History

fix bug with ihadamard to correct place with qmatrix on

huili2 committed 9 years ago

Commit b160c191 parent fcf345c4 files · +59 −39Browse files

Showing the changes to codec/decoder/core/src/decode_slice.cpp (1 of 4 files). Show all

Unified · Split

codec/decoder/core/src/decode_slice.cpp+12−22
@@ -155,9 +155,6 @@ int32_t WelsMbInterSampleConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLa · 154 unmodified lines
155155 int32_t iMbXy = pCurLayer->iMbXyIndex;
156156 int32_t i, iIndex, iOffset;
157157
158− WelsChromaDcIdct (pCurLayer->pScaledTCoeff[iMbXy] + 256); // 256 = 16*16
159− WelsChromaDcIdct (pCurLayer->pScaledTCoeff[iMbXy] + 320); // 320 = 16*16 + 16*4
160−
161158 if (pCurLayer->pTransformSize8x8Flag[iMbXy]) {
162159 for (i = 0; i < 4; i++) {
163160 iIndex = g_kuiMbCountScan4Idx[i << 2];
@@ -207,7 +204,7 @@ int32_t WelsMbInterConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLayer) { · 43 unmodified lines
207204 }
208205
209206 void WelsLumaDcDequantIdct (int16_t* pBlock, int32_t iQp, PWelsDecoderContext pCtx) {
210− const int32_t kiQMul = pCtx->bUseScalingList ? pCtx->pDequant_coeff4x4[0][iQp][0] >> 4 : g_kuiDequantCoeff[iQp][0];
207+ const int32_t kiQMul = pCtx->bUseScalingList ? pCtx->pDequant_coeff4x4[0][iQp][0] : (g_kuiDequantCoeff[iQp][0] << 4);
211208 #define STRIDE 16
212209 int32_t i;
213210 int32_t iTemp[16]; //FIXME check if this is a good idea
@@ -240,10 +237,10 @@ void WelsLumaDcDequantIdct (int16_t* pBlock, int32_t iQp, PWelsDecoderContext pC · 26 unmodified lines
240237 const int32_t kiZ2 = iTemp[kiI4] - iTemp[8 + kiI4];
241238 const int32_t kiZ3 = iTemp[kiI4] + iTemp[8 + kiI4];
242239
243− pBlk[kiOffset] = ((kiZ0 + kiZ3) * kiQMul + 2) >> 2; //FIXME think about merging this into decode_resdual
244− pBlk[kiYOffset[1] + kiOffset] = ((kiZ1 + kiZ2) * kiQMul + 2) >> 2;
245− pBlk[kiYOffset[2] + kiOffset] = ((kiZ1 - kiZ2) * kiQMul + 2) >> 2;
246− pBlk[kiYOffset[3] + kiOffset] = ((kiZ0 - kiZ3) * kiQMul + 2) >> 2;
240+ pBlk[kiOffset] = ((kiZ0 + kiZ3) * kiQMul + (1 << 5)) >> 6; //FIXME think about merging this into decode_resdual
241+ pBlk[kiYOffset[1] + kiOffset] = ((kiZ1 + kiZ2) * kiQMul + (1 << 5)) >> 6;
242+ pBlk[kiYOffset[2] + kiOffset] = ((kiZ1 - kiZ2) * kiQMul + (1 << 5)) >> 6;
243+ pBlk[kiYOffset[3] + kiOffset] = ((kiZ0 - kiZ3) * kiQMul + (1 << 5)) >> 6;
247244 }
248245 #undef STRIDE
249246 }
@@ -255,19 +252,12 @@ int32_t WelsMbIntraPredictionConstruction (PWelsDecoderContext pCtx, PDqLayer pC · 5 unmodified lines
255252 WelsFillRecNeededMbInfo (pCtx, bOutput, pCurLayer);
256253
257254 if (IS_INTRA16x16 (pCurLayer->pMbType[iMbXy])) {
258− WelsLumaDcDequantIdct (pCurLayer->pScaledTCoeff[iMbXy], pCurLayer->pLumaQp[iMbXy], pCtx);
259255 RecI16x16Mb (iMbXy, pCtx, pCurLayer->pScaledTCoeff[iMbXy], pCurLayer);
260−
261− return ERR_NONE;
262− }
263−
264− if (IS_INTRA8x8 (pCurLayer->pMbType[iMbXy])) {
256+ } else if (IS_INTRA8x8 (pCurLayer->pMbType[iMbXy])) {
265257 RecI8x8Mb (iMbXy, pCtx, pCurLayer->pScaledTCoeff[iMbXy], pCurLayer);
266− }
267−
268− if (IS_INTRA4x4 (pCurLayer->pMbType[iMbXy]))
258+ } else if (IS_INTRA4x4 (pCurLayer->pMbType[iMbXy])) {
269259 RecI4x4Mb (iMbXy, pCtx, pCurLayer->pScaledTCoeff[iMbXy], pCurLayer);
270−
260+ }
271261 return ERR_NONE;
272262 }
273263
@@ -327,10 +317,10 @@ void WelsChromaDcIdct (int16_t* pBlock) { · 53 unmodified lines
327317 iB = iC - iD;
328318 iC += iD;
329319
330− pBlk[0] = (iA + iC) >> 1;
331− pBlk[iXStride] = (iE + iB) >> 1;
332− pBlk[iStride] = (iA - iC) >> 1;
333− pBlk[iStride1] = (iE - iB) >> 1;
320+ pBlk[0] = (iA + iC);
321+ pBlk[iXStride] = (iE + iB);
322+ pBlk[iStride] = (iA - iC);
323+ pBlk[iStride1] = (iE - iB);
334324 }
335325
336326 void WelsMapNxNNeighToSampleNormal (PWelsNeighAvail pNeighAvail, int32_t* pSampleAvail) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t