Patch to enable UNICODE build in Xvid MPEG-4 DirectShow/MediaFoundation filter xvid.ax. Patch to make exported functions of the Xvid MPEG-4 (libxvidcore) library robust against different calling conventions in Xvid implementations. Jerker Back 2011-06-15 Patch made by AnkhSVN (ASCII/LF formatted). Index: xvidcore/dshow/src/config.h =================================================================== --- xvidcore/dshow/src/config.h (revision 2017) +++ xvidcore/dshow/src/config.h (working copy) @@ -32,8 +32,8 @@ /* registry stuff */ #define XVID_REG_KEY HKEY_CURRENT_USER -#define XVID_REG_SUBKEY "Software\\GNU\\XviD" -#define XVID_REG_CLASS "config" +#define XVID_REG_SUBKEY TEXT("Software\\GNU\\XviD") +#define XVID_REG_CLASS TEXT("config") #define REG_GET_N(X, Y, Z) size=sizeof(int);if(RegQueryValueEx(hKey, X, 0, 0, (LPBYTE)&Y, &size) != ERROR_SUCCESS) {Y=Z;} #define REG_GET_S(X, Y, Z) size=MAX_PATH;if(RegQueryValueEx(hKey, X, 0, 0, Y, &size) != ERROR_SUCCESS) {lstrcpy(Y, Z);} @@ -79,7 +79,7 @@ void SaveRegistryInfo(); INT_PTR CALLBACK adv_proc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -#define XVID_DLL_NAME "xvidcore.dll" +#define XVID_DLL_NAME TEXT("xvidcore.dll") #ifdef __cplusplus } =================================================================== This patch enable a __stdcall compile and corrects types of ar_x, ar_y Index: xvidcore/dshow/src/CXvidDecoder.h =================================================================== --- xvidcore/dshow/src/CXvidDecoder.h (revision 2017) +++ xvidcore/dshow/src/CXvidDecoder.h (working copy) @@ -161,9 +161,9 @@ xvid_dec_frame_t m_frame; HINSTANCE m_hdll; - int (*xvid_global_func)(void *handle, int opt, void *param1, void *param2); - int (*xvid_decore_func)(void *handle, int opt, void *param1, void *param2); - int ar_x, ar_y; + int (__cdecl *xvid_global_func)(void *handle, int opt, void *param1, void *param2); + int (__cdecl *xvid_decore_func)(void *handle, int opt, void *param1, void *param2); + UINT ar_x, ar_y; bool forced_ar; int rgb_flip; Index: xvidcore/dshow/src/config.c =================================================================== --- xvidcore/dshow/src/config.c (revision 2017) +++ xvidcore/dshow/src/config.c (working copy) @@ -44,19 +44,19 @@ RegOpenKeyEx(XVID_REG_KEY, XVID_REG_SUBKEY, 0, KEY_READ, &hKey); // Set the default post-processing settings - REG_GET_N("Brightness", g_config.nBrightness, 0) - REG_GET_N("Deblock_Y", g_config.nDeblock_Y, 0) - REG_GET_N("Deblock_UV", g_config.nDeblock_UV, 0) - REG_GET_N("Dering_Y", g_config.nDering_Y, 0) - REG_GET_N("Dering_UV", g_config.nDering_UV, 0) - REG_GET_N("FilmEffect", g_config.nFilmEffect, 0) - REG_GET_N("ForceColorspace", g_config.nForceColorspace, 0) - REG_GET_N("FlipVideo", g_config.nFlipVideo, 0) - REG_GET_N("Supported_4CC", g_config.supported_4cc, 0) - REG_GET_N("Videoinfo_Compat", g_config.videoinfo_compat, 0) - REG_GET_N("Decoder_Aspect_Ratio", g_config.aspect_ratio, 0) - REG_GET_N("num_threads", g_config.num_threads, 0) - REG_GET_N("cpu_flags", g_config.cpu, 0) + REG_GET_N(TEXT("Brightness"), g_config.nBrightness, 0) + REG_GET_N(TEXT("Deblock_Y"), g_config.nDeblock_Y, 0) + REG_GET_N(TEXT("Deblock_UV"), g_config.nDeblock_UV, 0) + REG_GET_N(TEXT("Dering_Y"), g_config.nDering_Y, 0) + REG_GET_N(TEXT("Dering_UV"), g_config.nDering_UV, 0) + REG_GET_N(TEXT("FilmEffect"), g_config.nFilmEffect, 0) + REG_GET_N(TEXT("ForceColorspace"), g_config.nForceColorspace, 0) + REG_GET_N(TEXT("FlipVideo"), g_config.nFlipVideo, 0) + REG_GET_N(TEXT("Supported_4CC"), g_config.supported_4cc, 0) + REG_GET_N(TEXT("Videoinfo_Compat"), g_config.videoinfo_compat, 0) + REG_GET_N(TEXT("Decoder_Aspect_Ratio"), g_config.aspect_ratio, 0) + REG_GET_N(TEXT("num_threads"), g_config.num_threads, 0) + REG_GET_N(TEXT("cpu_flags"), g_config.cpu, 0) RegCloseKey(hKey); } @@ -77,22 +77,22 @@ &hKey, &dispo) != ERROR_SUCCESS) { - OutputDebugString("Couldn't create XVID_REG_SUBKEY"); + OutputDebugString(TEXT("Couldn't create XVID_REG_SUBKEY")); return; } - REG_SET_N("Brightness", g_config.nBrightness); - REG_SET_N("Deblock_Y", g_config.nDeblock_Y); - REG_SET_N("Deblock_UV", g_config.nDeblock_UV); - REG_SET_N("Dering_Y", g_config.nDering_Y); - REG_SET_N("Dering_UV", g_config.nDering_UV); - REG_SET_N("FilmEffect", g_config.nFilmEffect); - REG_SET_N("ForceColorspace", g_config.nForceColorspace); - REG_SET_N("FlipVideo", g_config.nFlipVideo); - REG_SET_N("Supported_4CC", g_config.supported_4cc); - REG_SET_N("Videoinfo_Compat", g_config.videoinfo_compat); - REG_SET_N("Decoder_Aspect_Ratio", g_config.aspect_ratio); - REG_SET_N("num_threads", g_config.num_threads); + REG_SET_N(TEXT("Brightness"), g_config.nBrightness); + REG_SET_N(TEXT("Deblock_Y"), g_config.nDeblock_Y); + REG_SET_N(TEXT("Deblock_UV"), g_config.nDeblock_UV); + REG_SET_N(TEXT("Dering_Y"), g_config.nDering_Y); + REG_SET_N(TEXT("Dering_UV"), g_config.nDering_UV); + REG_SET_N(TEXT("FilmEffect"), g_config.nFilmEffect); + REG_SET_N(TEXT("ForceColorspace"), g_config.nForceColorspace); + REG_SET_N(TEXT("FlipVideo"), g_config.nFlipVideo); + REG_SET_N(TEXT("Supported_4CC"), g_config.supported_4cc); + REG_SET_N(TEXT("Videoinfo_Compat"), g_config.videoinfo_compat); + REG_SET_N(TEXT("Decoder_Aspect_Ratio"), g_config.aspect_ratio); + REG_SET_N(TEXT("num_threads"), g_config.num_threads); RegCloseKey(hKey); } @@ -103,6 +103,7 @@ { HWND hBrightness; + UNREFERENCED_PARAMETER(lParam); switch ( uMsg ) { case WM_DESTROY: @@ -113,14 +114,14 @@ nForceColorspace = SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_GETCURSEL, 0, 0); if ( g_config.nForceColorspace != nForceColorspace ) { - MessageBox(0, "You have changed the output colorspace.\r\nClose the movie and open it for the new colorspace to take effect.", "Xvid DShow", MB_TOPMOST); + MessageBox(0, TEXT("You have changed the output colorspace.\r\nClose the movie and open it for the new colorspace to take effect."), TEXT("Xvid DShow"), MB_TOPMOST); } g_config.nForceColorspace = (int) nForceColorspace; aspect_ratio = SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_GETCURSEL, 0, 0); if ( g_config.aspect_ratio != aspect_ratio ) { - MessageBox(0, "You have changed the default aspect ratio.\r\nClose the movie and open it for the new aspect ratio to take effect.", "Xvid DShow", MB_TOPMOST); + MessageBox(0, TEXT("You have changed the default aspect ratio.\r\nClose the movie and open it for the new aspect ratio to take effect."), TEXT("Xvid DShow"), MB_TOPMOST); } g_config.aspect_ratio = (int) aspect_ratio; SaveRegistryInfo(); @@ -142,25 +143,25 @@ ((int (__cdecl *)(void *, int, void *, void *))GetProcAddress(m_hdll, "xvid_global")) (0, XVID_GBL_INFO, &info, NULL); - wsprintf(core, "Xvid MPEG-4 Video Codec v%d.%d.%d", + wsprintfA(core, "Xvid MPEG-4 Video Codec v%d.%d.%d", XVID_VERSION_MAJOR(info.actual_version), XVID_VERSION_MINOR(info.actual_version), XVID_VERSION_PATCH(info.actual_version)); FreeLibrary(m_hdll); } else { - wsprintf(core, "xvidcore.dll not found!"); + wsprintfA(core, "xvidcore.dll not found!"); } - SetDlgItemText(hwnd, IDC_CORE, core); + SetDlgItemTextA(hwnd, IDC_CORE, core); } // Load Force Colorspace Box - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"No Force"); - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YV12"); - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"YUY2"); - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB24"); - SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)"RGB32"); + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)TEXT("No Force")); + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)TEXT("YV12")); + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)TEXT("YUY2")); + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)TEXT("RGB24")); + SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_ADDSTRING, 0, (LPARAM)TEXT("RGB32")); // Select Colorspace SendMessage(GetDlgItem(hwnd, IDC_COLORSPACE), CB_SETCURSEL, g_config.nForceColorspace, 0); @@ -171,11 +172,11 @@ SendMessage(hBrightness, TBM_SETPOS, (WPARAM)TRUE, (LPARAM) g_config.nBrightness); // Load Aspect Ratio Box - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"Auto (MPEG-4 first)"); - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"Auto (external first)"); - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"4:3"); - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"16:9"); - SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)"2.35:1"); + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)TEXT("Auto (MPEG-4 first)")); + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)TEXT("Auto (external first)")); + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)TEXT("4:3")); + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)TEXT("16:9")); + SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_ADDSTRING, 0, (LPARAM)TEXT("2.35:1")); // Select Aspect Ratio SendMessage(GetDlgItem(hwnd, IDC_USE_AR), CB_SETCURSEL, g_config.aspect_ratio, 0); Index: xvidcore/dshow/src/Configure.cpp =================================================================== --- xvidcore/dshow/src/Configure.cpp (revision 2017) +++ xvidcore/dshow/src/Configure.cpp (working copy) @@ -44,7 +44,7 @@ psp[0].pszTemplate = MAKEINTRESOURCE (IDD_ABOUT); psp[0].pszIcon = NULL; psp[0].pfnDlgProc = adv_proc; - psp[0].pszTitle = "About"; + psp[0].pszTitle = TEXT("About"); psp[0].lParam = 0; psh.dwSize = sizeof (PROPSHEETHEADER); @@ -52,7 +52,7 @@ psh.hwndParent = hwndOwner; psh.hInstance = g_xvid_hInst; psh.pszIcon = NULL; - psh.pszCaption = (LPSTR)"Xvid Configuration"; + psh.pszCaption = TEXT("Xvid Configuration"); psh.nPages = sizeof (psp) / sizeof (PROPSHEETPAGE); psh.ppsp = psp; =================================================================== Change the DirectShow macro NAME to the global macro TEXT (they are the same) Change strcpy_s (a bit of an overkill) to the UNICODE aware lstrcpy. The szTip member of NOTIFYICONDATA have a buffer of 128 characters, so this change is safe. Index: xvidcore/dshow/src/CXvidDecoder.cpp =================================================================== --- xvidcore/dshow/src/CXvidDecoder.cpp (revision 2017) +++ xvidcore/dshow/src/CXvidDecoder.cpp (working copy) @@ -314,7 +314,7 @@ /* constructor */ CXvidDecoder::CXvidDecoder(LPUNKNOWN punk, HRESULT *phr) : - CVideoTransformFilter(NAME("CXvidDecoder"), punk, CLSID_XVID), m_hdll (NULL) + CVideoTransformFilter(TEXT("CXvidDecoder"), punk, CLSID_XVID), m_hdll (NULL) { DPRINTF("Constructor"); @@ -356,7 +356,7 @@ m_hdll = LoadLibrary(XVID_DLL_NAME); if (m_hdll == NULL) { DPRINTF("dll load failed"); - MessageBox(0, XVID_DLL_NAME " not found","Error", MB_TOPMOST); + MessageBox(0, XVID_DLL_NAME TEXT(" not found"), TEXT("Error"), MB_TOPMOST); return E_FAIL; } @@ -364,7 +364,7 @@ if (xvid_global_func == NULL) { FreeLibrary(m_hdll); m_hdll = NULL; - MessageBox(0, "xvid_global() not found", "Error", MB_TOPMOST); + MessageBox(0, TEXT("xvid_global() not found"), TEXT("Error"), MB_TOPMOST); return E_FAIL; } @@ -373,7 +373,7 @@ xvid_global_func = NULL; FreeLibrary(m_hdll); m_hdll = NULL; - MessageBox(0, "xvid_decore() not found", "Error", MB_TOPMOST); + MessageBox(0, TEXT("xvid_decore() not found"), TEXT("Error"), MB_TOPMOST); return E_FAIL; } @@ -383,7 +383,7 @@ xvid_decore_func = NULL; FreeLibrary(m_hdll); m_hdll = NULL; - MessageBox(0, "xvid_global() failed", "Error", MB_TOPMOST); + MessageBox(0, TEXT("xvid_global() failed"), TEXT("Error"), MB_TOPMOST); return E_FAIL; } @@ -393,7 +393,7 @@ xvid_decore_func = NULL; FreeLibrary(m_hdll); m_hdll = NULL; - MessageBox(0, "xvid_global() failed", "Error", MB_TOPMOST); + MessageBox(0, TEXT("xvid_global() failed"), TEXT("Error"), MB_TOPMOST); return E_FAIL; } @@ -948,14 +948,14 @@ wc.hInstance = (HINSTANCE) g_xvid_hInst; wc.hbrBackground = (HBRUSH) GetStockObject(NULL_BRUSH); wc.lpszMenuName = NULL; - wc.lpszClassName = "XVID_MSG_WINDOW"; + wc.lpszClassName = TEXT("XVID_MSG_WINDOW"); wc.hIcon = NULL; wc.hIconSm = NULL; wc.hCursor = NULL; RegisterClassEx(&wc); - MSG_hwnd = CreateWindowEx(0, "XVID_MSG_WINDOW", NULL, 0, CW_USEDEFAULT, - CW_USEDEFAULT, 0, 0, HWND_MESSAGE, NULL, (HINSTANCE) g_xvid_hInst, NULL); + MSG_hwnd = CreateWindowEx(0, TEXT("XVID_MSG_WINDOW"), NULL, 0, CW_USEDEFAULT, + CW_USEDEFAULT, 0, 0, HWND_MESSAGE, NULL, (HINSTANCE) g_xvid_hInst, NULL); /* display the tray icon */ NOTIFYICONDATA nid; @@ -966,7 +966,7 @@ nid.uID = 1456; nid.uCallbackMessage = WM_ICONMESSAGE; nid.hIcon = LoadIcon(g_xvid_hInst, MAKEINTRESOURCE(IDI_ICON)); - strcpy_s(nid.szTip, 19, "Xvid Video Decoder"); + lstrcpy(nid.szTip, TEXT("Xvid Video Decoder")); nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; Shell_NotifyIcon(NIM_ADD, &nid); @@ -1660,13 +1660,13 @@ wc.hInstance = (HINSTANCE) g_xvid_hInst; wc.hbrBackground = (HBRUSH) GetStockObject(NULL_BRUSH); wc.lpszMenuName = NULL; - wc.lpszClassName = "XVID_MSG_WINDOW"; + wc.lpszClassName = TEXT("XVID_MSG_WINDOW"); wc.hIcon = NULL; wc.hIconSm = NULL; wc.hCursor = NULL; RegisterClassEx(&wc); - MSG_hwnd = CreateWindowEx(0, "XVID_MSG_WINDOW", NULL, 0, CW_USEDEFAULT, + MSG_hwnd = CreateWindowEx(0, TEXT("XVID_MSG_WINDOW"), NULL, 0, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, HWND_MESSAGE, NULL, (HINSTANCE) g_xvid_hInst, NULL); /* display the tray icon */ @@ -1677,8 +1677,8 @@ nid.hWnd = MSG_hwnd; nid.uID = 1456; nid.uCallbackMessage = WM_ICONMESSAGE; - nid.hIcon = LoadIcon(g_xvid_hInst, MAKEINTRESOURCE(IDI_ICON)); - strcpy_s(nid.szTip, 19, "Xvid Video Decoder"); + nid.hIcon = LoadIcon(g_xvid_hInst, MAKEINTRESOURCE(IDI_ICON)); + lstrcpy(nid.szTip, TEXT("Xvid Video Decoder")); nid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; Shell_NotifyIcon(NIM_ADD, &nid); @@ -1907,7 +1907,7 @@ EnterCriticalSection(&m_mft_lock); HRESULT hr = S_OK; - IMFMediaBuffer *pBuffer; + IMFMediaBuffer *pBuffer = NULL; if (SUCCEEDED(hr)) { hr = pSample->ConvertToContiguousBuffer(&pBuffer); @@ -2161,9 +2161,9 @@ } if (m_hdll == NULL) { - HRESULT hr = OpenLib(); + HRESULT hr2 = OpenLib(); - if (FAILED(hr) || (m_hdll == NULL)) // Paranoid checks. + if (FAILED(hr2) || (m_hdll == NULL)) // Paranoid checks. hr = MF_E_INVALIDTYPE; } =================================================================== We need OutputDebugStringA (which is preferrable) since the strings are ASCII. Index: xvidcore/dshow/src/debug.c =================================================================== --- xvidcore/dshow/src/debug.c (revision 2017) +++ xvidcore/dshow/src/debug.c (working copy) @@ -13,6 +13,6 @@ va_start(args, fmt); vsprintf(buf, fmt, args); - OutputDebugString(buf); + OutputDebugStringA(buf); #endif } =================================================================== This patch ensure that the calling convention of exported xvidcore functions is correct regardless of compile settings in calling applications. This makes the library robust against __stdcall/__fastcall compile settings in Xvid implementations. The calling convention is specified with the XVID_CALL macro and is only visible for compilers that care about these things. I also added the XVID_IMPEXP macro to mark exported functions (for convenience). NB: xvidcore itself cannot be compiled with __stdcall/__fastcall without extensive changes in the code (mostly due to assembler source). A developer may be successful if alterering the assembler options to allow __stdcall/__fastcall calling conventions and using an assembler that support these features. Otherwise all functions implemented in assembler must be marked with the XVID_CALL macro. There is however currently no good place to define this macro since not all source files include xvid.h. A realistic view is therefore to state that xvidcore require a __cdecl calling convention. In 64-bit this is of course no issue. Index: xvidcore/src/xvid.h =================================================================== --- xvidcore/src/xvid.h (revision 2017) +++ xvidcore/src/xvid.h (working copy) @@ -26,12 +26,28 @@ #ifndef _XVID_H_ #define _XVID_H_ - #ifdef __cplusplus extern "C" { #endif /***************************************************************************** + * function export defines + ****************************************************************************/ + +#if defined(XVID_BUILD_DLL) && (defined(_WIN32) || defined(__CYGWIN__) || defined(_MSC_VER)) +#define XVID_IMPEXP __declspec(dllexport) +#elif defined(XVID_BUILD_DLL) && (defined(__GNUC__) && (__GNUC__ >= 4)) +#define XVID_IMPEXP __attribute__ ((visibility ("default"))) +#else +#define XVID_IMPEXP extern +#endif +#if defined(_WIN32) || defined(_MSC_VER) +#define XVID_CALL __cdecl +#else +#define XVID_CALL +#endif + +/***************************************************************************** * versioning ****************************************************************************/ @@ -225,7 +241,7 @@ #define XVID_GBL_INFO 1 /* return some info about xvidcore, and the host computer */ #define XVID_GBL_CONVERT 2 /* colorspace conversion utility */ -extern int xvid_global(void *handle, int opt, void *param1, void *param2); +XVID_IMPEXP int XVID_CALL xvid_global(void *handle, int opt, void *param1, void *param2); /***************************************************************************** @@ -236,7 +252,7 @@ #define XVID_DEC_DESTROY 1 /* destroy decore instance: return 0 on success */ #define XVID_DEC_DECODE 2 /* decode a frame: returns number of bytes consumed >= 0 */ -extern int xvid_decore(void *handle, int opt, void *param1, void *param2); +XVID_IMPEXP int XVID_CALL xvid_decore(void *handle, int opt, void *param1, void *param2); /* XVID_DEC_CREATE param 1 image width & height as well as FourCC code may be specified @@ -475,7 +491,7 @@ ****************************************************************************/ -typedef int (xvid_plugin_func)(void * handle, int opt, void * param1, void * param2); +typedef int (XVID_CALL xvid_plugin_func)(void * handle, int opt, void * param1, void * param2); typedef struct { @@ -483,20 +499,19 @@ void * param; } xvid_enc_plugin_t; +XVID_IMPEXP xvid_plugin_func xvid_plugin_single; /* single-pass rate control */ +XVID_IMPEXP xvid_plugin_func xvid_plugin_2pass1; /* two-pass rate control: first pass */ +XVID_IMPEXP xvid_plugin_func xvid_plugin_2pass2; /* two-pass rate control: second pass */ -extern xvid_plugin_func xvid_plugin_single; /* single-pass rate control */ -extern xvid_plugin_func xvid_plugin_2pass1; /* two-pass rate control: first pass */ -extern xvid_plugin_func xvid_plugin_2pass2; /* two-pass rate control: second pass */ +XVID_IMPEXP xvid_plugin_func xvid_plugin_lumimasking; /* lumimasking */ -extern xvid_plugin_func xvid_plugin_lumimasking; /* lumimasking */ +XVID_IMPEXP xvid_plugin_func xvid_plugin_psnr; /* write psnr values to stdout */ +XVID_IMPEXP xvid_plugin_func xvid_plugin_dump; /* dump before and after yuvpgms */ -extern xvid_plugin_func xvid_plugin_psnr; /* write psnr values to stdout */ -extern xvid_plugin_func xvid_plugin_dump; /* dump before and after yuvpgms */ +XVID_IMPEXP xvid_plugin_func xvid_plugin_ssim; /*write ssim values to stdout*/ +XVID_IMPEXP xvid_plugin_func xvid_plugin_psnrhvsm; /*write psnrhvsm values to stdout*/ -extern xvid_plugin_func xvid_plugin_ssim; /*write ssim values to stdout*/ -extern xvid_plugin_func xvid_plugin_psnrhvsm; /*write psnrhvsm values to stdout*/ - /* single pass rate control * CBR and Constant quantizer modes */ typedef struct @@ -591,7 +606,7 @@ * Encoder entry point *--------------------------------------------------------------------------*/ -extern int xvid_encore(void *handle, int opt, void *param1, void *param2); +XVID_IMPEXP int XVID_CALL xvid_encore(void *handle, int opt, void *param1, void *param2); /* Quick API reference *