<?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 Re: MPEG4 decoding in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4-decoding/m-p/869370#M8729</link>
    <description>&lt;P&gt;Package ID: w_ipp-sample-media_p_5.1.007&lt;BR /&gt;Package Contents: Intel IPP Media Processing Samples for Windows*&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I have almost figured out what I'm doing. It looks like after the MPEG4 init call, I need to call &lt;FONT size="2"&gt;&lt;FONT size="3"&gt;MoveDataPointer before decoding the first frame. If there is not enough data in the buffer to decode a full frame, will I need to call MoveDataPointer before trying again? I.e.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;//dataptr == bufferptr&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;getFrame() //fails (returns what?)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;dataptr = GetDataPointer()&lt;/P&gt;
&lt;P&gt;//copy more data to buffer&lt;/P&gt;
&lt;P&gt;MoveDataPointer(GetBufferPointer() - dataptr)&lt;/P&gt;
&lt;P&gt;getFrame() //success?&lt;/P&gt;
&lt;P&gt;//copy end back to start&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;I'm still wondering why the color converter chooses the wrong routine.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;------------&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;There is another issue. It seems if there is not enough data, at least the first time, to decode a frame, getFrame return UMC_OK. How do I know if the output image is valid?&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Apr 2007 19:52:25 GMT</pubDate>
    <dc:creator>goldfita</dc:creator>
    <dc:date>2007-04-19T19:52:25Z</dc:date>
    <item>
      <title>MPEG4 decoding</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4-decoding/m-p/869368#M8727</link>
      <description>&lt;P&gt;I am using this example but need some help.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.intel.com/en-us/forums//topic/51651"&gt;http://software.intel.com/en-us/forums//topic/51651&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Please forgive the messiness. It's a work in progress.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;FONT size="2"&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;#define&lt;/FONT&gt;&lt;FONT size="2"&gt; vidW 640&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;#define&lt;/FONT&gt;&lt;FONT size="2"&gt; vidH 480&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;#define&lt;/FONT&gt;&lt;FONT size="2"&gt; BUF_SIZE 640*480*2*3&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;#define&lt;/FONT&gt;&lt;FONT size="2"&gt; MIN_SIZE 100000 &lt;P&gt;&lt;/P&gt;
&lt;P&gt;UMC::VideoDecoderParams VDecParams;&lt;/P&gt;
&lt;P&gt;UMC::ColorConversionInfo ColorInit;&lt;/P&gt;
&lt;P&gt;UMC::MediaData dataIn;&lt;/P&gt;
&lt;P&gt;UMC::VideoData dataOut;&lt;/P&gt;
&lt;P&gt;UMC::ColorSpaceConverter rColorConverter;&lt;/P&gt;
&lt;P&gt;UMC::Status umcRes = UMC::UMC_OK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;unsigned&lt;/FONT&gt;&lt;FONT size="2"&gt; &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;char&lt;/FONT&gt;&lt;FONT size="2"&gt; *start = pData;&lt;/FONT&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;
&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size="2"&gt;dataIn.SetBufferPointer(pData,dataLength);&lt;P&gt;&lt;/P&gt;
&lt;P&gt;dataIn.SetDataSize(dataLength);&lt;/P&gt;
&lt;P&gt;MPEG4VideoDecoder *mpg4 = &lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;new&lt;/FONT&gt;&lt;FONT size="2"&gt; UMC::MPEG4VideoDecoder();&lt;P&gt;&lt;/P&gt;
&lt;P&gt;VDecParams.m_pData = &amp;amp;dataIn;&lt;/P&gt;
&lt;P&gt;ColorInit.FormatSource = UMC::YV12;&lt;/P&gt;
&lt;P&gt;ColorInit.SizeSource.width = vidW;&lt;/P&gt;
&lt;P&gt;ColorInit.SizeSource.height = vidH;&lt;/P&gt;
&lt;P&gt;ColorInit.SizeDest.width = vidW;&lt;/P&gt;
&lt;P&gt;ColorInit.SizeDest.height = vidH;&lt;/P&gt;
&lt;P&gt;ColorInit.lFlags = 1;&lt;/P&gt;
&lt;P&gt;ColorInit.lDeinterlace = 0;&lt;/P&gt;
&lt;P&gt;ColorInit.lInterpolation = 1;&lt;/P&gt;
&lt;P&gt;ColorInit.FormatDest = UMC::RGB24;&lt;/P&gt;
&lt;P&gt;VDecParams.cformat = UMC::YV12;&lt;/P&gt;
&lt;P&gt;VDecParams.lFlags = UMC::FLAG_VDEC_COMPATIBLE | UMC::FLAG_VDEC_NO_PREVIEW | UMC::FLAG_VDEC_REORDER; &lt;/P&gt;
&lt;P&gt;TimedColorConverter *tcc = &lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;new&lt;/FONT&gt;&lt;FONT size="2"&gt; TimedColorConverter; //needs to be deleted...&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tcc-&amp;gt;Init(ColorInit);&lt;/P&gt;
&lt;P&gt;VDecParams.lpConverter = tcc;&lt;/P&gt;
&lt;P&gt;VDecParams.lpConvertInit = &amp;amp;ColorInit;&lt;/P&gt;
&lt;P&gt;VDecParams.uiLimitThreads = 0;&lt;/P&gt;
&lt;P&gt;umcRes = mpg4-&amp;gt;Init(&amp;amp;VDecParams); &lt;/P&gt;
&lt;P&gt;UMC::VideoDecoderParams vParams;&lt;/P&gt;
&lt;P&gt;umcRes = mpg4-&amp;gt;GetInfo(&amp;amp;vParams);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;VDecParams.lpConvertInit-&amp;gt;SizeSource.width=vParams.info.clip_info.width;&lt;/P&gt;
&lt;P&gt;VDecParams.lpConvertInit-&amp;gt;SizeSource.height=vParams.info.clip_info.height;&lt;/P&gt;
&lt;P&gt;VDecParams.lpConvertInit-&amp;gt;SizeDest.width=vParams.info.clip_info.width;&lt;/P&gt;
&lt;P&gt;VDecParams.lpConvertInit-&amp;gt;SizeDest.height=vParams.info.clip_info.height;&lt;/P&gt;
&lt;P&gt;dataOut.SetVideoParameters(vidW, vidH, UMC::RGB24);&lt;/P&gt;
&lt;P&gt;BYTE * pOut = (BYTE*)malloc(vidW*3*vidH);&lt;/P&gt;
&lt;P&gt;dataOut.SetDest(pOut,pOut+480*640,pOut+480*640*2);&lt;/P&gt;
&lt;P&gt;dataOut.SetPitch(vidW*3,vidW,vidW);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; cc=0;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;while&lt;/FONT&gt;&lt;FONT size="2"&gt; (cc&amp;lt;150) {&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;int&lt;/FONT&gt;&lt;FONT size="2"&gt; datasize = dataIn.GetDataSize();&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#008000" size="2"&gt;/*if(datasize&lt;MIN_SIZE&gt;
&lt;P&gt;Ipp8u* dataptr = (Ipp8u *)dataIn.GetDataPointer();&lt;/P&gt;
&lt;P&gt;pData = start + (dataptr - dataIn.GetBufferPointer());&lt;/P&gt;
&lt;P&gt;ippsCopy_8u(dataptr, pData, datasize); // copy tail to the head of buffer&lt;/P&gt;
&lt;P&gt;//ReadFile(fh,memBuf+datasize, BUF
_SIZE-datasize, &amp;amp;br, NULL); // read to remained space&lt;/P&gt;
&lt;P&gt;//if(br==0 &amp;amp;&amp;amp; datasize &amp;lt; 16) break; // need more accurate EOF detection&lt;/P&gt;
&lt;P&gt;dataIn.MoveDataPointer((Ipp8u *)dataIn.GetBufferPointer() - dataptr); // back to the start of the buffer&lt;/P&gt;
&lt;P&gt;dataIn.SetDataSize(datasize + 0); // remained + new read&lt;/P&gt;
&lt;P&gt;}*/&lt;/P&gt;&lt;/MIN_SIZE&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;
&lt;P&gt;umcRes = mpg4-&amp;gt;GetFrame(&amp;amp;dataIn, &amp;amp;dataOut);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color="#008000" size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;if&lt;/FONT&gt;&lt;FONT size="2"&gt; (umcRes!=UMC::UMC_OK &amp;amp;&amp;amp; umcRes!=UMC::UMC_NOT_ENOUGH_DATA) &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;break&lt;/FONT&gt;&lt;FONT size="2"&gt;;&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;
&lt;P&gt;cc++;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#008000" size="2"&gt;//set to next data in buffer, just for testing&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;
&lt;P&gt;vm_byte * tbuf=(vm_byte *)dataIn.GetDataPointer();&lt;/P&gt;
&lt;P&gt;dataIn.SetBufferPointer(tbuf,BUF_SIZE);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;free(pOut);&lt;/P&gt;
&lt;P&gt;mpg4-&amp;gt;Close();&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;delete&lt;/FONT&gt;&lt;FONT size="2"&gt; mpg4;&lt;/FONT&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;My first problem is inside the color converter. Even though I specified YV12 to RGB24, for some reason, the color converter chooses YUV to YUV conversion. The code looks correct to me, but I stepped through it (except for the macro), and it selects the wrong function. I had to add this line under 'case YV12' to fix the problem.&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size="2"&gt;
&lt;P&gt;lpFunc = &amp;amp;ColorSpaceConverter::ConvertFrom_YV12_To_RGB24;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size="2"&gt;The next issue is that setDest assigns three pointers as if the BGR image planes will all be in separate locations. However, the result is returned in one image plane with BGR triples. I guess it's not really a problem, but it seems awkward given the setDest function (am I using the right function?).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Next, the MPEG4 init routine seems to decode the first I-frame. But how do I access the decoded image? The first call to getFrame returns the the second I-frame, completely skipping the whole previous GVOP.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;I have this set up so that the entire MPEG is stored in pData. I would like to change it so I can pass a little data in the buffer, and when the decoder returns 'not enough data', I can pass a new buffer with the remaining data. This was done with ReadFile in the previous example. I have some code commented where I'm trying to understand what the functions do. I am also wondering if setBufferPointer is necessary in the loop.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;thank you&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2007 20:51:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4-decoding/m-p/869368#M8727</guid>
      <dc:creator>goldfita</dc:creator>
      <dc:date>2007-04-16T20:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: MPEG4 decoding</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4-decoding/m-p/869369#M8728</link>
      <description>&lt;P&gt;Do you use our the last version of media sample, which comes with IPP 5.2 beta?&lt;/P&gt;
