Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e2b71846
Commit
e2b71846
authored
Jul 22, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swresample: Make rematrix maxvalue user settable
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
51691111
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
3 deletions
+14
-3
rematrix.c
libswresample/rematrix.c
+11
-2
swresample.c
libswresample/swresample.c
+1
-0
swresample_internal.h
libswresample/swresample_internal.h
+1
-0
version.h
libswresample/version.h
+1
-1
No files found.
libswresample/rematrix.c
View file @
e2b71846
...
...
@@ -120,6 +120,7 @@ av_cold static int auto_matrix(SwrContext *s)
double
maxcoef
=
0
;
char
buf
[
128
];
const
int
matrix_encoding
=
s
->
matrix_encoding
;
float
maxval
;
in_ch_layout
=
clean_layout
(
s
,
s
->
in_ch_layout
);
if
(
!
sane_layout
(
in_ch_layout
)){
...
...
@@ -304,8 +305,16 @@ av_cold static int auto_matrix(SwrContext *s)
if
(
s
->
rematrix_volume
<
0
)
maxcoef
=
-
s
->
rematrix_volume
;
if
((
av_get_packed_sample_fmt
(
s
->
out_sample_fmt
)
<
AV_SAMPLE_FMT_FLT
||
av_get_packed_sample_fmt
(
s
->
int_sample_fmt
)
<
AV_SAMPLE_FMT_FLT
)
&&
maxcoef
>
1
.
0
){
if
(
s
->
rematrix_maxval
>
0
)
{
maxval
=
s
->
rematrix_maxval
;
}
else
if
(
av_get_packed_sample_fmt
(
s
->
out_sample_fmt
)
<
AV_SAMPLE_FMT_FLT
||
av_get_packed_sample_fmt
(
s
->
int_sample_fmt
)
<
AV_SAMPLE_FMT_FLT
)
{
maxval
=
1
.
0
;
}
else
maxval
=
INT_MAX
;
if
(
maxcoef
>
maxval
){
maxcoef
/=
maxval
;
for
(
i
=
0
;
i
<
SWR_CH_MAX
;
i
++
)
for
(
j
=
0
;
j
<
SWR_CH_MAX
;
j
++
){
s
->
matrix
[
i
][
j
]
/=
maxcoef
;
...
...
libswresample/swresample.c
View file @
e2b71846
...
...
@@ -68,6 +68,7 @@ static const AVOption options[]={
{
"lfe_mix_level"
,
"set LFE mix level"
,
OFFSET
(
lfe_mix_level
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
},
-
32
,
32
,
PARAM
},
{
"rmvol"
,
"set rematrix volume"
,
OFFSET
(
rematrix_volume
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
.
0
},
-
1000
,
1000
,
PARAM
},
{
"rematrix_volume"
,
"set rematrix volume"
,
OFFSET
(
rematrix_volume
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
.
0
},
-
1000
,
1000
,
PARAM
},
{
"rematrix_maxval"
,
"set rematrix maxval"
,
OFFSET
(
rematrix_maxval
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
.
0
},
0
,
1000
,
PARAM
},
{
"flags"
,
"set flags"
,
OFFSET
(
flags
),
AV_OPT_TYPE_FLAGS
,
{.
i64
=
0
},
0
,
UINT_MAX
,
PARAM
,
"flags"
},
{
"swr_flags"
,
"set flags"
,
OFFSET
(
flags
),
AV_OPT_TYPE_FLAGS
,
{.
i64
=
0
},
0
,
UINT_MAX
,
PARAM
,
"flags"
},
...
...
libswresample/swresample_internal.h
View file @
e2b71846
...
...
@@ -82,6 +82,7 @@ struct SwrContext {
float
clev
;
///< center mixing level
float
lfe_mix_level
;
///< LFE mixing level
float
rematrix_volume
;
///< rematrixing volume coefficient
float
rematrix_maxval
;
///< maximum value for rematrixing output
enum
AVMatrixEncoding
matrix_encoding
;
/**< matrixed stereo encoding */
const
int
*
channel_map
;
///< channel index (or -1 if muted channel) map
int
used_ch_count
;
///< number of used input channels (mapped channel count if channel_map, otherwise in.ch_count)
...
...
libswresample/version.h
View file @
e2b71846
...
...
@@ -30,7 +30,7 @@
#define LIBSWRESAMPLE_VERSION_MAJOR 0
#define LIBSWRESAMPLE_VERSION_MINOR 17
#define LIBSWRESAMPLE_VERSION_MICRO 10
2
#define LIBSWRESAMPLE_VERSION_MICRO 10
3
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
LIBSWRESAMPLE_VERSION_MINOR, \
...
...
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