⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 layeriiidecoder.java

📁 j2me音乐播放
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
/**
 *-----------------------------------------------------------------------
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Library General Public License as published
 *   by the Free Software Foundation; either version 2 of the License,or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU Library General Public License for more details.
 *
 *   You should have received a copy of the GNU Library General Public
 *   License along with this program; if not,write to the Free Software
 *   Foundation,Inc.,675 Mass Ave,Cambridge,MA 02139,USA.
 *----------------------------------------------------------------------
 */
package javazoom.jlme.decoder;



final class LayerIIIDecoder {

    private final static int pretab[] = {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0};

    private final static float two_to_negative_half_pow[] =
            {1.0000000000E+00f,7.0710678119E-01f,5.0000000000E-01f,3.5355339059E-01f,
            2.5000000000E-01f,1.7677669530E-01f,1.2500000000E-01f,8.8388347648E-02f,
            6.2500000000E-02f,4.4194173824E-02f,3.1250000000E-02f,2.2097086912E-02f,
            1.5625000000E-02f,1.1048543456E-02f,7.8125000000E-03f,5.5242717280E-03f,
            3.9062500000E-03f,2.7621358640E-03f,1.9531250000E-03f,1.3810679320E-03f,
            9.7656250000E-04f,6.9053396600E-04f,4.8828125000E-04f,3.4526698300E-04f,
            2.4414062500E-04f,1.7263349150E-04f,1.2207031250E-04f,8.6316745750E-05f,
            6.1035156250E-05f,4.3158372875E-05f,3.0517578125E-05f,2.1579186438E-05f,
            1.5258789062E-05f,1.0789593219E-05f,7.6293945312E-06f,5.3947966094E-06f,
            3.8146972656E-06f,2.6973983047E-06f,1.9073486328E-06f,1.3486991523E-06f,
            9.5367431641E-07f,6.7434957617E-07f,4.7683715820E-07f,3.3717478809E-07f,
            2.3841857910E-07f,1.6858739404E-07f,1.1920928955E-07f,8.4293697022E-08f,
            5.9604644775E-08f,4.2146848511E-08f,2.9802322388E-08f,2.1073424255E-08f,
            1.4901161194E-08f,1.0536712128E-08f,7.4505805969E-09f,5.2683560639E-09f,
            3.7252902985E-09f,2.6341780319E-09f,1.8626451492E-09f,1.3170890160E-09f,
            9.3132257462E-10f,6.5854450798E-10f,4.6566128731E-10f,3.2927225399E-10f
            };

    private final static float t_43[];

    static{
       t_43 = new float[8192];
       float d43 = (float)(4.0 / 3.0);
       for (int i = 0; i < 8192; i++)
         t_43[i] = (float)pow(i,(int)d43);
    }

   private final static float TAN12[] =
            {
            0.0f,0.26794919f,0.57735027f,1.0f,
            1.73205081f,3.73205081f,9.9999999e10f,-3.73205081f,
            -1.73205081f,-1.0f,-0.57735027f,-0.26794919f,
            0.0f,0.26794919f,0.57735027f,1.0f
            };

    private final static float win[][] =
            {
            {-1.6141214951E-02f,-5.3603178919E-02f,-1.0070713296E-01f,-1.6280817573E-01f,
            -4.9999999679E-01f,-3.8388735032E-01f,-6.2061144372E-01f,-1.1659756083E+00f,
            -3.8720752656E+00f,-4.2256286556E+00f,-1.5195289984E+00f,-9.7416483388E-01f,
            -7.3744074053E-01f,-1.2071067773E+00f,-5.1636156596E-01f,-4.5426052317E-01f,
            -4.0715656898E-01f,-3.6969460527E-01f,-3.3876269197E-01f,-3.1242222492E-01f,
            -2.8939587111E-01f,-2.6880081906E-01f,-5.0000000266E-01f,-2.3251417468E-01f,
            -2.1596714708E-01f,-2.0004979098E-01f,-1.8449493497E-01f,-1.6905846094E-01f,
            -1.5350360518E-01f,-1.3758624925E-01f,-1.2103922149E-01f,-2.0710679058E-01f,
            -8.4752577594E-02f,-6.4157525656E-02f,-4.1131172614E-02f,-1.4790705759E-02f},
            {-1.6141214951E-02f,-5.3603178919E-02f,-1.0070713296E-01f,-1.6280817573E-01f,
            -4.9999999679E-01f,-3.8388735032E-01f,-6.2061144372E-01f,-1.1659756083E+00f,
            -3.8720752656E+00f,-4.2256286556E+00f,-1.5195289984E+00f,-9.7416483388E-01f,
            -7.3744074053E-01f,-1.2071067773E+00f,-5.1636156596E-01f,-4.5426052317E-01f,
            -4.0715656898E-01f,-3.6969460527E-01f,-3.3908542600E-01f,-3.1511810350E-01f,
            -2.9642226150E-01f,-2.8184548650E-01f,-5.4119610000E-01f,-2.6213228100E-01f,
            -2.5387916537E-01f,-2.3296291359E-01f,-1.9852728987E-01f,-1.5233534808E-01f,
            -9.6496400054E-02f,-3.3423828516E-02f,0.0000000000E+00f,0.0000000000E+00f,
            0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f},
            {-4.8300800645E-02f,-1.5715656932E-01f,-2.8325045177E-01f,-4.2953747763E-01f,
            -1.2071067795E+00f,-8.2426483178E-01f,-1.1451749106E+00f,-1.7695290101E+00f,
            -4.5470225061E+00f,-3.4890531002E+00f,-7.3296292804E-01f,-1.5076514758E-01f,
            0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,
            0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,
            0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,
            0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,
            0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,
            0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f},
            {0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,0.0000000000E+00f,
            0.0000000000E+00f,0.0000000000E+00f,-1.5076513660E-01f,-7.3296291107E-01f,
            -3.4890530566E+00f,-4.5470224727E+00f,-1.7695290031E+00f,-1.1451749092E+00f,
            -8.3137738100E-01f,-1.3065629650E+00f,-5.4142014250E-01f,-4.6528974900E-01f,
            -4.1066990750E-01f,-3.7004680800E-01f,-3.3876269197E-01f,-3.1242222492E-01f,
            -2.8939587111E-01f,-2.6880081906E-01f,-5.0000000266E-01f,-2.3251417468E-01f,
            -2.1596714708E-01f,-2.0004979098E-01f,-1.8449493497E-01f,-1.6905846094E-01f,
            -1.5350360518E-01f,-1.3758624925E-01f,-1.2103922149E-01f,-2.0710679058E-01f,
            -8.4752577594E-02f,-6.4157525656E-02f,-4.1131172614E-02f,-1.4790705759E-02f}
            };

    private final static int reorder_table[][] = /* this array is a huge tax on the system */
            {
            {0,4,8,1,5,9,2,6,10,3,7,11,12,16,20,13,
            17,21,14,18,22,15,19,23,24,28,32,25,29,33,26,30,
            34,27,31,35,36,42,48,37,43,49,38,44,50,39,45,51,
            40,46,52,41,47,53,54,60,66,55,61,67,56,62,68,57,
            63,69,58,64,70,59,65,71,72,80,88,73,81,89,74,82,
            90,75,83,91,76,84,92,77,85,93,78,86,94,79,87,95,
            96,106,116,97,107,117,98,108,118,99,109,119,100,110,120,101,
            111,121,102,112,122,103,113,123,104,114,124,105,115,125,126,140,
            154,127,141,155,128,142,156,129,143,157,130,144,158,131,145,159,
            132,146,160,133,147,161,134,148,162,135,149,163,136,150,164,137,
            151,165,138,152,166,139,153,167,168,186,204,169,187,205,170,188,
            206,171,189,207,172,190,208,173,191,209,174,192,210,175,193,211,
            176,194,212,177,195,213,178,196,214,179,197,215,180,198,216,181,
            199,217,182,200,218,183,201,219,184,202,220,185,203,221,222,248,
            274,223,249,275,224,250,276,225,251,277,226,252,278,227,253,279,
            228,254,280,229,255,281,230,256,282,231,257,283,232,258,284,233,
            259,285,234,260,286,235,261,287,236,262,288,237,263,289,238,264,
            290,239,265,291,240,266,292,241,267,293,242,268,294,243,269,295,
            244,270,296,245,271,297,246,272,298,247,273,299,300,332,364,301,
            333,365,302,334,366,303,335,367,304,336,368,305,337,369,306,338,
            370,307,339,371,308,340,372,309,341,373,310,342,374,311,343,375,
            312,344,376,313,345,377,314,346,378,315,347,379,316,348,380,317,
            349,381,318,350,382,319,351,383,320,352,384,321,353,385,322,354,
            386,323,355,387,324,356,388,325,357,389,326,358,390,327,359,391,
            328,360,392,329,361,393,330,362,394,331,363,395,396,438,480,397,
            439,481,398,440,482,399,441,483,400,442,484,401,443,485,402,444,
            486,403,445,487,404,446,488,405,447,489,406,448,490,407,449,491,
            408,450,492,409,451,493,410,452,494,411,453,495,412,454,496,413,
            455,497,414,456,498,415,457,499,416,458,500,417,459,501,418,460,
            502,419,461,503,420,462,504,421,463,505,422,464,506,423,465,507,
            424,466,508,425,467,509,426,468,510,427,469,511,428,470,512,429,
            471,513,430,472,514,431,473,515,432,474,516,433,475,517,434,476,
            518,435,477,519,436,478,520,437,479,521,522,540,558,523,541,559,
            524,542,560,525,543,561,526,544,562,527,545,563,528,546,564,529,
            547,565,530,548,566,531,549,567,532,550,568,533,551,569,534,552,
            570,535,553,571,536,554,572,537,555,573,538,556,574,539,557,575},
            {0,4,8,1,5,9,2,6,10,3,7,11,12,16,20,13,
            17,21,14,18,22,15,19,23,24,28,32,25,29,33,26,30,
            34,27,31,35,36,42,48,37,43,49,38,44,50,39,45,51,
            40,46,52,41,47,53,54,62,70,55,63,71,56,64,72,57,
            65,73,58,66,74,59,67,75,60,68,76,61,69,77,78,88,
            98,79,89,99,80,90,100,81,91,101,82,92,102,83,93,103,
            84,94,104,85,95,105,86,96,106,87,97,107,108,120,132,109,
            121,133,110,122,134,111,123,135,112,124,136,113,125,137,114,126,
            138,115,127,139,116,128,140,117,129,141,118,130,142,119,131,143,
            144,158,172,145,159,173,146,160,174,147,161,175,148,162,176,149,
            163,177,150,164,178,151,165,179,152,166,180,153,167,181,154,168,
            182,155,169,183,156,170,184,157,171,185,186,204,222,187,205,223,
            188,206,224,189,207,225,190,208,226,191,209,227,192,210,228,193,
            211,229,194,212,230,195,213,231,196,214,232,197,215,233,198,216,
            234,199,217,235,200,218,236,201,219,237,202,220,238,203,221,239,
            240,264,288,241,265,289,242,266,290,243,267,291,244,268,292,245,
            269,293,246,270,294,247,271,295,248,272,296,249,273,297,250,274,
            298,251,275,299,252,276,300,253,277,301,254,278,302,255,279,303,
            256,280,304,257,281,305,258,282,306,259,283,307,260,284,308,261,
            285,309,262,286,310,263,287,311,312,344,376,313,345,377,314,346,
            378,315,347,379,316,348,380,317,349,381,318,350,382,319,351,383,
            320,352,384,321,353,385,322,354,386,323,355,387,324,356,388,325,
            357,389,326,358,390,327,359,391,328,360,392,329,361,393,330,362,
            394,331,363,395,332,364,396,333,365,397,334,366,398,335,367,399,
            336,368,400,337,369,401,338,370,402,339,371,403,340,372,404,341,
            373,405,342,374,406,343,375,407,408,452,496,409,453,497,410,454,
            498,411,455,499,412,456,500,413,457,501,414,458,502,415,459,503,
            416,460,504,417,461,505,418,462,506,419,463,507,420,464,508,421,
            465,509,422,466,510,423,467,511,424,468,512,425,469,513,426,470,
            514,427,471,515,428,472,516,429,473,517,430,474,518,431,475,519,
            432,476,520,433,477,521,434,478,522,435,479,523,436,480,524,437,
            481,525,438,482,526,439,483,527,440,484,528,441,485,529,442,486,
            530,443,487,531,444,488,532,445,489,533,446,490,534,447,491,535,
            448,492,536,449,493,537,450,494,538,451,495,539,540,552,564,541,
            553,565,542,554,566,543,555,567,544,556,568,545,557,569,546,558,
            570,547,559,571,548,560,572,549,561,573,550,562,574,551,563,575},
            {0,4,8,1,5,9,2,6,10,3,7,11,12,16,20,13,
            17,21,14,18,22,15,19,23,24,28,32,25,29,33,26,30,
            34,27,31,35,36,42,48,37,43,49,38,44,50,39,45,51,
            40,46,52,41,47,53,54,62,70,55,63,71,56,64,72,57,
            65,73,58,66,74,59,67,75,60,68,76,61,69,77,78,88,
            98,79,89,99,80,90,100,81,91,101,82,92,102,83,93,103,
            84,94,104,85,95,105,86,96,106,87,97,107,108,120,132,109,
            121,133,110,122,134,111,123,135,112,124,136,113,125,137,114,126,
            138,115,127,139,116,128,140,117,129,141,118,130,142,119,131,143,
            144,158,172,145,159,173,146,160,174,147,161,175,148,162,176,149,
            163,177,150,164,178,151,165,179,152,166,180,153,167,181,154,168,
            182,155,169,183,156,170,184,157,171,185,186,204,222,187,205,223,
            188,206,224,189,207,225,190,208,226,191,209,227,192,210,228,193,
            211,229,194,212,230,195,213,231,196,214,232,197,215,233,198,216,
            234,199,217,235,200,218,236,201,219,237,202,220,238,203,221,239,
            240,264,288,241,265,289,242,266,290,243,267,291,244,268,292,245,
            269,293,246,270,294,247,271,295,248,272,296,249,273,297,250,274,
            298,251,275,299,252,276,300,253,277,301,254,278,302,255,279,303,
            256,280,304,257,281,305,258,282,306,259,283,307,260,284,308,261,
            285,309,262,286,310,263,287,311,312,342,372,313,343,373,314,344,
            374,315,345,375,316,346,376,317,347,377,318,348,378,319,349,379,
            320,350,380,321,351,381,322,352,382,323,353,383,324,354,384,325,
            355,385,326,356,386,327,357,387,328,358,388,329,359,389,330,360,
            390,331,361,391,332,362,392,333,363,393,334,364,394,335,365,395,
            336,366,396,337,367,397,338,368,398,339,369,399,340,370,400,341,
            371,401,402,442,482,403,443,483,404,444,484,405,445,485,406,446,
            486,407,447,487,408,448,488,409,449,489,410,450,490,411,451,491,
            412,452,492,413,453,493,414,454,494,415,455,495,416,456,496,417,
            457,497,418,458,498,419,459,499,420,460,500,421,461,501,422,462,
            502,423,463,503,424,464,504,425,465,505,426,466,506,427,467,507,
            428,468,508,429,469,509,430,470,510,431,471,511,432,472,512,433,
            473,513,434,474,514,435,475,515,436,476,516,437,477,517,438,478,
            518,439,479,519,440,480,520,441,481,521,522,540,558,523,541,559,
            524,542,560,525,543,561,526,544,562,527,545,563,528,546,564,529,
            547,565,530,548,566,531,549,567,532,550,568,533,551,569,534,552,
            570,535,553,571,536,554,572,537,555,573,538,556,574,539,557,575},
            {0,4,8,1,5,9,2,6,10,3,7,11,12,16,20,13,
            17,21,14,18,22,15,19,23,24,28,32,25,29,33,26,30,
            34,27,31,35,36,40,44,37,41,45,38,42,46,39,43,47,
            48,54,60,49,55,61,50,56,62,51,57,63,52,58,64,53,
            59,65,66,74,82,67,75,83,68,76,84,69,77,85,70,78,
            86,71,79,87,72,80,88,73,81,89,90,100,110,91,101,111,
            92,102,112,93,103,113,94,104,114,95,105,115,96,106,116,97,
            107,117,98,108,118,99,109,119,120,132,144,121,133,145,122,134,
            146,123,135,147,124,136,148,125,137,149,126,138,150,127,139,151,
            128,140,152,129,141,153,130,142,154,131,143,155,156,170,184,157,
            171,185,158,172,186,159,173,187,160,174,188,161,175,189,162,176,
            190,163,177,191,164,178,192,165,179,193,166,180,194,167,181,195,
            168,182,196,169,183,197,198,216,234,199,217,235,200,218,236,201,
            219,237,202,220,238,203,221,239,204,222,240,205,223,241,206,224,
            242,207,225,243,208,226,244,209,227,245,210,228,246,211,229,247,
            212,230,248,213,231,249,214,232,250,215,233,251,252,274,296,253,
            275,297,254,276,298,255,277,299,256,278,300,257,279,301,258,280,
            302,259,281,303,260,282,304,261,283,305,262,284,306,263,285,307,
            264,286,308,265,287,309,266,288,310,267,289,311,268,290,312,269,
            291,313,270,292,314,271,293,315,272,294,316,273,295,317,318,348,
            378,319,349,379,320,350,380,321,351,381,322,352,382,323,353,383,
            324,354,384,325,355,385,326,356,386,327,357,387,328,358,388,329,
            359,389,330,360,390,331,361,391,332,362,392,333,363,393,334,364,
            394,335,365,395,336,366,396,337,367,397,338,368,398,339,369,399,
            340,370,400,341,371,401,342,372,402,343,373,403,344,374,404,345,
            375,405,346,376,406,347,377,407,408,464,520,409,465,521,410,466,
            522,411,467,523,412,468,524,413,469,525,414,470,526,415,471,527,
            416,472,528,417,473,529,418,474,530,419,475,531,420,476,532,421,
            477,533,422,478,534,423,479,535,424,480,536,425,481,537,426,482,
            538,427,483,539,428,484,540,429,485,541,430,486,542,431,487,543,
            432,488,544,433,489,545,434,490,546,435,491,547,436,492,548,437,
            493,549,438,494,550,439,495,551,440,496,552,441,497,553,442,498,
            554,443,499,555,444,500,556,445,501,557,446,502,558,447,503,559,
            448,504,560,449,505,561,450,506,562,451,507,563,452,508,564,453,
            509,565,454,510,566,455,511,567,456,512,568,457,513,569,458,514,
            570,459,515,571,460,516,572,461,517,573,462,518,574,463,519,575},
            {0,4,8,1,5,9,2,6,10,3,7,11,12,16,20,13,
            17,21,14,18,22,15,19,23,24,28,32,25,29,33,26,30,
            34,27,31,35,36,40,44,37,41,45,38,42,46,39,43,47,
            48,54,60,49,55,61,50,56,62,51,57,63,52,58,64,53,
            59,65,66,72,78,67,73,79,68,74,80,69,75,81,70,76,
            82,71,77,83,84,94,104,85,95,105,86,96,106,87,97,107,
            88,98,108,89,99,109,90,100,110,91,101,111,92,102,112,93,
            103,113,114,126,138,115,127,139,116,128,140,117,129,141,118,130,
            142,119,131,143,120,132,144,121,133,145,122,134,146,123,135,147,
            124,136,148,125,137,149,150,164,178,151,165,179,152,166,180,153,
            167,181,154,168,182,155,169,183,156,170,184,157,171,185,158,172,
            186,159,173,187,160,174,188,161,175,189,162,176,190,163,177,191,
            192,208,224,193,209,225,194,210,226,195,211,227,196,212,228,197,
            213,229,198,214,230,199,215,231,200,216,232,201,217,233,202,218,
            234,203,219,235,204,220,236,205,221,237,206,222,238,207,223,239,
            240,260,280,241,261,281,242,262,282,243,263,283,244,264,284,245,
            265,285,246,266,286,247,267,287,248,268,288,249,269,289,250,270,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -