You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
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:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -68,8 +68,8 @@ static void vp3_check_loop_filter(void)
|
||||
#define TEST(NAME) .name = #NAME, .offset = offsetof(VP3DSPContext, NAME)
|
||||
{ TEST(v_loop_filter_unaligned), 2, 1, 0, 7, 1, 0 },
|
||||
{ TEST(h_loop_filter_unaligned), 0, 7, 2, 1, 1, 1 },
|
||||
{ TEST(v_loop_filter), 2, 1, 0, 7, 8, 0 },
|
||||
{ TEST(h_loop_filter), 0, 7, 2, 1, 8, 1 },
|
||||
{ TEST(v_loop_filter), 2, 1, 0, 7, VP3_LOOP_FILTER_NO_UNALIGNED_SUPPORT ? 8 : 1, 0 },
|
||||
{ TEST(h_loop_filter), 0, 7, 2, 1, VP3_LOOP_FILTER_NO_UNALIGNED_SUPPORT ? 8 : 1, 1 },
|
||||
};
|
||||
declare_func(void, uint8_t *src, ptrdiff_t stride, int *bounding_values);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user