comparison g729dec.c @ 7780:b35486af268e libavcodec

Another set of approved G.729 chunks (from decoder core)
author voroshil
date Wed, 03 Sep 2008 01:07:03 +0000
parents 272a13ae94c0
children ca4a5c6c275c
comparison
equal deleted inserted replaced
7779:5b54bcbae698 7780:b35486af268e
77 static inline int g729_get_parity(uint8_t value) 77 static inline int g729_get_parity(uint8_t value)
78 { 78 {
79 return (0x6996966996696996ULL >> (value >> 2)) & 1; 79 return (0x6996966996696996ULL >> (value >> 2)) & 1;
80 } 80 }
81 81
82 /*
83 This filter enhances harmonic components of the fixed-codebook vector to
84 improve the quality of the reconstructed speech.
85
86 / fc_v[i], i < pitch_delay
87 fc_v[i] = <
88 \ fc_v[i] + gain_pitch * fc_v[i-pitch_delay], i >= pitch_delay
89 */
90 ff_acelp_weighted_vector_sum(
91 fc + pitch_delay_int[i],
92 fc + pitch_delay_int[i],
93 fc,
94 1 << 14,
95 av_clip(ctx->gain_pitch, SHARP_MIN, SHARP_MAX),
96 0,
97 14,
98 ctx->subframe_size - pitch_delay_int[i]);
99
100 ctx->gain_pitch = cb_gain_1st_8k[parm->gc_1st_index[i]][0] +
101 cb_gain_2nd_8k[parm->gc_2nd_index[i]][0];
102 gain_corr_factor = cb_gain_1st_8k[parm->gc_1st_index[i]][1] +
103 cb_gain_2nd_8k[parm->gc_2nd_index[i]][1];
104
105 /* Routine requires rounding to lowest. */
106 ff_acelp_interpolate(
107 ctx->exc + i*ctx->subframe_size,
108 ctx->exc + i*ctx->subframe_size - pitch_delay_3x/3,
109 ff_acelp_interp_filter,
110 6,
111 (pitch_delay_3x%3)<<1,
112 10,
113 ctx->subframe_size);
114
115 ff_acelp_weighted_vector_sum(
116 ctx->exc + i * ctx->subframe_size,
117 ctx->exc + i * ctx->subframe_size,
118 fc,
119 (!voicing && ctx->frame_erasure) ? 0 : ctx->gain_pitch,
120 ( voicing && ctx->frame_erasure) ? 0 : ctx->gain_code,
121 1<<13,
122 14,
123 ctx->subframe_size);
124
82 AVCodec g729_decoder = 125 AVCodec g729_decoder =
83 { 126 {
84 "g729", 127 "g729",
85 CODEC_TYPE_AUDIO, 128 CODEC_TYPE_AUDIO,
86 CODEC_ID_G729, 129 CODEC_ID_G729,