Log in

View Full Version : Reducing Blocks During Camera Pans


Pookie
16th January 2006, 10:01
1080i Broadcast TV Source

Scene With Low Motion
http://img17.imageshack.us/img17/7949/static5uf.png (http://imageshack.us)

Camera Pans to Other Actor
http://img17.imageshack.us/img17/6573/panning8bu.png (http://imageshack.us)

It would be better (I'm guessing) to blur rather than deblock on these fast moving scenes. Any suggestions ?

Mug Funky
16th January 2006, 10:27
ach! my eyes!

my prescription? fire! and lots of it!

seriously though, something like blindpp(quant=31) might have a chance at it. detecting blocks of that magnitude is another matter... i've been playing with using 16^2 blocks and mvmask to reveal areas that are likely to go blocky, but for something this bad i wouldn't use it because it'll destroy good areas too.

one thing you can do is the manual treatment. it's not too painful - track down blocky areas with bitrateview. when the frame quant spikes high, you can be pretty sure there's an ugly scene underneath*

[size=1]* a possible exception is with an encoder that really knows what it's doing - you can get high quants but somehow the scene doesn't block out. usually only happens on very grainy sources though.

AVIL
16th January 2006, 10:51
Hi,

You can try to deblock with filters from MSU:

The newest filter

http://www.compression.ru/video/deblocking/smartdeblocking_en.html

or the old one

http://www.compression.ru/video/deblocking/index_en.html

Those filters are mainly for virtualdub but can be called from avisynth scripts (at the cost of converting the video to RGB32)

You can also blur the video with FFT3DFilter:

You can get it from

http://www.avisynth.org/warpenterprises/

Try using sigma, sigma2, sigma3 and sigma4 at the same time but with stronger value for sigma (the highest frequency) and decreasing for subsequent sigmas.

Those filters (with conservative parameters) can be used along the complete video. If you don't want this you can select -after processing, with conditionalfilter and differences on luma- the frames more afected (blocky) and the original frames in the rest.


Good luck

Didée
16th January 2006, 11:24
Now, what IS that, Pookie? You mention 1080i capture, the screenshots are 720x400, and the blocks seem to be 6x6 pixels on average.
(6x6~720x400 -> 8x8~960x536 -> 16x16~1920x1080 ? )

Did you try Deblock_QED (http://videoprocessing.11.forumer.com/viewtopic.php?p=413#413)? Can't say if it will cut on that strong blocking - perhaps yes, perhaps no. At least it should not degrade detailed scenes.

Pookie
16th January 2006, 11:43
Thanks for the help , I'll try all recommended solutions.

Mug Funky - I recently stumbled upon an interesting thread regarding macroblock detection.
http://forum.abhdtv.com/showthread.php?t=22732

AVIL - Thanks. I've used those filters many times.

Didée - Yeah, I know. I wasn't thinking about resizing,A/R, etc other than making the images large enough to demonstrate the problem AND small enough not to take forever to load. Let me assure you the ugliness is on the 1920x1088 source ;) I'll try QED and FunkyDeblock, perhaps on the moving pans only. Problem is, this phenomenon is on all twelve shows.

foxyshadis
16th January 2006, 15:17
Deblock_qed requires an edit (hack) to work with HD, an extra stacking:

block = clp.width > 768 ? stackhorizontal( block,block,block) : block
block = clp.height > 576 ? stackvertical( block,block) : block
block = block .crop(0,0,ox,oy)

Otherwise it bitches about increasing the res with crop. You could possibly take the checks out, but I didn't want to mess with it too much until I get a chance to understand it.

Chainmax
16th January 2006, 15:31
DeBlock_QED is good, but doesn't remove strong blocking and upping the quants (like quant1=30,quant2=60 vs defaults of 20/40) doesn't seem to make much difference. In any case, that panning frame not only shows nasty blocking, but also chroma artifacts. I recall a past thread in which someone was trying to encode an episode of Lost IIRC and he said something like that each other frame was extremely blocky but was otherwise identical to one of its adjacents so it could be removed without any effect.

Pookie
16th January 2006, 18:30
Here's a short (8MB) clip of source material. (Thanks once again to Richard Berg for hosting)

ftp://tempclips%40avisynth%2Eorg:QfJY(86m@avisynth.org/1080i-block.m2v

Chainmax - I recall that 'LOST' post quite well, since it was mine :D

Chainmax
16th January 2006, 20:20
Maybe this is a similar case?

Pookie
16th January 2006, 21:54
Unfortunately, no. This is triggered by fast movement and fast brightness changes --> low bit rate issues. Seems like video sources are much more blocky than film. Have a look at this clip if you want to see more (warning 30MB)

This example can never be fixed :(
ftp://tempclips%40avisynth%2Eorg:QfJY(86m@avisynth.org/nbc1080i.MPG

Revgen
17th January 2006, 00:26
Opened this using ffdshows decoder and resized it to 960x540 to eliminate the interlacing and used ffdshow's FastSPP postprocessor and set it to 50%. It's still not great but it's far better than what it was.

You can use the latest ffavisynth.dll by using:

LoadCPlugin("yourdrive:\ffavisynt.dll")


And using:

ffdshow("default")

to use your currently set ffdshow settings.


Tip For Next Time:

Try capturing a 720p stream next time. Interlacing is just a PITA.

Pookie
17th January 2006, 00:40
Thanks Revgen, I'll try it out. I don't have any control over capture size, as these are OTA HD Transport Streams. There's no encoding going on during capture. NBC HD is 1080i, ABC HD is 720p, etc.

Pookie
17th January 2006, 11:25
Sorry about the .jpg, it was a size limitation of the host.

http://img35.imageshack.us/img35/4066/index14og.th.jpg (http://img35.imageshack.us/my.php?image=index14og.jpg)


Well, I applied them all to the 1920x1088 image. The Vdub plugin showed the greatest amount of deblocking/smoothing, but it affected the non-panning portions of the scene as well.

Osmiridium
17th January 2006, 12:33
For a recent video (blocky pretty much all the way through) I had good results by combining the outputs of Deblock_QED and the VirtualDub MSU SmartDeblocking Filter, as follows:


MSUclip = AviSource("MSU'ed clip.avi") # clip already processed by MSU Filter
QEDclip = AviSource("QED'ed clip.avi") # clip already processed by Deblock_QED

Interleave(MSUclip, QEDclip, MSUclip)

TemporalSoften(1,15,15,50,2)

SelectEvery(3,1)


I played about with the temporal soften values a bit, to find the right blend of QED and MSU for my particular video.