View Single Post
Old 28th July 2012, 19:34   #12  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
I don't know what vinverse does, but I understand the problem now.
I think you could use something I made before, which I called DOCI
http://forum.doom9.org/showthread.php?t=158230

Except not that exactly; but modified to work on luma instead of color.

This is the normal 3:2 pulldown pattern:
Code:
t0...t0...t1...t2...t3...t4...t4  top fields of NTSC video
b0...b1...b2...b2...b3...b4...b5  bot fields of NTSC video
cln  lac  lac  cln  cln| cln  lac
t0 means the top field of film frame 0, b0 means the bottom field of film frame 0.

What that means is, NTSC frame 0 has film frame 0 as the top field and film frame 0 as the bottom field.
Since both NTSC fields come from the same film frame, it's a progessive or clean (cln) frame.
Next is a combed or interlaced (lac) frame. The two NTSC fields come from different film frames.

Your problem is that in this frame, the two fields are blended. This means
NTSC top field=(t0+b1)
NTSC bot field=(t0+b1)
Since they are both the same value, it makes a tall pixel, which looks blocky. (I wouldn't call them lines)
The solution is to use a subtraction.
We must recreate film frame 1.

The answer is the equation:
b1=(t0+b1)-t0
t1=(t1+b2)-b2
This means to separatefields, then subtract the first blended frame, top field from the last top field. This becomes a new bottom field.
For the 2nd blended frame, subtract the bottom field from the next bottom field. This becomes a new top field.
Erase the two blended frames, and replace with the new frame.
Now you have only 4 of the 5 frames, and the framerate is now 23.976fps, and you've recovered the film frames.
You could then do your job of encoding it directly to AVC. Otherwise, for mpeg you should encode with soft telecine.

Last edited by jmac698; 28th July 2012 at 19:50.
jmac698 is offline   Reply With Quote