remove macros to clear codes

This commit is contained in:
sijchen
2014-02-28 14:54:11 +08:00
parent 3c29c92133
commit 10a4fb04c7
5 changed files with 35 additions and 520 deletions

View File

@@ -45,48 +45,6 @@
#include "wels_const.h"
#include "WelsThreadLib.h"
/*
* Dynamic Slicing Assignment (DSA)
*/
#define DYNAMIC_SLICE_ASSIGN
/*
* Try to do dynamic slicing for multiple threads sync based on history slicing complexity result,
* valid in case DYNAMIC_SLICE_ASSIGN enabled. In case it is disabled using step interval slicing map for DSA
*/
#define TRY_SLICING_BALANCE
/*
* not absolute balancing, tolerant conditions for dynamic adjustment
*/
#define NOT_ABSOLUTE_BALANCING
/*
* using root mean square error of slice complexity ratios for balancing
*/
#define USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING
/*
* REQUIREMENT FROM NOT BEING ABLE TO SUPPORT ASO ON GPU BASED DECODER
*/
#define RASTER_SCAN_ORDER_PACKING // Arbitary SSlice Ordering (ASO) exclusive
/*
* Parallel slice bs output without memcpy used
* NOTE: might be not applicable for SVC 2.0/2.1 client application layer implementation
* due bs of various slices need be continuous within a layer packing
*/
//#define PACKING_ONE_SLICE_PER_LAYER // MEAN packing only slice for a pLayerBs, disabled at SVC 2.0/2.1 in case Multi-Threading (MT) & Multi-SSlice (MS)
//#define FIXED_PARTITION_ASSIGN // for dynamic slicing parallelization, mean same partition number used in P or I slices
/*
* Need disable PACKING_ONE_SLICE_PER_LAYER if RASTER_SCAN_ORDER_PACKING enabled
* PACKING_ONE_SLICE_PER_LAYER might potentially introduce disordering slice packing into layer info for application layer
*/
#if defined(RASTER_SCAN_ORDER_PACKING)
#if defined(PACKING_ONE_SLICE_PER_LAYER)
#undef PACKING_ONE_SLICE_PER_LAYER
#endif//PACKING_ONE_SLICE_PER_LAYER
#endif//RASTER_SCAN_ORDER_PACKING
/*
* MT_DEBUG: output trace MT related into log file
*/
@@ -105,68 +63,20 @@
#endif//MT_ENABLED
/*
* TO Check macros dependencies MT related
*/
#if !defined(DYNAMIC_SLICE_ASSIGN)
#if defined(TRY_SLICING_BALANCE)
#undef TRY_SLICING_BALANCE
#endif//TRY_SLICING_BALANCE
#endif//!DYNAMIC_SLICE_ASSIGN
#if !defined(DYNAMIC_SLICE_ASSIGN) || !defined(TRY_SLICING_BALANCE)
#if defined(NOT_ABSOLUTE_BALANCING)
#undef NOT_ABSOLUTE_BALANCING
#endif//NOT_ABSOLUTE_BALANCING
#if defined(USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING)
#undef USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING
#endif//USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING
#endif//!DYNAMIC_SLICE_ASSIGN || !TRY_SLICING_BALANCE
#if !defined(MT_ENABLED)
#if defined(DYNAMIC_SLICE_ASSIGN)
#undef DYNAMIC_SLICE_ASSIGN
#endif//DYNAMIC_SLICE_ASSIGN
#if defined(TRY_SLICING_BALANCE)
#undef TRY_SLICING_BALANCE
#endif//TRY_SLICING_BALANCE
#if defined(MT_DEBUG)
#undef MT_DEBUG
#endif//MT_DEBUG
#if defined(ENABLE_TRACE_MT)
#undef ENABLE_TRACE_MT
#endif//ENABLE_TRACE_MT
#if defined(PACKING_ONE_SLICE_PER_LAYER)
#undef PACKING_ONE_SLICE_PER_LAYER
#endif//PACKING_ONE_SLICE_PER_LAYER
#ifdef NOT_ABSOLUTE_BALANCING
#undef NOT_ABSOLUTE_BALANCING
#endif//NOT_ABSOLUTE_BALANCING
#ifdef USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING
#undef USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING
#endif//USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING
#endif//!MT_ENABLED
#ifdef NOT_ABSOLUTE_BALANCING
#ifdef USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING
#define THRESHOLD_RMSE_CORE8 0.0320f // v1.1: 0.0320f; v1.0: 0.02f
#define THRESHOLD_RMSE_CORE4 0.0215f // v1.1: 0.0215f; v1.0: 0.03f
#define THRESHOLD_RMSE_CORE2 0.0200f // v1.1: 0.0200f; v1.0: 0.04f
#else
#define TOLERANT_BALANCING_RATIO_LOSS 0.08f
#define TOLERANT_BALANCING_RATIO_LOWER(n) ((1.0f-TOLERANT_BALANCING_RATIO_LOSS)/(n))
#define TOLERANT_BALANCING_RATIO_UPPER(n) ((1.0f+TOLERANT_BALANCING_RATIO_LOSS)/(n))
#endif//USE_RMSE_SLICE_COMPLEXITY_RATIO_FOR_BALANCING
#endif//NOT_ABSOLUTE_BALANCING
typedef struct TagSliceThreadPrivateData {
void* pWelsPEncCtx;
@@ -192,7 +102,6 @@ WELS_EVENT* pSliceCodedEvent[MAX_THREADS_NUM];// events for slice coded stat
WELS_EVENT* pReadySliceCodingEvent[MAX_THREADS_NUM]; // events for slice coding ready, [iThreadIdx]
#endif//_WIN32
#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
#if defined(__GNUC__)
WELS_THREAD_HANDLE* pUpdateMbListThrdHandles; // thread handles for update mb list thread, [iThreadIdx]
#endif//__GNUC__
@@ -203,24 +112,16 @@ WELS_EVENT* pFinUpdateMbListEvent; // signal to indicate finish updating mb
WELS_EVENT* pUpdateMbListEvent[MAX_THREADS_NUM]; // signal to update mb list neighbor for various slices
WELS_EVENT* pFinUpdateMbListEvent[MAX_THREADS_NUM]; // signal to indicate finish updating mb list
#endif//_WIN32
#endif//#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
WELS_MUTEX mutexSliceNumUpdate; // for dynamic slicing mode MT
#if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG)
uint32_t* pSliceConsumeTime[MAX_DEPENDENCY_LAYER]; // consuming time for each slice, [iSpatialIdx][uiSliceIdx]
#endif//DYNAMIC_SLICE_ASSIGN || MT_DEBUG
#if defined(DYNAMIC_SLICE_ASSIGN) && defined(TRY_SLICING_BALANCE)
float* pSliceComplexRatio[MAX_DEPENDENCY_LAYER];
#endif//DYNAMIC_SLICE_ASSIGN && TRY_SLICING_BALANCE
#ifdef MT_DEBUG
FILE* pFSliceDiff; // file handle for debug
#endif//MT_DEBUG
#ifdef PACKING_ONE_SLICE_PER_LAYER
uint32_t* pCountBsSizeInPartition;
#endif//PACKING_ONE_SLICE_PER_LAYER
} SSliceThreading;
#endif//MULTIPLE_THREADING_DEFINES_H__