Changeset 10 for trunk/src/mpc_decoder.c


Ignore:
Timestamp:
08/12/06 16:35:51 (18 years ago)
Author:
zorg
Message:

Update to 1.2.3 trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mpc_decoder.c

    r7 r10  
    4141#include <mpcdec/huffman.h>
    4242
     43//SV7 tables
     44extern const HuffmanTyp*   mpc_table_HuffQ [2] [8];
     45extern const HuffmanTyp    mpc_table_HuffHdr  [10];
     46extern const HuffmanTyp    mpc_table_HuffSCFI [ 4];
     47extern const HuffmanTyp    mpc_table_HuffDSCF [16];
     48
     49
     50#ifdef MPC_SUPPORT_SV456
     51//SV4/5/6 tables
     52extern const HuffmanTyp*   mpc_table_SampleHuff [18];
     53extern const HuffmanTyp    mpc_table_SCFI_Bundle   [ 8];
     54extern const HuffmanTyp    mpc_table_DSCF_Entropie [13];
     55extern const HuffmanTyp    mpc_table_Region_A [16];
     56extern const HuffmanTyp    mpc_table_Region_B [ 8];
     57extern const HuffmanTyp    mpc_table_Region_C [ 4];
     58
     59#endif
     60
    4361//------------------------------------------------------------------------------
    4462// types
     
    5775// forward declarations
    5876//------------------------------------------------------------------------------
    59 void mpc_decoder_init_huffman_sv6(mpc_decoder *d);
    60 void mpc_decoder_init_huffman_sv7(mpc_decoder *d);
    6177void mpc_decoder_read_bitstream_sv6(mpc_decoder *d);
    6278void mpc_decoder_read_bitstream_sv7(mpc_decoder *d);
     
    152168mpc_decoder_scfi_bundle_read(
    153169    mpc_decoder *d,
    154     HuffmanTyp* Table, mpc_int32_t* SCFI, mpc_int32_t* DSCF)
     170    const HuffmanTyp* Table, mpc_int32_t* SCFI, mpc_bool_t* DSCF)
    155171{
    156172    // load preview and decode
     
    172188    *SCFI = Table->Value >> 1;
    173189    *DSCF = Table->Value &  1;
    174 }
    175 
    176 static int
    177 mpc_decoder_huffman_typ_cmpfn(const void* p1, const void* p2)
    178 {
    179     if (((HuffmanTyp*) p1)->Code < ((HuffmanTyp*) p2)->Code ) return +1;
    180     if (((HuffmanTyp*) p1)->Code > ((HuffmanTyp*) p2)->Code ) return -1;
    181     return 0;
    182 }
    183 
    184 // sort huffman-tables by codeword
    185 // offset resulting value
    186 void
    187 mpc_decoder_resort_huff_tables(
    188     const mpc_uint32_t elements, HuffmanTyp* Table, const mpc_int32_t offset )
    189 {
    190     mpc_uint32_t  i;
    191 
    192     for ( i = 0; i < elements; i++ ) {
    193         Table[i].Code <<= 32 - Table[i].Length;
    194         Table[i].Value  =  i - offset;
    195     }
    196     qsort(Table, elements, sizeof(*Table), mpc_decoder_huffman_typ_cmpfn);
    197190}
    198191
     
    328321  d->dword = d->Speicher[0];
    329322  switch (d->StreamVersion) {
     323#ifdef MPC_SUPPORT_SV456
    330324    case 0x04:
    331325    case 0x05:
     
    333327        mpc_decoder_read_bitstream_sv6(d);
    334328        break;
     329#endif
    335330    case 0x07:
    336331    case 0x17:
     
    364359    FrameBitCnt = mpc_decoder_bits_read(d);
    365360    switch (d->StreamVersion) {
     361#ifdef MPC_SUPPORT_SV456
    366362    case 0x04:
    367363    case 0x05:
     
    369365        mpc_decoder_read_bitstream_sv6(d);
    370366        break;
     367#endif
    371368    case 0x07:
    372369    case 0x17:
     
    402399        // additional FilterDecay samples are needed for decay of synthesis filter
    403400        if (MPC_DECODER_SYNTH_DELAY + mod_block >= MPC_FRAME_LENGTH) {
    404 
    405             // **********************************************************************
    406             // Rhoades 4/16/2002
    407             // Commented out are blocks of code which cause gapless playback to fail.
    408             // Temporary fix...
    409             // **********************************************************************
    410 
    411401            if (!d->TrueGaplessPresent) {
    412402                mpc_decoder_reset_y(d);
    413             }
    414             else {
    415                 //if ( MPC_FRAME_LENGTH != d->LastValidSamples ) {
     403            } else {
    416404                mpc_decoder_bitstream_read(d, 20);
    417405                mpc_decoder_read_bitstream_sv7(d);
    418406                mpc_decoder_requantisierung(d, d->Max_Band);
    419                 //FilterDecay = d->LastValidSamples;
    420                 //}
    421                 //else {
    422                 //FilterDecay = 0;
    423                 //}
    424407            }
    425408
     
    652635}
    653636
     637#ifdef MPC_SUPPORT_SV456
     638static const unsigned char Q_res[32][16] = {
     639{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
     640{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
     641{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
     642{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
     643{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
     644{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
     645{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
     646{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
     647{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
     648{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
     649{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
     650{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     651{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     652{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     653{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     654{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     655{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     656{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     657{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     658{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     659{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     660{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     661{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
     662{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
     663{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
     664{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
     665{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
     666{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
     667{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
     668{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
     669{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
     670{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
     671};
     672
    654673/****************************************** SV 6 ******************************************/
    655674void
     
    658677    mpc_int32_t n,k;
    659678    mpc_int32_t Max_used_Band=0;
    660     HuffmanTyp *Table;
     679    const HuffmanTyp *Table;
    661680    const HuffmanTyp *x1;
    662681    const HuffmanTyp *x2;
     
    671690    for (n=0; n <= d->Max_Band; ++n, ++ResL, ++ResR)
    672691    {
    673         if      (n<11)           Table = d->Region_A;
    674         else if (n>=11 && n<=22) Table = d->Region_B;
    675         else /*if (n>=23)*/      Table = d->Region_C;
    676 
    677         *ResL = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
     692        if      (n<11)           Table = mpc_table_Region_A;
     693        else if (n>=11 && n<=22) Table = mpc_table_Region_B;
     694        else /*if (n>=23)*/      Table = mpc_table_Region_C;
     695
     696        *ResL = Q_res[n][mpc_decoder_huffman_decode(d, Table)];
    678697        if (d->MS_used) {
    679698            d->MS_Flag[n] = mpc_decoder_bitstream_read(d,  1);
    680699        }
    681         *ResR = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
     700        *ResR = Q_res[n][mpc_decoder_huffman_decode(d, Table)];
    682701
    683702        // only perform the following procedure up to the maximum non-zero subband
     
    689708    ResR = d->Res_R;
    690709    for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR) {
    691         if (*ResL) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_L[n]), &(d->DSCF_Flag_L[n]));
    692         if (*ResR) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_R[n]), &(d->DSCF_Flag_R[n]));
     710        if (*ResL) mpc_decoder_scfi_bundle_read(d, mpc_table_SCFI_Bundle, &(d->SCFI_L[n]), &(d->DSCF_Flag_L[n]));
     711        if (*ResR) mpc_decoder_scfi_bundle_read(d, mpc_table_SCFI_Bundle, &(d->SCFI_R[n]), &(d->DSCF_Flag_R[n]));
    693712    }
    694713
     
    709728                {
    710729                case 3:
    711                     L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
     730                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
    712731                    L[1] = L[0];
    713732                    L[2] = L[1];
    714733                    break;
    715734                case 1:
    716                     L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
    717                     L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
     735                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
     736                    L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
    718737                    L[2] = L[1];
    719738                    break;
    720739                case 2:
    721                     L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
     740                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
    722741                    L[1] = L[0];
    723                     L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
     742                    L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
    724743                    break;
    725744                case 0:
    726                     L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
    727                     L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
    728                     L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
     745                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
     746                    L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
     747                    L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
    729748                    break;
    730749                default:
     
    775794                {
    776795                case 3:
    777                     R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
     796                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
    778797                    R[1] = R[0];
    779798                    R[2] = R[1];
    780799                    break;
    781800                case 1:
    782                     R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
    783                     R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
     801                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
     802                    R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
    784803                    R[2] = R[1];
    785804                    break;
    786805                case 2:
    787                     R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
     806                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
    788807                    R[1] = R[0];
    789                     R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
     808                    R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
    790809                    break;
    791810                case 0:
    792                     R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
    793                     R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
    794                     R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
     811                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
     812                    R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
     813                    R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  mpc_table_DSCF_Entropie);
    795814                    break;
    796815                default:
     
    840859    {
    841860        // setting pointers
    842         x1 = d->SampleHuff[*ResL];
    843         x2 = d->SampleHuff[*ResR];
     861        x1 = mpc_table_SampleHuff[*ResL];
     862        x2 = mpc_table_SampleHuff[*ResR];
    844863        L = d->Q[n].L;
    845864        R = d->Q[n].R;
     
    860879    }
    861880}
    862 
     881#endif //MPC_SUPPORT_SV456
    863882/****************************************** SV 7 ******************************************/
    864883void
     
    895914    for (n=1; n <= d->Max_Band; ++n, ++ResL, ++ResR)
    896915    {
    897         idx   = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
     916        idx   = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffHdr);
    898917        *ResL = (idx!=4) ? *(ResL-1) + idx : (int) mpc_decoder_bitstream_read(d, 4);
    899918
    900         idx   = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
     919        idx   = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffHdr);
    901920        *ResR = (idx!=4) ? *(ResR-1) + idx : (int) mpc_decoder_bitstream_read(d, 4);
    902921
     
    916935    ResR  = d->Res_R;
    917936    for (n=0; n <= Max_used_Band; ++n, ++L, ++R, ++ResL, ++ResR) {
    918         if (*ResL) *L = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
    919         if (*ResR) *R = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
     937        if (*ResL) *L = mpc_decoder_huffman_decode_faster(d, mpc_table_HuffSCFI);
     938        if (*ResR) *R = mpc_decoder_huffman_decode_faster(d, mpc_table_HuffSCFI);
    920939    }
    921940
     
    932951            {
    933952            case 1:
    934                 idx  = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
     953                idx  = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffDSCF);
    935954                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    936                 idx  = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
     955                idx  = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffDSCF);
    937956                L[1] = (idx!=8) ? L[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    938957                L[2] = L[1];
    939958                break;
    940959            case 3:
    941                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     960                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    942961                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    943962                L[1] = L[0];
     
    945964                break;
    946965            case 2:
    947                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     966                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    948967                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    949968                L[1] = L[0];
    950                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     969                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    951970                L[2] = (idx!=8) ? L[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    952971                break;
    953972            case 0:
    954                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     973                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    955974                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    956                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     975                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    957976                L[1] = (idx!=8) ? L[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    958                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     977                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    959978                L[2] = (idx!=8) ? L[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    960979                break;
     
    972991            {
    973992            case 1:
    974                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     993                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    975994                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    976                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     995                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    977996                R[1] = (idx!=8) ? R[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    978997                R[2] = R[1];
    979998                break;
    980999            case 3:
    981                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     1000                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    9821001                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    9831002                R[1] = R[0];
     
    9851004                break;
    9861005            case 2:
    987                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     1006                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    9881007                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    9891008                R[1] = R[0];
    990                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     1009                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    9911010                R[2] = (idx!=8) ? R[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    9921011                break;
    9931012            case 0:
    994                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     1013                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    9951014                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    996                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     1015                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    9971016                R[1] = (idx!=8) ? R[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    998                 idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
     1017                idx  = mpc_decoder_huffman_decode_fast(d,  mpc_table_HuffDSCF);
    9991018                R[2] = (idx!=8) ? R[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
    10001019                break;
     
    10311050            break;
    10321051        case 1:
    1033             Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
     1052            Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
    10341053            for (k=0; k<12; ++k)
    10351054            {
     
    10411060            break;
    10421061        case 2:
    1043             Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
     1062            Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
    10441063            for (k=0; k<18; ++k)
    10451064            {
     
    10511070        case 3:
    10521071        case 4:
    1053             Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
     1072            Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
    10541073            for (k=0; k<36; ++k)
    10551074                *L++ = mpc_decoder_huffman_decode_faster(d, Table);
    10561075            break;
    10571076        case 5:
    1058             Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
     1077            Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
    10591078            for (k=0; k<36; ++k)
    10601079                *L++ = mpc_decoder_huffman_decode_fast(d, Table);
     
    10621081        case 6:
    10631082        case 7:
    1064             Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
     1083            Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
    10651084            for (k=0; k<36; ++k)
    10661085                *L++ = mpc_decoder_huffman_decode(d, Table);
     
    10911110                break;
    10921111            case 1:
    1093                 Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
     1112                Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
    10941113                for (k=0; k<12; ++k)
    10951114                {
     
    11011120                break;
    11021121            case 2:
    1103                 Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
     1122                Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
    11041123                for (k=0; k<18; ++k)
    11051124                {
     
    11111130            case 3:
    11121131            case 4:
    1113                 Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
     1132                Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
    11141133                for (k=0; k<36; ++k)
    11151134                    *R++ = mpc_decoder_huffman_decode_faster(d, Table);
    11161135                break;
    11171136            case 5:
    1118                 Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
     1137                Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
    11191138                for (k=0; k<36; ++k)
    11201139                    *R++ = mpc_decoder_huffman_decode_fast(d, Table);
     
    11221141            case 6:
    11231142            case 7:
    1124                 Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
     1143                Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
    11251144                for (k=0; k<36; ++k)
    11261145                    *R++ = mpc_decoder_huffman_decode(d, Table);
     
    11411160  d->r = r;
    11421161
    1143   d->HuffQ[0][0] = 0;
    1144   d->HuffQ[1][0] = 0;
    1145   d->HuffQ[0][1] = d->HuffQ1[0];
    1146   d->HuffQ[1][1] = d->HuffQ1[1];
    1147   d->HuffQ[0][2] = d->HuffQ2[0];
    1148   d->HuffQ[1][2] = d->HuffQ2[1];
    1149   d->HuffQ[0][3] = d->HuffQ3[0];
    1150   d->HuffQ[1][3] = d->HuffQ3[1];
    1151   d->HuffQ[0][4] = d->HuffQ4[0];
    1152   d->HuffQ[1][4] = d->HuffQ4[1];
    1153   d->HuffQ[0][5] = d->HuffQ5[0];
    1154   d->HuffQ[1][5] = d->HuffQ5[1];
    1155   d->HuffQ[0][6] = d->HuffQ6[0];
    1156   d->HuffQ[1][6] = d->HuffQ6[1];
    1157   d->HuffQ[0][7] = d->HuffQ7[0];
    1158   d->HuffQ[1][7] = d->HuffQ7[1];
    1159 
    1160   d->SampleHuff[0] = NULL;
    1161   d->SampleHuff[1] = d->Entropie_1;
    1162   d->SampleHuff[2] = d->Entropie_2;
    1163   d->SampleHuff[3] = d->Entropie_3;
    1164   d->SampleHuff[4] = d->Entropie_4;
    1165   d->SampleHuff[5] = d->Entropie_5;
    1166   d->SampleHuff[6] = d->Entropie_6;
    1167   d->SampleHuff[7] = d->Entropie_7;
    1168   d->SampleHuff[8] = NULL;
    1169   d->SampleHuff[9] = NULL;
    1170   d->SampleHuff[10] = NULL;
    1171   d->SampleHuff[11] = NULL;
    1172   d->SampleHuff[12] = NULL;
    1173   d->SampleHuff[13] = NULL;
    1174   d->SampleHuff[14] = NULL;
    1175   d->SampleHuff[15] = NULL;
    1176   d->SampleHuff[16] = NULL;
    1177   d->SampleHuff[17] = NULL;
    1178 
    1179   d->EQ_activated = 0;
    11801162  d->MPCHeaderPos = 0;
    11811163  d->StreamVersion = 0;
     
    11861168  d->OverallFrames = 0;
    11871169  d->DecodedFrames = 0;
    1188   d->LastValidSamples = 0;
    11891170  d->TrueGaplessPresent = 0;
    11901171  d->WordsRead = 0;
    11911172  d->Max_Band = 0;
    11921173  d->SampleRate = 0;
    1193 //  clips = 0;
    11941174  d->__r1 = 1;
    11951175  d->__r2 = 1;
     
    12021182
    12031183  mpc_decoder_initialisiere_quantisierungstabellen(d, 1.0f);
     1184#if 0
    12041185  mpc_decoder_init_huffman_sv6(d);
    12051186  mpc_decoder_init_huffman_sv7(d);
     1187#endif
    12061188}
    12071189
     
    12161198    d->OverallFrames      = si->frames;
    12171199    d->MPCHeaderPos       = si->header_position;
    1218     d->LastValidSamples   = si->last_frame_samples;
    12191200    d->TrueGaplessPresent = si->is_true_gapless;
    12201201    d->SampleRate         = (mpc_int32_t)si->sample_freq;
     
    13531334        }
    13541335        else {
     1336#ifdef MPC_SUPPORT_SV456
    13551337            mpc_decoder_read_bitstream_sv6(d);
     1338#else
     1339            return FALSE;
     1340#endif
    13561341        }
    13571342        if (mpc_decoder_bits_read(d) - FrameBitCnt != d->FwdJumpInfo ) {
Note: See TracChangeset for help on using the changeset viewer.