[FFmpeg-devel] [PATCH] H.264 fix interlaced flag

Ivan Schreter schreter
Tue Mar 3 19:49:53 CET 2009


Michael Niedermayer wrote:
> On Fri, Feb 20, 2009 at 05:16:13PM +0100, Ivan Schreter wrote:
>   
>> Michael Niedermayer wrote:
>>     
>>> On Fri, Feb 20, 2009 at 04:04:37PM +0100, Ivan Schreter wrote:
>>>   
>>>       
>>>> Michael Niedermayer wrote:
>>>>     
>>>>         
>>>>> [...]      
>>>>>           
>>>>> the patch is wrong, there seems no relation between the pic_struct and
>>>>> the interlacing vs progressive.
>>>>> Maybe the ct_type field could be used and the whole pic_struct->interlaced
>>>>> code removed
>>>>>   
>>>>>       
>>>>>           
>>>> Yes, ct_type could be used. But IMHO, it would be sufficient to say
>>>>
>>>> cur->interlaced_frame = FIELD_OR_MBAFF_PICTURE;
>>>>
>>>> outside of the switch and not set interlaced_frame at all in the switch 
>>>> (i.e., same as for missing picture structure). If you are OK with that, 
>>>> I'll prepare a patch.
>>>>     
>>>>         
>>> cur->interlaced_frame = FIELD_OR_MBAFF_PICTURE;
>>> is not correct
>>>
>>> progressive frames can be coded as fields and interlaced fields
>>> can be coded as frames
>>>
>>>   
>>>       
>> Then only ct_type remains...
>>     
>
> yes, let us hope it actually contains a sane value in practice otherwise
> we can throw a bit of code away and just use 
> cur->interlaced_frame = FIELD_OR_MBAFF_PICTURE;
>
>   
I added ct_type handling, as recommended by H.264 standard (basically, 
look at all ct_type fields of a frame and if any of them is interlaced, 
then it's interlaced frame).

If ct_type is missing, then take field pictures as interlaced, other 
picture types as non-interlaced by default.

If picture structure is missing, then look at FIELD_OR_MBAFF_PICTURE 
flag (same as today).

Seems to work OK with my samples (and is consistent with only looking at 
FIELD_OR_MBAFF_PICTURE flag, BTW)...

Patch for review attached.

Since I now have svn access, I can commit it by myself, so I can try it 
on this one, whether it works :-)

Regards,

Ivan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: h264_noninterlaced_fix.patch
Type: text/x-patch
Size: 3498 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090303/6b387890/attachment.bin>



More information about the ffmpeg-devel mailing list