Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
c1d404b9
Commit
c1d404b9
authored
Apr 11, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr: add a dither_scale parameter to tune the amplitude of the dither.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a2c92e60
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
dither.c
libswresample/dither.c
+2
-0
swresample.c
libswresample/swresample.c
+2
-1
swresample_internal.h
libswresample/swresample_internal.h
+1
-0
No files found.
libswresample/dither.c
View file @
c1d404b9
...
...
@@ -36,6 +36,8 @@ void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSa
if
(
in_fmt
==
AV_SAMPLE_FMT_S32
&&
out_fmt
==
AV_SAMPLE_FMT_U8
)
scale
=
1L
<<
24
;
if
(
in_fmt
==
AV_SAMPLE_FMT_S16
&&
out_fmt
==
AV_SAMPLE_FMT_U8
)
scale
=
1L
<<
8
;
scale
*=
s
->
dither_scale
;
for
(
i
=
0
;
i
<
len
+
TMP_EXTRA
;
i
++
){
double
v
;
seed
=
seed
*
1664525
+
1013904223
;
...
...
libswresample/swresample.c
View file @
c1d404b9
...
...
@@ -53,7 +53,8 @@ static const AVOption options[]={
{
"rmvol"
,
"rematrix volume"
,
OFFSET
(
rematrix_volume
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
.
0
},
-
1000
,
1000
,
0
},
{
"flags"
,
NULL
,
OFFSET
(
flags
)
,
AV_OPT_TYPE_FLAGS
,
{.
dbl
=
0
},
0
,
UINT_MAX
,
0
,
"flags"
},
{
"res"
,
"force resampling"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
SWR_FLAG_RESAMPLE
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"dither"
,
"dither method"
,
OFFSET
(
dither_method
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
SWR_DITHER_NB
-
1
,
0
,
"dither_method"
},
{
"dither_scale"
,
"dither scale"
,
OFFSET
(
dither_scale
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
INT_MAX
,
0
},
{
"dither_method"
,
"dither method"
,
OFFSET
(
dither_method
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
SWR_DITHER_NB
-
1
,
0
,
"dither_method"
},
{
"rectangular"
,
"rectangular dither"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
SWR_DITHER_RECTANGULAR
},
INT_MIN
,
INT_MAX
,
0
,
"dither_method"
},
{
"triangular"
,
"triangular dither"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
SWR_DITHER_TRIANGULAR
},
INT_MIN
,
INT_MAX
,
0
,
"dither_method"
},
{
"triangular_hp"
,
"triangular dither with high pass"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
SWR_DITHER_TRIANGULAR_HIGHPASS
},
INT_MIN
,
INT_MAX
,
0
,
"dither_method"
},
...
...
libswresample/swresample_internal.h
View file @
c1d404b9
...
...
@@ -51,6 +51,7 @@ struct SwrContext {
int
used_ch_count
;
///< number of used input channels (mapped channel count if channel_map, otherwise in.ch_count)
enum
SwrDitherType
dither_method
;
int
dither_pos
;
float
dither_scale
;
int
int_bps
;
///< internal bytes per sample
int
resample_first
;
///< 1 if resampling must come first, 0 if rematrixing
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment