[FFmpeg-devel] [PATCH] h264: integrate clear_blocks calls with IDCT.

Michael Niedermayer michaelni at gmx.at
Fri Feb 8 13:51:16 CET 2013


On Thu, Feb 07, 2013 at 10:20:52PM -0800, Ronald S. Bultje wrote:
> From: "Ronald S. Bultje" <rsbultje at gmail.com>
> 
> In case of no-transform, integrate it with put_pixels4/8(). In case
> of intra PCM, do an explicit memset(0) call. Together, this makes
> the H264 decoder almost-independent of dsputil.
> 
> (PPC and Arm assembly not yet ported.)

breaks fate-h264-lossless


[...]
> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index cfcb552..def1a36 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -1270,8 +1270,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
>  
>          h->thread_context[0] = h;
>  
> -        s->dsp.clear_blocks(h->mb);
> -        s->dsp.clear_blocks(h->mb + (24 * 16 << h->pixel_shift));
> +        memset(h->mb, 0, 24 * 16 * 4 << h->pixel_shift);
>      }
>  
>      /* frame_start may not be called for the next thread (if it's decoding
> diff --git a/libavcodec/h264_mb_template.c b/libavcodec/h264_mb_template.c
> index a841555..4fe2030 100644
> --- a/libavcodec/h264_mb_template.c
> +++ b/libavcodec/h264_mb_template.c
> @@ -133,6 +133,7 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h)
>                      }
>                  }
>              }
> +            memset(h->mb, 0, ff_h264_mb_sizes[h->sps.chroma_format_idc] * 2);
>          } else {
>              for (i = 0; i < 16; i++)
>                  memcpy(dest_y + i * linesize, (uint8_t *)h->mb + i * 16, 16);
> @@ -151,6 +152,7 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h)
>                      }
>                  }
>              }
> +            memset(h->mb, 0, ff_h264_mb_sizes[h->sps.chroma_format_idc]);
>          }
>      } else {
>          if (IS_INTRA(mb_type)) {

why should these (and other cases) use memset instead of (the faster)
clear_block* ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130208/c752141a/attachment.asc>


More information about the ffmpeg-devel mailing list