[XviD-devel] Bitrate calc bugfix

Dcoder dcoder at alexandria.cc
Sun Jun 6 23:51:56 CEST 2004


Hello guys!

I found a little bug in the vfw bitrate calc today. When using higher 
values for the audio bitrate (eg. 448 and 512), the audio size would be 
negative, and the final bitrate and filesize would get b0rked. I fixed 
it doing:

            if (audio_type!=NO_AUDIO) {
                if (audio_mode==0) {
                    audio_size = (int)(((duration * audio_rate) / (8.0 * 
1024)) * 1000);
                }
            }else{
                audio_size = 0;
            }

in line 934 of config.c. It works ok now, even with really big audio 
bitrates.

Also, i made some changes myself. I added AAC overhead calculation (with 
the option "sbr", so you can choose), and changed the OGM overhead 
formula to one more "accurate".

The code for my changes can be found here: 
http://dc0der.is-a-geek.org/xvid-1.0.1-vfw.zip

Hope this helps :)


More information about the XviD-devel mailing list