Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Why not RGB?

kenchan32
Beginner
324 Views

Hi,

I am using IPP to decode Mpeg4 data. I have checked the discussions and make one same as them.

InitilizeMpeg4Decoder(char *pIFrameData, int nFrameSize)

{

m_video_info.color_format= YUV420;
m_video_info.stream_type= MPEG4_VIDEO;
m_video_info.stream_subtype= UNDEF_VIDEO_SUBTYPE;
m_video_info.clip_info.width= 0;
m_video_info.clip_info.height= 0;

ColorConversionInfo ColorInit;
ColorInit.SizeSource.width= m_video_info.clip_info.width;
ColorInit.SizeSource.height = m_video_info.clip_info.height;
ColorInit.FormatDest= YUV420;
ColorInit.SizeDest.width= m_video_info.clip_info.width;
ColorInit.SizeDest.height= m_video_info.clip_info.height;
ColorInit.lFlags= 1;
ColorInit.lDeinterlace= 0;
ColorInit.lInterpolation= FLAG_CCNV_CONVERT;// FLAG_CCNV_NONE;// FLAG_CCNV_CONVERT;


m_InMediaData.SetBufferPointer((vm_byte*)pIFrameData,nFrameSize );

m_VideoDecoderParams.info = m_video_info;
m_VideoDecoderParams.cformat = RGB24;
m_VideoDecoderParams.lFlags = FLAG_VDEC_UVMERGED | FLAG_VDEC_REORDER;//0;//UMC::FLAG_VDEC_UVMERGED;//;// UMC::FLAG_VDEC_UVMERGED | UMC::FLAG_VDEC_REORDER;

m_VideoDecoderParams.lpConverter = &m_ColorDecoder;
m_VideoDecoderParams.lpConvertInit = &ColorInit;
m_VideoDecoderParams.uiLimitThreads = 0;
m_VideoDecoderParams.m_pData = &m_InMediaData;

Status status = m_Mpeg4Decoder.Init( &m_VideoDecoderParams );
if( UMC_OK == status )
{
m_videoWidth = m_VideoDecoderParams.info.clip_info.width;
m_videoHeight = m_VideoDecoderParams.info.clip_info.height;
}

m_pOutBMPBuf = new BYTE[ (m_videoWidth* m_videoHeight * 3) + 1024 ];
m_pOutBuf = new BYTE[ (m_videoWidth* m_videoHeight * 3) ];
m_OutVideoData.SetVideoParameters( m_videoWidth, m_videoHeight, DEST_C_FORMAT );
m_OutVideoData.Init( m_videoWidth, m_videoHeight, DEST_C_FORMAT );
m_nOutLen = m_OutVideoData.m_lPitch[0] * m_videoHeight;
m_OutVideoData.SetBufferPointer( (vm_byte*)m_pOutBuf, m_nOutLen );
}

bool DecodeVideoFrame( char *pVideoData, unsigned int nDataLen )
{
if( !m_bInitialized )
{
m_bInitialized = true;
InitilizeMpeg4Decoder( pVideoData, nDataLen );
}


m_InMediaData.SetBufferPointer( (vm_byte*)pVideoData, nDataLen );
m_InMediaData.SetDataSize( nDataLen );
umcRes = m_Mpeg4Decoder.GetFrame( &m_InMediaData, &m_OutVideoData );

if(umcRes != UMC_OK && umcRes != UMC_NOT_ENOUGH_DATA)
return false;
if(umcRes == UMC_NOT_ENOUGH_DATA)
return false;
if(umcRes == UMC_OK)
return true;
return false;
}

DecodeVideoFrame( pInBuf, Len );

After DecodeVideoFrame, pInBuf filled by bbbbbbbbrrrrrrrrgggggggg

I had try to change the ippiYCbCr420ToBGR_8u_P3C3R to ippiYCbCr420ToRGB_8u_P3C3R in the umc_color_space_converter_yv12.cpp

But I get rrrrrrrrbbbbbbbbgggggggg, did I do anything wrong?

Beside this, the CPU performance seems not so good? event I run the program on Core to duo with v8 dlls, it still costs CPU 50 -70 %.

My Video resolution id 720 x 480 30 FPS.

Please help me. thanks in advaced

0 Kudos
2 Replies
Vladimir_Dudnik
Employee
324 Views

Hello,

could you please specify what version of IPP do you use (there were some changes). Could try this on the latest IPP v5.2 beta (if you did not yet)?

Regards,
Vladimir

0 Kudos
kenchan32
Beginner
324 Views

thanks for reply,

I did to use 5.2.

But I got the same result.

0 Kudos
Reply