Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
20th August 2014, 14:00 | #1 | Link |
Registered User
Join Date: Oct 2012
Posts: 14
|
Question about lossy and lossless
Hi all, I have some troubles of understanding lossy and lossless video.
For ex: I encode raw source A1 to B1 through lossy method. Then when decoding B1 I have raw A2. So B1 is lossy of A1 and B1 is lossless of A2, is it right? If yes, then I encode A2 to B2 through lossless method, but It'll never touch the size of B1. I can not understand this. Please help me, thank you guys |
20th August 2014, 14:13 | #2 | Link |
ffx264/ffhevc author
Join Date: May 2007
Location: /dev/video0
Posts: 1,844
|
no it's not right
if you encode raw A1 to lossy B1, you'll get a compressed video (lossy). Decoding of B1 does not imply that you get true raw video (without modifications compared to raw A1) since B1 is compressed and the decoder decodes the compressed video. You cannot go from compressed video to raw video which is exactly the same as the original raw input. Note that raw video can mean two things: either it's truly raw without any compression or it's a compressed raw video which is extracted from a container Last edited by microchip8; 20th August 2014 at 14:22. |
20th August 2014, 15:14 | #3 | Link |
Registered User
Join Date: Oct 2012
Posts: 14
|
Thank froggy1.
I know that A2 will be different from A1. I just mean decoding B1 we'll have something call A2. So, as you said, A2 is not a raw? Is it still compressed? I have one more question. Does decoding a lossy video with different decoders bring different results? Thank you. |
20th August 2014, 15:26 | #4 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
A2 is uncompressed video decoded from B1, not the same thing as "raw" by any definition . A2 has same image quality as B1. But B1 has already incurred generation loss and is not equivalent to A1 Note in the video world "raw" has a very different meaning than in "anime" world. Decoding lossy video (in theory) should result in same results with different decoders . But sometimes there are problems with decoders, shortcuts taken, errors in code |
|
20th August 2014, 15:26 | #5 | Link | ||
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
It is possible to convert directly from one compressed format to another compressed format, but "internally" the data will still be decompressed (from the old format) and then compressed again (to the new format). Now, the compression may be lossy or lossless. With a lossless compression, the "raw" data you get back from the decoder is bit-identical to the "raw" data you once fed into the encoder. With lossy compression that is not the case! (Be aware though that different pixel formats for "raw" video data exist, such as YCrCb vs. RGB, different sub-sampling or different number of bits per channel. So even lossless compression may include a pixel format conversion!) Quote:
In reality, tough, decoders may contain bugs or not be 100% spec compliant. So you cannot rely on that (although it generally should be the case).
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 20th August 2014 at 15:41. |
||
20th August 2014, 16:20 | #6 | Link | ||
Registered User
Join Date: Oct 2012
Posts: 14
|
Very interesting, thank you all.
So in conclusion: Quote:
Quote:
|
||
20th August 2014, 16:29 | #7 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Yes that's right
"lossless" always refers to comparing to the uncompressed video state. A compressed video has to be decompressed (decoded) to uncompressed before it's recompressed. So lossless compression will always yield larger filesize , when the source is already lossy compressed. |
28th August 2014, 09:52 | #8 | Link |
Registered User
Join Date: May 2005
Posts: 1,462
|
Speaking of lossless, how lossless is encoding with "-QP 0" really?
I have a project that requires several passes, with lossless intermediate steps. Will "-QP 0" do it? Thanks.
__________________
Gorgeous, delicious, deculture! |
|
|