Skip to content
Snippets Groups Projects
Commit 872964dc authored by Christian Helmrich's avatar Christian Helmrich
Browse files

fix for packed YUV output after RPR integration

parent 67d7720d
No related branches found
No related tags found
No related merge requests found
......@@ -472,7 +472,6 @@ static bool writePlane( uint32_t orgWidth, uint32_t orgHeight, ostream& fd, cons
const uint32_t height_file = height444 >> csy_file;
const bool writePYUV = (packedYUVOutputMode > 0) && (fileBitDepth == 10 || fileBitDepth == 12) && ((width_file & (1 + (fileBitDepth & 3))) == 0);
CHECK( writePYUV, "Not supported" );
CHECK( csx_file != csx_src, "Not supported" );
const uint32_t stride_file = writePYUV ? ( orgWidth * fileBitDepth ) >> ( csx_file + 3 ) : ( orgWidth * ( is16bit ? 2 : 1 ) ) >> csx_file;
......@@ -573,6 +572,26 @@ static bool writePlane( uint32_t orgWidth, uint32_t orgHeight, ostream& fd, cons
pSrcBuf += srcbuf_stride;
}
}
// here height444 and orgHeight are luma heights
for (uint32_t y444 = height444; y444 < orgHeight; y444++)
{
if ((y444 & mask_y_file) == 0) // if this is chroma, determine whether to skip every other row
{
memset (reinterpret_cast<char*>(buf), 0, stride_file); // TODO: is this correct? Should behave similarly to code block at end of this function
fd.write (reinterpret_cast<const char*>(buf), stride_file);
if (fd.eof() || fd.fail())
{
return false;
}
}
if ((y444 & mask_y_src) == 0)
{
pSrcBuf += srcbuf_stride;
}
}
}
else // !writePYUV
if (compID!=COMPONENT_Y && (fileFormat==CHROMA_400 || srcFormat==CHROMA_400))
......@@ -678,7 +697,6 @@ static bool writePlane( uint32_t orgWidth, uint32_t orgHeight, ostream& fd, cons
{
if( ( y444 & mask_y_file ) == 0 ) // if this is chroma, determine whether to skip every other row
{
if( !is16bit )
{
for( uint32_t x = 0; x < ( orgWidth >> csx_file ); x++ )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment