| 1130 | |
| 1131 | #if TICKET_1090_FIX |
| 1132 | #if RATE_CONTROL_LAMBDA_DOMAIN |
| 1133 | if ( m_pcCfg->getUseRateCtrl() ) |
| 1134 | { |
| 1135 | #if !M0036_RC_IMPROVEMENT |
| 1136 | UInt SAD = m_pcCuEncoder->getLCUPredictionSAD(); |
| 1137 | Int height = min( pcSlice->getSPS()->getMaxCUHeight(),pcSlice->getSPS()->getPicHeightInLumaSamples() - uiCUAddr / rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUHeight() ); |
| 1138 | Int width = min( pcSlice->getSPS()->getMaxCUWidth(),pcSlice->getSPS()->getPicWidthInLumaSamples() - uiCUAddr % rpcPic->getFrameWidthInCU() * pcSlice->getSPS()->getMaxCUWidth() ); |
| 1139 | Double MAD = (Double)SAD / (Double)(height * width); |
| 1140 | MAD = MAD * MAD; |
| 1141 | ( m_pcRateCtrl->getRCPic()->getLCU(uiCUAddr) ).m_MAD = MAD; |
| 1142 | #endif |
| 1143 | |
| 1144 | Int actualQP = g_RCInvalidQPValue; |
| 1145 | Double actualLambda = m_pcRdCost->getLambda(); |
| 1146 | Int actualBits = pcCU->getTotalBits(); |
| 1147 | Int numberOfEffectivePixels = 0; |
| 1148 | for ( Int idx = 0; idx < rpcPic->getNumPartInCU(); idx++ ) |
| 1149 | { |
| 1150 | if ( pcCU->getPredictionMode( idx ) != MODE_NONE && ( !pcCU->isSkipped( idx ) ) ) |
| 1151 | { |
| 1152 | numberOfEffectivePixels = numberOfEffectivePixels + 16; |
| 1153 | break; |
| 1154 | } |
| 1155 | } |
| 1156 | |
| 1157 | if ( numberOfEffectivePixels == 0 ) |
| 1158 | { |
| 1159 | actualQP = g_RCInvalidQPValue; |
| 1160 | } |
| 1161 | else |
| 1162 | { |
| 1163 | actualQP = pcCU->getQP( 0 ); |
| 1164 | } |
| 1165 | m_pcRdCost->setLambda(oldLambda); |
| 1166 | |
| 1167 | m_pcRateCtrl->getRCPic()->updateAfterLCU( m_pcRateCtrl->getRCPic()->getLCUCoded(), actualBits, actualQP, actualLambda, m_pcCfg->getLCULevelRC() ); |
| 1168 | } |
| 1169 | #endif |
| 1170 | #endif |