diff --git a/Makefile b/Makefile index 39e1ea33..5984e15c 100644 --- a/Makefile +++ b/Makefile @@ -125,7 +125,7 @@ DECODER_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(DECODER_INCLUDES) ENCODER_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(ENCODER_INCLUDES) PROCESSING_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(PROCESSING_INCLUDES) API_TEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) -COMMON_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) $(DECODER_INCLUDES) +COMMON_UNITTEST_INCLUDES += $(CODEC_UNITTEST_INCLUDES) MODULE_INCLUDES += -I$(SRC_PATH)gmp-api DECODER_UNITTEST_CFLAGS += $(CODEC_UNITTEST_CFLAGS) diff --git a/codec/build/iOS/common/common.xcodeproj/project.pbxproj b/codec/build/iOS/common/common.xcodeproj/project.pbxproj index 55ba6743..e19900a7 100644 --- a/codec/build/iOS/common/common.xcodeproj/project.pbxproj +++ b/codec/build/iOS/common/common.xcodeproj/project.pbxproj @@ -69,6 +69,7 @@ 4CE443E918B722CD0017DF25 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 53C1C9BA193F0F9E00404D8F /* expand_pic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = expand_pic.h; sourceTree = ""; }; 53C1C9BB193F0FB000404D8F /* expand_pic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = expand_pic.cpp; sourceTree = ""; }; + 5B9196F91A7F8BA40075D641 /* wels_const_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wels_const_common.h; sourceTree = ""; }; 5BA8F2BE19603F3500011CE4 /* wels_common_defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wels_common_defs.h; sourceTree = ""; }; 5BA8F2BF19603F5F00011CE4 /* common_tables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = common_tables.cpp; sourceTree = ""; }; 5BD896B81A7B837700D32B7D /* memory_align.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory_align.h; sourceTree = ""; }; @@ -133,6 +134,7 @@ 5BD896B81A7B837700D32B7D /* memory_align.h */, 4C3406C118D96EA600DFA14A /* typedefs.h */, 5BA8F2BE19603F3500011CE4 /* wels_common_defs.h */, + 5B9196F91A7F8BA40075D641 /* wels_const_common.h */, 4C3406C218D96EA600DFA14A /* WelsThreadLib.h */, ); path = inc; diff --git a/codec/build/win32/dec/WelsDecCore.vcproj b/codec/build/win32/dec/WelsDecCore.vcproj index 38b8a99b..ad2ff27d 100644 --- a/codec/build/win32/dec/WelsDecCore.vcproj +++ b/codec/build/win32/dec/WelsDecCore.vcproj @@ -823,6 +823,10 @@ RelativePath="..\..\..\decoder\core\inc\wels_const.h" > + + + + diff --git a/codec/common/inc/wels_const_common.h b/codec/common/inc/wels_const_common.h new file mode 100644 index 00000000..fcb1a505 --- /dev/null +++ b/codec/common/inc/wels_const_common.h @@ -0,0 +1,56 @@ +/*! + * \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_CONST_COMMON_H__ +#define WELS_CONST_COMMON_H__ + +// Miscellaneous sizing infos +#ifndef MAX_FNAME_LEN +#define MAX_FNAME_LEN 256 // maximal length of file name in char size +#endif//MAX_FNAME_LEN + +#ifndef WELS_LOG_BUF_SIZE +#define WELS_LOG_BUF_SIZE 4096 +#endif//WELS_LOG_BUF_SIZE + +#ifndef MAX_TRACE_LOG_SIZE +#define MAX_TRACE_LOG_SIZE (50 * (1<<20)) // max trace log size: 50 MB, overwrite occur if log file size exceeds this size +#endif//MAX_TRACE_LOG_SIZE + +/* MB width in pixels for specified colorspace I420 usually used in codec */ +#define MB_WIDTH_LUMA 16 +#define MB_WIDTH_CHROMA (MB_WIDTH_LUMA>>1) +/* MB height in pixels for specified colorspace I420 usually used in codec */ +#define MB_HEIGHT_LUMA 16 +#define MB_HEIGHT_CHROMA (MB_HEIGHT_LUMA>>1) + +#endif//WELS_CONST_COMMON_H__ diff --git a/codec/decoder/core/inc/wels_const.h b/codec/decoder/core/inc/wels_const.h index f610d68c..56c18798 100644 --- a/codec/decoder/core/inc/wels_const.h +++ b/codec/decoder/core/inc/wels_const.h @@ -31,28 +31,10 @@ */ //wels_const.h -#ifndef WELS_CONSTANCE_H__ -#define WELS_CONSTANCE_H__ +#ifndef WELS_CONST_H__ +#define WELS_CONST_H__ -// Miscellaneous sizing infos -#ifndef MAX_FNAME_LEN -#define MAX_FNAME_LEN 256 // maximal length of file name in char size -#endif//MAX_FNAME_LEN - -#ifndef WELS_LOG_BUF_SIZE -#define WELS_LOG_BUF_SIZE 4096 -#endif//WELS_LOG_BUF_SIZE - -#ifndef MAX_TRACE_LOG_SIZE -#define MAX_TRACE_LOG_SIZE (50 * (1<<20)) // max trace log size: 50 MB, overwrite occur if log file size exceeds this size -#endif//MAX_TRACE_LOG_SIZE - -/* MB width in pixels for specified colorspace I420 usually used in codec */ -#define MB_WIDTH_LUMA 16 -#define MB_WIDTH_CHROMA (MB_WIDTH_LUMA>>1) -/* MB height in pixels for specified colorspace I420 usually used in codec */ -#define MB_HEIGHT_LUMA 16 -#define MB_HEIGHT_CHROMA (MB_HEIGHT_LUMA>>1) +#include "wels_const_common.h" /* Some list size */ #define MB_COEFF_LIST_SIZE (256+((MB_WIDTH_CHROMA*MB_HEIGHT_CHROMA)<<1)) @@ -102,4 +84,4 @@ enum { AVC_REWRITE_ENHANCE_MB = 2 }; -#endif//WELS_CONSTANCE_H__ +#endif//WELS_CONST_H__ diff --git a/codec/encoder/core/inc/wels_const.h b/codec/encoder/core/inc/wels_const.h index ccf6b06b..90221dfc 100644 --- a/codec/encoder/core/inc/wels_const.h +++ b/codec/encoder/core/inc/wels_const.h @@ -31,39 +31,20 @@ */ //wels_const.h -#ifndef WELS_CONSTANCE_H__ -#define WELS_CONSTANCE_H__ +#ifndef WELS_CONST_H__ +#define WELS_CONST_H__ #include "as264_common.h" // to communicate with specific macros there, 3/18/2010 #include "codec_app_def.h" +#include "wels_const_common.h" /* To control number of spatial, quality and temporal layers constraint by application layer? */ #define NUM_SPATIAL_LAYERS_CONSTRAINT #define NUM_QUALITY_LAYERS_CONSTRAINT -// Miscellaneous sizing infos -#ifndef MAX_FNAME_LEN -#define MAX_FNAME_LEN 256 // maximal length of file name in char size -#endif//MAX_FNAME_LEN - -#ifndef WELS_LOG_BUF_SIZE -#define WELS_LOG_BUF_SIZE 4096 -#endif//WELS_LOG_BUF_SIZE - -#ifndef MAX_TRACE_LOG_SIZE -#define MAX_TRACE_LOG_SIZE (50 * (1<<20)) // max trace log size: 50 MB, overwrite occur if log file size exceeds this size -#endif//MAX_TRACE_LOG_SIZE - #define STATISTICS_LOG_INTERVAL_MS (5000) // output statistics log every 5s -/* MB width in pixels for specified colorspace I420 usually used in codec */ -#define MB_WIDTH_LUMA 16 -#define MB_WIDTH_CHROMA (MB_WIDTH_LUMA>>1) -/* MB height in pixels for specified colorspace I420 usually used in codec */ -#define MB_HEIGHT_LUMA 16 -#define MB_HEIGHT_CHROMA (MB_HEIGHT_LUMA>>1) - /* Some list size */ #define MB_COEFF_LIST_SIZE (256+((MB_WIDTH_CHROMA*MB_HEIGHT_CHROMA)<<1)) #define MB_REQ_LUMA_CACHE_SIZE 40 // 8x5 Size of MB cache only luma component required to store @@ -215,4 +196,4 @@ enum { }; //TODO: need to complete the return checking in encoder and fill in more types if needed -#endif//WELS_CONSTANCE_H__ +#endif//WELS_CONST_H__ diff --git a/test/common/ExpandPicture.cpp b/test/common/ExpandPicture.cpp index 59bcaa7c..99bb58d6 100644 --- a/test/common/ExpandPicture.cpp +++ b/test/common/ExpandPicture.cpp @@ -2,14 +2,16 @@ #include "codec_def.h" #include "expand_pic.h" #include "memory_align.h" -#include "decoder_context.h" #include "cpu.h" #include "cpu_core.h" +#include "macros.h" +#include "wels_const_common.h" + #define EXPAND_PIC_TEST_NUM 10 #define H264_PADDING_LENGTH_LUMA (PADDING_LENGTH) #define H264_PADDING_LENGTH_CHROMA (PADDING_LENGTH>>1) -using namespace WelsDec; +using namespace WelsCommon; void H264ExpandPictureLumaAnchor_c (uint8_t* pDst, int32_t iStride, int32_t iPicWidth, int32_t iPicHeight) { uint8_t* pTmp = pDst;