Void CVTCCommon::markCoeff(Int x, Int y, UChar valuedDes, Int c) { if (COEFF_STATE(x,y,c) == S_INIT || COEFF_STATE(x,y,c) == S_ZTR || COEFF_STATE(x,y,c) == S_ZTR_D) { if (COEFF_VAL(x,y,c)) { if (valuedDes) COEFF_TYPE(x,y,c) = VAL; else COEFF_TYPE(x,y,c) = VZTR; } else { if (valuedDes) COEFF_TYPE(x,y,c) = IZ; else COEFF_TYPE(x,y,c) = ZTR; } } else if (COEFF_STATE(x,y,c) == S_IZ) { if (COEFF_VAL(x,y,c)) COEFF_TYPE(x,y,c) = VAL; else COEFF_TYPE(x,y,c) = IZ; } else if (COEFF_STATE(x,y,c) == S_VZTR) { if (valuedDes) COEFF_TYPE(x,y,c) = VAL; else COEFF_TYPE(x,y,c) = VZTR; } else if (COEFF_STATE(x,y,c) == S_VAL) { COEFF_TYPE(x,y,c) = VAL; } else if (COEFF_STATE(x,y,c) == S_LINIT || COEFF_STATE(x,y,c) == S_LZTR || COEFF_STATE(x,y,c) == S_LZTR_D) { if (COEFF_VAL(x,y,c)) COEFF_TYPE(x,y,c) = VZTR; else COEFF_TYPE(x,y,c) = ZTR; } else /* if (COEFF_STATE(x,y,c) == S_LVZTR) */ COEFF_TYPE(x,y,c) = VZTR; }
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); }
Int CVTCDecoder::decIQuantizeDC(Int c) { Int err; Int x, y; err=0; /* loop through DC */ noteDetail("Inverse Quantizing DC band...."); for (x = 0; x < mzte_codec.m_iDCWidth; ++x) for (y = 0; y < mzte_codec.m_iDCHeight; ++y) { /* assign new quantization value */ COEFF_RECVAL(x,y,c) = COEFF_VAL(x,y,c) * mzte_codec.m_iQDC[c]; } noteDetail("Completed inverse Quantizing DC bands."); return err; }