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
8c19732a
Commit
8c19732a
authored
Aug 10, 2016
by
Burt P
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
af_hdcd: add AVOption to set the CDT period
Signed-off-by:
Burt P
<
pburt0@gmail.com
>
parent
400e2acd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
af_hdcd.c
libavfilter/af_hdcd.c
+9
-3
No files found.
libavfilter/af_hdcd.c
View file @
8c19732a
...
...
@@ -917,6 +917,8 @@ typedef struct HDCDContext {
* process. See docs or HDCD_ANA_* defines. */
int
analyze_mode
;
int
ana_snb
;
/**< used in tone generation */
int
cdt_ms
;
/**< code detect timer period in ms */
/* end AVOption members */
/** config_input() and config_output() scan links for any resampling
...
...
@@ -941,6 +943,8 @@ typedef struct HDCDContext {
static
const
AVOption
hdcd_options
[]
=
{
{
"process_stereo"
,
"Process stereo channels together. Only apply target_gain when both channels match."
,
OFFSET
(
process_stereo
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
HDCD_PROCESS_STEREO_DEFAULT
},
0
,
1
,
A
},
{
"cdt_ms"
,
"Code detect timer period in ms."
,
OFFSET
(
cdt_ms
),
AV_OPT_TYPE_INT
,
{
.
i64
=
2000
},
100
,
60000
,
A
},
{
"force_pe"
,
"Always extend peaks above -3dBFS even when PE is not signaled."
,
OFFSET
(
force_pe
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
A
},
{
"analyze_mode"
,
"Replace audio with solid tone and signal some processing aspect in the amplitude."
,
...
...
@@ -957,7 +961,7 @@ AVFILTER_DEFINE_CLASS(hdcd);
#define APPLY_GAIN(s,g) do{int64_t s64 = s; s64 *= gaintab[g]; s = (int32_t)(s64 >> 23); }while(0);
static
void
hdcd_reset
(
hdcd_state_t
*
state
,
unsigned
rate
)
static
void
hdcd_reset
(
hdcd_state_t
*
state
,
unsigned
rate
,
unsigned
cdt_ms
)
{
int
i
;
...
...
@@ -969,7 +973,7 @@ static void hdcd_reset(hdcd_state_t *state, unsigned rate)
state
->
running_gain
=
0
;
state
->
sustain
=
0
;
state
->
sustain_reset
=
rate
*
1
0
;
state
->
sustain_reset
=
cdt_ms
*
rate
/
100
0
;
state
->
code_counterA
=
0
;
state
->
code_counterA_almost
=
0
;
...
...
@@ -1705,9 +1709,11 @@ static av_cold int init(AVFilterContext *ctx)
s
->
bad_config
=
0
;
for
(
c
=
0
;
c
<
HDCD_MAX_CHANNELS
;
c
++
)
{
hdcd_reset
(
&
s
->
state
[
c
],
44100
);
hdcd_reset
(
&
s
->
state
[
c
],
44100
,
s
->
cdt_ms
);
}
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"CDT period: %dms (%d samples @44100Hz)
\n
"
,
s
->
cdt_ms
,
s
->
cdt_ms
*
44100
/
1000
);
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"Process mode: %s
\n
"
,
(
s
->
process_stereo
)
?
"process stereo channels together"
:
"process each channel separately"
);
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"Force PE: %s
\n
"
,
...
...
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