Community
cancel
Showing results for 
Search instead for 
Did you mean: 
li__steve
Beginner
58 Views

ippiDeinterlaceMotionAdaptive_8u_C1() source planes order

Hi,

The function ippiDeinterlaceMotionAdaptive_8u_C1() takes an array of 4 source planes. I would like to know if I should put the earliest plane in index 0 or index 3 of the array.

For example, I have planes t0, t1, t2, and t3. Video starts with plane t0, followed by t1, then t2, and t3. Should I setup my array such that:

srcPlanes[0] = t0;
srcPlanes[1] = t1;
srcPlanes[2] = t2;
srcPlanes[3] = t3;

OR

srcPlanes[0] = t3;
srcPlanes[1] = t2;
srcPlanes[2] = t1;
srcPlanes[3] = t0;

Thanks
Steve
0 Kudos
1 Reply
Chao_Y_Intel
Employee
58 Views


Steve,

The followingscenario may help you understand theusge of this function (ippiDeinterlaceMotionAdaptive_8u_C1()):


Suppose I have 4 fields for 2 frames, frame size(720x480), field size(720x240), frame time is 0.03 sec.

FrameA=interlace(Field1+Field2)
FrameB=interlace(Field3+Field4)
FrameC=interlace(Field5+Field6)
FrameD=interlace(Field7+Field8)

The playtime is: FrameA(0.03)-FrameB(0.06)-FrameC(0.09)-FrameD(0.12)

To learn:
1. How to set "pSrcPlane[4]"? frame or field? array[0] is previous or next?
2. What to get in "pDst"? what is its output dimension?
3. What does "copyField" mean?

pSrcPlane[0] = FrameA (interlaced, weaved of Field1 and Field2)
pSrcPlane[1] = FrameB
pSrcPlane[2] = FrameC
pSrcPlane[3] = FrameD

dstStep = srcStep = 720 (+ padding)

Assume Field1 is the top one,
field times: Field1 - 0.03 sec, Field2 - 0.045 sec, Field3 - 0.06 sec, etc.

If one wants 30 deinterlaced frames per second, with the frame playing times equal to those of the odd (first) fields:

ippiDeinterlaceMotionAdaptive_8u_C1(pSrcPlane, ..., topFirst=1, topField=0, copyField=1, ...)

will write to pDst a 720x480 frame, with the top field copied from frame C, and the bottom field generated (interpolated),

Which means one will get a deinterlaced frame at 0.09 sec.

If copyField==0, the top field in pDst will be left unchanged (imagine one has already copied frame C to pDst).


To obtain a DI frame at 0.12 sec, one needs to update pSrcPlane:

pSrcPlane[0] = FrameB
pSrcPlane[1] = FrameC
pSrcPlane[2] = FrameD
pSrcPlane[3] = FrameE


If one has bottom field first (Field1 is the bottom one), and frames' playtimes are still 0.09, 0.12, etc:


ippiDeinterlaceMotionAdaptive_8u_C1(pSrcPlane, ..., topFirst=0, topField=1, copyField=1, ...)


To generate output frames 0.075, 0.105, etc sec, topField should be set to topFirst.
With A,B,C,D interlaced frames at input,

pDst will contain a frame consisting of the unchanged temporaly second field of frame B, and the first field interpolated.


Calling the function twice for each quartet of input frames:
pSrcPlane[0] = FrameA
pSrcPlane[1] = FrameB
pSrcPlane[2] = FrameC
pSrcPlane[3] = FrameD

ippiDeinterlaceMotionAdaptive_8u_C1(pSrcPlane, ..., topFirst=1, topField=1, ...)
ippiDeinterlaceMotionAdaptive_8u_C1(pSrcPlane, ..., topFirst=1, topField=0, ...)

one will end up with a deinterlaced frame for every input field: 60 deinterlaced frames per second in our case, frame playtimes 0.075, 0.09, 0.105, etc.

Thanks,
Chao

Reply