<?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 H264VideoDecoder::Reset won't work in 7.0.1 in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/H264VideoDecoder-Reset-won-t-work-in-7-0-1/m-p/772084#M777</link>
    <description>In version 6.1 we used H264VideoDecoder::Reset to reuse the decoder after a callingSplitter::SetTimePosition, but in the v7.0.1.041 after calling Reset the decoder will always return UMC_ERR_NOT_ENOUGH_DATA even after reading the whole file.&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;A modified simplesplitter.cpp (from&lt;/SPAN&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;A href="http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-unified-media-classes-sample/"&gt;http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-unified-media-classes-sample/&lt;/A&gt;&lt;/SPAN&gt;)&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;[cpp]&lt;SPAN style="font-family: verdana, sans-serif; white-space: normal; font-size: 11px;"&gt;&lt;/SPAN&gt;#include "ipp.h"
#include "umc_file_reader.h"
#include "umc_fio_reader.h"
#include "umc_mp4_spl.h"
#include "umc_splitter.h"
#include "umc_video_render.h"
#include "fw_video_render.h"
#include "umc_h264_dec.h"
#include "vm_time.h"

void EncodeStream(vm_char * inputfilename, vm_char * outputfilename )
{
   	Ipp32u videoTrack=0; int exit_flag =0;
	UMC::Status status;  
	UMC::MediaData in; UMC::VideoData out;	
	UMC::FIOReader reader; UMC::FileReaderParams readerParams;
	UMC::SplitterParams splitterParams; UMC::SplitterInfo * streamInfo;
	UMC::MP4Splitter Splitter;
		
	UMC::VideoStreamInfo *videoInfo=NULL;
	UMC::VideoDecoder *  videoDecoder; UMC::VideoDecoderParams videoDecParams;
	UMC::FWVideoRender fwRender; UMC::FWVideoRenderParams fwRenderParams;
	
	readerParams.m_portion_size = 0;
	vm_string_strcpy(readerParams.m_file_name, inputfilename);
	if((status = reader.Init(&amp;amp;readerParams))!= UMC::UMC_OK) 
       return;
	splitterParams.m_lFlags = UMC::VIDEO_SPLITTER;
	splitterParams.m_pDataReader = &amp;amp;reader;
    if((status = Splitter.Init(splitterParams))!= UMC::UMC_OK)
	   return;
	Splitter.GetInfo(&amp;amp;streamInfo);
    for (videoTrack = 0; videoTrack &amp;lt;  streamInfo-&amp;gt;m_nOfTracks; videoTrack++) {
      if (streamInfo-&amp;gt;m_ppTrackInfo[videoTrack]-&amp;gt;m_Type == UMC::TRACK_H264)
           break;
    }
	videoInfo = (UMC::VideoStreamInfo*)(streamInfo-&amp;gt;m_ppTrackInfo[videoTrack]-&amp;gt;m_pStreamInfo);
	if(videoInfo-&amp;gt;stream_type!=UMC::H264_VIDEO)
        return;
    videoDecParams.info =  (*videoInfo);
	videoDecParams.m_pData = streamInfo-&amp;gt;m_ppTrackInfo[videoTrack]-&amp;gt;m_pDecSpecInfo;
	videoDecParams.numThreads = 1;
    videoDecoder = (UMC::VideoDecoder*)(new UMC::H264VideoDecoder());
	if((status = videoDecoder-&amp;gt;Init(&amp;amp;videoDecParams))!= UMC::UMC_OK)
		return;
	fwRenderParams.out_data_template.Init(videoInfo-&amp;gt;clip_info.width, videoInfo-&amp;gt;clip_info.height, videoInfo-&amp;gt;color_format);
    fwRenderParams.pOutFile = outputfilename;
    if(status = fwRender.Init(&amp;amp;fwRenderParams)!= UMC::UMC_OK)
		return;

	Splitter.Run();
	int flag = 0;
	do
	{   do{ 
		     if (in.GetDataSize() &amp;lt; 4) {
	    	     do{ 
	              status= Splitter.GetNextData(&amp;amp;in,videoTrack);
			       if(status==UMC::UMC_ERR_NOT_ENOUGH_DATA)
   			            vm_time_sleep(5);
			      }while(status==UMC::UMC_ERR_NOT_ENOUGH_DATA);
			      if(((status != UMC::UMC_OK) &amp;amp;&amp;amp; (status != UMC::UMC_ERR_END_OF_STREAM))||
				     (status == UMC::UMC_ERR_END_OF_STREAM)&amp;amp;&amp;amp; (in.GetDataSize()&amp;lt;4)) {
                        exit_flag=1;
				  }
             }
			 fwRender.LockInputBuffer(&amp;amp;out);
		     videoDecoder-&amp;gt;GetFrame(&amp;amp;in,&amp;amp;out);
			 if (flag == 0 &amp;amp;&amp;amp; out.GetDataSize()&amp;gt;0) {
				 // Calling Reset after decoding a frame will result in a decoder always returning a
				 // UMC_ERR_NOT_ENOUGH_DATA
				 // but this worked in 6.1
				 flag = 1;
				 Splitter.SetTimePosition(0.f);
				 videoDecoder-&amp;gt;Reset();
				 Splitter.Run();
				 out.SetDataSize(0);
			 }
    	  	 fwRender.UnLockInputBuffer(&amp;amp;out);
		     fwRender.RenderFrame();
	     }while(!exit_flag &amp;amp;&amp;amp; (status == UMC::UMC_ERR_NOT_ENOUGH_DATA || status == UMC::UMC_ERR_SYNC));
	 }while (exit_flag!=1);

	 do{  
		 fwRender.LockInputBuffer(&amp;amp;out);
	     status  = videoDecoder-&amp;gt;GetFrame(NULL,&amp;amp;out);
	     fwRender.UnLockInputBuffer(&amp;amp;out);
         fwRender.RenderFrame();
	}while(status == UMC::UMC_OK);			
}

void main(int argc, vm_char* argv[])
{
   vm_char *  InputVideofileName, *OutputYUVFileName;
   InputVideofileName = _T("The Simpsons Movie - Trailer.mp4"); //use unicode string if project use unicode characters
   OutputYUVFileName  = _T("testoutput.yuv"); //use unicode string if project use unicode characters

   EncodeStream(InputVideofileName,OutputYUVFileName);
}[/cpp]&lt;/PRE&gt; &lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 03 Dec 2010 15:34:32 GMT</pubDate>
    <dc:creator>ismaelbej</dc:creator>
    <dc:date>2010-12-03T15:34:32Z</dc:date>
    <item>
      <title>H264VideoDecoder::Reset won't work in 7.0.1</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H264VideoDecoder-Reset-won-t-work-in-7-0-1/m-p/772084#M777</link>
      <description>In version 6.1 we used H264VideoDecoder::Reset to reuse the decoder after a callingSplitter::SetTimePosition, but in the v7.0.1.041 after calling Reset the decoder will always return UMC_ERR_NOT_ENOUGH_DATA even after reading the whole file.&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;A modified simplesplitter.cpp (from&lt;/SPAN&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;A href="http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-unified-media-classes-sample/"&gt;http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-unified-media-classes-sample/&lt;/A&gt;&lt;/SPAN&gt;)&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;[cpp]&lt;SPAN style="font-family: verdana, sans-serif; white-space: normal; font-size: 11px;"&gt;&lt;/SPAN&gt;#include "ipp.h"
#include "umc_file_reader.h"
#include "umc_fio_reader.h"
#include "umc_mp4_spl.h"
#include "umc_splitter.h"
#include "umc_video_render.h"
#include "fw_video_render.h"
#include "umc_h264_dec.h"
#include "vm_time.h"

