Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: MP3 Bitreservoir (Read 2109 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

MP3 Bitreservoir

Greetings.. I'm studying the source code from dist10 ( In C languaje) and I can't understand how the bit reservoir is working...
Code: [Select]
             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