- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I get a copy of sample in the forum. the code is below.
now Iwant to run the sample just in a empty project .
How should I to configure my VS 2010 to make the project work. The whole sample is so big. and I can not run the whole one when I started one in VS 2010.
Now I want to run the code below . Anyone can show me to configure the solution. For example, the include files. libs and so on .
Thank you
/*///////////////////////////////////////////////////////////////////////////////////////////
// This is a simple code to get started to use H.264 decoder. For more of the code sample, check
// simpleplaeyr application in the UMC sample code
*/
#include
#include
#include "ipp.h"
#include "umc_defs.h"
#include "umc_video_decoder.h"
#include "umc_video_data.h"
#include "umc_h264_dec.h"
#include "umc_structures.h"
#define MAXFRAME 100000
#define MAXVIDEOSIZE 100000000
#define MAXYUVSIZE 200000000
void DecodeStream( Ipp8u *cVideoData,int VideoDataSize,
Ipp8u *cYUVData, int& imgWidth, int & imgHeight, int & frameNumber )
{
UMC::Status status; UMC::MediaData DataIn; UMC::VideoData DataOut;
UMC::VideoDecoderParams Params;
UMC::H264VideoDecoder H264Decoder;
int frameSize=0;
DataIn.SetBufferPointer(cVideoData,VideoDataSize);
DataIn.SetDataSize(VideoDataSize);
Params.m_pData = &DataIn; Params.lFlags=0; Params.numThreads=1;
if(status = H264Decoder.Init(&Params)!=UMC::UMC_OK)
return;
H264Decoder.GetInfo(&Params);
imgWidth=Params.info.clip_info.width; imgHeight=Params.info.clip_info.height;
frameSize = imgWidth*imgHeight*3/2;
DataOut.Init(imgWidth,imgHeight,UMC::YV12,8);
DataOut.SetBufferPointer(cYUVData,frameSize);
int exit_flag=0; frameNumber=0;
do{ status = H264Decoder.GetFrame(&DataIn, &DataOut);
if (status == UMC::UMC_OK){
cYUVData += (imgWidth*imgHeight*3/2);
DataOut.SetBufferPointer(cYUVData,frameSize);
frameNumber++;
}
if((status !=UMC::UMC_OK)||(frameNumber >=MAXFRAME))
exit_flag = 1;
}while (exit_flag!=1);
do{ status = H264Decoder.GetFrame(NULL, &DataOut);
if (status == UMC::UMC_OK) {
cYUVData += frameSize;
DataOut.SetBufferPointer(cYUVData,frameSize);
frameNumber++;
}
}while(status == UMC::UMC_OK);
return;
}
int ReadVideoData(char* strFilename,Ipp8u *cVideoData,int &VideoDataSize)
{
FILE* fp = fopen(strFilename, "rb");
if(fp==NULL)
return 0;
VideoDataSize=fread(cVideoData,1,MAXVIDEOSIZE,fp);
fclose(fp);
}
void WriteYUVData(char* strFilename,Ipp8u * cYUVData,int imgWidth, int imgHeight, int frameNumber)
{
FILE* outfp = fopen(strFilename, "wb");
if(outfp==NULL)
return ;
fwrite(cYUVData,frameNumber*imgWidth*imgHeight*3/2,1,outfp);
fclose(outfp);
}
int main(int argc, vm_char* argv[])
{
Ipp8u *cVideoData = ippsMalloc_8u(MAXVIDEOSIZE);
Ipp8u *cYUVData = ippsMalloc_8u(MAXYUVSIZE);
int VideoDataSize,imgWidth, imgHeight, frameNumber;
char * InputVideofileName, *OutputYUVFileName;
InputVideofileName = "teststream.h264";
OutputYUVFileName = "testoutput.yuv";
ReadVideoData(InputVideofileName,cVideoData,VideoDataSize);
DecodeStream(cVideoData,VideoDataSize,cYUVData,imgWidth, imgHeight, frameNumber);
WriteYUVData(OutputYUVFileName,cYUVData,imgWidth, imgHeight, frameNumber);
return 0;
}
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Just create an empty project in VS 2010, add source file (sample code), add required header file from IPP sample code.
Refer to below article to configure it for VS 2010(properties).
http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-for-windows-compiling-and-linking-with-microsoft-visual-c-and-intel-c-compilers/#10
Thanks,
Naveen Gv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
O, I get the error below.
how to make use of UMC?
1>c:\ipph.264encoder.cpp(26): error C2039: 'H264EncoderParams' : is not a member of 'UMC'
1>c:\ipph.264encoder.cpp(26): error C2065: 'H264EncoderParams' : undeclared identifier
1>c:\ipph.264encoder.cpp(26): error C2146: syntax error : missing ';' before identifier 'Params'
1>c:\ipph.264encoder.cpp(26): error C2065: 'Params' : undeclared identifier
1>c:\ipph.264encoder.cpp(27): error C2039: 'H264VideoEncoder' : is not a member of 'UMC'
1>c:\ipph.264encoder.cpp(27): error C2065: 'H264VideoEncoder' : undeclared identifier
1>c:\ipph.264encoder.cpp(27): error C2146: syntax error : missing ';' before identifier 'H264Encoder'
1>c:\ipph.264encoder.cpp(27): error C2065: 'H264Encoder' : undeclared identifier
1>c:\ipph.264encoder.cpp(29): error C2065: 'Params' : undeclared identifier
1>c:\ipph.264encoder.cpp(29): error C2228: left of '.key_frame_controls' must have class/struct/union
1> type is ''unknown-type''
1>c:\ipph.264encoder.cpp(29): error C2228: left of '.method' must have class/struct/union
1>c:\ipph.264encoder.cpp(30): error C2065: 'Params' : undeclared identifier
1>c:\ipph.264encoder.cpp(30): error C2228: left of '.info' must have class/struct/union
1> type is ''unknown-type''
1>c:\ipph.264encoder.cpp(30): error C2228: left of '.clip_info' must have class/struct/union
1>c:\ipph.264encoder.cpp(30): error C2228: left of '.height' must have class/struct/union
1>c:\ipph.264encoder.cpp(31): error C2065: 'Params' : undeclared identifier
1>c:\ipph.264encoder.cpp(31): error C2228: left of '.info' must have class/struct/union
1> type is ''unknown-type''
1>c:\ipph.264encoder.cpp(31): error C2228: left of '.clip_info' must have class/struct/union
1>c:\ipph.264encoder.cpp(31): error C2228: left of '.width' must have class/struct/union
1>c:\ipph.264encoder.cpp(32): error C2065: 'Params' : undeclared identifier
1>c:\ipph.264encoder.cpp(32): error C2228: left of '.info' must have class/struct/union
1> type is ''unknown-type''
1>c:\ipph.264encoder.cpp(32): error C2228: left of '.bitrate' must have class/struct/union
1>c:\ipph.264encoder.cpp(35): error C2065: 'H264Encoder' : undeclared identifier
1>c:\ipph.264encoder.cpp(35): error C2228: left of '.Init' must have class/struct/union
1> type is ''unknown-type''
1>c:\ipph.264encoder.cpp(35): error C2065: 'Params' : undeclared identifier
1>c:\ipph.264encoder.cpp(49): error C2065: 'H264Encoder' : undeclared identifier
1>c:\ipph.264encoder.cpp(49): error C2228: left of '.GetFrame' must have class/struct/union
1> type is ''unknown-type''
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page