Head-Fi.org › Forums › Equipment Forums › Sound Science › Lossless Transcoding
New Posts  All Forums:Forum Nav:

Lossless Transcoding

post #1 of 8
Thread Starter 
Possible?

The way it works at the moment is Sample 1 (AAC) > wav > sample 2(MP3),
This loses quality during the transcode to MP3.
If you have an 128kbps AAC , can we assume that a 128kbps MP3 can (theoretically) contain ALL the data in the original AAC?
If we didnt convert the AAC into wav but used another algorithm to 'map' the original in some way do you think this could be done?
post #2 of 8
there's no "mapping", each lossy conversion is even lossier.
post #3 of 8
Let's try looking at this in terms of a hypothetical image compression algorithms.

Think of AAC as an image compression algorithm that lossy compresses the red and green but leaves the blue unchanged. Think of MP3 as an image compression algorithm that lossy compresses the green and blue but leaves the red unchanged.

If you take the AAC and convert it to MP3 you end up with an image that has the red degraded, green double degraded, and the blue degraded. You can't get the lost info back. What you end up with after converting from AAC to MP3 is worse than the original AAC. Even converting from 128 AAC to 320 MP3 would end up with something that is worse than the original AAC and be a larger file.

AAC and MP3 throw away different information in the audio. Once you throw it away you can't get it back. Converting from AAC to MP3 gives you the problems of both.
post #4 of 8
Thread Starter 
Quote:
Originally Posted by Ham Sandwich View Post
Let's try looking at this in terms of a hypothetical image compression algorithms.

Think of AAC as an image compression algorithm that lossy compresses the red and green but leaves the blue unchanged. Think of MP3 as an image compression algorithm that lossy compresses the green and blue but leaves the red unchanged.

If you take the AAC and convert it to MP3 you end up with an image that has the red degraded, green double degraded, and the blue degraded. You can't get the lost info back. What you end up with after converting from AAC to MP3 is worse than the original AAC. Even converting from 128 AAC to 320 MP3 would end up with something that is worse than the original AAC and be a larger file.

AAC and MP3 throw away different information in the audio. Once you throw it away you can't get it back. Converting from AAC to MP3 gives you the problems of both.
I know all of this, this is how it works now.

What i am asking is if it would be possible to create a NEW way to transcode that recreates an exact copy of the audio in a file , without doing the usual conversion to wav and then into the new codec.

Say your aac file is 4mb , we know that 4mb is what is required to hold the audio, so we should theoretically be able to store exactly the same audio in a 4mb MP3 (or maybe 4.5mb - 5mb, to compensate for AACs better compression).

When you transcode the original file is converted to wav , this bit is lossless. It is the next stage that introduces loss , when the file is re-encoded to the new codec.

Instead of converting to wav couldnt you 'read the file' with software that would then be able to recreate the same audio contents in another codec (the file would just have to be large enough to hold it).
post #5 of 8
Quote:
Originally Posted by astroid View Post

The way it works at the moment is Sample 1 (AAC) > wav > sample 2(MP3),
This loses quality during the transcode to MP3.
If you have an 128kbps AAC , can we assume that a 128kbps MP3 can (theoretically) contain ALL the data in the original AAC?
Nope!
When encoding to MP3 the encoder will run the audio data through a psychoacoustic model, dropping tones that is 'think' you will not be able to hear. Higher frequencies, low volume tones masked by higher volume ones, and more.

Since a similar model were used when encoding to AAC it mean that most of the original "noise" is gone, and hence the MP3 encoder may/will remove some of the audio data left from the original AAC file. Resulting in a file with even lover quality.
The same goes for any transcoding between lossy codecs. Audio, video, picture, ..

Quote:
If we didnt convert the AAC into wav but used another algorithm to 'map' the original in some way do you think this could be done?
Would not make a difference!
The audio data lost when encoding to AAC are lost forever. No way to get it back...


Edit:
Reading your post above, which you posted while I wrote this, I now understand what you mean.
In theory that may work. Basically take the audio data from the AAC and decompress it without adding silence, then lossless compress in a way readable by a MP3 decoder. MP3 being an old format I doubt this method is supported though.
Probably would have to use a different codec/container.
post #6 of 8
There is no possible direct mapping from AAC to MP3. They're essentially disjoint sets. AAC and MP3 do use some of the same underlying math theory, but they diverge from that sameness pretty quickly.

Here's a quick blurb from Wikipedia on the underlying math theory:
Quote:
In MP3, the MDCT is not applied to the audio signal directly, but rather to the output of a 32-band polyphase quadrature filter (PQF) bank. The output of this MDCT is postprocessed by an alias reduction formula to reduce the typical aliasing of the PQF filter bank. Such a combination of a filter bank with an MDCT is called a hybrid filter bank or a subband MDCT. AAC, on the other hand, normally uses a pure MDCT; only the (rarely used) MPEG-4 AAC-SSR variant (by Sony) uses a four-band PQF bank followed by an MDCT. ATRAC uses stacked quadrature mirror filters (QMF) followed by an MDCT.
Bitrate peeling, though is something that can be done. OGG can supposedly do that. MP3 and AAC cannot.
post #7 of 8
Won't work the way you want it

When you take AAC to lossless, you preserve the AAC intact, so it will sound exactly the same as the AAC. Of course it will never sound like the original CD again.

The problem is when you now take that new lossless file to MP3, that will strip more data. The MP3 will no longer sound the same as the original AAC you started with.

You either need to re-rip from the original CD or keep an original lossless file (made from the CD) on hand for transcoding. With the price of hard drives, it's now practical. You can also play the original lossless file for you home setup to have the best quality as well.

Edit: Also no reason to use WAV file. Lossless compression files like FLAC and Apple lossless work just as well. These can be transcoded into any lossy file you want. They can also be transcoded into other lossless formats with all data intact.
post #8 of 8
Quote:
Originally Posted by iamoneagain View Post
When you take AAC to lossless, you preserve the AAC intact, so it will sound exactly the same as the AAC.
in theory yes...but in practice you can decode any lossy format in 32float or 24int and yield more informations than in 16int...especially if you EQ/post-process your audio afterwards.

it's been discussed here: How accurate are the 24-bit mp3 decoders?

foobar's MP3 decoder decodes in 32float, applies DSP plugins also in 32float...and then cuts the bits to what you set in your renderer settings(no noise-shaping this time).

lossy files shouldn't be reencoded, nor decoded to lossless integer files...due to rounding errors. they should only be decoded to 32float.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Sound Science
Head-Fi.org › Forums › Equipment Forums › Sound Science › Lossless Transcoding