<?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 H.264Decoder returns corrupted images in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/H-264Decoder-returns-corrupted-images/m-p/915320#M15010</link>
    <description>&lt;P&gt;As I know, when we call GetFrame like&lt;/P&gt;
&lt;P&gt;GetFrame(NULL, out)&lt;/P&gt;
&lt;P&gt;The decoder will try to return a displayable image if possible.&lt;/P&gt;
&lt;P&gt;Since our application needs to limit the maximum number of compressed frames which can be passed to the decoder, we modified the sample application as follows.&lt;/P&gt;
&lt;P&gt;The basic idea is that we have a counter, say iNumInputSurraces, which counts that the input compressed surface the decoder is holding. When we read a new compressed frame, we increase the counter. When we decode a frame, we descrease the counter.&lt;/P&gt;
&lt;P&gt;When the counter reaches a limit, say, 32, we don't read any new data until the decoder returns a decoded frame and descrease the counter.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;However, we got corrupted images when we run the following modified application.&lt;/P&gt;
&lt;P&gt;It seems that the decoder returns partially decoded images when we stop giving new data during the midlle of decompression.&lt;/P&gt;
&lt;P&gt;Could you please give me some help about this? Thanks.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;int iNumInputSurfaces = 0;&lt;BR /&gt;bool bAllInputSurfacesUsed = false;&lt;/P&gt;
&lt;P&gt;int x =0;&lt;/P&gt;
&lt;P&gt;while(numDecodedFrames &amp;lt; numFramesToDecode)&lt;BR /&gt;{&lt;BR /&gt; if ((3 &amp;gt; in-&amp;gt;GetDataSize()) &amp;amp;&amp;amp;&lt;BR /&gt; (false == bEndOfStream))&lt;BR /&gt; {&lt;BR /&gt; &lt;FONT color="#800080"&gt;if (iNumInputSurfaces &amp;lt; 32)&lt;BR /&gt;&lt;/FONT&gt; {&lt;BR /&gt; Status statusHelper = splitter-&amp;gt;GetNextVideoData(*(in.get()));&lt;BR /&gt; if(UMC_OK != statusHelper){&lt;BR /&gt; bEndOfStream = true;}&lt;BR /&gt; &lt;BR /&gt;&lt;FONT color="#800080"&gt; iNumInputSurfaces++;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt; bAllInputSurfacesUsed = false;&lt;BR /&gt;&lt;/FONT&gt; &lt;BR /&gt; }&lt;BR /&gt;&lt;FONT color="#800080"&gt; else&lt;BR /&gt; {&lt;BR /&gt; bAllInputSurfacesUsed = true;&lt;BR /&gt; }&lt;BR /&gt;&lt;/FONT&gt; }&lt;/P&gt;
&lt;P&gt; if(!bInitialize)&lt;BR /&gt; {&lt;BR /&gt;&lt;BR /&gt; }&lt;BR /&gt; &lt;/P&gt;
&lt;P&gt; &lt;BR /&gt;&lt;FONT color="#ff1493"&gt;&lt;STRONG&gt; &lt;FONT color="#800080"&gt;Status ret = h264Decoder-&amp;gt;GetFrame(&lt;BR /&gt; (bEndOfStream | bAllInputSurfacesUsed) ? &lt;BR /&gt; (NULL) : (in.get()), out.get());&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; if (UMC_ERR_N
OT_ENOUGH_DATA == ret)&lt;BR /&gt; {&lt;BR /&gt; if (bEndOfStream)&lt;BR /&gt; break;&lt;BR /&gt; else&lt;BR /&gt; continue;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt; if (UMC_OK != ret)&lt;BR /&gt; continue;&lt;/P&gt;
&lt;P&gt; savedata(f_dst, out.get(), out-&amp;gt;GetWidth(), out-&amp;gt;GetHeight());&lt;BR /&gt; &lt;BR /&gt; numDecodedFrames++;&lt;/P&gt;
&lt;P&gt; &lt;FONT color="#800080"&gt;//release one input surface when a frame was outputed.&lt;BR /&gt; if (iNumInputSurfaces - 1 &amp;lt; 0)&lt;BR /&gt; {&lt;BR /&gt; _ASSERT(false);&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; iNumInputSurfaces--;&lt;BR /&gt; if (iNumInputSurfaces &amp;lt; iMaxNumInputSurfaces)&lt;BR /&gt; {&lt;BR /&gt; bAllInputSurfacesUsed = false;&lt;BR /&gt; }&lt;BR /&gt; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; }&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Feb 2008 16:02:12 GMT</pubDate>
    <dc:creator>shyaki</dc:creator>
    <dc:date>2008-02-29T16:02:12Z</dc:date>
    <item>
      <title>H.264Decoder returns corrupted images</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H-264Decoder-returns-corrupted-images/m-p/915320#M15010</link>
      <description>&lt;P&gt;As I know, when we call GetFrame like&lt;/P&gt;
&lt;P&gt;GetFrame(NULL, out)&lt;/P&gt;
&lt;P&gt;The decoder will try to return a displayable image if possible.&lt;/P&gt;
&lt;P&gt;Since our application needs to limit the maximum number of compressed frames which can be passed to the decoder, we modified the sample application as follows.&lt;/P&gt;
&lt;P&gt;The basic idea is that we have a counter, say iNumInputSurraces, which counts that the input compressed surface the decoder is holding. When we read a new compressed frame, we increase the counter. When we decode a frame, we descrease the counter.&lt;/P&gt;
&lt;P&gt;When the counter reaches a limit, say, 32, we don't read any new data until the decoder returns a decoded frame and descrease the counter.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;However, we got corrupted images when we run the following modified application.&lt;/P&gt;
&lt;P&gt;It seems that the decoder returns partially decoded images when we stop giving new data during the midlle of decompression.&lt;/P&gt;
&lt;P&gt;Could you please give me some help about this? Thanks.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;int iNumInputSurfaces = 0;&lt;BR /&gt;bool bAllInputSurfacesUsed = false;&lt;/P&gt;
&lt;P&gt;int x =0;&lt;/P&gt;
&lt;P&gt;while(numDecodedFrames &amp;lt; numFramesToDecode)&lt;BR /&gt;{&lt;BR /&gt; if ((3 &amp;gt; in-&amp;gt;GetDataSize()) &amp;amp;&amp;amp;&lt;BR /&gt; (false == bEndOfStream))&lt;BR /&gt; {&lt;BR /&gt; &lt;FONT color="#800080"&gt;if (iNumInputSurfaces &amp;lt; 32)&lt;BR /&gt;&lt;/FONT&gt; {&lt;BR /&gt; Status statusHelper = splitter-&amp;gt;GetNextVideoData(*(in.get()));&lt;BR /&gt; if(UMC_OK != statusHelper){&lt;BR /&gt; bEndOfStream = true;}&lt;BR /&gt; &lt;BR /&gt;&lt;FONT color="#800080"&gt; iNumInputSurfaces++;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080"&gt; bAllInputSurfacesUsed = false;&lt;BR /&gt;&lt;/FONT&gt; &lt;BR /&gt; }&lt;BR /&gt;&lt;FONT color="#800080"&gt; else&lt;BR /&gt; {&lt;BR /&gt; bAllInputSurfacesUsed = true;&lt;BR /&gt; }&lt;BR /&gt;&lt;/FONT&gt; }&lt;/P&gt;
&lt;P&gt; if(!bInitialize)&lt;BR /&gt; {&lt;BR /&gt;&lt;BR /&gt; }&lt;BR /&gt; &lt;/P&gt;
&lt;P&gt; &lt;BR /&gt;&lt;FONT color="#ff1493"&gt;&lt;STRONG&gt; &lt;FONT color="#800080"&gt;Status ret = h264Decoder-&amp;gt;GetFrame(&lt;BR /&gt; (bEndOfStream | bAllInputSurfacesUsed) ? &lt;BR /&gt; (NULL) : (in.get()), out.get());&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; if (UMC_ERR_N
OT_ENOUGH_DATA == ret)&lt;BR /&gt; {&lt;BR /&gt; if (bEndOfStream)&lt;BR /&gt; break;&lt;BR /&gt; else&lt;BR /&gt; continue;&lt;BR /&gt; }&lt;/P&gt;
&lt;P&gt; if (UMC_OK != ret)&lt;BR /&gt; continue;&lt;/P&gt;
&lt;P&gt; savedata(f_dst, out.get(), out-&amp;gt;GetWidth(), out-&amp;gt;GetHeight());&lt;BR /&gt; &lt;BR /&gt; numDecodedFrames++;&lt;/P&gt;
&lt;P&gt; &lt;FONT color="#800080"&gt;//release one input surface when a frame was outputed.&lt;BR /&gt; if (iNumInputSurfaces - 1 &amp;lt; 0)&lt;BR /&gt; {&lt;BR /&gt; _ASSERT(false);&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; iNumInputSurfaces--;&lt;BR /&gt; if (iNumInputSurfaces &amp;lt; iMaxNumInputSurfaces)&lt;BR /&gt; {&lt;BR /&gt; bAllInputSurfacesUsed = false;&lt;BR /&gt; }&lt;BR /&gt; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; }&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Feb 2008 16:02:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H-264Decoder-returns-corrupted-images/m-p/915320#M15010</guid>
      <dc:creator>shyaki</dc:creator>
      <dc:date>2008-02-29T16:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: H.264Decoder returns corrupted images</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H-264Decoder-returns-corrupted-images/m-p/915321#M15011</link>
      <description>&lt;P&gt;You can't do like this with H.264 decoder. The number of buffered frames depends on stream characteristics. Trying directly limit number of buffred frames you break the decoder work logic.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt; Vladimir&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2008 05:15:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H-264Decoder-returns-corrupted-images/m-p/915321#M15011</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2008-03-07T05:15:59Z</dc:date>
    </item>
  </channel>
</rss>

