View Full Version : Does using several succeeding lossless intermediates can hurt quality?


bizz & buzz
15th July 2010, 12:02
Simple question,as stated in the title...
Not sure the answer is simple though.

Underground78
15th July 2010, 12:58
Simple question,as stated in the title...
Not sure the answer is simple though.

The answer is simple if you really use lossless intermediates ...

Does using several succeeding lossless intermediates can hurt quality?

No since it's lossless :

Lossless data compression is a class of data compression algorithms that allows the exact original data to be reconstructed from the compressed data. The term lossless is in contrast to lossy data compression, which only allows an approximation of the original data to be reconstructed, in exchange for better compression rates.

Inspector.Gadget
15th July 2010, 13:34
The only issue you may run into is doing lossy colorspace conversions before the lossless compression. Once you're aware of that, and plan your workflow accordingly, lossless is lossless.

poisondeathray
15th July 2010, 14:12
It also depends on the software you are using. If you use software that treats lossless files as lossless and allows passthrough then you are ok.

But you can have colorspace conversions and other transformations after the lossless compression as well (ie. decoded differently)

For example, Premiere Pro will convert Lagarith YV12 to RGB, and clamp to sRGB 16-235 and use rec601 . Even lagarith in RGB mode will be clamped 16-235

bizz & buzz
15th July 2010, 15:38
Thanks for your help guys...

So as long there are no colorspace conversions in the workflow, the video will remain lossless.

My workflow is: DVD source -> Avisynth script via MPEG2Source() -> VirtualDub (both columns under "Video Color Depth" are set to YV12) -> compressing to Lagarith (which is set to YV12 mode).

The resulted AVI file is fed again to Avisynth via Avisource() for additional filtering -> fed again to VirtualDub -> Lagarith... And so on...

Although cumbersome, I can't detect any colorspace conversions in the chain.
Am I right on that?

poisondeathray
15th July 2010, 15:42
It looks ok

If you aren't using any vdub filters, you can use video=>fast recompress and it will bypass the RGB conversion as well

You can leave lagarith as RGB, it will output YV12 if fed a YV12 source, RGB if fed a RGB source

If you type info() at the bottom of the script, avisynth will tell you the colorspace

bizz & buzz
15th July 2010, 15:50
Thanks poisondeathray.

BTW, I didn't really catch what you meant about the clamping issue, but it sounds serious.. can you please explain more about that?

foxyshadis
15th July 2010, 22:39
It means the conversion from YV12 to RGB is performed by expanding Y[16,235]->RGB[0,255] so that anything less than 16 or above 235 is forced to 0 or 255. Anything that touches a TV has this problem, including most DVDs and Blurays, so it's often simpler to work within TV levels unless you control the entire chain and really need the extra 1/2 bit of precision. There are ways to signal it, like colorometry, but most applications just ignore that and do whatever they want.

bizz & buzz
15th July 2010, 23:26
Thanks for clarifying the issue Foxyshadis

poisondeathray
15th July 2010, 23:45
bizz & buzz - that doesn't affect you with the workflow that you listed above

The Premiere Pro case was just an example to illustrate where lagarith could be treated as not lossless .

IMO, the clamping is serious because , depending on your source, there can be substantial highlight and shadow data that you are missing . The only lossless intermedate that PP doesn't do that to is v210 (4:2:2 10-bit uncompressed) . You can even keep Rec.709 by using v210 , which is common for HD material

izolight
16th July 2010, 02:20
My workflow is: DVD source -> Avisynth script via MPEG2Source() -> VirtualDub (both columns under "Video Color Depth" are set to YV12) -> compressing to Lagarith (which is set to YV12 mode).

The resulted AVI file is fed again to Avisynth via Avisource() for additional filtering -> fed again to VirtualDub -> Lagarith... And so on...

Why aren't you doing the filtering in the original script, you could save quite some time/space with that.

bizz & buzz
16th July 2010, 06:56
Poisondeathray - I hope people aware of this issue.. kinda remind me when people ,unaware to Rec.709 <-> Rec.601 conversions, were encoding stuff with the wrong colors.

Izolight - I'm using several scripts cause my PC is not strong enough to encode all the heavy-duty (mostly MC based) filters I'm using at once.