Thursday, September 27, 2007

Visually Lossless and how to back it up.

CineForm is the company most guilty of using the term Visually Lossless (VL)-- we may even have coined it. Red has benefited from CineForm's success with wavelets, and they also uses the term, as they should. But it is a marketing term, so we all should do our best to back it up. While visual inspection of 1:1 pixel data (or magnified) at 12" viewing distances is a good way to test for VL, there is a different way to measure the amount of compression that is significant, without involving human inspection. There is a point in most high bit-rate image compression technologies when the amount of loss is insignificant; this occurs when the compression error falls well below the inherent noise floor of the imaging device.

Back in March '07, Scott Billups, George Palmer and Mark Chiolis helped us out with a Viper test shoot at Plus-8 to compare HDCAM-SR to CineForm 444 -- thanks again guys. Follow following this blog when remember many posts on the subject. Using a Billups Chart in front of the Viper in Filmstream mode, the stationary image noise power was measured in PSNR at 38.97dB -- this is the amount of difference between adjacent frames due to sensor noise or other environmentals, from an otherwise completely static image. Yet the difference between any uncompressed frame and the HDCAM-SR equivalent was 49.8dB, more than 10dB less distortion (massive) than the inherent noise level. CineForm 444 was 51.03db, better still (the higher number means less distortion.) While adjacent frame noise is not normally measured as a distortion, it is a very good indicator in the amount change that you must be less than for the image to look the same after compression -- assuming you are also trying to store the noise which I feel is an important part of being visually lossless. In film scans, the film grain is the noise floor you need to be less than, and the compression should preserve the shape of the grain to reach VL.

Taking this test further, and I get little wacky, but please bear with me. I average 72 frames of the uncompressed stationary image to extract out the sensor noise -- the 72 gives and effective 37dB of noise suppression. This new average frame is the ideal frame; it is what the camera was trying to see if noise could be eliminated in the camera. When I compare each unique uncompressed frame to the ideal, we can now measure the uncompressed acquisition distortion, just like as it was a lossy format. The PSNR error between uncompressed signal and the ideal frame was 41.86dB. When you compare the same ideal frame to the compressed results, you get the values of 41.38dB and 41.63dB for HDCAM-SR and CineForm respectively (CineForm 444 was compressing to around 5:1 using Filmscan1 mode and HDCAM SR compressed to around 4:1.) The less than 0.5dB difference between the lightly compressed solutions and the uncompressed capture, is why CineForm and Sony SR can safely claim to be visual lossless.

Ideal image:

Uncompressed image:

HDCAM-SR image:

CineForm image:

Download the full screen DPX versions here.

Notes
1: See in the black background to see how much noise has been removed through averaging sequential frames.

2: The reduction in noise in the ideal image can make it look softer, as noise is often seen as a visual cue for sharpness--add some noise to it and will seem sharper again.

3: There is some edge enhancement that must have occurred in camera, as all the images show it, so it is not a compression artifact.

Update: 10/1/07, Here is a good write up on the Viper's edge enhancement that I commented on in note 3.

14 comments:

David said...

I'm clearly getting readers, but not much feedback. Here am I commenting on my own blog.

Do you agree or disagree with this last post? Our my arguments reasonable, technical well supported and/or too geeky?

Rob:-] said...

Sorry nobody's commenting on your article.

I read most of your post but, since you asked, it's a bit too geeky for me. I am technical (EE degree in 1976) but I've been having a hard time climbing the learning curve on video acquisition and compression.

I'm really trying to focus more on the content creative side of things. I really only want to know how to select the right technology for what I'm trying to accomplish.

I have subscribed to your blog to try to keep up with the latest tech. Raw acquisition has always seemed like the best way to capture the material, then correct in post as needed.

So the short answer is, many may be reading even if few comment.

Peace,

Rob:-]

David said...

Thanks for the feedback. "Too geeky", yes this last post got heavily into numbers that are only lightly explained elsewhere on the blog. Is that where I lost you?

Sorry I geeked out with numbers, however they do have an impact on the creative. When any company uses a marketing term to describe quality, it either unsupported, or supported by numbers. I was trying show through the distortion number where CineForm can comfortable claim Visually Lossless or compression you can't see.

Anonymous said...

Hey David,

Keep the "geekery" coming . . . I know on my end I'm very anti-hype and I like numbers backing up claims. I refer people to you blog quite a bit, so it's nice to have the "hard-evidence" being posted in such a clean and concise manner. I think there's too much marketing terms being thrown around nowadays and not enough real information to steer people in the correction direction. So the "myth-busting" information you post is IMHO in-valuable to the community. Thanks so much for taking the time to-do it :)

GlennC said...

Hmm here's an interesting test. Throw something evil at the Cineform codec and see if it's still visually lossless. Random noise, perhaps with text (as text can sometimes exhibit ringing artifacts). In my test of this Cineform held up well... though my test was not very good (the 4:2:2 chroma subsampling mucks things up in VFW/Vegas).

GlennC said...

Hmm on second thought no. The worst pattern for Cineform would be green text on a magenta background (other color combinations might work). The ringing artifacts on the color transition can be visible.

Of course, fairly unlikely to happen in the real world (though possible, like blue title on yellow background). And the quality is so good that it's practically visually lossless. But in the **strictest** sense... knowing an obscure situation where Cineform stumbles slightly... I'd have to say something like 99(.99)% visually lossless.

David said...

glenn,

you are assuming compression issue with 4:2:2 YUV coding. CineForm supports 4:4:4 RGB in NEO 2K and Prospect 2K (used in these tests.) Green to magenta transition is as easy as black to white. No issues. In either YUV or RGB compression, we have enough quality options to meet the most demanding images.

GlennC said...

Hi David,
Here is how I tested and I did take into account chroma subsampling.

The original:
http://glennchan.info/Proofs/forums/CFtest-original.png
First frame of the compressed image (it looks worse than the subsequent frames; the subsequent frames all look the same, not sure what's going on):
http://glennchan.info/Proofs/forums/CFtest-cineform.png

Because I just made the test pattern at half size and blew it up with nearest neighbour resampling, there should not be chroma subsampling artifacts (since the Vegas version of Cineform should have chroma smoothing turned off). Of course the noise could be more random.

2- Ack, I tested the Cineform intermediate that comes with Vegas. Not the codec discussed in the blog article.

GlennC said...

http://glennchan.info/Proofs/forums/CFtest-original.png
http://glennchan.info/Proofs/forums/CFtest-cineform.png

The difference can be seen on the left edge of the triangle, and on some parts of the text in the purple blob area.

David said...

Glenn,

I'm surprise the free Vegas codec did as well as this. The Vegas license only supports "medium" quality, our second lowest quality. We offer three levels above that in our commercial tools (starting at $249.) Here is the same image encoding a YUV4:2:2 (just like yours) using the FilmScan quality setting (same used in the Viper shoot.)

YUV422-FilmScan.png

See, visually lossless :)

David said...

PS. We have quality levels above this that just call Overkill.

lordtangent said...

David,

Keep the technical stuff coming. I like your geeky posts! A agree with a lot of the folks here. There is too much hype and not enough real data in the marketing of most products. (the "Steve Jobs effect" aka, "reality distortion field")

I think it's great you back up your claims with pictures, numbers, and repeatable procedures others can use to do the tests themselves if they like.

GlennC said...

The filmscan quality looks great!

I'm also noticing some dithering in there (not visually noticeable, but there if you difference the images together). I'm not sure what I think about that. 8-bit RGB to 8-bit RGB shouldn't need dithering. Though if you converted that 8-bit RGB to Y'CbCr for pipeline or workflow reasons, then it might be appropriate to apply dithering when going back to 8-bit.

Regardless, the compression is very good quality. If you can save time by working with Cineform compressed (part of this depends on workflow/compatibility), then you ultimately have better quality because you can spend more time tweaking the project.

criticpapa said...
This comment has been removed by a blog administrator.