[FFmpeg-devel] [PATCH] Implement PAFF in H.264

Martin Zlomek martin.zlomek
Thu Oct 4 01:17:49 CEST 2007


On Wed, 03 Oct 2007 21:39:09 +0200, Michael Niedermayer <michaelni at gmx.at>  
wrote:

> On Wed, Oct 03, 2007 at 09:02:38PM +0200, Martin Zlomek wrote:
>> Attached patch fixes deblocking filter process as
>> described in the h.264 specs in section 8.7.2.1
>> "Derivation process for the luma content dependent
>> boundary filtering strength".
> [...]
>> @@ -6453,9 +6460,12 @@ static void filter_mb_fast( H264Context
>>                                                (h->slice_type ==  
>> B_TYPE), edges, step, mask_edge0, mask_edge1 );
>>          }
>>          if( IS_INTRA(s->current_picture.mb_type[mb_xy-1]) )
>> -            bSv[0][0] = 0x0004000400040004ULL;
>> +            bSv[0][0] = (!IS_INTERLACED(mb_type) &&  
>> !IS_INTERLACED(s->current_picture.mb_type[mb_xy - 1]))
>> +                ? 0x0004000400040004ULL : 0x0003000300030003ULL;
>
> (IS_INTERLACED(mb_type) ||  
> IS_INTERLACED(s->current_picture.mb_type[mb_xy - 1])) ? ...
> is simpler
>
>
>
>>          if( IS_INTRA(s->current_picture.mb_type[h->top_mb_xy]) )
>> -            bSv[1][0] = 0x0004000400040004ULL;
>> +            bSv[1][0] = ((!IS_INTERLACED(mb_type) &&  
>> !IS_INTERLACED(s->current_picture.mb_type[h->top_mb_xy]))
>> +                         || FIELD_PICTURE)
>
> can IS_INTERLACED(mb_type) be != FIELD_PICTURE here?
>

You are right, it can not. I did not realize that

(!IS_INTERLACED(mb_type)
  && !IS_INTERLACED(s->current_picture.mb_type[h->top_mb_xy])

makes sense for MBAFF macroblocks only and filter_mb_fast()
is not called for such macroblocks.
Optimized patch is attached.

-- 
Martin Zlomek
martin.zlomek at email.cz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: paff-deblock.patch
Type: text/x-patch
Size: 2983 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071004/e75167af/attachment.bin>



More information about the ffmpeg-devel mailing list