Loading media/codec2/components/aom/C2SoftAomDec.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -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]; Loading @@ -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 { Loading @@ -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; Loading media/codec2/components/base/SimpleC2Component.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; } Loading @@ -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; } } Loading media/codec2/components/base/include/SimpleC2Component.h +2 −2 Original line number Diff line number Diff line Loading @@ -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, Loading media/codec2/components/gav1/C2SoftGav1Dec.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -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]; Loading @@ -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 { Loading @@ -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; Loading media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading Loading
media/codec2/components/aom/C2SoftAomDec.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -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]; Loading @@ -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 { Loading @@ -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; Loading
media/codec2/components/base/SimpleC2Component.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; } Loading @@ -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; } } Loading
media/codec2/components/base/include/SimpleC2Component.h +2 −2 Original line number Diff line number Diff line Loading @@ -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, Loading
media/codec2/components/gav1/C2SoftGav1Dec.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -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]; Loading @@ -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 { Loading @@ -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; Loading
media/codec2/components/mpeg4_h263/C2SoftMpeg4Dec.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading