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: Serious problem with Oggenc (Read 7098 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Serious problem with Oggenc

Reply #1
Thanks for posting the clip, Ivan.  I tested it using the RC3 encoder, and also found ogg to have a lot of trouble.  So it's not just because you're using a pre-rc3 encoder.

None of the quality settings could handle the clip.  -q 10.0 put out a file with an average bitrate of 49 kbps.

I encoded using the cbr setting, first set to 128.  The output file had an average bitrate of 116, and the difference was still noticeable.  Then I encoded using the cbr setting at 200.  The output file had an average bitrate of 130, and this time I couldn't tell the difference between the ogg and the wav.  Better ears and speakers may be able to tell taht difference, though.

Ogg encodes the tone itself seemingly fine, but adds this tinny background ringing buzz which is incredibly annoying.  Not a good thing.  This potentially points to a couple problems:

1.  The tinny ring in the background may be related to the exaggerated brightness that a lot of people have noticed in ogg-encoded files.  This isn't very noticeable or annoying within songs with a lot of different sounds going on, but a clip where it can be isolated - like the one in question here - points out a serious problem with the encoder algorithm.

2.  The algorithm which decides the output bitrate when using the quality settings may need to be "smartened" so that it puts out a higher average bitrate for clips which it can't handle, such as this one.  Even if this is fixed, however, vorbis should be able to handle such a sound clip at lower bitrates.
God kills a kitten every time you encode with CBR 320

Serious problem with Oggenc

Reply #2
Surprisingly, I had very big problems with this clip during early stage of PsyTEL AACEnc development (mid 2000), no matter how encoding of 1k sine wave might sound easy, there is a lot of room for mistakes, like bad tonality estimation and modulating more noise than allowed.

I think that Liquifier 4.0 also has problems with this on bitrates lower than 128 kbps, 44.1 kHz

Serious problem with Oggenc

Reply #3
Ivan-
    did the problems that early versions of PsyTEL AACEnc  had with this clip sound similar to the problem that ogg has with it?
God kills a kitten every time you encode with CBR 320

Serious problem with Oggenc

Reply #4
Quote
Originally posted by timcupery 1.  The tinny ring in the background may be related to the exaggerated brightness that a lot of people have noticed in ogg-encoded files.
I wouldn't make this kind of conclusions about purely tonal sine wave regarding music encoding in general...
Juha Laaksonheimo

Serious problem with Oggenc

Reply #5
Hmm.. can't remember, but I think there were "buzz" like sounds, too.

Serious problem with Oggenc

Reply #6
Quote
Originally posted by JohnV
I wouldn't make this kind of conclusions about purely tonal sine wave regarding music encoding in general...


Well, it is a bug - and it should be fixed, because other codecs do not produce this bug.

Serious problem with Oggenc

Reply #7
Quote
Originally posted by Ivan Dimkovic


Well, it is a bug - and it should be fixed, because other codecs do not produce this bug.


Have you mailed it to Monty?

[a href='mailto:monty@xiph.org'][/a]

--
GCP

Serious problem with Oggenc

Reply #8
I will right now

Serious problem with Oggenc

Reply #9
Quote
Originally posted by timcupery

Ogg encodes the tone itself seemingly fine, but adds this tinny background ringing buzz which is incredibly annoying.  Not a good thing.  This potentially points to a couple problems:


...thanks for the wild speculation rather than any concrete testing.  After all, starting a raft of rumors is a lot more fun than figuring out what is actually wrong.

Quote
1.  The tinny ring in the background may be related to the exaggerated brightness that a lot of people have noticed in ogg-encoded files.  This isn't very noticeable or annoying within songs with a lot of different sounds going on, but a clip where it can be isolated - like the one in question here - points out a serious problem with the encoder algorithm.


"Wrong."

Quote
2.  The algorithm which decides the output bitrate when using the quality settings may need to be "smartened" so that it puts out a higher average bitrate for clips which it can't handle, such as this one.  Even if this is fixed, however, vorbis should be able to handle such a sound clip at lower bitrates.


"Wrong again."

The answer you're looking for is one of:

a) 'clipping'
b) 'clipping'
c) 'clipping'

...and this has been discussed absolutely to death on several forums.

Here's a neat little experiment you can do yourself: attenuate a few dB and try again.  It is *not* the responsibility of the encoder/decoder to deal with the clipping case, and you'll find messages, after searching, that explain why.  Try Google, or the mail archive search at xiph.org.

[evil]Monty

Serious problem with Oggenc

Reply #10
For anyone who still doesn't understand: the correct answer is b).

Segher

Serious problem with Oggenc

Reply #11
Humm, I thought Ivan wouldn't post this if it was the usual problem - clipping??
Juha Laaksonheimo

Serious problem with Oggenc

Reply #12
hmm.. I am sorry if this has been discussed before, but since other codecs encode this file properly I thought it might be a bug of some sort in Oggenc..

anyway I >think< it should be encoded properly.

Serious problem with Oggenc

Reply #13
Quote
Originally posted by Ivan Dimkovic
hmm.. I am sorry if this has been discussed before, but since other codecs encode this file properly I thought it might be a bug of some sort in Oggenc..

anyway I >think< it should be encoded properly.


It is.  And it's also *decoded* properly.... to slightly above the original range (fractions of a dB.  It's that way because, sans clipping, it's inaudible.)  The last step (float to 16 bit) is where the clipping is happening.  So either attenuate decode, or use something like replaygain.

