Hi,

On Wed, Jul 6, 2011 at 2:20 PM, Jason Garrett-Glaser <[email protected]> wrote:
> ---
>  libavcodec/h264.c |   52 ++++++++++------------------------------------------
>  1 files changed, 10 insertions(+), 42 deletions(-)
>
> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index f7c0345..f79f4d1 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -778,24 +778,6 @@ static av_always_inline void hl_motion(H264Context *h, 
> uint8_t *dest_y, uint8_t
>     prefetch_motion(h, 1, pixel_shift, chroma444);
>  }
>
> -#define hl_motion_fn(sh, bits) \
> -static av_always_inline void hl_motion_ ## bits(H264Context *h, \
> -                                       uint8_t *dest_y, \
> -                                       uint8_t *dest_cb, uint8_t *dest_cr, \
> -                                       qpel_mc_func (*qpix_put)[16], \
> -                                       h264_chroma_mc_func (*chroma_put), \
> -                                       qpel_mc_func (*qpix_avg)[16], \
> -                                       h264_chroma_mc_func (*chroma_avg), \
> -                                       h264_weight_func *weight_op, \
> -                                       h264_biweight_func *weight_avg, \
> -                                       int chroma444) \
> -{ \
> -    hl_motion(h, dest_y, dest_cb, dest_cr, qpix_put, chroma_put, \
> -              qpix_avg, chroma_avg, weight_op, weight_avg, sh, chroma444); \
> -}
> -hl_motion_fn(0, 8);
> -hl_motion_fn(1, 16);
> -
>  static void free_tables(H264Context *h, int free_rbsp){
>     int i;
>     H264Context *hx;
> @@ -1876,18 +1858,11 @@ static av_always_inline void 
> hl_decode_mb_internal(H264Context *h, int simple, i
>             if(h->deblocking_filter)
>                 xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize, 
> uvlinesize, 0, 0, simple, pixel_shift);
>         }else if(is_h264){
> -            if (pixel_shift) {
> -                hl_motion_16(h, dest_y, dest_cb, dest_cr,
> -                             s->me.qpel_put, 
> s->dsp.put_h264_chroma_pixels_tab,
> -                             s->me.qpel_avg, 
> s->dsp.avg_h264_chroma_pixels_tab,
> -                             h->h264dsp.weight_h264_pixels_tab,
> -                             h->h264dsp.biweight_h264_pixels_tab, 0);
> -            } else
> -                hl_motion_8(h, dest_y, dest_cb, dest_cr,
> -                            s->me.qpel_put, 
> s->dsp.put_h264_chroma_pixels_tab,
> -                            s->me.qpel_avg, 
> s->dsp.avg_h264_chroma_pixels_tab,
> -                            h->h264dsp.weight_h264_pixels_tab,
> -                            h->h264dsp.biweight_h264_pixels_tab, 0);
> +            hl_motion(h, dest_y, dest_cb, dest_cr,
> +                      s->me.qpel_put, s->dsp.put_h264_chroma_pixels_tab,
> +                      s->me.qpel_avg, s->dsp.avg_h264_chroma_pixels_tab,
> +                      h->h264dsp.weight_h264_pixels_tab,
> +                      h->h264dsp.biweight_h264_pixels_tab, pixel_shift, 0);
>         }
>
>         hl_decode_mb_idct_luma(h, mb_type, is_h264, simple, transform_bypass, 
> pixel_shift, block_offset, linesize, dest_y, 0);

I believe the reason this exists is so that we duplicate the code, and
shifting becomes a constant in the code, rather then a variable to be
loaded into cl. This leaves cl free for others and lead to somewhat of
a speedup.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to