MP3 Bit reservoir: dist10 source code

Status
Not open for further replies.

pablogog

Newbie level 1
Joined
Feb 23, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Pereira, Colômbia
Activity points
1,286
Greetings.. I'm studying the source code from dist10 ( In C languaje) and I can't understand how the bit reservoir is working...


Code:
             if ( flush_main=(hsstell() % bitsPerSlot) ) {
                hgetbits((int)(bitsPerSlot - flush_main));
        main_data_end ++;
         }


             bytes_to_discard = frame_start - main_data_end
                        - III_side_info.main_data_begin;



             if( main_data_end > 4096 )
             {   frame_start -= 4096;
                 rewindNbytes( 4096 );
             }// ???

             frame_start += main_data_slots(fr_ps);
             {//Notes
                    /*ES: Se suma la cantidad de bytes que comprende el main data
                    al frame_start*/
             }


             if (bytes_to_discard < 0) {
         printf("Not enough main data to decode frame %d.  Frame discarded.\n",
                        frameNum - 1); break;
             }



             for (; bytes_to_discard > 0; bytes_to_discard--) hgetbits(8);


Perhaps somebody understood this??? The disto10 source code can be founded here: http://mp3-tech.org/programmer/sources/dist10.tgz



Many thanks for any answer
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…