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
16bbb8df
Commit
16bbb8df
authored
Jun 26, 2009
by
Vladimir Voroshilov
Committed by
Michael Niedermayer
Sep 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace pitch_delay_int with array
parent
bfbfe56f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
g729dec.c
libavcodec/g729dec.c
+6
-6
No files found.
libavcodec/g729dec.c
View file @
16bbb8df
...
@@ -380,7 +380,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -380,7 +380,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
uint8_t
quantizer_2nd_lo
;
///< second stage lower vector of quantizer (size in bits)
uint8_t
quantizer_2nd_lo
;
///< second stage lower vector of quantizer (size in bits)
uint8_t
quantizer_2nd_hi
;
///< second stage higher vector of quantizer (size in bits)
uint8_t
quantizer_2nd_hi
;
///< second stage higher vector of quantizer (size in bits)
int
pitch_delay_int
;
// pitch delay, integer part
int
pitch_delay_int
[
2
];
// pitch delay, integer part
int
pitch_delay_3x
;
// pitch delay, multiplied by 3
int
pitch_delay_3x
;
// pitch delay, multiplied by 3
int16_t
fc
[
SUBFRAME_SIZE
];
// fixed-codebook vector
int16_t
fc
[
SUBFRAME_SIZE
];
// fixed-codebook vector
int16_t
synth
[
SUBFRAME_SIZE
+
10
];
// fixed-codebook vector
int16_t
synth
[
SUBFRAME_SIZE
+
10
];
// fixed-codebook vector
...
@@ -475,7 +475,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -475,7 +475,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
}
}
/* Round pitch delay to nearest (used everywhere except ff_acelp_interpolate). */
/* Round pitch delay to nearest (used everywhere except ff_acelp_interpolate). */
pitch_delay_int
=
(
pitch_delay_3x
+
1
)
/
3
;
pitch_delay_int
[
i
]
=
(
pitch_delay_3x
+
1
)
/
3
;
if
(
frame_erasure
)
{
if
(
frame_erasure
)
{
ctx
->
rand_value
=
g729_prng
(
ctx
->
rand_value
);
ctx
->
rand_value
=
g729_prng
(
ctx
->
rand_value
);
...
@@ -508,12 +508,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -508,12 +508,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
fc_v[i] = <
fc_v[i] = <
\ fc_v[i] + gain_pitch * fc_v[i-pitch_delay], i >= pitch_delay
\ fc_v[i] + gain_pitch * fc_v[i-pitch_delay], i >= pitch_delay
*/
*/
ff_acelp_weighted_vector_sum
(
fc
+
pitch_delay_int
,
ff_acelp_weighted_vector_sum
(
fc
+
pitch_delay_int
[
i
]
,
fc
+
pitch_delay_int
,
fc
+
pitch_delay_int
[
i
]
,
fc
,
1
<<
14
,
fc
,
1
<<
14
,
av_clip
(
ctx
->
past_gain_pitch
[
0
],
SHARP_MIN
,
SHARP_MAX
),
av_clip
(
ctx
->
past_gain_pitch
[
0
],
SHARP_MIN
,
SHARP_MAX
),
0
,
14
,
0
,
14
,
SUBFRAME_SIZE
-
pitch_delay_int
);
SUBFRAME_SIZE
-
pitch_delay_int
[
i
]
);
memmove
(
ctx
->
past_gain_pitch
+
1
,
ctx
->
past_gain_pitch
,
5
*
sizeof
(
int16_t
));
memmove
(
ctx
->
past_gain_pitch
+
1
,
ctx
->
past_gain_pitch
,
5
*
sizeof
(
int16_t
));
ctx
->
past_gain_code
[
1
]
=
ctx
->
past_gain_code
[
0
];
ctx
->
past_gain_code
[
1
]
=
ctx
->
past_gain_code
[
0
];
...
@@ -628,7 +628,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -628,7 +628,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
if
(
frame_erasure
)
if
(
frame_erasure
)
ctx
->
pitch_delay_int_prev
=
FFMIN
(
ctx
->
pitch_delay_int_prev
+
1
,
PITCH_DELAY_MAX
);
ctx
->
pitch_delay_int_prev
=
FFMIN
(
ctx
->
pitch_delay_int_prev
+
1
,
PITCH_DELAY_MAX
);
else
else
ctx
->
pitch_delay_int_prev
=
pitch_delay_int
;
ctx
->
pitch_delay_int_prev
=
pitch_delay_int
[
i
]
;
memcpy
(
synth
+
8
,
ctx
->
hpf_z
,
2
*
sizeof
(
int16_t
));
memcpy
(
synth
+
8
,
ctx
->
hpf_z
,
2
*
sizeof
(
int16_t
));
ff_acelp_high_pass_filter
(
ff_acelp_high_pass_filter
(
...
...
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