Log in

View Full Version : Mpeg2 Blockiness


KnightAzul
15th October 2005, 19:20
Hi,

I have encoded Mpeg2 files, using TMPGEnc, from PAL DV source (home videos). For playback I use the latest Nvidia Purevideo Decoder. I have noticed that during some scenes, for example, shots with ocean backdrops with lots of small waves, there is some blockiness in the waves. This is visibile on my 17" TFT monitor. I tried encoding at 9000 CBR, just to see, and there was a slight improvement but it did not go away.

The original DV file plays ok with no blockiness, and also a DivX encoding of the same file with AutoGK plays ok with no blockiness.

Why could this be? Is the DivX somehow blurring the output to make it appear as if it is better quality, or have I possibly messed something up on the Mpeg2 encoding?

Thanks for any help!
KnightAzul

Pookie
16th October 2005, 02:11
http://forum.doom9.org/showthread.php?t=28780&highlight=dv+macroblock

freelock7
16th October 2005, 09:32
What's the bitrate average of your mpeg file?

KnightAzul
16th October 2005, 09:38
CBR 9000 would give an average bit rate of 9000. I encoded at the maximum so verify the blockiness was not entirely a bitrate problem.

KnightAzul

freelock7
16th October 2005, 11:33
Well, it's not possible to have such a bad file with these settings.
1-Are you sure about the source quality?
2-are you sure about the interlaced dv settings-if it is?
(It could be helpful to go in the DV section).

KnightAzul
16th October 2005, 14:56
Well, it's not possible to have such a bad file with these settings.
1-Are you sure about the source quality?
2-are you sure about the interlaced dv settings-if it is?
(It could be helpful to go in the DV section).

In my original post: "The original DV file plays ok with no blockiness, and also a DivX encoding of the same file with AutoGK plays ok with no blockiness."

I am not saying that the quality of the Mpeg2 is terrible, but that on close inspection on a TFT display some blockiness can be observed during shots with the ocean. I'm pretty sure that I have all of the TMPGEnc setting correct for DV to Mpeg conversion (http://www.doom9.org/index.html?/dv/guide.html).

Perhaps I am expecting too much ... would I get better results with a hardware encoder such as a Hauppauge card?

KnightAzul

freelock7
16th October 2005, 18:29
Perhaps I am expecting too much ...

No, you don't. MPEG 2 encoding can't be worse.
You could try another encoder to compare (f.e. Canopus or mainconcept).

KnightAzul
16th October 2005, 19:55
I'm currently battling with CCE to see if I can get better results. Though I am not holding my breath!

KnightAzul

Mug Funky
17th October 2005, 10:55
divx's decoder will perform rather strong deblocking by default, so you might want to turn it's postprocessing off and check again.

9000 should be safe for any content... checking whether it is interlaced and if TMPG is set for it could be handy.

another thing it could be (particularly with an LCD screen) is blocking becoming visible because the screen is not using 8 bits per channel and rounding the colours wrong. i've seen this on tons of LCD screens, and so i don't trust them for QC'ing stuff.

however, oceans are notoriously hard to encode. as far as the encoder is concerned it's just uncorelated noise. though 9000 Ought To Be Enough For Anyone (TM), it's still quite possible for it not to be.

it's also possible the DV source was slightly blocky too, and re-encoding has amplified it. at 25mbps, i-frame only, DV isn't the most efficient thing out there, and IMHO a good MPEG-2 at 9600 is actually a fair bit better than DV25 (in NTSC there's just no contest - NTSC DV25 is awful on account of the 4:1:1 colour sampling. PAL DV doesn't have this problem, nor does NTSC mpeg-2)

DV50 is a different story though... it's very good indeed.

scharfis_brain
17th October 2005, 11:54
I had problems encoding water, too.

Switching from TMPGenc to Camopus ProCoder helped a lot.
Especially its field-mode gained things.

But do not expect miracles. Even with ProCoder the blockyness wasn't knocked out completely.

freelock7
18th October 2005, 08:42
a-Do not forget that the DV data transfert has to be done through a IEEE 1394 interface. You'll keep the full digital information you can't loose-I don't know if you use it(?).
b-To know the difference between DV and MPEG2 compression:
The DV compression format was designed as a capture and editing format for use in devices like camcorders.DV therefore uses "intraframe" compression, in which each frame is compressed independently of each other. It uses a fixed data rate, which makes sense when you are writing to or reading from a video tape.Each compressed frame depends entirely on itself, and not on any data from preceding or following frames. However, it also uses adaptive interfield compression; if the compressor detects little difference between the two interlaced fields of a frame, it will compress them together, freeing up some of the "bit budget" to allow for higher overall quality. In theory, this means that static areas of images will be more accurately represented than areas with a lot of motion; in practice, this can sometimes be observed as a slight degree of "blockiness" in the immediate vicinity of moving objects.
So, what's the big difference between DV and DVD video anyway? After all, they're both compressed digital video, full-resolution (720 x 480) and full-rate, and even start with the same two letters. But they are significantly different formats, designed for very different purposes.
By comparison, the MPEG-2 compression format was designed as an efficient delivery format for pre-recorded video. It supports variable data rates, so you can tune the amount of compression, trading off quality against data size, to match the type of material and target storage medium. To compress more aggressively, MPEG-2 uses "interframe" compression, in which some of the frames are compressed independently (like DV), but most of the frames are compressed by using information from the previous and even following frames. This can provide big savings in compression size, especially when large portions of the background remain relatively unchanged from frame to frame. However, the trade-off is that the video is much less suited for editing, since it is compressed more heavily, especially the in-between frames.
Adam J.Wilt "FAQ DV format", Douglas Dixon "DV to DVD"
c-tests link:
http://www.videohelp.com/guides.php?link=743
So,I believe that water can be encoded correctly with a good encoder and a good setting.

Kika
18th October 2005, 10:05
For DV to DVD at such high Bitrate, simply turn B-Frames OFF in TMPGEnc and set the GOP-size to 12-15 (IPPPPPPPPPPPPPP).
Also use CQ_VBR instead of CBR (Q of 80-100). P-Spoilage = -5 to 5, this depends on the source.

This settings will result in a far better quality. Even water-scenes will come out much better (and less blocky).