[FFmpeg-devel] [PATCH] Implement PAFF in H.264
Michael Niedermayer
michaelni
Thu Oct 4 02:00:57 CEST 2007
Hi
On Thu, Oct 04, 2007 at 01:17:49AM +0200, Martin Zlomek wrote:
> 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
> --- h264.c~ 2007-10-03 20:46:21.000000000 +0200
> +++ h264.c 2007-10-04 00:51:36.000000000 +0200
> @@ -6410,28 +6410,30 @@ static void filter_mb_fast( H264Context
> if( IS_INTRA(mb_type) ) {
> int16_t bS4[4] = {4,4,4,4};
> int16_t bS3[4] = {3,3,3,3};
> + int16_t *bSH = FIELD_PICTURE ? bS3 : bS4;
> + int16_t *bSV = bS4;
if bSV is always bS4 why not keep using bS4 ?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071004/1e4ec9cb/attachment.pgp>
More information about the ffmpeg-devel
mailing list