diff options
author | Vladimir Voroshilov <voroshil@gmail.com> | 2009-06-26 09:26:56 +0700 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-24 21:11:01 +0200 |
commit | 16bbb8dfeab0d0ace5a066b7810cdf170d8739fd (patch) | |
tree | 3c4dbd6c273db02e3f312ea58fab6ab66c965473 /libavcodec/g729dec.c | |
parent | bfbfe56f944960ecf2599e9d3ca9340bf867543a (diff) | |
download | ffmpeg-16bbb8dfeab0d0ace5a066b7810cdf170d8739fd.tar.gz |
Replace pitch_delay_int with array
Diffstat (limited to 'libavcodec/g729dec.c')
-rw-r--r-- | libavcodec/g729dec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c index 0c6fffaaa4..b20d3d25c7 100644 --- a/libavcodec/g729dec.c +++ b/libavcodec/g729dec.c @@ -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_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 int16_t fc[SUBFRAME_SIZE]; // 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, } /* 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) { ctx->rand_value = g729_prng(ctx->rand_value); @@ -508,12 +508,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, fc_v[i] = < \ fc_v[i] + gain_pitch * fc_v[i-pitch_delay], i >= pitch_delay */ - ff_acelp_weighted_vector_sum(fc + pitch_delay_int, - fc + pitch_delay_int, + ff_acelp_weighted_vector_sum(fc + pitch_delay_int[i], + fc + pitch_delay_int[i], fc, 1 << 14, av_clip(ctx->past_gain_pitch[0], SHARP_MIN, SHARP_MAX), 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)); 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, if (frame_erasure) ctx->pitch_delay_int_prev = FFMIN(ctx->pitch_delay_int_prev + 1, PITCH_DELAY_MAX); 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)); ff_acelp_high_pass_filter( |