On Mon, 14 Jul 2014 12:55:36 +0200, Luca Barbato <[email protected]> wrote:
> Square prediction units are the most common.
> About 0.7% faster on 4k videos.
> ---
>  libavcodec/hevc.c             | 64 
> +++++++++++++++++++++++++++++++++----------
>  libavcodec/hevcdsp.c          |  6 ++++
>  libavcodec/hevcdsp.h          |  2 ++
>  libavcodec/hevcdsp_template.c | 16 +++++++++++
>  4 files changed, 73 insertions(+), 15 deletions(-)
> 
> diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
> index 1634185..7d15ed3 100644
> --- a/libavcodec/hevc.c
> +++ b/libavcodec/hevc.c
> @@ -27,6 +27,7 @@
>  #include "libavutil/common.h"
>  #include "libavutil/display.h"
>  #include "libavutil/internal.h"
> +#include "libavutil/intmath.h"
>  #include "libavutil/md5.h"
>  #include "libavutil/opt.h"
>  #include "libavutil/pixdesc.h"
> @@ -1652,9 +1653,27 @@ static void hevc_await_progress(HEVCContext *s, 
> HEVCFrame *ref,
>      ff_thread_await_progress(&ref->tf, y, 0);
>  }
>  
> -static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
> -                                int nPbW, int nPbH,
> -                                int log2_cb_size, int partIdx)
> +av_always_inline
> +static void put_unweighted_pred(HEVCContext *s,
> +                                uint8_t *dst, ptrdiff_t dststride,
> +                                int16_t *src, ptrdiff_t srcstride,
> +                                int width, int height, int square)
> +{
> +    if (!square) {
> +        s->hevcdsp.put_unweighted_pred(dst, dststride,
> +                                       src, srcstride, width, height);
> +    } else {
> +        const int square = av_log2_16bit(width) - 2;

Variable shadowing is evil, rename this to something like log_size

Otherwise looks ok

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

Reply via email to