INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Suggestion from Anandtech about deinterlacing [nevcairiel, madshi, etc.]  (Read 16826 times)

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42442
  • Shoes gone again!

This is from Ganesh at Anandtech:
Quote
MC 17 should try to avoid deinterlacing in multiple places, i.e, if
madVR is set to do deinterlacing, there should be no need for LAV
Video Decoder to do it. In fact, Hendrik indicated on Doom9 that doing
so would increase the GPU load because of extra number of frames which
need to get transferred for madVR to process [
http://forum.doom9.org/showthread.php?p=1572953#post1572953 ]. If it
is possible, MC 17 can try to detect if madVR deinterlacing is turned
on and, if that is the case, set LAV Video Decoder Hardware / GPU
deinterlacing to Weave (None).

Should Red October HQ disable deinterlacing in LAV and assume madVR will take care of it?

Will madVR leverage nVidia CUDA deinterlacing?

Thanks for any advice.
Logged
Matt Ashland, JRiver Media Center

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day

Obviously Nev will have better details, but from my reading of the threads, LAV can/will use more/better tools for de-interlacing than madVR.  When madVR does it, it's of the same 'quality' as LAV, but it is able to do so with less content/tools.

So, I think it makes sense to have LAV do all the de-interlacing, and just let madVR render what it receives from LAV.
Logged
pretend this is something funny

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10970

There is no big difference in deinterlacing from madVR or from LAV CUVID. Its the same hardware deinterlacing doing its work, not much will change.

As he outlined, it'll be slightly more efficient to let madVR do it, because it doesn't have to leave the GPU again.
So for all i care, always let the renderer do it when possible.
Logged
~ nevcairiel
~ Author of LAV Filters

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day

always let the renderer do it when possible.

Is this the difficult part?  When to have madVR do it, and when should LAV do it?

I just figured that since LAV can handle it in more situations, it might be best to just let LAV always handle it.

But, of course, you 2 know MUCH more about this than I do, so feel free to ignore me :)
Logged
pretend this is something funny

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10970

There is no difficult part. Why would the renderer not be able to do it?
Logged
~ nevcairiel
~ Author of LAV Filters

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day

I didn't think madVR was able to de-interlace every possible stream, so then MC would need to choose which streams to have de-interlaced where (adding a decision layer/difficulty).

But again, you're the expert, and I'm certainly not trying to argue with you about it.   :-X  If you think it's best to have madVR do it all, that's totally fine with me :D
Logged
pretend this is something funny

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!

Does both madVR and lav both support the same HW based deinterlacing on Intel, AMD, as well as nvidia?
Logged
JRiver CEO Elect

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10970

lav doesn't do any hw deinterlacing on intel or amd.
Logged
~ nevcairiel
~ Author of LAV Filters

madshi

  • Galactic Citizen
  • ****
  • Posts: 376

When talking about NVidia GPUs, it would probably make sense to let madVR do the deinterlacing because (as nevcairiel already explained) there should be no difference in quality, while we might get slightly better performance when letting madVR do the work. Furthermore madVR can do DXVA2 deinterlacing with all GPUs (NVidia, AMD, Intel, whatever) on all OSs, including Windows XP (if you install .NET 3.0 or newer). LAV on the other hand can do software YADIF deinterlacing, which madVR currently does not do. So pick your poison. My recommendation would be to let madVR perform DXVA2 deinterlacing for NVidia and AMD GPUs, but for Intel GPUs it might be a matter of taste or a matter of priorities. LAV YADIF deinterlacing might provide better image quality than Intel DXVA2 deinterlacing, on the cost of higher CPU consumption. The quality of DXVA2 deinterlacing depends on the GPU hardware and from what I've read Intel's hardware deinterlacing isn't that great. But I haven't compared quality myself, so I can't really say.

There shouldn't be any streams that madVR cannot deinterlace. However, there could be slight differences in when and how deinterlacing is activated. If madVR doesn't automatically activate deinterlacing for some streams, you can manually activate it by pressing Ctrl+Alt+Shift+D twice. Generally, madVR should behave mostly similar to VMR and EVR in terms of video deinterlacing. There are a couple of differences, though, because I think that VMR/EVR don't always do the "right" thing, so I tried to improve on that in madVR.

Another topic is IVTC. madVR can perform (software) IVTC with all kinds of movie cadences, which to my best knowledge no other DirectShow filter (nor DXVA) can currently do in comparable quality. But that's probably a separate topic. For those of you who're wondering what I'm talking about: If you let DXVA "deinterlace" movies for you then for 1080i60 movies you'll get 1080p30 or 1080p60 output, but *not* 1080p24 output. Which means that you'll still have the 3:2 motion judder. madVR's IVTC algorithm on the other hand allows you to convert 1080i60 back to the original 1080p24 to get perfect motion smoothness.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42442
  • Shoes gone again!

I'm trying to figure out what the code should look like on our side.

Is it possible to configure madVR deinterlacing from code?

Maybe if it defaults to "on", this is good enough?

Thanks.
Logged
Matt Ashland, JRiver Media Center

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!

FYI madVR is doing the deinterlacing in RO HQ on intel now
Logged
JRiver CEO Elect

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608

Reading through this, it seems like making that change is a no-brainer.

The differences between performance/quality on Intel integrated GPUs, Nvidia, and AMD here and other places might be one reason to implement something like this for MC18.

Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

