shithub: openh264

Download patch

ref: dacd22d695152105dc9dc93776513247a27371dc
parent: 03af36dc541e6ded49c08dd39c0f3084b08d4955
parent: 642b405f87f486e5c045e5e8a238936a4cfed817
author: huili2 <[email protected]>
date: Fri Aug 8 13:36:07 EDT 2014

Merge pull request #1254 from mstorsjo/alias-attribute

Add attributes incidating intentional data type aliasing, fix GetIntraPredictorTest on android

--- a/codec/common/inc/ls_defines.h
+++ b/codec/common/inc/ls_defines.h
@@ -40,13 +40,13 @@
 
 struct tagUnaligned_64 {
   uint64_t l;
-} __attribute__ ((packed));
+} __attribute__ ((packed)) __attribute__ ((may_alias));
 struct tagUnaligned_32 {
   uint32_t l;
-} __attribute__ ((packed));
+} __attribute__ ((packed)) __attribute__ ((may_alias));
 struct tagUnaligned_16 {
   uint16_t l;
-} __attribute__ ((packed));
+} __attribute__ ((packed)) __attribute__ ((may_alias));
 
 #define LD16(a) (((struct tagUnaligned_16 *) (a))->l)
 #define LD32(a) (((struct tagUnaligned_32 *) (a))->l)
@@ -54,7 +54,7 @@
 
 #define STRUCTA(size, align) struct tagUnaligned_##size##_##align {\
     uint##size##_t l; \
-} __attribute__ ((aligned(align)))
+} __attribute__ ((aligned(align))) __attribute__ ((may_alias))
 STRUCTA (16, 2);
 STRUCTA (32, 2);
 STRUCTA (32, 4);
--- a/test/encoder/EncUT_GetIntraPredictor.cpp
+++ b/test/encoder/EncUT_GetIntraPredictor.cpp
@@ -6,7 +6,6 @@
 #include "macros.h"
 
 using namespace WelsSVCEnc;
-/* disable two UT to avoide fail on Android, root cause not found
 TEST (GetIntraPredictorTest, TestGetI4x4LumaPredV) {
   uint8_t* pPred = new uint8_t[64];
   uint8_t*	pRef  = new uint8_t[64];
@@ -61,7 +60,6 @@
   delete []pRef;
   delete []pPred;
 }
-*/
 
 TEST (GetIntraPredictorTest, TestGetI4x4LumaPredDDL) {
   const int32_t kiStride = 0;