From 377b2ec9a2885f9b6405b07ba900a9e3f4349c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20PETIT?= Date: Mon, 3 Feb 2014 12:35:36 +0000 Subject: Make frameworks/av 64-bit compatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contains the necessary changes to make frameworks/av build and work on a 64-bit machine. Signed-off-by: Craig Barber Signed-off-by: Kévin PETIT Signed-off-by: Ashok Bhat Signed-off-by: Marcus Oakland Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43 --- .../codecs/m4v_h263/dec/src/get_pred_adv_b_add.cpp | 8 ++++---- media/libstagefright/codecs/m4v_h263/enc/src/dct.cpp | 12 ++++++------ media/libstagefright/codecs/m4v_h263/enc/src/fastcodemb.cpp | 4 ++-- media/libstagefright/codecs/m4v_h263/enc/src/motion_comp.cpp | 2 +- media/libstagefright/codecs/m4v_h263/enc/src/sad_inline.h | 2 +- .../libstagefright/codecs/on2/h264dec/source/h264bsd_util.h | 3 ++- 6 files changed, 16 insertions(+), 15 deletions(-) (limited to 'media/libstagefright/codecs') diff --git a/media/libstagefright/codecs/m4v_h263/dec/src/get_pred_adv_b_add.cpp b/media/libstagefright/codecs/m4v_h263/dec/src/get_pred_adv_b_add.cpp index e23f23d..fe9e7dc 100644 --- a/media/libstagefright/codecs/m4v_h263/dec/src/get_pred_adv_b_add.cpp +++ b/media/libstagefright/codecs/m4v_h263/dec/src/get_pred_adv_b_add.cpp @@ -96,7 +96,7 @@ int GetPredAdvancedBy0x0( offset = width - B_SIZE; /* offset for prev */ offset2 = (pred_width_rnd >> 1) - 4; /* offset for pred_block */ - tmp = (uint32)prev & 0x3; + tmp = (uintptr_t)prev & 0x3; pred_block -= offset2; /* preset */ if (tmp == 0) /* word-aligned */ @@ -203,7 +203,7 @@ int GetPredAdvancedBy0x1( /* Branch based on pixel location (half-pel or full-pel) for x and y */ pred_block -= offset2; /* preset */ - tmp = (uint32)prev & 3; + tmp = (uintptr_t)prev & 3; mask = 254; mask |= (mask << 8); mask |= (mask << 16); /* 0xFEFEFEFE */ @@ -532,7 +532,7 @@ int GetPredAdvancedBy1x0( /* Branch based on pixel location (half-pel or full-pel) for x and y */ pred_block -= offset2; /* preset */ - tmp = (uint32)prev & 3; + tmp = (uintptr_t)prev & 3; mask = 254; mask |= (mask << 8); mask |= (mask << 16); /* 0xFEFEFEFE */ @@ -884,7 +884,7 @@ int GetPredAdvancedBy1x1( mask |= (mask << 8); mask |= (mask << 16); /* 0x3f3f3f3f */ - tmp = (uint32)prev & 3; + tmp = (uintptr_t)prev & 3; pred_block -= 4; /* preset */ diff --git a/media/libstagefright/codecs/m4v_h263/enc/src/dct.cpp b/media/libstagefright/codecs/m4v_h263/enc/src/dct.cpp index fa50eeb..fa4ae23 100644 --- a/media/libstagefright/codecs/m4v_h263/enc/src/dct.cpp +++ b/media/libstagefright/codecs/m4v_h263/enc/src/dct.cpp @@ -250,7 +250,7 @@ extern "C" out[40] = k4 ; /* row 5 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } @@ -455,7 +455,7 @@ extern "C" out[8] = k5 ; /* row 1 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } @@ -635,7 +635,7 @@ extern "C" out[8] = k5 ; /* row 1 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } @@ -846,7 +846,7 @@ extern "C" out[40] = k4 ; /* row 5 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } @@ -1033,7 +1033,7 @@ extern "C" out[8] = k5 ; /* row 1 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } @@ -1195,7 +1195,7 @@ extern "C" out[8] = k5 ; /* row 1 */ out++; } - while ((UInt)out < (UInt)dst) ; + while ((uintptr_t)out < (uintptr_t)dst) ; return ; } diff --git a/media/libstagefright/codecs/m4v_h263/enc/src/fastcodemb.cpp b/media/libstagefright/codecs/m4v_h263/enc/src/fastcodemb.cpp index 6fd41c3..0ad39a6 100644 --- a/media/libstagefright/codecs/m4v_h263/enc/src/fastcodemb.cpp +++ b/media/libstagefright/codecs/m4v_h263/enc/src/fastcodemb.cpp @@ -572,7 +572,7 @@ Int Sad8x8(UChar *cur, UChar *prev, Int width) cur2 = cur2 & (mask << 8); /* mask first and third bytes */ sum2 = sum2 + ((UInt)cur2 >> 8); } - while ((UInt)curInt < (UInt)end); + while ((uintptr_t)curInt < (uintptr_t)end); cur1 = sum4 - (sum2 << 8); /* get even-sum */ cur1 = cur1 + sum2; /* add 16 bit even-sum and odd-sum*/ @@ -611,7 +611,7 @@ Int getBlockSum(UChar *cur, Int width) load2 = load2 & (mask << 8); /* even bytes */ sum2 += ((UInt)load2 >> 8); /* sum even bytes, 16 bit */ } - while ((UInt)curInt < (UInt)end); + while ((uintptr_t)curInt < (uintptr_t)end); load1 = sum4 - (sum2 << 8); /* get even-sum */ load1 = load1 + sum2; /* add 16 bit even-sum and odd-sum*/ load1 = load1 + (load1 << 16); /* add upper and lower 16 bit sum */ diff --git a/media/libstagefright/codecs/m4v_h263/enc/src/motion_comp.cpp b/media/libstagefright/codecs/m4v_h263/enc/src/motion_comp.cpp index b81d278..06e8926 100644 --- a/media/libstagefright/codecs/m4v_h263/enc/src/motion_comp.cpp +++ b/media/libstagefright/codecs/m4v_h263/enc/src/motion_comp.cpp @@ -1959,7 +1959,7 @@ void PutSkippedBlock(UChar *rec, UChar *prev, Int lx) dst += offset; src += offset; } - while ((UInt)src < (UInt)end); + while ((uintptr_t)src < (uintptr_t)end); return ; } diff --git a/media/libstagefright/codecs/m4v_h263/enc/src/sad_inline.h b/media/libstagefright/codecs/m4v_h263/enc/src/sad_inline.h index ba77dfd..b865f23 100644 --- a/media/libstagefright/codecs/m4v_h263/enc/src/sad_inline.h +++ b/media/libstagefright/codecs/m4v_h263/enc/src/sad_inline.h @@ -85,7 +85,7 @@ extern "C" x9 = 0x80808080; /* const. */ - x8 = (uint32)ref & 0x3; + x8 = (uintptr_t)ref & 0x3; if (x8 == 3) goto SadMBOffset3; if (x8 == 2) diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h index cb3adda..216ad04 100755 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h @@ -42,6 +42,7 @@ #include #endif +#include #include "basetype.h" #include "h264bsd_stream.h" #include "h264bsd_image.h" @@ -150,7 +151,7 @@ } #define ALIGN(ptr, bytePos) \ - (ptr + ( ((bytePos - (int)ptr) & (bytePos - 1)) / sizeof(*ptr) )) + (ptr + ( ((bytePos - (uintptr_t)ptr) & (bytePos - 1)) / sizeof(*ptr) )) extern const u32 h264bsdQpC[52]; -- cgit v1.1