avcodec/vp3: Optimize alignment check away when possible

Check only on arches that need said check.

(Btw: I do not see how h_loop_filter benefits from alignment
at all and why h_loop_filter_unaligned exists.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-10-10 15:49:04 +02:00
parent 5823ab347a
commit 31f0749cd4
3 changed files with 7 additions and 3 deletions

View File

@@ -2031,7 +2031,7 @@ static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int
plane_height);
#define safe_loop_filter(name, ptr, stride, bounding_values) \
if ((uintptr_t)(ptr) & 7) \
if (VP3_LOOP_FILTER_NO_UNALIGNED_SUPPORT && (uintptr_t)(ptr) & 7) \
s->vp3dsp.name##_unaligned(ptr, stride, bounding_values); \
else \
s->vp3dsp.name(ptr, stride, bounding_values);

View File

@@ -22,6 +22,10 @@
#include <stddef.h>
#include <stdint.h>
// If this is one, {v,h}_loop_filter expect src to be aligned on eight bytes;
// otherwise they don't have any alignment requirements for src.
#define VP3_LOOP_FILTER_NO_UNALIGNED_SUPPORT (ARCH_ARM || ARCH_MIPS)
typedef struct VP3DSPContext {
/**
* Copy 8xH pixels from source to destination buffer using a bilinear