Int CVTCCommon::ztqInitDC(Int decode, Int c) { Int err; Int x, y; Int dummyPrevQ; err = 0; noteDetail("Initializing DC coefficient information...."); noteDebug("DC Dimensions: Width=%d, Height=%d", mzte_codec.m_iDCWidth, mzte_codec.m_iDCHeight); for (y = 0; y < mzte_codec.m_iDCHeight; ++y) for (x = 0; x < mzte_codec.m_iDCWidth; ++x) { if (decode) initInvQuantSingleStage(&COEFF_QSTATE(x, y, c), &dummyPrevQ); else initQuantSingleStage(&COEFF_QSTATE(x, y, c), &dummyPrevQ, COEFF_ORGVAL(x,y,c)); COEFF_TYPE(x, y, c) = UNTYPED; COEFF_STATE(x, y, c) = S_DC; } noteDetail("Completed initializing of DC coefficient information."); return err; }
Void CVTCDecoder::iQuantizeCoeff(Int x, Int y, Int c) { Int dumQ=0; /* assign new quantization value - update quant state */ if (mzte_codec.m_iQuantType == MULTIPLE_Q) COEFF_RECVAL(x,y,c) = invQuantSingleStage(COEFF_VAL(x,y,c), USER_Q(c), &COEFF_QSTATE(x,y,c), &prevQList2[c][coordToSpatialLev(x,y,c)], 0); else if (mzte_codec.m_iQuantType == SINGLE_Q) COEFF_RECVAL(x,y,c) = invQuantSingleStage(COEFF_VAL(x,y,c), USER_Q(c), &COEFF_QSTATE(x,y,c), &dumQ, 0); }
// hjlee 0901 Int CVTCCommon::ztqInitAC(Int decode, Int c) { Int err; Int x, y, xc[4], yc[4]; Int height, width; Int dummyPrevQ; err = 0; noteDetail("Initializing AC coefficient information for col %d....",c); height = mzte_codec.m_iHeight >> (int)(c!=0); width = mzte_codec.m_iWidth >> (int)(c!=0); noteDebug("Image: Width=%d, Height=%d", width, height); for (y = 0; y < height; ++y) for (x = 0; x < width; ++x) { if (x >= mzte_codec.m_iDCWidth || y >= mzte_codec.m_iDCHeight) { if (decode) initInvQuantSingleStage(&COEFF_QSTATE(x, y, c), &dummyPrevQ); else { initQuantSingleStage(&COEFF_QSTATE(x, y, c), &dummyPrevQ, COEFF_ORGVAL(x,y,c)); } COEFF_TYPE(x, y, c) = UNTYPED; /* AC Bands */ if (findChild(x, y, xc, yc, c)==0 || x >= mzte_codec.m_SPlayer[c].width || y >= mzte_codec.m_SPlayer[c].height) /* leaf */ COEFF_STATE(x, y, c) = S_LINIT; else COEFF_STATE(x, y,c) = S_INIT; } } noteDetail("Completed Initializing of AC coefficient information."); return err; }