Mercurial > libavcodec.hg
comparison aac.c @ 8006:c7c1e85d14bc libavcodec
Rename variables to clarify the channel coupling element and corresponding
target channel element.
Patch by Alex Converse (alex converse gmail com)
author | superdump |
---|---|
date | Mon, 06 Oct 2008 16:22:11 +0000 |
parents | 8fd8f23be794 |
children | e70975d5ff80 |
comparison
equal
deleted
inserted
replaced
8005:43fabceb40f2 | 8006:c7c1e85d14bc |
---|---|
1245 /** | 1245 /** |
1246 * Apply dependent channel coupling (applied before IMDCT). | 1246 * Apply dependent channel coupling (applied before IMDCT). |
1247 * | 1247 * |
1248 * @param index index into coupling gain array | 1248 * @param index index into coupling gain array |
1249 */ | 1249 */ |
1250 static void apply_dependent_coupling(AACContext * ac, SingleChannelElement * sce, ChannelElement * cc, int index) { | 1250 static void apply_dependent_coupling(AACContext * ac, SingleChannelElement * target, ChannelElement * cce, int index) { |
1251 IndividualChannelStream * ics = &cc->ch[0].ics; | 1251 IndividualChannelStream * ics = &cce->ch[0].ics; |
1252 const uint16_t * offsets = ics->swb_offset; | 1252 const uint16_t * offsets = ics->swb_offset; |
1253 float * dest = sce->coeffs; | 1253 float * dest = target->coeffs; |
1254 const float * src = cc->ch[0].coeffs; | 1254 const float * src = cce->ch[0].coeffs; |
1255 int g, i, group, k, idx = 0; | 1255 int g, i, group, k, idx = 0; |
1256 if(ac->m4ac.object_type == AOT_AAC_LTP) { | 1256 if(ac->m4ac.object_type == AOT_AAC_LTP) { |
1257 av_log(ac->avccontext, AV_LOG_ERROR, | 1257 av_log(ac->avccontext, AV_LOG_ERROR, |
1258 "Dependent coupling is not supported together with LTP\n"); | 1258 "Dependent coupling is not supported together with LTP\n"); |
1259 return; | 1259 return; |
1260 } | 1260 } |
1261 for (g = 0; g < ics->num_window_groups; g++) { | 1261 for (g = 0; g < ics->num_window_groups; g++) { |
1262 for (i = 0; i < ics->max_sfb; i++, idx++) { | 1262 for (i = 0; i < ics->max_sfb; i++, idx++) { |
1263 if (cc->ch[0].band_type[idx] != ZERO_BT) { | 1263 if (cce->ch[0].band_type[idx] != ZERO_BT) { |
1264 for (group = 0; group < ics->group_len[g]; group++) { | 1264 for (group = 0; group < ics->group_len[g]; group++) { |
1265 for (k = offsets[i]; k < offsets[i+1]; k++) { | 1265 for (k = offsets[i]; k < offsets[i+1]; k++) { |
1266 // XXX dsputil-ize | 1266 // XXX dsputil-ize |
1267 dest[group*128+k] += cc->coup.gain[index][idx] * src[group*128+k]; | 1267 dest[group*128+k] += cce->coup.gain[index][idx] * src[group*128+k]; |
1268 } | 1268 } |
1269 } | 1269 } |
1270 } | 1270 } |
1271 } | 1271 } |
1272 dest += ics->group_len[g]*128; | 1272 dest += ics->group_len[g]*128; |
1277 /** | 1277 /** |
1278 * Apply independent channel coupling (applied after IMDCT). | 1278 * Apply independent channel coupling (applied after IMDCT). |
1279 * | 1279 * |
1280 * @param index index into coupling gain array | 1280 * @param index index into coupling gain array |
1281 */ | 1281 */ |
1282 static void apply_independent_coupling(AACContext * ac, SingleChannelElement * sce, ChannelElement * cc, int index) { | 1282 static void apply_independent_coupling(AACContext * ac, SingleChannelElement * target, ChannelElement * cce, int index) { |
1283 int i; | 1283 int i; |
1284 for (i = 0; i < 1024; i++) | 1284 for (i = 0; i < 1024; i++) |
1285 sce->ret[i] += cc->coup.gain[index][0] * (cc->ch[0].ret[i] - ac->add_bias); | 1285 target->ret[i] += cce->coup.gain[index][0] * (cce->ch[0].ret[i] - ac->add_bias); |
1286 } | 1286 } |
1287 | 1287 |
1288 /** | 1288 /** |
1289 * channel coupling transformation interface | 1289 * channel coupling transformation interface |
1290 * | 1290 * |
1291 * @param index index into coupling gain array | 1291 * @param index index into coupling gain array |
1292 * @param apply_coupling_method pointer to (in)dependent coupling function | 1292 * @param apply_coupling_method pointer to (in)dependent coupling function |
1293 */ | 1293 */ |
1294 static void apply_channel_coupling(AACContext * ac, ChannelElement * cc, | 1294 static void apply_channel_coupling(AACContext * ac, ChannelElement * cc, |
1295 enum RawDataBlockType type, int elem_id, enum CouplingPoint coupling_point, | 1295 enum RawDataBlockType type, int elem_id, enum CouplingPoint coupling_point, |
1296 void (*apply_coupling_method)(AACContext * ac, SingleChannelElement * sce, ChannelElement * cc, int index)) | 1296 void (*apply_coupling_method)(AACContext * ac, SingleChannelElement * target, ChannelElement * cce, int index)) |
1297 { | 1297 { |
1298 int i, c; | 1298 int i, c; |
1299 | 1299 |
1300 for (i = 0; i < MAX_ELEM_ID; i++) { | 1300 for (i = 0; i < MAX_ELEM_ID; i++) { |
1301 ChannelElement *cce = ac->che[TYPE_CCE][i]; | 1301 ChannelElement *cce = ac->che[TYPE_CCE][i]; |