Decoder: Replacing some numbers with equivalent macros.

Bug: 118445723
Test: vendor
Change-Id: I2dbdf3bf289c34409db341d7c0502cd88a20bab5
This commit is contained in:
S Hamsalekha 2019-02-01 18:04:23 +05:30 committed by Ray Essick
parent 34769a5b08
commit 65477dcfb9
4 changed files with 31 additions and 21 deletions

View file

@ -36,6 +36,8 @@
#ifndef _IH264_PLATFORM_MACROS_H_
#define _IH264_PLATFORM_MACROS_H_
#include <stdint.h>
#ifndef ARMV8
static __inline WORD32 CLIP_U8(WORD32 x)
@ -107,8 +109,8 @@ static __inline UWORD32 ITT_BIG_ENDIAN(UWORD32 x)
#else
#define CLIP_U8(x) CLIP3(0, 255, (x))
#define CLIP_S8(x) CLIP3(-128, 127, (x))
#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
#define CLIP_U10(x) CLIP3(0, 1023, (x))
#define CLIP_S10(x) CLIP3(-512, 511, (x))
@ -119,8 +121,8 @@ static __inline UWORD32 ITT_BIG_ENDIAN(UWORD32 x)
#define CLIP_U12(x) CLIP3(0, 4095, (x))
#define CLIP_S12(x) CLIP3(-2048, 2047, (x))
#define CLIP_U16(x) CLIP3(0, 65535, (x))
#define CLIP_S16(x) CLIP3(-32768, 32767, (x))
#define CLIP_U16(x) CLIP3(0, UINT16_MAX, (x))
#define CLIP_S16(x) CLIP3(INT16_MIN, INT16_MAX, (x))
#define ITT_BIG_ENDIAN(x) __asm__("rev %0, %1" : "=r"(x) : "r"(x));
@ -135,7 +137,8 @@ static __inline UWORD32 ITT_BIG_ENDIAN(UWORD32 x)
/*saturating instructions are not available for WORD64 in ARMv7, hence we cannot
* use inline assembly like other clips*/
#define CLIP_S32(x) CLIP3(-4294967296, 4294967295, (x))
#define CLIP_U32(x) CLIP3(0, UINT32_MAX, (x))
#define CLIP_S32(x) CLIP3(INT32_MIN, INT32_MAX, (x))
#define DATA_SYNC() __sync_synchronize()

View file

@ -36,6 +36,8 @@
#ifndef _IH264_PLATFORM_MACROS_H_
#define _IH264_PLATFORM_MACROS_H_
#include <stdint.h>
#ifndef ARMV8
static __inline WORD32 CLIP_U8(WORD32 x)
@ -107,8 +109,8 @@ static __inline UWORD32 ITT_BIG_ENDIAN(UWORD32 x)
#else
#define CLIP_U8(x) CLIP3(0, 255, (x))
#define CLIP_S8(x) CLIP3(-128, 127, (x))
#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
#define CLIP_U10(x) CLIP3(0, 1023, (x))
#define CLIP_S10(x) CLIP3(-512, 511, (x))
@ -119,8 +121,8 @@ static __inline UWORD32 ITT_BIG_ENDIAN(UWORD32 x)
#define CLIP_U12(x) CLIP3(0, 4095, (x))
#define CLIP_S12(x) CLIP3(-2048, 2047, (x))
#define CLIP_U16(x) CLIP3(0, 65535, (x))
#define CLIP_S16(x) CLIP3(-32768, 32767, (x))
#define CLIP_U16(x) CLIP3(0, UINT16_MAX, (x))
#define CLIP_S16(x) CLIP3(INT16_MIN, INT16_MAX, (x))
#define ITT_BIG_ENDIAN(x) __asm__("rev %0, %1" : "=r"(x) : "r"(x));
@ -135,7 +137,8 @@ static __inline UWORD32 ITT_BIG_ENDIAN(UWORD32 x)
/*saturating instructions are not available for WORD64 in ARMv7, hence we cannot
* use inline assembly like other clips*/
#define CLIP_S32(x) CLIP3(-4294967296, 4294967295, (x))
#define CLIP_U32(x) CLIP3(0, UINT32_MAX, (x))
#define CLIP_S32(x) CLIP3(INT32_MIN, INT32_MAX, (x))
#define DATA_SYNC() __sync_synchronize()

View file

@ -38,8 +38,10 @@
#ifndef _IH264_PLATFORM_MACROS_H_
#define _IH264_PLATFORM_MACROS_H_
#define CLIP_U8(x) CLIP3(0, 255, (x))
#define CLIP_S8(x) CLIP3(-128, 127, (x))
#include <stdint.h>
#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
#define CLIP_U10(x) CLIP3(0, 1023, (x))
#define CLIP_S10(x) CLIP3(-512, 511, (x))
@ -50,10 +52,11 @@
#define CLIP_U12(x) CLIP3(0, 4095, (x))
#define CLIP_S12(x) CLIP3(-2048, 2047, (x))
#define CLIP_U16(x) CLIP3(0, 65535, (x))
#define CLIP_S16(x) CLIP3(-32768, 32767, (x))
#define CLIP_U16(x) CLIP3(0, UINT16_MAX, (x))
#define CLIP_S16(x) CLIP3(INT16_MIN, INT16_MAX, (x))
#define CLIP_S32(x) CLIP3(-4294967296, 4294967295, (x))
#define CLIP_U32(x) CLIP3(0, UINT32_MAX, (x))
#define CLIP_S32(x) CLIP3(INT32_MIN, INT32_MAX, (x))
#define MEM_ALIGN16 __attribute__ ((aligned (16)))

View file

@ -38,11 +38,11 @@
#ifndef _IH264_PLATFORM_MACROS_H_
#define _IH264_PLATFORM_MACROS_H_
#include <stdint.h>
#include <immintrin.h>
#define CLIP_U8(x) CLIP3(0, 255, (x))
#define CLIP_S8(x) CLIP3(-128, 127, (x))
#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
#define CLIP_U10(x) CLIP3(0, 1023, (x))
#define CLIP_S10(x) CLIP3(-512, 511, (x))
@ -53,10 +53,11 @@
#define CLIP_U12(x) CLIP3(0, 4095, (x))
#define CLIP_S12(x) CLIP3(-2048, 2047, (x))
#define CLIP_U16(x) CLIP3(0, 65535, (x))
#define CLIP_S16(x) CLIP3(-32768, 32767, (x))
#define CLIP_U16(x) CLIP3(0, UINT16_MAX, (x))
#define CLIP_S16(x) CLIP3(INT16_MIN, INT16_MAX, (x))
#define CLIP_S32(x) CLIP3(-4294967296, 4294967295, (x))
#define CLIP_U32(x) CLIP3(0, UINT32_MAX, (x))
#define CLIP_S32(x) CLIP3(INT32_MIN, INT32_MAX, (x))
#define MEM_ALIGN16 __attribute__ ((aligned (16)))