View Full Version : Blocking shows in encode, increase bitrate or moeg-2 deblocking?


bananacreamandpeca
6th January 2007, 12:16
My encode shows visible blocking in scenes where theres lots of smoke and big explosions.

What should I do? Icrease the bitrate when encoding?
Or set MP2-deblocking on (feature in Megui/AVS-creator)?
The line with mpeg2-deblocking in AVS will ook like this:

DGDecode_mpeg2source("F:\source.d2v",cpu=4)

picture:

http://i11.photobucket.com/albums/a158/alcappuccino/vlcsnap-70199.png
http://i11.photobucket.com/albums/a158/alcappuccino/vlcsnap-68470.png

it's actually alot worse than the pictures show. You have to see it in motion I guess.

Morte66
6th January 2007, 13:34
Your real problem is the source DVD, which has lots of blocking covered by lots of noise and general MPEG2 crud. Encoders like x264 act like quite strong denoisers, so encoding with them reveals the blocking.

There are a few things that can be tried:

1. DGIndex deblocking.
Usually makes things worse in my experience.

2. The Blockbuster() filter for avisynth
Adds noise to blocky areas before encoding. A bit of a waste with x264, since it pretty much just removes the noise again. Works better with Xvid.

3. Add noise on playback.
If you use the ffdshow decoder or raw video processor, it can add noise over your output. Once you get it tweaked right, this will make the blocking less noticable and it may also give a sense of enhanced detail (e.g. more skin texture on faces). A partial solution.

4. Use DeBand in ffdshow
This is another ffdshow function that looks for colour banding and blends over the edges. It's somewhat useful against blocking too, but it doesn't handle patchy/jumpy blocks so well as stable areas.

5. Funky stuff.
Use a very slow and complex avisynth script like this (http://forum.doom9.org/showthread.php?p=920050#post920050) with motion vector analysis to deblock the source.

6. Sit further away.

Combinations of 3-6 work well.

You'll note that none of these are h264 encoding, and we're in the AVC forum, so as a gesture to our sponsors... If you want to minimise the small amount of blocking that x264 introduces as well as the large amount that it reveals, there are some useful settings. Enable --no-fast-pskip and --no-dct-decimate (minor bitrate impact, might as well use 'em by default). Experiment with an antiblocking custom matrix (http://forum.doom9.org/showthread.php?t=117041) like m4g-smooth (much bigger impact, needs to be weighed).

Also, read the threads I linked and the threads they link too.

bananacreamandpeca
6th January 2007, 19:19
6. Sit further away.


http://i11.photobucket.com/albums/a158/alcappuccino/lol.gif

I tried it, I still see them. And I'm kinda in this fase right now
where I'm overly concerned with quality and trying to
get the hang of the codecs and options etc.

Your real problem is the source DVD, which has lots of blocking covered by lots of noise and general MPEG2 crud. Encoders like x264 act like quite strong denoisers, so encoding with them reveals the blocking.

Another thingie I did not know.
Thought it was an "available bitrate vs. video complexity" thing.

There are a few things that can be tried:

1. DGIndex deblocking.
Usually makes things worse in my experience.

In an AVS script does it look something like this?

"DGDecode_mpeg2source("F:\source.d2v",cpu=4

[QUOTE]5. Funky stuff.
Use a very slow and complex avisynth script like this (http://forum.doom9.org/showthread.php?p=920050#post920050) with motion vector analysis to deblock the source.

Is this the same as Motion Estimation in x264?

I used very few ME. ref. frames

there are some useful settings. Enable --no-fast-pskip and --no-dct-decimate (minor bitrate impact, might as well use 'em by default). Experiment with an antiblocking

Yes, I already disabled fast-pskip.

Here's the full commandline I used:

--crf 21 --keyint 240 --min-keyint 24 --ref 2 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --weightb --direct none --filter -3,-2 --analyse p8x8,b8x8,i4x4,p4x4 --vbv-maxrate 25000 --me umh --merange 10 --thread-input --zones 173043,179381,q=26 --progress --no-psnr --no-ssim --output "F:\SW6\VIDEO_TS\SW-VI.mp4" "F:\SW6\VIDEO_TS\SW-VI.avs"

Don't ask me why I ruled out certain default settings. I'm just trying to understand them to a degree.
And Yes, I;ve tried encoding using the standard presets by sharktooth too. But weren't too satisfied with the results.
But thats due to the fact the sources I used were prob. crappy in the first place.

bkman
6th January 2007, 19:49
I think that Morte's answer is going a bit overboard. There are some simple things that you can use to decrease blocking.

For one, your deblocking settings are too low for that CRF level. Try -2,-1, or even -1, -1.

Secondly, use a custom quantisation matrix, like Sharktooth's AVC_HR. It will allocate more bits to some bland parts.

If that doesn't help much, try AQ. Eg. --aq-strength 0.6

Lastly, just lower the CRF quantiser, if you can afford it.

Manao
6th January 2007, 20:15
AQ shouldn't help when a frame is uniformely filled with fog.

Morte66
6th January 2007, 20:23
In an AVS script does it look something like this?
"DGDecode_mpeg2source("F:\source.d2v",cpu=4

Yes, the "cpu=4" is what turns on DGIndex deblocking.

Is this the same as Motion Estimation in x264?

No, it's a very different thing. Not related.

Here's the full commandline I used:

That looks reasonable, except I think --direct none is probably only useful with some custom quantiser matrices, --direct auto might make more sense with the rest of your current settings.

I don't know what the zones thing is about.

bananacreamandpeca
6th January 2007, 21:55
I don't know what the zones thing is about.
O, it's just to decode things like end-credits and intro's at lower quality.