shithub: openh264

Download patch

ref: 6ff4ef3b38b37fb47bd7ea29a5dbb77aea741c51
parent: 32d1510d296d0dd5189b5432bbc0edd83cfb49b9
parent: 78e0ec613021861b1434b05eba0f4191a30de42d
author: sijchen <sijchen@cisco.com>
date: Wed Jun 10 11:51:09 EDT 2015

Merge pull request #1983 from mstorsjo/remove-tabs

Remove tabs from the source code

--- a/codec/build/iOS/dec/demo/demo/DEMOViewController.m
+++ b/codec/build/iOS/dec/demo/demo/DEMOViewController.m
@@ -47,7 +47,7 @@
 - (void)viewDidLoad
 {
     [super viewDidLoad];
-	// Do any additional setup after loading the view, typically from a nib.
+    // Do any additional setup after loading the view, typically from a nib.
     //Add the testing codes
     self.resFileArray = [[NSMutableArray alloc] init];
     self.selectedRow = 0;
--- a/codec/common/inc/WelsThreadLib.h
+++ b/codec/common/inc/WelsThreadLib.h
@@ -60,7 +60,7 @@
 #define    WELS_THREAD_ROUTINE_TYPE         DWORD  WINAPI
 #define    WELS_THREAD_ROUTINE_RETURN(rc)   return (DWORD)rc;
 
-#else	// NON-WINDOWS
+#else // NON-WINDOWS
 
 #include <stdlib.h>
 #include <unistd.h>
--- a/codec/common/inc/copy_mb.h
+++ b/codec/common/inc/copy_mb.h
@@ -42,8 +42,8 @@
 void WelsCopy8x4_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
 void WelsCopy4x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
 void WelsCopy8x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
-void WelsCopy8x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);	//
-void WelsCopy16x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);	//
+void WelsCopy8x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS); //
+void WelsCopy16x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS); //
 void WelsCopy16x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
 
 #if defined(__cplusplus)
--- a/codec/common/inc/expand_pic.h
+++ b/codec/common/inc/expand_pic.h
@@ -46,7 +46,7 @@
 extern "C" {
 #endif//__cplusplus
 
-#define PADDING_LENGTH			32 // reference extension
+#define PADDING_LENGTH 32 // reference extension
 
 #if defined(X86_ASM)
 void ExpandPictureLuma_sse2 (uint8_t* pDst,
--- a/codec/common/inc/golomb_common.h
+++ b/codec/common/inc/golomb_common.h
@@ -67,11 +67,11 @@
 static inline int32_t InitBits (SBitStringAux* pBs, const uint8_t* kpBuf, const int32_t kiSize) {
   uint8_t* ptr = (uint8_t*)kpBuf;
 
-  pBs->pStartBuf	= ptr;
-  pBs->pCurBuf	= ptr;
-  pBs->pEndBuf	= ptr + kiSize;
-  pBs->iLeftBits	= 32;
-  pBs->uiCurBits	= 0;
+  pBs->pStartBuf = ptr;
+  pBs->pCurBuf   = ptr;
+  pBs->pEndBuf   = ptr + kiSize;
+  pBs->iLeftBits = 32;
+  pBs->uiCurBits = 0;
 
   return kiSize;
 }
--- a/codec/common/inc/ls_defines.h
+++ b/codec/common/inc/ls_defines.h
@@ -62,7 +62,7 @@
 STRUCTA (64, 4);
 STRUCTA (64, 8);
 //#define _USE_STRUCT_INT_CVT
-//	#ifdef _USE_STRUCT_INT_CVT
+//#ifdef _USE_STRUCT_INT_CVT
 #define ST16(a, b) (((struct tagUnaligned_16 *) (a))->l) = (b)
 #define ST32(a, b) (((struct tagUnaligned_32 *) (a))->l) = (b)
 #define ST64(a, b) (((struct tagUnaligned_64 *) (a))->l) = (b)
@@ -81,11 +81,11 @@
 #define ST64A2(a, b) STA(a, b, 64, 2)
 #define ST64A4(a, b) STA(a, b, 64, 4)
 #define ST64A8(a, b) STA(a, b, 64, 8)
-//	#else
-//		inline void __ST16(void *dst, uint16_t v) { memcpy(dst, &v, 2); }
-//		inline void __ST32(void *dst, uint32_t v) { memcpy(dst, &v, 4); }
+//#else
+//inline void __ST16(void *dst, uint16_t v) { memcpy(dst, &v, 2); }
+//inline void __ST32(void *dst, uint32_t v) { memcpy(dst, &v, 4); }
 //inline void __ST64(void *dst, uint64_t v) { memcpy(dst, &v, 8); }
-//	#endif
+//#endif
 
 #else
 
@@ -116,15 +116,15 @@
 #endif /* !__GNUC__ */
 
 #ifndef INTD16
-#define INTD16	LD16
+#define INTD16 LD16
 #endif//INTD16
 
 #ifndef INTD32
-#define INTD32	LD32
+#define INTD32 LD32
 #endif//INTD32
 
 #ifndef INTD64
-#define INTD64	LD64
+#define INTD64 LD64
 #endif//INTD64
 
 #endif//___LD_ST_MACROS___
--- a/codec/common/inc/macros.h
+++ b/codec/common/inc/macros.h
@@ -70,7 +70,7 @@
 #if defined(_MSC_VER)
 
 #if(_MSC_VER < 1700)
-#define inline	__inline
+#define inline __inline
 #endif
 
 #define ALIGNED_DECLARE( type, var, n ) __declspec(align(n)) type var
@@ -82,51 +82,51 @@
 
 
 #ifndef WELS_ALIGN
-#define WELS_ALIGN(x, n)	(((x)+(n)-1)&~((n)-1))
+#define WELS_ALIGN(x, n) (((x)+(n)-1)&~((n)-1))
 #endif//WELS_ALIGN
 
 
 #if 1 // Alternative implementation of WELS_MAX and WELS_MIN
 #ifndef WELS_MAX
-#define WELS_MAX(x, y)	((x) > (y) ? (x) : (y))
+#define WELS_MAX(x, y) ((x) > (y) ? (x) : (y))
 #endif//WELS_MAX
 
 #ifndef WELS_MIN
-#define WELS_MIN(x, y)	((x) < (y) ? (x) : (y))
+#define WELS_MIN(x, y) ((x) < (y) ? (x) : (y))
 #endif//WELS_MIN
 #else // Alternative implementation of WELS_MAX and WELS_MIN
 #ifndef WELS_MAX
-#define WELS_MAX(x, y)	((x) - (((x)-(y))&(((x)-(y))>>31)))
+#define WELS_MAX(x, y) ((x) - (((x)-(y))&(((x)-(y))>>31)))
 #endif//WELS_MAX
 
 #ifndef WELS_MIN
-#define WELS_MIN(x, y)	((y) + (((x)-(y))&(((x)-(y))>>31)))
+#define WELS_MIN(x, y) ((y) + (((x)-(y))&(((x)-(y))>>31)))
 #endif//WELS_MIN
 #endif // Alternative implementation of WELS_MAX and WELS_MIN
 
 
 #ifndef WELS_CEIL
-#define WELS_CEIL(x)	ceil(x)	// FIXME: low complexity instead of math library used
+#define WELS_CEIL(x) ceil(x) // FIXME: low complexity instead of math library used
 #endif//WELS_CEIL
 
 #ifndef WELS_FLOOR
-#define WELS_FLOOR(x)	floor(x)	// FIXME: low complexity instead of math library used
+#define WELS_FLOOR(x) floor(x)        // FIXME: low complexity instead of math library used
 #endif//WELS_FLOOR
 
 #ifndef WELS_ROUND
-#define WELS_ROUND(x)	((int32_t)(0.5+(x)))
+#define WELS_ROUND(x) ((int32_t)(0.5+(x)))
 #endif//WELS_ROUND
 
 #ifndef WELS_ROUND64
-#define WELS_ROUND64(x)	((int64_t)(0.5+(x)))
+#define WELS_ROUND64(x) ((int64_t)(0.5+(x)))
 #endif//WELS_ROUND
 
 #ifndef WELS_DIV_ROUND
-#define WELS_DIV_ROUND(x,y)	((int32_t)((y)==0?((x)/((y)+1)):(((y)/2+(x))/(y))))
+#define WELS_DIV_ROUND(x,y) ((int32_t)((y)==0?((x)/((y)+1)):(((y)/2+(x))/(y))))
 #endif//WELS_DIV_ROUND
 
 #ifndef WELS_DIV_ROUND64
-#define WELS_DIV_ROUND64(x,y)	((int64_t)((y)==0?((x)/((y)+1)):(((y)/2+(x))/(y))))
+#define WELS_DIV_ROUND64(x,y) ((int64_t)((y)==0?((x)/((y)+1)):(((y)/2+(x))/(y))))
 #endif//WELS_DIV_ROUND64
 
 #define WELS_NON_ZERO_COUNT_AVERAGE(nC,nA,nB) {         \
@@ -152,14 +152,14 @@
   int32_t iMin = iX, iMax = iX;
 
   if (iY < iMin)
-    iMin	= iY;
+    iMin = iY;
   else
     iMax = iY;
 
   if (iZ < iMin)
-    iMin	= iZ;
+    iMin = iZ;
   else if (iZ > iMax)
-    iMax	= iZ;
+    iMax = iZ;
 
   return (iX + iY + iZ) - (iMin + iMax);
 }
@@ -253,7 +253,7 @@
 
 }
 