Monty

Serious problem with Oggenc

Reply #14
Yeah, it's clipping. Though I thought Ivan wouldn't post clipping problem and RC3 was supposed to have somekind of clipping protection.

Buut it was the usual..
Juha Laaksonheimo

Serious problem with Oggenc

Reply #15
BTW, Peter has implemented replaygain in the most recent WinAmp plugin, and Garf [I think] wrote a command line replaygain tagger for Ogg.

Monty

Serious problem with Oggenc

Reply #16
And what's Ogg's problem with Suzan Vega's - Tom's Diner?

Serious problem with Oggenc

Reply #17
I remembered the ReplayGain announcement mail very poorly.  Support is in XMMS, not WinAmp, and it was GCP who implemented it.  Quoting the mail:

Quote
Hi all,

I have implemented ReplayGain support for Vorbis.

If you are not familiar with it, it is basically
a method of making sure all your files have equal loudness,
remove the need for normalization and prevent clipping
during playback. The process is totally lossless,
and supporting it requires minimal work.

More info about the exact workings can
be found on www.replaygain.org (recommended reading) 

The support consists of three levels:

a) An agreed tag format for storing the ReplayGain
data. I hereby propose:

RG_RADIO=+0.0 dB
RG_AUDIOPHILE=+0.0 dB
RG_PEAK=1.000

The exact meaning of these values is described
on www.replaygain.org. This format should be
self-explanatory otherwhise. Note that the Vorbis
version has a human-readable form, in accordance
with the fact the they are in the 'comment' field
of a Vorbis file.

If possible, and if this format is agreeable
for everyone, I would ask that they be included
in the Vorbis comment/tag format documentation.


b) An analysis program, that reads .ogg files,
calculates the correct gain values, and stores
them back into the oggs as tags.

This program is already written and available at
http://sjeng.org/ftp/vorbis/ReplayGain-0.3.tar.gz.
It should work on both Unix and Windows, although I
have not tried it on the latter yet.

Usage is as simple as:

replaygain <file1> <file2> <...>

It also supports

replaygain -a <track1> <track2> <...>

to perform 'Audiophile Gain' analysis. This stores
additional ReplayGain values for entire albums.


c) The decoder software

ReplayGain must be supported by the decoder/player to
have any effect. If the decoder/player does not support
ReplayGain, the files will still play as usual.
In fact, nothing will change.

Basic support can be done in a minimal amount of
code:

1) Read out the RG_RADIO tag
2) Calculate scale = 10^(RG_RADIO/20)
3) Multiply all PCM samples with 'scale'

That's it!

If the decoder author wishes to do so, he can also
add support for more advanced features (in order
of complexity):

4) Offer a selection between 'Radio' and 'Audiophile'
ReplayGain and use RG_RADIO or RG_AUDIOPHILE depending
on the selection. (trivial)

5) Use the RG_PEAK value to prevent clipping and thus
improve audio quality. (also very easy, see example code)

6) Implement a preamp and a hard limiter to allow the
user to increase the loudness without causing the audio
to clip. (more tricky to do fast)

Example code, including all of the 'advanced' features is provided
in the form of an enhanced XMMS decoder with ReplayGain support
at:

http://sjeng.org/ftp/vorbis/ReplayGain-XMMS-0.2.tar.gz

Serious problem with Oggenc

Reply #18
Quote
Originally posted by xiphmont
BTW, Peter has implemented replaygain in the most recent WinAmp plugin


Not yet.

--
GCP

Serious problem with Oggenc

Reply #19
I normalized Ivan's 1k.wav file to 98% using EAC, and encoded the result at -q 4.9.  Could still hear the tinny background ring, clipping evidence.
Normalized the 1k file to 95%, same encode, this time it sounded perfect.  Hope that this is helpful in some way or another.  And may [evil] monty please forgive my wild speculation (i.e., hypothesizing) above.
God kills a kitten every time you encode with CBR 320

Serious problem with Oggenc

Reply #20
Quote
Originally posted by timcupery
I normalized Ivan's 1k.wav file to 98% using EAC, and encoded the result at -q 4.9.  Could still hear the tinny background ring, clipping evidence.
Normalized the 1k file to 95%, same encode, this time it sounded perfect.  Hope that this is helpful in some way or another.  And may [evil] monty please forgive my wild speculation (i.e., hypothesizing) above.


ReplayGain data:

Code: [Select]
Running in Radio/Single Track mode

Analyzing...

  Gain   |  Peak  | Scale | New Peak | Track

---------------------------------------------

-14.16 dB |  33467 |  0.20 |     6556 | 1k.ogg

Done.


Looking at the peak value, we see that you need to normalize to at most 97% for the clipping to disappear. Or run ReplayGain on the ogg, of course

--
GCP


Serious problem with Oggenc

Reply #22
Hmm, I was suspicious at first because:

a) You're using -b (NEVER do that)

b) The signal was so low in level that the amplitude differences may have been inaudible.

So I tested again, with a louder sweep (that still wasn't clipping) and encoded it with -q0.

I can positively ABX the result (18/20).

Eeps. Weird.

Edit: The problem disappears if you up the quality level.

--
GCP

 

Serious problem with Oggenc

Reply #23
This kind of problem may audibly manifest itself, then, in samples like rach_original.wav and deerhunter.wav, at -q0.

ff123