void EncodeStream(vm_char * inputfilename, vm_char * outputfilename )
{
   	Ipp32u videoTrack=0; int exit_flag =0;
	UMC::Status status;  
	UMC::MediaData in; UMC::VideoData out;	
	UMC::FIOReader reader; UMC::FileReaderParams readerParams;
	UMC::SplitterParams splitterParams; UMC::SplitterInfo * streamInfo;
	UMC::MP4Splitter Splitter;
		
	UMC::VideoStreamInfo *videoInfo=NULL;
	UMC::VideoDecoder *  videoDecoder; UMC::VideoDecoderParams videoDecParams;
	UMC::FWVideoRender fwRender; UMC::FWVideoRenderParams fwRenderParams;
	
	readerParams.m_portion_size = 0;
	vm_string_strcpy(readerParams.m_file_name, inputfilename);
	if((status = reader.Init(&amp;amp;readerParams))!= UMC::UMC_OK) 
       return;
	splitterParams.m_lFlags = UMC::VIDEO_SPLITTER;
	splitterParams.m_pDataReader = &amp;amp;reader;
    if((status = Splitter.Init(splitterParams))!= UMC::UMC_OK)
	   return;
	Splitter.GetInfo(&amp;amp;streamInfo);
    for (videoTrack = 0; videoTrack &amp;lt;  streamInfo-&amp;gt;m_nOfTracks; videoTrack++) {
      if (streamInfo-&amp;gt;m_ppTrackInfo[videoTrack]-&amp;gt;m_Type == UMC::TRACK_H264)
           break;
    }
	videoInfo = (UMC::VideoStreamInfo*)(streamInfo-&amp;gt;m_ppTrackInfo[videoTrack]-&amp;gt;m_pStreamInfo);
	if(videoInfo-&amp;gt;stream_type!=UMC::H264_VIDEO)
        return;
    videoDecParams.info =  (*videoInfo);
	videoDecParams.m_pData = streamInfo-&amp;gt;m_ppTrackInfo[videoTrack]-&amp;gt;m_pDecSpecInfo;
	videoDecParams.numThreads = 1;
    videoDecoder = (UMC::VideoDecoder*)(new UMC::H264VideoDecoder());
	if((status = videoDecoder-&amp;gt;Init(&amp;amp;videoDecParams))!= UMC::UMC_OK)
		return;
	fwRenderParams.out_data_template.Init(videoInfo-&amp;gt;clip_info.width, videoInfo-&amp;gt;clip_info.height, videoInfo-&amp;gt;color_format);
    fwRenderParams.pOutFile = outputfilename;
    if(status = fwRender.Init(&amp;amp;fwRenderParams)!= UMC::UMC_OK)
		return;

	Splitter.Run();
	int flag = 0;
	do
	{   do{ 
		     if (in.GetDataSize() &amp;lt; 4) {
	    	     do{ 
	              status= Splitter.GetNextData(&amp;amp;in,videoTrack);
			       if(status==UMC::UMC_ERR_NOT_ENOUGH_DATA)
   			            vm_time_sleep(5);
			      }while(status==UMC::UMC_ERR_NOT_ENOUGH_DATA);
			      if(((status != UMC::UMC_OK) &amp;amp;&amp;amp; (status != UMC::UMC_ERR_END_OF_STREAM))||
				     (status == UMC::UMC_ERR_END_OF_STREAM)&amp;amp;&amp;amp; (in.GetDataSize()&amp;lt;4)) {
                        exit_flag=1;
				  }
             }
			 fwRender.LockInputBuffer(&amp;amp;out);
		     videoDecoder-&amp;gt;GetFrame(&amp;amp;in,&amp;amp;out);
			 if (flag == 0 &amp;amp;&amp;amp; out.GetDataSize()&amp;gt;0) {
				 // Calling Reset after decoding a frame will result in a decoder always returning a
				 // UMC_ERR_NOT_ENOUGH_DATA
				 // but this worked in 6.1
				 flag = 1;
				 Splitter.SetTimePosition(0.f);
				 videoDecoder-&amp;gt;Reset();
				 Splitter.Run();
				 out.SetDataSize(0);
			 }
    	  	 fwRender.UnLockInputBuffer(&amp;amp;out);
		     fwRender.RenderFrame();
	     }while(!exit_flag &amp;amp;&amp;amp; (status == UMC::UMC_ERR_NOT_ENOUGH_DATA || status == UMC::UMC_ERR_SYNC));
	 }while (exit_flag!=1);

	 do{  
		 fwRender.LockInputBuffer(&amp;amp;out);
	     status  = videoDecoder-&amp;gt;GetFrame(NULL,&amp;amp;out);
	     fwRender.UnLockInputBuffer(&amp;amp;out);
         fwRender.RenderFrame();
	}while(status == UMC::UMC_OK);			
}

void main(int argc, vm_char* argv[])
{
   vm_char *  InputVideofileName, *OutputYUVFileName;
   InputVideofileName = _T("The Simpsons Movie - Trailer.mp4"); //use unicode string if project use unicode characters
   OutputYUVFileName  = _T("testoutput.yuv"); //use unicode string if project use unicode characters

   EncodeStream(InputVideofileName,OutputYUVFileName);
}[/cpp]&lt;/PRE&gt; &lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Dec 2010 15:34:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H264VideoDecoder-Reset-won-t-work-in-7-0-1/m-p/772084#M777</guid>
      <dc:creator>ismaelbej</dc:creator>
      <dc:date>2010-12-03T15:34:32Z</dc:date>
    </item>
    <item>
      <title>H264VideoDecoder::Reset won't work in 7.0.1</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H264VideoDecoder-Reset-won-t-work-in-7-0-1/m-p/772085#M778</link>
      <description>Hello Ismael,&lt;BR /&gt;&lt;BR /&gt;Thank you for that updated encoder. I will forward it to the attention of our engineering folks.&lt;BR /&gt;&lt;BR /&gt;Paul</description>
      <pubDate>Tue, 14 Dec 2010 17:13:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H264VideoDecoder-Reset-won-t-work-in-7-0-1/m-p/772085#M778</guid>
      <dc:creator>PaulF_IntelCorp</dc:creator>
      <dc:date>2010-12-14T17:13:39Z</dc:date>
    </item>
    <item>
      <title>H264VideoDecoder::Reset won't work in 7.0.1</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H264VideoDecoder-Reset-won-t-work-in-7-0-1/m-p/772086#M779</link>
      <description>There seems to be an issue withUMC::H264VideoDecoder::Reset() in 7.0.1. I can get it to decode after calling Reset() but it decodes garbage (output slowly turns pink). I think the TaskSupplier doesn't reset its headers properly, because the debugger reveals the SPS structure contains a lot of 0xfeeefeee invalid values. See umc_h264_heap.h.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Ismael, one solution I've found is to simply reallocate the decoder to bypass its internal Reset().&lt;/DIV&gt;&lt;DIV&gt;Instead of doing "pDecoder-&amp;gt;Reset();", do "delete pDecoder, pDecoder = new UMC::H264VideoDecoder;".&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Dec 2010 23:44:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H264VideoDecoder-Reset-won-t-work-in-7-0-1/m-p/772086#M779</guid>
      <dc:creator>oxydius</dc:creator>
      <dc:date>2010-12-14T23:44:11Z</dc:date>
    </item>
    <item>
      <title>H264VideoDecoder::Reset won't work in 7.0.1</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H264VideoDecoder-Reset-won-t-work-in-7-0-1/m-p/772087#M780</link>
      <description>Good day.&lt;BR /&gt;&lt;BR /&gt;Problem could be fixed this way:&lt;BR /&gt;In thefile "umc_h264_au_splitter.cpp" there is method "void AU_Splitter::Reset()" on line 100. Add parameter "true" to "m_Headers.Reset()"in order to omitinfo headers release.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[cpp]void AU_Splitter::Reset()
{
    if (m_pNALSplitter.get())
        m_pNALSplitter-&amp;gt;Reset();

    m_Headers.Reset(true); // partial reset
}
[/cpp]&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Dec 2010 13:23:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H264VideoDecoder-Reset-won-t-work-in-7-0-1/m-p/772087#M780</guid>
      <dc:creator>Pavel_V_Intel</dc:creator>
      <dc:date>2010-12-22T13:23:07Z</dc:date>
    </item>
    <item>
      <title>H264VideoDecoder::Reset won't work in 7.0.1</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/H264VideoDecoder-Reset-won-t-work-in-7-0-1/m-p/772088#M781</link>
      <description>Thank you, now it is working again.&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Dec 2010 14:37:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/H264VideoDecoder-Reset-won-t-work-in-7-0-1/m-p/772088#M781</guid>
      <dc:creator>ismaelbej</dc:creator>
      <dc:date>2010-12-23T14:37:07Z</dc:date>
    </item>
  </channel>
</rss>

