Skip to content

Commit 3befb24

Browse files
committed
stagefright avcenc: Use intptr_t for casting pointers to integers
This is used for doing integer arithmetic on the pointers, for checking pointer alignment. Change-Id: I7a7ff834dc631ac9cce90e46216f64645e1ae6e5
1 parent 3d7f0cb commit 3befb24

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

media/libstagefright/codecs/avc/enc/src/avcenc_api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ OSCL_EXPORT_REF AVCEnc_Status PVAVCEncGetRecon(AVCHandle *avcHandle, AVCFrameIO
573573
recon->pitch = currFS->frame.pitch;
574574
recon->disp_order = currFS->PicOrderCnt;
575575
recon->coding_order = currFS->FrameNum;
576-
recon->id = (uint32) currFS->base_dpb; /* use the pointer as the id */
576+
recon->id = (intptr_t) currFS->base_dpb; /* use the pointer as the id */
577577

578578
currFS->IsOutputted |= 1;
579579

media/libstagefright/codecs/avc/enc/src/motion_comp.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void eCreateAlign(uint8 *ref, int picpitch, int y_pos,
198198
out_offset = 24 - blkwidth;
199199

200200
//switch(x_pos&0x3){
201-
switch (((uint32)ref)&0x3)
201+
switch (((intptr_t)ref)&0x3)
202202
{
203203
case 1:
204204
offset = picpitch - blkwidth - 3;
@@ -790,7 +790,7 @@ void eVertInterp1MC(uint8 *in, int inpitch, uint8 *out, int outpitch,
790790
uint8 tmp_in[24][24];
791791

792792
/* not word-aligned */
793-
if (((uint32)in)&0x3)
793+
if (((intptr_t)in)&0x3)
794794
{
795795
eCreateAlign(in, inpitch, -2, &tmp_in[0][0], blkwidth, blkheight + 5);
796796
in = &tmp_in[2][0];
@@ -1465,7 +1465,7 @@ void eDiagonalInterpMC(uint8 *in1, uint8 *in2, int inpitch,
14651465

14661466
/* perform vertical interpolation */
14671467
/* not word-aligned */
1468-
if (((uint32)in2)&0x3)
1468+
if (((intptr_t)in2)&0x3)
14691469
{
14701470
eCreateAlign(in2, inpitch, -2, &tmp_in[0][0], blkwidth, blkheight + 5);
14711471
in2 = &tmp_in[2][0];
@@ -1659,7 +1659,7 @@ void eFullPelMC(uint8 *in, int inpitch, uint8 *out, int outpitch,
16591659
uint32 temp;
16601660
uint8 byte;
16611661

1662-
if (((uint32)in)&3)
1662+
if (((intptr_t)in)&3)
16631663
{
16641664
for (j = blkheight; j > 0; j--)
16651665
{
@@ -1720,7 +1720,7 @@ void ePadChroma(uint8 *ref, int picwidth, int picheight, int picpitch, int x_pos
17201720
else start = ref + x_pos;
17211721

17221722
/* word-align start */
1723-
offset = (uint32)start & 0x3;
1723+
offset = (intptr_t)start & 0x3;
17241724
if (offset) start -= offset;
17251725

17261726
word1 = *((uint32*)start);
@@ -1746,7 +1746,7 @@ void ePadChroma(uint8 *ref, int picwidth, int picheight, int picpitch, int x_pos
17461746
else start = ref + picpitch * (picheight - 1) + x_pos;
17471747

17481748
/* word-align start */
1749-
offset = (uint32)start & 0x3;
1749+
offset = (intptr_t)start & 0x3;
17501750
if (offset) start -= offset;
17511751

17521752
word1 = *((uint32*)start);
@@ -2121,7 +2121,7 @@ void eChromaFullMC_SIMD(uint8 *pRef, int srcPitch, int dx, int dy,
21212121
uint16 temp;
21222122
uint8 byte;
21232123

2124-
if (((uint32)pRef)&1)
2124+
if (((intptr_t)pRef)&1)
21252125
{
21262126
for (j = blkheight; j > 0; j--)
21272127
{

media/libstagefright/codecs/avc/enc/src/sad_inline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ extern "C"
8080

8181
x9 = 0x80808080; /* const. */
8282

83-
x8 = (uint32)ref & 0x3;
83+
x8 = (intptr_t)ref & 0x3;
8484
if (x8 == 3)
8585
goto SadMBOffset3;
8686
if (x8 == 2)

0 commit comments

Comments
 (0)