Community
cancel
Showing results for 
Search instead for 
Did you mean: 
juriman
Beginner
270 Views

Deinterlace -FilterCAVT and -MotionAdaptive

Jump to solution
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
0 Kudos
1 Solution
Vladimir_Dudnik
Employee
270 Views

Hello,

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

[cpp]#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);[/cpp]
[cpp][/cpp]
[cpp]
#define INTERP(a, b, c, d)  (int)((a + 7*b + 7*c + d + edge2 + 8) >> 4)
[/cpp]


Regards,
Vladimir

View solution in original post

14 Replies
jerome-brossais
Beginner
270 Views
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
juriman
Beginner
270 Views


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
juriman
Beginner
270 Views
Can I expect some help?
juriman
Beginner
270 Views
My questions were not understandable?
juriman
Beginner
270 Views
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?
Vladimir_Dudnik
Employee
270 Views
Sorry for delay, I'm waiting comments from our expert, who is currently not available.

Vladimir
juriman
Beginner
270 Views
Thank You for feedback. When are the experts available?
juriman
Beginner
270 Views
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...
Vladimir_Dudnik
Employee
270 Views

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
juriman
Beginner
270 Views
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?
Vladimir_Dudnik
Employee
270 Views
Hello,

CAVT implemented like the piece of code below:
[cpp]
#define INTERP(a, b, c, d)  (int)((a + 7*b + 7*c + d + edge2 + 8) >> 4)

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

Yes, we also use 30 for artifact protection.
[/cpp]


Regards,
Vladimir
juriman
Beginner
270 Views
... and edge detection is realy like this?

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

and what does SAT8U?
Vladimir_Dudnik
Employee
271 Views

Hello,

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

[cpp]#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);[/cpp]
[cpp][/cpp]
[cpp]
#define INTERP(a, b, c, d)  (int)((a + 7*b + 7*c + d + edge2 + 8) >> 4)
[/cpp]


Regards,
Vladimir

View solution in original post

juriman
Beginner
270 Views
Thank you very much!
Reply