fix issue update according to wayne's suggestiong
Showing the changes to codec/decoder/core/src/decode_slice.cpp (1 of 2 files). Show all
Unified · Split
| @@ -936,19 +936,32 @@ int32_t WelsCalcDeqCoeffScalingList (PWelsDecoderContext pCtx) { · 935 unmodified lines | ||
| 936 | 936 | pCtx->bUseScalingList = true; |
| 937 | 937 | |
| 938 | 938 | if (!pCtx->bDequantCoeff4x4Init || (pCtx->iDequantCoeffPpsid != pCtx->pPps->iPpsId)) { |
| 939 | − int i, q, x; | |
| 939 | + int i, q, x, y; | |
| 940 | 940 | // Rewrite pps scaling list for scalingList present flag=0 |
| 941 | 941 | if (pCtx->bSpsLatePps) { |
| 942 | − for (i = 0; i < 6; i++) { | |
| 943 | − if (!pCtx->pSps->bSeqScalingListPresentFlag[i]) { | |
| 944 | − if (i == 0 || i == 3) | |
| 945 | − memcpy (pCtx->pPps->iScalingList4x4[i], pCtx->pSps->iScalingList4x4[i], 16 * sizeof (uint8_t)); | |
| 946 | − else | |
| 947 | − memcpy (pCtx->pPps->iScalingList4x4[i], pCtx->pPps->iScalingList4x4[i - 1], 16 * sizeof (uint8_t)); | |
| 942 | + for (i = 0; i < 12; i++) { | |
| 943 | + //if (!pCtx->pSps->bSeqScalingListPresentFlag[i]) { | |
| 944 | + if (!pCtx->pPps->bPicScalingListPresentFlag[i]) { | |
| 945 | + if (i < 6) { | |
| 946 | + | |
| 947 | + | |
| 948 | + if (i == 0 || i == 3) | |
| 949 | + memcpy (pCtx->pPps->iScalingList4x4[i], pCtx->pSps->iScalingList4x4[i], 16 * sizeof (uint8_t)); | |
| 950 | + else | |
| 951 | + memcpy (pCtx->pPps->iScalingList4x4[i], pCtx->pPps->iScalingList4x4[i - 1], 16 * sizeof (uint8_t)); | |
| 952 | + } else { | |
| 953 | + | |
| 954 | + if (i == 6 || i == 7) | |
| 955 | + memcpy (pCtx->pPps->iScalingList8x8[ i - 6 ], pCtx->pSps->iScalingList8x8[ i - 6 ], 64 * sizeof (uint8_t)); | |
| 956 | + else | |
| 957 | + memcpy (pCtx->pPps->iScalingList8x8[ i - 6 ], pCtx->pPps->iScalingList8x8[i - 8], 64 * sizeof (uint8_t)); | |
| 958 | + | |
| 959 | + | |
| 960 | + } | |
| 948 | 961 | |
| 949 | 962 | } |
| 950 | 963 | } |
| 951 | − //TO DO, SUPPORT 8x8 SCALINGlist | |
| 964 | + | |
| 952 | 965 | |
| 953 | 966 | } |
| 954 | 967 | //Init dequant coeff value for different QP |
| @@ -959,10 +972,17 @@ int32_t WelsCalcDeqCoeffScalingList (PWelsDecoderContext pCtx) { · 4 unmodified lines | ||
| 959 | 972 | pCtx->pDequant_coeff4x4[i][q][x] = pCtx->pPps->bPicScalingMatrixPresentFlag ? pCtx->pPps->iScalingList4x4[i][x] * |
| 960 | 973 | g_kuiDequantCoeff[q][x & 0x07] : pCtx->pSps->iScalingList4x4[i][x] * g_kuiDequantCoeff[q][x & 0x07]; |
| 961 | 974 | } |
| 975 | + for (y = 0; y < 64; y++) { | |
| 976 | + pCtx->pDequant_coeff8x8[i][q][y] = pCtx->pPps->bPicScalingMatrixPresentFlag ? pCtx->pPps->iScalingList8x8[i][y] * | |
| 977 | + g_kuiDequantCoeff[q][x & 0x07] : pCtx->pSps->iScalingList8x8[i][y] * g_kuiDequantCoeff[q][x & | |
| 978 | + 0x07];//pseudo-code ,holding for 8x8transform into | |
| 979 | + } | |
| 962 | 980 | } |
| 963 | 981 | } |
| 964 | 982 | |
| 983 | + | |
| 965 | 984 | pCtx->bDequantCoeff4x4Init = true; |
| 985 | + pCtx->iDequantCoeffPpsid = pCtx->pPps->iPpsId; | |
| 966 | 986 | } |
| 967 | 987 | } else |
| 968 | 988 | pCtx->bUseScalingList = false; |