HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - Tech => Topic started by: snadge on 2011-06-08 04:01:31

Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: snadge on 2011-06-08 04:01:31
ive been trying to find out which encoder produces the best audio quality at similar bitrates (say 128k) to other lossy encoders - ive seen a couple of reviews and tests and they seem to point to Ogg Vorbis as being the better encoder - I encoded a WAV file to MP3, AAC, WMA & Vorbis all at 128k CBR and while it was hard to tell any difference the Ogg Vorbis was pumping out higher frequencies at 20Khz + and the rest were up to 18Khz (according to spectrum on Foobar2000)

the only gripe is during conversion Ogg Vorbis was the only one that didnt have the Tag info from the WAV file.

can anyone lead me to more listening test results and the likes so i can ascertain for myself? - i would like others views on "best lossy codec" etc

I read on Wikipedia that AAC at 128k is supposedly Transparent to the lossless source according to listening tests by M-PEG for ITU or something? - I was hoping to adopt AAC as my default rip codec as I have an iPod and MP3 player that plays AAC - but Iam in the market for a new media-player so all this is irrelevant as I can buy something to suite.

thanks in advance for replies

please be gentle...im a noob at all this,
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: SonicBooom! on 2011-06-08 04:36:04
I hope I'll not get bashed for I am not truly an expert on this. I haven't tried Ogg Vorbis yet, but if I should choose between AAC (.m4a) and MP3, I would choose MP3. The main reason why is because I apply album gain on all my audio files. To apply album gain to an .m4a file(s), one will use AACgain but upon reading this (from http://altosdesign.com/aacgain/) (http://altosdesign.com/aacgain/)), I thought of reverting back to mp3:
Quote
"UNLIKE MP3GAIN, AACGAIN IS NOT COMPLETELY REVERSIBLE. THE UNDO OPTION IS INTENDED TO RESTORE A MUSIC FILE TO BE FUNCTIONALLY EQUIVALENT TO ITS ORIGINAL STATE, BUT IT WILL NOT BE BIT-FOR-BIT IDENTICAL TO THE ORIGINAL FILE. IT IS POSSIBLE FOR APPLE TO CHANGE THE ITUNES MUSIC FILE FORMAT IN WAYS THAT ARE INCOMPATIBLE WITH AACGAIN, RESULTING TO CORRUPTED MUSIC FILES THAT CANNOT BE RESTORED TO THEIR ORIGINAL STATE."

I don't have enough free space on my hard disk to back up everything and time also for maintaining two identical files. To conclude, if you can discern the difference between an MP3/AAC/WMA and Ogg Vorbis by a matter of 2KHz, then go for Vorbis, but if not, then you have another dilemma on choosing which one of the remaining three to choose  Goodluck!
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: snadge on 2011-06-08 04:58:16
thanks for the info

im glad you told me about replaygain as I use that also - so handy to bear in mind
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: terhardp on 2011-06-08 07:10:39
I'm saying this from my personal view, not based on scientific evidence.

I was in the similar dilemma recently. I was trying to decide which codec to use for 128 kbps VBR encoding for my iPod Nano 2G. Before I've discovered Rockbox, the obvious choice would be AAC 128 kbps VBR, even though I've read and seen some tests that show LAME V5 is not very far away in that range.  But then I've installed Rockbox, which has stable version for my iPod now. Rockbox is great, it has numerious fancy features comparing to the original Apple firmware, but I thought it makes no much practical sense of using it if not using some format that the official FW doesn't support. So, after all the years of using FLAC, LAME and AAC exclusively, I've finally looked at OGG. I'm using the latest version of AoTuV, as I've read that this is optimized at lower bitrates. I've even did couple of ABX tests using the IEM's I'm using mostly with my Nano: Head-Direct RE0. Unlike most people, I treat my iPod differently: I don't listen it in noisy situations; quite the opposite. I'm using it to quickly get to my favourite albums, primarily for inspirational (as a musician and composer) as well as relaxation purposes. So, I'm concerned about transparency. I'm planning to do more testing in the future, but for now, I must say that I'm extremely happy how Vorbis performs at relatively low bitrates (Q4). I also think that the quality / filesize ratio is best for my purpose, given the somewhat limited space (8 GB). No, I'm certainly not a "hamster" when it comes to music, but I still have quite a lot of albums that I like to keep on handy.

The only thing about using Vorbis on my Rockboxed iPod I'm a bit sceptical about is the running time. According to what I've read on Rockbox's site and forums, OGG is rather memory intensive. But the running tests they've made are rather old now, and since both Rockbox and Vorbis are developing, I'm guessing that this isn't that big issue nowdays.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: googlebot on 2011-06-08 07:43:25
What is the best car?
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: Lorem Ipsum on 2011-06-08 08:07:17
The Batmobile.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: Cron on 2011-06-08 08:10:13
What is the best car?

I'm sure choosing a car would be much more straightforward if all of them would cost $0, just like the encoders in question here.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: snadge on 2011-06-08 17:32:02
I'm saying this from my personal view, not based on scientific evidence.

I was in the similar dilemma recently. I was trying to decide which codec to use for 128 kbps VBR encoding for my iPod Nano 2G. Before I've discovered Rockbox, the obvious choice would be AAC 128 kbps VBR, even though I've read and seen some tests that show LAME V5 is not very far away in that range.  But then I've installed Rockbox, which has stable version for my iPod now. Rockbox is great, it has numerious fancy features comparing to the original Apple firmware, but I thought it makes no much practical sense of using it if not using some format that the official FW doesn't support. So, after all the years of using FLAC, LAME and AAC exclusively, I've finally looked at OGG. I'm using the latest version of AoTuV, as I've read that this is optimized at lower bitrates. I've even did couple of ABX tests using the IEM's I'm using mostly with my Nano: Head-Direct RE0. Unlike most people, I treat my iPod differently: I don't listen it in noisy situations; quite the opposite. I'm using it to quickly get to my favourite albums, primarily for inspirational (as a musician and composer) as well as relaxation purposes. So, I'm concerned about transparency. I'm planning to do more testing in the future, but for now, I must say that I'm extremely happy how Vorbis performs at relatively low bitrates (Q4). I also think that the quality / filesize ratio is best for my purpose, given the somewhat limited space (8 GB). No, I'm certainly not a "hamster" when it comes to music, but I still have quite a lot of albums that I like to keep on handy.

The only thing about using Vorbis on my Rockboxed iPod I'm a bit sceptical about is the running time. According to what I've read on Rockbox's site and forums, OGG is rather memory intensive. But the running tests they've made are rather old now, and since both Rockbox and Vorbis are developing, I'm guessing that this isn't that big issue nowdays.


many thanks for that reply

I too was leaning towards OGG but then read about MPC... I dont know of any 'flavours' of encoders that are preferred...perhaps you can help? im using dbPowerAmp with lastest codecs installed - thing is ive run a short listening test and at 128k it sounds transparent (as does the 128k AAC Nero enc) but i noticed on Foobar spectrum eq analyser that when playing the OGG version there are frequencies being played that arent in the original.. I played the FLAC, AAC and OGG (AAC and OGG ripped from the FLAC in dbPowerAmp) and FLAC and AAC play 17Khz+ but OGG is playing frequencies 20Khz+ ...?? is this bad or good? I see some listening test reviewers saying ogg gives off a his and ive noticed in spectrum analysers in some tests that it has the best high end reproduction of the popular codecs... It must be related...the hiss people report, the added high end on my EQ etc..

can you advise of better 'flavour' encoders?  whats difference?

I too have iPod Nano 4G 16Gb - I will have too look into this Rockbox thing

thanks again
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: saratoga on 2011-06-08 18:52:22
I played the FLAC, AAC and OGG (AAC and OGG ripped from the FLAC in dbPowerAmp) and FLAC and AAC play 17Khz+ but OGG is playing frequencies 20Khz+ ...?? is this bad or good?


Its neither.

I see some listening test reviewers saying ogg gives off a his and ive noticed in spectrum analysers in some tests that it has the best high end reproduction of the popular codecs...


spectrum analyser results are meaningless.  Don't waste your time.

I too have iPod Nano 4G 16Gb - I will have too look into this Rockbox thing


Its a little late to ask about Vorbis then.  Unless you're selling that player you're going to be using MP3 or AAC.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: smok3 on 2011-06-08 19:15:38
if planing to rockbox, i would check battery eating state of codecs (maybe musepack can still do better than vorbis here?). On the other hand, Vorbis is well respected in open communities (think linux) if that is of any concern to you.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: C.R.Helmrich on 2011-06-08 19:45:55
@ snadge: regarding quality, have a look at http://www.hydrogenaudio.org/forums/index....showtopic=88023 (http://www.hydrogenaudio.org/forums/index.php?showtopic=88023)

Chris
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: Xanikseo on 2011-06-08 22:03:14
Regarding that link, it's only really useful for very very low bitrates. Once you get above ~96kbps, AAC and vorbis become more comparable. IMO I find that the few compression artefacts that vorbis produce at lower bitrates ~128kbps less "irritating" and "digital" than any AAC ones, so I use vorbis. However I don't really tend to use 128kbps, I use 192kbps since it is above what is generally considered transparent (160kbps), plus it is the bitrate at which lossless stereo coupling is used, so very very few artefacts would reach my ears.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: ExUser on 2011-06-08 22:56:26
However I don't really tend to use 128kbps, I use 192kbps since it is above what is generally considered transparent (160kbps), plus it is the bitrate at which lossless stereo coupling is used, so very very few artefacts would reach my ears.
At this bitrate, my codec of choice would be Musepack, but support is far from universal.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: snadge on 2011-06-09 13:43:37
thanks for all the great replies...

so, do you think people are wasting storage space when they are using 200Kbps+...? as there are no audible differences?

I was thinking of Vorbis @ 170 VBR  (.5)

does CBR have better dynamics than VBR on quieter sections of music? (should I consider CBR over VBR?)

thanks
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: lvqcl on 2011-06-09 13:49:22
Dynamics? What is it?
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: snadge on 2011-06-09 13:56:31
Dynamics? What is it?


have I got it wrong? sorry...noob... Dynamics I thought meant the audible range from low notes to the highest note you can hear? and VBR on quiet sections of music may be cutting out some higher frequencies that may be playing during that section giving it less 'range' where-as CBR would have that constant higher ceiling making the higher notes more audible?? - correct me if im wrong..im still learning

thanks
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: snadge on 2011-06-09 14:03:39
I played the FLAC, AAC and OGG (AAC and OGG ripped from the FLAC in dbPowerAmp) and FLAC and AAC play 17Khz+ but OGG is playing frequencies 20Khz+ ...?? is this bad or good?


Its neither.

I see some listening test reviewers saying ogg gives off a his and ive noticed in spectrum analysers in some tests that it has the best high end reproduction of the popular codecs...


spectrum analyser results are meaningless.  Don't waste your time.

I too have iPod Nano 4G 16Gb - I will have too look into this Rockbox thing


Its a little late to ask about Vorbis then.  Unless you're selling that player you're going to be using MP3 or AAC.


he iPod is actually going to my girlfriend and im getting a new player - i cant find any that play MPC files though as I was also considering this format.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: pdq on 2011-06-09 14:25:00
Dynamics? What is it?


have I got it wrong? sorry...noob... Dynamics I thought meant the audible range from low notes to the highest note you can hear? and VBR on quiet sections of music may be cutting out some higher frequencies that may be playing during that section giving it less 'range' where-as CBR would have that constant higher ceiling making the higher notes more audible?? - correct me if im wrong..im still learning

thanks

Lossy encoders (at least any that I am aware of) do not change frequency response based on loudness. What they do is determine which components are more or less audible, and concentrate the available bits on the more audible sounds (at least this is a very simplified way of looking at it).

Yes, VBR uses less bits where less are needed, but where less are needed the encoded audio tends to be more true to the original, not less. CBR may use more bits than are needed, but that is not an efficient way to do it.

Also, dynamic range does not refer to frequency reponse.

Edit: typo
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: DonP on 2011-06-09 15:26:12
[
he iPod is actually going to my girlfriend and im getting a new player - i cant find any that play MPC files though as I was also considering this format.


As far as I know, your choices for an mpc player are either rockbox or more general purpose devices like android or palm
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: Xanikseo on 2011-06-10 01:00:14
have I got it wrong? sorry...noob... Dynamics I thought meant the audible range from low notes to the highest note you can hear? and VBR on quiet sections of music may be cutting out some higher frequencies that may be playing during that section giving it less 'range' where-as CBR would have that constant higher ceiling making the higher notes more audible?? - correct me if im wrong..im still learning


Yes, VBR uses less bits where less are needed, but where less are needed the encoded audio tends to be more true to the original, not less.

So true. When I see an album/song with a lower bitrate than the target bitrate, I am surer that it is being encoded well - that is, truer to the original. When the bitrate increases, it is a sign that vorbis is less able to encode as accurately, and therefore has to compensate by increasing the bitrate.

I think of VBR as a trick, to make a codec look better than it actually is. VBR means that all the moments in the music that the encoder can't encode well (due to the deficiencies of the design of the codec) can go to ridiculous bitrates to hide the deficiencies of the encoder. But to make up for all the space that has been wasted due to said deficiencies, it cuts back on the bitrate when the encoder comes to a part of the music that the codec can easily handle (where the codec was well designed/thought of). In the end, you have no idea that the codec was struggling to encode part of your file accurately because it all evens out, and you end up getting your target bitrate. Of course if the VBR algorithm itself isn't well designed, then the bitrate will not increase enough at the points where it is needed, and vice versa, and the deficiencies of the encoder are more noticeable. However vorbis has a very good VBR algorithm that has been tweaked a lot over the years by the likes of Aoyumi.

...So back to the point, you should be happy with parts of the file that go below the target bitrate, rather than unhappy.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: dv1989 on 2011-06-10 01:30:52
Yes, VBR uses less bits where less are needed, but where less are needed the encoded audio tends to be more true to the original, not less.
So true. When I see an album/song with a lower bitrate than the target bitrate, I am surer that it is being encoded well - that is, truer to the original. When the bitrate increases, it is a sign that vorbis is less able to encode as accurately, and therefore has to compensate by increasing the bitrate.
Quality setting being equal, from the encoder having to allocate more bits to encode a particular source file, it does not follow that the resulting lossy file is any farther removed from its source than is a file of a lower bitrate from its source. It simply means the encoder judged it required more bits to attain the same (approximate) quality. That’s the entire point of settings based on quality rather than bitrate, after all!

Quote
I think of VBR as a trick, to make a codec look better than it actually is.
Way off track, though there’s little point going into great depth (as if I even could!) when there’s bound to be plenty of documentation on VBR explaining its actual rationale. But in short: The best lossy encoder in the world would still benefit from a VBR model because all passages of audio are not created equal. It has nothing (necessarily) to do with inherent incompetence of either the encoder or its format as a whole.

Quote
But to make up for all the space that has been wasted due to said deficiencies, it cuts back on the bitrate when the encoder comes to a part of the music that the codec can easily handle (where the codec was well designed/thought of). In the end, you have no idea that the codec was struggling to encode part of your file accurately because it all evens out, and you end up getting your target bitrate.
Sounds like ABR to me, your aforementioned misconception notwithstanding.

Quote
Of course if the VBR algorithm itself isn't well designed, then the bitrate will not increase enough at the points where it is needed, and vice versa, and the deficiencies of the encoder are more noticeable. However vorbis has a very good VBR algorithm that has been tweaked a lot over the years by the likes of Aoyumi.
As have the VBR algorithms of all the leading audio codecs. Again, it has nothing to do with intrinsic deficiencies of lossy audio encoding. VBR just is logical given the heterogenous nature of most source material. It makes sense that end-users would prefer oscillating bitrate to disruptive changes in quality.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: smok3 on 2011-06-10 07:10:43
[
he iPod is actually going to my girlfriend and im getting a new player - i cant find any that play MPC files though as I was also considering this format.


As far as I know, your choices for an mpc player are either rockbox or more general purpose devices like android or palm

any recommended player software for android (htc wildfire s with a shiny new 16gig minisd card)? (preferably replaygain aware)
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: DonP on 2011-06-10 12:44:27


As far as I know, your choices for an mpc player are either rockbox or more general purpose devices like android or palm

any recommended player software for android (htc wildfire s with a shiny new 16gig minisd card)? (preferably replaygain aware)


I don't have anything android, but this list of programs supporting mpc has a couple of entries for android.

http://www.musepack.net/index.php?pg=pro (http://www.musepack.net/index.php?pg=pro)
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: saratoga on 2011-06-10 15:32:04
[
he iPod is actually going to my girlfriend and im getting a new player - i cant find any that play MPC files though as I was also considering this format.


As far as I know, your choices for an mpc player are either rockbox or more general purpose devices like android or palm

any recommended player software for android (htc wildfire s with a shiny new 16gig minisd card)? (preferably replaygain aware)


On android, both rockbox or andless (which uses many of the rockbox decoders) support mpc.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: smok3 on 2011-06-12 11:02:42
saratoga, andless is working with my old musepack files, however the gui is useless for vertical placement of the device (think car + navigation + music..), edit: rockbox is well, useless in a car..., ill stick with what poweramp can play (vorbis as well).
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: Xanikseo on 2011-06-12 14:07:33
Quality setting being equal, from the encoder having to allocate more bits to encode a particular source file, it does not follow that the resulting lossy file is any farther removed from its source than is a file of a lower bitrate from its source. It simply means the encoder judged it required more bits to attain the same (approximate) quality. That’s the entire point of settings based on quality rather than bitrate, after all!

Ok that is true, but it is reassuring that the encoder needed fewer bits to handle a particular sample: it's a sign that it can be approximated more efficiently with the encoder used, which is a good thing, rather than something to be worried about. That was my main point.

Way off track, though there’s little point going into great depth (as if I even could!) when there’s bound to be plenty of documentation on VBR explaining its actual rationale. But in short: The best lossy encoder in the world would still benefit from a VBR model because all passages of audio are not created equal. It has nothing (necessarily) to do with inherent incompetence of either the encoder or its format as a whole.

Of course, the whole point of music is that it isn't just one sine wave for about 5 mins, in fact CBR is a pretty dumb idea, apart from the fact that it is the easiest to implement, and you know exactly what the filesize will be in the end.

When I say deficiencies I mean, say for example the encoder can only represent everything sinusoidally, it would not be able to represent a square or triangle wave in terms of sinusoidal waves, so it would have to increase the bitrate to accurately represent that, but if the encoder didn't have that deficiency and could just switch to representing things in square waves, it would not have to increase the bitrate at all. So in a way, VBR tends to be a cheap work around of sorts, as I'm pretty sure a lot of the variation in bitrate could be removed if more flexible algorithms were introduced into the encoder. Therefore in today's context, a higher resulting output bitrate is the sign that it is more likely that there is a part of the music that the encoder can't handle very well with it's current algorithms, which means it's more likely part of the music was not as accurately represented. But as you mention, a perfectly flexible encoder would still have a VBR, as the music itself has varying complexity, but vorbis is not an infallible perfectly flexible format.

Sounds like ABR to me, your aforementioned misconception notwithstanding.

Yes VBR is when one specifies a quality. Quality is dependant on how well the codec can handle the music per bitrate.

effectiveness of encoder (0-1) = (overall perceived quality)*(1-(compression ratio)) ; 0 < overall perceived quality < 1 (lossless or transparent, depending on the encoder's aim), 0 < compression ratio=(uncompressed filesize)/(filesize) < 1
so in other words, a perfectly effective encoder is lossless/transparent and compresses the file into nothing.

=> overall perceived quality = (effectiveness of encoder)/(1-(compression ratio))
Which works for either the whole file, or just a sample of it.

Therefore, since the quality is to be a specified constant, if the bitrate decreases and compression ratio also decreases, the effectiveness of encoder is higher. Which is basically just a mathematical way of saying what I said in my first sentence. Given the encoder seems more effective for a particular sample, it is a sign that the type of sample has been well thought of in the design of the codec, and is less likely to be an inaccurate approximation.

I think of ABR as just a more restricted form of VBR, based on the assumption that each person only has enough space on their DAP for one music file. The thing about vorbis is, the quality settings are pretty much target bitrates, just that the encoder is much more forgiving to itself, and allows itself to deviate much more from the target per file, as after an infinite number of files, the files will tend towards the target bitrate, due to the heterogenous nature of music which you meantioned. So actually, vorbis is trying to get towards a target bitrate, just in a cleverer way, as there will be a standard distribution of bitrates, with the mean being the target bitrate. So when it sounds like ABR, it is, just a lot cleverer, as the main aim of an encoder is to be more effective by decreasing the compression ratio for a given quality. So cutting back on the bitrate when possible is intrinsically part of VBR, not just ABR.

As have the VBR algorithms of all the leading audio codecs. Again, it has nothing to do with intrinsic deficiencies of lossy audio encoding. VBR just is logical given the heterogenous nature of most source material. It makes sense that end-users would prefer oscillating bitrate to disruptive changes in quality.
I know and agree.

I feel we're on the same page, you just misunderstood me.

Wow I've just realised how much I've written, I seem to be repeating myself a lot, maybe I should be some boring lecturer .
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: dv1989 on 2011-06-12 17:16:47
While your post is considered and doesn’t look particularly unreasonable at a glance, I’m afraid this has gone beyond the level of thinking I put in.  One of the many people here with a better understanding of audio encoding than me might try! (And announce my imminent extradition to Dunce’s Island, maybe.)
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: saratoga on 2011-06-12 18:10:35
When I say deficiencies I mean, say for example the encoder can only represent everything sinusoidally, it would not be able to represent a square or triangle wave in terms of sinusoidal waves,


This is a really unfortunate example given that a digital square is exactly defined by a few sin waves. 

So in a way, VBR tends to be a cheap work around of sorts, as I'm pretty sure a lot of the variation in bitrate could be removed if more flexible algorithms were introduced into the encoder.


No this is nonsense.  The instantaneous entropy of audio varies continuously and randomly.  If it didn't you'd just be listening to static . . . 

Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: Xanikseo on 2011-06-12 20:08:13
I do accept that vbr is necessary, music does constantly change in complexity, I just think that with the current state of encoders, some peaks in bitrate may be a necessary evil due to the deficiencies (I'm getting sick of saying this) in the design.

When you say relatively few sine waves (surely that depends on the resolution?), isn't that more than only one that would be necessary if it were simply a sine wave? If there were a square wave mode or something it would surely require less bits than choosing to represent it with sine? Perhaps the square wave was the poor example, but I think you yourself may be able to offer some more potent ones.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: saratoga on 2011-06-12 21:09:26
When you say relatively few sine waves (surely that depends on the resolution?), isn't that more than only one that would be necessary if it were simply a sine wave? If there were a square wave mode or something it would surely require less bits than choosing to represent it with sine? Perhaps the square wave was the poor example, but I think you yourself may be able to offer some more potent ones.


How about sin functions, since thats what pretty much every codec uses.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: Xanikseo on 2011-06-13 00:09:22
I meant what kind of signal would represent a problem to encoders? Well rather than square waves, which you claim aren't (although I reckon you could decrease bitrate by representing it using a straight forward square wave function for example).

Maybe you could improve encoders by using techniques that don't just use sin?
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: [JAZ] on 2011-06-13 09:46:14
@Xanikseo: While everything is representable by series of sine waves, only a square wave is representable by a square wave (that is, without applying a filter after that, which makes it more like a sine wave).  Only chip music (i.e. music using/emulating old computer audio chips) could potentially benefit from that suggestion.
Let's put another example: If i add to an encoder the possibility to encode the vowels using a model (in fact, that's what speech codecs do), first, i would need deconstruct the sound to separate the speech from the audio, and second, the model may be good for unaltered voice, but in music, that's not necessarily the case.

In the end, lossy encoding is always based on transmiting information about the signal instead of the signal itself. The transformation to sine wave series is just one such way. SBR and Parametric encoding is another way. Modeling (like in speech codecs) is another way. They can be combined, but the more you focus on a specific case, the less applicable it is to other cases (And you would have an increase of cpu, memory and disk usage of the encoder/decoder).


I believe you were trying to say that, to avoid the increase of bitrate needed for complexs parts of the signal, the encoder changed to another way to represent it, so that it could encode that part with fewer bits.
This isn't something new, and in fact it is being done in many encoders. Temporal noise shaping, noise normalization,... those are just some tools used in specific situations to send information about the signal.

In this regard, the best encoder could be the one that could use all the tools available in all circumstances (Like, for example, aplying SBR to a part of the signal without being necesary to use it for all content above a specific frequency band), but that means the stream needs more information to inform when these tools are activated and deactivated, so it is only applicable on the higher end of the bitrate range.
And the truth is that development has focused on the lower end (to add more channels, to be used with video... etc...)
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: saratoga on 2011-06-13 17:14:40

@Xanikseo: While everything is representable by series of sine waves, only a square wave is representable by a square wave (that is, without applying a filter after that, which makes it more like a sine wave).


Since you can make a sin wav from sampled square waves, I disagree ;)

But you're right, it is silly to use square waves as your basis function when you can use sin waves and take advantage of all the math developed for harmonic analysis and discrete fourier transforms.
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: Xanikseo on 2011-06-15 23:20:45
I never said that you should use a square waves as the basis function, but only when it would be appropriate, ie when it would reduce the bitrate. Unfortunately, square waves were a bad example, as they do not occur so often in music, but the idea is there - that there are samples that are very hard to approximate using sine waves. Yes there are many advantages to using sine waves, since it is an area of Mathematics that is very well covered. Perhaps we are starting to reach the boundaries in that area, and it is time to explore other ways of approximating signals which should be used when sine waves would be less effective.

By the way, it is not possible to produce a sine wave with square wave samples, as you would need an infinite amount of them to produce a perfectly smooth sine wave curve. The only reason sine waves are used in audio compression is because it is (mostly correctly) assumed that the smoothness of the sine curve was lost when the sample rate decreased from an infinitely high frequency to a meagre 44.1KHz (for example). Similarly, you can only reproduce a perfect square wave with an infinite sum of sine wave, which is why I suggested a square wave mode, but apparently square waves are not a common occurrence in music.

According to the most recent listening test for low bitrates, CELT performed the best. IIRC this is due to the fact that as little of the bitstream as possible is used for defining things like switching block sizes / encoding modes etc. This fits with what you were saying, Jaz, that the lower overhead is of an advantage at very low bitrates. Apparently this also causes the bitrate to be a sort-of restrained VBR, in that the bitrate does not jump suddenly, but changes gradually. It is interesting that CELT does so well, considering the amount of compromises that were involved in the design of the codec.

However I still feel more flexibility would result in lower overall bitrates in certain circumstances and less needs for jumps in bitrate. Perhaps a more flexible way of informing the decoder when to activate and deactivate each "encoding mode" is needed (are these sorts of things CBR?, as in, is there always the same amount of information given to the decoder per second about this? Perhaps this should also be VBR-ised. If one "encoding mode" was used for 10 seconds without changing, it would be pointless to keep telling the encoder every 100th of a second that it should keep using the same "encoding mode"!). This will probably result in a higher memory usage though...
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: K-Meleon on 2011-06-16 07:25:04
@OP: This test shows that 96 kbps QuickTime AAC is superior to Lame -v5, so at 128 kbps it should be much better: http://www.hydrogenaudio.org/forums/index....showtopic=66949 (http://www.hydrogenaudio.org/forums/index.php?showtopic=66949)

You can encode to qtaacenc using foobar: http://www.hydrogenaudio.org/forums/index....showtopic=78072 (http://www.hydrogenaudio.org/forums/index.php?showtopic=78072)

I'm happy with Q65, which actually averages out to about 120 kbps in my collection.

Granted, I haven't tried Ogg Vorbis and can't speak for or against its quality, but AAC is a native codec to the iPod, and you won't have to muck around with alternate firmwares, etc. to get vorbis working.

(Edit: Whoops, didn't see that you gave your iPod away. Still, AAC is much more widely supported than ogg vorbis...)
Title: is Ogg Vorbis the best Lossy encoder? (what is?)
Post by: B7k on 2011-06-27 06:47:09
@OP: This test shows that 96 kbps QuickTime AAC is superior to Lame -v5, so at 128 kbps it should be much better: http://www.hydrogenaudio.org/forums/index....showtopic=66949 (http://www.hydrogenaudio.org/forums/index.php?showtopic=66949)

You can encode to qtaacenc using foobar: http://www.hydrogenaudio.org/forums/index....showtopic=78072 (http://www.hydrogenaudio.org/forums/index.php?showtopic=78072)

I'm happy with Q65, which actually averages out to about 120 kbps in my collection.

Granted, I haven't tried Ogg Vorbis and can't speak for or against its quality, but AAC is a native codec to the iPod, and you won't have to muck around with alternate firmwares, etc. to get vorbis working.

(Edit: Whoops, didn't see that you gave your iPod away. Still, AAC is much more widely supported than ogg vorbis...)

Their are many devices that can play vorbis check out http://wiki.xiph.org/PortablePlayers (http://wiki.xiph.org/PortablePlayers) and don't forget that the droids can play vorbis as well bye bye Iphone. Apples ipod firmware is a joke with rockbox on the Ipod you have so much more control over the sound of you're player with a full EQ no crappy presets. also you're ipod turns into a portable hdd that can be plugged and played with any pc and dose not need Itunes.