-#define CLIP3_QP_0_51(q)		WELS_CLIP3(q, 0, 51)	// ((q) < (0) ? (0) : ((q) > (51) ? (51) : (q)))
+#define CLIP3_QP_0_51(q) WELS_CLIP3(q, 0, 51) // ((q) < (0) ? (0) : ((q) > (51) ? (51) : (q)))
 #define   CALC_BI_STRIDE(width,bitcount)  ((((width * bitcount) + 31) & ~31) >> 3)
 
 
--- a/codec/common/inc/memory_align.h
+++ b/codec/common/inc/memory_align.h
@@ -68,10 +68,10 @@
 CMemoryAlign& operator= (const CMemoryAlign& kcMa);
 
  protected:
-uint32_t	m_nCacheLineSize;
+uint32_t        m_nCacheLineSize;
 
 #ifdef MEMORY_MONITOR
-uint32_t	m_nMemoryUsageInBytes;
+uint32_t        m_nMemoryUsageInBytes;
 #endif//MEMORY_MONITOR
 };
 
--- a/codec/common/inc/typedefs.h
+++ b/codec/common/inc/typedefs.h
@@ -80,7 +80,7 @@
 #ifdef EPSN
 #undef EPSN
 #endif//EPSN
-#define EPSN	  (0.000001f) // (1e-6)	// desired float precision
+#define EPSN (0.000001f) // (1e-6) // desired float precision
 
 #endif //WELS_TYPE_DEFINES_H__
 
--- a/codec/common/inc/welsCodecTrace.h
+++ b/codec/common/inc/welsCodecTrace.h
@@ -53,7 +53,7 @@
   static void StaticCodecTrace (void* pCtx, const int32_t kiLevel, const char* kpStrFormat, va_list vl);
   void CodecTrace (const int32_t kiLevel, const char* kpStrFormat, va_list vl);
 
-  int32_t	m_iTraceLevel;
+  int32_t       m_iTraceLevel;
   WelsTraceCallback m_fpTrace;
   void*         m_pTraceCtx;
  public:
--- a/codec/common/inc/wels_common_defs.h
+++ b/codec/common/inc/wels_common_defs.h
@@ -218,14 +218,14 @@
  *  Bit-stream auxiliary reading / writing
  */
 typedef struct TagBitStringAux {
-  uint8_t* pStartBuf;	// buffer to start position
-  uint8_t* pEndBuf;	// buffer + length
+  uint8_t* pStartBuf;   // buffer to start position
+  uint8_t* pEndBuf;     // buffer + length
   int32_t  iBits;       // count bits of overall bitstreaming input
 
   intX_t   iIndex;      //only for cavlc usage
-  uint8_t* pCurBuf;	// current reading position
+  uint8_t* pCurBuf;     // current reading position
   uint32_t uiCurBits;
-  int32_t  iLeftBits;	// count number of available bits left ([1, 8]),
+  int32_t  iLeftBits;   // count number of available bits left ([1, 8]),
   // need pointer to next byte start position in case 0 bit left then 8 instead
 } SBitStringAux, *PBitStringAux;
 
@@ -234,17 +234,17 @@
   uint8_t             uiForbiddenZeroBit;
   uint8_t             uiNalRefIdc;
   EWelsNalUnitType    eNalUnitType;
