summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-03-31 22:04:22 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-03-31 22:04:22 +0000
commit25072b2da38e1a10edcdb300788aacd4701a9ff0 (patch)
treefeb7b618ce08c29a5dc07b2223e89d4e4c71bc15
parent8a3d60ddeb6b18498a1c8e62916c9b4907b5c609 (diff)
parent28a802c5ca0dd3c081e79a202f388b129025b18a (diff)
Snap for 7249461 from 28a802c5ca0dd3c081e79a202f388b129025b18a to rvc-qpr3-release
Change-Id: Ibcbd3bb3541f4d8b7e9f78a9545be4b43c5fc5f5
-rw-r--r--media/codec2/components/avc/C2SoftAvcEnc.cpp20
-rw-r--r--media/libstagefright/codecs/m4v_h263/enc/src/motion_est.cpp2
-rw-r--r--media/libstagefright/codecs/mp3dec/src/pvmp3_framedecoder.cpp21
3 files changed, 15 insertions, 28 deletions
diff --git a/media/codec2/components/avc/C2SoftAvcEnc.cpp b/media/codec2/components/avc/C2SoftAvcEnc.cpp
index ab93ce39f5..566895fa6b 100644
--- a/media/codec2/components/avc/C2SoftAvcEnc.cpp
+++ b/media/codec2/components/avc/C2SoftAvcEnc.cpp
@@ -1328,13 +1328,13 @@ c2_status_t C2SoftAvcEnc::setEncodeArgs(
ps_inp_raw_buf->apv_bufs[1] = uPlane;
ps_inp_raw_buf->apv_bufs[2] = vPlane;
- ps_inp_raw_buf->au4_wd[0] = input->width();
- ps_inp_raw_buf->au4_wd[1] = input->width() / 2;
- ps_inp_raw_buf->au4_wd[2] = input->width() / 2;
+ ps_inp_raw_buf->au4_wd[0] = mSize->width;
+ ps_inp_raw_buf->au4_wd[1] = mSize->width / 2;
+ ps_inp_raw_buf->au4_wd[2] = mSize->width / 2;
- ps_inp_raw_buf->au4_ht[0] = input->height();
- ps_inp_raw_buf->au4_ht[1] = input->height() / 2;
- ps_inp_raw_buf->au4_ht[2] = input->height() / 2;
+ ps_inp_raw_buf->au4_ht[0] = mSize->height;
+ ps_inp_raw_buf->au4_ht[1] = mSize->height / 2;
+ ps_inp_raw_buf->au4_ht[2] = mSize->height / 2;
ps_inp_raw_buf->au4_strd[0] = yStride;
ps_inp_raw_buf->au4_strd[1] = uStride;
@@ -1359,11 +1359,11 @@ c2_status_t C2SoftAvcEnc::setEncodeArgs(
ps_inp_raw_buf->apv_bufs[0] = yPlane;
ps_inp_raw_buf->apv_bufs[1] = uPlane;
- ps_inp_raw_buf->au4_wd[0] = input->width();
- ps_inp_raw_buf->au4_wd[1] = input->width();
+ ps_inp_raw_buf->au4_wd[0] = mSize->width;
+ ps_inp_raw_buf->au4_wd[1] = mSize->width;
- ps_inp_raw_buf->au4_ht[0] = input->height();
- ps_inp_raw_buf->au4_ht[1] = input->height() / 2;
+ ps_inp_raw_buf->au4_ht[0] = mSize->height;
+ ps_inp_raw_buf->au4_ht[1] = mSize->height / 2;
ps_inp_raw_buf->au4_strd[0] = yStride;
ps_inp_raw_buf->au4_strd[1] = uStride;
diff --git a/media/libstagefright/codecs/m4v_h263/enc/src/motion_est.cpp b/media/libstagefright/codecs/m4v_h263/enc/src/motion_est.cpp
index 997b78d229..9deb02367b 100644
--- a/media/libstagefright/codecs/m4v_h263/enc/src/motion_est.cpp
+++ b/media/libstagefright/codecs/m4v_h263/enc/src/motion_est.cpp
@@ -1576,7 +1576,7 @@ void RasterIntraUpdate(UChar *intraArray, UChar *Mode, Int totalMB, Int numRefre
/* find the last refresh MB */
indx = 0;
- while (intraArray[indx] == 1 && indx < totalMB)
+ while (indx < totalMB && intraArray[indx] == 1)
indx++;
/* add more */
diff --git a/media/libstagefright/codecs/mp3dec/src/pvmp3_framedecoder.cpp b/media/libstagefright/codecs/mp3dec/src/pvmp3_framedecoder.cpp
index 15d2feb4d4..5cf1ed3aa3 100644
--- a/media/libstagefright/codecs/mp3dec/src/pvmp3_framedecoder.cpp
+++ b/media/libstagefright/codecs/mp3dec/src/pvmp3_framedecoder.cpp
@@ -598,18 +598,10 @@ void fillMainDataBuf(void *pMem, int32 temp)
}
else
{
- int32 tmp1 = *(ptr++);
- for (int32 nBytes = temp >> 1; nBytes != 0; nBytes--) /* read main data. */
+ for (int32 nBytes = temp; nBytes != 0; nBytes--) /* read main data. */
{
- int32 tmp2 = *(ptr++);
- fillDataBuf(&pVars->mainDataStream, tmp1);
- fillDataBuf(&pVars->mainDataStream, tmp2);
- tmp1 = *(ptr++);
- }
-
- if (temp&1)
- {
- fillDataBuf(&pVars->mainDataStream, tmp1);
+ int32 tmp = *(ptr++);
+ fillDataBuf(&pVars->mainDataStream, tmp);
}
/* adjust circular buffer counter */
@@ -618,14 +610,9 @@ void fillMainDataBuf(void *pMem, int32 temp)
}
else
{
- for (int32 nBytes = temp >> 1; nBytes != 0; nBytes--) /* read main data. */
+ for (int32 nBytes = temp; nBytes != 0; nBytes--) /* read main data. */
{
fillDataBuf(&pVars->mainDataStream, *(pVars->inputStream.pBuffer + module(offset++ , BUFSIZE)));
- fillDataBuf(&pVars->mainDataStream, *(pVars->inputStream.pBuffer + module(offset++ , BUFSIZE)));
- }
- if (temp&1)
- {
- fillDataBuf(&pVars->mainDataStream, *(pVars->inputStream.pBuffer + module(offset , BUFSIZE)));
}
}