Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
a2c92e60
Commit
a2c92e60
authored
12 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
swr: pass context to swri_get_dither()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f8a237a3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libswresample/dither.c
+3
-3
3 additions, 3 deletions
libswresample/dither.c
libswresample/swresample.c
+1
-1
1 addition, 1 deletion
libswresample/swresample.c
libswresample/swresample_internal.h
+1
-1
1 addition, 1 deletion
libswresample/swresample_internal.h
with
5 additions
and
5 deletions
libswresample/dither.c
+
3
−
3
View file @
a2c92e60
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#include
"libavutil/avassert.h"
#include
"libavutil/avassert.h"
#include
"swresample_internal.h"
#include
"swresample_internal.h"
void
swri_get_dither
(
void
*
dst
,
int
len
,
unsigned
seed
,
enum
AVSampleFormat
out_fmt
,
enum
AVSampleFormat
in_fmt
,
enum
SwrDitherType
method
)
{
void
swri_get_dither
(
SwrContext
*
s
,
void
*
dst
,
int
len
,
unsigned
seed
,
enum
AVSampleFormat
out_fmt
,
enum
AVSampleFormat
in_fmt
)
{
double
scale
=
0
;
double
scale
=
0
;
#define TMP_EXTRA 2
#define TMP_EXTRA 2
double
*
tmp
=
av_malloc
((
len
+
TMP_EXTRA
)
*
sizeof
(
double
));
double
*
tmp
=
av_malloc
((
len
+
TMP_EXTRA
)
*
sizeof
(
double
));
...
@@ -40,7 +40,7 @@ void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_
...
@@ -40,7 +40,7 @@ void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_
double
v
;
double
v
;
seed
=
seed
*
1664525
+
1013904223
;
seed
=
seed
*
1664525
+
1013904223
;
switch
(
method
){
switch
(
s
->
dither_
method
){
case
SWR_DITHER_RECTANGULAR
:
v
=
((
double
)
seed
)
/
UINT_MAX
-
0
.
5
;
break
;
case
SWR_DITHER_RECTANGULAR
:
v
=
((
double
)
seed
)
/
UINT_MAX
-
0
.
5
;
break
;
case
SWR_DITHER_TRIANGULAR
:
case
SWR_DITHER_TRIANGULAR
:
case
SWR_DITHER_TRIANGULAR_HIGHPASS
:
case
SWR_DITHER_TRIANGULAR_HIGHPASS
:
...
@@ -56,7 +56,7 @@ void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_
...
@@ -56,7 +56,7 @@ void swri_get_dither(void *dst, int len, unsigned seed, enum AVSampleFormat out_
for
(
i
=
0
;
i
<
len
;
i
++
){
for
(
i
=
0
;
i
<
len
;
i
++
){
double
v
;
double
v
;
switch
(
method
){
switch
(
s
->
dither_
method
){
case
SWR_DITHER_RECTANGULAR
:
case
SWR_DITHER_RECTANGULAR
:
case
SWR_DITHER_TRIANGULAR
:
case
SWR_DITHER_TRIANGULAR
:
v
=
tmp
[
i
];
v
=
tmp
[
i
];
...
...
This diff is collapsed.
Click to expand it.
libswresample/swresample.c
+
1
−
1
View file @
a2c92e60
...
@@ -527,7 +527,7 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
...
@@ -527,7 +527,7 @@ static int swr_convert_internal(struct SwrContext *s, AudioData *out, int out_co
return
ret
;
return
ret
;
if
(
ret
)
if
(
ret
)
for
(
ch
=
0
;
ch
<
s
->
dither
.
ch_count
;
ch
++
)
for
(
ch
=
0
;
ch
<
s
->
dither
.
ch_count
;
ch
++
)
swri_get_dither
(
s
->
dither
.
ch
[
ch
],
s
->
dither
.
count
,
12345678913579
<<
ch
,
s
->
out_sample_fmt
,
s
->
int_sample_fmt
,
s
->
dither_method
);
swri_get_dither
(
s
,
s
->
dither
.
ch
[
ch
],
s
->
dither
.
count
,
12345678913579
<<
ch
,
s
->
out_sample_fmt
,
s
->
int_sample_fmt
);
av_assert0
(
s
->
dither
.
ch_count
==
preout
->
ch_count
);
av_assert0
(
s
->
dither
.
ch_count
==
preout
->
ch_count
);
if
(
s
->
dither_pos
+
out_count
>
s
->
dither
.
count
)
if
(
s
->
dither_pos
+
out_count
>
s
->
dither
.
count
)
...
...
This diff is collapsed.
Click to expand it.
libswresample/swresample_internal.h
+
1
−
1
View file @
a2c92e60
...
@@ -94,6 +94,6 @@ int swri_rematrix_init(SwrContext *s);
...
@@ -94,6 +94,6 @@ int swri_rematrix_init(SwrContext *s);
int
swri_rematrix
(
SwrContext
*
s
,
AudioData
*
out
,
AudioData
*
in
,
int
len
,
int
mustcopy
);
int
swri_rematrix
(
SwrContext
*
s
,
AudioData
*
out
,
AudioData
*
in
,
int
len
,
int
mustcopy
);
void
swri_sum2
(
enum
AVSampleFormat
format
,
void
*
dst
,
const
void
*
src0
,
const
void
*
src1
,
float
coef0
,
float
coef1
,
int
len
);
void
swri_sum2
(
enum
AVSampleFormat
format
,
void
*
dst
,
const
void
*
src0
,
const
void
*
src1
,
float
coef0
,
float
coef1
,
int
len
);
void
swri_get_dither
(
void
*
dst
,
int
len
,
unsigned
seed
,
enum
AVSampleFormat
out_fmt
,
enum
AVSampleFormat
in_fmt
,
enum
SwrDitherType
type
);
void
swri_get_dither
(
SwrContext
*
s
,
void
*
dst
,
int
len
,
unsigned
seed
,
enum
AVSampleFormat
out_fmt
,
enum
AVSampleFormat
in_fmt
);
#endif
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment