Changeset 33


Ignore:
Timestamp:
02/22/12 11:57:50 (6 years ago)
Author:
shan2
Message:

ForSyDe-SystemC/CoMPSoC: removed the need to pass around an array of constants between the actors in the mp3decode example.

Location:
ForSyDe-SystemC/branches/CoMPSoC/examples/sdf/mp3decoder
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • ForSyDe-SystemC/branches/CoMPSoC/examples/sdf/mp3decoder/ProcessGranuleOne.hpp

    r32 r33  
    2121    const vector<FrameHeader>&        inp1, // headerGranule 
    2222    const vector<FrameSideInfo>&      inp2, // sideInfoGranule 
    23     const vector<GranuleData>&        inp3, // granuleData 
    24     const vector<t_sf_band_indices*>& inp4  // bandIndicesGranule 
     23    const vector<GranuleData>&        inp3  // granuleData 
    2524) 
    2625{ 
     
    3837     
    3938    /* Main actor code */ 
    40     processGranule(1, &inp1[0], &inp2[0], &inp3[0], inp4[0], &processedMainData); 
     39    processGranule(1, &inp1[0], &inp2[0], &inp3[0], &processedMainData); 
    4140 
    4241    out1[0] = inp1[0]; 
  • ForSyDe-SystemC/branches/CoMPSoC/examples/sdf/mp3decoder/ProcessGranuleZero.hpp

    r32 r33  
    2121    const vector<FrameHeader>&        inp1, // headerGranule 
    2222    const vector<FrameSideInfo>&      inp2, // sideInfoGranule 
    23     const vector<GranuleData>&        inp3, // granuleData 
    24     const vector<t_sf_band_indices*>& inp4  // bandIndicesGranule 
     23    const vector<GranuleData>&        inp3  // granuleData 
    2524) 
    2625{ 
     
    3837     
    3938    /* Main actor code */ 
    40     processGranule(0, &inp1[0], &inp2[0], &inp3[0], inp4[0], &processedMainData); 
     39    processGranule(0, &inp1[0], &inp2[0], &inp3[0], &processedMainData); 
    4140 
    4241    out1[0] = inp1[0]; 
  • ForSyDe-SystemC/branches/CoMPSoC/examples/sdf/mp3decoder/ReadBitstreamAndExtractFrames.hpp

    r32 r33  
    1515        vector<FrameSideInfo>,      // sideInfoGranule0 
    1616        vector<GranuleData>,        // granuleData0 
    17         vector<t_sf_band_indices*>,  // bandIndicesGranule0 
    1817        vector<FrameHeader>,        // headerGranule1 
    1918        vector<FrameSideInfo>,      // sideInfoGranule1 
    20         vector<GranuleData>,        // granuleData1 
    21         vector<t_sf_band_indices*>   // bandIndicesGranule1 
     19        vector<GranuleData>         // granuleData1 
    2220    > InputType; 
    2321 
     
    3230    vector<FrameSideInfo>       out5(1);    // sideInfoGranule0 
    3331    vector<GranuleData>         out6(1);    // granuleData0 
    34     vector<t_sf_band_indices*>  out7(1);    // bandIndicesGranule0 
    35     vector<FrameHeader>         out8(1);    // headerGranule1 
    36     vector<FrameSideInfo>       out9(1);    // sideInfoGranule1 
    37     vector<GranuleData>         out10(1);   // granuleData1 
    38     vector<t_sf_band_indices*>  out11(1);   // bandIndicesGranule1 
     32    vector<FrameHeader>         out7(1);    // headerGranule1 
     33    vector<FrameSideInfo>       out8(1);    // sideInfoGranule1 
     34    vector<GranuleData>         out9(1);    // granuleData1 
    3935     
    4036#pragma ForSyDe begin ReadBitstreamAndExtractFrames_func 
     
    4440    static FrameSideInfo sideInfo = {0}; 
    4541    static FrameMainData frameMainData; 
    46     t_sf_band_indices bandIndices[3] =   { 
    47         { 
    48             { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 52, 62, 74, 90, 110, 134, 162, 
    49                 196, 238, 288, 342, 418, 576 }, 
    50             { 0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136, 192 } 
    51         }, 
    52         { 
    53             { 0, 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 60, 72, 88, 106, 128, 156, 
    54                 190, 230, 276, 330, 384, 576 }, 
    55             { 0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126, 192 } 
    56         }, 
    57         { 
    58             { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 54, 66, 82, 102, 126, 156, 194, 
    59                 240, 296, 364, 448, 550, 576 }, 
    60             { 0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138, 180, 192 } 
    61         } 
    62     }; 
    6342    bool moreFrames = true; 
    6443     
     
    6645 
    6746    #ifdef FORSYDE_HPP 
    68     moreFrames = readBitstreamAndExtractFrames(file_name, &header, &sideInfo, &frameMainData, bandIndices); 
     47    moreFrames = readBitstreamAndExtractFrames(file_name, &header, &sideInfo, &frameMainData); 
    6948    #endif 
    7049 
     
    7554    out5[0] = sideInfo; 
    7655    copyGranuleData(frameMainData, 0, out6[0]); 
    77     out7[0] = bandIndices; 
    78     out8[0] = header; 
    79     out9[0] = sideInfo; 
    80     copyGranuleData(frameMainData, 1, out10[0]); 
    81     out11[0] = bandIndices; 
     56    out7[0] = header; 
     57    out8[0] = sideInfo; 
     58    copyGranuleData(frameMainData, 1, out9[0]); 
    8259 
    8360#pragma ForSyDe end 
    84     outs[0] = make_tuple(out1,out2,out3,out4,out5, 
    85                          out6,out7,out8,out9,out10,out11); 
     61    outs[0] = make_tuple(out1,out2,out3,out4,out5,out6,out7,out8,out9); 
    8662} 
    8763 
  • ForSyDe-SystemC/branches/CoMPSoC/examples/sdf/mp3decoder/Top.hpp

    r32 r33  
    4242              ChanuleSamples> ProcessChanule; 
    4343 
    44 typedef comb4<FrameHeader,FrameSideInfo,GranuleData,t_sf_band_indices*, 
     44typedef comb3<FrameHeader,FrameSideInfo,GranuleData, 
    4545    tuple< 
    4646        vector<FrameHeader>, 
     
    6868        FrameSideInfo, 
    6969        GranuleData, 
    70         t_sf_band_indices*, 
    71         FrameHeader, 
    72         FrameSideInfo, 
    73         GranuleData, 
    74         t_sf_band_indices* 
     70        FrameHeader, 
     71        FrameSideInfo, 
     72        GranuleData 
    7573    > InputUnzipper; 
    7674 
     
    111109    SDF2SDF<GranuleData> *granuleData0; 
    112110    SDF2SDF<GranuleData> *granuleData1; 
    113     SDF2SDF<t_sf_band_indices*> *bandIndicesGranule0; 
    114     SDF2SDF<t_sf_band_indices*> *bandIndicesGranule1; 
    115111    SDF2SDF<GranuleType> *zippedGranuel0Out; 
    116112    SDF2SDF<GranuleType> *zippedGranuel1Out; 
     
    147143        granuleData0 = new SDF2SDF<GranuleData>("granuleData0",1); 
    148144        granuleData1 = new SDF2SDF<GranuleData>("granuleData1",1); 
    149         bandIndicesGranule0 = new SDF2SDF<t_sf_band_indices*>("bandIndicesGranule0",1); 
    150         bandIndicesGranule1 = new SDF2SDF<t_sf_band_indices*>("bandIndicesGranule1",1); 
    151145        zippedGranuel0Out = new SDF2SDF<GranuleType>("zippedGranuel0Out",1); 
    152146        zippedGranuel1Out = new SDF2SDF<GranuleType>("zippedGranuel1Out",1);; 
     
    174168        a_ReadBitstreamAndExtractFrames->oport(*zippedInput); 
    175169        // 
    176         vector<unsigned> inputUnzipperRates = {1,1,1,1,1,1,1,1,1,1,1}; 
     170        vector<unsigned> inputUnzipperRates = {1,1,1,1,1,1,1,1,1}; 
    177171        a_InputUnzipper = new InputUnzipper("InputUnzipper",inputUnzipperRates); 
    178172        a_InputUnzipper->iport(*zippedInput); 
     
    183177        get<4>(a_InputUnzipper->oport)(*sideInfoGranule0); 
    184178        get<5>(a_InputUnzipper->oport)(*granuleData0); 
    185         get<6>(a_InputUnzipper->oport)(*bandIndicesGranule0); 
    186         get<7>(a_InputUnzipper->oport)(*headerGranule1); 
    187         get<8>(a_InputUnzipper->oport)(*sideInfoGranule1); 
    188         get<9>(a_InputUnzipper->oport)(*granuleData1); 
    189         get<10>(a_InputUnzipper->oport)(*bandIndicesGranule1); 
     179        get<6>(a_InputUnzipper->oport)(*headerGranule1); 
     180        get<7>(a_InputUnzipper->oport)(*sideInfoGranule1); 
     181        get<8>(a_InputUnzipper->oport)(*granuleData1); 
    190182        // 
    191183        a_DummyLoopDelay = new delayn<float>("DummyLoopDelay",1,1); 
     
    212204        a_Merge->iport(*zippedMerge); 
    213205         
    214         a_ProcessGranule0 = new ProcessGranule("ProcessGranuleZero0",ProcessGranuleZero_func,1,1,1,1,1); 
     206        a_ProcessGranule0 = new ProcessGranule("ProcessGranuleZero0",ProcessGranuleZero_func,1,1,1,1); 
    215207        a_ProcessGranule0->iport1(*headerGranule0); 
    216208        a_ProcessGranule0->iport2(*sideInfoGranule0); 
    217209        a_ProcessGranule0->iport3(*granuleData0); 
    218         a_ProcessGranule0->iport4(*bandIndicesGranule0); 
    219210        a_ProcessGranule0->oport(*zippedGranuel0Out); 
    220211        // 
     
    229220        get<5>(a_Granuel0Unzipper->oport)(*chanuleData0Right); 
    230221 
    231         a_ProcessGranule1 = new ProcessGranule("ProcessGranuleOne",ProcessGranuleOne_func,1,1,1,1,1); 
     222        a_ProcessGranule1 = new ProcessGranule("ProcessGranuleOne0",ProcessGranuleOne_func,1,1,1,1); 
    232223        a_ProcessGranule1->iport1(*headerGranule1); 
    233224        a_ProcessGranule1->iport2(*sideInfoGranule1); 
    234225        a_ProcessGranule1->iport3(*granuleData1); 
    235         a_ProcessGranule1->iport4(*bandIndicesGranule1); 
    236226        a_ProcessGranule1->oport(*zippedGranuel1Out); 
    237227        // 
  • ForSyDe-SystemC/branches/CoMPSoC/examples/sdf/mp3decoder/include/MP3Decoder.h

    r32 r33  
    173173} t_sf_band_indices; 
    174174 
    175 //t_sf_band_indices  g_sf_band_indices[3]; 
    176  
     175static const t_sf_band_indices g_sf_band_indices[3 /* Sampling freq. */] = 
     176  { 
     177    { 
     178      { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 52, 62, 74, 90, 110, 134, 162, 
     179        196, 238, 288, 342, 418, 576 }, 
     180      { 0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136, 192 } 
     181    }, 
     182    { 
     183      { 0, 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 60, 72, 88, 106, 128, 156, 
     184        190, 230, 276, 330, 384, 576 }, 
     185      { 0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126, 192 } 
     186    }, 
     187    { 
     188      { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 54, 66, 82, 102, 126, 156, 194, 
     189        240, 296, 364, 448, 550, 576 }, 
     190      { 0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138, 180, 192 } 
     191    } 
     192  }; 
     193   
    177194/* MP3 Decoder function definitions */ 
    178195 
    179196 
    180197/// ReadBitstreamAndExtractFrames.c 
    181 bool readBitstreamAndExtractFrames(char *file_name, FrameHeader *frameHeader, FrameSideInfo *frameSideInfo, FrameMainData *frameMainData, t_sf_band_indices* g_sf_band_indices); 
     198bool readBitstreamAndExtractFrames(char *file_name, FrameHeader *frameHeader, FrameSideInfo *frameSideInfo, FrameMainData *frameMainData); 
    182199 
    183200///ProcessGranule.c 
    184 void processGranule(const UINT32 gr, FrameHeader *frameHeader, FrameSideInfo *frameSideInfo, GranuleData *frameInMainData, t_sf_band_indices* bandIndices, GranuleData *frameOutMainData); 
     201void processGranule(const UINT32 gr, FrameHeader *frameHeader, FrameSideInfo *frameSideInfo, GranuleData *frameInMainData, GranuleData *frameOutMainData); 
    185202 
    186203///ProcessChanule.c 
  • ForSyDe-SystemC/branches/CoMPSoC/examples/sdf/mp3decoder/processGranule.cpp

    r32 r33  
    1717#endif 
    1818 
    19 static void MPG_L3_Requantize (UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData, t_sf_band_indices* g_sf_band_indices); 
     19static void MPG_L3_Requantize (UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData); 
    2020static void MPG_Requantize_Process_Long (UINT32 gr, UINT32 ch, UINT32 is_pos, UINT32 sfb, FrameSideInfo* g_side_info, GranuleData* granuleData); 
    2121static void MPG_Requantize_Process_Short (UINT32 gr, UINT32 ch, UINT32 is_pos, UINT32 sfb, UINT32 win, FrameSideInfo* g_side_info, GranuleData* granuleData); 
    22 static void MPG_L3_Reorder (UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData, t_sf_band_indices* g_sf_band_indices); 
    23 static void MPG_L3_Stereo (UINT32 gr, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData, t_sf_band_indices* g_sf_band_indices); 
    24 static void MPG_Stereo_Process_Intensity_Long (UINT32 gr, UINT32 sfb, FrameHeader* g_frame_header, GranuleData* granuleData, t_sf_band_indices* g_sf_band_indices); 
    25 static void MPG_Stereo_Process_Intensity_Short (UINT32 gr, UINT32 sfb, FrameHeader* g_frame_header, GranuleData* granuleData, t_sf_band_indices* g_sf_band_indices); 
     22static void MPG_L3_Reorder (UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData); 
     23static void MPG_L3_Stereo (UINT32 gr, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData); 
     24static void MPG_Stereo_Process_Intensity_Long (UINT32 gr, UINT32 sfb, FrameHeader* g_frame_header, GranuleData* granuleData); 
     25static void MPG_Stereo_Process_Intensity_Short (UINT32 gr, UINT32 sfb, FrameHeader* g_frame_header, GranuleData* granuleData); 
    2626 
    2727//////////////////////////////////////////////////////////////////////////////// 
     
    2929//////////////////////////////////////////////////////////////////////////////// 
    3030/* Main actor function */ 
    31 void processGranule(const UINT32 gr, FrameHeader *frameHeader, FrameSideInfo *frameSideInfo, GranuleData *frameInMainData, t_sf_band_indices* bandIndices, GranuleData *frameOutMainData) 
     31void processGranule(const UINT32 gr, FrameHeader *frameHeader, FrameSideInfo *frameSideInfo, GranuleData *frameInMainData, GranuleData *frameOutMainData) 
    3232{ 
    3333  UINT32 ch, nch; 
     
    4747    for (ch = 0; ch<nch; ch++) { 
    4848        /* Requantize samples */ 
    49         MPG_L3_Requantize (gr, ch, frameHeader, frameSideInfo, frameOutMainData, bandIndices); 
     49        MPG_L3_Requantize (gr, ch, frameHeader, frameSideInfo, frameOutMainData); 
    5050 
    5151        /* Reorder short blocks */ 
    52         MPG_L3_Reorder (gr, ch, frameHeader, frameSideInfo, frameOutMainData, bandIndices); 
     52        MPG_L3_Reorder (gr, ch, frameHeader, frameSideInfo, frameOutMainData); 
    5353    } 
    5454    /* Stereo processing */ 
    55     MPG_L3_Stereo (gr, frameHeader, frameSideInfo, frameOutMainData, bandIndices); 
     55    MPG_L3_Stereo (gr, frameHeader, frameSideInfo, frameOutMainData); 
    5656 
    5757} 
     
    6262//////////////////////////////////////////////////////////////////////////////// 
    6363static void 
    64 MPG_L3_Requantize (UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData, t_sf_band_indices* g_sf_band_indices) 
     64MPG_L3_Requantize (UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData) 
    6565{ 
    6666    UINT32 sfb /* scalefac band index */; 
     
    319319//////////////////////////////////////////////////////////////////////////////// 
    320320static void 
    321 MPG_L3_Reorder (UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData, t_sf_band_indices* g_sf_band_indices) 
     321MPG_L3_Reorder (UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData) 
    322322{ 
    323323    UINT32 sfreq, i, j, next_sfb, sfb, win_len, win; 
     
    412412//////////////////////////////////////////////////////////////////////////////// 
    413413static void 
    414 MPG_L3_Stereo (UINT32 gr, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData, t_sf_band_indices* g_sf_band_indices) 
     414MPG_L3_Stereo (UINT32 gr, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, GranuleData* granuleData) 
    415415{ 
    416416    UINT32 max_pos, i; 
     
    476476                    /* Is this scale factor band above count1 for the right channel? */ 
    477477                    if (g_sf_band_indices[sfreq].l[sfb] >= (*g_side_info).count1[gr][1]) { 
    478                         MPG_Stereo_Process_Intensity_Long (gr, sfb, g_frame_header, granuleData, g_sf_band_indices); 
     478                        MPG_Stereo_Process_Intensity_Long (gr, sfb, g_frame_header, granuleData); 
    479479                    } 
    480480 
     
    490490 
    491491                        /* Perform the intensity stereo processing */ 
    492                         MPG_Stereo_Process_Intensity_Short (gr, sfb, g_frame_header, granuleData, g_sf_band_indices); 
     492                        MPG_Stereo_Process_Intensity_Short (gr, sfb, g_frame_header, granuleData); 
    493493                    } 
    494494                } 
     
    502502 
    503503                        /* Perform the intensity stereo processing */ 
    504                         MPG_Stereo_Process_Intensity_Short (gr, sfb, g_frame_header, granuleData, g_sf_band_indices); 
     504                        MPG_Stereo_Process_Intensity_Short (gr, sfb, g_frame_header, granuleData); 
    505505                    } 
    506506                } 
     
    516516 
    517517                    /* Perform the intensity stereo processing */ 
    518                     MPG_Stereo_Process_Intensity_Long (gr, sfb, g_frame_header, granuleData, g_sf_band_indices); 
     518                    MPG_Stereo_Process_Intensity_Long (gr, sfb, g_frame_header, granuleData); 
    519519                } 
    520520            } 
     
    531531//////////////////////////////////////////////////////////////////////////////// 
    532532static void 
    533 MPG_Stereo_Process_Intensity_Long (UINT32 gr, UINT32 sfb, FrameHeader* g_frame_header, GranuleData* granuleData, t_sf_band_indices* g_sf_band_indices) 
     533MPG_Stereo_Process_Intensity_Long (UINT32 gr, UINT32 sfb, FrameHeader* g_frame_header, GranuleData* granuleData) 
    534534{ 
    535535    static int init = 0; 
     
    588588//////////////////////////////////////////////////////////////////////////////// 
    589589static void 
    590 MPG_Stereo_Process_Intensity_Short (UINT32 gr, UINT32 sfb, FrameHeader* g_frame_header, GranuleData* granuleData, t_sf_band_indices* g_sf_band_indices) 
     590MPG_Stereo_Process_Intensity_Short (UINT32 gr, UINT32 sfb, FrameHeader* g_frame_header, GranuleData* granuleData) 
    591591{ 
    592592    UINT32 i; 
  • ForSyDe-SystemC/branches/CoMPSoC/examples/sdf/mp3decoder/readBitstreamAndExtractFrames.cpp

    r32 r33  
    1818/* Function Declaration*/ 
    1919char file_name[256]; 
    20 STATUS MPG_Read_Frame (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, t_sf_band_indices* g_sf_band_indices, FILE* fp); 
     20STATUS MPG_Read_Frame (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, FILE* fp); 
    2121UINT32 MPG_Get_Filepos (FILE* fp); 
    2222STATUS MPG_Read_Header (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, FILE* fp); 
     
    2424void MPG_Decode_L3_Init_Song (); 
    2525STATUS MPG_Read_CRC (FILE* fp); 
    26 STATUS MPG_Read_Audio_L3 (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, t_sf_band_indices* g_sf_band_indices, FILE* fp); 
     26STATUS MPG_Read_Audio_L3 (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, FILE* fp); 
    2727static void MPG_Get_Sideinfo (UINT32 sideinfo_size, FILE* fp); 
    2828STATUS MPG_Get_Bytes (UINT32 no_of_bytes, UINT32 data_vec[], FILE* fp); 
    2929UINT32 MPG_Get_Side_Bits (UINT32 number_of_bits); 
    30 STATUS MPG_Read_Main_L3 (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, t_sf_band_indices* g_sf_band_indices, FILE* fp); 
     30STATUS MPG_Read_Main_L3 (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, FILE* fp); 
    3131UINT32 MPG_Get_Main_Bits (UINT32 number_of_bits); 
    3232static STATUS MPG_Get_Main_Data (UINT32 main_data_size, UINT32 main_data_begin, FILE* fp); 
    3333UINT32 MPG_Get_Main_Pos (); 
    3434static STATUS MPG_Huffman_Decode (UINT32 table_num, INT32 *x, INT32 *y, INT32 *v, INT32 *w); 
    35 void MPG_Read_Huffman (UINT32 part_2_start, UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, t_sf_band_indices* g_sf_band_indices); 
     35void MPG_Read_Huffman (UINT32 part_2_start, UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data); 
    3636UINT32 MPG_Get_Main_Bit (); 
    3737STATUS MPG_Set_Main_Pos (UINT32 bit_pos); 
     
    7979  32000 * Hz 
    8080}; 
    81  
    82 t_sf_band_indices g_sf_band_indices[3 /* Sampling freq. */] = 
    83   { 
    84     { 
    85       { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 52, 62, 74, 90, 110, 134, 162, 
    86         196, 238, 288, 342, 418, 576 }, 
    87       { 0, 4, 8, 12, 16, 22, 30, 40, 52, 66, 84, 106, 136, 192 } 
    88     }, 
    89     { 
    90       { 0, 4, 8, 12, 16, 20, 24, 30, 36, 42, 50, 60, 72, 88, 106, 128, 156, 
    91         190, 230, 276, 330, 384, 576 }, 
    92       { 0, 4, 8, 12, 16, 22, 28, 38, 50, 64, 80, 100, 126, 192 } 
    93     }, 
    94     { 
    95       { 0, 4, 8, 12, 16, 20, 24, 30, 36, 44, 54, 66, 82, 102, 126, 156, 194, 
    96         240, 296, 364, 448, 550, 576 }, 
    97       { 0, 4, 8, 12, 16, 22, 30, 42, 58, 78, 104, 138, 180, 192 } 
    98     } 
    99   }; 
    10081 
    10182static UINT32 mpeg1_scalefac_sizes[16][2 /* slen1, slen2 */] = { 
     
    11596 
    11697 
    117 bool readBitstreamAndExtractFrames(char *file_name, FrameHeader *frameHeader, FrameSideInfo *frameSideInfo, FrameMainData *frameMainData, t_sf_band_indices* g_sf_band_indices){ 
     98bool readBitstreamAndExtractFrames(char *file_name, FrameHeader *frameHeader, FrameSideInfo *frameSideInfo, FrameMainData *frameMainData){ 
    11899 
    119100        /* File open? */ 
     
    126107 
    127108            if (MPG_Get_Filepos (fp) != C_MPG_EOF) { 
    128              MPG_Read_Frame(frameHeader, frameSideInfo, frameMainData, g_sf_band_indices,fp); 
     109             MPG_Read_Frame(frameHeader, frameSideInfo, frameMainData, fp); 
    129110            } 
    130111            else{ 
     
    138119        } 
    139120 
    140 STATUS MPG_Read_Frame (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, t_sf_band_indices* g_sf_band_indices, FILE* fp) 
     121STATUS MPG_Read_Frame (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, FILE* fp) 
    141122{ 
    142123    UINT32 first = 0; 
     
    169150 
    170151        /* Get side info */ 
    171         MPG_Read_Audio_L3 (g_frame_header, g_side_info, g_main_data, g_sf_band_indices, fp); 
     152        MPG_Read_Audio_L3 (g_frame_header, g_side_info, g_main_data, fp); 
    172153 
    173154 
     
    175156 
    176157        /* Get main data (scalefactors and Huffman coded frequency data) */ 
    177         if (MPG_Read_Main_L3 (g_frame_header, g_side_info, g_main_data, g_sf_band_indices, fp) != OK) { 
     158        if (MPG_Read_Main_L3 (g_frame_header, g_side_info, g_main_data, fp) != OK) { 
    178159            return (ERROR); 
    179160        } 
     
    359340} 
    360341 
    361 STATUS MPG_Read_Audio_L3 (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, t_sf_band_indices* g_sf_band_indices, FILE* fp) 
     342STATUS MPG_Read_Audio_L3 (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, FILE* fp) 
    362343{ 
    363344        UINT32 framesize, sideinfo_size, main_data_size; 
     
    517498} 
    518499 
    519 STATUS MPG_Read_Main_L3 (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, t_sf_band_indices* g_sf_band_indices, FILE* fp) 
     500STATUS MPG_Read_Main_L3 (FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, FILE* fp) 
    520501{ 
    521502 
     
    651632 
    652633            /* Read Huffman coded data. Skip stuffing bits. */ 
    653             MPG_Read_Huffman (part_2_start, gr, ch, g_frame_header, g_side_info, g_main_data, g_sf_band_indices); 
     634            MPG_Read_Huffman (part_2_start, gr, ch, g_frame_header, g_side_info, g_main_data); 
    654635 
    655636        } /* end for (gr... */ 
     
    745726} 
    746727 
    747 void MPG_Read_Huffman (UINT32 part_2_start, UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data, t_sf_band_indices* g_sf_band_indices) 
     728void MPG_Read_Huffman (UINT32 part_2_start, UINT32 gr, UINT32 ch, FrameHeader* g_frame_header, FrameSideInfo* g_side_info, FrameMainData* g_main_data) 
    748729{ 
    749730    INT32 x, y, v, w; 
Note: See TracChangeset for help on using the changeset viewer.