&lt;P&gt;Vladimir&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2007 15:22:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4-decoding/m-p/869369#M8728</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2007-04-19T15:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: MPEG4 decoding</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4-decoding/m-p/869370#M8729</link>
      <description>&lt;P&gt;Package ID: w_ipp-sample-media_p_5.1.007&lt;BR /&gt;Package Contents: Intel IPP Media Processing Samples for Windows*&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I have almost figured out what I'm doing. It looks like after the MPEG4 init call, I need to call &lt;FONT size="2"&gt;&lt;FONT size="3"&gt;MoveDataPointer before decoding the first frame. If there is not enough data in the buffer to decode a full frame, will I need to call MoveDataPointer before trying again? I.e.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;//dataptr == bufferptr&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;getFrame() //fails (returns what?)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;dataptr = GetDataPointer()&lt;/P&gt;
&lt;P&gt;//copy more data to buffer&lt;/P&gt;
&lt;P&gt;MoveDataPointer(GetBufferPointer() - dataptr)&lt;/P&gt;
&lt;P&gt;getFrame() //success?&lt;/P&gt;
&lt;P&gt;//copy end back to start&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;I'm still wondering why the color converter chooses the wrong routine.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;------------&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;There is another issue. It seems if there is not enough data, at least the first time, to decode a frame, getFrame return UMC_OK. How do I know if the output image is valid?&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2007 19:52:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4-decoding/m-p/869370#M8729</guid>
      <dc:creator>goldfita</dc:creator>
      <dc:date>2007-04-19T19:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: MPEG4 decoding</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4-decoding/m-p/869371#M8730</link>
      <description>&lt;P&gt;It seems you met issue which was fixed in IPP 5.2 beta. Could you try our the latest sample?&lt;/P&gt;
&lt;P&gt;Vladimir&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2007 21:47:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4-decoding/m-p/869371#M8730</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2007-04-30T21:47:06Z</dc:date>
    </item>
  </channel>
</rss>

