Log in

View Full Version : Ways of reducing combing on encodes that haven't been de-interlaced?


j8ee
1st August 2015, 15:26
Are there things you can try to get things that wasn't de-interlaced when resized and encoded to look better, smoothening out and reducing the combing somewhat?

I'm watching a film that has some short episodes of interviews shot with video, and those interviews are quite hard on the eye, with combing when they move their hands or just talk. The rest of the film is excellent, smooth and sharp, so those interviews really jump at you.

LoRd_MuldeR
1st August 2015, 15:40
If interlaced material has been resized without de-interlacing first (or using special "interlaced" resize methods), then it's pretty much a lost case.

If it has not been resized, you could apply an adaptive de-interlacing filter, so only the interlaced sections of the movie will be processed, while the progressive sections will be passed-through unmodified.

j8ee
1st August 2015, 15:48
Yeah, it's resized, so the effects lie on several pixel rows. I had a vague hope of that someone had made an avisynth filter/script that reduced such combing, and then putting it in another script to apply it only on affected parts.

feisty2
1st August 2015, 16:10
resized like, how? resized as progressive image or resized field based and woven back together
first kind = blending, irreversible imho
second kind = field phase shift, we might have some avisynth plugin for this kind of crap I guess.

kuchikirukia
1st August 2015, 23:15
If it's been enlarged you can scale it back and deinterlace. I've had luck with a 1080p Bluray that had upscaled 720 content and a 720p Youtube upscale of DVD clips that hadn't been IVTC'd.

Original Youtube:
https://www.youtube.com/watch?v=3_pwdPSafEs

Mine:
http://www.filedropper.com/brs-thecatalyst

(Not properly decimated since I couldn't find a setting that worked and I was tired of screwing around with it.)

Resize back to original, QTGMC, and antialias to clean up.

hello_hello
2nd August 2015, 08:51
Maybe something like this?
http://forum.videohelp.com/threads/372822-Fixing-jagged-lines

ChiDragon
2nd August 2015, 19:47
johnmeyer had some limited success making an improperly-downsized interlaced video look less awful. It was this thread (http://forum.doom9.org/showthread.php?t=170813) about a concert video of the rock band KISS that someone on YouTube butchered.

But for a "film" I suppose the video would have been upsized, per kuchikirukia's post.

StainlessS
3rd August 2015, 00:44
Did it look anything like that posted in these two threads:

original thread:
http://forum.doom9.org/showthread.php?t=162599

ExBlend thread (The clip in question is 3:2 pulldown that has been resized as if progressive):
http://forum.doom9.org/showthread.php?p=1558846#post1558846

j8ee
3rd August 2015, 09:18
Thanks!

I will take a look at those threads later and see if anythings helps. I have no idea of the original format, or how it was processed. The bad parts look like this anyway:

http://i.imgur.com/tIuNJWn.png
http://i.imgur.com/jQ3YsGn.png
http://i.imgur.com/uXVffst.png
http://i.imgur.com/qKsXQnX.png

It's a small cropped part of the frames. More frames at http://imgur.com/a/BSsS9

It's actually now mostly of theoretical interest since I just sighed and watched it, but I do come across these things every now and then, so it's good to know what possibilities there are.

wonkey_monkey
3rd August 2015, 16:08
Can you post, say, one second of video with the most movement?

j8ee
3rd August 2015, 22:48
Sure, here are two clips, 1 MB and a few seconds each:

https://mega.co.nz/#!mswEnIpD!t9Lg2YEYunDBskdZTDy1UrLBl1DGpn5twXD_Ir5PL34

https://mega.co.nz/#!X0JSFTqB!tdgHD4ODCtQpDcRsMtxtvnPn2LlhgYHTyiC-uMQPpq4

It's not much movement as they just sit and talk, but when gesticulating or only nodding and moving the lips, the combing is quite noticeable.

LoRd_MuldeR
3rd August 2015, 23:31
Just a quick try (sledgehammer method):
FFVideoSource("cut (1).mkv")
Last.PointResize(Last.Width, 480)
NNEDI3(field=2)
Merge(Last.SelectEven(), Last.SelectOdd())
Spline36Resize(Last.Width, 720)

kuchikirukia
4th August 2015, 02:04
Last.PointResize(Last.Width, 480)
QTGMC()
Merge(Last.SelectEven(), Last.SelectOdd())
Spline36Resize(Last.Width, 720)

j8ee
4th August 2015, 12:41
Well, that QTGMC script worked good, but not surprising it's so slow I would only be able to use it for recoding. (CPU didn't go up much, but it was still a very low frame rate - what processing is it that makes such a thing happen? Memory throughput?)

NNEDI3 was decent, it removes the jagged edges in the hand movement and smooths it out, but leaves more artifacts for the man's glasses in cut (3). Definitely works "well enough" for my needs here, nice and simple.

I'm surprised the resizing to 480 managed to resemble an interlaced video as well as it did, I would have though it would be more irregular than it turned out.

colours
4th August 2015, 16:35
[edit: disregard, I just got it, order of frames... ] Bordering OT since my avisynth skills are low level, but why is NNEDI3(field=2) used?

It's not just a difference in field order (which actually doesn't matter here). field=1 does single-rate deinterlacing (i.e. the output has the same frame rate as the input) while field=2 does double-rate deinterlacing (i.e. the output has twice the frame rate of the input).

LoRd_MuldeR
4th August 2015, 19:31
It's not just a difference in field order (which actually doesn't matter here). field=1 does single-rate deinterlacing (i.e. the output has the same frame rate as the input) while field=2 does double-rate deinterlacing (i.e. the output has twice the frame rate of the input).

Yes, "field=2" interpolates one frame from the "odd" lines and one frame from the "even" lines, so we use Merge(...) to blend each pair of consecutive frames, in order to keep the total frame count unchanged.

You can try with "field=0" or "filed=1", which will interpolate only from the "even" or the "odd" lines, but then the Merge(...) has to be removed...

j8ee
4th August 2015, 19:47
Yeah, I read the documentation _after_ I posted that - I thought I was fast enough to delete it before someone actually read it... :)

daa was much sharper, didn't realize nedi3 alone was blurring since I was only paying attention to the combing artifacts. And it's fast enough for my computer in this resolution.

Just a thought - In a case like this where interlaced content have been upscaled, could there be room for improvement with a resizing filter that actively tried to replicate the interlaced content, and looked at patterns corresponding to every second line at a time?

(Oh yes, before I forget, what is it that makes qtgmc so slow? I'm curious where the bottleneck is, since cpu doesn't rise much.)

LoRd_MuldeR
4th August 2015, 19:51
I don't think so. In the original interlaced frame, the "even" lines belonged to one field and the "odd" lines to the other field. But once this gets resized, as if it was progressive, the lines are blurred together. This is an irreversible process!

If z got computed as z = c1 * x + c2 * y, and all you know is the resulting z value (plus the constants c1 and c2), can you restore the original x and y values? Nope, because there's an infinite number of possibilities. There's not the "one" solution.

Things are quite similar here. Once the lines got blurred together, and all you know is the blurred result, you cannot restore the original non-blurred lines. Your best bet is to take the center of the blurred region, which is what PointResize does.


(Oh yes, before I forget, what is it that makes qtgmc so slow? I'm curious where the bottleneck is, since cpu doesn't rise much.)

MVTools? NNEDI3? Anyway, if the "bottleneck" plug-in doesn't split the calculations across multiple threads, it won't be able to use more than a single CPU core. Thus you won't see more than, e.g., 25% "CPU utilization" on a Quadcore CPU.

Now you may wonder why they don't "simply" make every plug-in use multiple threads. Maybe because the developer didn't bother. Maybe because the underlying algorithm is very difficult (or even impossible!) to compute in parallel.

Also "standard" Avisynth is single-threaded, in the sense that it doesn't compute multiple frames in parallel. There is Avisynth-MT which can do this - which works with certain plug-in's, and fails horribly with others. You may give it a try ;)

feisty2
5th August 2015, 04:54
I don't think so. In the original interlaced frame, the "even" lines belonged to one field and the "odd" lines to the other field. But once this gets resized, as if it was progressive, the lines are blurred together. This is an irreversible process!

If z got computed as z = c1 * x + c2 * y, and all you know is the resulting z value (plus the constants c1 and c2), can you restore the original x and y values? Nope, because there's an infinite number of possibilities. There's not the "one" solution.

Things are quite similar here. Once the lines got blurred together, and all you know is the blurred result, you cannot restore the original non-blurred lines. Your best bet is to take the center of the blurred region, which is what PointResize does.


irreversible if downscaled, theoretically reversible if upscaled
"z = c1 * x + c2 * y" is simply wrong for being a single equation, x and y were used multiple times with different weights to make new pixels, so it's like more of "a set of equations", larger tap you used in your scaling algorithm, more equations you got, with the upscaled image and the scaling algorithm used to upscale it, you should be able to restore it back to what it was, and just theoretically, right, hardass job but not impossible, theoretically reversible at least

j8ee
5th August 2015, 09:02
My thought was that the standard fast downscaling in practice produced something much like an interlaced picture, and that a specialized filter could make an even better approximation. That part is pretty clear, but what I don't know if it actually has the potential of producing better video in a case like this, that other de-interlacing filters could make a better job with such resized content.

I have learned more about avisynth scripting and various filters now anyway, and got useful tools for dealing with combing residues in the future! Many thanks to everyone for your help!