[vlc-devel] [PATCH] Soft field repeat support

Juha Jeronen juha.jeronen at jyu.fi
Sun Jan 9 14:38:19 CET 2011


Hi all,

The attached patch adds soft field repeat (repeat_pict) support to the 
deinterlacer module, and to all existing framerate doubling 
deinterlacers within it. This patch is (at least in theory) orthogonal 
with the IVTC patch.

This is required to correctly handle streams that utilize repeat_pict. 
Notably some NTSC DVDs are like this, such as Sol Bianca, Silent Mobius 
and Angel Links.

I have worked around the incorrect PTS issue by modifying DecodeVideo() 
to only accept PTS updates that are clearly smaller or larger than one 
field duration. This fixes the problem for me, although I'm not sure if 
it's a good long-term solution. I have tested that the change has no ill 
effects on streams which do not use pict_repeat.

I have included the PTS hack in the patch, because correct timing is 
essential for framerate doublers to work correctly, as it is also 
essential infrastructure for soft telecine removal.

There is one problem remaining that I haven't been able to track down. 
If the user seeks in a stream that utilizes repeat_pict, 
"assert(picture->i_refcount > 0);" at src/misc/picture_pool.c:265 
(Release()) sometimes fails. A reliable way to reproduce this is to open 
such a stream, and start hitting Alt+arrow quickly repeatedly to seek 
back and forth.

This problem started to occur as soon as I changed the constant 
private_picture (in src/video_output/vout_wrapper.c) from 3 to 4 to 
account for the third output picture (and actually used the third output 
picture in the deinterlacer), so I'm perfectly sure it has nothing to do 
with the PTS hack.

I've also looked through my deinterlacer changes and to me they seem 
correct, so I think the problem must be somewhere else. It's as if there 
is another assumption somewhere that the deinterlacer can only output 
two pictures per one input frame.

Comments would be appreciated :)

  -J

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Soft-field-repeat.patch
Type: text/x-patch
Size: 13479 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110109/f8264bd9/attachment.bin>


More information about the vlc-devel mailing list