From dd913ef878294f338895cf11ed3c231b636823b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 4 May 2015 10:52:40 +0300 Subject: [PATCH 1/2] Don't use tabs for indentation in multi-line macros The astyle configuration makes sure normal code is indented consistently with 2 spaces, but astyle doesn't seem to touch the indentation in these multi-line macros. --- codec/common/inc/macros.h | 42 +++++++++---------- codec/decoder/core/inc/dec_golomb.h | 18 ++++---- codec/decoder/core/inc/vlc_decoder.h | 12 +++--- codec/decoder/core/src/deblocking.cpp | 14 +++---- codec/decoder/core/src/parse_mb_syn_cavlc.cpp | 16 +++---- codec/encoder/core/src/deblocking.cpp | 32 +++++++------- codec/encoder/core/src/md.cpp | 8 ++-- .../scrolldetection/ScrollDetectionFuncs.h | 8 ++-- test/processing/ProcessUT_VaaCalc.cpp | 20 ++++----- 9 files changed, 85 insertions(+), 85 deletions(-) diff --git a/codec/common/inc/macros.h b/codec/common/inc/macros.h index 87a93ace..6c7c5166 100644 --- a/codec/common/inc/macros.h +++ b/codec/common/inc/macros.h @@ -55,16 +55,16 @@ * auxiliary var: _nm ## _tEmP */ #define ENFORCE_STACK_ALIGN_1D(_tp, _nm, _sz, _al) \ - _tp _nm ## _tEmP[(_sz)+(_al)-1]; \ - _tp *_nm = _nm ## _tEmP + ((_al)-1) - (((uintptr_t)(_nm ## _tEmP + ((_al)-1)) & ((_al)-1))/sizeof(_tp)); + _tp _nm ## _tEmP[(_sz)+(_al)-1]; \ + _tp *_nm = _nm ## _tEmP + ((_al)-1) - (((uintptr_t)(_nm ## _tEmP + ((_al)-1)) & ((_al)-1))/sizeof(_tp)); #define ENFORCE_STACK_ALIGN_2D(_tp, _nm, _cx, _cy, _al) \ - assert( ((_al) && !((_al) & ((_al) - 1))) && ((_al) >= sizeof(_tp)) ); /*_al should be power-of-2 and >= sizeof(_tp)*/\ - _tp _nm ## _tEmP[(_cx)*(_cy)+(_al)/sizeof(_tp)-1]; \ - _tp *_nm ## _tEmP_al = _nm ## _tEmP + ((_al)/sizeof(_tp)-1); \ - _nm ## _tEmP_al -= (((uintptr_t)_nm ## _tEmP_al & ((_al)-1))/sizeof(_tp)); \ - _tp (*_nm)[(_cy)] = (_tp (*)[(_cy)])_nm ## _tEmP_al; + assert( ((_al) && !((_al) & ((_al) - 1))) && ((_al) >= sizeof(_tp)) ); /*_al should be power-of-2 and >= sizeof(_tp)*/\ + _tp _nm ## _tEmP[(_cx)*(_cy)+(_al)/sizeof(_tp)-1]; \ + _tp *_nm ## _tEmP_al = _nm ## _tEmP + ((_al)/sizeof(_tp)-1); \ + _nm ## _tEmP_al -= (((uintptr_t)_nm ## _tEmP_al & ((_al)-1))/sizeof(_tp)); \ + _tp (*_nm)[(_cy)] = (_tp (*)[(_cy)])_nm ## _tEmP_al; #if defined(_MSC_VER) @@ -129,10 +129,10 @@ #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) { \ - nC = nA + nB + 1; \ - nC >>= (uint8_t)( nA != -1 && nB != -1); \ - nC += (uint8_t)(nA == -1 && nB == -1); \ +#define WELS_NON_ZERO_COUNT_AVERAGE(nC,nA,nB) { \ + nC = nA + nB + 1; \ + nC >>= (uint8_t)( nA != -1 && nB != -1); \ + nC += (uint8_t)(nA == -1 && nB == -1); \ } static inline int32_t CeilLog2 (int32_t i) { @@ -212,9 +212,9 @@ template T WelsClip3(T iX, T iY, T iZ) { */ #ifndef WELS_VERIFY_RETURN_IFNEQ #define WELS_VERIFY_RETURN_IFNEQ(iResult, iExpected) \ - if ( iResult != iExpected ){ \ - return iResult; \ - } + if (iResult != iExpected) { \ + return iResult; \ + } #endif//#if WELS_VERIFY_RETURN_IF /* @@ -224,9 +224,9 @@ template T WelsClip3(T iX, T iY, T iZ) { */ #ifndef WELS_VERIFY_RETURN_IF #define WELS_VERIFY_RETURN_IF(iResult, bCaseIf) \ - if ( bCaseIf ){ \ - return iResult; \ - } + if (bCaseIf) { \ + return iResult; \ + } #endif//#if WELS_VERIFY_RETURN_IF /* @@ -238,10 +238,10 @@ template T WelsClip3(T iX, T iY, T iZ) { */ #ifndef WELS_VERIFY_RETURN_PROC_IF #define WELS_VERIFY_RETURN_PROC_IF(iResult, bCaseIf, fProc) \ - if ( bCaseIf ){ \ - fProc; \ - return iResult; \ - } + if (bCaseIf) { \ + fProc; \ + return iResult; \ + } #endif//#if WELS_VERIFY_RETURN_PROC_IF static inline int32_t WELS_LOG2 (uint32_t v) { diff --git a/codec/decoder/core/inc/dec_golomb.h b/codec/decoder/core/inc/dec_golomb.h index 58705763..a1d7246c 100644 --- a/codec/decoder/core/inc/dec_golomb.h +++ b/codec/decoder/core/inc/dec_golomb.h @@ -58,20 +58,20 @@ namespace WelsDec { if (iReadBytes > iAllowedBytes+1) { \ return ERR_INFO_READ_OVERFLOW; \ } \ - iCurBits |= ((uint32_t)((pBufPtr[0] << 8) | pBufPtr[1])) << (iLeftBits); \ - iLeftBits -= 16; \ - pBufPtr +=2; \ + iCurBits |= ((uint32_t)((pBufPtr[0] << 8) | pBufPtr[1])) << (iLeftBits); \ + iLeftBits -= 16; \ + pBufPtr +=2; \ } #define NEED_BITS(iCurBits, pBufPtr, iLeftBits, iAllowedBytes, iReadBytes) { \ - if( iLeftBits > 0 ) { \ - GET_WORD(iCurBits, pBufPtr, iLeftBits, iAllowedBytes, iReadBytes); \ - } \ + if (iLeftBits > 0) { \ + GET_WORD(iCurBits, pBufPtr, iLeftBits, iAllowedBytes, iReadBytes); \ + } \ } #define UBITS(iCurBits, iNumBits) (iCurBits>>(32-(iNumBits))) #define DUMP_BITS(iCurBits, pBufPtr, iLeftBits, iNumBits, iAllowedBytes, iReadBytes) { \ - iCurBits <<= (iNumBits); \ - iLeftBits += (iNumBits); \ - NEED_BITS(iCurBits, pBufPtr, iLeftBits, iAllowedBytes, iReadBytes); \ + iCurBits <<= (iNumBits); \ + iLeftBits += (iNumBits); \ + NEED_BITS(iCurBits, pBufPtr, iLeftBits, iAllowedBytes, iReadBytes); \ } static inline int32_t BsGetBits (PBitStringAux pBs, int32_t iNumBits, uint32_t* pCode) { diff --git a/codec/decoder/core/inc/vlc_decoder.h b/codec/decoder/core/inc/vlc_decoder.h index 7f15cfa9..9f19700d 100644 --- a/codec/decoder/core/inc/vlc_decoder.h +++ b/codec/decoder/core/inc/vlc_decoder.h @@ -105,12 +105,12 @@ extern const uint8_t g_kuiZeroLeftBitNumMap[16]; #if defined(_MSC_VER) && defined(_M_IX86) //TODO need linux version #define WELS_GET_PREFIX_BITS(inval,outval){\ - uint32_t local = inval;\ - __asm xor eax, eax\ - __asm bsr eax, local\ - __asm sub eax, 32\ - __asm neg eax\ - __asm mov outval, eax\ + uint32_t local = inval;\ + __asm xor eax, eax\ + __asm bsr eax, local\ + __asm sub eax, 32\ + __asm neg eax\ + __asm mov outval, eax\ } #else #define WELS_GET_PREFIX_BITS(inval, outval) outval = GetPrefixBits(inval) diff --git a/codec/decoder/core/src/deblocking.cpp b/codec/decoder/core/src/deblocking.cpp index 8c8f3963..508c9b74 100644 --- a/codec/decoder/core/src/deblocking.cpp +++ b/codec/decoder/core/src/deblocking.cpp @@ -81,9 +81,9 @@ namespace WelsDec { #define GET_ALPHA_BETA_FROM_QP(iQp, iAlphaOffset, iBetaOffset, iIndex, iAlpha, iBeta) \ {\ - iIndex = (iQp + iAlphaOffset);\ - iAlpha = g_kuiAlphaTable(iIndex);\ - iBeta = g_kiBetaTable((iQp + iBetaOffset));\ + iIndex = (iQp + iAlphaOffset);\ + iAlpha = g_kuiAlphaTable(iIndex);\ + iBeta = g_kiBetaTable((iQp + iBetaOffset));\ } static const uint8_t g_kuiAlphaTable[52 + 24] = { //this table refers to Table 8-16 in H.264/AVC standard @@ -151,10 +151,10 @@ static const uint8_t g_kuiTableB8x8Idx[2][16] = { #define TC0_TBL_LOOKUP(tc, iIndexA, pBS, bChroma) \ {\ - tc[0] = g_kiTc0Table(iIndexA)[pBS[0]] + bChroma;\ - tc[1] = g_kiTc0Table(iIndexA)[pBS[1]] + bChroma;\ - tc[2] = g_kiTc0Table(iIndexA)[pBS[2]] + bChroma;\ - tc[3] = g_kiTc0Table(iIndexA)[pBS[3]] + bChroma;\ + tc[0] = g_kiTc0Table(iIndexA)[pBS[0]] + bChroma;\ + tc[1] = g_kiTc0Table(iIndexA)[pBS[1]] + bChroma;\ + tc[2] = g_kiTc0Table(iIndexA)[pBS[2]] + bChroma;\ + tc[3] = g_kiTc0Table(iIndexA)[pBS[3]] + bChroma;\ } void inline DeblockingBSInsideMBAvsbase (int8_t* pNnzTab, uint8_t nBS[2][4][4], int32_t iLShiftFactor) { diff --git a/codec/decoder/core/src/parse_mb_syn_cavlc.cpp b/codec/decoder/core/src/parse_mb_syn_cavlc.cpp index 09314139..98f4a441 100644 --- a/codec/decoder/core/src/parse_mb_syn_cavlc.cpp +++ b/codec/decoder/core/src/parse_mb_syn_cavlc.cpp @@ -497,16 +497,16 @@ int32_t PredIntra4x4Mode (int8_t* pIntraPredMode, int32_t iIdx4) { #define CHECK_I16_MODE(a, b, c, d) \ ((a == g_ksI16PredInfo[a].iPredMode) && \ - (b >= g_ksI16PredInfo[a].iLeftAvail) && \ - (c >= g_ksI16PredInfo[a].iTopAvail) && \ - (d >= g_ksI16PredInfo[a].iLeftTopAvail)); + (b >= g_ksI16PredInfo[a].iLeftAvail) && \ + (c >= g_ksI16PredInfo[a].iTopAvail) && \ + (d >= g_ksI16PredInfo[a].iLeftTopAvail)); #define CHECK_CHROMA_MODE(a, b, c, d) \ - ((a == g_ksChromaPredInfo[a].iPredMode) && \ - (b >= g_ksChromaPredInfo[a].iLeftAvail) && \ - (c >= g_ksChromaPredInfo[a].iTopAvail) && \ - (d >= g_ksChromaPredInfo[a].iLeftTopAvail)); + ((a == g_ksChromaPredInfo[a].iPredMode) && \ + (b >= g_ksChromaPredInfo[a].iLeftAvail) && \ + (c >= g_ksChromaPredInfo[a].iTopAvail) && \ + (d >= g_ksChromaPredInfo[a].iLeftTopAvail)); #define CHECK_I4_MODE(a, b, c, d) \ - ((a == g_ksI4PredInfo[a].iPredMode) && \ + ((a == g_ksI4PredInfo[a].iPredMode) && \ (b >= g_ksI4PredInfo[a].iLeftAvail) && \ (c >= g_ksI4PredInfo[a].iTopAvail) && \ (d >= g_ksI4PredInfo[a].iLeftTopAvail)); diff --git a/codec/encoder/core/src/deblocking.cpp b/codec/encoder/core/src/deblocking.cpp index c3708168..eea2aa5b 100644 --- a/codec/encoder/core/src/deblocking.cpp +++ b/codec/encoder/core/src/deblocking.cpp @@ -48,25 +48,25 @@ namespace WelsEnc { #define g_kiTc0Table(x) g_kiTc0Table[(x)] #define MB_BS_MV(sCurMv, sNeighMv, uiBIdx, uiBnIdx) \ - (\ - ( WELS_ABS( sCurMv[uiBIdx].iMvX - sNeighMv[uiBnIdx].iMvX ) >= 4 ) ||\ - ( WELS_ABS( sCurMv[uiBIdx].iMvY - sNeighMv[uiBnIdx].iMvY ) >= 4 )\ - ) + (\ + ( WELS_ABS( sCurMv[uiBIdx].iMvX - sNeighMv[uiBnIdx].iMvX ) >= 4 ) ||\ + ( WELS_ABS( sCurMv[uiBIdx].iMvY - sNeighMv[uiBnIdx].iMvY ) >= 4 )\ + ) #define SMB_EDGE_MV(uiRefIndex, sMotionVector, uiBIdx, uiBnIdx) \ - (\ - !!((WELS_ABS(sMotionVector[uiBIdx].iMvX - sMotionVector[uiBnIdx].iMvX) &(~3)) | (WELS_ABS(sMotionVector[uiBIdx].iMvY - sMotionVector[uiBnIdx].iMvY) &(~3)))\ - ) + (\ + !!((WELS_ABS(sMotionVector[uiBIdx].iMvX - sMotionVector[uiBnIdx].iMvX) &(~3)) | (WELS_ABS(sMotionVector[uiBIdx].iMvY - sMotionVector[uiBnIdx].iMvY) &(~3)))\ + ) #define BS_EDGE(bsx1, uiRefIndex, sMotionVector, uiBIdx, uiBnIdx) \ - ( (bsx1|SMB_EDGE_MV(uiRefIndex, sMotionVector, uiBIdx, uiBnIdx))<<(bsx1?1:0)) + ( (bsx1|SMB_EDGE_MV(uiRefIndex, sMotionVector, uiBIdx, uiBnIdx))<<(bsx1?1:0)) #define GET_ALPHA_BETA_FROM_QP(QP, iAlphaOffset, iBetaOffset, iIdexA, iAlpha, iBeta) \ {\ - iIdexA = (QP + iAlphaOffset);\ - iIdexA = CLIP3_QP_0_51(iIdexA);\ - iAlpha = g_kuiAlphaTable(iIdexA);\ - iBeta = g_kiBetaTable((CLIP3_QP_0_51(QP + iBetaOffset)));\ + iIdexA = (QP + iAlphaOffset);\ + iIdexA = CLIP3_QP_0_51(iIdexA);\ + iAlpha = g_kuiAlphaTable(iIdexA);\ + iBeta = g_kiBetaTable((CLIP3_QP_0_51(QP + iBetaOffset)));\ } static const uint8_t g_kuiAlphaTable[52 + 12] = { //this table refers to Table 8-16 in H.264/AVC standard @@ -117,10 +117,10 @@ static const uint8_t g_kuiTableBIdx[2][8] = { #define TC0_TBL_LOOKUP(iTc, iIdexA, pBS, bchroma) \ {\ - iTc[0] = g_kiTc0Table(iIdexA)[pBS[0]] + bchroma;\ - iTc[1] = g_kiTc0Table(iIdexA)[pBS[1]] + bchroma;\ - iTc[2] = g_kiTc0Table(iIdexA)[pBS[2]] + bchroma;\ - iTc[3] = g_kiTc0Table(iIdexA)[pBS[3]] + bchroma;\ + iTc[0] = g_kiTc0Table(iIdexA)[pBS[0]] + bchroma;\ + iTc[1] = g_kiTc0Table(iIdexA)[pBS[1]] + bchroma;\ + iTc[2] = g_kiTc0Table(iIdexA)[pBS[2]] + bchroma;\ + iTc[3] = g_kiTc0Table(iIdexA)[pBS[3]] + bchroma;\ } void inline DeblockingBSInsideMBAvsbase (int8_t* pNnzTab, uint8_t uiBS[2][4][4], int32_t iLShiftFactor) { diff --git a/codec/encoder/core/src/md.cpp b/codec/encoder/core/src/md.cpp index a5ad6552..15625f19 100644 --- a/codec/encoder/core/src/md.cpp +++ b/codec/encoder/core/src/md.cpp @@ -522,10 +522,10 @@ typedef struct TagQuarParams { } SQuarRefineParams; #define SWITCH_BEST_TMP_BUF(prev_best, curr_best){\ - pParams->iBestCost = iCurCost;\ - pTmp = prev_best;\ - prev_best = curr_best;\ - curr_best = pTmp;\ + pParams->iBestCost = iCurCost;\ + pTmp = prev_best;\ + prev_best = curr_best;\ + curr_best = pTmp;\ } #define CALC_COST(me_buf, lm) ( pFunc->sSampleDealingFuncs.pfMeCost[kuiPixel](pEncMb, iStrideEnc, me_buf, ME_REFINE_BUF_STRIDE) + lm ) diff --git a/codec/processing/src/scrolldetection/ScrollDetectionFuncs.h b/codec/processing/src/scrolldetection/ScrollDetectionFuncs.h index d94324e9..8d998589 100644 --- a/codec/processing/src/scrolldetection/ScrollDetectionFuncs.h +++ b/codec/processing/src/scrolldetection/ScrollDetectionFuncs.h @@ -45,10 +45,10 @@ WELSVP_NAMESPACE_BEGIN #define CHECK_OFFSET 25 #define MAX_SCROLL_MV_Y 511 #define REGION_NUMBER 9 -#define RECORD_COLOR(a, x) \ -{ \ - int32_t _t = (uint8_t)(a); \ - x[_t>>5] |= (1 << (_t&31)); \ +#define RECORD_COLOR(a, x) \ +{ \ + int32_t _t = (uint8_t)(a); \ + x[_t>>5] |= (1 << (_t&31)); \ } int32_t CheckLine (uint8_t* pData, int32_t iWidth); diff --git a/test/processing/ProcessUT_VaaCalc.cpp b/test/processing/ProcessUT_VaaCalc.cpp index 5d39ed84..f62d09b3 100644 --- a/test/processing/ProcessUT_VaaCalc.cpp +++ b/test/processing/ProcessUT_VaaCalc.cpp @@ -576,20 +576,20 @@ TEST (VAACalcFuncTest, func) { \ if (0 == (m_uiCpuFeatureFlag & CPUFLAGS)) \ return; \ } \ - ENFORCE_STACK_ALIGN_1D (uint8_t, cur_data_c, BUFFER_SIZE, 16); \ + ENFORCE_STACK_ALIGN_1D (uint8_t, cur_data_c, BUFFER_SIZE, 16); \ ENFORCE_STACK_ALIGN_1D (uint8_t, ref_data_c, BUFFER_SIZE, 16); \ ENFORCE_STACK_ALIGN_1D (int32_t, psad8x8_c, BUFFER_SIZE/64, 16); \ - int32_t pic_width_c; \ - int32_t pic_height_c; \ - int32_t pic_stride_c; \ - int32_t psadframe_c; \ - ENFORCE_STACK_ALIGN_1D (uint8_t, cur_data_a, BUFFER_SIZE, 16); \ + int32_t pic_width_c; \ + int32_t pic_height_c; \ + int32_t pic_stride_c; \ + int32_t psadframe_c; \ + ENFORCE_STACK_ALIGN_1D (uint8_t, cur_data_a, BUFFER_SIZE, 16); \ ENFORCE_STACK_ALIGN_1D (uint8_t, ref_data_a, BUFFER_SIZE, 16); \ ENFORCE_STACK_ALIGN_1D (int32_t, psad8x8_a, BUFFER_SIZE/64, 16); \ - int32_t pic_width_a; \ - int32_t pic_height_a; \ - int32_t pic_stride_a; \ - int32_t psadframe_a; \ + int32_t pic_width_a; \ + int32_t pic_height_a; \ + int32_t pic_stride_a; \ + int32_t psadframe_a; \ pic_width_c = pic_width_a = 320-16; \ pic_height_c = pic_height_a = 320; \ pic_stride_c = pic_stride_a = 320; \ From 7a80c21526add871d4558c0d89a35870e871a576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 27 Apr 2015 15:45:11 +0300 Subject: [PATCH 2/2] Reformat tables without tabs --- codec/common/src/common_tables.cpp | 132 +++++------ .../decoder/core/src/decoder_data_tables.cpp | 42 ++-- codec/encoder/core/src/encode_mb_aux.cpp | 104 ++++----- .../encoder/core/src/encoder_data_tables.cpp | 178 +++++++-------- codec/encoder/core/src/svc_base_layer_md.cpp | 42 ++-- .../processing/src/denoise/denoise_filter.cpp | 16 +- test/encoder/EncUT_EncoderMb.cpp | 208 +++++++++--------- 7 files changed, 361 insertions(+), 361 deletions(-) diff --git a/codec/common/src/common_tables.cpp b/codec/common/src/common_tables.cpp index 2b4ec0f3..c2431d17 100644 --- a/codec/common/src/common_tables.cpp +++ b/codec/common/src/common_tables.cpp @@ -48,17 +48,17 @@ const uint8_t g_kuiMbCountScan4Idx[24] = { const uint8_t g_kuiCache48CountScan4Idx[24] = { /* Luma */ - 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8, - 11, 12, 19, 20, // 3+1*8, 4+1*8, 3+2*8, 4+2*8, - 25, 26, 33, 34, // 1+3*8, 2+3*8, 1+4*8, 2+4*8, - 27, 28, 35, 36, // 3+3*8, 4+3*8, 3+4*8, 4+4*8, + 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8, + 11, 12, 19, 20, // 3+1*8, 4+1*8, 3+2*8, 4+2*8, + 25, 26, 33, 34, // 1+3*8, 2+3*8, 1+4*8, 2+4*8, + 27, 28, 35, 36, // 3+3*8, 4+3*8, 3+4*8, 4+4*8, /* Cb */ - 14, 15, // 6+1*8, 7+1*8, - 22, 23, // 6+2*8, 7+2*8, + 14, 15, // 6+1*8, 7+1*8, + 22, 23, // 6+2*8, 7+2*8, /* Cr */ - 38, 39, // 6+4*8, 7+4*8, - 46, 47, // 6+5*8, 7+5*8, + 38, 39, // 6+4*8, 7+4*8, + 46, 47, // 6+5*8, 7+5*8, }; const uint8_t g_kuiMatrixV[6][8][8] = { // generated from equation 8-317, 8-318 @@ -149,38 +149,38 @@ const uint8_t g_kuiChromaQpTable[52] = { * vcl type map for given NAL unit type and corresponding H264 type (0: AVC; 1: SVC). */ const EVclType g_keTypeMap[32][2] = { - { NON_VCL, NON_VCL }, // 0: NAL_UNIT_UNSPEC_0 - { VCL, VCL, }, // 1: NAL_UNIT_CODED_SLICE - { VCL, NOT_APP }, // 2: NAL_UNIT_CODED_SLICE_DPA - { VCL, NOT_APP }, // 3: NAL_UNIT_CODED_SLICE_DPB - { VCL, NOT_APP }, // 4: NAL_UNIT_CODED_SLICE_DPC - { VCL, VCL }, // 5: NAL_UNIT_CODED_SLICE_IDR - { NON_VCL, NON_VCL }, // 6: NAL_UNIT_SEI - { NON_VCL, NON_VCL }, // 7: NAL_UNIT_SPS - { NON_VCL, NON_VCL }, // 8: NAL_UNIT_PPS - { NON_VCL, NON_VCL }, // 9: NAL_UNIT_AU_DELIMITER - { NON_VCL, NON_VCL }, // 10: NAL_UNIT_END_OF_SEQ - { NON_VCL, NON_VCL }, // 11: NAL_UNIT_END_OF_STR - { NON_VCL, NON_VCL }, // 12: NAL_UNIT_FILLER_DATA - { NON_VCL, NON_VCL }, // 13: NAL_UNIT_SPS_EXT - { NON_VCL, NON_VCL }, // 14: NAL_UNIT_PREFIX, NEED associate succeeded NAL to make a VCL - { NON_VCL, NON_VCL }, // 15: NAL_UNIT_SUBSET_SPS - { NON_VCL, NON_VCL }, // 16: NAL_UNIT_RESV_16 - { NON_VCL, NON_VCL }, // 17: NAL_UNIT_RESV_17 - { NON_VCL, NON_VCL }, // 18: NAL_UNIT_RESV_18 - { NON_VCL, NON_VCL }, // 19: NAL_UNIT_AUX_CODED_SLICE - { NON_VCL, VCL }, // 20: NAL_UNIT_CODED_SLICE_EXT - { NON_VCL, NON_VCL }, // 21: NAL_UNIT_RESV_21 - { NON_VCL, NON_VCL }, // 22: NAL_UNIT_RESV_22 - { NON_VCL, NON_VCL }, // 23: NAL_UNIT_RESV_23 - { NON_VCL, NON_VCL }, // 24: NAL_UNIT_UNSPEC_24 - { NON_VCL, NON_VCL }, // 25: NAL_UNIT_UNSPEC_25 - { NON_VCL, NON_VCL }, // 26: NAL_UNIT_UNSPEC_26 - { NON_VCL, NON_VCL }, // 27: NAL_UNIT_UNSPEC_27 - { NON_VCL, NON_VCL }, // 28: NAL_UNIT_UNSPEC_28 - { NON_VCL, NON_VCL }, // 29: NAL_UNIT_UNSPEC_29 - { NON_VCL, NON_VCL }, // 30: NAL_UNIT_UNSPEC_30 - { NON_VCL, NON_VCL } // 31: NAL_UNIT_UNSPEC_31 + { NON_VCL, NON_VCL }, // 0: NAL_UNIT_UNSPEC_0 + { VCL, VCL, }, // 1: NAL_UNIT_CODED_SLICE + { VCL, NOT_APP }, // 2: NAL_UNIT_CODED_SLICE_DPA + { VCL, NOT_APP }, // 3: NAL_UNIT_CODED_SLICE_DPB + { VCL, NOT_APP }, // 4: NAL_UNIT_CODED_SLICE_DPC + { VCL, VCL }, // 5: NAL_UNIT_CODED_SLICE_IDR + { NON_VCL, NON_VCL }, // 6: NAL_UNIT_SEI + { NON_VCL, NON_VCL }, // 7: NAL_UNIT_SPS + { NON_VCL, NON_VCL }, // 8: NAL_UNIT_PPS + { NON_VCL, NON_VCL }, // 9: NAL_UNIT_AU_DELIMITER + { NON_VCL, NON_VCL }, // 10: NAL_UNIT_END_OF_SEQ + { NON_VCL, NON_VCL }, // 11: NAL_UNIT_END_OF_STR + { NON_VCL, NON_VCL }, // 12: NAL_UNIT_FILLER_DATA + { NON_VCL, NON_VCL }, // 13: NAL_UNIT_SPS_EXT + { NON_VCL, NON_VCL }, // 14: NAL_UNIT_PREFIX, NEED associate succeeded NAL to make a VCL + { NON_VCL, NON_VCL }, // 15: NAL_UNIT_SUBSET_SPS + { NON_VCL, NON_VCL }, // 16: NAL_UNIT_RESV_16 + { NON_VCL, NON_VCL }, // 17: NAL_UNIT_RESV_17 + { NON_VCL, NON_VCL }, // 18: NAL_UNIT_RESV_18 + { NON_VCL, NON_VCL }, // 19: NAL_UNIT_AUX_CODED_SLICE + { NON_VCL, VCL }, // 20: NAL_UNIT_CODED_SLICE_EXT + { NON_VCL, NON_VCL }, // 21: NAL_UNIT_RESV_21 + { NON_VCL, NON_VCL }, // 22: NAL_UNIT_RESV_22 + { NON_VCL, NON_VCL }, // 23: NAL_UNIT_RESV_23 + { NON_VCL, NON_VCL }, // 24: NAL_UNIT_UNSPEC_24 + { NON_VCL, NON_VCL }, // 25: NAL_UNIT_UNSPEC_25 + { NON_VCL, NON_VCL }, // 26: NAL_UNIT_UNSPEC_26 + { NON_VCL, NON_VCL }, // 27: NAL_UNIT_UNSPEC_27 + { NON_VCL, NON_VCL }, // 28: NAL_UNIT_UNSPEC_28 + { NON_VCL, NON_VCL }, // 29: NAL_UNIT_UNSPEC_29 + { NON_VCL, NON_VCL }, // 30: NAL_UNIT_UNSPEC_30 + { NON_VCL, NON_VCL } // 31: NAL_UNIT_UNSPEC_31 }; //default scaling list matrix value of 4x4 const uint8_t g_kuiDequantScaling4x4Default[2][16]={ @@ -206,32 +206,32 @@ const uint8_t g_kuiDequantScaling8x8Default[2][64]={ 24, 25, 27, 28, 30, 32, 33, 35 } }; ALIGNED_DECLARE (const uint16_t, g_kuiDequantCoeff[52][8], 16) = { - /* 0*/{ 10, 13, 10, 13, 13, 16, 13, 16 }, /* 1*/{ 11, 14, 11, 14, 14, 18, 14, 18 }, - /* 2*/{ 13, 16, 13, 16, 16, 20, 16, 20 }, /* 3*/{ 14, 18, 14, 18, 18, 23, 18, 23 }, - /* 4*/{ 16, 20, 16, 20, 20, 25, 20, 25 }, /* 5*/{ 18, 23, 18, 23, 23, 29, 23, 29 }, - /* 6*/{ 20, 26, 20, 26, 26, 32, 26, 32 }, /* 7*/{ 22, 28, 22, 28, 28, 36, 28, 36 }, - /* 8*/{ 26, 32, 26, 32, 32, 40, 32, 40 }, /* 9*/{ 28, 36, 28, 36, 36, 46, 36, 46 }, - /*10*/{ 32, 40, 32, 40, 40, 50, 40, 50 }, /*11*/{ 36, 46, 36, 46, 46, 58, 46, 58 }, - /*12*/{ 40, 52, 40, 52, 52, 64, 52, 64 }, /*13*/{ 44, 56, 44, 56, 56, 72, 56, 72 }, - /*14*/{ 52, 64, 52, 64, 64, 80, 64, 80 }, /*15*/{ 56, 72, 56, 72, 72, 92, 72, 92 }, - /*16*/{ 64, 80, 64, 80, 80, 100, 80, 100 }, /*17*/{ 72, 92, 72, 92, 92, 116, 92, 116 }, - /*18*/{ 80, 104, 80, 104, 104, 128, 104, 128 }, /*19*/{ 88, 112, 88, 112, 112, 144, 112, 144 }, - /*20*/{ 104, 128, 104, 128, 128, 160, 128, 160 }, /*21*/{ 112, 144, 112, 144, 144, 184, 144, 184 }, - /*22*/{ 128, 160, 128, 160, 160, 200, 160, 200 }, /*23*/{ 144, 184, 144, 184, 184, 232, 184, 232 }, - /*24*/{ 160, 208, 160, 208, 208, 256, 208, 256 }, /*25*/{ 176, 224, 176, 224, 224, 288, 224, 288 }, - /*26*/{ 208, 256, 208, 256, 256, 320, 256, 320 }, /*27*/{ 224, 288, 224, 288, 288, 368, 288, 368 }, - /*28*/{ 256, 320, 256, 320, 320, 400, 320, 400 }, /*29*/{ 288, 368, 288, 368, 368, 464, 368, 464 }, - /*30*/{ 320, 416, 320, 416, 416, 512, 416, 512 }, /*31*/{ 352, 448, 352, 448, 448, 576, 448, 576 }, - /*32*/{ 416, 512, 416, 512, 512, 640, 512, 640 }, /*33*/{ 448, 576, 448, 576, 576, 736, 576, 736 }, - /*34*/{ 512, 640, 512, 640, 640, 800, 640, 800 }, /*35*/{ 576, 736, 576, 736, 736, 928, 736, 928 }, - /*36*/{ 640, 832, 640, 832, 832, 1024, 832, 1024 }, /*37*/{ 704, 896, 704, 896, 896, 1152, 896, 1152 }, - /*38*/{ 832, 1024, 832, 1024, 1024, 1280, 1024, 1280 }, /*39*/{ 896, 1152, 896, 1152, 1152, 1472, 1152, 1472 }, - /*40*/{ 1024, 1280, 1024, 1280, 1280, 1600, 1280, 1600 }, /*41*/{ 1152, 1472, 1152, 1472, 1472, 1856, 1472, 1856 }, - /*42*/{ 1280, 1664, 1280, 1664, 1664, 2048, 1664, 2048 }, /*43*/{ 1408, 1792, 1408, 1792, 1792, 2304, 1792, 2304 }, - /*44*/{ 1664, 2048, 1664, 2048, 2048, 2560, 2048, 2560 }, /*45*/{ 1792, 2304, 1792, 2304, 2304, 2944, 2304, 2944 }, - /*46*/{ 2048, 2560, 2048, 2560, 2560, 3200, 2560, 3200 }, /*47*/{ 2304, 2944, 2304, 2944, 2944, 3712, 2944, 3712 }, - /*48*/{ 2560, 3328, 2560, 3328, 3328, 4096, 3328, 4096 }, /*49*/{ 2816, 3584, 2816, 3584, 3584, 4608, 3584, 4608 }, - /*50*/{ 3328, 4096, 3328, 4096, 4096, 5120, 4096, 5120 }, /*51*/{ 3584, 4608, 3584, 4608, 4608, 5888, 4608, 5888 }, + /* 0*/{ 10, 13, 10, 13, 13, 16, 13, 16 }, /* 1*/{ 11, 14, 11, 14, 14, 18, 14, 18 }, + /* 2*/{ 13, 16, 13, 16, 16, 20, 16, 20 }, /* 3*/{ 14, 18, 14, 18, 18, 23, 18, 23 }, + /* 4*/{ 16, 20, 16, 20, 20, 25, 20, 25 }, /* 5*/{ 18, 23, 18, 23, 23, 29, 23, 29 }, + /* 6*/{ 20, 26, 20, 26, 26, 32, 26, 32 }, /* 7*/{ 22, 28, 22, 28, 28, 36, 28, 36 }, + /* 8*/{ 26, 32, 26, 32, 32, 40, 32, 40 }, /* 9*/{ 28, 36, 28, 36, 36, 46, 36, 46 }, + /*10*/{ 32, 40, 32, 40, 40, 50, 40, 50 }, /*11*/{ 36, 46, 36, 46, 46, 58, 46, 58 }, + /*12*/{ 40, 52, 40, 52, 52, 64, 52, 64 }, /*13*/{ 44, 56, 44, 56, 56, 72, 56, 72 }, + /*14*/{ 52, 64, 52, 64, 64, 80, 64, 80 }, /*15*/{ 56, 72, 56, 72, 72, 92, 72, 92 }, + /*16*/{ 64, 80, 64, 80, 80, 100, 80, 100 }, /*17*/{ 72, 92, 72, 92, 92, 116, 92, 116 }, + /*18*/{ 80, 104, 80, 104, 104, 128, 104, 128 }, /*19*/{ 88, 112, 88, 112, 112, 144, 112, 144 }, + /*20*/{ 104, 128, 104, 128, 128, 160, 128, 160 }, /*21*/{ 112, 144, 112, 144, 144, 184, 144, 184 }, + /*22*/{ 128, 160, 128, 160, 160, 200, 160, 200 }, /*23*/{ 144, 184, 144, 184, 184, 232, 184, 232 }, + /*24*/{ 160, 208, 160, 208, 208, 256, 208, 256 }, /*25*/{ 176, 224, 176, 224, 224, 288, 224, 288 }, + /*26*/{ 208, 256, 208, 256, 256, 320, 256, 320 }, /*27*/{ 224, 288, 224, 288, 288, 368, 288, 368 }, + /*28*/{ 256, 320, 256, 320, 320, 400, 320, 400 }, /*29*/{ 288, 368, 288, 368, 368, 464, 368, 464 }, + /*30*/{ 320, 416, 320, 416, 416, 512, 416, 512 }, /*31*/{ 352, 448, 352, 448, 448, 576, 448, 576 }, + /*32*/{ 416, 512, 416, 512, 512, 640, 512, 640 }, /*33*/{ 448, 576, 448, 576, 576, 736, 576, 736 }, + /*34*/{ 512, 640, 512, 640, 640, 800, 640, 800 }, /*35*/{ 576, 736, 576, 736, 736, 928, 736, 928 }, + /*36*/{ 640, 832, 640, 832, 832, 1024, 832, 1024 }, /*37*/{ 704, 896, 704, 896, 896, 1152, 896, 1152 }, + /*38*/{ 832, 1024, 832, 1024, 1024, 1280, 1024, 1280 }, /*39*/{ 896, 1152, 896, 1152, 1152, 1472, 1152, 1472 }, + /*40*/{ 1024, 1280, 1024, 1280, 1280, 1600, 1280, 1600 }, /*41*/{ 1152, 1472, 1152, 1472, 1472, 1856, 1472, 1856 }, + /*42*/{ 1280, 1664, 1280, 1664, 1664, 2048, 1664, 2048 }, /*43*/{ 1408, 1792, 1408, 1792, 1792, 2304, 1792, 2304 }, + /*44*/{ 1664, 2048, 1664, 2048, 2048, 2560, 2048, 2560 }, /*45*/{ 1792, 2304, 1792, 2304, 2304, 2944, 2304, 2944 }, + /*46*/{ 2048, 2560, 2048, 2560, 2560, 3200, 2560, 3200 }, /*47*/{ 2304, 2944, 2304, 2944, 2944, 3712, 2944, 3712 }, + /*48*/{ 2560, 3328, 2560, 3328, 3328, 4096, 3328, 4096 }, /*49*/{ 2816, 3584, 2816, 3584, 3584, 4608, 3584, 4608 }, + /*50*/{ 3328, 4096, 3328, 4096, 4096, 5120, 4096, 5120 }, /*51*/{ 3584, 4608, 3584, 4608, 4608, 5888, 4608, 5888 }, }; ALIGNED_DECLARE (const uint16_t, g_kuiDequantCoeff8x8[52][64], 16) = { diff --git a/codec/decoder/core/src/decoder_data_tables.cpp b/codec/decoder/core/src/decoder_data_tables.cpp index ac295542..84ba7356 100644 --- a/codec/decoder/core/src/decoder_data_tables.cpp +++ b/codec/decoder/core/src/decoder_data_tables.cpp @@ -67,17 +67,17 @@ const uint8_t g_kMbNonZeroCountIdx[24] = { const uint8_t g_kCacheNzcScanIdx[4 * 4 + 4 + 4 + 3] = { /* Luma */ - 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8, - 11, 12, 19, 20, // 3+1*8, 4+1*8, 3+2*8, 4+2*8, - 25, 26, 33, 34, // 1+3*8, 2+3*8, 1+4*8, 2+4*8, - 27, 28, 35, 36, // 3+3*8, 4+3*8, 3+4*8, 4+4*8, + 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8, + 11, 12, 19, 20, // 3+1*8, 4+1*8, 3+2*8, 4+2*8, + 25, 26, 33, 34, // 1+3*8, 2+3*8, 1+4*8, 2+4*8, + 27, 28, 35, 36, // 3+3*8, 4+3*8, 3+4*8, 4+4*8, /* Cb */ - 14, 15, // 6+1*8, 7+1*8, - 22, 23, // 6+2*8, 7+2*8, + 14, 15, // 6+1*8, 7+1*8, + 22, 23, // 6+2*8, 7+2*8, /* Cr */ - 38, 39, // 6+4*8, 7+4*8, - 46, 47, // 6+5*8, 7+5*8, + 38, 39, // 6+4*8, 7+4*8, + 46, 47, // 6+5*8, 7+5*8, /* Luma DC */ 41, // 1+5*8 /* Chroma DC */ @@ -104,22 +104,22 @@ const uint8_t g_kNonZeroScanIdxC[4] = { //pNonZeroCount cache for chroma, 4*4 bl 7, 8 }; -const uint8_t g_kuiScan8[24] = { // [16 + 2*4] - 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8, - 11, 12, 19, 20, // 3+1*8, 4+1*8, 3+2*8, 4+2*8, - 25, 26, 33, 34, // 1+3*8, 2+3*8, 1+4*8, 2+4*8, - 27, 28, 35, 36, // 3+3*8, 4+3*8, 3+4*8, 4+4*8, - 14, 15, // 6+1*8, 7+1*8, - 22, 23, // 6+2*8, 7+2*8, - 38, 39, // 6+4*8, 7+4*8, - 46, 47, // 6+5*8, 7+5*8, +const uint8_t g_kuiScan8[24] = { // [16 + 2*4] + 9, 10, 17, 18, // 1+1*8, 2+1*8, 1+2*8, 2+2*8, + 11, 12, 19, 20, // 3+1*8, 4+1*8, 3+2*8, 4+2*8, + 25, 26, 33, 34, // 1+3*8, 2+3*8, 1+4*8, 2+4*8, + 27, 28, 35, 36, // 3+3*8, 4+3*8, 3+4*8, 4+4*8, + 14, 15, // 6+1*8, 7+1*8, + 22, 23, // 6+2*8, 7+2*8, + 38, 39, // 6+4*8, 7+4*8, + 46, 47, // 6+5*8, 7+5*8, }; const uint8_t g_kuiLumaDcZigzagScan[16] = { - 0, 16, 32, 128, // 0*16 + 0*64, 1*16 + 0*64, 2*16 + 0*64, 0*16 + 2*64, - 48, 64, 80, 96, // 3*16 + 0*64, 0*16 + 1*64, 1*16 + 1*64, 2*16 + 1*64, - 144, 160, 176, 192, // 1*16 + 2*64, 2*16 + 2*64, 3*16 + 2*64, 0*16 + 3*64, - 112, 208, 224, 240 // 3*16 + 1*64, 1*16 + 3*64, 2*16 + 3*64, 3*16 + 3*64, + 0, 16, 32, 128, // 0*16 + 0*64, 1*16 + 0*64, 2*16 + 0*64, 0*16 + 2*64, + 48, 64, 80, 96, // 3*16 + 0*64, 0*16 + 1*64, 1*16 + 1*64, 2*16 + 1*64, + 144, 160, 176, 192, // 1*16 + 2*64, 2*16 + 2*64, 3*16 + 2*64, 0*16 + 3*64, + 112, 208, 224, 240 // 3*16 + 1*64, 1*16 + 3*64, 2*16 + 3*64, 3*16 + 3*64, }; const uint8_t g_kuiChromaDcScan[4] = { diff --git a/codec/encoder/core/src/encode_mb_aux.cpp b/codec/encoder/core/src/encode_mb_aux.cpp index b6fb1a90..fc2188b3 100644 --- a/codec/encoder/core/src/encode_mb_aux.cpp +++ b/codec/encoder/core/src/encode_mb_aux.cpp @@ -101,58 +101,58 @@ ALIGNED_DECLARE (const int16_t, g_kiQuantInterFF[58][8], 16) = { ALIGNED_DECLARE (const int16_t, g_kiQuantMF[52][8], 16) = { - /* 0*/ {26214, 16132, 26214, 16132, 16132, 10486, 16132, 10486 }, - /* 1*/ {23832, 14980, 23832, 14980, 14980, 9320, 14980, 9320 }, - /* 2*/ {20164, 13108, 20164, 13108, 13108, 8388, 13108, 8388 }, - /* 3*/ {18724, 11650, 18724, 11650, 11650, 7294, 11650, 7294 }, - /* 4*/ {16384, 10486, 16384, 10486, 10486, 6710, 10486, 6710 }, - /* 5*/ {14564, 9118, 14564, 9118, 9118, 5786, 9118, 5786 }, - /* 6*/ {13107, 8066, 13107, 8066, 8066, 5243, 8066, 5243 }, - /* 7*/ {11916, 7490, 11916, 7490, 7490, 4660, 7490, 4660 }, - /* 8*/ {10082, 6554, 10082, 6554, 6554, 4194, 6554, 4194 }, - /* 9*/ { 9362, 5825, 9362, 5825, 5825, 3647, 5825, 3647 }, - /*10*/ { 8192, 5243, 8192, 5243, 5243, 3355, 5243, 3355 }, - /*11*/ { 7282, 4559, 7282, 4559, 4559, 2893, 4559, 2893 }, - /*12*/ { 6554, 4033, 6554, 4033, 4033, 2622, 4033, 2622 }, - /*13*/ { 5958, 3745, 5958, 3745, 3745, 2330, 3745, 2330 }, - /*14*/ { 5041, 3277, 5041, 3277, 3277, 2097, 3277, 2097 }, - /*15*/ { 4681, 2913, 4681, 2913, 2913, 1824, 2913, 1824 }, - /*16*/ { 4096, 2622, 4096, 2622, 2622, 1678, 2622, 1678 }, - /*17*/ { 3641, 2280, 3641, 2280, 2280, 1447, 2280, 1447 }, - /*18*/ { 3277, 2017, 3277, 2017, 2017, 1311, 2017, 1311 }, - /*19*/ { 2979, 1873, 2979, 1873, 1873, 1165, 1873, 1165 }, - /*20*/ { 2521, 1639, 2521, 1639, 1639, 1049, 1639, 1049 }, - /*21*/ { 2341, 1456, 2341, 1456, 1456, 912, 1456, 912 }, - /*22*/ { 2048, 1311, 2048, 1311, 1311, 839, 1311, 839 }, - /*23*/ { 1821, 1140, 1821, 1140, 1140, 723, 1140, 723 }, - /*24*/ { 1638, 1008, 1638, 1008, 1008, 655, 1008, 655 }, - /*25*/ { 1490, 936, 1490, 936, 936, 583, 936, 583 }, - /*26*/ { 1260, 819, 1260, 819, 819, 524, 819, 524 }, - /*27*/ { 1170, 728, 1170, 728, 728, 456, 728, 456 }, - /*28*/ { 1024, 655, 1024, 655, 655, 419, 655, 419 }, - /*29*/ { 910, 570, 910, 570, 570, 362, 570, 362 }, - /*30*/ { 819, 504, 819, 504, 504, 328, 504, 328 }, - /*31*/ { 745, 468, 745, 468, 468, 291, 468, 291 }, - /*32*/ { 630, 410, 630, 410, 410, 262, 410, 262 }, - /*33*/ { 585, 364, 585, 364, 364, 228, 364, 228 }, - /*34*/ { 512, 328, 512, 328, 328, 210, 328, 210 }, - /*35*/ { 455, 285, 455, 285, 285, 181, 285, 181 }, - /*36*/ { 410, 252, 410, 252, 252, 164, 252, 164 }, - /*37*/ { 372, 234, 372, 234, 234, 146, 234, 146 }, - /*38*/ { 315, 205, 315, 205, 205, 131, 205, 131 }, - /*39*/ { 293, 182, 293, 182, 182, 114, 182, 114 }, - /*40*/ { 256, 164, 256, 164, 164, 105, 164, 105 }, - /*41*/ { 228, 142, 228, 142, 142, 90, 142, 90 }, - /*42*/ { 205, 126, 205, 126, 126, 82, 126, 82 }, - /*43*/ { 186, 117, 186, 117, 117, 73, 117, 73 }, - /*44*/ { 158, 102, 158, 102, 102, 66, 102, 66 }, - /*45*/ { 146, 91, 146, 91, 91, 57, 91, 57 }, - /*46*/ { 128, 82, 128, 82, 82, 52, 82, 52 }, - /*47*/ { 114, 71, 114, 71, 71, 45, 71, 45 }, - /*48*/ { 102, 63, 102, 63, 63, 41, 63, 41 }, - /*49*/ { 93, 59, 93, 59, 59, 36, 59, 36 }, - /*50*/ { 79, 51, 79, 51, 51, 33, 51, 33 }, - /*51*/ { 73, 46, 73, 46, 46, 28, 46, 28 } + /* 0*/ {26214, 16132, 26214, 16132, 16132, 10486, 16132, 10486 }, + /* 1*/ {23832, 14980, 23832, 14980, 14980, 9320, 14980, 9320 }, + /* 2*/ {20164, 13108, 20164, 13108, 13108, 8388, 13108, 8388 }, + /* 3*/ {18724, 11650, 18724, 11650, 11650, 7294, 11650, 7294 }, + /* 4*/ {16384, 10486, 16384, 10486, 10486, 6710, 10486, 6710 }, + /* 5*/ {14564, 9118, 14564, 9118, 9118, 5786, 9118, 5786 }, + /* 6*/ {13107, 8066, 13107, 8066, 8066, 5243, 8066, 5243 }, + /* 7*/ {11916, 7490, 11916, 7490, 7490, 4660, 7490, 4660 }, + /* 8*/ {10082, 6554, 10082, 6554, 6554, 4194, 6554, 4194 }, + /* 9*/ { 9362, 5825, 9362, 5825, 5825, 3647, 5825, 3647 }, + /*10*/ { 8192, 5243, 8192, 5243, 5243, 3355, 5243, 3355 }, + /*11*/ { 7282, 4559, 7282, 4559, 4559, 2893, 4559, 2893 }, + /*12*/ { 6554, 4033, 6554, 4033, 4033, 2622, 4033, 2622 }, + /*13*/ { 5958, 3745, 5958, 3745, 3745, 2330, 3745, 2330 }, + /*14*/ { 5041, 3277, 5041, 3277, 3277, 2097, 3277, 2097 }, + /*15*/ { 4681, 2913, 4681, 2913, 2913, 1824, 2913, 1824 }, + /*16*/ { 4096, 2622, 4096, 2622, 2622, 1678, 2622, 1678 }, + /*17*/ { 3641, 2280, 3641, 2280, 2280, 1447, 2280, 1447 }, + /*18*/ { 3277, 2017, 3277, 2017, 2017, 1311, 2017, 1311 }, + /*19*/ { 2979, 1873, 2979, 1873, 1873, 1165, 1873, 1165 }, + /*20*/ { 2521, 1639, 2521, 1639, 1639, 1049, 1639, 1049 }, + /*21*/ { 2341, 1456, 2341, 1456, 1456, 912, 1456, 912 }, + /*22*/ { 2048, 1311, 2048, 1311, 1311, 839, 1311, 839 }, + /*23*/ { 1821, 1140, 1821, 1140, 1140, 723, 1140, 723 }, + /*24*/ { 1638, 1008, 1638, 1008, 1008, 655, 1008, 655 }, + /*25*/ { 1490, 936, 1490, 936, 936, 583, 936, 583 }, + /*26*/ { 1260, 819, 1260, 819, 819, 524, 819, 524 }, + /*27*/ { 1170, 728, 1170, 728, 728, 456, 728, 456 }, + /*28*/ { 1024, 655, 1024, 655, 655, 419, 655, 419 }, + /*29*/ { 910, 570, 910, 570, 570, 362, 570, 362 }, + /*30*/ { 819, 504, 819, 504, 504, 328, 504, 328 }, + /*31*/ { 745, 468, 745, 468, 468, 291, 468, 291 }, + /*32*/ { 630, 410, 630, 410, 410, 262, 410, 262 }, + /*33*/ { 585, 364, 585, 364, 364, 228, 364, 228 }, + /*34*/ { 512, 328, 512, 328, 328, 210, 328, 210 }, + /*35*/ { 455, 285, 455, 285, 285, 181, 285, 181 }, + /*36*/ { 410, 252, 410, 252, 252, 164, 252, 164 }, + /*37*/ { 372, 234, 372, 234, 234, 146, 234, 146 }, + /*38*/ { 315, 205, 315, 205, 205, 131, 205, 131 }, + /*39*/ { 293, 182, 293, 182, 182, 114, 182, 114 }, + /*40*/ { 256, 164, 256, 164, 164, 105, 164, 105 }, + /*41*/ { 228, 142, 228, 142, 142, 90, 142, 90 }, + /*42*/ { 205, 126, 205, 126, 126, 82, 126, 82 }, + /*43*/ { 186, 117, 186, 117, 117, 73, 117, 73 }, + /*44*/ { 158, 102, 158, 102, 102, 66, 102, 66 }, + /*45*/ { 146, 91, 146, 91, 91, 57, 91, 57 }, + /*46*/ { 128, 82, 128, 82, 82, 52, 82, 52 }, + /*47*/ { 114, 71, 114, 71, 71, 45, 71, 45 }, + /*48*/ { 102, 63, 102, 63, 63, 41, 63, 41 }, + /*49*/ { 93, 59, 93, 59, 59, 36, 59, 36 }, + /*50*/ { 79, 51, 79, 51, 51, 33, 51, 33 }, + /*51*/ { 73, 46, 73, 46, 46, 28, 46, 28 } }; /**************************************************************************** diff --git a/codec/encoder/core/src/encoder_data_tables.cpp b/codec/encoder/core/src/encoder_data_tables.cpp index a44a57ba..8d206530 100644 --- a/codec/encoder/core/src/encoder_data_tables.cpp +++ b/codec/encoder/core/src/encoder_data_tables.cpp @@ -39,9 +39,9 @@ namespace WelsEnc { // extern at mb_cache.h const uint8_t g_kuiSmb4AddrIn256[16] = { - 0, 4, 16 * 4, 16 * 4 + 4, - 8, 12, 16 * 4 + 8, 16 * 4 + 12, - 16 * 8, 16 * 8 + 4, 16 * 12, 16 * 12 + 4, + 0, 4, 16 * 4, 16 * 4 + 4, + 8, 12, 16 * 4 + 8, 16 * 4 + 12, + 16 * 8, 16 * 8 + 4, 16 * 12, 16 * 12 + 4, 16 * 8 + 8, 16 * 8 + 12, 16 * 12 + 8, 16 * 12 + 12 }; @@ -84,113 +84,113 @@ const int8_t g_kiMapModeIntraChroma[7] = { const uint8_t g_kuiVlcCoeffToken[5][17][4][2] = { { //0<=nc<2 - { { 1, 1}, { 0, 0}, { 0, 0}, { 0, 0} }, //0 - { { 5, 6}, { 1, 2}, { 0, 0}, { 0, 0} },//1 - { { 7, 8}, { 4, 6}, { 1, 3}, { 0, 0} },//2 - { { 7, 9}, { 6, 8}, { 5, 7}, { 3, 5} },//3 - { { 7, 10}, { 6, 9}, { 5, 8}, { 3, 6} },//4 - { { 7, 11}, { 6, 10}, { 5, 9}, { 4, 7} },//5 - { {15, 13}, { 6, 11}, { 5, 10}, { 4, 8} },//6 - { {11, 13}, {14, 13}, { 5, 11}, { 4, 9} },//7 - { { 8, 13}, {10, 13}, {13, 13}, { 4, 10} },//8 - { {15, 14}, {14, 14}, { 9, 13}, { 4, 11} },//9 - { {11, 14}, {10, 14}, {13, 14}, {12, 13} },//10 - { {15, 15}, {14, 15}, { 9, 14}, {12, 14} },//11 - { {11, 15}, {10, 15}, {13, 15}, { 8, 14} },//12 - { {15, 16}, { 1, 15}, { 9, 15}, {12, 15} },//13 - { {11, 16}, {14, 16}, {13, 16}, { 8, 15} },//14 - { { 7, 16}, {10, 16}, { 9, 16}, {12, 16} },//15 - { { 4, 16}, { 6, 16}, { 5, 16}, { 8, 16} }//16 + { { 1, 1}, { 0, 0}, { 0, 0}, { 0, 0} },//0 + { { 5, 6}, { 1, 2}, { 0, 0}, { 0, 0} },//1 + { { 7, 8}, { 4, 6}, { 1, 3}, { 0, 0} },//2 + { { 7, 9}, { 6, 8}, { 5, 7}, { 3, 5} },//3 + { { 7, 10}, { 6, 9}, { 5, 8}, { 3, 6} },//4 + { { 7, 11}, { 6, 10}, { 5, 9}, { 4, 7} },//5 + { {15, 13}, { 6, 11}, { 5, 10}, { 4, 8} },//6 + { {11, 13}, {14, 13}, { 5, 11}, { 4, 9} },//7 + { { 8, 13}, {10, 13}, {13, 13}, { 4, 10} },//8 + { {15, 14}, {14, 14}, { 9, 13}, { 4, 11} },//9 + { {11, 14}, {10, 14}, {13, 14}, {12, 13} },//10 + { {15, 15}, {14, 15}, { 9, 14}, {12, 14} },//11 + { {11, 15}, {10, 15}, {13, 15}, { 8, 14} },//12 + { {15, 16}, { 1, 15}, { 9, 15}, {12, 15} },//13 + { {11, 16}, {14, 16}, {13, 16}, { 8, 15} },//14 + { { 7, 16}, {10, 16}, { 9, 16}, {12, 16} },//15 + { { 4, 16}, { 6, 16}, { 5, 16}, { 8, 16} } //16 }, { //2<=nc<4 - { { 3, 2}, { 0, 0}, { 0, 0}, { 0, 0} },//0 - { {11, 6}, { 2, 2}, { 0, 0}, { 0, 0} },//1 - { { 7, 6}, { 7, 5}, { 3, 3}, { 0, 0} },//2 - { { 7, 7}, {10, 6}, { 9, 6}, { 5, 4} },//3 - { { 7, 8}, { 6, 6}, { 5, 6}, { 4, 4} },//4 - { { 4, 8}, { 6, 7}, { 5, 7}, { 6, 5} },//5 - { { 7, 9}, { 6, 8}, { 5, 8}, { 8, 6} },//6 - { {15, 11}, { 6, 9}, { 5, 9}, { 4, 6} },//7 - { {11, 11}, {14, 11}, {13, 11}, { 4, 7} },//8 - { {15, 12}, {10, 11}, { 9, 11}, { 4, 9} },//9 - { {11, 12}, {14, 12}, {13, 12}, {12, 11} },//10 - { { 8, 12}, {10, 12}, { 9, 12}, { 8, 11} },//11 - { {15, 13}, {14, 13}, {13, 13}, {12, 12} },//12 - { {11, 13}, {10, 13}, { 9, 13}, {12, 13} },//13 - { { 7, 13}, {11, 14}, { 6, 13}, { 8, 13} },//14 - { { 9, 14}, { 8, 14}, {10, 14}, { 1, 13} },//15 - { { 7, 14}, { 6, 14}, { 5, 14}, { 4, 14} }//16 + { { 3, 2}, { 0, 0}, { 0, 0}, { 0, 0} },//0 + { {11, 6}, { 2, 2}, { 0, 0}, { 0, 0} },//1 + { { 7, 6}, { 7, 5}, { 3, 3}, { 0, 0} },//2 + { { 7, 7}, {10, 6}, { 9, 6}, { 5, 4} },//3 + { { 7, 8}, { 6, 6}, { 5, 6}, { 4, 4} },//4 + { { 4, 8}, { 6, 7}, { 5, 7}, { 6, 5} },//5 + { { 7, 9}, { 6, 8}, { 5, 8}, { 8, 6} },//6 + { {15, 11}, { 6, 9}, { 5, 9}, { 4, 6} },//7 + { {11, 11}, {14, 11}, {13, 11}, { 4, 7} },//8 + { {15, 12}, {10, 11}, { 9, 11}, { 4, 9} },//9 + { {11, 12}, {14, 12}, {13, 12}, {12, 11} },//10 + { { 8, 12}, {10, 12}, { 9, 12}, { 8, 11} },//11 + { {15, 13}, {14, 13}, {13, 13}, {12, 12} },//12 + { {11, 13}, {10, 13}, { 9, 13}, {12, 13} },//13 + { { 7, 13}, {11, 14}, { 6, 13}, { 8, 13} },//14 + { { 9, 14}, { 8, 14}, {10, 14}, { 1, 13} },//15 + { { 7, 14}, { 6, 14}, { 5, 14}, { 4, 14} } //16 }, { //4<=nc<8 - { {15, 4}, { 0, 0}, { 0, 0}, { 0, 0} },//0 - { {15, 6}, {14, 4}, { 0, 0}, { 0, 0} },//1 - { {11, 6}, {15, 5}, {13, 4}, { 0, 0} },//2 - { { 8, 6}, {12, 5}, {14, 5}, {12, 4} },//3 - { {15, 7}, {10, 5}, {11, 5}, {11, 4} },//4 - { {11, 7}, { 8, 5}, { 9, 5}, {10, 4} },//5 - { { 9, 7}, {14, 6}, {13, 6}, { 9, 4} },//6 - { { 8, 7}, {10, 6}, { 9, 6}, { 8, 4} },//7 - { {15, 8}, {14, 7}, {13, 7}, {13, 5} },//8 - { {11, 8}, {14, 8}, {10, 7}, {12, 6} },//9 - { {15, 9}, {10, 8}, {13, 8}, {12, 7} },//10 - { {11, 9}, {14, 9}, { 9, 8}, {12, 8} },//11 - { { 8, 9}, {10, 9}, {13, 9}, { 8, 8} },//12 - { {13, 10}, { 7, 9}, { 9, 9}, {12, 9} },//13 - { { 9, 10}, {12, 10}, {11, 10}, {10, 10} },//14 - { { 5, 10}, { 8, 10}, { 7, 10}, { 6, 10} },//15 - { { 1, 10}, { 4, 10}, { 3, 10}, { 2, 10} }//16 + { {15, 4}, { 0, 0}, { 0, 0}, { 0, 0} },//0 + { {15, 6}, {14, 4}, { 0, 0}, { 0, 0} },//1 + { {11, 6}, {15, 5}, {13, 4}, { 0, 0} },//2 + { { 8, 6}, {12, 5}, {14, 5}, {12, 4} },//3 + { {15, 7}, {10, 5}, {11, 5}, {11, 4} },//4 + { {11, 7}, { 8, 5}, { 9, 5}, {10, 4} },//5 + { { 9, 7}, {14, 6}, {13, 6}, { 9, 4} },//6 + { { 8, 7}, {10, 6}, { 9, 6}, { 8, 4} },//7 + { {15, 8}, {14, 7}, {13, 7}, {13, 5} },//8 + { {11, 8}, {14, 8}, {10, 7}, {12, 6} },//9 + { {15, 9}, {10, 8}, {13, 8}, {12, 7} },//10 + { {11, 9}, {14, 9}, { 9, 8}, {12, 8} },//11 + { { 8, 9}, {10, 9}, {13, 9}, { 8, 8} },//12 + { {13, 10}, { 7, 9}, { 9, 9}, {12, 9} },//13 + { { 9, 10}, {12, 10}, {11, 10}, {10, 10} },//14 + { { 5, 10}, { 8, 10}, { 7, 10}, { 6, 10} },//15 + { { 1, 10}, { 4, 10}, { 3, 10}, { 2, 10} } //16 }, { //8<=nc - { { 3, 6}, { 0, 0}, { 0, 0}, { 0, 0} },//0 - { { 0, 6}, { 1, 6}, { 0, 0}, { 0, 0} },//1 - { { 4, 6}, { 5, 6}, { 6, 6}, { 0, 0} },//2 - { { 8, 6}, { 9, 6}, {10, 6}, {11, 6} },//3 - { {12, 6}, {13, 6}, {14, 6}, {15, 6} },//4 - { {16, 6}, {17, 6}, {18, 6}, {19, 6} },//5 - { {20, 6}, {21, 6}, {22, 6}, {23, 6} },//6 - { {24, 6}, {25, 6}, {26, 6}, {27, 6} },//7 - { {28, 6}, {29, 6}, {30, 6}, {31, 6} },//8 - { {32, 6}, {33, 6}, {34, 6}, {35, 6} },//9 - { {36, 6}, {37, 6}, {38, 6}, {39, 6} },//10 - { {40, 6}, {41, 6}, {42, 6}, {43, 6} },//11 - { {44, 6}, {45, 6}, {46, 6}, {47, 6} },//12 - { {48, 6}, {49, 6}, {50, 6}, {51, 6} },//13 - { {52, 6}, {53, 6}, {54, 6}, {55, 6} },//14 - { {56, 6}, {57, 6}, {58, 6}, {59, 6} },//15 - { {60, 6}, {61, 6}, {62, 6}, {63, 6} }//16 + { { 3, 6}, { 0, 0}, { 0, 0}, { 0, 0} },//0 + { { 0, 6}, { 1, 6}, { 0, 0}, { 0, 0} },//1 + { { 4, 6}, { 5, 6}, { 6, 6}, { 0, 0} },//2 + { { 8, 6}, { 9, 6}, {10, 6}, {11, 6} },//3 + { {12, 6}, {13, 6}, {14, 6}, {15, 6} },//4 + { {16, 6}, {17, 6}, {18, 6}, {19, 6} },//5 + { {20, 6}, {21, 6}, {22, 6}, {23, 6} },//6 + { {24, 6}, {25, 6}, {26, 6}, {27, 6} },//7 + { {28, 6}, {29, 6}, {30, 6}, {31, 6} },//8 + { {32, 6}, {33, 6}, {34, 6}, {35, 6} },//9 + { {36, 6}, {37, 6}, {38, 6}, {39, 6} },//10 + { {40, 6}, {41, 6}, {42, 6}, {43, 6} },//11 + { {44, 6}, {45, 6}, {46, 6}, {47, 6} },//12 + { {48, 6}, {49, 6}, {50, 6}, {51, 6} },//13 + { {52, 6}, {53, 6}, {54, 6}, {55, 6} },//14 + { {56, 6}, {57, 6}, {58, 6}, {59, 6} },//15 + { {60, 6}, {61, 6}, {62, 6}, {63, 6} } //16 }, { //nc == -1 - { { 1, 2}, { 0, 0}, { 0, 0}, { 0, 0} },//0 - { { 7, 6}, { 1, 1}, { 0, 0}, { 0, 0} },//1 - { { 4, 6}, { 6, 6}, { 1, 3}, { 0, 0} },//2 - { { 3, 6}, { 3, 7}, { 2, 7}, { 5, 6} },//3 - { { 2, 6}, { 3, 8}, { 2, 8}, { 0, 7} },//4 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//5 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//6 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//7 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//8 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//9 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//10 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//11 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//12 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//13 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//14 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//15 - { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} }//16 + { { 1, 2}, { 0, 0}, { 0, 0}, { 0, 0} },//0 + { { 7, 6}, { 1, 1}, { 0, 0}, { 0, 0} },//1 + { { 4, 6}, { 6, 6}, { 1, 3}, { 0, 0} },//2 + { { 3, 6}, { 3, 7}, { 2, 7}, { 5, 6} },//3 + { { 2, 6}, { 3, 8}, { 2, 8}, { 0, 7} },//4 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//5 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//6 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//7 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//8 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//9 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//10 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//11 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//12 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//13 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//14 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} },//15 + { { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} } //16 } }; //const uint8_t g_kuiVlcLevelPrefix[15][2] = //{ -// {1, 1}, {1, 2} +// {1, 1}, {1, 2} //}; //g_kuiVlcTotalZeros[tzVlcIndex][total_zeros][0--value, 1--bit count] diff --git a/codec/encoder/core/src/svc_base_layer_md.cpp b/codec/encoder/core/src/svc_base_layer_md.cpp index 814765ae..239160f4 100644 --- a/codec/encoder/core/src/svc_base_layer_md.cpp +++ b/codec/encoder/core/src/svc_base_layer_md.cpp @@ -48,12 +48,12 @@ namespace WelsEnc { static const ALIGNED_DECLARE (int8_t, g_kiIntra16AvaliMode[8][5], 16) = { { I16_PRED_DC_128, I16_PRED_INVALID, I16_PRED_INVALID, I16_PRED_INVALID, 1 }, { I16_PRED_DC_L, I16_PRED_H, I16_PRED_INVALID, I16_PRED_INVALID, 2 }, - { I16_PRED_DC_T, I16_PRED_V, I16_PRED_INVALID, I16_PRED_INVALID, 2 }, - { I16_PRED_V, I16_PRED_H, I16_PRED_DC, I16_PRED_INVALID, 3 }, + { I16_PRED_DC_T, I16_PRED_V, I16_PRED_INVALID, I16_PRED_INVALID, 2 }, + { I16_PRED_V, I16_PRED_H, I16_PRED_DC, I16_PRED_INVALID, 3 }, { I16_PRED_DC_128, I16_PRED_INVALID, I16_PRED_INVALID, I16_PRED_INVALID, 1 }, - { I16_PRED_DC_L, I16_PRED_H, I16_PRED_INVALID, I16_PRED_INVALID, 2 }, - { I16_PRED_DC_T, I16_PRED_V, I16_PRED_INVALID, I16_PRED_INVALID, 2 }, - { I16_PRED_V, I16_PRED_H, I16_PRED_DC, I16_PRED_P, 4 } + { I16_PRED_DC_L, I16_PRED_H, I16_PRED_INVALID, I16_PRED_INVALID, 2 }, + { I16_PRED_DC_T, I16_PRED_V, I16_PRED_INVALID, I16_PRED_INVALID, 2 }, + { I16_PRED_V, I16_PRED_H, I16_PRED_DC, I16_PRED_P, 4 } }; static const ALIGNED_DECLARE (uint8_t, g_kiIntra4AvailCount[16], 16) = { @@ -221,22 +221,22 @@ const int8_t g_kiCoordinateIdx4x4Y[16] = { 0, 0, 4, 4, 8, 8, 12, 12 }; static const ALIGNED_DECLARE (int8_t, g_kiNeighborIntraToI4x4[16][16], 16) = { - { 0, 1, 10, 7, 1, 1, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, - { 1, 1, 15, 7, 1, 1, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, - { 10, 15, 10, 7, 15, 7, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, - { 11, 15, 15, 7, 15, 7, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, - { 4, 1, 10, 7, 1, 1, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, - { 5, 1, 15, 7, 1, 1, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, - { 14, 15, 10, 7, 15, 7, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, - { 15, 15, 15, 7, 15, 7, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, - { 0, 1, 10, 7, 1, 9, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, - { 1, 1, 15, 7, 1, 9, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, - { 10, 15, 10, 7, 15, 15, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, - { 11, 15, 15, 7, 15, 15, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, - { 4, 1, 10, 7, 1, 9, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, - { 5, 1, 15, 7, 1, 9, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, - { 14, 15, 10, 7, 15, 15, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, - { 15, 15, 15, 7, 15, 15, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, + { 0, 1, 10, 7, 1, 1, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, + { 1, 1, 15, 7, 1, 1, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, + { 10, 15, 10, 7, 15, 7, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, + { 11, 15, 15, 7, 15, 7, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, + { 4, 1, 10, 7, 1, 1, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, + { 5, 1, 15, 7, 1, 1, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, + { 14, 15, 10, 7, 15, 7, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, + { 15, 15, 15, 7, 15, 7, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, + { 0, 1, 10, 7, 1, 9, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, + { 1, 1, 15, 7, 1, 9, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, + { 10, 15, 10, 7, 15, 15, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, + { 11, 15, 15, 7, 15, 15, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, + { 4, 1, 10, 7, 1, 9, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, + { 5, 1, 15, 7, 1, 9, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, + { 14, 15, 10, 7, 15, 15, 15, 7, 10, 15, 10, 7, 15, 7, 15, 7}, + { 15, 15, 15, 7, 15, 15, 15, 7, 15, 15, 15, 7, 15, 7, 15, 7}, }; ALIGNED_DECLARE (const int8_t, g_kiMapModeI4x4[14], 16) = { diff --git a/codec/processing/src/denoise/denoise_filter.cpp b/codec/processing/src/denoise/denoise_filter.cpp index 953d5098..5986d97c 100644 --- a/codec/processing/src/denoise/denoise_filter.cpp +++ b/codec/processing/src/denoise/denoise_filter.cpp @@ -77,11 +77,11 @@ void BilateralLumaFilter8_c (uint8_t* pSample, int32_t iStride) { /*************************************************************************** 5x5 filter: -1 1 2 1 1 -1 2 4 2 1 -2 4 20 4 2 -1 2 4 2 1 -1 1 2 1 1 +1 1 2 1 1 +1 2 4 2 1 +2 4 20 4 2 +1 2 4 2 1 +1 1 2 1 1 ***************************************************************************/ #define SUM_LINE1(pSample) (pSample[0] +(pSample[1]) +(pSample[2]<<1) + pSample[3] + pSample[4]) #define SUM_LINE2(pSample) (pSample[0] +(pSample[1]<<1) +(pSample[2]<<2) +(pSample[3]<<1) +pSample[4]) @@ -107,9 +107,9 @@ void WaverageChromaFilter8_c (uint8_t* pSample, int32_t iStride) { /*************************************************************************** edge of y/uv use a 3x3 Gauss filter, radius = 1: -1 2 1 -2 4 2 -1 2 1 +1 2 1 +2 4 2 +1 2 1 ***************************************************************************/ void Gauss3x3Filter (uint8_t* pSrc, int32_t iStride) { int32_t nSum = 0; diff --git a/test/encoder/EncUT_EncoderMb.cpp b/test/encoder/EncUT_EncoderMb.cpp index 0bdaf5d4..aacc923a 100644 --- a/test/encoder/EncUT_EncoderMb.cpp +++ b/test/encoder/EncUT_EncoderMb.cpp @@ -7,111 +7,111 @@ using namespace WelsEnc; ALIGNED_DECLARE (const int16_t, g_kiQuantInterFFCompare[104][8], 16) = { - /* 0*/ { 0, 1, 0, 1, 1, 1, 1, 1 }, - /* 1*/ { 0, 1, 0, 1, 1, 1, 1, 1 }, - /* 2*/ { 1, 1, 1, 1, 1, 1, 1, 1 }, - /* 3*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, - /* 4*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, - /* 5*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, - /* 6*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, - /* 7*/ { 1, 2, 1, 2, 2, 2, 2, 2 }, - /* 8*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, - /* 9*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, - /*10*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, - /*11*/ { 2, 2, 2, 2, 2, 4, 2, 4 }, - /*12*/ { 2, 3, 2, 3, 3, 4, 3, 4 }, - /*13*/ { 2, 3, 2, 3, 3, 5, 3, 5 }, - /*14*/ { 2, 3, 2, 3, 3, 5, 3, 5 }, - /*15*/ { 2, 4, 2, 4, 4, 6, 4, 6 }, - /*16*/ { 3, 4, 3, 4, 4, 7, 4, 7 }, - /*17*/ { 3, 5, 3, 5, 5, 8, 5, 8 }, - /*18*/ { 3, 6, 3, 6, 6, 9, 6, 9 }, - /*19*/ { 4, 6, 4, 6, 6, 10, 6, 10 }, - /*20*/ { 4, 7, 4, 7, 7, 11, 7, 11 }, - /*21*/ { 5, 8, 5, 8, 8, 12, 8, 12 }, - /*22*/ { 6, 9, 6, 9, 9, 13, 9, 13 }, - /*23*/ { 6, 10, 6, 10, 10, 16, 10, 16 }, - /*24*/ { 7, 11, 7, 11, 11, 17, 11, 17 }, - /*25*/ { 8, 12, 8, 12, 12, 19, 12, 19 }, - /*26*/ { 9, 14, 9, 14, 14, 21, 14, 21 }, - /*27*/ { 10, 15, 10, 15, 15, 25, 15, 25 }, - /*28*/ { 11, 17, 11, 17, 17, 27, 17, 27 }, - /*29*/ { 12, 20, 12, 20, 20, 31, 20, 31 }, - /*30*/ { 14, 22, 14, 22, 22, 34, 22, 34 }, - /*31*/ { 15, 24, 15, 24, 24, 39, 24, 39 }, - /*32*/ { 18, 27, 18, 27, 27, 43, 27, 43 }, - /*33*/ { 19, 31, 19, 31, 31, 49, 31, 49 }, - /*34*/ { 22, 34, 22, 34, 34, 54, 34, 54 }, - /*35*/ { 25, 40, 25, 40, 40, 62, 40, 62 }, - /*36*/ { 27, 45, 27, 45, 45, 69, 45, 69 }, - /*37*/ { 30, 48, 30, 48, 48, 77, 48, 77 }, - /*38*/ { 36, 55, 36, 55, 55, 86, 55, 86 }, - /*39*/ { 38, 62, 38, 62, 62, 99, 62, 99 }, - /*40*/ { 44, 69, 44, 69, 69, 107, 69, 107 }, - /*41*/ { 49, 79, 49, 79, 79, 125, 79, 125 }, - /*42*/ { 55, 89, 55, 89, 89, 137, 89, 137 }, - /*43*/ { 61, 96, 61, 96, 96, 154, 96, 154 }, - /*44*/ { 71, 110, 71, 110, 110, 171, 110, 171 }, - /*45*/ { 77, 124, 77, 124, 124, 198, 124, 198 }, - /*46*/ { 88, 137, 88, 137, 137, 217, 137, 217 }, - /*47*/ { 99, 159, 99, 159, 159, 250, 159, 250 }, - /*48*/ { 110, 179, 110, 179, 179, 275, 179, 275 }, - /*49*/ { 121, 191, 121, 191, 191, 313, 191, 313 }, - /*50*/ { 143, 221, 143, 221, 221, 341, 221, 341 }, - /*51*/ { 154, 245, 154, 245, 245, 402, 245, 402 }, + /* 0*/ { 0, 1, 0, 1, 1, 1, 1, 1 }, + /* 1*/ { 0, 1, 0, 1, 1, 1, 1, 1 }, + /* 2*/ { 1, 1, 1, 1, 1, 1, 1, 1 }, + /* 3*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, + /* 4*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, + /* 5*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, + /* 6*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, + /* 7*/ { 1, 2, 1, 2, 2, 2, 2, 2 }, + /* 8*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, + /* 9*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, + /*10*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, + /*11*/ { 2, 2, 2, 2, 2, 4, 2, 4 }, + /*12*/ { 2, 3, 2, 3, 3, 4, 3, 4 }, + /*13*/ { 2, 3, 2, 3, 3, 5, 3, 5 }, + /*14*/ { 2, 3, 2, 3, 3, 5, 3, 5 }, + /*15*/ { 2, 4, 2, 4, 4, 6, 4, 6 }, + /*16*/ { 3, 4, 3, 4, 4, 7, 4, 7 }, + /*17*/ { 3, 5, 3, 5, 5, 8, 5, 8 }, + /*18*/ { 3, 6, 3, 6, 6, 9, 6, 9 }, + /*19*/ { 4, 6, 4, 6, 6, 10, 6, 10 }, + /*20*/ { 4, 7, 4, 7, 7, 11, 7, 11 }, + /*21*/ { 5, 8, 5, 8, 8, 12, 8, 12 }, + /*22*/ { 6, 9, 6, 9, 9, 13, 9, 13 }, + /*23*/ { 6, 10, 6, 10, 10, 16, 10, 16 }, + /*24*/ { 7, 11, 7, 11, 11, 17, 11, 17 }, + /*25*/ { 8, 12, 8, 12, 12, 19, 12, 19 }, + /*26*/ { 9, 14, 9, 14, 14, 21, 14, 21 }, + /*27*/ { 10, 15, 10, 15, 15, 25, 15, 25 }, + /*28*/ { 11, 17, 11, 17, 17, 27, 17, 27 }, + /*29*/ { 12, 20, 12, 20, 20, 31, 20, 31 }, + /*30*/ { 14, 22, 14, 22, 22, 34, 22, 34 }, + /*31*/ { 15, 24, 15, 24, 24, 39, 24, 39 }, + /*32*/ { 18, 27, 18, 27, 27, 43, 27, 43 }, + /*33*/ { 19, 31, 19, 31, 31, 49, 31, 49 }, + /*34*/ { 22, 34, 22, 34, 34, 54, 34, 54 }, + /*35*/ { 25, 40, 25, 40, 40, 62, 40, 62 }, + /*36*/ { 27, 45, 27, 45, 45, 69, 45, 69 }, + /*37*/ { 30, 48, 30, 48, 48, 77, 48, 77 }, + /*38*/ { 36, 55, 36, 55, 55, 86, 55, 86 }, + /*39*/ { 38, 62, 38, 62, 62, 99, 62, 99 }, + /*40*/ { 44, 69, 44, 69, 69, 107, 69, 107 }, + /*41*/ { 49, 79, 49, 79, 79, 125, 79, 125 }, + /*42*/ { 55, 89, 55, 89, 89, 137, 89, 137 }, + /*43*/ { 61, 96, 61, 96, 96, 154, 96, 154 }, + /*44*/ { 71, 110, 71, 110, 110, 171, 110, 171 }, + /*45*/ { 77, 124, 77, 124, 124, 198, 124, 198 }, + /*46*/ { 88, 137, 88, 137, 137, 217, 137, 217 }, + /*47*/ { 99, 159, 99, 159, 159, 250, 159, 250 }, + /*48*/ { 110, 179, 110, 179, 179, 275, 179, 275 }, + /*49*/ { 121, 191, 121, 191, 191, 313, 191, 313 }, + /*50*/ { 143, 221, 143, 221, 221, 341, 221, 341 }, + /*51*/ { 154, 245, 154, 245, 245, 402, 245, 402 }, //from here below is intra - /* 0*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, - /* 1*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, - /* 2*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, - /* 3*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, - /* 4*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, - /* 5*/ { 1, 2, 1, 2, 2, 4, 2, 4 }, - /* 6*/ { 2, 3, 2, 3, 3, 4, 3, 4 }, - /* 7*/ { 2, 3, 2, 3, 3, 5, 3, 5 }, - /* 8*/ { 2, 3, 2, 3, 3, 5, 3, 5 }, - /* 9*/ { 2, 4, 2, 4, 4, 6, 4, 6 }, - /*10*/ { 3, 4, 3, 4, 4, 6, 4, 6 }, - /*11*/ { 3, 5, 3, 5, 5, 7, 5, 7 }, - /*12*/ { 3, 5, 3, 5, 5, 8, 5, 8 }, - /*13*/ { 4, 6, 4, 6, 6, 9, 6, 9 }, - /*14*/ { 4, 7, 4, 7, 7, 10, 7, 10 }, - /*15*/ { 5, 7, 5, 7, 7, 12, 7, 12 }, - /*16*/ { 5, 8, 5, 8, 8, 13, 8, 13 }, - /*17*/ { 6, 9, 6, 9, 9, 15, 9, 15 }, - /*18*/ { 7, 11, 7, 11, 11, 16, 11, 16 }, - /*19*/ { 7, 11, 7, 11, 11, 18, 11, 18 }, - /*20*/ { 9, 13, 9, 13, 13, 20, 13, 20 }, - /*21*/ { 9, 15, 9, 15, 15, 24, 15, 24 }, - /*22*/ { 11, 16, 11, 16, 16, 26, 16, 26 }, - /*23*/ { 12, 19, 12, 19, 19, 30, 19, 30 }, - /*24*/ { 13, 21, 13, 21, 21, 33, 21, 33 }, - /*25*/ { 14, 23, 14, 23, 23, 37, 23, 37 }, - /*26*/ { 17, 26, 17, 26, 26, 41, 26, 41 }, - /*27*/ { 18, 30, 18, 30, 30, 47, 30, 47 }, - /*28*/ { 21, 33, 21, 33, 33, 51, 33, 51 }, - /*29*/ { 24, 38, 24, 38, 38, 59, 38, 59 }, - /*30*/ { 26, 43, 26, 43, 43, 66, 43, 66 }, - /*31*/ { 29, 46, 29, 46, 46, 74, 46, 74 }, - /*32*/ { 34, 52, 34, 52, 52, 82, 52, 82 }, - /*33*/ { 37, 59, 37, 59, 59, 94, 59, 94 }, - /*34*/ { 42, 66, 42, 66, 66, 102, 66, 102 }, - /*35*/ { 47, 75, 47, 75, 75, 119, 75, 119 }, - /*36*/ { 52, 85, 52, 85, 85, 131, 85, 131 }, - /*37*/ { 58, 92, 58, 92, 92, 147, 92, 147 }, - /*38*/ { 68, 105, 68, 105, 105, 164, 105, 164 }, - /*39*/ { 73, 118, 73, 118, 118, 189, 118, 189 }, - /*40*/ { 84, 131, 84, 131, 131, 205, 131, 205 }, - /*41*/ { 94, 151, 94, 151, 151, 239, 151, 239 }, - /*42*/ { 105, 171, 105, 171, 171, 262, 171, 262 }, - /*43*/ { 116, 184, 116, 184, 184, 295, 184, 295 }, - /*44*/ { 136, 211, 136, 211, 211, 326, 211, 326 }, - /*45*/ { 147, 236, 147, 236, 236, 377, 236, 377 }, - /*46*/ { 168, 262, 168, 262, 262, 414, 262, 414 }, - /*47*/ { 189, 303, 189, 303, 303, 478, 303, 478 }, - /*48*/ { 211, 341, 211, 341, 341, 524, 341, 524 }, - /*49*/ { 231, 364, 231, 364, 364, 597, 364, 597 }, - /*50*/ { 272, 422, 272, 422, 422, 652, 422, 652 }, - /*51*/ { 295, 467, 295, 467, 467, 768, 467, 768 } + /* 0*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, + /* 1*/ { 1, 1, 1, 1, 1, 2, 1, 2 }, + /* 2*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, + /* 3*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, + /* 4*/ { 1, 2, 1, 2, 2, 3, 2, 3 }, + /* 5*/ { 1, 2, 1, 2, 2, 4, 2, 4 }, + /* 6*/ { 2, 3, 2, 3, 3, 4, 3, 4 }, + /* 7*/ { 2, 3, 2, 3, 3, 5, 3, 5 }, + /* 8*/ { 2, 3, 2, 3, 3, 5, 3, 5 }, + /* 9*/ { 2, 4, 2, 4, 4, 6, 4, 6 }, + /*10*/ { 3, 4, 3, 4, 4, 6, 4, 6 }, + /*11*/ { 3, 5, 3, 5, 5, 7, 5, 7 }, + /*12*/ { 3, 5, 3, 5, 5, 8, 5, 8 }, + /*13*/ { 4, 6, 4, 6, 6, 9, 6, 9 }, + /*14*/ { 4, 7, 4, 7, 7, 10, 7, 10 }, + /*15*/ { 5, 7, 5, 7, 7, 12, 7, 12 }, + /*16*/ { 5, 8, 5, 8, 8, 13, 8, 13 }, + /*17*/ { 6, 9, 6, 9, 9, 15, 9, 15 }, + /*18*/ { 7, 11, 7, 11, 11, 16, 11, 16 }, + /*19*/ { 7, 11, 7, 11, 11, 18, 11, 18 }, + /*20*/ { 9, 13, 9, 13, 13, 20, 13, 20 }, + /*21*/ { 9, 15, 9, 15, 15, 24, 15, 24 }, + /*22*/ { 11, 16, 11, 16, 16, 26, 16, 26 }, + /*23*/ { 12, 19, 12, 19, 19, 30, 19, 30 }, + /*24*/ { 13, 21, 13, 21, 21, 33, 21, 33 }, + /*25*/ { 14, 23, 14, 23, 23, 37, 23, 37 }, + /*26*/ { 17, 26, 17, 26, 26, 41, 26, 41 }, + /*27*/ { 18, 30, 18, 30, 30, 47, 30, 47 }, + /*28*/ { 21, 33, 21, 33, 33, 51, 33, 51 }, + /*29*/ { 24, 38, 24, 38, 38, 59, 38, 59 }, + /*30*/ { 26, 43, 26, 43, 43, 66, 43, 66 }, + /*31*/ { 29, 46, 29, 46, 46, 74, 46, 74 }, + /*32*/ { 34, 52, 34, 52, 52, 82, 52, 82 }, + /*33*/ { 37, 59, 37, 59, 59, 94, 59, 94 }, + /*34*/ { 42, 66, 42, 66, 66, 102, 66, 102 }, + /*35*/ { 47, 75, 47, 75, 75, 119, 75, 119 }, + /*36*/ { 52, 85, 52, 85, 85, 131, 85, 131 }, + /*37*/ { 58, 92, 58, 92, 92, 147, 92, 147 }, + /*38*/ { 68, 105, 68, 105, 105, 164, 105, 164 }, + /*39*/ { 73, 118, 73, 118, 118, 189, 118, 189 }, + /*40*/ { 84, 131, 84, 131, 131, 205, 131, 205 }, + /*41*/ { 94, 151, 94, 151, 151, 239, 151, 239 }, + /*42*/ { 105, 171, 105, 171, 171, 262, 171, 262 }, + /*43*/ { 116, 184, 116, 184, 184, 295, 184, 295 }, + /*44*/ { 136, 211, 136, 211, 211, 326, 211, 326 }, + /*45*/ { 147, 236, 147, 236, 236, 377, 236, 377 }, + /*46*/ { 168, 262, 168, 262, 262, 414, 262, 414 }, + /*47*/ { 189, 303, 189, 303, 303, 478, 303, 478 }, + /*48*/ { 211, 341, 211, 341, 341, 524, 341, 524 }, + /*49*/ { 231, 364, 231, 364, 364, 597, 364, 597 }, + /*50*/ { 272, 422, 272, 422, 422, 652, 422, 652 }, + /*51*/ { 295, 467, 295, 467, 467, 768, 467, 768 } }; #define ThValue 2