ref: 93d58ee06e588de289779d06fe96d0d3fb8fe935
parent: 32ebf966c5cb2cd5370b5a36477f268aac7e0943
parent: 9254d722d397569a1e4d2bbce99bde6c5374830c
author: Ethan Hugg <[email protected]>
date: Fri Dec 27 03:09:00 EST 2013
Merge branch 'master' of https://github.com/ethanhugg/openh264 into cosmetic
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-UNAME=$(shell uname | tr A-Z a-z)
+UNAME=$(shell uname | tr A-Z a-z | tr -d \\-[:digit:].)
LIBPREFIX=lib
LIBSUFFIX=a
CP=cp
@@ -35,7 +35,7 @@
CFLAGS += -DNO_DYNAMIC_VP -DHAVE_CACHE_LINE_ALIGN
LDFLAGS +=
-ASMFLAGS += -DNO_DYNAMIC_VP -DNOPREFIX
+ASMFLAGS += -DNO_DYNAMIC_VP
#### No user-serviceable parts below this line
--- a/README.md
+++ b/README.md
@@ -47,40 +47,42 @@
- ARMv7 optionally with NEON (initial release does not include this target, will follow later)
- Any architecture using C/C++ fallback functions
-Using the Library
+Building the Library
-----------------------
-Linux makefiles for 32 bit builds are available:
- : build the decoder library and executable via codec/build/linux/dec/makefile
- : build the encoder library and executable via codec/build/linux/enc/makefile
- : build the encoder shared library via processing/build/linux/makefile
+NASM needed to be installed for assembly code: workable version 2.07 or above, nasm can downloaded from http://www.nasm.us/
+For Windows Builds
+-----------------------
Windows Visual Studio 2008/2010/2012 projects are available:
: build the decoder via the Visual Studio projects in codec/build/win32/dec
: build the encoder via the Visual Studio projects in codec/build/win32/enc
: build the encoder shared library via the Visual Studio projects in processing/build/win32/
-NASM needed to be installed for assembly code: workable version 2.07 or above, nasm can downloaded from http://www.nasm.us/
+The command line programs will be bin/win32/decConsoled.exe and bin/win32/encConsole.exe.
-API details to be provided later.
-
-Using the Test App
--------------------------
-Linux shell scripts to build the test apps:
- : build via testbin/AutoBuild_Linux.sh
- : clean via testbin/AutoClean_Linux.sh
-
-Windows batch files to build the test apps:
+Windows batch files also exist for building:
: Visual Studio 2008 use testbin/AutoBuild_Windows_VS2008.bat
: Visual Studio 2010 use testbin/AutoBuild_Windows_VS2010.bat
: Visual Studio 2012 use testbin/AutoBuild_Windows_VS2012.bat
+For Other Platforms
+------------------------
+From the main project directory:
+'make' for 32bit builds
+'make ENABLE64BIT=Yes' for 64bit builds
+
+The command line programs h264enc and h264dec will appear in the main project directory.
+
+A shell script to run the command-line apps is in testbin/CmdLineExample.sh
+
Usage information can be found in testbin/CmdLineReadMe
-Command line options and details to be provided later.
Using the Source
-----------------------
codec - encoder, decoder, console (test app), build (makefile, vcproj)
processing - raw pixel processing (used by encoder)
+build - scripts for Makefile build system.
+test - GTest unittest files.
testbin - autobuild scripts, test app config files, yuv test files
bin - binaries for library and test app
--- a/build/platform-darwin.mk
+++ b/build/platform-darwin.mk
@@ -2,4 +2,4 @@
ASM = nasm
CFLAGS += -Werror -fPIC
LDFLAGS += -lpthread
-ASMFLAGS += -f macho --prefix _
+ASMFLAGS += -f macho --prefix _ -DNOPREFIX
--- a/build/platform-freebsd.mk
+++ b/build/platform-freebsd.mk
@@ -1,5 +1,5 @@
ASM = nasm
CFLAGS += -fPIC
LDFLAGS += -lpthread
-ASMFLAGS += -f elf
+ASMFLAGS += -f elf -DNOPREFIX
--- a/build/platform-linux.mk
+++ b/build/platform-linux.mk
@@ -1,5 +1,5 @@
ASM = nasm
CFLAGS += -Werror -fPIC -DLINUX -D__NO_CTYPE
LDFLAGS += -lpthread
-ASMFLAGS += -f elf
+ASMFLAGS += -f elf -DNOPREFIX
--- /dev/null
+++ b/build/platform-mingw_nt.mk
@@ -1,0 +1,5 @@
+ASM = nasm
+CFLAGS += -DWIN32 -D__NO_CTYPE
+LDFLAGS +=
+ASMFLAGS += -f win -DPREFIX
+
--- a/codec/api/svc/codec_app_def.h
+++ b/codec/api/svc/codec_app_def.h
@@ -74,7 +74,7 @@
ENCODER_OPTION_IDR_INTERVAL,
ENCODER_OPTION_SVC_ENCODE_PARAM,
ENCODER_OPTION_FRAME_RATE,
- ENCODER_OPTION_iBitRate,
+ ENCODER_OPTION_BITRATE,
ENCODER_OPTION_INTER_SPATIAL_PRED,
ENCODER_OPTION_RC_MODE,
ENCODER_PADDING_PADDING,
--- a/codec/console/dec/src/h264dec.cpp
+++ b/codec/console/dec/src/h264dec.cpp
@@ -344,7 +344,6 @@
printf ("Specified file: %s not exist, maybe invalid path or parameter settting.\n", cReadCfg.GetFileName().c_str());
return 1;
}
- memset (&sDecParam, 0, sizeof (sDecParam));
while (!cReadCfg.EndOfFile()) {
long nRd = cReadCfg.ReadLine (&strTag[0]);
@@ -382,7 +381,6 @@
} else if (strstr (pArgV[1],
".264")) { // no output dump yuv file, just try to render the decoded pictures //confirmed_safe_unsafe_usage
strInputFile = pArgV[1];
- memset (&sDecParam, 0, sizeof (sDecParam));
sDecParam.iOutputColorFormat = videoFormatI420;
sDecParam.uiTargetDqLayer = (uint8_t) - 1;
sDecParam.uiEcActiveFlag = 1;
@@ -391,26 +389,28 @@
} else { //iArgC > 2
strInputFile = pArgV[1];
strOutputFile = pArgV[2];
- memset (&sDecParam, 0, sizeof (sDecParam));
sDecParam.iOutputColorFormat = videoFormatI420;
sDecParam.uiTargetDqLayer = (uint8_t) - 1;
sDecParam.uiEcActiveFlag = 1;
sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;
if (iArgC > 3) {
- // Basic option parser. Note that this is not safe about the
- // number of remaining arguments.
- // TODO: rewrite
for (int i = 3; i < iArgC; i++) {
char* cmd = pArgV[i];
if (!strcmp (cmd, "-options")) {
- strOutputFile = pArgV[i + 1];
- i += 2;
+ if (i + 1 < iArgC)
+ strOptionFile = pArgV[i++];
+ else {
+ printf ("options file not specified.\n");
+ return 1;
+ }
} else if (!strcmp (cmd, "-trace")) {
- WelsStderrSetTraceLevel (atoi (pArgV[i + 1]));
- i += 2;
- } else {
- i++;
+ if (i + 1 < iArgC)
+ WelsStderrSetTraceLevel (atoi (pArgV[i++]));
+ else {
+ printf ("trace level not specified.\n");
+ return 1;
+ }
}
}
}
@@ -494,4 +494,3 @@
return 0;
}
-
--- a/codec/console/dec/src/read_config.cpp
+++ b/codec/console/dec/src/read_config.cpp
@@ -37,7 +37,7 @@
* 08/18/2008 Created
*
*****************************************************************************/
-#if !defined(_WIN32)
+#if !defined(_WIN32) || !defined(_MSC_VER)
#include <string.h>
#include <stdio.h>
#endif
--- a/codec/console/enc/src/welsenc.cpp
+++ b/codec/console/enc/src/welsenc.cpp
@@ -905,11 +905,13 @@
int iParsedNum = 3;
if (ParseCommandLine (argc - iParsedNum, argv + iParsedNum, sSvcParam) != 0) {
printf ("parse pCommand line failed\n");
+ fclose(pFpSrc);
return 1;
}
if (cmResultSuccess != pPtrEnc->Initialize (&sSvcParam, INIT_TYPE_PARAMETER_BASED)) {
fprintf (stderr, "Encoder Initialization failed!\n");
+ fclose(pFpSrc);
return 1;
}
@@ -1414,10 +1416,7 @@
if (argc < 2) {
goto exit;
} else {
- string strCfgFileName = argv[1];
- basic_string <char>::size_type index;
- index = strCfgFileName.rfind (".cfg"); // check configuration type (like .cfg?)
- if (index == std::string::npos) {
+ if (!strstr(argv[1], ".cfg")) { // check configuration type (like .cfg?)
if (argc > 2) {
iRet = ProcessEncodingSvcWithParam (pSVCEncoder, argc, argv);
if (iRet != 0)
--- a/codec/decoder/core/src/bit_stream.cpp
+++ b/codec/decoder/core/src/bit_stream.cpp
@@ -48,7 +48,7 @@
}
#else //WORDS_BIGENDIAN
-#ifdef WIN32
+#if defined(WIN32) && defined(_MSC_VER)
inline uint32_t EndianFix (uint32_t uiX) {
__asm {
mov eax, uiX
--- a/codec/decoder/core/src/parse_mb_syn_cavlc.cpp
+++ b/codec/decoder/core/src/parse_mb_syn_cavlc.cpp
@@ -708,7 +708,7 @@
for (; i < uiTotalCoeff; i++) {
if (pBitsCache->uiRemainBits <= 16) SHIFT_BUFFER (pBitsCache);
-#if defined(WIN32) && !defined(WIN64)
+#if defined(WIN32) && !defined(WIN64) && defined(_MSC_VER)
uiCache32Bit = pBitsCache->uiCache32Bit;
WELS_GET_PREFIX_BITS (uiCache32Bit, iPrefixBits);
#else
@@ -811,7 +811,7 @@
iRun[i] = pVlcTable->kpZeroTable[6][uiValue][0];
} else {
if (pBitsCache->uiRemainBits < 16) SHIFT_BUFFER (pBitsCache);
-#if defined(WIN32) && !defined(WIN64)
+#if defined(WIN32) && !defined(WIN64) && defined(_MSC_VER)
uiCache32Bit = pBitsCache->uiCache32Bit;
WELS_GET_PREFIX_BITS (uiCache32Bit, iPrefixBits);
#else
@@ -1345,4 +1345,4 @@
return 0;
}
-} // namespace WelsDec
\ No newline at end of file
+} // namespace WelsDec
--- a/codec/decoder/core/src/utils.cpp
+++ b/codec/decoder/core/src/utils.cpp
@@ -46,10 +46,16 @@
#include <windows.h>
#include <sys/types.h>
#include <sys/timeb.h>
+#ifndef _MSC_VER
+#include <sys/time.h>
+#ifndef HAVE_STRNLEN
+#define strnlen(a,b) strlen(a)
+#endif //!HAVE_STRNLEN
+#endif //!_MSC_VER
#else
#include <sys/time.h>
#include <sys/timeb.h>
-#endif
+#endif //_WIN32
#include "utils.h"
#include "macros.h"
@@ -79,7 +85,7 @@
}
-#if defined(_WIN32)
+#if defined(_WIN32) && defined(_MSC_VER)
#if defined(_MSC_VER) && (_MSC_VER>=1500)
@@ -275,4 +281,4 @@
return fflush (pFp);
}
-} // namespace WelsDec
\ No newline at end of file
+} // namespace WelsDec
--- a/codec/decoder/plus/src/welsDecoderExt.cpp
+++ b/codec/decoder/plus/src/welsDecoderExt.cpp
@@ -480,6 +480,5 @@
void_t DestroyDecoder (ISVCDecoder* pDecoder) {
if (NULL != pDecoder) {
delete (CWelsDecoder*)pDecoder;
- pDecoder = NULL;
}
}
--- a/codec/encoder/core/inc/crt_util_safe_x.h
+++ b/codec/encoder/core/inc/crt_util_safe_x.h
@@ -375,9 +375,7 @@
#endif//(WIN32 && _MSC_VER && _MSC_VER<1500) || __GNUC__
-#if defined(WIN32)
-
-#ifdef _MSC_VER
+#if defined(WIN32) && defined(_MSC_VER)
#if _MSC_VER >= 1500 // VS2008
#define SNPRINTF _snprintf_s
#define LOCALTIME localtime_s
@@ -397,7 +395,6 @@
#define VSPRINTF vsprintf
#define FOPEN fopen
#endif//_MSC_VER >= 1500
-#endif//_MSC_VER
#else//__GNUC__
--- a/codec/encoder/core/inc/macros.h
+++ b/codec/encoder/core/inc/macros.h
@@ -273,7 +273,7 @@
#else
-#if defined(WIN32) && !defined(WIN64)
+#if defined(WIN32) && !defined(WIN64) && defined(_MSC_VER)
static inline uint32_t ENDIAN_FIX (uint32_t x) {
__asm {
mov eax, x
--- a/codec/encoder/core/src/slice_multi_threading.cpp
+++ b/codec/encoder/core/src/slice_multi_threading.cpp
@@ -41,7 +41,7 @@
#if defined(MT_ENABLED)
#include <assert.h>
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(_WIN32)
#include <semaphore.h>
#ifndef SEM_NAME_MAX
// length of semaphore name should be system constrained at least on mac 10.7
@@ -441,7 +441,7 @@
iIdx = 0;
while (iIdx < iThreadNum) {
-#ifdef __GNUC__ // for posix threading
+#if defined(__GNUC__) && !defined(_WIN32) // for posix threading
str_t name[SEM_NAME_MAX] = {0};
int32_t used_len = 0;
WELS_THREAD_ERROR_CODE err = 0;
@@ -488,7 +488,7 @@
err = WelsEventOpen (&pSmt->pReadySliceCodingEvent[iIdx], name);
#if defined(ENABLE_TRACE_MT)
WelsLog ((*ppCtx), WELS_LOG_INFO, "[MT] Open pReadySliceCodingEvent%d = 0x%p named(%s) ret%d err%d\n", iIdx,
- (void*)pSmt->pReadySliceCodingEvent[iIdx]), (void*) (*ppCtx), err, errno);
+ (void*)pSmt->pReadySliceCodingEvent[iIdx], (void*) (*ppCtx), err, errno);
#endif
#endif//_WIN32
@@ -852,7 +852,7 @@
}
#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
-#if defined(__GNUC__)
+#if defined(__GNUC__) && !defined(_WIN32)
WELS_THREAD_ROUTINE_TYPE UpdateMbListThreadProc (void* arg) {
SSliceThreadPrivateData* pPrivateData = (SSliceThreadPrivateData*)arg;
sWelsEncCtx* pEncPEncCtx = NULL;
@@ -1243,7 +1243,7 @@
// due to WelsMultipleEventsWaitSingleBlocking implememtation can not work well
// in case waiting pUpdateMbListEvent and pReadySliceCodingEvent events at the same time
#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
-#if defined(__GNUC__)
+#if defined(__GNUC__) && !defined(_WIN32)
WelsThreadCreate (&pCtx->pSliceThreading->pUpdateMbListThrdHandles[iIdx], UpdateMbListThreadProc,
&pCtx->pSliceThreading->pThreadPEncCtx[iIdx], 0);
#endif//__GNUC__
--- a/codec/encoder/core/src/utils.cpp
+++ b/codec/encoder/core/src/utils.cpp
@@ -46,6 +46,9 @@
#include <windows.h>
#include <sys/types.h>
#include <sys/timeb.h>
+#ifndef _MSC_VER
+#include <sys/time.h>
+#endif
#else
#include <sys/time.h>
#endif
@@ -147,23 +150,20 @@
if (pEncCtx) {
time_t l_time;
-#if defined(_WIN32)
-#if defined(_MSC_VER)
+#if defined(_WIN32) && defined(_MSC_VER)
#if _MSC_VER >= 1500
struct tm t_now;
#else//VC6
struct tm* t_now;
#endif//_MSC_VER >= 1500
-#endif//_MSC_VER
#else//__GNUC__
struct tm* t_now;
#endif//WIN32
-#if defined( _WIN32 )
+#if defined( _WIN32 ) && defined(_MSC_VER)
struct _timeb tb;
time (&l_time);
-#ifdef _MSC_VER
#if _MSC_VER >= 1500
LOCALTIME (&t_now, &l_time);
#else
@@ -172,7 +172,6 @@
return;
}
#endif//_MSC_VER >= 1500
-#endif//_MSC_VER
FTIME (&tb);
#elif defined( __GNUC__ )
struct timeval tv;
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -946,11 +946,11 @@
}
break;
- case ENCODER_OPTION_iBitRate: { // Target bit-rate
+ case ENCODER_OPTION_BITRATE: { // Target bit-rate
int32_t iValue = * ((int32_t*)pOption);
#ifdef REC_FRAME_COUNT
WelsLog (m_pEncContext, WELS_LOG_INFO,
- "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_iBitRate, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n",
+ "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n",
m_uiCountFrameNum, m_iCspInternal, iValue);
#endif//REC_FRAME_COUNT
m_pEncContext->pSvcParam->iTargetBitrate = iValue;
@@ -1075,10 +1075,10 @@
* ((float*)pOption) = m_pEncContext->pSvcParam->fMaxFrameRate;
}
break;
- case ENCODER_OPTION_iBitRate: { // Target bit-rate
+ case ENCODER_OPTION_BITRATE: { // Target bit-rate
#ifdef REC_FRAME_COUNT
WelsLog (m_pEncContext, WELS_LOG_INFO,
- "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_iBitRate, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",
+ "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",
m_uiCountFrameNum, m_iCspInternal);
#endif//REC_FRAME_COUNT
* ((int32_t*)pOption) = m_pEncContext->pSvcParam->iTargetBitrate;
--- a/processing/src/common/typedef.h
+++ b/processing/src/common/typedef.h
@@ -52,7 +52,7 @@
WELSVP_NAMESPACE_BEGIN
-#if defined(_WIN32) || defined(_WIN32) || defined(_MSC_VER)
+#if ( defined(_WIN32) || defined(_WIN32) ) && defined(_MSC_VER)
typedef char int8_t ;
typedef unsigned char uint8_t ;
--- a/processing/src/testbed/WelsVideoProcessor.cpp
+++ /dev/null
@@ -1,382 +1,0 @@
-/*!
- * \copy
- * Copyright (c) 2013, Cisco Systems
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-// WelsVideoProcessor.cpp : Defines the entry point for the console application.
-//
-
-#include <tchar.h>
-#include "stdafx.h"
-#include "wels_process.h"
-
-//////////////////////////////////////////////////////////////////////////
-typedef struct {
- FILE* srcfile;
- FILE* dstfile;
- vPixMap src;
- vPixMap dst;
- vMethods methods[vMethods_Mask];
-} VpConfigure;
-//////////////////////////////////////////////////////////////////////////
-
-void PrintHelp (TCHAR* strAppName, TCHAR* strError) {
- if (strError) {
- _tprintf (_T ("Error: %s\n"), strError);
- } else {
- _tprintf (_T ("Welsvp Sample Console\n"));
- }
-
- _tprintf (_T ("Usage1: %s [Options] -i InputFile -o OutputFile -w 640 -h 480\n"), strAppName);
- _tprintf (_T ("Options: \n"));
-
- _tprintf (_T (" [-sx x] - cropX of src video (def: 0)\n"));
- _tprintf (_T (" [-sy y] - cropY of src video (def: 0)\n"));
- _tprintf (_T (" [-sw width] - cropW of src video (def: width)\n"));
- _tprintf (_T (" [-sh height] - cropH of src video (def: height)\n"));
- _tprintf (_T (" [-scc format] - format (FourCC) of src video (def: support yv12|yuy2|rgb3|rgb4)\n"));
-
- _tprintf (_T (" [-dx x] - cropX of dst video (def: 0)\n"));
- _tprintf (_T (" [-dy y] - cropY of dst video (def: 0)\n"));
- _tprintf (_T (" [-dw width] - cropW of dst video (def: width)\n"));
- _tprintf (_T (" [-dh height] - cropH of dst video (def: height)\n"));
- _tprintf (_T (" [-dcc format] - format (FourCC) of dst video (def: nv12. support nv12|yuy2)\n"));
-
- _tprintf (_T (" Video Processing Algorithms\n"));
- _tprintf (_T (" [-vaa] - enable video analysis algorithm \n"));
- _tprintf (_T (" [-bgd] - enable background detection algorithm \n"));
- _tprintf (_T (" [-scd] - enable scene change detection algorithm \n"));
- _tprintf (_T (" [-denoise] - enable denoise algorithm \n"));
- _tprintf (_T (" [-downsample] - enable downsample algorithm \n"));
-
- _tprintf (_T (" [-n frames] - number of frames to VP process\n\n"));
- _tprintf (_T ("\n"));
-
- _tprintf (_T ("Usage2: %s -sw 640 -sh 480 -scc rgb3 -dw 320 -dh 240 -dcc i420 -denoise -vaa -i in.rgb -o out.yuv\n"),
- strAppName);
- _tprintf (_T ("\n"));
-}
-
-vVideoFormat Str2FourCC (TCHAR* strInput) {
- vVideoFormat format = vVideoFormat_I420; // as default
-
- if (0 == _tcscmp (strInput, _T ("yv12"))) {
- format = vVideoFormat_YV12;
- } else if (0 == _tcscmp (strInput, _T ("i420"))) {
- format = vVideoFormat_I420;
- } else if (0 == _tcscmp (strInput, _T ("rgb24"))) {
- format = vVideoFormat_RGB24;
- } else if (0 == _tcscmp (strInput, _T ("rgb32"))) {
- format = vVideoFormat_RGB32;
- } else if (0 == _tcscmp (strInput, _T ("yuy2"))) {
- format = vVideoFormat_YUY2;
- } else if (0 == _tcscmp (strInput, _T ("nv12"))) {
- format = vVideoFormat_NV12;
- }
-
- return format;
-}
-
-int ReadFile (vPixMap& pixmap, FILE* fp) {
- int ret = 0;
-
- int size = pixmap.Rect.width * pixmap.Rect.height;
- switch (pixmap.eFormat) {
- case vVideoFormat_I420:
- case vVideoFormat_YV12: {
- if (fread (pixmap.pPixel[0], pixmap.nSizeInBits / 8, (3 * size) >> 1, fp) <= 0)
- ret = 1;
- }
- break;
- case vVideoFormat_YUY2: {
- if (fread (pixmap.pPixel[0], pixmap.nSizeInBits / 8, 2 * size, fp) <= 0)
- ret = 1;
- }
- break;
- case vVideoFormat_RGB24: {
- if (fread (pixmap.pPixel[0], pixmap.nSizeInBits / 8, 3 * size, fp) <= 0)
- ret = 1;
- }
- break;
- case vVideoFormat_RGB32: {
- if (fread (pixmap.pPixel[0], pixmap.nSizeInBits / 8, 4 * size, fp) <= 0)
- ret = 1;
- }
- break;
- default:
- ret = 1;
- break;
- }
- return ret;
-}
-
-int WriteFile (vPixMap& pixmap, FILE* fp) {
- int ret = 0;
- int size = pixmap.Rect.width * pixmap.Rect.height;
- switch (pixmap.eFormat) {
- case vVideoFormat_I420:
- case vVideoFormat_YV12: {
- if (fwrite (pixmap.pPixel[0], pixmap.nSizeInBits / 8, (3 * size) >> 1, fp) <= 0)
- ret = 1;
- }
- break;
- case vVideoFormat_YUY2: {
- if (fwrite (pixmap.pPixel[0], pixmap.nSizeInBits / 8, 2 * size, fp) <= 0)
- ret = 1;
- }
- break;
- case vVideoFormat_RGB24: {
- if (fwrite (pixmap.pPixel[0], pixmap.nSizeInBits / 8, 3 * size, fp) <= 0)
- ret = 1;
- }
- break;
- case vVideoFormat_RGB32: {
- if (fwrite (pixmap.pPixel[0], pixmap.nSizeInBits / 8, 4 * size, fp) <= 0)
- ret = 1;
- }
- break;
- default:
- ret = 1;
- break;
- }
- return ret;
-}
-
-
-int AllocPixMap (vPixMap& pixmap) {
- pixmap.nSizeInBits = sizeof (unsigned char) * 8;
-
- switch (pixmap.eFormat) {
- case vVideoFormat_I420:
- case vVideoFormat_YV12: {
- pixmap.nStride[0] = pixmap.Rect.width;
- pixmap.nStride[1] = pixmap.nStride[2] = pixmap.Rect.width / 2;
- pixmap.pPixel[0] = new void* [pixmap.nStride[0] * pixmap.Rect.height * pixmap.nSizeInBits / 8 * 3 / 2];
- pixmap.pPixel[1] = (unsigned char*)pixmap.pPixel[0] + pixmap.nStride[0] * pixmap.Rect.height * pixmap.nSizeInBits / 8;
- pixmap.pPixel[2] = (unsigned char*)pixmap.pPixel[0] + pixmap.nStride[0] * pixmap.Rect.height * pixmap.nSizeInBits /
- 8 * 5 / 4;
- }
- break;
-
- case vVideoFormat_YUY2: {
- pixmap.nStride[0] = pixmap.nStride[1] = pixmap.nStride[2] = pixmap.Rect.width * 2;
- pixmap.pPixel[0] = new void* [pixmap.nStride[0] * pixmap.Rect.height * pixmap.nSizeInBits / 8 * 2];
- pixmap.pPixel[1] = pixmap.pPixel[2] = NULL;
- }
- break;
-
- case vVideoFormat_RGB24: {
- pixmap.nStride[0] = pixmap.nStride[1] = pixmap.nStride[2] = pixmap.Rect.width * 3;
- pixmap.pPixel[0] = new void* [pixmap.nStride[0] * pixmap.Rect.height * pixmap.nSizeInBits / 8 * 3];
- pixmap.pPixel[1] = pixmap.pPixel[2] = NULL;
- }
- break;
-
- case vVideoFormat_RGB32: {
- pixmap.nStride[0] = pixmap.nStride[1] = pixmap.nStride[2] = pixmap.Rect.width * 4;
- pixmap.pPixel[0] = new void* [pixmap.nStride[0] * pixmap.Rect.height * pixmap.nSizeInBits / 8 * 4];
- pixmap.pPixel[1] = pixmap.pPixel[2] = NULL;
- }
- break;
-
- default:
- return 1;
- }
-
- return (pixmap.pPixel[0]) ? 0 : 1;
-}
-
-void FreePixMap (vPixMap& pixmap) {
- if (pixmap.pPixel[0]) {
- free (pixmap.pPixel[0]);
- pixmap.pPixel[0] = pixmap.pPixel[1] = pixmap.pPixel[2] = NULL;
- }
-}
-
-int InitResource (TCHAR* strAppName, VpConfigure& cfg) {
- if (0 == cfg.srcfile) {
- PrintHelp (strAppName, _T ("Source file can not found!\n"));
- goto exit;
- };
-
- if (0 == cfg.dstfile) {
- PrintHelp (strAppName, _T ("Destination file name not found"));
- goto exit;
- };
-
- if (cfg.dst.Rect.width == 0)
- cfg.dst.Rect.width = cfg.src.Rect.width;
- if (cfg.dst.Rect.height == 0)
- cfg.dst.Rect.height = cfg.src.Rect.height;
-
- cfg.methods[vMethods_ColorSpaceConvert] = vMethods_ColorSpaceConvert;
-
- if (AllocPixMap (cfg.src))
- goto exit;
-
- if (AllocPixMap (cfg.dst))
- goto exit;
-
- return 0;
-
-exit:
- FreePixMap (cfg.src);
- FreePixMap (cfg.dst);
- return 1;
-}
-
-int ParseCommond (TCHAR* strInput[], int nArgNum, VpConfigure& cfg) {
- if (nArgNum < 9) {
- PrintHelp (strInput[0], _T ("please specify all necessary parameters!"));
- return 1;
- }
-
- int width = 0, height = 0;
- for (int i = 1; i < nArgNum; i++) {
- if (strInput[i]) {
- if (0 == _tcscmp (strInput[i], _T ("-i"))) {
- i++;
- _tfopen_s (&cfg.srcfile, strInput[i], _T ("rb"));
- } else if (0 == _tcscmp (strInput[i], _T ("-o"))) {
- i++;
- _tfopen_s (&cfg.dstfile, strInput[i], _T ("wb"));
- } else if (0 == _tcscmp (strInput[i], _T ("-w"))) {
- i++;
- _stscanf_s (strInput[i], _T ("%d"), &width);
- } else if (0 == _tcscmp (strInput[i], _T ("-h"))) {
- i++;
- _stscanf_s (strInput[i], _T ("%d"), &height);
- }
- //-----------------------------------------------------------------------------------
- else if (0 == _tcscmp (strInput[i], _T ("-sx"))) {
- i++;
- _stscanf_s (strInput[i], _T ("%hd"), &cfg.src.Rect.top);
- } else if (0 == _tcscmp (strInput[i], _T ("-sy"))) {
- i++;
- _stscanf_s (strInput[i], _T ("%hd"), &cfg.src.Rect.left);
- } else if (0 == _tcscmp (strInput[i], _T ("-sw"))) {
- i++;
- TCHAR* a = strInput[i];
- _stscanf_s (strInput[i], _T ("%hd"), &cfg.src.Rect.width);
- } else if (0 == _tcscmp (strInput[i], _T ("-sh"))) {
- i++;
- _stscanf_s (strInput[i], _T ("%hd"), &cfg.src.Rect.height);
- } else if (0 == _tcscmp (strInput[i], _T ("-scc"))) {
- i++;
- cfg.src.eFormat = Str2FourCC (strInput[i]);
- }
- //-----------------------------------------------------------------------------------
- else if (0 == _tcscmp (strInput[i], _T ("-dx"))) {
- i++;
- _stscanf_s (strInput[i], _T ("%hd"), &cfg.dst.Rect.top);
- } else if (0 == _tcscmp (strInput[i], _T ("-dy"))) {
- i++;
- _stscanf_s (strInput[i], _T ("%hd"), &cfg.dst.Rect.left);
- } else if (0 == _tcscmp (strInput[i], _T ("-dw"))) {
- i++;
- _stscanf_s (strInput[i], _T ("%hd"), &cfg.dst.Rect.width);
- } else if (0 == _tcscmp (strInput[i], _T ("-dh"))) {
- i++;
- _stscanf_s (strInput[i], _T ("%hd"), &cfg.dst.Rect.height);
- } else if (0 == _tcscmp (strInput[i], _T ("-dcc"))) {
- i++;
- cfg.dst.eFormat = Str2FourCC (strInput[i]);
- }
- //-----------------------------------------------------------------------------------
- else if (0 == _tcscmp (strInput[i], _T ("-denoise"))) {
- cfg.methods[vMethods_Denoise] = vMethods_Denoise;
- } else if (0 == _tcscmp (strInput[i], _T ("-scd"))) {
- cfg.methods[vMethods_SceneChangeDetection] = vMethods_SceneChangeDetection;
- } else if (0 == _tcscmp (strInput[i], _T ("-downsample"))) {
- } else if (0 == _tcscmp (strInput[i], _T ("-vaa"))) {
- } else if (0 == _tcscmp (strInput[i], _T ("-bgd"))) {
- } else if (0 == _tcscmp (strInput[i], _T ("-aq"))) {
- }
- }
- }
-
- if (cfg.src.Rect.width == 0) cfg.src.Rect.width = width;
- if (cfg.src.Rect.height == 0) cfg.src.Rect.height = height;
- if (cfg.dst.Rect.width == 0) cfg.dst.Rect.width = width;
- if (cfg.dst.Rect.height == 0) cfg.dst.Rect.height = height;
-
- return InitResource (strInput[0], cfg);
-}
-
-int _tmain (int argc, _TCHAR* argv[]) {
- int ret = 0;
- VpConfigure cfg = {0};
- IWelsVpPlugin* pVpp = NULL;
-
- ret = ParseCommond (argv, argc, cfg);
- if (ret)
- goto exit;
-
- pVpp = new IWelsVpPlugin (ret);
- if (pVpp && ret == 0) {
- vResult vret = vRet_Success;
- while (1) {
- if (feof (cfg.srcfile))
- break;
-
- if (ReadFile (cfg.src, cfg.srcfile))
- break;
-
- vret = pVpp->Process (cfg.methods[vMethods_ColorSpaceConvert], &cfg.src, &cfg.dst);
- if (vret)
- break;
-
- vret = pVpp->Process (cfg.methods[vMethods_Denoise], &cfg.dst, NULL);
- if (vret)
- break;
-
- if (WriteFile (cfg.dst, cfg.dstfile))
- break;
- }
- }
-
-exit:
-
- if (pVpp) {
- delete pVpp;
- pVpp = NULL;
- }
-
- if (cfg.srcfile)
- fclose (cfg.srcfile);
- if (cfg.dstfile)
- fclose (cfg.dstfile);
-
- FreePixMap (cfg.src);
- FreePixMap (cfg.dst);
-
- return 0;
-}
-
--- a/processing/src/testbed/bundleloader.h
+++ /dev/null
@@ -1,87 +1,0 @@
-/*!
- * \copy
- * Copyright (c) 2013, Cisco Systems
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef WELS_BOUNDLELOAD_H
-#define WELS_BOUNDLELOAD_H
-
-#if defined(MACOS)
-
-#include <dlfcn.h>
-#include <string>
-
-CFBundleRef LoadBundle (const char* lpBundlePath) {
- if (lpBundlePath == NULL) {
- return NULL;
- }
- CFStringRef bundlePath = CFStringCreateWithCString (kCFAllocatorSystemDefault, lpBundlePath,
- CFStringGetSystemEncoding());
- if (NULL == bundlePath) {
- return NULL;
- }
-
- CFURLRef bundleURL = CFURLCreateWithString (kCFAllocatorSystemDefault, bundlePath, NULL);
- if (NULL == bundleURL) {
- return NULL;
- }
-
- // 2.get bundle ref
- CFBundleRef bundleRef = CFBundleCreate (kCFAllocatorSystemDefault, bundleURL);
- CFRelease (bundleURL);
-
- // Boolean bReturn = FALSE;
- if (NULL != bundleRef) {
- // bReturn = CFBundleLoadExecutable(bundleRef);
- }
-
- return bundleRef;
-}
-
-Boolean FreeBundle (CFBundleRef bundleRef) {
- if (NULL != bundleRef) {
- // CFBundleUnloadExecutable(bundleRef);
- CFRelease (bundleRef);
- }
- return TRUE;
-}
-
-void* GetProcessAddress (CFBundleRef bundleRef, const char* lpProcName) {
- void* processAddress = NULL;
- if (NULL != bundleRef) {
- CFStringRef cfProcName = CFStringCreateWithCString (kCFAllocatorSystemDefault, lpProcName, CFStringGetSystemEncoding());
- processAddress = CFBundleGetFunctionPointerForName (bundleRef, cfProcName);
- CFRelease (cfProcName);
- }
- return processAddress;
-}
-#endif
-
-#endif
\ No newline at end of file
--- a/processing/src/testbed/stdafx.cpp
+++ /dev/null
@@ -1,8 +1,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// WelsVideoProcessor.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
--- a/processing/src/testbed/stdafx.h
+++ /dev/null
@@ -1,20 +1,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#ifndef _WELSVP_STDAFX_H
-#define _WELSVP_STDAFX_H
-
-#include "targetver.h"
-
-#if defined (WIN32)
-#include <windows.h>
-#include <tchar.h>
-#else
-#include <string.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-
-#endif
--- a/processing/src/testbed/targetver.h
+++ /dev/null
@@ -1,16 +1,0 @@
-#ifndef _WELSVP_TARGETVER_H
-#define _WELSVP_TARGETVER_H
-
-// The following macros define the minimum required platform. The minimum required platform
-// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
-// your application. The macros work by enabling all features available on platform versions up to and
-// including the version specified.
-
-// Modify the following defines if you have to target a platform prior to the ones specified below.
-// Refer to MSDN for the latest info on corresponding values for different platforms.
-#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
-#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.
-#endif
-
-#endif
-
--- a/processing/src/testbed/wels_process.cpp
+++ /dev/null
@@ -1,181 +1,0 @@
-/*!
- * \copy
- * Copyright (c) 2013, Cisco Systems
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <windows.h>
-#include "wels_process.h"
-#include "bundleloader.h"
-
-// entry API declaration
-typedef vResult (WELSAPI* pfnCreateVpInterface) (void**, int);
-typedef vResult (WELSAPI* pfnDestroyVpInterface) (void*, int);
-
-////////////////////////////////////////////////////////
-void* loadlib() {
-#if defined(WIN32)
- HMODULE shModule = LoadLibraryA ("WelsVP.dll");
- if (shModule == NULL)
- shModule = LoadLibraryA ("../WelsVP.dll");
-
-#elif defined(MACOS)
- const char WelsVPLib[] = "WelsVP.bundle";
- CFBundleRef shModule = LoadBundle (WelsVPLib);
-
-#elif defined(UNIX)
- const char WelsVPLib[] = "WelsVP.so";
- void* shModule = dlopen (WelsVPLib, RTLD_LAZY);
-#endif
-
- return (void*)shModule;
-}
-
-void freelib (void* lib) {
- if (lib) {
-#ifdef WIN32
- HMODULE shModule = (HMODULE)lib;
- FreeLibrary (shModule);
-
-#elif defined(MACOS)
- CFBundleRef shModule = (CFBundleRef)lib;
- FreeBundle (shModule);
-
-#elif defined(UNIX)
- void* shModule = lib;
- dlclose (shModule);
-#endif
- }
-}
-
-void* queryfunc (void* lib, const char* name) {
- void* pFunc = NULL;
-#ifdef WIN32
- HMODULE shModule = (HMODULE)lib;
- pFunc = (void*)GetProcAddress (shModule, name);
-#elif defined(MACOS)
- CFBundleRef shModule = (CFBundleRef)lib;
- pFunc = (void*)GetProcessAddress (shModule, name);
-#elif defined(UNIX)
- void* shModule = lib;
- pFunc = (void*)dlsym (shModule, name);
-#endif
-
- return pFunc;
-}
-
-IWelsVpPlugin::IWelsVpPlugin (int& ret)
- : flag (0)
- , ivp (NULL)
- , hlib (NULL) {
- pfnCreateVpInterface pCreateVpInterface = NULL;
- pfnDestroyVpInterface pDestroyVpInterface = NULL;
- iface[0] = iface[1] = NULL;
-
- hlib = loadlib();
- if (!hlib)
- goto exit;
-
- pCreateVpInterface = (pfnCreateVpInterface) queryfunc (hlib, ("CreateVpInterface"));
- pDestroyVpInterface = (pfnDestroyVpInterface) queryfunc (hlib, ("DestroyVpInterface"));
- if (!pCreateVpInterface || !pDestroyVpInterface)
- goto exit;
-
- iface[0] = (void*) pCreateVpInterface;
- iface[1] = (void*) pDestroyVpInterface;
- pCreateVpInterface ((void**)&ivp, WELSVP_INTERFACE_VERION);
- if (!iface)
- goto exit;
-
- ret = 0;
- return;
-
-exit:
- ret = 1;
-}
-
-IWelsVpPlugin::~IWelsVpPlugin() {
- if (hlib) {
- pfnDestroyVpInterface pDestroyVpInterface = (pfnDestroyVpInterface) iface[1];
- if (pDestroyVpInterface)
- pDestroyVpInterface ((void*)ivp, WELSVP_INTERFACE_VERION);
-
- freelib (hlib);
- hlib = NULL;
- }
-}
-
-vResult IWelsVpPlugin::Init (int nType, void* pCfg) {
- vResult ret = vRet_NotSupport;
- if (hlib && nType > 0)
- ret = ivp->Init (nType, pCfg);
- return ret;
-}
-
-vResult IWelsVpPlugin::Uninit (int nType) {
- vResult ret = vRet_NotSupport;
- if (hlib && nType > 0)
- ret = ivp->Uninit (nType);
- return ret;
-}
-
-vResult IWelsVpPlugin::Flush (int nType) {
- vResult ret = vRet_NotSupport;
- if (hlib && nType > 0)
- ret = ivp->Flush (nType);
- return ret;
-}
-
-vResult IWelsVpPlugin::Process (int nType, vPixMap* src, vPixMap* dst) {
- vResult ret = vRet_NotSupport;
- if (hlib && nType > 0)
- ret = ivp->Process (nType, src, dst);
- return ret;
-}
-
-vResult IWelsVpPlugin::Get (int nType, void* pParam) {
- vResult ret = vRet_NotSupport;
- if (hlib && nType > 0)
- ret = ivp->Get (nType, pParam);
- return ret;
-}
-
-vResult IWelsVpPlugin::Set (int nType, void* pParam) {
- vResult ret = vRet_NotSupport;
- if (hlib && nType > 0)
- ret = ivp->Set (nType, pParam);
- return ret;
-}
-
-vResult IWelsVpPlugin::SpecialFeature (int nType, void* pIn, void* pOut) {
- vResult ret = vRet_NotSupport;
- if (hlib && nType > 0)
- ret = ivp->SpecialFeature (nType, pIn, pOut);
- return ret;
-}
\ No newline at end of file
--- a/processing/src/testbed/wels_process.h
+++ /dev/null
@@ -1,81 +1,0 @@
-/*!
- * \copy
- * Copyright (c) 2011-2013, Cisco Systems
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \file wels_process.h
- *
- * \brief interface of video pre-process plugins
- *
- * \date 03/21/2011
- *
- * \description : this class is designed as an interface to unify video pre-processing
- * class implement sets such as denoise,colorspace conversion etc...
- *
- *************************************************************************************
- */
-
-#ifndef WELS_PREPROCESS_H
-#define WELS_PREPROCESS_H
-
-#include "../../interface/IWelsVP.h"
-
-class IWelsVpPlugin {
- public:
- IWelsVpPlugin (int& ret);
- ~IWelsVpPlugin();
-
- enum {
- STATE_BEFOREENC = 0, /* before picture encoding */
- STATE_AFTERENC , /* after picture encoded */
- };
-
- public:
- vResult Init (int nType, void* pCfg);
- vResult Uninit (int nType);
- vResult Flush (int nType);
- vResult Process (int nType, vPixMap* src, vPixMap* dst);
- vResult Get (int nType, void* pParam);
- vResult Set (int nType, void* pParam);
- vResult SpecialFeature (int nType, void* pIn, void* pOut);
-
- void SetFlag (int a) {
- flag = a;
- }
- void GetFlag (int& a) {
- a = flag;
- }
-
- private:
- int flag;
- IWelsVP* ivp;
- void* hlib;
- void* iface[2];
-};
-
-#endif
\ No newline at end of file
--- a/processing/targets.mk
+++ b/processing/targets.mk
@@ -18,7 +18,6 @@
$(PROCESSING_SRCDIR)/./src/imagerotate/imagerotatefuncs.cpp\
$(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetection.cpp\
$(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetectionCommon.cpp\
- $(PROCESSING_SRCDIR)/./src/testbed/stdafx.cpp\
$(PROCESSING_SRCDIR)/./src/vaacalc/vaacalcfuncs.cpp\
$(PROCESSING_SRCDIR)/./src/vaacalc/vaacalculation.cpp\
@@ -87,9 +86,6 @@
$(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetectionCommon.o: $(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetectionCommon.cpp
$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetectionCommon.o $(PROCESSING_SRCDIR)/./src/scenechangedetection/SceneChangeDetectionCommon.cpp
-
-$(PROCESSING_SRCDIR)/./src/testbed/stdafx.o: $(PROCESSING_SRCDIR)/./src/testbed/stdafx.cpp
- $(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/testbed/stdafx.o $(PROCESSING_SRCDIR)/./src/testbed/stdafx.cpp
$(PROCESSING_SRCDIR)/./src/vaacalc/vaacalcfuncs.o: $(PROCESSING_SRCDIR)/./src/vaacalc/vaacalcfuncs.cpp
$(CXX) $(CFLAGS) $(CXXFLAGS) $(INCLUDES) $(PROCESSING_CFLAGS) $(PROCESSING_INCLUDES) -c -o $(PROCESSING_SRCDIR)/./src/vaacalc/vaacalcfuncs.o $(PROCESSING_SRCDIR)/./src/vaacalc/vaacalcfuncs.cpp
--- a/testbin/CmdLineExample.sh
+++ b/testbin/CmdLineExample.sh
@@ -1,6 +1,5 @@
-chmod 777 ../bin/linux/welsenc.exe
-../bin/linux/welsenc.exe welsenc_vd_1d.cfg
-../bin/linux/welsenc.exe welsenc_vd_rc.cfg
+../h264enc welsenc_vd_1d.cfg
+../h264enc welsenc_vd_rc.cfg
-../bin/linux/welsdec.exe test_vd_1d.264 test_vd_1d.yuv
-../bin/linux/welsdec.exe test_vd_1d.264 test_vd_rc.yuv
+../h264dec test_vd_1d.264 test_vd_1d.yuv
+../h264dec test_vd_rc.264 test_vd_rc.yuv