summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-08 00:49:59 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-08 00:49:59 +0000
commit6fe7c6a59be6a0806f6517a8e9ad6dffdeec140e (patch)
tree6398be76817aa81d22fc3b3e0be10f0859e83ffe
parent5fe25e80a084128883885c26a815cad405683c3c (diff)
parent1e598f7caf3ab49c47c1f39dbcfe2c8a690615cf (diff)
downloadav-6fe7c6a59be6a0806f6517a8e9ad6dffdeec140e.tar.gz
Snap for 9576959 from 1e598f7caf3ab49c47c1f39dbcfe2c8a690615cf to mainline-adservices-releaseaml_ads_331611190
Change-Id: I75e3117fa7185d8bb02d7e5a436d9684ca970399
-rw-r--r--media/codec2/components/aom/C2SoftAomDec.cpp7
-rw-r--r--media/codec2/components/base/SimpleC2Component.cpp12
-rw-r--r--media/codec2/components/base/include/SimpleC2Component.h4
-rw-r--r--media/codec2/components/gav1/C2SoftGav1Dec.cpp10
-rw-r--r--media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp7
-rw-r--r--media/codec2/components/vpx/C2SoftVpxDec.cpp9
6 files changed, 27 insertions, 22 deletions
diff --git a/media/codec2/components/aom/C2SoftAomDec.cpp b/media/codec2/components/aom/C2SoftAomDec.cpp
index 96b81d7b7f..0eb47f4e62 100644
--- a/media/codec2/components/aom/C2SoftAomDec.cpp
+++ b/media/codec2/components/aom/C2SoftAomDec.cpp
@@ -578,7 +578,8 @@ bool C2SoftAomDec::outputBuffer(
size_t srcVStride = img->stride[AOM_PLANE_V];
C2PlanarLayout layout = wView.layout();
size_t dstYStride = layout.planes[C2PlanarLayout::PLANE_Y].rowInc;
- size_t dstUVStride = layout.planes[C2PlanarLayout::PLANE_U].rowInc;
+ size_t dstUStride = layout.planes[C2PlanarLayout::PLANE_U].rowInc;
+ size_t dstVStride = layout.planes[C2PlanarLayout::PLANE_V].rowInc;
if (img->fmt == AOM_IMG_FMT_I42016) {
const uint16_t *srcY = (const uint16_t *)img->planes[AOM_PLANE_Y];
@@ -592,7 +593,7 @@ bool C2SoftAomDec::outputBuffer(
std::static_pointer_cast<const C2ColorAspectsStruct>(defaultColorAspects));
} else {
convertYUV420Planar16ToYV12(dstY, dstU, dstV, srcY, srcU, srcV, srcYStride / 2,
- srcUStride / 2, srcVStride / 2, dstYStride, dstUVStride,
+ srcUStride / 2, srcVStride / 2, dstYStride, dstUStride,
mWidth, mHeight);
}
} else {
@@ -600,7 +601,7 @@ bool C2SoftAomDec::outputBuffer(
const uint8_t *srcU = (const uint8_t *)img->planes[AOM_PLANE_U];
const uint8_t *srcV = (const uint8_t *)img->planes[AOM_PLANE_V];
convertYUV420Planar8ToYV12(dstY, dstU, dstV, srcY, srcU, srcV, srcYStride, srcUStride,
- srcVStride, dstYStride, dstUVStride, mWidth, mHeight);
+ srcVStride, dstYStride, dstUStride, dstVStride, mWidth, mHeight);
}
finishWork(*(int64_t*)img->user_priv, work, std::move(block));
block = nullptr;
diff --git a/media/codec2/components/base/SimpleC2Component.cpp b/media/codec2/components/base/SimpleC2Component.cpp
index 199875dfa3..c25261331f 100644
--- a/media/codec2/components/base/SimpleC2Component.cpp
+++ b/media/codec2/components/base/SimpleC2Component.cpp
@@ -38,8 +38,8 @@ constexpr uint16_t kNeutralUVBitDepth10 = 512;
void convertYUV420Planar8ToYV12(uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, const uint8_t *srcY,
const uint8_t *srcU, const uint8_t *srcV, size_t srcYStride,
size_t srcUStride, size_t srcVStride, size_t dstYStride,
- size_t dstUVStride, uint32_t width, uint32_t height,
- bool isMonochrome) {
+ size_t dstUStride, size_t dstVStride, uint32_t width,
+ uint32_t height, bool isMonochrome) {
for (size_t i = 0; i < height; ++i) {
memcpy(dstY, srcY, width);
srcY += srcYStride;
@@ -51,8 +51,8 @@ void convertYUV420Planar8ToYV12(uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, con
for (size_t i = 0; i < (height + 1) / 2; ++i) {
memset(dstV, kNeutralUVBitDepth8, (width + 1) / 2);
memset(dstU, kNeutralUVBitDepth8, (width + 1) / 2);
- dstV += dstUVStride;
- dstU += dstUVStride;
+ dstV += dstVStride;
+ dstU += dstUStride;
}
return;
}
@@ -60,13 +60,13 @@ void convertYUV420Planar8ToYV12(uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, con
for (size_t i = 0; i < (height + 1) / 2; ++i) {
memcpy(dstV, srcV, (width + 1) / 2);
srcV += srcVStride;
- dstV += dstUVStride;
+ dstV += dstVStride;
}
for (size_t i = 0; i < (height + 1) / 2; ++i) {
memcpy(dstU, srcU, (width + 1) / 2);
srcU += srcUStride;
- dstU += dstUVStride;
+ dstU += dstUStride;
}
}
diff --git a/media/codec2/components/base/include/SimpleC2Component.h b/media/codec2/components/base/include/SimpleC2Component.h
index 7600c5b0d4..83c4991706 100644
--- a/media/codec2/components/base/include/SimpleC2Component.h
+++ b/media/codec2/components/base/include/SimpleC2Component.h
@@ -33,8 +33,8 @@ namespace android {
void convertYUV420Planar8ToYV12(uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, const uint8_t *srcY,
const uint8_t *srcU, const uint8_t *srcV, size_t srcYStride,
size_t srcUStride, size_t srcVStride, size_t dstYStride,
- size_t dstUVStride, uint32_t width, uint32_t height,
- bool isMonochrome = false);
+ size_t dstUStride, size_t dstVStride, uint32_t width,
+ uint32_t height, bool isMonochrome = false);
void convertYUV420Planar16ToY410OrRGBA1010102(
uint32_t *dst, const uint16_t *srcY,
diff --git a/media/codec2/components/gav1/C2SoftGav1Dec.cpp b/media/codec2/components/gav1/C2SoftGav1Dec.cpp
index d234f21f96..9c5ce9f4b2 100644
--- a/media/codec2/components/gav1/C2SoftGav1Dec.cpp
+++ b/media/codec2/components/gav1/C2SoftGav1Dec.cpp
@@ -857,7 +857,8 @@ bool C2SoftGav1Dec::outputBuffer(const std::shared_ptr<C2BlockPool> &pool,
C2PlanarLayout layout = wView.layout();
size_t dstYStride = layout.planes[C2PlanarLayout::PLANE_Y].rowInc;
- size_t dstUVStride = layout.planes[C2PlanarLayout::PLANE_U].rowInc;
+ size_t dstUStride = layout.planes[C2PlanarLayout::PLANE_U].rowInc;
+ size_t dstVStride = layout.planes[C2PlanarLayout::PLANE_V].rowInc;
if (buffer->bitdepth == 10) {
const uint16_t *srcY = (const uint16_t *)buffer->plane[0];
@@ -873,10 +874,10 @@ bool C2SoftGav1Dec::outputBuffer(const std::shared_ptr<C2BlockPool> &pool,
} else if (format == HAL_PIXEL_FORMAT_YCBCR_P010) {
convertYUV420Planar16ToP010((uint16_t *)dstY, (uint16_t *)dstU, srcY, srcU, srcV,
srcYStride / 2, srcUStride / 2, srcVStride / 2, dstYStride / 2,
- dstUVStride / 2, mWidth, mHeight, isMonochrome);
+ dstUStride / 2, mWidth, mHeight, isMonochrome);
} else {
convertYUV420Planar16ToYV12(dstY, dstU, dstV, srcY, srcU, srcV, srcYStride / 2,
- srcUStride / 2, srcVStride / 2, dstYStride, dstUVStride, mWidth,
+ srcUStride / 2, srcVStride / 2, dstYStride, dstUStride, mWidth,
mHeight, isMonochrome);
}
} else {
@@ -884,7 +885,8 @@ bool C2SoftGav1Dec::outputBuffer(const std::shared_ptr<C2BlockPool> &pool,
const uint8_t *srcU = (const uint8_t *)buffer->plane[1];
const uint8_t *srcV = (const uint8_t *)buffer->plane[2];
convertYUV420Planar8ToYV12(dstY, dstU, dstV, srcY, srcU, srcV, srcYStride, srcUStride,
- srcVStride, dstYStride, dstUVStride, mWidth, mHeight, isMonochrome);
+ srcVStride, dstYStride, dstUStride, dstVStride, mWidth, mHeight,
+ isMonochrome);
}
finishWork(buffer->user_private_data, work, std::move(block));
block = nullptr;
diff --git a/media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp b/media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp
index 3bf9c48dc3..2137964792 100644
--- a/media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp
+++ b/media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp
@@ -603,7 +603,8 @@ void C2SoftMpeg4Dec::process(
C2PlanarLayout layout = wView.layout();
size_t dstYStride = layout.planes[C2PlanarLayout::PLANE_Y].rowInc;
- size_t dstUVStride = layout.planes[C2PlanarLayout::PLANE_U].rowInc;
+ size_t dstUStride = layout.planes[C2PlanarLayout::PLANE_U].rowInc;
+ size_t dstVStride = layout.planes[C2PlanarLayout::PLANE_V].rowInc;
size_t srcYStride = align(mWidth, 16);
size_t srcUStride = srcYStride / 2;
size_t srcVStride = srcYStride / 2;
@@ -613,8 +614,8 @@ void C2SoftMpeg4Dec::process(
const uint8_t *srcV = (const uint8_t *)srcY + vStride * srcYStride * 5 / 4;
convertYUV420Planar8ToYV12(outputBufferY, outputBufferU, outputBufferV, srcY, srcU, srcV,
- srcYStride, srcUStride, srcVStride, dstYStride, dstUVStride,
- mWidth, mHeight);
+ srcYStride, srcUStride, srcVStride, dstYStride, dstUStride,
+ dstVStride, mWidth, mHeight);
inPos += inSize - (size_t)tmpInSize;
finishWork(workIndex, work);
diff --git a/media/codec2/components/vpx/C2SoftVpxDec.cpp b/media/codec2/components/vpx/C2SoftVpxDec.cpp
index 18cd1bf958..dab7b89e65 100644
--- a/media/codec2/components/vpx/C2SoftVpxDec.cpp
+++ b/media/codec2/components/vpx/C2SoftVpxDec.cpp
@@ -766,7 +766,8 @@ status_t C2SoftVpxDec::outputBuffer(
size_t srcVStride = img->stride[VPX_PLANE_V];
C2PlanarLayout layout = wView.layout();
size_t dstYStride = layout.planes[C2PlanarLayout::PLANE_Y].rowInc;
- size_t dstUVStride = layout.planes[C2PlanarLayout::PLANE_U].rowInc;
+ size_t dstUStride = layout.planes[C2PlanarLayout::PLANE_U].rowInc;
+ size_t dstVStride = layout.planes[C2PlanarLayout::PLANE_V].rowInc;
if (img->fmt == VPX_IMG_FMT_I42016) {
const uint16_t *srcY = (const uint16_t *)img->planes[VPX_PLANE_Y];
@@ -804,10 +805,10 @@ status_t C2SoftVpxDec::outputBuffer(
} else if (format == HAL_PIXEL_FORMAT_YCBCR_P010) {
convertYUV420Planar16ToP010((uint16_t *)dstY, (uint16_t *)dstU, srcY, srcU, srcV,
srcYStride / 2, srcUStride / 2, srcVStride / 2,
- dstYStride / 2, dstUVStride / 2, mWidth, mHeight);
+ dstYStride / 2, dstUStride / 2, mWidth, mHeight);
} else {
convertYUV420Planar16ToYV12(dstY, dstU, dstV, srcY, srcU, srcV, srcYStride / 2,
- srcUStride / 2, srcVStride / 2, dstYStride, dstUVStride,
+ srcUStride / 2, srcVStride / 2, dstYStride, dstUStride,
mWidth, mHeight);
}
} else {
@@ -816,7 +817,7 @@ status_t C2SoftVpxDec::outputBuffer(
const uint8_t *srcV = (const uint8_t *)img->planes[VPX_PLANE_V];
convertYUV420Planar8ToYV12(dstY, dstU, dstV, srcY, srcU, srcV, srcYStride, srcUStride,
- srcVStride, dstYStride, dstUVStride, mWidth, mHeight);
+ srcVStride, dstYStride, dstVStride, dstVStride, mWidth, mHeight);
}
finishWork(((c2_cntr64_t *)img->user_priv)->peekull(), work, std::move(block));
return OK;