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: Can you tell a difference encoding twice at Q9  (Read 13435 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Can you tell a difference encoding twice at Q9

Hi,

I'd like to share a thought. If you encode at Q9 (or Q10) then back to wav and then back to Q9/Q10, can you hear the difference ?

My reasoning is that the first conversion will simplify and throw away inaudible parts of the spectrum. The second conversion will have a better and easier job allocating more bits where there *is* something to hear and no bits where stuff was already removed in the first conversion.

It's given, this will not be 100% perfect and there will be differences, but question is: Can you tell these differences in a blind test?

Re: Can you tell a difference encoding twice at Q9

Reply #1
Long ago I tried re-encoding a sample vorbis > vorbis. The results were bad. I vaguely remember needing up to Q10 to make it right. Encoding hq vorbis to mp3 was ok though. Its unpredictable, Working in one instance and not another. Maybe its improved since then.

Re: Can you tell a difference encoding twice at Q9

Reply #2
There will be generation loss, like encoding JPG several times. It will not get any better.

I once made a script that made about 100 generations. Even at high settings, at the end of it, it sound like garbage.
My advise, never encode more than once to lossy, and keep your lossless sources.

Re: Can you tell a difference encoding twice at Q9

Reply #3
Well, if you sum it 100 times sure. But two ? Can you hear it when using Q9 ?

Might it be that Q9 -> Q9 you hear, but Q9 -> Q10 no ?

Re: Can you tell a difference encoding twice at Q9

Reply #4
For most files it will sound fine. There will probably be some where it does not.  Try it and hear with your own ears.

Re: Can you tell a difference encoding twice at Q9

Reply #5
@korewell : You are being told that two people made a stress test of lossy vorbis reencoding and the results were bad.

You are saying that doing it just twice actually improves things, and I am not even sure you've proven to yourself that such is the case.

I am not sure if it is simply your wording, or are you failing for a common misconception for which lossy codecs are thought as "just removing non-important frequencies" and that "two passes will simply not remove them again". Every lossy encoder is different but they don't work like that. They approximate, later truncate, and finally compress. And generally in those steps they apply some DSP techniques too.
Would a lossy codec be able to reconstruct the original signal that it receives? Yes, it could, but probably either the input signal would be very simple (a single sine wave), or it would need to be modified in a way that the compression would be marginal.

Re: Can you tell a difference encoding twice at Q9

Reply #6
Korewell your logic fails on its fundamental premises

why would you think that the previous encoding would waste bit on something that is not there ?
Your argument is that the second encoding doesn't have to use bits because the previous encoding removed some of the audio data.  Yes the reason it is removing it is  because the previous encoding didn't assign bits for it.  not because it assign bits for and just decide not to playback that information.

You also have to realize that the second encoding doesn't try to sound like the original. it tries to sound like the first encoding.
any added artifacts is now seen as details and can even remove bit away from what is actually the original sound.


Re: Can you tell a difference encoding twice at Q9

Reply #7
> Can you tell these differences in a blind test
Have you tried it?

 

Re: Can you tell a difference encoding twice at Q9

Reply #8
Noise alone would approximately double, reducing SNR by 3 dB. But audibility depends on the material. Could be entirely fine with -q 9 (~320 kbps!). Haven't done much with Vorbis.
"I hear it when I see it."

Re: Can you tell a difference encoding twice at Q9

Reply #9
@Sven: I understand where you're coming from. However, the added artefacts are supposedly below the hearing level, even much so at Q9. It's not that you add a "bell" in the music and then you need to keep it on the second conversion.

I'm not sure if it's my wording, but I'll try to explain again. When you do FFT of an input signal, you end up with the "component" frequencies and their respective volume. Psychoacoustics come into play here to "prove" that we, as humans, cannot hear some frequencies in the presence of other, louder, frequencies. In this case, the algos will not throw away, but will quantise the resulting wave forms with a much coarser shape (read: less bits).  How and when this is done depends on the specific algo/codec and chosen quality level (bitrate etc). Some algos (like the sony atrac) will go the extend of "masking" frequencies in the time domain as well (i.e. You hear a loud sound and you cannot hear anything else for some time after).

So at the end, the waveform is stored in a way that prioritises the more "prominent" parts that are audible and the others that are hard to hear become less detailed.

Everything is then "mixed" at playback time and hopefully everything will sound very similar to the original. Mind, we're not talking about the resulting wave forms before and after the conversion (they are different), but whether our ears are able to distinguish the difference.

The JPEG example is the same, but I'd argue that any two people can distinguish a Jpeg made from TIFF at 99% and a 99% Jpeg made from the first Jpeg, unless they go down to the pixel level where differences are "evident". Sure, you convert 100 times then the differences add (perhaps exponentially), but you cannot tell a difference the first time.

Same goes for audio: You can *see* the different waveform in audacity and you can actually listen to this difference (try it), however I have tested myself a few times and I really cannot pass an ABX blind test when I do convert only once.


Re: Can you tell a difference encoding twice at Q9

Reply #11
Are you familiar with video encoding? multi-pass is used to ensure the encoded files have predictable size so that they can be fitted in some specific media, like CD or DVD, or conform to some standards (like AVC profile) so that they will be compatible with a wide range of playback devices without losing the advantages VBR encoding.

Multi-pass encoding in audio is pretty rare but one encoder I know (nero aac encoder) supports it. Do you want to try it out even though it is not vorbis?

Multi-pass encoding gathers statistics in the first (and subsequent non-final passes) to optimize the distribution of bitrate in the entire file and it doesn't refer to or output actual lossy data in each passes so it will not result in generation loss. That means a 100-pass encoding will not worsen quality, it just has a finer estimation of bitrate distribution in the entire file. For example, you specify a target file size of 1GB to encode a video file, if you use 2-pass, it may output a 1022MB or 1026MB file, if you use 3-pass, you may get 1023.7MB or 1024.2MB, the more passess the more accurate the resulting file size, or average bitrate.

This is the the multi-pass method I know, it always refers to the original source in all passes, unlike the one you described.

Finally, to answer your question, whether I can hear the differences or not won't make your assumption more correct or incorrect.

Re: Can you tell a difference encoding twice at Q9

Reply #12
question is: Can you tell these differences in a blind test?
I have tested myself a few times and I really cannot pass an ABX blind test when I do convert only once.

...So what's your question again?
I had not done (yet) a proper ABX test when I posted the question. Now I know the answer. But this is me. Perhaps I'm wrong.

Re: Can you tell a difference encoding twice at Q9

Reply #13
I don't think so. I did similar tests some years ago converting to high bitrate mp3, and others, and I couldn't discern a difference in listening tests. The only thing I remember noticing was that the 2nd gen encode actually generated a slightly higher bitrate.