diff mbox series

[FFmpeg-devel,04/18] swscale/ppc/swscale_altivec: Simplify macro

Message ID AS8P250MB07443FB394EE83FAF16EEC628F3B2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit b49e621c83209a4f3d2c525a4ce33bd87aa02a84
Headers show
Series [FFmpeg-devel,01/18] avcodec/mips/ac3dsp_mips: Add missing includes | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt March 28, 2024, 11:10 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libswscale/ppc/swscale_altivec.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c
index 8e35e0372f..9bf72738df 100644
--- a/libswscale/ppc/swscale_altivec.c
+++ b/libswscale/ppc/swscale_altivec.c
@@ -109,17 +109,12 @@ 
 
 #define SHIFT  3
 
-#define output_pixel(pos, val, bias, signedness) \
-    if (big_endian) { \
-        AV_WB16(pos, bias + av_clip_ ## signedness ## 16(val >> shift)); \
-    } else { \
-        AV_WL16(pos, bias + av_clip_ ## signedness ## 16(val >> shift)); \
-    }
+#define get_pixel(val, bias, signedness) \
+    (bias + av_clip_ ## signedness ## 16(val >> shift))
 
 static void
 yuv2plane1_float_u(const int32_t *src, float *dest, int dstW, int start)
 {
-    static const int big_endian = HAVE_BIGENDIAN;
     static const int shift = 3;
     static const float float_mult = 1.0f / 65535.0f;
     int i, val;
@@ -127,7 +122,7 @@  yuv2plane1_float_u(const int32_t *src, float *dest, int dstW, int start)
 
     for (i = start; i < dstW; ++i){
         val = src[i] + (1 << (shift - 1));
-        output_pixel(&val_uint, val, 0, uint);
+        val_uint = get_pixel(val, 0, uint);
         dest[i] = float_mult * (float)val_uint;
     }
 }
@@ -135,7 +130,6 @@  yuv2plane1_float_u(const int32_t *src, float *dest, int dstW, int start)
 static void
 yuv2plane1_float_bswap_u(const int32_t *src, uint32_t *dest, int dstW, int start)
 {
-    static const int big_endian = HAVE_BIGENDIAN;
     static const int shift = 3;
     static const float float_mult = 1.0f / 65535.0f;
     int i, val;
@@ -143,7 +137,7 @@  yuv2plane1_float_bswap_u(const int32_t *src, uint32_t *dest, int dstW, int start
 
     for (i = start; i < dstW; ++i){
         val = src[i] + (1 << (shift - 1));
-        output_pixel(&val_uint, val, 0, uint);
+        val_uint = get_pixel(val, 0, uint);
         dest[i] = av_bswap32(av_float2int(float_mult * (float)val_uint));
     }
 }