[FFmpeg-devel] [PATCH 2/6] lavc/aarch64: new optimization for 8-bit hevc_epel_bi_h

Martin Storsjö martin at martin.st
Fri Dec 1 20:25:01 EET 2023


On Sat, 18 Nov 2023, Logan.Lyu wrote:

> diff --git a/libavcodec/aarch64/hevcdsp_epel_neon.S 
> b/libavcodec/aarch64/hevcdsp_epel_neon.S
> index 74165273d7..070c8c9990 100644
> --- a/libavcodec/aarch64/hevcdsp_epel_neon.S
> +++ b/libavcodec/aarch64/hevcdsp_epel_neon.S
> @@ -423,6 +423,263 @@ function ff_hevc_put_hevc_pel_bi_pixels64_8_neon, 
> export=1
>         ret
> endfunc
> +
> +function ff_hevc_put_hevc_epel_bi_h4_8_neon, export=1
> +        load_epel_filterb x6, x7
> +        sub             x2, x2, #1
> +        mov             x10, #(MAX_PB_SIZE * 2)
> +1:      ld1             {v4.8b}, [x2], x3
> +        ext             v5.8b, v4.8b, v4.8b, #1
> +        ext             v6.8b, v4.8b, v4.8b, #2
> +        ext             v7.8b, v4.8b, v4.8b, #3
> +        calc_epelb      v16, v4, v5, v6, v7
> +        ld1             {v20.4h}, [x4], x10
> +        sqadd           v16.8h, v16.8h, v20.8h
> +        sqrshrun        v4.8b, v16.8h, #7
> +        st1             {v4.s}[0], [x0], x1
> +        subs            w5, w5, #1   // height
> +        b.ne            1b
> +        ret
> +endfunc
> +
> +function ff_hevc_put_hevc_epel_bi_h6_8_neon, export=1
> +        load_epel_filterb x6, x7
> +        sub             w1, w1, #4
> +        sub             x2, x2, #1
> +        mov             x10, #(MAX_PB_SIZE * 2)
> +1:      ld1             {v24.16b}, [x2], x3
> +        ext             v26.16b, v24.16b, v24.16b, #1
> +        ext             v27.16b, v24.16b, v24.16b, #2
> +        ext             v28.16b, v24.16b, v24.16b, #3
> +        calc_epelb      v16, v24, v26, v27, v28
> +        ld1             {v20.8h}, [x4], x10
> +        sqadd           v16.8h, v16.8h, v20.8h
> +        sqrshrun        v16.8b, v16.8h, #7
> +        st1             {v16.s}[0], [x0], #4
> +        st1             {v16.h}[2], [x0], x1
> +        subs            w5, w5, #1   // height
> +        b.ne            1b
> +        ret
> +endfunc
> +
> +function ff_hevc_put_hevc_epel_bi_h8_8_neon, export=1
> +        load_epel_filterb x6, x7
> +        sub             x2, x2, #1
> +        mov             x10, #(MAX_PB_SIZE * 2)
> +1:      ld1             {v24.16b}, [x2], x3
> +        ext             v26.16b, v24.16b, v24.16b, #1
> +        ext             v27.16b, v24.16b, v24.16b, #2
> +        ext             v28.16b, v24.16b, v24.16b, #3
> +        calc_epelb      v16, v24, v26 v27, v28

Here, you're missing a comma between v26 and v27 - this produces an error 
when building for macOS, but not for other platforms.

// Martin



More information about the ffmpeg-devel mailing list