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: AAC to AAC loss of quality (Read 13569 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

AAC to AAC loss of quality

This is a terribly noobish question but google search after google search could not give me an answer. 

I have a double album that was well encoded at 256 kbps.  The files were all converted on itunes from 256 aac to 256 aac (I know.  Who does such a thing?  ). 

Will there be any quality loss if the conversion was in the same format and same size?  256 aac to 256 aac?



thanks


 


AAC to AAC loss of quality

Reply #3
Will there be any quality loss if the conversion was in the same format and same size?  256 aac to 256 aac?

Yes.

Can you hear it? Probably not: http://www.hydrogenaudio.org/forums/index....howtopic=100067

Thank you.


That said, it's generally not recommended. When you transcode as in your example, internally the codec is first effectively reconstituting a waveform to PCM then immediately recompressing.

What you irreparably lose is the fine detail in high frequencies, complex frequency content subsequently masked by the perceptual model, some time domain resolution and some stereo information. Lossy codecs aren't best suited to being fed audio that's already been through the wash once, so results become unpredictable (increased janglies, smearing, graininess, loss of clarity.)

Even with high bitrate lossy sources, your compression ratio is still phenomenal - i.e., loads of data already thrown away - so the encoder doesn't get much to work with for starters.

Liken it to rescanning and reprinting an already-printed scan of a photo.
Don't forget International Talk Like A Pirate Day! September the 19th!

AAC to AAC loss of quality

Reply #4
Will there be any quality loss if the conversion was in the same format and same size?  256 aac to 256 aac?

Yes.

Can you hear it? Probably not: http://www.hydrogenaudio.org/forums/index....howtopic=100067

Thank you.


That said, it's generally not recommended. When you transcode as in your example, internally the codec is first effectively reconstituting a waveform to PCM then immediately recompressing.

What you irreparably lose is the fine detail in high frequencies, complex frequency content subsequently masked by the perceptual model, some time domain resolution and some stereo information. Lossy codecs aren't best suited to being fed audio that's already been through the wash once, so results become unpredictable (increased janglies, smearing, graininess, loss of clarity.)

Even with high bitrate lossy sources, your compression ratio is still phenomenal - i.e., loads of data already thrown away - so the encoder doesn't get much to work with for starters.

Liken it to rescanning and reprinting an already-printed scan of a photo.

Hmm.  Somehow I had thought things were more efficient in the digital age.  You make it sound like when I taped cds for my walkman. 

AAC to AAC loss of quality

Reply #5
Some formats are worse than others.

It's highly unlikely that you're going to hear any difference if you transcode as described in your initial post.

ABX is your friend.

AAC to AAC loss of quality

Reply #6
You will if there is any critical material. It probably won't be too too too bad.

Please look at the last 4 slides of www.aes.org/sections/pnw/ppt.htm in the "perceptual coding tutorial".
-----
J. D. (jj) Johnston


AAC to AAC loss of quality

Reply #8
What I do when I have to transcode, is to mark it in file names. Like, file.mpc¤.m4a would tell me it was an mpc, and then I know I have a source to fetch a better file from should it not be good enough.

Somehow I had thought things were more efficient in the digital age.  You make it sound like when I taped cds for my walkman. 


I have asked the question a few times, why isn't it possible? And as far as I can understand the answer, it is a bit like trying to .zip an encrypted file. Which also in principle should be possible, as the encrypted file does not have any more information than the unencrypted, but you could try - it won't help much. And in both cases is trivial in theory but infeasible in practice - you can by brute force crack encryption, and you can by brute force find a 256 k AAC file which sounds indistinguishable from another 256 k AAC file (you just generate all possible 256 k AAC files of the same length ...).

AAC to AAC loss of quality

Reply #9
Hmm.  Somehow I had thought things were more efficient in the digital age.  You make it sound like when I taped cds for my walkman. 

Transcoding is usually done by decoding + re-encoding. After decoding, not only you have degraded input that is more or less different from the reference (like broken telephone), but also any information about the original compression is lost (so you cannot make use of it).

Working directly on the compressed domain (without decoding) might make it more efficient as you say, but I dunno.


AAC to AAC loss of quality

Reply #11
I have asked the question a few times, why isn't it possible?


The data is already been through lossy quantization.  How exactly would you do any better than just decoding it to PCM?  I guess you could look at the quantized values and restrict the transcoder to quantization that is equal or coarser then the original, but that might not even be possible unless you're going to force the new bitrate to use the same block sizes as the old, which might work quite badly if the bitrates are very different.  Probably though if you want to go from 256k to 64k you will not want to use the same transform sizes, in which case you will end up requantizing everything anyway.   

AAC to AAC loss of quality

Reply #12
In general I would say that if at least one of the bitrates, source or destination, is fairly high then you are probably OK (high to low, low to high, or high to high). If you are transcoding from low bitrate to low bitrate that is when you are most likely to be adding audible artifacts.

AAC to AAC loss of quality

Reply #13
I have asked the question a few times, why isn't it possible?


The data is already been through lossy quantization.  How exactly would you do any better than just decoding it to PCM? 


Me? The same way as I usually encode - start an application somebody else has written ...

Now the point is: If you have a 4 MB file that unpacks to a 30 MB file, then it we know for a fact that those 4 megabytes contain precisely the same information as the 30 megabytes - i.e., it is possible to losslessly compress those 30 down to 4. "Possible" except nobody knows how (except keep it and delete the unpacked one).

AAC to AAC loss of quality

Reply #14
Me? The same way as I usually encode - start an application somebody else has written ...


No I mean logically.  Without knowing what the original lossless data was, you need someway to use extra additional 'clues' from the the compressed audio stream that aren't in the decompressed PCM.  There are some; the transform sizes used, the quantization levels per frequency domain coefficient, and the stereo modes, but how do you use these to do something useful?  Its not clear to me that you can. 

Now the point is: If you have a 4 MB file that unpacks to a 30 MB file, then it we know for a fact that those 4 megabytes contain precisely the same information as the 30 megabytes - i.e., it is possible to losslessly compress those 30 down to 4.


In general you can define an infinite number of mappings between bitstreams of different lengths (although they will not be bijective).  But to what end?  Its not clear to me how you would do something useful with the information that a specific one exists . . . 

AAC to AAC loss of quality

Reply #15
No I mean logically.


Logically it is trivial, so I suspect we are talking about completely different things.

What I mean, is that there is nothing - logically - that says you get any quality loss whatsoever by transcoding AAC@256 into AAC@256. In fact, there is a trivial but infeasibly slow way to do so, losslessly.
As it is trivial in theory, what needs to be explained is why nobody has found a way to even transcode an AAC@256 - or even an  AAC@64 - into an AAC@256 without loss if information.
Especially since we consider state-of-the-art data compressing algorithms to be "quite good". (Which leads me to point out that although they are "quite good" most of the time, they are easy to fool.)

AAC to AAC loss of quality

Reply #16
As it is trivial in theory, what needs to be explained is why nobody has found a way to even transcode an AAC@256 - or even an  AAC@64 - into an AAC@256 without loss if information.


This is actually really easy.  Just pad a lot of zeros into the 64k bitstream until you reach 256k.  Or unpack the entropy coding and then repack it less efficiently.  You can always losslessly increase bitrate without much effort. 

I'm assuming the question you really want to know is if you can decrease bitrate with less increase in quantization error than regular transcoding.

AAC to AAC loss of quality

Reply #17
What I mean, is that there is nothing - logically - that says you get any quality loss whatsoever by transcoding AAC@256 into AAC@256.
Yes there is, and it's called a psychoacoustic model.

Any good AAC encoder will have a psychoacoustic model that it uses to decide things like quantizers, stereo mode, block size, and bit allocation. All of these decisions depend on the input audio, which means some of the decisions will be different between a file that is taken directly from a lossless source versus one that has already been encoded to AAC@256 and then decoded back to uncompressed PCM.

In theory, you could create an AAC encoder that does not make any decisions based on the input audio. If you used this hypothetical AAC encoder to re-encode its own output, you'd end up with a nearly (if not completely) identical file. Unfortunately, this hypothetical AAC encoder is not even close to being competitive with encoders that use psychoacoustic models.

AAC to AAC loss of quality

Reply #18
I'm assuming the question you really want to know is if you can decrease bitrate with less increase in quantization error than regular transcoding.


OK, I missed the explanation of transcoding 256 to 256, so here goes again:
Decode an AAC 256 stream. Then it is trivial to losslessly compress the decoded signal down to a bitrate of (at most) 256; trivial, but practically infeasible.

AAC to AAC loss of quality

Reply #19
Decode an AAC 256 stream. Then it is trivial to losslessly compress the decoded signal down to a bitrate of (at most) 256; trivial, but practically infeasible.


No thats generally not possible because of rounding error.  Once its gone to PCM, you're probably out of luck.

You can trivially turn the 256k AAC file into a 256k AAC file by doing nothing however.

AAC to AAC loss of quality

Reply #20
No thats generally not possible because of rounding error.  Once its gone to PCM, you're probably out of luck.


Look, if you really feel like derailing the logic by nitpicking on that level of detail, then (i) who said you need to use LPCM upon transcoding?, and (ii) if you do not allow roundoff errors, then you can delete a lot of software from your list of media players. For example, foobar2000 is not an mp3 player unless you allow for roundoff errors in the -150 dB range.

People do transcode, and they are surprised that lossless --> 256 --> lossless --> 256 is not the same as lossless --> 256. And logically it could very well be the same (that would be the situation if you e.g. reduce the # of colours in a photo format), that just is not implemented.

AAC to AAC loss of quality

Reply #21
No thats generally not possible because of rounding error.  Once its gone to PCM, you're probably out of luck.


Look, if you really feel like derailing the logic by nitpicking on that level of detail, then (i) who said you need to use LPCM upon transcoding?


AAC actually specifies LPCM, so you'll have to use it at some point in your decoder. 

, and (ii) if you do not allow roundoff errors, then you can delete a lot of software from your list of media players. For example, foobar2000 is not an mp3 player unless you allow for roundoff errors in the -150 dB range.


You're missing the point.  Because rounding is not explicitly defined by the specification, there are an infinite number of PCM outputs that can be generated from any given AAC file.  Hence, given one specific output, its not in general possible to uniquely identify the AAC stream that generated it, nor to generate an AAC stream that will losslessly decode back to it (since the decoder will have an unknown rounding error).  You might be able to in practice, but its not a for sure thing, especially if you don't have prior information (for example, the specific decoder binary used).

People do transcode, and they are surprised that lossless --> 256 --> lossless --> 256 is not the same as lossless --> 256. And logically it could very well be the same (that would be the situation if you e.g. reduce the # of colours in a photo format), that just is not implemented.


I suspect we're just talking past each other because I have no idea what this is in reference to.  I thought you were asking why its not possible to take an AAC file and transcode it to a lower bitrate while preserving more quality than decoding to PCM and feeding that back into an encoder.

AAC to AAC loss of quality

Reply #22
And logically it could very well be the same (that would be the situation if you e.g. reduce the # of colours in a photo format), that just is not implemented.
Not really. Reducing colors is trivial, and you can guarantee that no further loss will occur after one generation; encoding JPEG is nearly trivial and will reduce to no further loss during encoding after a few generations, if the rounding error from the encoder and decoder sums close to zero.

A more fair comparison would be re-encoding a video multiple times with the same settings. Any good (i.e. not MJPEG) codec will use its psychovisual model to make encoding decisions and cause nearly endless generation loss. Even codecs that require bit-exact decoding (H.264) will have generation loss.

AAC to AAC loss of quality

Reply #23
People do transcode, and they are surprised that lossless --> 256 --> lossless --> 256 [...]

I suspect we're just talking past each other because I have no idea what this is in reference to.


The original posting?