-  uint8_t             uiReservedOneByte;		// only padding usage
+  uint8_t             uiReservedOneByte;                // only padding usage
 } SNalUnitHeader, *PNalUnitHeader;
 
 /* NAL Unit Header in scalable extension syntax, refer to Page 390 in JVT X201wcm */
 typedef struct TagNalUnitHeaderExt {
-  SNalUnitHeader	sNalUnitHeader;
+  SNalUnitHeader      sNalUnitHeader;
 
-  //	uint8_t		reserved_one_bit;
+  // uint8_t   reserved_one_bit;
   bool      bIdrFlag;
   uint8_t   uiPriorityId;
-  int8_t    iNoInterLayerPredFlag;	// change as int8_t to support 3 values probably in encoder
+  int8_t    iNoInterLayerPredFlag;      // change as int8_t to support 3 values probably in encoder
   uint8_t   uiDependencyId;
 
   uint8_t   uiQualityId;
--- a/codec/common/src/WelsThreadLib.cpp
+++ b/codec/common/src/WelsThreadLib.cpp
@@ -299,12 +299,12 @@
 }
 WELS_THREAD_ERROR_CODE    WelsEventClose (WELS_EVENT* event, const char* event_name) {
 #ifdef __APPLE__
-  WELS_THREAD_ERROR_CODE err = sem_close (*event);	// match with sem_open
+  WELS_THREAD_ERROR_CODE err = sem_close (*event); // match with sem_open
   if (event_name)
     sem_unlink (event_name);
   return err;
 #else
-  WELS_THREAD_ERROR_CODE err = sem_destroy (*event);	// match with sem_init
+  WELS_THREAD_ERROR_CODE err = sem_destroy (*event); // match with sem_init
   free (*event);
   return err;
 #endif
@@ -312,17 +312,17 @@
 
 WELS_THREAD_ERROR_CODE   WelsEventSignal (WELS_EVENT* event) {
   WELS_THREAD_ERROR_CODE err = 0;
-//	int32_t val = 0;
-//	sem_getvalue(event, &val);
-//	fprintf( stderr, "before signal it, val= %d..\n",val );
+//  int32_t val = 0;
+//  sem_getvalue(event, &val);
+//  fprintf( stderr, "before signal it, val= %d..\n",val );
   err = sem_post (*event);
-//	sem_getvalue(event, &val);
-//	fprintf( stderr, "after signal it, val= %d..\n",val );
+//  sem_getvalue(event, &val);
+//  fprintf( stderr, "after signal it, val= %d..\n",val );
   return err;
 }
 
 WELS_THREAD_ERROR_CODE   WelsEventWait (WELS_EVENT* event) {
-  return sem_wait (*event);	// blocking until signaled
+  return sem_wait (*event); // blocking until signaled
 }
 
 WELS_THREAD_ERROR_CODE    WelsEventWaitWithTimeOut (WELS_EVENT* event, uint32_t dwMilliseconds) {
@@ -360,7 +360,7 @@
 WELS_THREAD_ERROR_CODE    WelsMultipleEventsWaitSingleBlocking (uint32_t nCount,
     WELS_EVENT* event_list, WELS_EVENT* master_event) {
   uint32_t nIdx = 0;
-  uint32_t uiAccessTime = 2;	// 2 us once
+  uint32_t uiAccessTime = 2; // 2 us once
 
   if (nCount == 0)
     return WELS_THREAD_ERROR_WAIT_FAILED;
@@ -378,7 +378,7 @@
   }
 
   while (1) {
-    nIdx = 0;	// access each event by order
+    nIdx = 0; // access each event by order
     while (nIdx < nCount) {
       int32_t err = 0;
       int32_t wait_count = 0;
@@ -399,7 +399,7 @@
       // we do need access next event next time
       ++ nIdx;
     }
-    usleep (1);	// switch to working threads
+    usleep (1); // switch to working threads
     if (master_event != NULL) {
       // A master event was used and was signalled, but none of the events in the
       // list was found to be signalled, thus wait a little more when rechecking
@@ -417,19 +417,19 @@
     WELS_EVENT* event_list, WELS_EVENT* master_event) {
   uint32_t nIdx = 0;
   uint32_t uiCountSignals = 0;
-  uint32_t uiSignalFlag	= 0;	// UGLY: suppose maximal event number up to 32
+  uint32_t uiSignalFlag = 0;    // UGLY: suppose maximal event number up to 32
 
   if (nCount == 0 || nCount > (sizeof (uint32_t) << 3))
     return WELS_THREAD_ERROR_WAIT_FAILED;
 
   while (1) {
-    nIdx = 0;	// access each event by order
+    nIdx = 0; // access each event by order
     while (nIdx < nCount) {
       const uint32_t kuiBitwiseFlag = (1 << nIdx);
 
       if ((uiSignalFlag & kuiBitwiseFlag) != kuiBitwiseFlag) { // non-blocking mode
         int32_t err = 0;
-//				fprintf( stderr, "sem_wait(): start to wait event %d..\n", nIdx );
+//        fprintf( stderr, "sem_wait(): start to wait event %d..\n", nIdx );
         if (master_event == NULL) {
           err = sem_wait (event_list[nIdx]);
         } else {
@@ -445,11 +445,11 @@
             }
           }
         }
-//				fprintf( stderr, "sem_wait(): wait event %d result %d errno %d..\n", nIdx, err, errno );
+//        fprintf( stderr, "sem_wait(): wait event %d result %d errno %d..\n", nIdx, err, errno );
         if (WELS_THREAD_ERROR_OK == err) {
-//					int32_t val = 0;
-//					sem_getvalue(&event_list[nIdx], &val);
-//					fprintf( stderr, "after sem_timedwait(), event_list[%d] semaphore value= %d..\n", nIdx, val);
+//          int32_t val = 0;
+//          sem_getvalue(&event_list[nIdx], &val);
+//          fprintf( stderr, "after sem_timedwait(), event_list[%d] semaphore value= %d..\n", nIdx, val);
 
           uiSignalFlag |= kuiBitwiseFlag;
           ++ uiCountSignals;
--- a/codec/common/src/cpu.cpp
+++ b/codec/common/src/cpu.cpp
@@ -96,7 +96,7 @@
     uiCPU |= WELS_CPU_CMOV;
   }
   if ((!strcmp ((const char*)chVendorName, CPU_Vendor_INTEL)) ||
-      (!strcmp ((const char*)chVendorName, CPU_Vendor_AMD))) {	// confirmed_safe_unsafe_usage
+      (!strcmp ((const char*)chVendorName, CPU_Vendor_AMD))) { // confirmed_safe_unsafe_usage
     if (uiFeatureD & 0x10000000) {
       /* Multi-Threading checking: contains of multiple logic processors */
       uiCPU |= WELS_CPU_HTT;
@@ -165,7 +165,7 @@
   WelsCPUId (0x80000000, &uiFeatureA, &uiFeatureB, &uiFeatureC, &uiFeatureD);
 
   if ((!strcmp ((const char*)chVendorName, CPU_Vendor_AMD))
-      && (uiFeatureA >= 0x80000001)) {	// confirmed_safe_unsafe_usage
+      && (uiFeatureA >= 0x80000001)) { // confirmed_safe_unsafe_usage
     WelsCPUId (0x80000001, &uiFeatureA, &uiFeatureB, &uiFeatureC, &uiFeatureD);
     if (uiFeatureD & 0x00400000) {
       uiCPU |= WELS_CPU_MMXEXT;
@@ -175,7 +175,7 @@
     }
   }
 
-  if (!strcmp ((const char*)chVendorName, CPU_Vendor_INTEL)) {	// confirmed_safe_unsafe_usage
+  if (!strcmp ((const char*)chVendorName, CPU_Vendor_INTEL)) { // confirmed_safe_unsafe_usage
     int32_t  family, model;
 
     WelsCPUId (1, &uiFeatureA, &uiFeatureB, &uiFeatureC, &uiFeatureD);
@@ -189,11 +189,11 @@
 
   // get cache line size
   if ((!strcmp ((const char*)chVendorName, CPU_Vendor_INTEL))
-      || ! (strcmp ((const char*)chVendorName, CPU_Vendor_CYRIX))) {	// confirmed_safe_unsafe_usage
+      || ! (strcmp ((const char*)chVendorName, CPU_Vendor_CYRIX))) { // confirmed_safe_unsafe_usage
     WelsCPUId (1, &uiFeatureA, &uiFeatureB, &uiFeatureC, &uiFeatureD);
 
     CacheLineSize = (uiFeatureB & 0xff00) >>
-                    5;	// ((clflush_line_size >> 8) << 3), CLFLUSH_line_size * 8 = CacheLineSize_in_byte
+                    5; // ((clflush_line_size >> 8) << 3), CLFLUSH_line_size * 8 = CacheLineSize_in_byte
 
     if (CacheLineSize == 128) {
       uiCPU |= WELS_CPU_CACHELINE_128;
--- a/codec/common/src/crt_util_safe_x.cpp
+++ b/codec/common/src/crt_util_safe_x.cpp
@@ -54,7 +54,7 @@
 #endif //_WIN32
 
 #include "macros.h"
-#include "crt_util_safe_x.h"	// Safe CRT routines like utils for cross platforms
+#include "crt_util_safe_x.h" // Safe CRT routines like utils for cross platforms
 
 #if defined(_WIN32) && defined(_MSC_VER)
 
--- a/codec/common/src/deblocking_common.cpp
+++ b/codec/common/src/deblocking_common.cpp
@@ -56,23 +56,23 @@
         bool bDetaQ2Q0 =  WELS_ABS (q2 - q0) < iBeta;
         if (bDetaP2P0) {
           const int32_t p3 = pPix[-4 * iStrideX];
-          pPix[-iStrideX] = (p2 + (p1 << 1) + (p0 << 1) + (q0 << 1) + q1 + 4) >> 3;	   //p0
-          pPix[-2 * iStrideX] = (p2 + p1 + p0 + q0 + 2) >> 2;	 //p1
-          pPix[-3 * iStrideX] = ((p3 << 1) + p2 + (p2 << 1) + p1 + p0 + q0 + 4) >> 3;//p2
+          pPix[-iStrideX] = (p2 + (p1 << 1) + (p0 << 1) + (q0 << 1) + q1 + 4) >> 3;   //p0
+          pPix[-2 * iStrideX] = (p2 + p1 + p0 + q0 + 2) >> 2;                         //p1
+          pPix[-3 * iStrideX] = ((p3 << 1) + p2 + (p2 << 1) + p1 + p0 + q0 + 4) >> 3; //p2
         } else {
-          pPix[-1 * iStrideX] = ((p1 << 1) + p0 + q1 + 2) >> 2;	//p0
+          pPix[-1 * iStrideX] = ((p1 << 1) + p0 + q1 + 2) >> 2;                       //p0
         }
         if (bDetaQ2Q0) {
           const int32_t q3 = pPix[3 * iStrideX];
-          pPix[0] = (p1 + (p0 << 1) + (q0 << 1) + (q1 << 1) + q2 + 4) >> 3;   //q0
-          pPix[iStrideX] = (p0 + q0 + q1 + q2 + 2) >> 2;   //q1
-          pPix[2 * iStrideX] = ((q3 << 1) + q2 + (q2 << 1) + q1 + q0 + p0 + 4) >> 3;//q2
+          pPix[0] = (p1 + (p0 << 1) + (q0 << 1) + (q1 << 1) + q2 + 4) >> 3;           //q0
+          pPix[iStrideX] = (p0 + q0 + q1 + q2 + 2) >> 2;                              //q1
+          pPix[2 * iStrideX] = ((q3 << 1) + q2 + (q2 << 1) + q1 + q0 + p0 + 4) >> 3;  //q2
         } else {
-          pPix[0] = ((q1 << 1) + q0 + p1 + 2) >> 2;   //q0
+          pPix[0] = ((q1 << 1) + q0 + p1 + 2) >> 2;                                   //q0
         }
       } else {
         pPix[-iStrideX] = ((p1 << 1) + p0 + q1 + 2) >> 2;   //p0
-        pPix[ 0] = ((q1 << 1) + q0 + p1 + 2) >> 2;   //q0
+        pPix[ 0] = ((q1 << 1) + q0 + p1 + 2) >> 2;          //q0
       }
     }
     pPix += iStrideY;
--- a/codec/common/src/expand_pic.cpp
+++ b/codec/common/src/expand_pic.cpp
@@ -36,23 +36,23 @@
 // rewrite it (split into luma & chroma) that is helpful for mmx/sse2 optimization perform, 9/27/2009
 static inline void ExpandPictureLuma_c (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
                                         const int32_t kiPicH) {
-  uint8_t* pTmp				= pDst;
-  uint8_t* pDstLastLine		= pTmp + (kiPicH - 1) * kiStride;
-  const int32_t kiPaddingLen	= PADDING_LENGTH;
-  const uint8_t kuiTL			= pTmp[0];
-  const uint8_t kuiTR			= pTmp[kiPicW - 1];
-  const uint8_t kuiBL			= pDstLastLine[0];
-  const uint8_t kuiBR			= pDstLastLine[kiPicW - 1];
-  int32_t i					= 0;
+  uint8_t* pTmp              = pDst;
+  uint8_t* pDstLastLine      = pTmp + (kiPicH - 1) * kiStride;
+  const int32_t kiPaddingLen = PADDING_LENGTH;
+  const uint8_t kuiTL        = pTmp[0];
+  const uint8_t kuiTR        = pTmp[kiPicW - 1];
+  const uint8_t kuiBL        = pDstLastLine[0];
+  const uint8_t kuiBR        = pDstLastLine[kiPicW - 1];
+  int32_t i                  = 0;
 
   do {
-    const int32_t kiStrides	= (1 + i) * kiStride;
-    uint8_t* pTop			= pTmp - kiStrides;
-    uint8_t* pBottom			= pDstLastLine + kiStrides;
+    const int32_t kiStrides = (1 + i) * kiStride;
+    uint8_t* pTop           = pTmp - kiStrides;
+    uint8_t* pBottom        = pDstLastLine + kiStrides;
 
     // pad pTop and pBottom
-    memcpy (pTop, pTmp, kiPicW);				// confirmed_safe_unsafe_usage
-    memcpy (pBottom, pDstLastLine, kiPicW);	// confirmed_safe_unsafe_usage
+    memcpy (pTop, pTmp, kiPicW);                // confirmed_safe_unsafe_usage
+    memcpy (pBottom, pDstLastLine, kiPicW);     // confirmed_safe_unsafe_usage
 
     // pad corners
     memset (pTop - kiPaddingLen, kuiTL, kiPaddingLen); //pTop left
@@ -76,23 +76,23 @@
 
 static inline void ExpandPictureChroma_c (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
     const int32_t kiPicH) {
-  uint8_t* pTmp				= pDst;
-  uint8_t* pDstLastLine		= pTmp + (kiPicH - 1) * kiStride;
-  const int32_t kiPaddingLen	= (PADDING_LENGTH >> 1);
-  const uint8_t kuiTL			= pTmp[0];
-  const uint8_t kuiTR			= pTmp[kiPicW - 1];
-  const uint8_t kuiBL			= pDstLastLine[0];
-  const uint8_t kuiBR			= pDstLastLine[kiPicW - 1];
-  int32_t i					= 0;
+  uint8_t* pTmp                 = pDst;
+  uint8_t* pDstLastLine         = pTmp + (kiPicH - 1) * kiStride;
+  const int32_t kiPaddingLen    = (PADDING_LENGTH >> 1);
+  const uint8_t kuiTL           = pTmp[0];
+  const uint8_t kuiTR           = pTmp[kiPicW - 1];
+  const uint8_t kuiBL           = pDstLastLine[0];
+  const uint8_t kuiBR           = pDstLastLine[kiPicW - 1];
+  int32_t i                     = 0;
 
   do {
-    const int32_t kiStrides	= (1 + i) * kiStride;
-    uint8_t* pTop			= pTmp - kiStrides;
-    uint8_t* pBottom			= pDstLastLine + kiStrides;
+    const int32_t kiStrides = (1 + i) * kiStride;
+    uint8_t* pTop           = pTmp - kiStrides;
+    uint8_t* pBottom        = pDstLastLine + kiStrides;
 
     // pad pTop and pBottom
-    memcpy (pTop, pTmp, kiPicW);				// confirmed_safe_unsafe_usage
-    memcpy (pBottom, pDstLastLine, kiPicW);	// confirmed_safe_unsafe_usage
+    memcpy (pTop, pTmp, kiPicW);                // confirmed_safe_unsafe_usage
+    memcpy (pBottom, pDstLastLine, kiPicW);     // confirmed_safe_unsafe_usage
 
     // pad corners
     memset (pTop - kiPaddingLen, kuiTL, kiPaddingLen); //pTop left
@@ -147,13 +147,13 @@
 void ExpandReferencingPicture (uint8_t* pData[3], int32_t iWidth, int32_t iHeight, int32_t iStride[3],
                                PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChrom[2]) {
   /*local variable*/
-  uint8_t* pPicY	= pData[0];
+  uint8_t* pPicY  = pData[0];
   uint8_t* pPicCb = pData[1];
   uint8_t* pPicCr = pData[2];
-  const int32_t kiWidthY	= iWidth;
-  const int32_t kiHeightY	= iHeight;
-  const int32_t kiWidthUV	= kiWidthY >> 1;
-  const int32_t kiHeightUV	= kiHeightY >> 1;
+  const int32_t kiWidthY    = iWidth;
+  const int32_t kiHeightY   = iHeight;
+  const int32_t kiWidthUV   = kiWidthY >> 1;
+  const int32_t kiHeightUV  = kiHeightY >> 1;
 
 
 
@@ -160,7 +160,7 @@
   pExpLuma (pPicY, iStride[0], kiWidthY, kiHeightY);
   if (kiWidthUV >= 16) {
     // fix coding picture size as 16x16
-    const bool kbChrAligned = /*(iWidthUV >= 16) && */ ((kiWidthUV & 0x0F) == 0);	// chroma planes: (16+iWidthUV) & 15
+    const bool kbChrAligned = /*(iWidthUV >= 16) && */ ((kiWidthUV & 0x0F) == 0); // chroma planes: (16+iWidthUV) & 15
     pExpChrom[kbChrAligned] (pPicCb, iStride[1], kiWidthUV, kiHeightUV);
     pExpChrom[kbChrAligned] (pPicCr, iStride[2], kiWidthUV, kiHeightUV);
   } else {
--- a/codec/common/src/intra_pred_common.cpp
+++ b/codec/common/src/intra_pred_common.cpp
@@ -61,12 +61,12 @@
 void WelsI16x16LumaPredH_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride) {
   int32_t iStridex15 = (kiStride << 4) - kiStride;
   int32_t iPredStride = 16;
-  int32_t iPredStridex15 = 240;	//(iPredStride<<4)-iPredStride;
+  int32_t iPredStridex15 = 240; //(iPredStride<<4)-iPredStride;
   uint8_t i = 15;
 
   do {
-    const uint8_t kuiSrc8	= pRef[iStridex15 - 1];
-    const uint64_t kuiV64	= (uint64_t) (0x0101010101010101ULL * kuiSrc8);
+    const uint8_t kuiSrc8 = pRef[iStridex15 - 1];
+    const uint64_t kuiV64 = (uint64_t) (0x0101010101010101ULL * kuiSrc8);
     ST64 (&pPred[iPredStridex15], kuiV64);
     ST64 (&pPred[iPredStridex15 + 8], kuiV64);
 
--- a/codec/common/src/mc.cpp
+++ b/codec/common/src/mc.cpp
@@ -58,7 +58,7 @@
 //iB = dx * (8 - dy);
 //iC = (8 - dx) * dy;
 //iD = dx * dy
-static const uint8_t g_kuiABCD[8][8][4] = {	//g_kA[dy][dx], g_kB[dy][dx], g_kC[dy][dx], g_kD[dy][dx]
+static const uint8_t g_kuiABCD[8][8][4] = { //g_kA[dy][dx], g_kB[dy][dx], g_kC[dy][dx], g_kD[dy][dx]
   {
     {64, 0, 0, 0}, {56, 8, 0, 0}, {48, 16, 0, 0}, {40, 24, 0, 0},
     {32, 32, 0, 0}, {24, 40, 0, 0}, {16, 48, 0, 0}, {8, 56, 0, 0}
@@ -965,7 +965,7 @@
     {McHorVer20_neon,    McHorVer21_neon, McHorVer22_neon,    McHorVer23_neon},
     {McHorVer30_neon, McHorVer31_neon, McHorVer32_neon, McHorVer33_neon},
   };
-  //	pSrc += (iMvY >> 2) * iSrcStride + (iMvX >> 2);
+  // pSrc += (iMvY >> 2) * iSrcStride + (iMvX >> 2);
   pWelsMcFunc[iMvX & 0x03][iMvY & 0x03] (pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight);
 }
 void McChroma_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
@@ -1248,7 +1248,7 @@
     {McHorVer20_AArch64_neon,    McHorVer21_AArch64_neon, McHorVer22_AArch64_neon,    McHorVer23_AArch64_neon},
     {McHorVer30_AArch64_neon, McHorVer31_AArch64_neon, McHorVer32_AArch64_neon, McHorVer33_AArch64_neon},
   };
-  //	pSrc += (iMvY >> 2) * iSrcStride + (iMvX >> 2);
+  // pSrc += (iMvY >> 2) * iSrcStride + (iMvX >> 2);
   pWelsMcFunc[iMvX & 0x03][iMvY & 0x03] (pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight);
 }
 void McChroma_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
--- a/codec/common/src/memory_align.cpp
+++ b/codec/common/src/memory_align.cpp
@@ -49,9 +49,9 @@
 #endif//MEMORY_MONITOR
 {
   if ((kuiCacheLineSize == 0) || (kuiCacheLineSize & 0x0f))
-    m_nCacheLineSize	= 0x10;
+    m_nCacheLineSize = 0x10;
   else
-    m_nCacheLineSize	= kuiCacheLineSize;
+    m_nCacheLineSize = kuiCacheLineSize;
 }
 
 CMemoryAlign::~CMemoryAlign() {
@@ -61,14 +61,14 @@
 }
 
 void* WelsMalloc (const uint32_t kuiSize, const char* kpTag, const uint32_t kiAlign) {
-  const int32_t kiSizeOfVoidPointer	= sizeof (void**);
-  const int32_t kiSizeOfInt				= sizeof (int32_t);
-  const int32_t kiAlignedBytes		= kiAlign - 1;
-  const int32_t kiTrialRequestedSize	= kuiSize + kiAlignedBytes + kiSizeOfVoidPointer + kiSizeOfInt;
-  const int32_t kiActualRequestedSize	= kiTrialRequestedSize;
-  const uint32_t kiPayloadSize			= kuiSize;
+  const int32_t kiSizeOfVoidPointer     = sizeof (void**);
+  const int32_t kiSizeOfInt             = sizeof (int32_t);
+  const int32_t kiAlignedBytes          = kiAlign - 1;
+  const int32_t kiTrialRequestedSize    = kuiSize + kiAlignedBytes + kiSizeOfVoidPointer + kiSizeOfInt;
+  const int32_t kiActualRequestedSize   = kiTrialRequestedSize;
+  const uint32_t kiPayloadSize          = kuiSize;
 
-  uint8_t* pBuf		= (uint8_t*) malloc (kiActualRequestedSize);
+  uint8_t* pBuf = (uint8_t*) malloc (kiActualRequestedSize);
 #ifdef MEMORY_CHECK
   if (fpMemChkPoint == NULL) {
     m_fpMemChkPoint    = fopen ("./enc_mem_check_point.txt",  "at+");
--- a/codec/common/src/utils.cpp
+++ b/codec/common/src/utils.cpp
@@ -38,7 +38,7 @@
  *************************************************************************************
  */
 #include "utils.h"
-#include "crt_util_safe_x.h"	// Safe CRT routines like utils for cross platforms
+#include "crt_util_safe_x.h" // Safe CRT routines like utils for cross platforms
 #include "codec_app_def.h"
 float WelsCalcPsnr (const void* kpTarPic,
                     const int32_t kiTarStride,
@@ -112,10 +112,10 @@
   if (NULL == pTar || NULL == pRef)
     return (-1.0f);
 
-  for (y = 0; y < kiHeight; ++ y) {	// OPTable !!
+  for (y = 0; y < kiHeight; ++ y) { // OPTable !!
     for (x = 0; x < kiWidth; ++ x) {
       const int32_t kiT = pTar[y * kiTarStride + x] - pRef[y * kiRefStride + x];
-      iSqe	+= kiT * kiT;
+      iSqe += kiT * kiT;
     }
   }
   if (0 == iSqe) {
--- a/codec/common/src/welsCodecTrace.cpp
+++ b/codec/common/src/welsCodecTrace.cpp
@@ -39,7 +39,7 @@
 #include <stdarg.h>
 #include <string.h>
 
-#include "crt_util_safe_x.h"	// Safe CRT routines like utils for cross platforms
+#include "crt_util_safe_x.h" // Safe CRT routines like utils for cross platforms
 
 #include "welsCodecTrace.h"
 #include "utils.h"
@@ -78,7 +78,7 @@
   }
 
   char pBuf[MAX_LOG_SIZE] = {0};
-  WelsVsnprintf (pBuf, MAX_LOG_SIZE, Str_Format, vl);	// confirmed_safe_unsafe_usage
+  WelsVsnprintf (pBuf, MAX_LOG_SIZE, Str_Format, vl); // confirmed_safe_unsafe_usage
   if (m_fpTrace) {
     m_fpTrace (m_pTraceCtx, iLevel, pBuf);
   }
@@ -90,7 +90,7 @@
 
 void welsCodecTrace::SetTraceLevel (const int32_t iLevel) {
   if (iLevel >= 0)
-    m_iTraceLevel	= iLevel;
+    m_iTraceLevel = iLevel;
 }
 
 void welsCodecTrace::SetTraceCallback (WelsTraceCallback func) {
--- a/codec/console/common/inc/read_config.h
+++ b/codec/console/common/inc/read_config.h
@@ -59,10 +59,10 @@
   const std::string& GetFileName();
 
  private:
-  FILE*			m_pCfgFile;
-  std::string			m_strCfgFileName;
-  unsigned int	m_iLines;
+  FILE*             m_pCfgFile;
+  std::string       m_strCfgFileName;
+  unsigned int      m_iLines;
 };
 
-#endif	// READ_CONFIG_H__
+#endif // READ_CONFIG_H__
 
--- a/codec/console/common/src/read_config.cpp
+++ b/codec/console/common/src/read_config.cpp
@@ -53,7 +53,7 @@
   : m_pCfgFile (0)
   , m_strCfgFileName (kpConfigFileName)
   , m_iLines (0) {
-  if (strlen (kpConfigFileName) > 0) {	// confirmed_safe_unsafe_usage
+  if (strlen (kpConfigFileName) > 0) { // confirmed_safe_unsafe_usage
     m_pCfgFile = fopen (kpConfigFileName, "r");
   }
 }
@@ -75,7 +75,7 @@
 }
 
 void CReadConfig::Openf (const char* kpStrFile) {
-  if (kpStrFile != NULL && strlen (kpStrFile) > 0) {	// confirmed_safe_unsafe_usage
+  if (kpStrFile != NULL && strlen (kpStrFile) > 0) { // confirmed_safe_unsafe_usage
     m_strCfgFileName = kpStrFile;
     m_pCfgFile = fopen (kpStrFile, "r");
   }
@@ -90,7 +90,7 @@
   bool bCommentFlag = false;
 
   while (n < kiValSize) {
-    pVal[n]	= "";
+    pVal[n] = "";
     ++ n;
   }
 
@@ -109,7 +109,7 @@
           break;
         if (! (*strTags).empty()) {
           ++ nTagNum;
-          strTags	= &pVal[nTagNum];
+          strTags = &pVal[nTagNum];
         }
       } else
         *strTags += kCh;
--- a/codec/console/dec/src/d3d9_utils.cpp
+++ b/codec/console/dec/src/d3d9_utils.cpp
@@ -465,18 +465,18 @@
   const TCHAR kszWindowClass[] = TEXT ("Wels Decoder Class");
 
   WNDCLASSEX sWndClassEx = {0};
-  sWndClassEx.cbSize          = sizeof (WNDCLASSEX);
-  sWndClassEx.style			= CS_HREDRAW | CS_VREDRAW;
-  sWndClassEx.lpfnWndProc	    = (WNDPROC)WndProc;
-  sWndClassEx.cbClsExtra		= 0;
-  sWndClassEx.cbWndExtra		= 0;
-  sWndClassEx.hInstance		= GetModuleHandle (NULL);
-  sWndClassEx.hIcon			= LoadIcon (sWndClassEx.hInstance, (LPCTSTR)IDI_TESTSHARESURFACE);
-  sWndClassEx.hCursor		    = LoadCursor (NULL, IDC_ARROW);
-  sWndClassEx.hbrBackground	= (HBRUSH) (COLOR_WINDOW + 1);
-  sWndClassEx.lpszMenuName	= (LPCSTR)IDC_TESTSHARESURFACE;
-  sWndClassEx.lpszClassName	= kszWindowClass;
-  sWndClassEx.hIconSm		    = LoadIcon (sWndClassEx.hInstance, (LPCTSTR)IDI_SMALL);
+  sWndClassEx.cbSize            = sizeof (WNDCLASSEX);
+  sWndClassEx.style             = CS_HREDRAW | CS_VREDRAW;
+  sWndClassEx.lpfnWndProc       = (WNDPROC)WndProc;
+  sWndClassEx.cbClsExtra        = 0;
+  sWndClassEx.cbWndExtra        = 0;
+  sWndClassEx.hInstance         = GetModuleHandle (NULL);
+  sWndClassEx.hIcon             = LoadIcon (sWndClassEx.hInstance, (LPCTSTR)IDI_TESTSHARESURFACE);
+  sWndClassEx.hCursor           = LoadCursor (NULL, IDC_ARROW);
+  sWndClassEx.hbrBackground     = (HBRUSH) (COLOR_WINDOW + 1);
+  sWndClassEx.lpszMenuName      = (LPCSTR)IDC_TESTSHARESURFACE;
+  sWndClassEx.lpszClassName     = kszWindowClass;
+  sWndClassEx.hIconSm           = LoadIcon (sWndClassEx.hInstance, (LPCTSTR)IDI_SMALL);
 
   if (!RegisterClassEx (&sWndClassEx))
     return E_FAIL;
--- a/codec/console/dec/src/h264dec.cpp
+++ b/codec/console/dec/src/h264dec.cpp
@@ -69,12 +69,12 @@
 #endif
 //using namespace WelsDec;
 
-//#define NO_DELAY_DECODING	// For Demo interfaces test with no delay decoding
+//#define NO_DELAY_DECODING // For Demo interfaces test with no delay decoding
 
 void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, const char* kpOuputFileName,
                          int32_t& iWidth, int32_t& iHeight, const char* pOptionFileName, const char* pLengthFileName) {
-  FILE* pH264File	  = NULL;
-  FILE* pYuvFile	  = NULL;
+  FILE* pH264File   = NULL;
+  FILE* pYuvFile    = NULL;
   FILE* pOptionFile = NULL;
 // Lenght input mode support
   FILE* fpTrack = NULL;
@@ -129,7 +129,7 @@
     if (pYuvFile == NULL) {
       fprintf (stderr, "Can not open yuv file to output result of decoding..\n");
       // any options
-      //return;	// can let decoder work in quiet mode, no writing any output
+      //return; // can let decoder work in quiet mode, no writing any output
     } else
       fprintf (stderr, "Sequence output file name: %s..\n", kpOuputFileName);
   } else {
@@ -237,8 +237,8 @@
       pDst[1] = pData[1];
       pDst[2] = pData[2];
     }
-    iEnd	= WelsTime();
-    iTotal	+= iEnd - iStart;
+    iEnd    = WelsTime();
+    iTotal += iEnd - iStart;
     if (sDstBufInfo.iBufferStatus == 1) {
       cOutputModule.Process ((void**)pDst, &sDstBufInfo, pYuvFile);
       iWidth  = sDstBufInfo.UsrData.sSystemBuffer.iWidth;
@@ -269,8 +269,8 @@
       pDst[1] = pData[1];
       pDst[2] = pData[2];
     }
-    iEnd	= WelsTime();
-    iTotal	+= iEnd - iStart;
+    iEnd    = WelsTime();
+    iTotal += iEnd - iStart;
     if (sDstBufInfo.iBufferStatus == 1) {
       cOutputModule.Process ((void**)pDst, &sDstBufInfo, pYuvFile);
       iWidth  = sDstBufInfo.UsrData.sSystemBuffer.iWidth;
@@ -362,13 +362,13 @@
         long nRd = cReadCfg.ReadLine (&strTag[0]);
         if (nRd > 0) {
           if (strTag[0].compare ("InputFile") == 0) {
-            strInputFile	= strTag[1];
+            strInputFile = strTag[1];
           } else if (strTag[0].compare ("OutputFile") == 0) {
-            strOutputFile	= strTag[1];
+            strOutputFile = strTag[1];
           } else if (strTag[0].compare ("RestructionFile") == 0) {
-            strReconFile	= strTag[1];
+            strReconFile = strTag[1];
             int32_t iLen = (int32_t)strReconFile.length();
-            sDecParam.pFileNameRestructed	= new char[iLen + 1];
+            sDecParam.pFileNameRestructed = new char[iLen + 1];
             if (sDecParam.pFileNameRestructed != NULL) {
               sDecParam.pFileNameRestructed[iLen] = 0;
             }
@@ -375,13 +375,13 @@
 
             strncpy (sDecParam.pFileNameRestructed, strReconFile.c_str(), iLen); //confirmed_safe_unsafe_usage
           } else if (strTag[0].compare ("TargetDQID") == 0) {
-            sDecParam.uiTargetDqLayer	= (uint8_t)atol (strTag[1].c_str());
+            sDecParam.uiTargetDqLayer = (uint8_t)atol (strTag[1].c_str());
           } else if (strTag[0].compare ("OutColorFormat") == 0) {
             sDecParam.eOutputColorFormat = (EVideoFormatType) atoi (strTag[1].c_str());
           } else if (strTag[0].compare ("ErrorConcealmentIdc") == 0) {
             sDecParam.eEcActiveIdc = (ERROR_CON_IDC)atol (strTag[1].c_str());
           } else if (strTag[0].compare ("CPULoad") == 0) {
-            sDecParam.uiCpuLoad	= (uint32_t)atol (strTag[1].c_str());
+            sDecParam.uiCpuLoad = (uint32_t)atol (strTag[1].c_str());
           } else if (strTag[0].compare ("VideoBitstreamType") == 0) {
             sDecParam.sVideoProperty.eVideoBsType = (VIDEO_BITSTREAM_TYPE)atol (strTag[1].c_str());
           }
@@ -393,17 +393,17 @@
       }
     } 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];
-      sDecParam.eOutputColorFormat          = videoFormatI420;
-      sDecParam.uiTargetDqLayer	          = (uint8_t) - 1;
+      strInputFile = pArgV[1];
+      sDecParam.eOutputColorFormat = videoFormatI420;
+      sDecParam.uiTargetDqLayer = (uint8_t) - 1;
       sDecParam.eEcActiveIdc = ERROR_CON_SLICE_COPY;
       sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;
     }
   } else { //iArgC > 2
-    strInputFile	= pArgV[1];
-    strOutputFile	= pArgV[2];
-    sDecParam.eOutputColorFormat	= videoFormatI420;
-    sDecParam.uiTargetDqLayer	= (uint8_t) - 1;
+    strInputFile = pArgV[1];
+    strOutputFile = pArgV[2];
+    sDecParam.eOutputColorFormat = videoFormatI420;
+    sDecParam.uiTargetDqLayer = (uint8_t) - 1;
     sDecParam.eEcActiveIdc = ERROR_CON_SLICE_COPY;
     sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_DEFAULT;
     if (iArgC > 3) {
--- a/codec/console/enc/src/welsenc.cpp
+++ b/codec/console/enc/src/welsenc.cpp
@@ -42,7 +42,7 @@
 #ifdef ONLY_ENC_FRAMES_NUM
 #undef ONLY_ENC_FRAMES_NUM
 #endif//ONLY_ENC_FRAMES_NUM
-#define ONLY_ENC_FRAMES_NUM		INT_MAX // 2, INT_MAX	// type the num you try to encode here, 2, 10, etc
+#define ONLY_ENC_FRAMES_NUM INT_MAX // 2, INT_MAX // type the num you try to encode here, 2, 10, etc
 
 #if defined (WINDOWS_PHONE)
 float   g_fFPS           = 0.0;
@@ -96,8 +96,8 @@
  *  Layer Context
  */
 typedef struct LayerpEncCtx_s {
-  int32_t				iDLayerQp;
-  SSliceConfig	sSliceCfg;
+  int32_t       iDLayerQp;
+  SSliceConfig  sSliceCfg;
 } SLayerPEncCtx;
 
 typedef struct tagFilesSet {
@@ -138,9 +138,9 @@
       if (strTag[0].empty())
         continue;
       if (strTag[0].compare ("FrameWidth") == 0) {
-        pDLayer->iVideoWidth	= atoi (strTag[1].c_str());
+        pDLayer->iVideoWidth = atoi (strTag[1].c_str());
       } else if (strTag[0].compare ("FrameHeight") == 0) {
-        pDLayer->iVideoHeight	= atoi (strTag[1].c_str());
+        pDLayer->iVideoHeight = atoi (strTag[1].c_str());
       } else if (strTag[0].compare ("FrameRateOut") == 0) {
         pDLayer->fFrameRate = (float)atof (strTag[1].c_str());
       } else if (strTag[0].compare ("ReconFile") == 0) {
@@ -148,13 +148,13 @@
         if (kiLen >= sizeof (sFileSet.sRecFileName[iLayer]))
           return -1;
         sFileSet.sRecFileName[iLayer][kiLen] = '\0';
-        strncpy (sFileSet.sRecFileName[iLayer], strTag[1].c_str(), kiLen);	// confirmed_safe_unsafe_usage
+        strncpy (sFileSet.sRecFileName[iLayer], strTag[1].c_str(), kiLen); // confirmed_safe_unsafe_usage
       } else if (strTag[0].compare ("ProfileIdc") == 0) {
-        pDLayer->uiProfileIdc	= (EProfileIdc)atoi (strTag[1].c_str());
+        pDLayer->uiProfileIdc = (EProfileIdc)atoi (strTag[1].c_str());
       } else if (strTag[0].compare ("FRExt") == 0) {
-        //					pDLayer->frext_mode	= (bool)atoi(strTag[1].c_str());
+//        pDLayer->frext_mode = (bool)atoi(strTag[1].c_str());
       } else if (strTag[0].compare ("SpatialBitrate") == 0) {
-        pDLayer->iSpatialBitrate	= 1000 * atoi (strTag[1].c_str());
+        pDLayer->iSpatialBitrate = 1000 * atoi (strTag[1].c_str());
         if (pSvcParam.iRCMode != RC_OFF_MODE) {
           if (pDLayer->iSpatialBitrate <= 0) {
             fprintf (stderr, "Invalid spatial bitrate(%d) in dependency layer #%d.\n", pDLayer->iSpatialBitrate, iLayer);
@@ -181,11 +181,11 @@
           }
         }
       } else if (strTag[0].compare ("InitialQP") == 0) {
-        sLayerCtx.iDLayerQp	= atoi (strTag[1].c_str());
+        sLayerCtx.iDLayerQp = atoi (strTag[1].c_str());
       } else if (strTag[0].compare ("SliceMode") == 0) {
-        sLayerCtx.sSliceCfg.uiSliceMode	= (SliceModeEnum)atoi (strTag[1].c_str());
+        sLayerCtx.sSliceCfg.uiSliceMode = (SliceModeEnum)atoi (strTag[1].c_str());
       } else if (strTag[0].compare ("SliceSize") == 0) { //SM_DYN_SLICE
-        sLayerCtx.sSliceCfg.sSliceArgument.uiSliceSizeConstraint	= atoi (strTag[1].c_str());
+        sLayerCtx.sSliceCfg.sSliceArgument.uiSliceSizeConstraint = atoi (strTag[1].c_str());
         continue;
       } else if (strTag[0].compare ("SliceNum") == 0) {
         sLayerCtx.sSliceCfg.sSliceArgument.uiSliceNum = atoi (strTag[1].c_str());
@@ -197,12 +197,12 @@
       }
     }
   }
-  pDLayer->iDLayerQp	= sLayerCtx.iDLayerQp;
-  pDLayer->sSliceCfg.uiSliceMode		= sLayerCtx.sSliceCfg.uiSliceMode;
+  pDLayer->iDLayerQp             = sLayerCtx.iDLayerQp;
+  pDLayer->sSliceCfg.uiSliceMode = sLayerCtx.sSliceCfg.uiSliceMode;
 
-  memcpy (&pDLayer->sSliceCfg, &sLayerCtx.sSliceCfg, sizeof (SSliceConfig));	// confirmed_safe_unsafe_usage
+  memcpy (&pDLayer->sSliceCfg, &sLayerCtx.sSliceCfg, sizeof (SSliceConfig)); // confirmed_safe_unsafe_usage
   memcpy (&pDLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0], &sLayerCtx.sSliceCfg.sSliceArgument.uiSliceMbNum[0],
-          sizeof (sLayerCtx.sSliceCfg.sSliceArgument.uiSliceMbNum));	// confirmed_safe_unsafe_usage
+          sizeof (sLayerCtx.sSliceCfg.sSliceArgument.uiSliceMbNum)); // confirmed_safe_unsafe_usage
 
   return 0;
 }
@@ -225,21 +225,21 @@
         pSrcPic->iPicHeight = atoi (strTag[1].c_str());
       } else if (strTag[0].compare ("InputFile") == 0) {
         if (strTag[1].length() > 0)
-          sFileSet.strSeqFile	= strTag[1];
+          sFileSet.strSeqFile = strTag[1];
       } else if (strTag[0].compare ("OutputFile") == 0) {
-        sFileSet.strBsFile	= strTag[1];
+        sFileSet.strBsFile = strTag[1];
       } else if (strTag[0].compare ("MaxFrameRate") == 0) {
-        pSvcParam.fMaxFrameRate	= (float)atof (strTag[1].c_str());
+        pSvcParam.fMaxFrameRate = (float)atof (strTag[1].c_str());
       } else if (strTag[0].compare ("FramesToBeEncoded") == 0) {
-        sFileSet.uiFrameToBeCoded	= atoi (strTag[1].c_str());
+        sFileSet.uiFrameToBeCoded = atoi (strTag[1].c_str());
       } else if (strTag[0].compare ("TemporalLayerNum") == 0) {
-        pSvcParam.iTemporalLayerNum	= atoi (strTag[1].c_str());
+        pSvcParam.iTemporalLayerNum = atoi (strTag[1].c_str());
       } else if (strTag[0].compare ("IntraPeriod") == 0) {
-        pSvcParam.uiIntraPeriod	= atoi (strTag[1].c_str());
+        pSvcParam.uiIntraPeriod = atoi (strTag[1].c_str());
       } else if (strTag[0].compare ("MaxNalSize") == 0) {
         pSvcParam.uiMaxNalSize = atoi (strTag[1].c_str());
       } else if (strTag[0].compare ("SpsPpsIDStrategy") == 0) {
-        int32_t iValue	= atoi (strTag[1].c_str());
+        int32_t iValue = atoi (strTag[1].c_str());
         switch (iValue) {
           case 0:
             pSvcParam.eSpsPpsIdStrategy  = CONSTANT_ID;
@@ -261,13 +261,13 @@
             break;
         }
       } else if (strTag[0].compare ("EnableScalableSEI") == 0) {
-        pSvcParam.bEnableSSEI	= atoi (strTag[1].c_str()) ? true : false;
+        pSvcParam.bEnableSSEI = atoi (strTag[1].c_str()) ? true : false;
       } else if (strTag[0].compare ("EnableFrameCropping") == 0) {
         pSvcParam.bEnableFrameCroppingFlag = (atoi (strTag[1].c_str()) != 0);
       } else if (strTag[0].compare ("EntropyCodingModeFlag") == 0) {
         pSvcParam.iEntropyCodingModeFlag = (atoi (strTag[1].c_str()) != 0);
       } else if (strTag[0].compare ("LoopFilterDisableIDC") == 0) {
-        pSvcParam.iLoopFilterDisableIdc	= (int8_t)atoi (strTag[1].c_str());
+        pSvcParam.iLoopFilterDisableIdc = (int8_t)atoi (strTag[1].c_str());
         if (pSvcParam.iLoopFilterDisableIdc > 6 || pSvcParam.iLoopFilterDisableIdc < 0) {
           fprintf (stderr, "Invalid parameter in iLoopFilterDisableIdc: %d.\n", pSvcParam.iLoopFilterDisableIdc);
           iRet = 1;
@@ -274,58 +274,58 @@
           break;
         }
       } else if (strTag[0].compare ("LoopFilterAlphaC0Offset") == 0) {
-        pSvcParam.iLoopFilterAlphaC0Offset	= (int8_t)atoi (strTag[1].c_str());
+        pSvcParam.iLoopFilterAlphaC0Offset = (int8_t)atoi (strTag[1].c_str());
         if (pSvcParam.iLoopFilterAlphaC0Offset < -6)
-          pSvcParam.iLoopFilterAlphaC0Offset	= -6;
+          pSvcParam.iLoopFilterAlphaC0Offset = -6;
         else if (pSvcParam.iLoopFilterAlphaC0Offset > 6)
-          pSvcParam.iLoopFilterAlphaC0Offset	= 6;
+          pSvcParam.iLoopFilterAlphaC0Offset = 6;
       } else if (strTag[0].compare ("LoopFilterBetaOffset") == 0) {
-        pSvcParam.iLoopFilterBetaOffset	= (int8_t)atoi (strTag[1].c_str());
+        pSvcParam.iLoopFilterBetaOffset = (int8_t)atoi (strTag[1].c_str());
         if (pSvcParam.iLoopFilterBetaOffset < -6)
-          pSvcParam.iLoopFilterBetaOffset	= -6;
+          pSvcParam.iLoopFilterBetaOffset = -6;
         else if (pSvcParam.iLoopFilterBetaOffset > 6)
-          pSvcParam.iLoopFilterBetaOffset	= 6;
+          pSvcParam.iLoopFilterBetaOffset = 6;
       } else if (strTag[0].compare ("MultipleThreadIdc") == 0) {
         // # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
-        pSvcParam.iMultipleThreadIdc	= atoi (strTag[1].c_str());
+        pSvcParam.iMultipleThreadIdc = atoi (strTag[1].c_str());
         if (pSvcParam.iMultipleThreadIdc < 0)
           pSvcParam.iMultipleThreadIdc = 0;
         else if (pSvcParam.iMultipleThreadIdc > MAX_THREADS_NUM)
           pSvcParam.iMultipleThreadIdc = MAX_THREADS_NUM;
       } else if (strTag[0].compare ("RCMode") == 0) {
-        pSvcParam.iRCMode	= (RC_MODES) atoi (strTag[1].c_str());
+        pSvcParam.iRCMode = (RC_MODES) atoi (strTag[1].c_str());
       } else if (strTag[0].compare ("TargetBitrate") == 0) {
-        pSvcParam.iTargetBitrate	= 1000 * atoi (strTag[1].c_str());
+        pSvcParam.iTargetBitrate = 1000 * atoi (strTag[1].c_str());
         if ((pSvcParam.iRCMode != RC_OFF_MODE) && pSvcParam.iTargetBitrate <= 0) {
           fprintf (stderr, "In