<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Can only get black frames from the h.264 decoder. in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Can-only-get-black-frames-from-the-h-264-decoder/m-p/885088#M10682</link>
    <description>&lt;FONT size="3"&gt;&lt;FONT face="Times New Roman"&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;I'm trying to integrate the ipp h.264 decoder into our application. I get frame data from an RTP stream. All I can get out of the decoder are black frames (all 0's) where I expect an RGB32 formatted array of bytes. In the debugger the return value from "GetFrame" is UMC_OK, so I assume the decoder was able to decode a frame. &lt;BR /&gt;&lt;BR /&gt;We also use libavcodec (ffmpeg) which seems to work fine, so we're pretty sure it's not bad input data. I've recorded a chunk of video data to a file and played it with the simple_player application. It appears to decode just fine based on the statistics output.&lt;BR /&gt;&lt;BR /&gt;Choice bits of the code are below. Any help is appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;bool ScIppH264Decoder::initialize(int width, int height)&lt;BR /&gt;{&lt;BR /&gt;  //-- Create video input buffer.&lt;BR /&gt;  m_in_buf = new UMC::MediaData();&lt;BR /&gt;&lt;BR /&gt;  //-- Create output buffer.&lt;BR /&gt;  m_out_buf = new UMC::VideoData();&lt;BR /&gt;  m_out_buf-&amp;gt;Init(width, height, UMC::RGB32);&lt;BR /&gt;  m_out_buf-&amp;gt;InitAlloc(width, height, UMC::RGB32);&lt;BR /&gt;  m_out_buf-&amp;gt;SetColorFormat(UMC::RGB32);&lt;BR /&gt;  m_out_buf-&amp;gt;SetFrameType(UMC::P_PICTURE);&lt;BR /&gt;&lt;BR /&gt;  //-- Create decoder.&lt;BR /&gt;  m_decoder = new UMC::H264VideoDecoder();&lt;BR /&gt;  if (m_decoder == NULL)&lt;BR /&gt;  {&lt;BR /&gt;    return false;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  UMC::ColorConversionInfo *colorParams = new UMC::ColorConversionInfo();&lt;BR /&gt;  colorParams-&amp;gt;FormatDest = UMC::RGB32;&lt;BR /&gt;  colorParams-&amp;gt;SizeSource.width = width;&lt;BR /&gt;  colorParams-&amp;gt;SizeSource.height = height;&lt;BR /&gt;  colorParams-&amp;gt;SizeDest.width = width;&lt;BR /&gt;  colorParams-&amp;gt;SizeDest.height = height;&lt;BR /&gt;  colorParams-&amp;gt;lFlags = UMC::FLAG_CCNV_NONE;&lt;BR /&gt;  colorParams-&amp;gt;lDeinterlace = 0;&lt;BR /&gt;  colorParams-&amp;gt;lInterpolation = IPPI_INTER_NN;&lt;BR /&gt;&lt;BR /&gt;  UMC::VideoDecoderParams *params = new UMC::VideoDecoderParams();&lt;BR /&gt;  params-&amp;gt;m_pData = m_in_buf;&lt;BR /&gt;  params-&amp;gt;cformat = UMC::RGB32;&lt;BR /&gt;  params-&amp;gt;lFlags = UMC::FLAG_VDEC_NO_PREVIEW | UMC::FLAG_VDEC_COMPATIBLE | UMC::FLAG_VDEC_REORDER;&lt;BR /&gt;  params-&amp;gt;lpConverter = new TimedColorConverter();&lt;BR /&gt;  params-&amp;gt;lpConvertInit = colorParams;&lt;BR /&gt;  params-&amp;gt;uiLimitThreads = 1;&lt;BR /&gt;&lt;BR /&gt;  if (m_decoder-&amp;gt;Init(params) != UMC::UMC_OK)&lt;BR /&gt;  {&lt;BR /&gt;    return false;&lt;BR /&gt;  }&lt;BR /&gt;  &lt;BR /&gt;  return true;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int ScIppH264Decoder::getImage(unsigned char **ptrDecodeImage)&lt;BR /&gt;{&lt;BR /&gt;  *ptrDecodeImage = (unsigned char*) m_out_buf-&amp;gt;GetDataPointer();&lt;BR /&gt;  return m_out_buf-&amp;gt;GetDataSize();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int ScIppH264Decoder::decode(int width, int height, unsigned char *buf, int bufSize, bool *gotImage)&lt;BR /&gt;{&lt;BR /&gt;  if (!m_initialized)&lt;BR /&gt;  {&lt;BR /&gt;    if (!(m_initialized = initialize(width, height)))&lt;BR /&gt;    {&lt;BR /&gt;      *gotImage = false;&lt;BR /&gt;      return -1;&lt;BR /&gt;    }&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  if ((bufSize == 0) || (buf == NULL))&lt;BR /&gt;  {&lt;BR /&gt;    *gotImage = false;&lt;BR /&gt;    return -1;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  m_in_buf-&amp;gt;SetBufferPointer(buf, bufSize);&lt;BR /&gt;  m_in_buf-&amp;gt;SetDataSize(bufSize);&lt;BR /&gt;  UMC::Status decStatus = UMC::UMC_OK;&lt;BR /&gt;&lt;BR /&gt;  do&lt;BR /&gt;  {&lt;BR /&gt;    decStatus = m_decoder-&amp;gt;GetFrame(m_in_buf, m_out_buf);&lt;BR /&gt;  }&lt;BR /&gt;  while ((decStatus != UMC::UMC_NOT_ENOUGH_DATA) &amp;amp;&amp;amp;&lt;BR /&gt;    (decStatus != UMC::UMC_OK));&lt;BR /&gt;&lt;BR /&gt;  if (decStatus == UMC::UMC_NOT_ENOUGH_DATA)&lt;BR /&gt;  {&lt;BR /&gt;    *gotImage = false;&lt;BR /&gt;    return bufSize;&lt;BR /&gt;  }&lt;BR /&gt;  else if (decStatus == UMC::UMC_OK)&lt;BR /&gt;  {&lt;BR /&gt;    *gotImage = true;&lt;BR /&gt;    return bufSize;&lt;BR /&gt;  }&lt;BR /&gt;  else&lt;BR /&gt;  {&lt;BR /&gt;    *gotImage = false;&lt;BR /&gt;    return -1;&lt;BR /&gt;  
}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 20 May 2008 21:47:03 GMT</pubDate>
    <dc:creator>lycono</dc:creator>
    <dc:date>2008-05-20T21:47:03Z</dc:date>
    <item>
      <title>Can only get black frames from the h.264 decoder.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Can-only-get-black-frames-from-the-h-264-decoder/m-p/885088#M10682</link>
      <description>&lt;FONT size="3"&gt;&lt;FONT face="Times New Roman"&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;I'm trying to integrate the ipp h.264 decoder into our application. I get frame data from an RTP stream. All I can get out of the decoder are black frames (all 0's) where I expect an RGB32 formatted array of bytes. In the debugger the return value from "GetFrame" is UMC_OK, so I assume the decoder was able to decode a frame. &lt;BR /&gt;&lt;BR /&gt;We also use libavcodec (ffmpeg) which seems to work fine, so we're pretty sure it's not bad input data. I've recorded a chunk of video data to a file and played it with the simple_player application. It appears to decode just fine based on the statistics output.&lt;BR /&gt;&lt;BR /&gt;Choice bits of the code are below. Any help is appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;bool ScIppH264Decoder::initialize(int width, int height)&lt;BR /&gt;{&lt;BR /&gt;  //-- Create video input buffer.&lt;BR /&gt;  m_in_buf = new UMC::MediaData();&lt;BR /&gt;&lt;BR /&gt;  //-- Create output buffer.&lt;BR /&gt;  m_out_buf = new UMC::VideoData();&lt;BR /&gt;  m_out_buf-&amp;gt;Init(width, height, UMC::RGB32);&lt;BR /&gt;  m_out_buf-&amp;gt;InitAlloc(width, height, UMC::RGB32);&lt;BR /&gt;  m_out_buf-&amp;gt;SetColorFormat(UMC::RGB32);&lt;BR /&gt;  m_out_buf-&amp;gt;SetFrameType(UMC::P_PICTURE);&lt;BR /&gt;&lt;BR /&gt;  //-- Create decoder.&lt;BR /&gt;  m_decoder = new UMC::H264VideoDecoder();&lt;BR /&gt;  if (m_decoder == NULL)&lt;BR /&gt;  {&lt;BR /&gt;    return false;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  UMC::ColorConversionInfo *colorParams = new UMC::ColorConversionInfo();&lt;BR /&gt;  colorParams-&amp;gt;FormatDest = UMC::RGB32;&lt;BR /&gt;  colorParams-&amp;gt;SizeSource.width = width;&lt;BR /&gt;  colorParams-&amp;gt;SizeSource.height = height;&lt;BR /&gt;  colorParams-&amp;gt;SizeDest.width = width;&lt;BR /&gt;  colorParams-&amp;gt;SizeDest.height = height;&lt;BR /&gt;  colorParams-&amp;gt;lFlags = UMC::FLAG_CCNV_NONE;&lt;BR /&gt;  colorParams-&amp;gt;lDeinterlace = 0;&lt;BR /&gt;  colorParams-&amp;gt;lInterpolation = IPPI_INTER_NN;&lt;BR /&gt;&lt;BR /&gt;  UMC::VideoDecoderParams *params = new UMC::VideoDecoderParams();&lt;BR /&gt;  params-&amp;gt;m_pData = m_in_buf;&lt;BR /&gt;  params-&amp;gt;cformat = UMC::RGB32;&lt;BR /&gt;  params-&amp;gt;lFlags = UMC::FLAG_VDEC_NO_PREVIEW | UMC::FLAG_VDEC_COMPATIBLE | UMC::FLAG_VDEC_REORDER;&lt;BR /&gt;  params-&amp;gt;lpConverter = new TimedColorConverter();&lt;BR /&gt;  params-&amp;gt;lpConvertInit = colorParams;&lt;BR /&gt;  params-&amp;gt;uiLimitThreads = 1;&lt;BR /&gt;&lt;BR /&gt;  if (m_decoder-&amp;gt;Init(params) != UMC::UMC_OK)&lt;BR /&gt;  {&lt;BR /&gt;    return false;&lt;BR /&gt;  }&lt;BR /&gt;  &lt;BR /&gt;  return true;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int ScIppH264Decoder::getImage(unsigned char **ptrDecodeImage)&lt;BR /&gt;{&lt;BR /&gt;  *ptrDecodeImage = (unsigned char*) m_out_buf-&amp;gt;GetDataPointer();&lt;BR /&gt;  return m_out_buf-&amp;gt;GetDataSize();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int ScIppH264Decoder::decode(int width, int height, unsigned char *buf, int bufSize, bool *gotImage)&lt;BR /&gt;{&lt;BR /&gt;  if (!m_initialized)&lt;BR /&gt;  {&lt;BR /&gt;    if (!(m_initialized = initialize(width, height)))&lt;BR /&gt;    {&lt;BR /&gt;      *gotImage = false;&lt;BR /&gt;      return -1;&lt;BR /&gt;    }&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  if ((bufSize == 0) || (buf == NULL))&lt;BR /&gt;  {&lt;BR /&gt;    *gotImage = false;&lt;BR /&gt;    return -1;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  m_in_buf-&amp;gt;SetBufferPointer(buf, bufSize);&lt;BR /&gt;  m_in_buf-&amp;gt;SetDataSize(bufSize);&lt;BR /&gt;  UMC::Status decStatus = UMC::UMC_OK;&lt;BR /&gt;&lt;BR /&gt;  do&lt;BR /&gt;  {&lt;BR /&gt;    decStatus = m_decoder-&amp;gt;GetFrame(m_in_buf, m_out_buf);&lt;BR /&gt;  }&lt;BR /&gt;  while ((decStatus != UMC::UMC_NOT_ENOUGH_DATA) &amp;amp;&amp;amp;&lt;BR /&gt;    (decStatus != UMC::UMC_OK));&lt;BR /&gt;&lt;BR /&gt;  if (decStatus == UMC::UMC_NOT_ENOUGH_DATA)&lt;BR /&gt;  {&lt;BR /&gt;    *gotImage = false;&lt;BR /&gt;    return bufSize;&lt;BR /&gt;  }&lt;BR /&gt;  else if (decStatus == UMC::UMC_OK)&lt;BR /&gt;  {&lt;BR /&gt;    *gotImage = true;&lt;BR /&gt;    return bufSize;&lt;BR /&gt;  }&lt;BR /&gt;  else&lt;BR /&gt;  {&lt;BR /&gt;    *gotImage = false;&lt;BR /&gt;    return -1;&lt;BR /&gt;  
}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 May 2008 21:47:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Can-only-get-black-frames-from-the-h-264-decoder/m-p/885088#M10682</guid>
      <dc:creator>lycono</dc:creator>
      <dc:date>2008-05-20T21:47:03Z</dc:date>
    </item>
  </channel>
</rss>

