[XviD-devel] ***SPAM*** UYVY decompression
Erkan Ermiş
erkan_ermis at hotmail.com
Tue May 23 20:59:40 CEST 2006
Hi developper,
I am beginner in using XVid codec. I want to decompress an mp4 I-frame with size 704x576
but I am receiving run-time error at;
xerr = API_xvid_decore(dechandle, XVID_DEC_DECODE, &xframe, 0);
The frame is valid mp4 I-frame i verified it.
It seems there is some invalid input parameters in "xframe"
How can I solve this, or what may cause this.
Thanks for you advices
Erkan Ermis
//------------------------------------------------------------------------------------------------
Decode(lpbFrame,dwFrameSize,704,576);
//------------------------------------------------------------------------------------------------
//... header file
typedef int (__cdecl *API_tag_xvid_global)(void *handle, int opt, void *param1,void *param2);
typedef int (__cdecl *API_tag_xvid_decore)(void *handle, int opt, void *param1,void *param2);
//------------------------------------------------------------------------------------------------
//... cpp file
void Decode(BYTE *lpbFrame, DWORD dwFrameSize, DWORD dwWidth, DWORD dwHeight)
{
..
..
//... Init Dll
HINSTANCE hXvidDll; hXvidDll = LoadLibrary("xvidcore.dll");if(hXvidDll==NULL) return;
API_tag_xvid_global API_xvid_global;
API_tag_xvid_decore API_xvid_decore;
API_xvid_decore = (API_tag_xvid_decore)GetProcAddress(hXvidDll,"xvid_decore");if(API_xvid_decore==NULL) return;
API_xvid_global = (API_tag_xvid_global)GetProcAddress(hXvidDll,"xvid_global");if(API_xvid_global==NULL) return;
//... Initialize Decompressor
int xerr;
xvid_gbl_info_t xinfo;
xvid_gbl_init_t xinit;
xvid_dec_create_t xparam;
xvid_dec_frame_t xframe;
//... Get Info
ZeroMemory(&xinfo,sizeof(xvid_gbl_info_t));
xinfo.version = XVID_VERSION;
API_xvid_global(NULL, XVID_GBL_INFO, &xinit, NULL);
//... Init
ZeroMemory(&xinit,sizeof(xvid_gbl_init_t));
xinit.cpu_flags = 0;
xinit.version = XVID_VERSION;
API_xvid_global(NULL, 0, &xinit, NULL);
//... Create
ZeroMemory(&xparam,sizeof(xvid_dec_create_t));
xparam.width = width;
xparam.height = height;
xparam.version = XVID_VERSION;
xerr = API_xvid_decore(NULL, XVID_DEC_CREATE, &xparam, NULL);
if(xerr==XVID_ERR_FAIL) return;
void *dechandle;
dechandle = xparam.handle;
//... Decode Frame
BYTE *lpbUYVY;lpbUYVY = new BYTE[width*height*3];if(!lpbUYVY) return;
ZeroMemory(&xframe,sizeof(xvid_dec_frame_t));
xframe.version = XVID_VERSION;
xframe.bitstream = lpbFrame;
xframe.length = dwFrameSize;
xframe.output.plane[0] = lpbUYVY;
xframe.output.plane[1] = NULL;
xframe.output.plane[2] = NULL;
xframe.output.stride[0] = 704;
xframe.output.stride[1] = 0;
xframe.output.stride[2] = 0;
xframe.output.csp = XVID_CSP_UYVY;
xerr = API_xvid_decore(dechandle, XVID_DEC_DECODE, &xframe, 0); //... Giving Run-Time Error at this point
....
....
More information about the XviD-devel
mailing list