[FFmpeg-devel] [PATCH] avcodec: use looking up crop table method when do clip
Ronald S. Bultje
rsbultje at gmail.com
Tue Aug 11 02:05:37 CEST 2015
Hi,
On Fri, Aug 7, 2015 at 5:30 AM, 周晓勇 <zhouxiaoyong at loongson.cn> wrote:
> based on last h264qpel optimization patch i have pushed
> do i need separate this patch to double? cause one file to change loongson
> arch
> use looking up crop table method may boost up decode on loongson, and with
> this patch x86 pass fate too
> but i have not tested on other arch
>
>
> test on loongson-3b
> time ./ffmepg -i 1280x720.mp4 -f rawvideo -an -vframes 4096 -y /dev/null
>
>
> no patch:
>
>
> real 0m58.2s
> user 4m59.1s
> sys 0m5.8s
>
>
> with patch:
>
>
> real 0m53.9s
> user 4m33.2s
> sys 0m6.2s
>
>
> ---
> From 68e88b17d113875d829a9936284d3551fd499139 Mon Sep 17 00:00:00 2001
> From: ZhouXiaoyong <zhouxiaoyong at loongson.cn>
> Date: Fri, 7 Aug 2015 16:33:10 +0800
> Subject: [PATCH] avcodec: use looking up crop table method when do clip
>
>
> Signed-off-by: ZhouXiaoyong <zhouxiaoyong at loongson.cn>
> ---
> libavcodec/bit_depth_template.c | 4 ++--
> libavcodec/mips/h264qpel_mmi.c | 4 ++++
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
>
> diff --git a/libavcodec/bit_depth_template.c
> b/libavcodec/bit_depth_template.c
> index 8018489..759cd30 100644
> --- a/libavcodec/bit_depth_template.c
> +++ b/libavcodec/bit_depth_template.c
> @@ -72,7 +72,7 @@
> # define pixel4 uint32_t
> # define dctcoef int16_t
>
> -# define INIT_CLIP
> +# define INIT_CLIP const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
> # define no_rnd_avg_pixel4 no_rnd_avg32
> # define rnd_avg_pixel4 rnd_avg32
> # define AV_RN2P AV_RN16
I remember vaguely that we had something like this before, but we removed
it because on some systems, fuzzed bitstreams could trigger out-of-array
reads. Or am I making that up? See 263bb6edcf6b767006fcde315850d3a60b3fceed
Ronald
More information about the ffmpeg-devel
mailing list