[FFmpeg-soc] [soc]: r2434 - in aacenc: aacenc.c aacpsy.c aacpsy.h
kostya
subversion at mplayerhq.hu
Sat Jun 14 13:39:37 CEST 2008
Author: kostya
Date: Sat Jun 14 13:39:36 2008
New Revision: 2434
Log:
Prepare decoder for future '8 short windows' mode support
Modified:
aacenc/aacenc.c
aacenc/aacpsy.c
aacenc/aacpsy.h
Modified: aacenc/aacenc.c
==============================================================================
--- aacenc/aacenc.c (original)
+++ aacenc/aacenc.c Sat Jun 14 13:39:36 2008
@@ -388,9 +388,9 @@ static void encode_scale_factor_data(AVC
int i;
for(i = 0; i < cpe->ch[channel].ics.max_sfb; i++){
- if(!cpe->ch[channel].zeroes[i]){
- diff = cpe->ch[channel].sf_idx[i] - off + SCALE_DIFF_ZERO;
- off = cpe->ch[channel].sf_idx[i];
+ if(!cpe->ch[channel].zeroes[0][i]){
+ diff = cpe->ch[channel].sf_idx[0][i] - off + SCALE_DIFF_ZERO;
+ off = cpe->ch[channel].sf_idx[0][i];
put_bits(&s->pb, bits[diff], code[diff]);
}
}
@@ -401,7 +401,7 @@ static void encode_spectral_data(AVCodec
int start = 0, i;
for(i = 0; i < cpe->ch[channel].ics.max_sfb; i++){
- if(!cpe->ch[channel].zeroes[i])
+ if(!cpe->ch[channel].zeroes[0][i])
encode_codebook(s, cpe, channel, start, s->swb_sizes[i], cpe->ch[channel].cb[0][i]);
start += s->swb_sizes[i];
}
@@ -417,9 +417,9 @@ static int encode_individual_channel(AVC
i = 0;
while(i < 1024){
- if(!cpe->ch[channel].zeroes[g]){
+ if(!cpe->ch[channel].zeroes[0][g]){
cpe->ch[channel].cb[0][g] = determine_section_info(s, cpe, channel, g, i, s->swb_sizes[g]);
- cpe->ch[channel].zeroes[g] = !cpe->ch[channel].cb[0][g];
+ cpe->ch[channel].zeroes[0][g] = !cpe->ch[channel].cb[0][g];
}else
cpe->ch[channel].cb[0][g] = 0;
i += s->swb_sizes[g];
Modified: aacenc/aacpsy.c
==============================================================================
--- aacenc/aacpsy.c (original)
+++ aacenc/aacpsy.c Sat Jun 14 13:39:36 2008
@@ -68,7 +68,7 @@ static void psy_null_process(AACPsyConte
cpe->ch[ch].gain = SCALE_ONE_POS;
for(g = 0; g < apc->num_bands; g++){
sum = 0;
- cpe->ch[ch].sf_idx[g] = SCALE_ONE_POS;
+ cpe->ch[ch].sf_idx[0][g] = SCALE_ONE_POS;
//apply M/S
if(!ch && cpe->ms.mask[0][g]){
for(i = 0; i < apc->bands[g]; i++){
@@ -77,13 +77,13 @@ static void psy_null_process(AACPsyConte
}
}
for(i = 0; i < apc->bands[g]; i++){
- cpe->ch[ch].icoefs[start+i] = av_clip((int)(roundf(cpe->ch[ch].coeffs[start+i] / pow2sf_tab[cpe->ch[ch].sf_idx[g]+60])), -8191, 8191);
+ cpe->ch[ch].icoefs[start+i] = av_clip((int)(roundf(cpe->ch[ch].coeffs[start+i] / pow2sf_tab[cpe->ch[ch].sf_idx[0][g]+60])), -8191, 8191);
sum += !!cpe->ch[ch].icoefs[start+i];
}
- cpe->ch[ch].zeroes[g] = !sum;
+ cpe->ch[ch].zeroes[0][g] = !sum;
start += apc->bands[g];
}
- for(maxsfb = apc->num_bands; maxsfb > 0 && cpe->ch[ch].zeroes[maxsfb-1]; maxsfb--);
+ for(maxsfb = apc->num_bands; maxsfb > 0 && cpe->ch[ch].zeroes[0][maxsfb-1]; maxsfb--);
cpe->ch[ch].ics.max_sfb = maxsfb;
}
if(apc->avctx->channels > 1 && cpe->common_window){
Modified: aacenc/aacpsy.h
==============================================================================
--- aacenc/aacpsy.h (original)
+++ aacenc/aacpsy.h Sat Jun 14 13:39:36 2008
@@ -69,8 +69,8 @@ typedef struct {
* Thus, when used inside CPE elements, both channels must have equal gain.
*/
ics_struct ics;
- int zeroes[64];
- int sf_idx[64];
+ int zeroes[8][64];
+ int sf_idx[8][64];
int cb[8][64]; ///< Codebooks
float sf[8][64]; ///< Scalefactors
DECLARE_ALIGNED_16(float, coeffs[1024]); ///< Coefficients for IMDCT
More information about the FFmpeg-soc
mailing list