[FFmpeg-devel] [PATCH 3/5] lavc/aarch64: new optimization for 8-bit hevc_epel_uni_w_v
Martin Storsjö
martin at martin.st
Mon Jun 12 12:08:07 EEST 2023
On Mon, 12 Jun 2023, Martin Storsjö wrote:
> On Sun, 4 Jun 2023, Logan.Lyu at myais.com.cn wrote:
>
>> From: Logan Lyu <Logan.Lyu at myais.com.cn>
>>
>> Signed-off-by: Logan Lyu <Logan.Lyu at myais.com.cn>
>> ---
>> libavcodec/aarch64/hevcdsp_epel_neon.S | 504 ++++++++++++++++++++++
>> libavcodec/aarch64/hevcdsp_init_aarch64.c | 6 +
>> 2 files changed, 510 insertions(+)
>>
>> diff --git a/libavcodec/aarch64/hevcdsp_epel_neon.S
>> b/libavcodec/aarch64/hevcdsp_epel_neon.S
>> index fe494dd843..4841f49dab 100644
>> --- a/libavcodec/aarch64/hevcdsp_epel_neon.S
>> +++ b/libavcodec/aarch64/hevcdsp_epel_neon.S
>
>
>> +function ff_hevc_put_hevc_epel_uni_w_v48_8_neon, export=1
>> + stp q8, q9, [sp, #-32]
>> + stp q10, q11, [sp, #-64]
>
> This backs up values on the stack without decrementing the stack pointer,
> i.e. storing it in the red zone. Whether this is supported depends on the
> platform ABI. Linux and macOS have a 128 byte red zone on aarch64, while
> Windows only has 16 bytes. So for portability, don't rely on a red zone at
> all.
>
> I.e., here please decrement the stack pointer like in a previous patch:
>
> stp q8, q9, [sp, #-64]!
> stp q10, q11, [sp, #32]
>
> And inversely when restoring it.
Oh, and another detail here. You don't need to back up and restore the
whole q8-q15 registers, it's enough to restore the lower 64 bits of it, so
you can do
stp d8, d9, [sp, #-32]
stp d10, d11, [sp, #16]
in this case.
// Martin
More information about the ffmpeg-devel
mailing list