PDA

View Full Version : TECHNICAL: The Risk Of Compression Noise


BobDiaz
12-09-2007, 10:24 PM
First thing I want to say is that it is impossible to judge the quality of a video by just using a calculator. The results of the calculations I use in this message can only provide a relative comparison between the different recording modes.

As I said in a past message, using MPEG-2 compression on the Sony EX-1 is both a blessing and a curse. It's a blessing because depending on the recording mode, one could obtain more than 3 to 4 minutes per GB of storage. In contrast, the Panasonic HVX-200 provides around 1 to 2.5 minutes per GB of HD recording.

The curse is the risk of having too many changes within the GOP (Group Of Pictures) which results in overloading the CODEC, creating compression noise blocks within the image. In the case of the Sony Z1 HDV camera, a rapid pan could result in creating the visible compression noise blocks within the image. Under less aggressive shooting, the noise blocks would not appear.

Not all CODECs perform the same and it seems likely that Sony used a better CODEC in the EX-1 than they did in the Z1. After all, a few years have passed from the introduction of the Z1 and both software MPEG-2 compression and chip hardware have improved during that time.

Depending on the resolution selected and the frame rate, the amount of data that must be compressed varies between the different modes. In order to better understand the relative differences, I've converted the differences into a EBR (Equivalent Bit Rate) figure. This represents the equivalent bit rate that the SQ 1440 x 1080 @ 60i would need to be, to match the same video compression level of a given mode. Where higher EBR represents less compression, thus less risk of seeing compression noise.

The first surprise was that the HQ 1920 x 1080 @ 60i (or 30p) came to 25.5 Mb/s EBR. An increase of just 2% for the number of bits per pixel, compared to the SQ mode. In all fairness to Sony, there is both an increase in the horizontal pixels from 1440 to 1920 and the audio switches from a compressed 0.384Mb/s audio to an uncompressed 1.536Mb/s audio, so there really is an improvement from SQ to HQ.

Another issue is that whenever you work in progressive mode, MPEG-2 works better. However, that effect is not reflected in my calculations. The numbers for the different modes are:

SQ 1440 x 1080 @ 60i = 25 Mb/s

HQ 1920 x 1080 @ 60i (or 30p) = 25.5 Mb/s EBR

HQ 1920 x 1080 @ 24p = 31.7 MB/s EBR

HQ 1280 x 720 @ 60p = 28.6 Mb/s EBR

HQ 1280 x 720 @ 30p = 58.6 Mb/s EBR

HQ 1280 x 720 @ 24p = 73.2 Mb/s EBR

The real test would be to shoot something that tends to overload the CODEX and view it frame by frame. This could be a rapid pan, a gray card at +18dB, a tight shot of noise patterns on an older analog TV, a tight show of a large number of leaves blowing in the wind, a shot lit with a rapidly flashing strobe light, or many different ripples running though reflections in the water.

Assuming that you can generate an image that overloads the CODEC, I would predict that the greatest risk of it happening at the SQ 1440 x 1080 @ 60i mode; the HQ 1920 x 1080 @ 60i mode would be very close too. However, the HQ 1280 x 720 @ 30p mode and the HQ 1280 x 720 @ 24p mode may be very hard, to next to impossible to overload the CODEC. In those modes, the EBR (Equivalent Bit Rate) is so high, it might be able to deal with almost everything you can throw at it.

Anyway, that's the theory ... I hope that someone who has an EX-1 will try a torture test in the different modes to see how far you can push the camera before the CODEC generates compression noise.



Bob Diaz

harddrive
12-10-2007, 01:55 AM
First thing I want to say is that it is impossible to judge the quality of a video by just using a calculator. The results of the calculations I use in this message can only provide a relative comparison between the different recording modes.

Another issue is that whenever you work in progressive mode, MPEG-2 works better. However, that effect is not reflected in my calculations.
I do note your caveat, and also agree with the comment about progressive v interlace. I'd also suggest another effect though, which is that higher resolution images seem to stand a higher level of compression than lower res ones. (A theory you can test very easily making JPEGs in Photoshop)

In practice, this should mean that as well as increasing the recording resolution, the use of 1920x1080 progressive should also have compression advantages. Combined with the use of a new generation coder, I'd expect the "EBR" in such as 1080p modes to be much higher than straightforward maths would suggest.

