Deinterlace -FilterCAVT and -MotionAdaptive

Deinterlace -FilterCAVT and -MotionAdaptive

Hello!
I'd love to know how excactly the both function works. For example how affect threshold in FilterCAVT or how works artifactProtection in MotionAdaptive.
If anyone can explain it in 2-3 sentence it would be nice, but it would be better if I get a detailed "work-flow" of the functions. Or maybe a source where the developers get the algorithms.
I hope the support implies such information.

Juri

15 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - juriman
Hello!
I'd love to know how excactly the both function works. For example how affect threshold in FilterCAVT or how works artifactProtection in MotionAdaptive.
If anyone can explain it in 2-3 sentence it would be nice, but it would be better if I get a detailed "work-flow" of the functions. Or maybe a source where the developers get the algorithms.
I hope the support implies such information.

Juri

Hi,

I'm also interresting by Deinterlace functions.
For information, you can find source codes in umc_deinterlacing.cpp from audio-video-codecs samples.

JB

Quoting - jbrossais@prynel.com

Hi,

I'm also interresting by Deinterlace functions.
For information, you can find source codes in umc_deinterlacing.cpp from audio-video-codecs samples.

JB

I've seen the source code and Ive also implemented the functions in my project. And now I have to explain the different deinterlacer.

In the literature for example CAVT is always explained with three fields. How does the aperture look like and whats the threshold for?

And MotionAdaptive: how do you detect the significant temporal difference between the consecutive frames? What do you get after this first step as output? A binary picture of motion? And why and how do you detect minor spatial changes between vertical neighbour pixels? What is the output from the second step? What do you do with the regions where motion was detected? Line average? And when there is no motion will it just copy the values? And what does artifactProtection?

These algorithms are not so trivial that you could it explain in a few word like in the service manual. So it would be wonderful if I ( and JB and certain more developer) get more information here.

Juri

Can I expect some help?

My questions were not understandable?

Chao Yu, Ying Hu, Vladimir Dudnik ??
Has no one any idea?
Is it so long ago that the developers have forgotten how they have implemented it?

Sorry for delay, I'm waiting comments from our expert, who is currently not available.

Vladimir

Thank You for feedback. When are the experts available?

I do not want to annoy, but I have been waiting over 6 weeks for a response.
I have to evaluate different algorithms for a endoscopy software and I have to knew what these algorithms exactly do. If I dont get a response I can not use your deinterlacer and our company does not need to buy IPP.

In two weeks the evaluation is over...

Sorry for delay (you know summer isvacation time) and thanks you for your patience. Finally I've got comment from our expert:

pSrc/pDst - pointer(s) to input/output frames, input frame consists of 2 (temporally adjacent) fields.

One field in Dst is copied from the Src (left unchanged) and the other is modified.

Which one is modified is defined by topfield arg in MotionAdaptive DI, in CAVT fields starting at pDst[step*(2n+1)] are modified, step can be negative thus enabling top field to be modified.

Motion adaptive:

based on DGBob by Donald A. Graft. Easy to find in the net.

CAVT is different from the known De Haan's CAVT.

Threshold is the threshold for edge detection.

The edge is calculated as

abs(4*(- a + 2*b - c)),

where a, b, c - values of the vertically adjacent pixels in the modified field. b is the spatial position of the pixel being interpolated.

Regards,
Vladimir

Thank you for your reply! I had much to do and could not immediately respond.

I have two more questions about CAVT:

I think the edge detection is calculated as

boolean edge = (threshold < abs( (-a + 2*b -c) / 2 ));

So the possible threshold range would be the same as for a,b and c (for example 0..255). With *4 it would be 0..2040.

And how do you interpolate b?
b=(a+c)/2 ?

And one question about MotionDetection:
In the source code of DGBob 'artifact protection' uses 30 as threshold. Is it also in ippiDeinterlaceMotionAdaptive_8u_C1?

Hello,

CAVT implemented like the piece of code below:

#define INTERP(a, b, c, d)  (int)((a + 7*b + 7*c + d + edge2 + 8) >> 4)

        edge2 = EDGE(s1[i], s3[i], s5[i]);
        value = INTERP(s0[i], s2[i], s4[i], s6[i]);
        if (ABS(edge2) < thresh) {
            value = IPP_MIN(value, IPP_MAX(s2[i], s4[i]));
            value = IPP_MAX(value, IPP_MIN(s2[i], s4[i]));
        }
       dst[i] = SAT8U(value);

Yes, we also use 30 for artifact protection.

Regards,
Vladimir

... and edge detection is realy like this?

#define EDGE(a, b, c) (int)( (- a + b<<1 - c)<<2 ))

and what does SAT8U?

Best Reply

Hello,

the result is saturated to Ipp8u data type, edge detection implemented as

#define SAT8U(x)    (Ipp8u)((x > IPP_MAX_8U) ? IPP_MAX_8U : (x < 0) ? 0 : x)

#define EDGE(a, b, c)       (int)(- 4*a + 8*b - 4*c);
#define INTERP(a, b, c, d)  (int)((a + 7*b + 7*c + d + edge2 + 8) >> 4)

Regards,
Vladimir

Thank you very much!

Leave a Comment

Please sign in to add a comment. Not a member? Join today