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
30b2611e
Commit
30b2611e
authored
Aug 18, 2016
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swresample: Skip over dither steps if dithering scale is 0
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
946acacd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
1 deletion
+9
-1
dither.c
libswresample/dither.c
+5
-0
options.c
libswresample/options.c
+1
-1
swresample.c
libswresample/swresample.c
+2
-0
swresample_internal.h
libswresample/swresample_internal.h
+1
-0
No files found.
libswresample/dither.c
View file @
30b2611e
...
...
@@ -102,6 +102,11 @@ av_cold int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AV
if
(
out_fmt
==
AV_SAMPLE_FMT_S32
&&
s
->
dither
.
output_sample_bits
)
scale
*=
1
<<
(
32
-
s
->
dither
.
output_sample_bits
);
if
(
scale
==
0
)
{
s
->
dither
.
method
=
0
;
return
0
;
}
s
->
dither
.
ns_pos
=
0
;
s
->
dither
.
noise_scale
=
scale
;
s
->
dither
.
ns_scale
=
scale
;
...
...
libswresample/options.c
View file @
30b2611e
...
...
@@ -70,7 +70,7 @@ static const AVOption options[]={
{
"dither_scale"
,
"set dither scale"
,
OFFSET
(
dither
.
scale
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
INT_MAX
,
PARAM
},
{
"dither_method"
,
"set dither method"
,
OFFSET
(
dither
.
method
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_DITHER_NB
-
1
,
PARAM
,
"dither_method"
},
{
"dither_method"
,
"set dither method"
,
OFFSET
(
user_dither_method
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_DITHER_NB
-
1
,
PARAM
,
"dither_method"
},
{
"rectangular"
,
"select rectangular dither"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
SWR_DITHER_RECTANGULAR
},
INT_MIN
,
INT_MAX
,
PARAM
,
"dither_method"
},
{
"triangular"
,
"select triangular dither"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
SWR_DITHER_TRIANGULAR
},
INT_MIN
,
INT_MAX
,
PARAM
,
"dither_method"
},
{
"triangular_hp"
,
"select triangular dither with high pass"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
SWR_DITHER_TRIANGULAR_HIGHPASS
},
INT_MIN
,
INT_MAX
,
PARAM
,
"dither_method"
},
...
...
libswresample/swresample.c
View file @
30b2611e
...
...
@@ -176,6 +176,8 @@ av_cold int swr_init(struct SwrContext *s){
s
->
int_sample_fmt
=
s
->
user_int_sample_fmt
;
s
->
dither
.
method
=
s
->
user_dither_method
;
if
(
av_get_channel_layout_nb_channels
(
s
->
in_ch_layout
)
>
SWR_CH_MAX
)
{
av_log
(
s
,
AV_LOG_WARNING
,
"Input channel layout 0x%"
PRIx64
" is invalid or unsupported.
\n
"
,
s
->
in_ch_layout
);
s
->
in_ch_layout
=
0
;
...
...
libswresample/swresample_internal.h
View file @
30b2611e
...
...
@@ -120,6 +120,7 @@ struct SwrContext {
int64_t
user_in_ch_layout
;
///< User set input channel layout
int64_t
user_out_ch_layout
;
///< User set output channel layout
enum
AVSampleFormat
user_int_sample_fmt
;
///< User set internal sample format
int
user_dither_method
;
///< User set dither method
struct
DitherContext
dither
;
...
...
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