Skip to content

Commit 64f77c5

Browse files
Jean-Baptiste Queruandroid code review
authored andcommitted
Merge "stagefright avcenc: Use intptr_t for casting pointers to integers"
2 parents 6fd507b + 3befb24 commit 64f77c5

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;
@@ -788,7 +788,7 @@ void eVertInterp1MC(uint8 *in, int inpitch, uint8 *out, int outpitch,
788788
uint8 tmp_in[24][24];
789789

790790
/* not word-aligned */
791-
if (((uint32)in)&0x3)
791+
if (((intptr_t)in)&0x3)
792792
{
793793
eCreateAlign(in, inpitch, -2, &tmp_in[0][0], blkwidth, blkheight + 5);
794794
in = &tmp_in[2][0];
@@ -1461,7 +1461,7 @@ void eDiagonalInterpMC(uint8 *in1, uint8 *in2, int inpitch,
14611461

14621462
/* perform vertical interpolation */
14631463
/* not word-aligned */
1464-
if (((uint32)in2)&0x3)
1464+
if (((intptr_t)in2)&0x3)
14651465
{
14661466
eCreateAlign(in2, inpitch, -2, &tmp_in[0][0], blkwidth, blkheight + 5);
14671467
in2 = &tmp_in[2][0];
@@ -1655,7 +1655,7 @@ void eFullPelMC(uint8 *in, int inpitch, uint8 *out, int outpitch,
16551655
uint32 temp;
16561656
uint8 byte;
16571657

1658-
if (((uint32)in)&3)
1658+
if (((intptr_t)in)&3)
16591659
{
16601660
for (j = blkheight; j > 0; j--)
16611661
{
@@ -1716,7 +1716,7 @@ void ePadChroma(uint8 *ref, int picwidth, int picheight, int picpitch, int x_pos
17161716
else start = ref + x_pos;
17171717

17181718
/* word-align start */
1719-
offset = (uint32)start & 0x3;
1719+
offset = (intptr_t)start & 0x3;
17201720
if (offset) start -= offset;
17211721

17221722
word1 = *((uint32*)start);
@@ -1742,7 +1742,7 @@ void ePadChroma(uint8 *ref, int picwidth, int picheight, int picpitch, int x_pos
17421742
else start = ref + picpitch * (picheight - 1) + x_pos;
17431743

17441744
/* word-align start */
1745-
offset = (uint32)start & 0x3;
1745+
offset = (intptr_t)start & 0x3;
17461746
if (offset) start -= offset;
17471747

17481748
word1 = *((uint32*)start);
@@ -2117,7 +2117,7 @@ void eChromaFullMC_SIMD(uint8 *pRef, int srcPitch, int dx, int dy,
21172117
uint16 temp;
21182118
uint8 byte;
21192119

2120-
if (((uint32)pRef)&1)
2120+
if (((intptr_t)pRef)&1)
21212121
{
21222122
for (j = blkheight; j > 0; j--)
21232123
{

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)