IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Double encoding mp3, what degradation can be expected?
shaocaholica
post Nov 14 2013, 06:07
Post #1





Group: Members
Posts: 11
Joined: 2-October 13
Member No.: 110574



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.

This post has been edited by shaocaholica: Nov 14 2013, 06:15
Go to the top of the page
+Quote Post
saratoga
post Nov 14 2013, 06:14
Post #2





Group: Members
Posts: 5169
Joined: 2-September 02
Member No.: 3264



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.
Go to the top of the page
+Quote Post
shaocaholica
post Nov 14 2013, 06:27
Post #3





Group: Members
Posts: 11
Joined: 2-October 13
Member No.: 110574



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.
Go to the top of the page
+Quote Post
saratoga
post Nov 14 2013, 06:57
Post #4





Group: Members
Posts: 5169
Joined: 2-September 02
Member No.: 3264



QUOTE (shaocaholica @ Nov 14 2013, 01:27) *
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.
Go to the top of the page
+Quote Post
shaocaholica
post Nov 14 2013, 07:11
Post #5





Group: Members
Posts: 11
Joined: 2-October 13
Member No.: 110574



How would you compare 2 waveforms for differences? Subtract them and see the significance of the result?
Go to the top of the page
+Quote Post
saratoga
post Nov 14 2013, 07:24
Post #6





Group: Members
Posts: 5169
Joined: 2-September 02
Member No.: 3264



QUOTE (shaocaholica @ Nov 14 2013, 02:11) *
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.
Go to the top of the page
+Quote Post
eahm
post Nov 14 2013, 07:52
Post #7





Group: Members
Posts: 1171
Joined: 11-February 12
Member No.: 97076



You may like this one http://www.hydrogenaudio.org/forums/index....howtopic=100067
Go to the top of the page
+Quote Post
shaocaholica
post Nov 14 2013, 07:57
Post #8





Group: Members
Posts: 11
Joined: 2-October 13
Member No.: 110574



QUOTE (eahm @ Nov 13 2013, 23:52) *


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.
Go to the top of the page
+Quote Post
saratoga
post Nov 14 2013, 08:12
Post #9





Group: Members
Posts: 5169
Joined: 2-September 02
Member No.: 3264



QUOTE (shaocaholica @ Nov 14 2013, 02:57) *
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).
Go to the top of the page
+Quote Post
Alexey Lukin
post Nov 14 2013, 09:35
Post #10





Group: Members
Posts: 206
Joined: 31-July 08
Member No.: 56508



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.
Go to the top of the page
+Quote Post
dhromed
post Nov 14 2013, 16:32
Post #11





Group: Members
Posts: 1339
Joined: 16-February 08
From: NL
Member No.: 51347



QUOTE (shaocaholica @ Nov 14 2013, 07:57) *
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.
Go to the top of the page
+Quote Post
Nessuno
post Nov 14 2013, 17:50
Post #12





Group: Members
Posts: 423
Joined: 16-December 10
From: Palermo
Member No.: 86562



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.
Go to the top of the page
+Quote Post
saratoga
post Nov 14 2013, 18:42
Post #13





Group: Members
Posts: 5169
Joined: 2-September 02
Member No.: 3264



QUOTE (dhromed @ Nov 14 2013, 11:32) *
QUOTE (shaocaholica @ Nov 14 2013, 07:57) *
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.



Go to the top of the page
+Quote Post
shaocaholica
post Nov 14 2013, 18:52
Post #14





Group: Members
Posts: 11
Joined: 2-October 13
Member No.: 110574



QUOTE (saratoga @ Nov 14 2013, 10:42) *
QUOTE (dhromed @ Nov 14 2013, 11:32) *
QUOTE (shaocaholica @ Nov 14 2013, 07:57) *
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.
Go to the top of the page
+Quote Post
Alexey Lukin
post Nov 14 2013, 19:10
Post #15





Group: Members
Posts: 206
Joined: 31-July 08
Member No.: 56508



QUOTE (saratoga @ Nov 14 2013, 13:42) *
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...
Go to the top of the page
+Quote Post
2Bdecided
post Nov 14 2013, 19:26
Post #16


ReplayGain developer


Group: Developer
Posts: 5364
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



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.
Go to the top of the page
+Quote Post
saratoga
post Nov 14 2013, 19:33
Post #17





Group: Members
Posts: 5169
Joined: 2-September 02
Member No.: 3264



QUOTE (Alexey Lukin @ Nov 14 2013, 14:10) *
QUOTE (saratoga @ Nov 14 2013, 13:42) *
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.

QUOTE (Alexey Lukin @ Nov 14 2013, 14:10) *
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.

Go to the top of the page
+Quote Post
Alexey Lukin
post Nov 14 2013, 19:49
Post #18





Group: Members
Posts: 206
Joined: 31-July 08
Member No.: 56508



QUOTE (saratoga @ Nov 14 2013, 14:33) *
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.


QUOTE (saratoga @ Nov 14 2013, 14:33) *
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.
Go to the top of the page
+Quote Post
DVDdoug
post Nov 14 2013, 22:43
Post #19





Group: Members
Posts: 2716
Joined: 24-August 07
From: Silicon Valley
Member No.: 46454



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 .




Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th December 2014 - 16:27