View Full Version : Cinepak CVID deblocking and sync troubles


2Bdecided
7th November 2007, 15:33
I have an old Cinepak video I'm trying to restore.

I face two problems with it...

1. The 2x2 pixel blocks this format is based on are sometimes very visible (see attached image). The motion compensated denoising I'm trying often locks onto these blocks rather than the actual movement - this makes the blocks stronger rather than smoothing them! What would be a suitable deblocker for these 2x2 pixel blocks?

2. I'm using DirectShowSource, and the audio / video sync is weird. There's about 10 seconds of black at the start of the file which is there when watching in VLC and _skipping_ through the AVS in VirtualDub, but which goes missing when I perform an actual dub or press play in VirtualDub: it jumps to the first non-black frame (but the audio doesn't!). seeking=true or false doesn't help. I can use trim to cut the audio to almost match the video at the start ("trim" doesn't trim the video, as long as I keep the trim amount within the sometimes missing black 10 seconds!), but the audio drifts out of sync.

According to AVIsynth info(), it's 320x240, 14.8478fps(!). It would have come from a PAL source.

I won't mention the fact that there are parts which weren't even deinterlaced before being resized to 320x240 - I'm concentrating on fixing the parts that "only" have the above two problems!

Any ideas?

Cheers,
David.

IanB
7th November 2007, 22:35
ConvertFPS=True might fix your audio sync problem.

You could try the motion analysis with 50% subsampling i.e....
Pval=??? # experiment to find a good P
GaussResize(Width, Height/2, P=Pval) # subsample!
Neeedi(....) # Edge detected interpolate back to original height
TurnLeft()
GaussResize(Width, Height/2, P=Pval)
Neeedi(....)
TurnRight()
...You may only need to subsample in 1 dimension or the other, experiment, use ShowMV to look at the motion vectors. (look in the Developer Forum for posts by Tritical for the Edge detection interpolators.)

2Bdecided
8th November 2007, 11:05
ConvertFPS=True might fix your audio sync problem.Thank you! That works perfectly.

You could try the motion analysis with 50% subsamplingI'd thought of something like that, but I didn't know how to resample motion vectors back up to the desired size, and hadn't thought of resampling the clip back up before analysing the motion - thank you for your excellent suggestion - I'll give it a go.

Cheers,
David.

Dark Shikari
8th November 2007, 11:11
If the source is entirely 2x2 subsampled, both luma and chroma, you might as well just downsize it by 50%.

2Bdecided
8th November 2007, 12:48
No, you can see even in that bad frame that some information remains at the pixel resolution - it's only in complex scenes that the 2x2 pixel pattern predominates, and even then, it's sometimes like 8x8 MPEG - blocky, but there is information within the block. Better to remove the blockiness than nuke the resolution completely.

Cheers,
David.

2Bdecided
8th November 2007, 17:20
Having experimented with the above as a pre-process to motion compensated denoising, the motion compensation doesn't stick to the blocks any more, but (of course!) the blocking is still there in the absence of motion.

So I think I really need a good deblocker which can be told to look at 2x2 pixel blocks (or just generally) - any suggestions?

Cheers,
David.

IanB
8th November 2007, 21:07
Well the crude approach is to PointResize by 2 or 4 to make the blocks 4x4 or 8x8 ... then GaussResize down again.