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
d765e073
Commit
d765e073
authored
Jun 06, 2015
by
Max Poliakovski
Committed by
Michael Niedermayer
Jun 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atrac3plus: add support for GHA phase inversion.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ac2dad96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
atrac3plus.c
libavcodec/atrac3plus.c
+1
-5
atrac3plusdsp.c
libavcodec/atrac3plusdsp.c
+8
-2
No files found.
libavcodec/atrac3plus.c
View file @
d765e073
...
@@ -1724,11 +1724,7 @@ static int decode_tones_info(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
...
@@ -1724,11 +1724,7 @@ static int decode_tones_info(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
if
(
num_channels
==
2
)
{
if
(
num_channels
==
2
)
{
get_subband_flags
(
gb
,
ctx
->
waves_info
->
tone_sharing
,
ctx
->
waves_info
->
num_tone_bands
);
get_subband_flags
(
gb
,
ctx
->
waves_info
->
tone_sharing
,
ctx
->
waves_info
->
num_tone_bands
);
get_subband_flags
(
gb
,
ctx
->
waves_info
->
tone_master
,
ctx
->
waves_info
->
num_tone_bands
);
get_subband_flags
(
gb
,
ctx
->
waves_info
->
tone_master
,
ctx
->
waves_info
->
num_tone_bands
);
if
(
get_subband_flags
(
gb
,
ctx
->
waves_info
->
phase_shift
,
get_subband_flags
(
gb
,
ctx
->
waves_info
->
phase_shift
,
ctx
->
waves_info
->
num_tone_bands
);
ctx
->
waves_info
->
num_tone_bands
))
{
avpriv_report_missing_feature
(
avctx
,
"GHA Phase shifting"
);
return
AVERROR_PATCHWELCOME
;
}
}
}
ctx
->
waves_info
->
tones_index
=
0
;
ctx
->
waves_info
->
tones_index
=
0
;
...
...
libavcodec/atrac3plusdsp.c
View file @
d765e073
...
@@ -116,6 +116,7 @@ av_cold void ff_atrac3p_init_wave_synth(void)
...
@@ -116,6 +116,7 @@ av_cold void ff_atrac3p_init_wave_synth(void)
* @param[in] synth_param ptr to common synthesis parameters
* @param[in] synth_param ptr to common synthesis parameters
* @param[in] waves_info parameters for each sine wave
* @param[in] waves_info parameters for each sine wave
* @param[in] envelope envelope data for all waves in a group
* @param[in] envelope envelope data for all waves in a group
* @param[in] fdsp ptr to floating-point DSP context
* @param[in] phase_shift flag indicates 180° phase shift
* @param[in] phase_shift flag indicates 180° phase shift
* @param[in] reg_offset region offset for trimming envelope data
* @param[in] reg_offset region offset for trimming envelope data
* @param[out] out receives sythesized data
* @param[out] out receives sythesized data
...
@@ -123,6 +124,7 @@ av_cold void ff_atrac3p_init_wave_synth(void)
...
@@ -123,6 +124,7 @@ av_cold void ff_atrac3p_init_wave_synth(void)
static
void
waves_synth
(
Atrac3pWaveSynthParams
*
synth_param
,
static
void
waves_synth
(
Atrac3pWaveSynthParams
*
synth_param
,
Atrac3pWavesData
*
waves_info
,
Atrac3pWavesData
*
waves_info
,
Atrac3pWaveEnvelope
*
envelope
,
Atrac3pWaveEnvelope
*
envelope
,
AVFloatDSPContext
*
fdsp
,
int
phase_shift
,
int
reg_offset
,
float
*
out
)
int
phase_shift
,
int
reg_offset
,
float
*
out
)
{
{
int
i
,
wn
,
inc
,
pos
;
int
i
,
wn
,
inc
,
pos
;
...
@@ -146,6 +148,10 @@ static void waves_synth(Atrac3pWaveSynthParams *synth_param,
...
@@ -146,6 +148,10 @@ static void waves_synth(Atrac3pWaveSynthParams *synth_param,
}
}
}
}
/* 180° phase shift if requested */
if
(
phase_shift
)
fdsp
->
vector_fmul_scalar
(
out
,
out
,
-
1
.
0
f
,
128
);
/* fade in with steep Hann window if requested */
/* fade in with steep Hann window if requested */
if
(
envelope
->
has_start_point
)
{
if
(
envelope
->
has_start_point
)
{
pos
=
(
envelope
->
start_pos
<<
2
)
-
reg_offset
;
pos
=
(
envelope
->
start_pos
<<
2
)
-
reg_offset
;
...
@@ -216,11 +222,11 @@ void ff_atrac3p_generate_tones(Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *f
...
@@ -216,11 +222,11 @@ void ff_atrac3p_generate_tones(Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *f
/* synthesize waves for both overlapping regions */
/* synthesize waves for both overlapping regions */
if
(
tones_now
->
num_wavs
&&
reg1_env_nonzero
)
if
(
tones_now
->
num_wavs
&&
reg1_env_nonzero
)
waves_synth
(
ch_unit
->
waves_info_prev
,
tones_now
,
&
tones_now
->
curr_env
,
waves_synth
(
ch_unit
->
waves_info_prev
,
tones_now
,
&
tones_now
->
curr_env
,
ch_unit
->
waves_info_prev
->
phase_shift
[
sb
]
&
ch_num
,
fdsp
,
ch_unit
->
waves_info_prev
->
phase_shift
[
sb
]
&
ch_num
,
128
,
wavreg1
);
128
,
wavreg1
);
if
(
tones_next
->
num_wavs
&&
reg2_env_nonzero
)
if
(
tones_next
->
num_wavs
&&
reg2_env_nonzero
)
waves_synth
(
ch_unit
->
waves_info
,
tones_next
,
&
tones_next
->
curr_env
,
waves_synth
(
ch_unit
->
waves_info
,
tones_next
,
&
tones_next
->
curr_env
,
fdsp
,
ch_unit
->
waves_info
->
phase_shift
[
sb
]
&
ch_num
,
0
,
wavreg2
);
ch_unit
->
waves_info
->
phase_shift
[
sb
]
&
ch_num
,
0
,
wavreg2
);
/* Hann windowing for non-faded wave signals */
/* Hann windowing for non-faded wave signals */
...
...
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