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: Lossy-Lossy transcoding (Read 9418 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Lossy-Lossy transcoding

As I've heard numerous times, lossy-to-lossy is BAD, I know this, please don't point this out anymore, it's an established point.

However, I'm looking to find out, what happens in this given situation:
FLAC->MP3 320 CBR->MP3 192 CBR
that is different from
FLAC->MP3 192 CBR

Oh, but you lose quality between 320->192... YES, but you lose even more quality between FLAC->192. Of course, I do NOT know how encoders work, but I'm tired of people not knowing about transcoders try to tell me that "it's just different and i will not tell you how". My very simplistic view is that it is a layer cake, FLAC being 5 layers, 320 being 4 layer and 192 being 2 layers, and that with 320->192 you're just removing another layer. I know this is wrong, and I'm trying to find out what is really going on in transcoding, that makes the two things different.
Thanks to anyone willing to help me with this

Lossy-Lossy transcoding

Reply #1
As I've heard numerous times, lossy-to-lossy is BAD, I know this, please don't point this out anymore, it's an established point.

However, I'm looking to find out, what happens in this given situation:
FLAC->MP3 320 CBR->MP3 192 CBR
that is different from
FLAC->MP3 192 CBR

Oh, but you lose quality between 320->192... YES, but you lose even more quality between FLAC->192. Of course, I do NOT know how encoders work, but I'm tired of people not knowing about transcoders try to tell me that "it's just different and i will not tell you how". My very simplistic view is that it is a layer cake, FLAC being 5 layers, 320 being 4 layer and 192 being 2 layers, and that with 320->192 you're just removing another layer. I know this is wrong, and I'm trying to find out what is really going on in transcoding, that makes the two things different.
Thanks to anyone willing to help me with this


As a very general explanation, MP3 works by replacing audio data with "close enough" data.  If you've taken some science courses, think of this as reducing the number of significant figures for parts of the audio spectrum deemed unimportant.

When you re-encode to a lower bitrate, the MP3 encoder doesn't know that some sections are of the audio were approximated and will apply a new approximation that might change the value to something even further from its original value.

Or, put another way, the second MP3 encoder can't tell the difference between legitimately important audio and audio that was distorted by the first encoder.

In theory, an MP3->MP3 downcoder would be written that reads the scalefactors from the first file and never adds precision, only reduces it further.  This has been discussed numerous times on Hydrogenaudio, but to my knowledge there has never been an implementation of it.


Lossy-Lossy transcoding

Reply #3
Well... I think there's a lot of ways one could try to explain this to you... I have come up with one:

Think of it as if you have rabbits and you want them to breed. If you use lossless encoding, you use two of the healthiest of your rabbits, which are not related, to breed and produce perfect offspring. If you however use lossy encoding, you use two rabbits, who are related, you risk that their offspring will have genetic defects, which will be the result of "amplification" of the bad genes that the two parent-siblings had in common and is then even worse with their offspring. And if you repeat with inbreeding another generation further, it gets even worse.

That's why FLAC -> MP3 192 CBR is less likely to produce a file with noticeable artifacts (bad genes), because it hapened only in one generation and if you do FLAC -> MP3 320 CBR -> MP3 192 CBR you have two generations of "inbreeding".

I hope this helps you understand a bit more.
lame -V 0

Lossy-Lossy transcoding

Reply #4
As a very general explanation, MP3 works by replacing audio data with "close enough" data.  If you've taken some science courses, think of this as reducing the number of significant figures for parts of the audio spectrum deemed unimportant.

When you re-encode to a lower bitrate, the MP3 encoder doesn't know that some sections are of the audio were approximated and will apply a new approximation that might change the value to something even further from its original value.

Or, put another way, the second MP3 encoder can't tell the difference between legitimately important audio and audio that was distorted by the first encoder.

In theory, an MP3->MP3 downcoder would be written that reads the scalefactors from the first file and never adds precision, only reduces it further.  This has been discussed numerous times on Hydrogenaudio, but to my knowledge there has never been an implementation of it.

Thank you VERY much, this answered my question.
So, if I get it right, it transcodes "replaced audio" from the lossy, while on the lossless, it would transcode original audio. I had the understanding that it worked as your described with your theoretical MP3 downcoder. Would it be possible to create such a program, and it just hasn't been created yet, or is it too problematic?

Lossy-Lossy transcoding

Reply #5
Another possible method in the same vein as benski’s suggestion is bitrate peeling, but that’s met with only barely more success.

Lossy-Lossy transcoding

Reply #6
It's really simple. mp3 encoders smear the audio in both the time and frequency domains, as well as adding noise. You could look at the smearing as a form of noise. They get away with this because a limited amount of smearing and noise (in the right places) is inaudible - it's hidden by comparable smearing and noise that already exists in our ears.

If one encoding step does as much smearing as possible without introducing audible problems, it's obvious that extra smearing from a second encoding step can take things past the threshold of audibility into the area where you can hear something has changed.

The exact same thing applies to adding noise. If you add as much as possible without it being audible first time around, then adding any second time around is going to make it audible.

Lossy codecs don't work so cleanly (sometimes it sounds bad first time, other times it sounds fine after two generations), but that's the principle.

Cheers,
David.

Lossy-Lossy transcoding

Reply #7
In addition - and maybe I read over this because I'm impatient, a bit - lossy encoding also finds "artifacts", and not just a lack of data, and tries to encode those as if they were original audio as well, so now you have artifacted artifacts.  I'm aware that's not the most technical explanation in the world, but that's another concern.  Again, not everyone - in fact, very few - hear these artifacts up to a certain point.  I'm 100% sure there's SOME music in my library from my days of not knowing better which is transcoded, and I have a hell of a time figuring out which except in extreme examples (128-160 bitrates, generally).