Ignore:
Timestamp:
05/04/07 14:10:51 (17 years ago)
Author:
r2d
Message:
  • corrected a M/S bug in sv8 decoding
  • changed Max_used_band usage in sv7 decoding, so it as the same meaning as in sv8 decoding
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/trunk/libmpcdec/mpc_decoder.c

    r301 r310  
    369369        d->Res_L[0] = mpc_bits_read(r, 4);
    370370        d->Res_R[0] = mpc_bits_read(r, 4);
    371         if (d->ms && !(d->Res_L[0] == 0 && d->Res_R[0] == 0))
    372         d->MS_Flag[0] = mpc_bits_read(r, 1);
     371        if (!(d->Res_L[0] == 0 && d->Res_R[0] == 0)) {
     372                if (d->ms)
     373                d->MS_Flag[0] = mpc_bits_read(r, 1);
     374                Max_used_Band = 1;
     375        }
    373376
    374377    // consecutive subbands
     
    383386                        if (d->ms)
    384387                d->MS_Flag[n] = mpc_bits_read(r, 1);
    385                         Max_used_Band = n;
     388                        Max_used_Band = n + 1;
    386389                }
    387390    }
     391
    388392    /****************************** SCFI ******************************/
    389     for ( n = 0; n <= Max_used_Band; n++ ) {
     393    for ( n = 0; n < Max_used_Band; n++ ) {
    390394                if (d->Res_L[n])
    391395                        d->SCFI_L[n] = mpc_bits_huff_dec(r, mpc_table_HuffSCFI);
     
    395399
    396400    /**************************** SCF/DSCF ****************************/
    397     for ( n = 0; n <= Max_used_Band; n++ ) {
     401    for ( n = 0; n < Max_used_Band; n++ ) {
    398402                mpc_int32_t * SCF = d->SCF_Index_L[n];
    399403                mpc_uint32_t Res  = d->Res_L[n], SCFI = d->SCFI_L[n];
     
    448452
    449453    /***************************** Samples ****************************/
    450     for ( n = 0; n <= Max_used_Band; n++ ) {
     454    for ( n = 0; n < Max_used_Band; n++ ) {
    451455                mpc_int32_t *q = d->Q[n].L, Res = d->Res_L[n];
    452456                do {
     
    554558        for( n = Max_used_Band; n <= d->max_band; n++)
    555559                d->Res_L[n] = d->Res_R[n] = 0;
    556 
    557 
    558560
    559561        /****************************** SCFI ******************************/
Note: See TracChangeset for help on using the changeset viewer.