[vorbis] Problem with nominal bitrates

Nick Gisburne post at KaraokeBuilder.com
Tue Aug 20 16:06:26 PDT 2002



I'm tentatively creating a Windows .dll file using the Vorbis tools
demos as a base for it.  I've taken oggenc and simply converted it into
a .dll file, with some minor changes purely to pass parameters to it
(the original uses the command line).

I have it working as far as it goes, but there seems to be something
going wrong deep inside that I don't understand.

The line at fault appears to be in the oe_encode function in the file
encode.c:

    vorbis_encode_setup_init(&vi);

This is what I do (refer to the docs for oggenc and again bear in mind
that I've simply taken the code and added a few headers). The command
line equivalent for these tests would be:

    oggenc myfile.wav -b64  (or -b51, and so on)

I set the nominal bitrate to 64 and start the encoding. I inspect the
following variable, just after the above-mentioned line of code:

    vi.bitrate_nominal
    
The value is 64000 as expected (ie 64 * 1000)

If I now encode something else, with 51, the value for
vi.bitrate_nominal is 50999, ie 1 less than expected.

I could live with that if it was normal behaviour (though I expected it
to be 51000), if it was not for the following:

When I start again (ie reload the .dll and its calling program) and
start off with a nominal bitrate of 51, the value for vi.bitrate_nominal
is now 51000 (what I would expect, rather than 50999 which I had
earlier).

It seems that something, somewhere, has a memory about what went before,
and if you encode for the second time it will mess up the results. This
may be a bug because it only happens in a very small number of cases.
I've only found two - 51 gives 50999 and 50 gives 49999.

It does look bad because I encode at 51, play the .ogg file in Winamp,
and see it reported as 50 kbps and not 51.

Does anyone know what is going on in vorbis_encode_setup_init which
might be causing this?

Nick Gisburne

PS Early tests lead me to believe there might be similar problems if you
set the min/max bitrates - again the problem rates are 50/51kbps

<p><p><p>--- >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 'vorbis-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 Vorbis mailing list