Changeset 243


Ignore:
Timestamp:
03/27/07 11:23:35 (18 years ago)
Author:
r2d
Message:

corrected pns encoding/decoding bug (doesn't change bitstream for quality >= 5)

Location:
libmpc/branches/r2d
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libmpc/branches/r2d/libmpcdec/mpc_decoder.c

    r242 r243  
    523523                d->Res_L[Max_used_Band-1] = mpc_bits_huff_dec(r, mpc_table_HuffRes[0]);
    524524                d->Res_R[Max_used_Band-1] = mpc_bits_huff_dec(r, mpc_table_HuffRes[0]);
     525                if (d->Res_L[Max_used_Band-1] > 15) d->Res_L[Max_used_Band-1] -= 17;
     526                if (d->Res_R[Max_used_Band-1] > 15) d->Res_R[Max_used_Band-1] -= 17;
    525527                for ( n = Max_used_Band - 2; n >= 0; n--) {
    526528                        d->Res_L[n] = mpc_bits_huff_dec(r, mpc_table_HuffRes[d->Res_L[n + 1] > 2]) + d->Res_L[n + 1];
  • libmpc/branches/r2d/libmpcenc/encode_sv7.c

    r226 r243  
    177177
    178178        if (MaxBand) {
    179                 writeBits(e, HuffRes[0][Res_L[MaxBand - 1]].Code, HuffRes[0][Res_L[MaxBand - 1]].Length);
    180                 writeBits(e, HuffRes[0][Res_R[MaxBand - 1]].Code, HuffRes[0][Res_R[MaxBand - 1]].Length);
     179                {
     180                        int tmp = Res_L[MaxBand - 1];
     181                        if (tmp < 0) tmp += 17;
     182                        writeBits(e, HuffRes[0][tmp].Code, HuffRes[0][tmp].Length);
     183                        tmp = Res_R[MaxBand - 1];
     184                        if (tmp < 0) tmp += 17;
     185                        writeBits(e, HuffRes[0][tmp].Code, HuffRes[0][tmp].Length);
     186                }
    181187                for ( n = MaxBand - 2; n >= 0; n--) {
    182188                        int tmp = Res_L[n] - Res_L[n + 1];
Note: See TracChangeset for help on using the changeset viewer.