I-frame only mode does obviously mean that changes between frames cause no problems, but a price is paid that these frames may often be compressed more heavily within themselves than the I-frames in a long GOP system. (And if the relative rates are well chosen, those advantages can be passed on to the Band P frames as well.

Whilst "quality" is so often agonised over in the great inter/intra debate, the real disadvantage of inter-frame systems is really complexity and less easy editing, whereas with intra-frame the price to be paid is data rate.

BobDiaz
12-10-2007, 11:58 AM
harddrive,

Thanks for the comments. There are several factors that I can't take into account in the calculations, because it all depends on the CODEC. So my numbers are just a rough estimate as to the chance of seeing compression noise under worst conditions.

As for higher resolution, you're correct; because an 8x8 pixel block of data will appear 1.5x larger in the horizontal or vertical direction when we compare 720 to 1080. Even with a small amount of compression, if you zoom into a JPEG image enough, you can see the compression artifacts. It's hard for me to say if the increase in the "EBR" of jumping from 1080@30p to 720@30p is enough to overcome the increase of the block size. Maybe it is, but I really don't know for sure.

There's a presentation on the Sony EX-1 at LAFCPUG this Wednesday, December 12 at 6:45 PM. I plan on going to it. For those in the Los Angeles area:

http://www.promax.com/Events/Sony/lafcpug_xdcamex.lasso

For those who can't be there, I'll post anything new that I learn.


Best Wishes,

Bob Diaz

harddrive
12-10-2007, 01:21 PM
As for higher resolution, you're correct; because an 8x8 pixel block of data will appear 1.5x larger in the horizontal or vertical direction when we compare 720 to 1080.
I was really thinking of the move from 1440x1080 of HDV to the 1920x1080 of the EX codec. Simplistically, the maths show that the "data rate per pixel" is similar in each case - I'd expect that the EX would have an advantage for the reasons discussed, higher resolutions can take more compression within the frame.

Barry_Green
12-10-2007, 01:39 PM
The other thing to factor in is that it may seem like you'll have more efficient compression at the lower frame rates and less efficient at the higher frame rates, but it may not in actuality play out quite like you'd expect. For one thing, there'll probably be quite a bit less change frame-to-frame when running at the higher frame rates, which could make the higher-frame-rate compression a tad more efficient in comparison to the potential for larger jumps between frames at the 24fps or other slower frame rate.

In other words, you're right -- this is one that's going to be nearly impossible to figure out just by slide-rule alone. :thumbsup:

Elton
12-10-2007, 03:32 PM
Bit rates can only indicate so much when we're discussing interframe compression schemes. When you throw in Sony's VBR 35mbs HQ mode, encoding quality jumps to a different league than standard HDV CBR 25mbs. I've had some seat time with the EX1 and I can say confidently that it's pretty tough to break the codec in HQ mode.

I've done HDV torture tests with the Canon cams and I can tell you that the HDV frame modes fared much better when put under severe stress than the interlace mode. (frame mode is progressive MPEG2 encoding) All I had to do was point the camera at a little babbling brook and fill the entire frame with frothing, bubbling water everywhere. 1080i broke down into noticeable macroblocking, whereas 24F blocking was much more difficult to detect, especially in motion.

Now you have the added wrinkle of Sony's much better XDCAM 35 mbs VBR compression, and it gets even better when applied to 720 24p encoding.

Have you heard many people complain about macroblocking with the Canon cams? I expect there will be few to zero complaints with the EX1's HQ modes.

BobDiaz
12-10-2007, 07:10 PM
I would not be surprised to find out that all my worries about the risk of seeing micro blocks is for nothing. Still, it would be nice to know that for sure...

I recall seeing a post where someone did try a rapid pan at 720@24p and found that it was next to impossible to get compression noise.

http://www.dvxuser.com/V6/showpost.php?p=1119046&postcount=565


It would be interesting to know if the modes like 1080@60i, 1080@30p, and 720@60p would hold up as well. I'm sure that as more people try out the camera, we'll find out....

Berry hit upon a key point that as we drop the frame rate, the differences between each frame increases. To switch from 720@60p to 720@30p, the amount of data to be compressed drops by 1/2, but things move around by twice the amount. My gut level feeling is that the drop in data rate has the advantage, but without a real world test, I can't be sure.


That's the problem with being an engineer, I tend to worry about these things too much. :Drogar-BigGrin(DBG)

Bob Diaz

harddrive
12-11-2007, 02:06 AM
The other thing to factor in is that it may seem like you'll have more efficient compression at the lower frame rates and less efficient at the higher frame rates, but it may not in actuality play out quite like you'd expect. For one thing, there'll probably be quite a bit less change frame-to-frame when running at the higher frame rates, which could make the higher-frame-rate compression a tad more efficient .............
You're absolutely right, though it may be considerably more than a tad. The same principle is being found in discussions about any move to 1080p/50(60) for broadcast. Early thoughts were that it could never be justified in bandwidth terms. In practice, the factors you mention, coupled with coder improvements seem to indicate that the increase isn't likely to be as much as feared.