Log in

View Full Version : Better alternative for repairing badly upscaled chroma on interlaced NTSC DVD?


Reel.Deel
9th September 2014, 00:16
Currently working on some of my DVDs and I came across one where the chroma has been upscaled horribly (PointResize? at least that's what it looks like). This is a 1st for me, even though I have something that works decently (little blurry) I was wondering if you guys have better alternatives or suggestions? Here's a brief sample (https://dl.dropbox.com/s/9ifarh3jwbyxbwj/sample.m2v) showing the problem.

This is my current script, not really sure why it works :p but here's the output before (https://dl.dropbox.com/s/lgyw46notbqfhb0/Before.png) and after (https://dl.dropboxusercontent.com/s/9vmgb56afaehbom/After.png).
MPEG2Source("sample.d2v")
SeparateFields()
o = last

ConvertToYUY2(chromaresample="Point")
ReInterpolate411()

U = UToY8().BicubicResize(width/2, height/2, src_left=-0.50, src_top=1.0)
V = VToY8().BicubicResize(width/2, height/2, src_left=-0.50, src_top=1.5)

YToUV(U, V, O)
#Weave()
#QTGMC()

#debug only
Interleave(o,last)
ConvertToRGB32(chromaresample="Point")
PointResize(width*2, height*2)

feisty2
9th September 2014, 00:49
pointresize is reversible, if you're sure it's upscaled with pointresize, you can pointresize it back

Reel.Deel
9th September 2014, 00:56
It looks like PointResize but may have had other processing done to it so it's not completely reversible. Regardless, I already tried that and the results were not as good as my current script.

feisty2
9th September 2014, 09:43
little bit confused here, your clip is an mpeg2 video, so I guess it would be yv12 in the most possible way, and how could yv12 chroma be upscaled from some original video, shouldn't it be downscaled from yuy2 or yv24?
edit: is your clip upscaled?

Reel.Deel
9th September 2014, 13:29
Well that's assuming that this DVD came from a perfect world, I think we all know that's not the case. Proprietary software/hardware and industry 'professionals' find a way to mess things up. This footage was shot circa 2003 (small budget) so if I had to guess I would say that it was originally DV/DVCPRO 4:1:1 and then blindly converted to 4:2:2 for editing and finally 4:2:0 for DVD. Don't know how correct I would be but problems with DV and wrong chroma resampling was a known problem back in the day. That's why plugins like ReInterpolate411 (http://forum.doom9.org/showthread.php?p=352001#post352001) and ReInterpolate420 (http://forum.doom9.org/showthread.php?t=82787) exist.

feisty2
9th September 2014, 14:25
I tried to pointresize chroma back and upscale it with spline64resize, it works perfectly, so I don't know what you mean pointresize doesn't work

separatefields ()
y=grayscale ()
u=utoy ().pointresize (180,120).spline64resize (360,120)
v=vtoy ().pointresize (180,120).spline64resize (360,120)
ytouv (u,v,y)
weave ()

Reel.Deel
10th September 2014, 01:43
I never said PointResize didn't work, I said the results weren't as good. Also, I tried something a little differently, I downscaled with PointResize and then upscale chroma with nnedi3_rpow2 but the chroma was bobbing (don't know why). Anyways, I guess sometimes it's best to keep things simple. You're script does a pretty good job. Do you by chance know the offsets for the chroma placement to be MPEG2?

feisty2
10th September 2014, 01:59
it's a nnedi3 issue, you can't use nnedi3_rpow2 to upscale chroma since it's a top left aligned resizer (the align is designed for mvtools2 or awarp4 kind of supersample interpolation, not general image enlargement), it will get you center shift because you need a center aligned resizer, you gotta adjust the nnedi3 result with other resizers to fix the shift, like spline64resize (width,height,src_left=-0.25,src_top=-0.25)

colours
10th September 2014, 18:24
If the chroma planes end up being the same resolution as the source, there's no potential chroma shift to care about from ignoring MPEG-2 chroma siting.

For that matter, using PointResize to downscale only to upscale again with nnedi3_rpow2 is wasteful: just use nnedi3 directly!

ffvideosource("O:\sample.m2v")
nnedi3(field=3) # deinterlace first
u = utoy().turnleft().nnedi3(field=0).turnright().spline36resize(360,240,src_left=-0.5) # antialias the chroma
v = vtoy().turnleft().nnedi3(field=0).turnright().spline36resize(360,240,src_left=-0.5)
ytouv(u,v,last)
qtgmc(inputtype=1) # then use qtgmc in progressive mode

feisty2
11th September 2014, 01:01
that's no good, most people will not use pure nnedi3, one single intra filter to deinterlace for quality concerns, they prefer to use complex script for INTERPOLATION, not just STABILIZATION

colours
11th September 2014, 02:32
So you're saying that most people use QTGMC(Preset="Ultra Fast") because that's the only QTGMC preset that uses a not-purely-spatial deinterlacer for the first step?

I find that a bit hard to believe!

Reel.Deel
11th September 2014, 03:09
...using PointResize to downscale only to upscale again with nnedi3_rpow2 is wasteful: just use nnedi3 directly!

Thanks for the suggestion, believe me or not this is very close to what I wanted to do but had trouble making it work. I was more under the impression that using the progressive modes on QTGMC was more geared towards badly deinterlaced content. So is QTGMC(inputtype=1) the same as QTGMC() minus nnedi3 or is there more missing?

PS: Loving the signature :)

feisty2
11th September 2014, 03:11
the interpolation is not pure nnedi3/eedi3, it's actually edi+mflowinter, that's why it's called qtgMC, I think I read the qtgmc script before, now I can't remember all those specific details, but I guess it approximately works that way
edit: I'll check qtgmc script later when I get to my computer, and see what exactly does qtgmc do if inputtype=1

feisty2
11th September 2014, 03:24
inputtype=1 is designed to STABILIZE low quality deinterlaced clips, I guess it's not the same as normal interpolation process

feisty2
11th September 2014, 06:51
okay, I just checked qtgmc script again, it doesn't use mflowinter, did a little search on forum, mcbob uses it instead, seems like I mixed them up in my memory, and yes, you can use inputtype=1, it's identical to qtgmc internal process, tho I guess nnedi3 is not a good deinterlace kernel since it's too weak at connecting lines which is one of the most important features required for a deinterlace kernel, I always thought nnedi3 is more like an upscale kernel, back to the point, eedi3 (sclip=nnedi3 ()) would be a lot better for deinterlacing, and dude, you don't really wanna upscale chroma with nnedi3 cuz chroma quality is usually..., well, we all know the answer, I think a smooth algorithm like eedi3 would be better for chroma upscaling