Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 698e2f2e authored by Aayush Soni's avatar Aayush Soni Committed by Fyodor Kyslov
Browse files

C2SoftAomEnc: Fix encoding issues with 10bit av1 clips

Address for V component was wrongly computed for P010 case and the
source strides weren't used correctly.

Bug: 267373580
Test: atest android.mediav2.cts.CodecEncoderSurfaceTest \
   android.videocodec.cts.VideoEncoderTest

Change-Id: Icce1090243e8c6c73b6c6dfe142c47e48b3e15d8
parent a554a792
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -774,10 +774,12 @@ void C2SoftAomEnc::process(const std::unique_ptr<C2Work>& work,
                    if (mConversionBuffer.size() >= stride * vstride * 3) {
                        uint16_t *dstY, *dstU, *dstV;
                        dstY = (uint16_t*)mConversionBuffer.data();
                        dstU = ((uint16_t*)mConversionBuffer.data()) + stride * vstride;
                        dstV = ((uint16_t*)mConversionBuffer.data()) + (stride * vstride) / 4;
                        dstU = dstY + stride * vstride;
                        dstV = dstU + (stride * vstride) / 4;
                        convertP010ToYUV420Planar16(dstY, dstU, dstV, (uint16_t*)(rView->data()[0]),
                                                    (uint16_t*)(rView->data()[1]), stride, stride,
                                                    (uint16_t*)(rView->data()[1]),
                                                    layout.planes[layout.PLANE_Y].rowInc / 2,
                                                    layout.planes[layout.PLANE_U].rowInc / 2,
                                                    stride, stride / 2, stride / 2, stride,
                                                    vstride);
                        aom_img_wrap(&raw_frame, AOM_IMG_FMT_I42016, stride, vstride, mStrideAlign,