summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Jadhav <vivek.jadhav@ittiam.com>2023-09-20 11:32:55 +0530
committerHarish Mahendrakar <harish.mahendrakar@ittiam.com>2023-09-20 06:23:35 -0700
commit4fef330d970c6499e5563f7fe51fd51f4fac931a (patch)
treeac961a0933cd11369b55cb22d257fa5bde5c27ae
parent0358065eb1b00db81f52dcf842bc1e8c84113742 (diff)
downloadlibmpeg2-4fef330d970c6499e5563f7fe51fd51f4fac931a.tar.gz
libmpeg2: Cleanup CONV_LE_TO_BE using builtin_bswap32
Bug: b/261228395 Test: Build
-rw-r--r--common/arm/impeg2_platform_macros.h6
-rw-r--r--common/armv8/impeg2_platform_macros.h6
-rw-r--r--common/riscv/impeg2_platform_macros.h6
-rw-r--r--common/x86/impeg2_platform_macros.h6
4 files changed, 6 insertions, 18 deletions
diff --git a/common/arm/impeg2_platform_macros.h b/common/arm/impeg2_platform_macros.h
index 11db302..52b625d 100644
--- a/common/arm/impeg2_platform_macros.h
+++ b/common/arm/impeg2_platform_macros.h
@@ -21,11 +21,7 @@
#define __IMPEG2_PLATFORM_MACROS_H__
-#define CONV_LE_TO_BE(u4_temp2,u4_temp1) u4_temp2 = \
- (u4_temp1 << 24) | \
- ((u4_temp1 & 0xff00) << 8) | \
- ((u4_temp1 & 0xff0000) >> 8) | \
- (u4_temp1 >> 24);
+#define CONV_LE_TO_BE(u4_temp2,u4_temp1) u4_temp2 = __builtin_bswap32(u4_temp1);
static __inline UWORD32 CLZ(UWORD32 u4_word)
{
diff --git a/common/armv8/impeg2_platform_macros.h b/common/armv8/impeg2_platform_macros.h
index be1f8d8..e3d1243 100644
--- a/common/armv8/impeg2_platform_macros.h
+++ b/common/armv8/impeg2_platform_macros.h
@@ -20,11 +20,7 @@
#ifndef __IMPEG2_PLATFORM_MACROS_H__
#define __IMPEG2_PLATFORM_MACROS_H__
-#define CONV_LE_TO_BE(u4_temp2,u4_temp1) u4_temp2 = \
- (u4_temp1 << 24) | \
- ((u4_temp1 & 0xff00) << 8) | \
- ((u4_temp1 & 0xff0000) >> 8) | \
- (u4_temp1 >> 24);
+#define CONV_LE_TO_BE(u4_temp2,u4_temp1) u4_temp2 = __builtin_bswap32(u4_temp1);
static __inline UWORD32 CLZ(UWORD32 u4_word)
{
diff --git a/common/riscv/impeg2_platform_macros.h b/common/riscv/impeg2_platform_macros.h
index a5912e2..9de0251 100644
--- a/common/riscv/impeg2_platform_macros.h
+++ b/common/riscv/impeg2_platform_macros.h
@@ -21,10 +21,8 @@
#define __IMPEG2_PLATFORM_MACROS_H__
-#define CONV_LE_TO_BE(u4_temp2,u4_temp1) u4_temp2 = (u4_temp1 << 24) | \
- ((u4_temp1 & 0xff00) << 8) | \
- ((u4_temp1 & 0xff0000) >> 8) | \
- (u4_temp1 >> 24);
+#define CONV_LE_TO_BE(u4_temp2,u4_temp1) u4_temp2 = __builtin_bswap32(u4_temp1);
+
static __inline UWORD32 CLZ(UWORD32 u4_word)
{
if(u4_word)
diff --git a/common/x86/impeg2_platform_macros.h b/common/x86/impeg2_platform_macros.h
index 183f1fa..10dbdb2 100644
--- a/common/x86/impeg2_platform_macros.h
+++ b/common/x86/impeg2_platform_macros.h
@@ -21,10 +21,8 @@
#define __IMPEG2_PLATFORM_MACROS_H__
-#define CONV_LE_TO_BE(u4_temp2,u4_temp1) u4_temp2 = (u4_temp1 << 24) | \
- ((u4_temp1 & 0xff00) << 8) | \
- ((u4_temp1 & 0xff0000) >> 8) | \
- (u4_temp1 >> 24);
+#define CONV_LE_TO_BE(u4_temp2,u4_temp1) u4_temp2 = __builtin_bswap32(u4_temp1);
+
static __inline UWORD32 CLZ(UWORD32 u4_word)
{
if(u4_word)