[vlc-devel] [PATCH] Added IVTC deinterlacer (NTSC film mode)

Juha Jeronen juha.jeronen at jyu.fi
Fri Dec 31 17:28:09 CET 2010

On 12/31/2010 04:52 PM, Jean-Baptiste Kempf wrote:
> On Fri, Dec 31, 2010 at 03:57:13PM +0200, Juha Jeronen wrote :
>> What should we do about the name shown to the user? Relabel as "IVTC (NTSC film)" to reach both camps of users?
> I believe the code should refer to IVTC, since it is the most exact
> term. The user display could be Film NTSC (IVTC) or something of the
> like.

I agree. So let's make it "IVTC" for code, and for the user "Film NTSC 

I think the user label needs to be picked up by the localization 
mechanism, since it will contain the English word "Film". I take it that 
the "N_()" wrapping some of the other labels tells the localization 
mechanism to pick them up? If so, I'll add that to this one, too.

>> Mm, maybe I should use int_fast32_t instead. What I basically want there is simply enough space to handle (P - C)*(N - C) in all cases, and keep it as "native" as possible so that the speed doesn't suffer unnecessarily. This requires at least 17 bits (worst case: both (P - C) and (N - C) are plus or minus 255), so 32 is the smallest size that will work.
> long is not native, this is exactly my point. On Win64, long ain't of
> the stack size.

Yep. Will fix.

Speaking of CalculateInterlaceScore(), there is one further thing that 
slipped my mind that needs to be fixed - "#define T 100" without a 
corresponding #undef soon after is just asking for trouble ;)

(Will fix that, too.)

>> How to quit a filter nicely in VLC? Any suggestions where I should look? None of the other deinterlacers quit, so in this module there was no example of that.
> return NULL ?

Currently, returning NULL won't quit the filter. This is actually how 
the frame dropping mechanism works - when a frame is (intentionally) 
dropped, Deinterlace() returns NULL. The core (apparently) uses the 
existence of the filter output frame to determine whether it should be 
shown ;)

I think that if we want to go this route, picture_t needs a new field 
"b_drop" (or something). This needs to be accounted for at the calling 
end, so that NULL can be reserved only for "fatal error occurred, quit 

The other possible approach I can think of off the top of my head is 
that a separate mechanism is needed to signal quit.

In my opinion the "return NULL" approach you suggest is cleaner of the 
two. How should we proceed with this?

>> Please let me know what you think about the name issue, whether the loop counters should be defined in the for or outside it, and the quit issue. Once these are decided, I'll get to work :)
> for, do as you want. name, see as above.
> Quit, I need Laurent to tell us.

Ok. Thanks :)

>> Thanks for the analysis!
> Was just a quick review :)

Much appreciated nevertheless ;)


More information about the vlc-devel mailing list