void ExpandReferencingPicture (SPicture* pPic, PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChrom[2]) { /*local variable*/ uint8_t* pPicY = pPic->pData[0]; uint8_t* pPicCb = pPic->pData[1]; uint8_t* pPicCr = pPic->pData[2]; const int32_t kiWidthY = pPic->iWidthInPixel; const int32_t kiHeightY = pPic->iHeightInPixel; const int32_t kiWidthUV = kiWidthY >> 1; const int32_t kiHeightUV = kiHeightY >> 1; pExpLuma (pPicY, pPic->iLineSize[0], kiWidthY, kiHeightY); if (kiWidthUV >= 16) { // fix coding picture size as 16x16 const bool kbChrAligned = /*(iWidthUV >= 16) && */ ((kiWidthUV & 0x0F) == 0); // chroma planes: (16+iWidthUV) & 15 pExpChrom[kbChrAligned] (pPicCb, pPic->iLineSize[1], kiWidthUV, kiHeightUV); pExpChrom[kbChrAligned] (pPicCr, pPic->iLineSize[2], kiWidthUV, kiHeightUV); } else { // fix coding picture size as 16x16 ExpandPictureChroma_c (pPicCb, pPic->iLineSize[1], kiWidthUV, kiHeightUV); ExpandPictureChroma_c (pPicCr, pPic->iLineSize[2], kiWidthUV, kiHeightUV); } }
//void ExpandReferencingPicture (SPicture* pPic, PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChrom[2]) { void ExpandReferencingPicture (uint8_t* pData[3], int32_t iWidth, int32_t iHeight, int32_t iStride[3], PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChrom[2]) { /*local variable*/ uint8_t* pPicY = pData[0]; uint8_t* pPicCb = pData[1]; uint8_t* pPicCr = pData[2]; const int32_t kiWidthY = iWidth; const int32_t kiHeightY = iHeight; const int32_t kiWidthUV = kiWidthY >> 1; const int32_t kiHeightUV = kiHeightY >> 1; pExpLuma (pPicY, iStride[0], kiWidthY, kiHeightY); if (kiWidthUV >= 16) { // fix coding picture size as 16x16 const bool kbChrAligned = /*(iWidthUV >= 16) && */ ((kiWidthUV & 0x0F) == 0); // chroma planes: (16+iWidthUV) & 15 pExpChrom[kbChrAligned] (pPicCb, iStride[1], kiWidthUV, kiHeightUV); pExpChrom[kbChrAligned] (pPicCr, iStride[2], kiWidthUV, kiHeightUV); } else { // fix coding picture size as 16x16 ExpandPictureChroma_c (pPicCb, iStride[1], kiWidthUV, kiHeightUV); ExpandPictureChroma_c (pPicCr, iStride[2], kiWidthUV, kiHeightUV); } }