aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-28 05:59:08 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-31 00:08:42 +0100
commitb49e621c83209a4f3d2c525a4ce33bd87aa02a84 (patch)
tree56970b18fe9f14c29ac71ee1ac51e21b3056314b /libswscale
parent72f4f1dafbddb266b53695e4c8b5e2df4927c1ba (diff)
downloadffmpeg-b49e621c83209a4f3d2c525a4ce33bd87aa02a84.tar.gz
swscale/ppc/swscale_altivec: Simplify macro
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/ppc/swscale_altivec.c14
1 files changed, 4 insertions, 10 deletions
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));
}
}