ref: 17e5ea95c0afb6258188d90525d447ebfe2dc084
parent: 698ba11bb62607eb24f668ecc2f6760c4f4b6ef2
author: zhuiling <[email protected]>
date: Wed Mar 11 06:19:38 EDT 2015
support scalinglist8x8 fix issue update according to wayne's suggestiong
--- a/codec/decoder/core/src/au_parser.cpp
+++ b/codec/decoder/core/src/au_parser.cpp
@@ -1504,7 +1504,7 @@
uint8_t (*iScalingList4x4)[16], uint8_t (*iScalingList8x8)[64]) {
uint32_t uiScalingListNum;
uint32_t uiCode;
- int32_t iRetTmp;
+
bool bUseDefaultScalingMatrixFlag4x4 = false;
bool bUseDefaultScalingMatrixFlag8x8 = false;
bool bInit = false;
@@ -1526,28 +1526,21 @@
WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode));
pScalingListPresentFlag[i] = !!uiCode;
if (!!uiCode) {
- if (i < 6) {
- iRetTmp = SetScalingListValue (iScalingList4x4[i], 16, &bUseDefaultScalingMatrixFlag4x4, pBs);
- if (iRetTmp == ERR_NONE) {
- if (bUseDefaultScalingMatrixFlag4x4) {
- bUseDefaultScalingMatrixFlag4x4 = false;
- memcpy (iScalingList4x4[i], g_kuiDequantScaling4x4Default[i / 3], sizeof (uint8_t) * 16);
- }
- } else
- return iRetTmp;
+ if (i < 6) {//4x4 scaling list
+ WELS_READ_VERIFY (SetScalingListValue (iScalingList4x4[i], 16, &bUseDefaultScalingMatrixFlag4x4, pBs));
+ if (bUseDefaultScalingMatrixFlag4x4) {
+ bUseDefaultScalingMatrixFlag4x4 = false;
+ memcpy (iScalingList4x4[i], g_kuiDequantScaling4x4Default[i / 3], sizeof (uint8_t) * 16);
+ }
+
} else {
- SetScalingListValue (iScalingList8x8[i - 6], 64, &bUseDefaultScalingMatrixFlag8x8, pBs);
- //if(iRetTmp == ERR_NONE)
- //{
+ WELS_READ_VERIFY (SetScalingListValue (iScalingList8x8[i - 6], 64, &bUseDefaultScalingMatrixFlag8x8, pBs));
+
if (bUseDefaultScalingMatrixFlag8x8) {
bUseDefaultScalingMatrixFlag8x8 = false;
memcpy (iScalingList8x8[i - 6], g_kuiDequantScaling8x8Default[ (i - 6) & 1], sizeof (uint8_t) * 64);
}
- // }
-
- //else
- // return iRetTmp;
}
} else {
@@ -1561,7 +1554,7 @@
if ((i == 6) || (i == 7))
memcpy (iScalingList8x8[i - 6], defaultScaling[ (i & 1) + 2], sizeof (uint8_t) * 64);
else
- memcpy (iScalingList8x8[i - 6], iScalingList8x8[ (i - 6) / 3], sizeof (uint8_t) * 64);
+ memcpy (iScalingList8x8[i - 6], iScalingList8x8[i - 8], sizeof (uint8_t) * 64);
}
}
--- a/codec/decoder/core/src/decode_slice.cpp
+++ b/codec/decoder/core/src/decode_slice.cpp
@@ -936,20 +936,33 @@
pCtx->bUseScalingList = true;
if (!pCtx->bDequantCoeff4x4Init || (pCtx->iDequantCoeffPpsid != pCtx->pPps->iPpsId)) {
- int i, q, x;
+ int i, q, x, y;
// Rewrite pps scaling list for scalingList present flag=0
if (pCtx->bSpsLatePps) {
- for (i = 0; i < 6; i++) {
- if (!pCtx->pSps->bSeqScalingListPresentFlag[i]) {
- if (i == 0 || i == 3)
- memcpy (pCtx->pPps->iScalingList4x4[i], pCtx->pSps->iScalingList4x4[i], 16 * sizeof (uint8_t));
- else
- memcpy (pCtx->pPps->iScalingList4x4[i], pCtx->pPps->iScalingList4x4[i - 1], 16 * sizeof (uint8_t));
+ for (i = 0; i < 12; i++) {
+ //if (!pCtx->pSps->bSeqScalingListPresentFlag[i]) {
+ if (!pCtx->pPps->bPicScalingListPresentFlag[i]) {
+ if (i < 6) {
+
+ if (i == 0 || i == 3)
+ memcpy (pCtx->pPps->iScalingList4x4[i], pCtx->pSps->iScalingList4x4[i], 16 * sizeof (uint8_t));
+ else
+ memcpy (pCtx->pPps->iScalingList4x4[i], pCtx->pPps->iScalingList4x4[i - 1], 16 * sizeof (uint8_t));
+ } else {
+
+ if (i == 6 || i == 7)
+ memcpy (pCtx->pPps->iScalingList8x8[ i - 6 ], pCtx->pSps->iScalingList8x8[ i - 6 ], 64 * sizeof (uint8_t));
+ else
+ memcpy (pCtx->pPps->iScalingList8x8[ i - 6 ], pCtx->pPps->iScalingList8x8[i - 8], 64 * sizeof (uint8_t));
+
+
+ }
+
}
}
- //TO DO, SUPPORT 8x8 SCALINGlist
+
}
//Init dequant coeff value for different QP
for (i = 0; i < 6; i++) {
@@ -959,10 +972,17 @@
pCtx->pDequant_coeff4x4[i][q][x] = pCtx->pPps->bPicScalingMatrixPresentFlag ? pCtx->pPps->iScalingList4x4[i][x] *
g_kuiDequantCoeff[q][x & 0x07] : pCtx->pSps->iScalingList4x4[i][x] * g_kuiDequantCoeff[q][x & 0x07];
}
+ for (y = 0; y < 64; y++) {
+ pCtx->pDequant_coeff8x8[i][q][y] = pCtx->pPps->bPicScalingMatrixPresentFlag ? pCtx->pPps->iScalingList8x8[i][y] *
+ g_kuiDequantCoeff[q][x & 0x07] : pCtx->pSps->iScalingList8x8[i][y] * g_kuiDequantCoeff[q][x &
+ 0x07];//pseudo-code ,holding for 8x8transform into
+ }
}
}
+
pCtx->bDequantCoeff4x4Init = true;
+ pCtx->iDequantCoeffPpsid = pCtx->pPps->iPpsId;
}
} else
pCtx->bUseScalingList = false;