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

Commit 3d0a45ca authored by Danny Fernandes's avatar Danny Fernandes Committed by Android Git Automerger
Browse files

am ca87261a: Fixed 3423072 Imported 1080x720 video clips present distorted view

* commit 'ca87261a03e1683dfd9b6e93a187c70a52eeead4':
  Fixed 3423072 Imported 1080x720 video clips present distorted view
parents 651affdc 5eae88ab
Loading
Loading
Loading
Loading
+41 −8
Original line number Diff line number Diff line
@@ -1374,6 +1374,9 @@ M4OSA_ERR VideoEditorVideoDecoder_decode(M4OSA_Context context,
                int32_t uvPlaneSize = width * height / 4;
                int32_t offsetSrc = 0;

                if (( width == pDecShellContext->mGivenWidth )  &&
                    ( height == pDecShellContext->mGivenHeight ))
                {
                    M4OSA_MemAddr8 pTmpBuff = (M4OSA_MemAddr8)pDecoderBuffer->data() + pDecoderBuffer->range_offset();

                    M4OSA_memcpy((M4OSA_MemAddr8)tmpDecBuffer->pData, pTmpBuff, yPlaneSize);
@@ -1385,6 +1388,36 @@ M4OSA_ERR VideoEditorVideoDecoder_decode(M4OSA_Context context,
                    offsetSrc += (pDecShellContext->mGivenWidth >> 1) * (pDecShellContext->mGivenHeight >> 1);
                    M4OSA_memcpy((M4OSA_MemAddr8)tmpDecBuffer->pData + yPlaneSize + uvPlaneSize,
                        pTmpBuff + offsetSrc, uvPlaneSize);
                }
                else
                {
                    M4OSA_MemAddr8 pTmpBuff = (M4OSA_MemAddr8)pDecoderBuffer->data() + pDecoderBuffer->range_offset();
                    M4OSA_MemAddr8 pTmpBuffDst = (M4OSA_MemAddr8)tmpDecBuffer->pData;
                    int32_t index;

                    for ( index = 0; index < height; index++)
                    {
                        memcpy(pTmpBuffDst, pTmpBuff, width);
                        pTmpBuffDst += width;
                        pTmpBuff += pDecShellContext->mGivenWidth;
                    }

                    pTmpBuff += (pDecShellContext->mGivenWidth * ( pDecShellContext->mGivenHeight - height));
                    for ( index = 0; index < height >> 1; index++)
                    {
                        memcpy(pTmpBuffDst, pTmpBuff, width >> 1);
                        pTmpBuffDst += width >> 1;
                        pTmpBuff += pDecShellContext->mGivenWidth >> 1;
                    }

                    pTmpBuff += ((pDecShellContext->mGivenWidth * (pDecShellContext->mGivenHeight - height)) / 4);
                    for ( index = 0; index < height >> 1; index++)
                    {
                        memcpy(pTmpBuffDst, pTmpBuff, width >> 1);
                        pTmpBuffDst += width >> 1;
                        pTmpBuff += pDecShellContext->mGivenWidth >> 1;
                    }
                }

                break;
            }