madshi

  • Galactic Citizen
  • ****
  • Posts: 376

I'm trying to figure out what the code should look like on our side.

Is it possible to configure madVR deinterlacing from code?

Maybe if it defaults to "on", this is good enough?

You can certainly configure madVR deinterlacing from code, but currently it's a global setting, not a session setting. The session setting stuff is still on my to do list. Anyway, in "mvrInterfaces.h" search for "deinterlacing" to find how to modify the madVR global settings from code.

madVR defaults to DXVA2 deinterlacing "on". Whether that is good enough for your needs, I can't say.
Logged

JohnT

  • Citizen of the Universe
  • *****
  • Posts: 4627

So I propose the following program flow for de-interlacing decision making:

if renderer is madVR or EVR:
    turn off all LAV deinterlacing
    let renderer do deinterlacing
else if hardware acceleration is selected in MC (and hardware supports it):
    turn on LAV hardware deinterlacing
else
    turn on LAV software deinterlacing (YADIF)
endif

Recently we added code to set LAV deinterlacing to "aggressive" mode for mpeg-2 streams, since we ran into the problem of some interlaced television streams being incorrectly marked as progressive.  In the above scheme, madVR would be used for deinterlacing and may run into the problem of not "aggressively" deinterlacing these streams.  Comments from madshi and nevcairiel welcome.
Logged
John Thompson, JRiver Media Center

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10970

The "aggressive deinterlacing" option will affect the deinterlacingdone by madVR or EVR as well, because it also translates to the interlace signaling on the outgoing frames, so it should be just fine.

On that note, if you go this route, i would also let EVR do the deinterlacing, and not limit it to madVR.
Logged
~ nevcairiel
~ Author of LAV Filters

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42442
  • Shoes gone again!

On that note, if you go this route, i would also let EVR do the deinterlacing, and not limit it to madVR.

I thought LAV did a better job than EVR at deinterlacing in some cases.  Is that not the case?
Logged
Matt Ashland, JRiver Media Center

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10970

I thought LAV did a better job than EVR at deinterlacing in some cases.  Is that not the case?

I dunno. Its the same hardware deinterlacer, i fail to see where there might be a difference, unless EVR bugs out with some streams.
Not to mention that its NVIDIA only anyway.
Logged
~ nevcairiel
~ Author of LAV Filters

JohnT

  • Citizen of the Universe
  • *****
  • Posts: 4627

The "aggressive deinterlacing" option will affect the deinterlacingdone by madVR or EVR as well, because it also translates to the interlace signaling on the outgoing frames, so it should be just fine.

On that note, if you go this route, i would also let EVR do the deinterlacing, and not limit it to madVR.
Ok, I changed the flow to let EVR do the deinterlacing as well as madVR.  Thanks for clarifying the "aggressive" option.  By the way, do I set LAV HW deinterlacing mode to "Weave" in the case where we're letting EVR/madVR do the work?
Logged
John Thompson, JRiver Media Center

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10970

By the way, do I set LAV HW deinterlacing mode to "Weave" in the case where we're letting EVR/madVR do the work?

Yes, Weave is "no deinterlacing", it just weaves the two fields together without any interpolation.
Logged
~ nevcairiel
~ Author of LAV Filters

madshi

  • Galactic Citizen
  • ****
  • Posts: 376

Just to clear things up: I think the main purpose/benefit of letting LAV Video do hardware deinterlacing is if you want to further process the video via CPU. This makes a lot of sense if you have ffdshow raw processor (+ some AviSynth scripts) in the processing chain, or if you maybe even don't want to render at all, but use a DirectShow encoder to encode a new video. For a pure playback chain with no CPU post processing at all, in theory there should be no benefit letting LAV Video do the hardware deinterlacing instead of the renderer.

I don't think EVR deinterlaces worse than LAV or madVR (except for one special situation where madVR does things differently, but that's not too important right now, I guess). EVR might not always activate deinterlacing when it needs to, but you can use LAV Video for force EVR to deinterlace, so no problem. One thing, though: I've read that when using EVR, with some decoders you only get single rate deinterlacing (30p output for 60i content) instead of double rate (60p output). But I'm not really sure if that is true. And even if it's true, I guess at least when using LAV Video Decoder, EVR should always output double rate, right, Hendrik?
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10970

I guess at least when using LAV Video Decoder, EVR should always output double rate, right, Hendrik?

Yes.
I don't even know what those other decoders are doing wrong that prompts EVR to only go single-rate.
Logged
~ nevcairiel
~ Author of LAV Filters

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42442
  • Shoes gone again!

Here's what Ganesh (of Anandtech) had to say about hardware deinterlacers:
Quote
Btw, I just skimmed through the thread and saw Mathias mentioning
about Intel HW deinterlacing quality. Just wanted to mention that
based on our current tests, there is really not much difference
between NV, AMD and Intel's HW deinterlacers.
Logged
Matt Ashland, JRiver Media Center

madshi

  • Galactic Citizen
  • ****
  • Posts: 376

I remember to have seen screenshots in doom9 from Intel deinterlacing which didn't look good (clearly visible artifacts), but I don't remember which hardware is was exactly. Also I don't know if it was just a one in a million corner case, or if the problems I saw there occur more often. Anyway, I can't really say much about it since I haven't tested it myself. If Ganesh says their tests indicated good quality, then probably there's no reason to worry.
Logged
Pages: [1]   Go Up