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: Double encoding mp3, what degradation can be expected? (Read 10661 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Double encoding mp3, what degradation can be expected?

Purely scientific question.  I'm not advocating double or more encoding lossy but how bad can it really be?

PCM > mp3_128 > PCM > mp3_128
PCM > mp3_320 > PCM > mp3_320
PCM > mp3_v0 > PCM > mp3_v0

Some people might think that lossy double encoded is 'the worse thing' like crossing the streams but I have a feeling that it might be practically inaudible compared the first lossy copy as all the compromises have already been made.  Sure there's a high probability it won't be identical but that doesn't mean you can hear that difference.

Double encoding mp3, what degradation can be expected?

Reply #1
No one can tell you how it will sound to you.  If you want to know, pick samples, transcode and see how low a bitrate you have to use before you can ABX the result.

Double encoding mp3, what degradation can be expected?

Reply #2
Well of course theres that.  I just figured this topic has been touched on already.  I'm interested in the sound for sure but also the under workings of mp3 encoders and whats happening, academically, in this scenario regardless of the audibility of differences.

Double encoding mp3, what degradation can be expected?

Reply #3
I'm interested in the sound for sure but also the under workings of mp3 encoders and whats happening, academically, in this scenario regardless of the audibility of differences.


Quantization error is being compounded by the second encoding pass.  If the encoder/decoder pass is not gapless, you may also have some additional time/frequency hit if the transform blocks don't line up on the second pass.

Double encoding mp3, what degradation can be expected?

Reply #4
How would you compare 2 waveforms for differences?  Subtract them and see the significance of the result?

Double encoding mp3, what degradation can be expected?

Reply #5
How would you compare 2 waveforms for differences?  Subtract them and see the significance of the result?


Generally by listening test.  If you just want to see the literal difference between them, you can do subtraction, but the results will be difficult to interpret.  In general, MP3 files have a quantization noise floor 25 or 30 dB below peak.  If you encode twice you'll raise that by two or 3 dB most likely.


Double encoding mp3, what degradation can be expected?

Reply #7
You may like this one http://www.hydrogenaudio.org/forums/index....howtopic=100067


Haha awesome, thats exactly what I'm looking for!

I was actually doing an artsy test with jpgs a few years ago where I wanted to make a movie of a single jpg file being reencoded over and over just to see what would happen but actually nothing really happened visually over time that was interesting.  A few artifacts started growing but then stopped pretty quick and then the image would reach some sort of stable entropy where it would just stay there no matter how many times it was reencoded and this was with a pretty lossy jpeg setting too.  I think it was 20/100 or lower.

Double encoding mp3, what degradation can be expected?

Reply #8
A few artifacts started growing but then stopped pretty quick and then the image would reach some sort of stable entropy where it would just stay there no matter how many times it was reencoded and this was with a pretty lossy jpeg setting too.  I think it was 20/100 or lower.


JPEG is just a lowpass filter.  Once you've removed a level of detail completely, there subsequent encoding passes introduce little or no loss (depending on how rounding error is handled). 

Double encoding mp3, what degradation can be expected?

Reply #9
Both mp3 and JPEG use quantization of transform coefficients. It makes their recompression performance totally dependent on a particular encoder/decoder pair. My guess is that for every possible encoder the error will slowly accumulate with every iteration, but the biggest loss will happen during the very first encoding pass. The contributing factor for mp3 is that the filter bank itself introduces small nonlinearity.

Double encoding mp3, what degradation can be expected?

Reply #10
I think it was 20/100 or lower.


That doesn't mean much without telling us which application. Jpeg doesn't define a quality range, so applications are free to implement their own arbitrary sliders. Even Photoshop's 0-12 and Save For Web's 0-100 are very different.

Double encoding mp3, what degradation can be expected?

Reply #11
Just a (maybe stupid) question crossing my mind: has ever been experienced a subjective improvement in perceived sound quality in lossy after lossy generation, due to a higher amount of distortion and noise floor sounding more euphonic and masking smaller but more annoying artifacts?
I'm thinking to vinyl or low power tube amps which someone happens to prefer to better spec-ed devices.
... I live by long distance.

Double encoding mp3, what degradation can be expected?

Reply #12
I think it was 20/100 or lower.


That doesn't mean much without telling us which application. Jpeg doesn't define a quality range, so applications are free to implement their own arbitrary sliders. Even Photoshop's 0-12 and Save For Web's 0-100 are very different.


The quality actually isn't very important here.  Probably less important than the choice of decoder.  JPEG is just a low pass filter implemented with a DCT.  What happens on the Nth pass is going to be entirely determined by how rounding error in the DCT and colorspace conversion accumulates on successive passes.  If it doesn't accumulate, successive passes will have no effect (since lowpass filtering frequencies that don't exist doesn't do anything).  If it does accumulate, eventually the entire image will be swamped by gradually rising noise.




Double encoding mp3, what degradation can be expected?

Reply #13
I think it was 20/100 or lower.


That doesn't mean much without telling us which application. Jpeg doesn't define a quality range, so applications are free to implement their own arbitrary sliders. Even Photoshop's 0-12 and Save For Web's 0-100 are very different.


The quality actually isn't very important here.  Probably less important than the choice of decoder.  JPEG is just a low pass filter implemented with a DCT.  What happens on the Nth pass is going to be entirely determined by how rounding error in the DCT and colorspace conversion accumulates on successive passes.  If it doesn't accumulate, successive passes will have no effect (since lowpass filtering frequencies that don't exist doesn't do anything).  If it does accumulate, eventually the entire image will be swamped by gradually rising noise.


Maybe my decoder was pretty good as I did not get much accumulated artifacts. The decoder and encoder were both from nuke compositor.

Double encoding mp3, what degradation can be expected?

Reply #14
JPEG is just a low pass filter implemented with a DCT.

It is not a low-pass, it is a coefficient quantizer. You could call mp3 a low-pass filter this way...

Double encoding mp3, what degradation can be expected?

Reply #15
JPEG doesn't overlap the blocks. mp3 does. That makes a huge difference when you're going through multiple generations. You can (ignoring YUV/RGB conversion) end up feeding exactly the same data back into the JPEG DCT the next time around. However the overlap means you'll never do this with mp3's MDCT, because adjacent blocks always contaminate the current block each and every time.

Cheers,
David.

Double encoding mp3, what degradation can be expected?

Reply #16
JPEG is just a low pass filter implemented with a DCT.

It is not a low-pass, it is a coefficient quantizer.


No, JPEG is actually a low pass filter because the quantization becomes monotonically more coarse with increasing frequency, and because higher frequencies are omitted entirely.

You could call mp3 a low-pass filter this way...


I don't see how.  An mp3 encoder does not work the same way, in large part because unlike human vision, human hearing does not have a monotonically decreasing frequency response.  There is no expectation that an MP3 encoder retain DC energy more accurately than AC energy, and in fact they rarely do.  A JPEG encoder must do this or it will corrupt the signal.


Double encoding mp3, what degradation can be expected?

Reply #17
No, JPEG is actually a low pass filter because the quantization becomes monotonically more coarse with increasing frequency, and because higher frequencies are omitted entirely.

You are not quite correct on either point: the default quantization table is not monotonous (and there can be user-defined tables too!), and even if it is, it does not necessarily result in a low-pass filtering because it completely depends on the signal spectrum. I don't see any point in arguing further: I agree with the rest of your post about successive generations of JPEG compression. I just wanted to clarify the JPEG is very similar to mp3 in many respects and it's inaccurate to call either of them a low-pass filter, as both can cut frequencies at the middle or anywhere the signal falls below the threshold.


An mp3 encoder does not work the same way, in large part because unlike human vision, human hearing does not have a monotonically decreasing frequency response.

You'll be surprised how similar human vision and hearing are! Their sensitivity curves are close to parabolas, with a clear extremum at middle frequencies.

Double encoding mp3, what degradation can be expected?

Reply #18
Somewhere on the forum (posted by someone I trust), I read that AAC was designed to be less prone to accumulated degradation. 

But, I would assume going from MP3 -> AAC is not much better (maybe worse) than going from MP3 -> MP3.

My approach is to avoid re-encoding lossy or transcoding lossy-to-lossy whenever possible, but sometimes you simply don't have a choice.  And, I almost always use LAME V0 when encoding or re-encoding MP3.   

Theoretically/philosophically it's possible to avoid accumulated errors/artifacts.  The idea of psychoacoustic compression is to "throw away" details that you can't hear.  If those details are thrown-away during the 1st compression there's no need to throw-away more data during the 2nd or 3rd compression.    An analogy would be bit-depth reduction...  If you go from 24-bits to 16-bits and back, you loose 8-bits of resolution.    Repeating that over & over doesn't do any more damage.

But like all engineering, I'm sure there compromises & trade-offs, and the MP3 developers probably had good reasons for the choices they made .