Changeset 10 for trunk/src/mpc_decoder.c
- Timestamp:
- 08/12/06 16:35:51 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mpc_decoder.c
r7 r10 41 41 #include <mpcdec/huffman.h> 42 42 43 //SV7 tables 44 extern const HuffmanTyp* mpc_table_HuffQ [2] [8]; 45 extern const HuffmanTyp mpc_table_HuffHdr [10]; 46 extern const HuffmanTyp mpc_table_HuffSCFI [ 4]; 47 extern const HuffmanTyp mpc_table_HuffDSCF [16]; 48 49 50 #ifdef MPC_SUPPORT_SV456 51 //SV4/5/6 tables 52 extern const HuffmanTyp* mpc_table_SampleHuff [18]; 53 extern const HuffmanTyp mpc_table_SCFI_Bundle [ 8]; 54 extern const HuffmanTyp mpc_table_DSCF_Entropie [13]; 55 extern const HuffmanTyp mpc_table_Region_A [16]; 56 extern const HuffmanTyp mpc_table_Region_B [ 8]; 57 extern const HuffmanTyp mpc_table_Region_C [ 4]; 58 59 #endif 60 43 61 //------------------------------------------------------------------------------ 44 62 // types … … 57 75 // forward declarations 58 76 //------------------------------------------------------------------------------ 59 void mpc_decoder_init_huffman_sv6(mpc_decoder *d);60 void mpc_decoder_init_huffman_sv7(mpc_decoder *d);61 77 void mpc_decoder_read_bitstream_sv6(mpc_decoder *d); 62 78 void mpc_decoder_read_bitstream_sv7(mpc_decoder *d); … … 152 168 mpc_decoder_scfi_bundle_read( 153 169 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) 155 171 { 156 172 // load preview and decode … … 172 188 *SCFI = Table->Value >> 1; 173 189 *DSCF = Table->Value & 1; 174 }175 176 static int177 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 codeword185 // offset resulting value186 void187 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);197 190 } 198 191 … … 328 321 d->dword = d->Speicher[0]; 329 322 switch (d->StreamVersion) { 323 #ifdef MPC_SUPPORT_SV456 330 324 case 0x04: 331 325 case 0x05: … … 333 327 mpc_decoder_read_bitstream_sv6(d); 334 328 break; 329 #endif 335 330 case 0x07: 336 331 case 0x17: … … 364 359 FrameBitCnt = mpc_decoder_bits_read(d); 365 360 switch (d->StreamVersion) { 361 #ifdef MPC_SUPPORT_SV456 366 362 case 0x04: 367 363 case 0x05: … … 369 365 mpc_decoder_read_bitstream_sv6(d); 370 366 break; 367 #endif 371 368 case 0x07: 372 369 case 0x17: … … 402 399 // additional FilterDecay samples are needed for decay of synthesis filter 403 400 if (MPC_DECODER_SYNTH_DELAY + mod_block >= MPC_FRAME_LENGTH) { 404 405 // **********************************************************************406 // Rhoades 4/16/2002407 // Commented out are blocks of code which cause gapless playback to fail.408 // Temporary fix...409 // **********************************************************************410 411 401 if (!d->TrueGaplessPresent) { 412 402 mpc_decoder_reset_y(d); 413 } 414 else { 415 //if ( MPC_FRAME_LENGTH != d->LastValidSamples ) { 403 } else { 416 404 mpc_decoder_bitstream_read(d, 20); 417 405 mpc_decoder_read_bitstream_sv7(d); 418 406 mpc_decoder_requantisierung(d, d->Max_Band); 419 //FilterDecay = d->LastValidSamples;420 //}421 //else {422 //FilterDecay = 0;423 //}424 407 } 425 408 … … 652 635 } 653 636 637 #ifdef MPC_SUPPORT_SV456 638 static 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 654 673 /****************************************** SV 6 ******************************************/ 655 674 void … … 658 677 mpc_int32_t n,k; 659 678 mpc_int32_t Max_used_Band=0; 660 HuffmanTyp *Table;679 const HuffmanTyp *Table; 661 680 const HuffmanTyp *x1; 662 681 const HuffmanTyp *x2; … … 671 690 for (n=0; n <= d->Max_Band; ++n, ++ResL, ++ResR) 672 691 { 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)]; 678 697 if (d->MS_used) { 679 698 d->MS_Flag[n] = mpc_decoder_bitstream_read(d, 1); 680 699 } 681 *ResR = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];700 *ResR = Q_res[n][mpc_decoder_huffman_decode(d, Table)]; 682 701 683 702 // only perform the following procedure up to the maximum non-zero subband … … 689 708 ResR = d->Res_R; 690 709 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])); 693 712 } 694 713 … … 709 728 { 710 729 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); 712 731 L[1] = L[0]; 713 732 L[2] = L[1]; 714 733 break; 715 734 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); 718 737 L[2] = L[1]; 719 738 break; 720 739 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); 722 741 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); 724 743 break; 725 744 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); 729 748 break; 730 749 default: … … 775 794 { 776 795 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); 778 797 R[1] = R[0]; 779 798 R[2] = R[1]; 780 799 break; 781 800 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); 784 803 R[2] = R[1]; 785 804 break; 786 805 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); 788 807 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); 790 809 break; 791 810 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); 795 814 break; 796 815 default: … … 840 859 { 841 860 // setting pointers 842 x1 = d->SampleHuff[*ResL];843 x2 = d->SampleHuff[*ResR];861 x1 = mpc_table_SampleHuff[*ResL]; 862 x2 = mpc_table_SampleHuff[*ResR]; 844 863 L = d->Q[n].L; 845 864 R = d->Q[n].R; … … 860 879 } 861 880 } 862 881 #endif //MPC_SUPPORT_SV456 863 882 /****************************************** SV 7 ******************************************/ 864 883 void … … 895 914 for (n=1; n <= d->Max_Band; ++n, ++ResL, ++ResR) 896 915 { 897 idx = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);916 idx = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffHdr); 898 917 *ResL = (idx!=4) ? *(ResL-1) + idx : (int) mpc_decoder_bitstream_read(d, 4); 899 918 900 idx = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);919 idx = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffHdr); 901 920 *ResR = (idx!=4) ? *(ResR-1) + idx : (int) mpc_decoder_bitstream_read(d, 4); 902 921 … … 916 935 ResR = d->Res_R; 917 936 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); 920 939 } 921 940 … … 932 951 { 933 952 case 1: 934 idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);953 idx = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffDSCF); 935 954 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); 937 956 L[1] = (idx!=8) ? L[0] + idx : (int) mpc_decoder_bitstream_read(d, 6); 938 957 L[2] = L[1]; 939 958 break; 940 959 case 3: 941 idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);960 idx = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffDSCF); 942 961 L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6); 943 962 L[1] = L[0]; … … 945 964 break; 946 965 case 2: 947 idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);966 idx = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffDSCF); 948 967 L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6); 949 968 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); 951 970 L[2] = (idx!=8) ? L[1] + idx : (int) mpc_decoder_bitstream_read(d, 6); 952 971 break; 953 972 case 0: 954 idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);973 idx = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffDSCF); 955 974 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); 957 976 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); 959 978 L[2] = (idx!=8) ? L[1] + idx : (int) mpc_decoder_bitstream_read(d, 6); 960 979 break; … … 972 991 { 973 992 case 1: 974 idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);993 idx = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffDSCF); 975 994 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); 977 996 R[1] = (idx!=8) ? R[0] + idx : (int) mpc_decoder_bitstream_read(d, 6); 978 997 R[2] = R[1]; 979 998 break; 980 999 case 3: 981 idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);1000 idx = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffDSCF); 982 1001 R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6); 983 1002 R[1] = R[0]; … … 985 1004 break; 986 1005 case 2: 987 idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);1006 idx = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffDSCF); 988 1007 R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6); 989 1008 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); 991 1010 R[2] = (idx!=8) ? R[1] + idx : (int) mpc_decoder_bitstream_read(d, 6); 992 1011 break; 993 1012 case 0: 994 idx = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);1013 idx = mpc_decoder_huffman_decode_fast(d, mpc_table_HuffDSCF); 995 1014 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); 997 1016 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); 999 1018 R[2] = (idx!=8) ? R[1] + idx : (int) mpc_decoder_bitstream_read(d, 6); 1000 1019 break; … … 1031 1050 break; 1032 1051 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]; 1034 1053 for (k=0; k<12; ++k) 1035 1054 { … … 1041 1060 break; 1042 1061 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]; 1044 1063 for (k=0; k<18; ++k) 1045 1064 { … … 1051 1070 case 3: 1052 1071 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]; 1054 1073 for (k=0; k<36; ++k) 1055 1074 *L++ = mpc_decoder_huffman_decode_faster(d, Table); 1056 1075 break; 1057 1076 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]; 1059 1078 for (k=0; k<36; ++k) 1060 1079 *L++ = mpc_decoder_huffman_decode_fast(d, Table); … … 1062 1081 case 6: 1063 1082 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]; 1065 1084 for (k=0; k<36; ++k) 1066 1085 *L++ = mpc_decoder_huffman_decode(d, Table); … … 1091 1110 break; 1092 1111 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]; 1094 1113 for (k=0; k<12; ++k) 1095 1114 { … … 1101 1120 break; 1102 1121 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]; 1104 1123 for (k=0; k<18; ++k) 1105 1124 { … … 1111 1130 case 3: 1112 1131 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]; 1114 1133 for (k=0; k<36; ++k) 1115 1134 *R++ = mpc_decoder_huffman_decode_faster(d, Table); 1116 1135 break; 1117 1136 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]; 1119 1138 for (k=0; k<36; ++k) 1120 1139 *R++ = mpc_decoder_huffman_decode_fast(d, Table); … … 1122 1141 case 6: 1123 1142 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]; 1125 1144 for (k=0; k<36; ++k) 1126 1145 *R++ = mpc_decoder_huffman_decode(d, Table); … … 1141 1160 d->r = r; 1142 1161 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;1180 1162 d->MPCHeaderPos = 0; 1181 1163 d->StreamVersion = 0; … … 1186 1168 d->OverallFrames = 0; 1187 1169 d->DecodedFrames = 0; 1188 d->LastValidSamples = 0;1189 1170 d->TrueGaplessPresent = 0; 1190 1171 d->WordsRead = 0; 1191 1172 d->Max_Band = 0; 1192 1173 d->SampleRate = 0; 1193 // clips = 0;1194 1174 d->__r1 = 1; 1195 1175 d->__r2 = 1; … … 1202 1182 1203 1183 mpc_decoder_initialisiere_quantisierungstabellen(d, 1.0f); 1184 #if 0 1204 1185 mpc_decoder_init_huffman_sv6(d); 1205 1186 mpc_decoder_init_huffman_sv7(d); 1187 #endif 1206 1188 } 1207 1189 … … 1216 1198 d->OverallFrames = si->frames; 1217 1199 d->MPCHeaderPos = si->header_position; 1218 d->LastValidSamples = si->last_frame_samples;1219 1200 d->TrueGaplessPresent = si->is_true_gapless; 1220 1201 d->SampleRate = (mpc_int32_t)si->sample_freq; … … 1353 1334 } 1354 1335 else { 1336 #ifdef MPC_SUPPORT_SV456 1355 1337 mpc_decoder_read_bitstream_sv6(d); 1338 #else 1339 return FALSE; 1340 #endif 1356 1341 } 1357 1342 if (mpc_decoder_bits_read(d) - FrameBitCnt != d->FwdJumpInfo ) {
Note: See TracChangeset
for help on using the changeset viewer.