[FFmpeg-devel] [PATCH] avcodec/hevcdsp: Offset ff_hevc_.pel_filters to simplify addressing

Nuo Mi nuomi2021 at gmail.com
Sun Feb 11 13:47:50 EET 2024


On Sun, Feb 11, 2024 at 4:21 PM Andreas Rheinhardt <
andreas.rheinhardt at outlook.com> wrote:

> Besides simplifying address computations (it saves 432B of .text
> in hevcdsp.o alone here) it also fixes undefined behaviour that
>
We can save more if we change
void (*put_hevc_epel[10][2][2])(int16_t *dst, const uint8_t *src, ptrdiff_t
srcstride, int height, intptr_t mx, intptr_t my, int width);
to
void (*put_hevc_epel[10][2][2])(int16_t *dst, const uint8_t *src, ptrdiff_t
srcstride, int height, const int8_t *hf, const int8_t *vf, int width);
But it may need a lot of work.

occurs if mx or my are 0 (happens when the filters are unused)
> because they lead to an array index of -1 in the old code.
> This happens in the checkasm-hevc_pel FATE-test.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
> The loongarch and mips parts of this are untested. Luckily we have a
> loongarch patchwork runner...
>
>


More information about the ffmpeg-devel mailing list