[tremor] Bug fix and question

Tim Norman tim at normsoft.com
Sun Nov 24 17:57:21 PST 2002



I found a small bug in ov_bitrate_instant (diffs included below).  It
would have worked fine with floating point, but there's a singnificant
loss of precision with integer math unless you reorder the operations.

Does anyone know how WinAmp computes instantaneous bitrate for OGG
files?  With this bug fix, using ov_bitrate_instant from Tremor seems to
produce values that are consistently about 20 kbps lower than what
WinAmp shows...  Who's right?

Thanks,
Tim Norman
www.normsoft.com

<p>diff -c -r1.4 vorbisfile.c
*** vorbisfile.c        16 Oct 2002 08:16:11 -0000      1.4
--- vorbisfile.c        25 Nov 2002 01:48:52 -0000
***************
*** 758,764 ****
    long ret;
    if(vf->ready_state<OPENED)return(OV_EINVAL);
    if(vf->samptrack==0)return(OV_FALSE);
!   ret=vf->bittrack/vf->samptrack*vf->vi[link].rate;
    vf->bittrack=0;
    vf->samptrack=0;
    return(ret);
--- 758,764 ----
    long ret;
    if(vf->ready_state<OPENED)return(OV_EINVAL);
    if(vf->samptrack==0)return(OV_FALSE);
!   ret=vf->bittrack*vf->vi[link].rate/vf->samptrack;
    vf->bittrack=0;
    vf->samptrack=0;
    return(ret);

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'tremor-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Tremor mailing list