Fix FrameMask and minor bug fixes in PlaYUVerFrame

This commit is contained in:
jfmcarreira committed 2016-03-10 02:38:35 +00:00
1 parent 7ddf3c0a6d
commit e38ba03f65
8 files changed
+71 -17

No files matched your search

+6 -3
View File
@@ -173,7 +173,8 @@ Void PlaYUVerFrame::init( UInt width, UInt height, Int pel_format, Int bitsPixel
m_iPixelFormat = pel_format;
m_iNumberChannels = 3;
m_uiBitsPel = bitsPixel > 8 ? bitsPixel : 8;
m_uiHalfPelValue = 1 << ( m_uiBitsPel - 1 );
if( m_uiWidth == 0 || m_uiHeight == 0 || m_iPixelFormat == -1 || bitsPixel > 16 )
{
throw "Cannot create a PlYUVerFrame of this type";
@@ -238,6 +239,8 @@ Bool PlaYUVerFrame::haveSameFmt( PlaYUVerFrame* other, UInt match ) const
bRet &= ( getPelFormat() == other->getPelFormat() );
if( match & MATCH_BITS )
bRet &= ( getBitsPel() == other->getBitsPel() );
if( match & MATCH_COLOR_SPACE_IGNORE_GRAY )
bRet &= ( getColorSpace() == PlaYUVerPixel::COLOR_GRAY || getColorSpace() == other->getColorSpace() );
}
else
{
@@ -320,7 +323,7 @@ UInt PlaYUVerFrame::getChromaSize() const
PlaYUVerPixel PlaYUVerFrame::getPixelValue( Int xPos, Int yPos )
{
PlaYUVerPixel PixelValue( m_pcPelFormat->colorSpace, 0, 0, 0 );
PlaYUVerPixel PixelValue( m_pcPelFormat->colorSpace, m_uiHalfPelValue, m_uiHalfPelValue, m_uiHalfPelValue );
for( UInt ch = 0; ch < m_pcPelFormat->numberChannels; ch++ )
{
Int ratioH = ch > 0 ? m_pcPelFormat->log2ChromaWidth : 0;
@@ -332,7 +335,7 @@ PlaYUVerPixel PlaYUVerFrame::getPixelValue( Int xPos, Int yPos )
PlaYUVerPixel PlaYUVerFrame::getPixelValue( Int xPos, Int yPos, PlaYUVerPixel::ColorSpace eColorSpace )
{
PlaYUVerPixel PixelValue( m_pcPelFormat->colorSpace, 0, 0, 0 );
PlaYUVerPixel PixelValue( m_pcPelFormat->colorSpace );
for( UInt ch = 0; ch < m_pcPelFormat->numberChannels; ch++ )
{
Int ratioH = ch > 0 ? m_pcPelFormat->log2ChromaWidth : 0;
+5 -3
View File
@@ -56,16 +56,16 @@ class PlaYUVerFrame
{
public:
/** ColorSpace Enum
* List of supported pixel formats (deprecated)
/** ColorSpace Enum (deprecated)
* List of supported pixel formats - do not change order
*/
enum PixelFormats
{
NO_FMT = -1,
YUV420p = 0,
YUV444p,
YUV422p,
YUYV422,
YUV444p,
GRAY,
RGB24,
BRG24,
@@ -80,6 +80,7 @@ public:
MATCH_RESOLUTION = 2,
MATCH_PEL_FMT = 4,
MATCH_BITS = 8,
MATCH_COLOR_SPACE_IGNORE_GRAY = 16,
MATCH_ALL = 0xFFFF,
};
@@ -296,6 +297,7 @@ private:
Int m_iPixelFormat; //!< Pixel format number (it follows the list of supported pixel formats)
Int m_iNumberChannels; //!< Number of channels
UInt m_uiBitsPel; //!< Bits per pixel/channel
UInt m_uiHalfPelValue; //!< Bits per pixel/channel
Pel*** m_pppcInputPel;
+9
View File
@@ -40,6 +40,15 @@ PlaYUVerPixel::PlaYUVerPixel()
PixelComponents[3] = 0;
}
PlaYUVerPixel::PlaYUVerPixel( Int ColorSpace )
{
m_iColorSpace = ColorSpace == COLOR_GRAY ? COLOR_YUV : ColorSpace;
PixelComponents[0] = 0;
PixelComponents[1] = 0;
PixelComponents[2] = 0;
PixelComponents[3] = 0;
}
PlaYUVerPixel::PlaYUVerPixel( Int ColorSpace, Pel c0, Pel c1, Pel c2 )
{
m_iColorSpace = ColorSpace == COLOR_GRAY ? COLOR_YUV : ColorSpace;
+1
View File
@@ -74,6 +74,7 @@ public:
};
PlaYUVerPixel();
PlaYUVerPixel( Int ColorSpace );
PlaYUVerPixel( Int ColorSpace, Pel c0, Pel c1, Pel c2 );
Int ColorSpaceType()