comparison g729dec.c @ 9852:af3cc583501e libavcodec

Replace MAX_SUBFRAME_SIZE and ctx->subframe_size with SUBFRAME_SIZE, since subframe length is the same in all G.729 modes.
author voroshil
date Sun, 14 Jun 2009 02:29:39 +0000
parents 7679262f1459
children ae38e13a63d6
comparison
equal deleted inserted replaced
9851:e0fe929c5dc4 9852:af3cc583501e
105 ff_acelp_weighted_vector_sum(fc + pitch_delay_int[i], 105 ff_acelp_weighted_vector_sum(fc + pitch_delay_int[i],
106 fc + pitch_delay_int[i], 106 fc + pitch_delay_int[i],
107 fc, 1 << 14, 107 fc, 1 << 14,
108 av_clip(ctx->gain_pitch, SHARP_MIN, SHARP_MAX), 108 av_clip(ctx->gain_pitch, SHARP_MIN, SHARP_MAX),
109 0, 14, 109 0, 14,
110 ctx->subframe_size - pitch_delay_int[i]); 110 SUBFRAME_SIZE - pitch_delay_int[i]);
111 111
112 if (ctx->frame_erasure) { 112 if (ctx->frame_erasure) {
113 ctx->gain_pitch = (29491 * ctx->gain_pitch) >> 15; // 0.90 (0.15) 113 ctx->gain_pitch = (29491 * ctx->gain_pitch) >> 15; // 0.90 (0.15)
114 ctx->gain_code = ( 2007 * ctx->gain_code ) >> 11; // 0.98 (0.11) 114 ctx->gain_code = ( 2007 * ctx->gain_code ) >> 11; // 0.98 (0.11)
115 115
118 ctx->gain_pitch = cb_gain_1st_8k[parm->gc_1st_index[i]][0] + 118 ctx->gain_pitch = cb_gain_1st_8k[parm->gc_1st_index[i]][0] +
119 cb_gain_2nd_8k[parm->gc_2nd_index[i]][0]; 119 cb_gain_2nd_8k[parm->gc_2nd_index[i]][0];
120 gain_corr_factor = cb_gain_1st_8k[parm->gc_1st_index[i]][1] + 120 gain_corr_factor = cb_gain_1st_8k[parm->gc_1st_index[i]][1] +
121 cb_gain_2nd_8k[parm->gc_2nd_index[i]][1]; 121 cb_gain_2nd_8k[parm->gc_2nd_index[i]][1];
122 122
123 ff_acelp_weighted_vector_sum(ctx->exc + i * ctx->subframe_size, 123 ff_acelp_weighted_vector_sum(ctx->exc + i * SUBFRAME_SIZE,
124 ctx->exc + i * ctx->subframe_size, fc, 124 ctx->exc + i * SUBFRAME_SIZE, fc,
125 (!voicing && ctx->frame_erasure) ? 0 : ctx->gain_pitch, 125 (!voicing && ctx->frame_erasure) ? 0 : ctx->gain_pitch,
126 ( voicing && ctx->frame_erasure) ? 0 : ctx->gain_code, 126 ( voicing && ctx->frame_erasure) ? 0 : ctx->gain_code,
127 1<<13, 14, ctx->subframe_size); 127 1 << 13, 14, SUBFRAME_SIZE);
128 128
129 if (buf_size < packed_frame_size) { 129 if (buf_size < packed_frame_size) {
130 av_log(avctx, AV_LOG_ERROR, "Error processing packet: packet size too small\n"); 130 av_log(avctx, AV_LOG_ERROR, "Error processing packet: packet size too small\n");
131 return AVERROR(EIO); 131 return AVERROR(EIO);
132 } 132 }