00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <math.h>
00013 #include <limits.h>
00014 #include <float.h>
00015
00016 #include "global.h"
00017 #include "rdopt_coding_state.h"
00018 #include "mb_access.h"
00019 #include "intrarefresh.h"
00020 #include "image.h"
00021 #include "transform8x8.h"
00022 #include "ratectl.h"
00023 #include "mode_decision.h"
00024 #include "fmo.h"
00025 #include "me_umhex.h"
00026 #include "me_umhexsmp.h"
00027 #include "macroblock.h"
00028 #include "q_around.h"
00029 #include "vlc.h"
00030 #include "md_common.h"
00031 #include "rdopt.h"
00032 #include "memalloc.h"
00033 #include "mc_prediction.h"
00034
00035
00036
00037
00038
00039
00040
00041
00042 void encode_one_macroblock_low (Macroblock *currMB)
00043 {
00044 Slice *currSlice = currMB->p_slice;
00045 RDOPTStructure *p_RDO = currSlice->p_RDO;
00046 ImageParameters *p_Img = currMB->p_Img;
00047 InputParameters *p_Inp = currMB->p_Inp;
00048 PicMotionParams *motion = &p_Img->enc_picture->motion;
00049
00050 imgpel ***temp_img;
00051
00052 int block, mode, i=0, j;
00053 RD_PARAMS enc_mb;
00054 int bmcost[5] = {INT_MAX};
00055 double rd_cost = 0;
00056 int cost = 0;
00057 int min_cost = INT_MAX, cost_direct=0, have_direct=0;
00058 int intra1 = 0;
00059 int temp_cpb = 0;
00060 Boolean best_transform_flag = FALSE;
00061 int cost8x8_direct = 0;
00062 short islice = (short) (currSlice->slice_type == I_SLICE);
00063 short bslice = (short) (currSlice->slice_type == B_SLICE);
00064 short pslice = (short) ((currSlice->slice_type == P_SLICE) || (currSlice->slice_type == SP_SLICE));
00065 short intra = (short) (islice || (pslice && currMB->mb_y == p_Img->mb_y_upd && p_Img->mb_y_upd!=p_Img->mb_y_intra));
00066 int lambda_mf[3];
00067 Block8x8Info *b8x8info = p_Img->b8x8info;
00068
00069
00070 char **ipredmodes = p_Img->ipredmode;
00071 short *allmvs = (currSlice->slice_type == I_SLICE) ? NULL: currSlice->all_mv[0][0][0][0][0];
00072 int ****i4p;
00073 imgpel **mb_pred = currSlice->mb_pred[0];
00074
00075 Boolean tmp_8x8_flag, tmp_no_mbpart;
00076
00077 BestMode md_best;
00078 Info8x8 best;
00079
00080 init_md_best(&md_best);
00081
00082
00083 best.pdir = 0;
00084 best.bipred = 0;
00085 best.ref[LIST_0] = 0;
00086 best.ref[LIST_1] = -1;
00087
00088 get_mem3Dpel(&temp_img, 3, MB_BLOCK_SIZE, MB_BLOCK_SIZE);
00089
00090 intra |= RandomIntra (p_Img, currMB->mbAddrX);
00091
00092
00093 init_enc_mb_params(currMB, &enc_mb, intra);
00094 if (p_Inp->AdaptiveRounding)
00095 {
00096 reset_adaptive_rounding(p_Img);
00097 }
00098
00099 if (currSlice->MbaffFrameFlag)
00100 {
00101 reset_mb_nz_coeff(p_Img, currMB->mbAddrX);
00102 }
00103
00104
00105
00106 currSlice->store_coding_state (currMB, currSlice->p_RDO->cs_cm);
00107
00108 if (!intra)
00109 {
00110
00111 currMB->best_mode = 10;
00112 if (bslice && enc_mb.valid[0])
00113 {
00114 currSlice->Get_Direct_Motion_Vectors (currMB);
00115 }
00116
00117 if (p_Inp->CtxAdptLagrangeMult == 1)
00118 {
00119 get_initial_mb16x16_cost(currMB);
00120 }
00121
00122
00123 for (mode = 1; mode < 4; mode++)
00124 {
00125 best.bipred = 0;
00126 best.mode = (char) mode;
00127 b8x8info->best[mode][0].bipred = 0;
00128 if (enc_mb.valid[mode])
00129 {
00130 for (cost=0, block=0; block<(mode==1?1:2); block++)
00131 {
00132 update_lambda_costs(currMB, &enc_mb, lambda_mf);
00133 PartitionMotionSearch (currMB, mode, block, lambda_mf);
00134
00135
00136 j = (block==1 && mode==2 ? 2 : 0);
00137 i = (block==1 && mode==3 ? 2 : 0);
00138
00139
00140 bmcost[LIST_0] = INT_MAX;
00141 list_prediction_cost(currMB, LIST_0, block, mode, &enc_mb, bmcost, best.ref);
00142
00143 if (bslice)
00144 {
00145
00146 bmcost[LIST_1] = INT_MAX;
00147 list_prediction_cost(currMB, LIST_1, block, mode, &enc_mb, bmcost, best.ref);
00148
00149
00150 list_prediction_cost(currMB, BI_PRED, block, mode, &enc_mb, bmcost, best.ref);
00151
00152
00153 if (is_bipred_enabled(p_Inp, mode))
00154 {
00155 list_prediction_cost(currMB, BI_PRED_L0, block, mode, &enc_mb, bmcost, 0);
00156 list_prediction_cost(currMB, BI_PRED_L1, block, mode, &enc_mb, bmcost, 0);
00157 }
00158 else
00159 {
00160 bmcost[BI_PRED_L0] = INT_MAX;
00161 bmcost[BI_PRED_L1] = INT_MAX;
00162 }
00163
00164
00165 determine_prediction_list(bmcost, &best, &cost);
00166 }
00167 else
00168 {
00169 best.pdir = 0;
00170 cost += bmcost[LIST_0];
00171 }
00172
00173 assign_enc_picture_params(currMB, mode, &best, 2 * block);
00174
00175
00176 set_block8x8_info(b8x8info, mode, block, &best);
00177
00178
00179 if (mode>1 && block==0)
00180 currSlice->set_ref_and_motion_vectors (currMB, motion, &best, block);
00181 }
00182
00183 currMB->luma_transform_size_8x8_flag = FALSE;
00184 if (p_Inp->Transform8x8Mode)
00185 {
00186 SetModesAndRefframeForBlocks(currMB, (short) mode);
00187 currMB->luma_transform_size_8x8_flag = (byte) TransformDecision(currMB, -1, &cost);
00188 }
00189
00190 if (cost < min_cost)
00191 {
00192 currMB->best_mode = (short) mode;
00193 min_cost = cost;
00194 best_transform_flag = currMB->luma_transform_size_8x8_flag;
00195
00196 if (p_Inp->CtxAdptLagrangeMult == 1)
00197 {
00198 adjust_mb16x16_cost(currMB, cost);
00199 }
00200 }
00201 }
00202 }
00203
00204 if (enc_mb.valid[P8x8])
00205 {
00206
00207 currSlice->store_coding_state (currMB, currSlice->p_RDO->cs_mb);
00208 memset( currSlice->cofAC[0][0][0], 0, 2080 * sizeof(int));
00209
00210 currMB->valid_8x8 = FALSE;
00211
00212 if (p_Inp->Transform8x8Mode)
00213 {
00214 ResetRD8x8Data(p_Img, p_RDO->tr8x8);
00215
00216
00217
00218
00219 for (cost_direct = 0, block = 0; block < 4; block++)
00220 {
00221 submacroblock_mode_decision_low(currMB, &enc_mb, p_RDO->tr8x8, p_RDO->cofAC8x8ts[block],
00222 &have_direct, block, &cost_direct, &cost, &cost8x8_direct, 1);
00223
00224 set_subblock8x8_info(b8x8info, P8x8, block, p_RDO->tr8x8);
00225 }
00226
00227 currMB->luma_transform_size_8x8_flag = FALSE;
00228 }
00229
00230
00231 if (p_Inp->Transform8x8Mode != 2)
00232 {
00233 ResetRD8x8Data(p_Img, p_RDO->tr4x4);
00234
00235
00236
00237
00238 for (cost_direct = 0, block=0; block<4; block++)
00239 {
00240 submacroblock_mode_decision_low(currMB, &enc_mb, p_RDO->tr4x4, p_RDO->coefAC8x8[block],
00241 &have_direct, block, &cost_direct, &cost, &cost8x8_direct, 0);
00242
00243 set_subblock8x8_info(b8x8info, P8x8, block, p_RDO->tr4x4);
00244 }
00245 }
00246
00247 if (p_Inp->RCEnable)
00248 rc_store_diff(currSlice->diffy, &p_Img->pCurImg[currMB->opix_y], currMB->pix_x, mb_pred);
00249
00250
00251 if (((p_Inp->Transform8x8Mode < 2) && (p_RDO->tr4x4->mb_p8x8_cost < min_cost)) ||
00252 ((p_Inp->Transform8x8Mode > 0) && (p_RDO->tr8x8->mb_p8x8_cost < min_cost)))
00253 {
00254 currMB->best_mode = P8x8;
00255 if (p_Inp->Transform8x8Mode == 2)
00256 {
00257 min_cost = p_RDO->tr8x8->mb_p8x8_cost;
00258 currMB->luma_transform_size_8x8_flag = TRUE;
00259 }
00260 else if (p_Inp->Transform8x8Mode)
00261 {
00262 if (p_RDO->tr8x8->mb_p8x8_cost < p_RDO->tr4x4->mb_p8x8_cost)
00263 {
00264 min_cost = p_RDO->tr8x8->mb_p8x8_cost;
00265 currMB->luma_transform_size_8x8_flag = TRUE;
00266 }
00267 else if(p_RDO->tr4x4->mb_p8x8_cost < p_RDO->tr8x8->mb_p8x8_cost)
00268 {
00269 min_cost = p_RDO->tr4x4->mb_p8x8_cost;
00270 currMB->luma_transform_size_8x8_flag = FALSE;
00271 }
00272 else
00273 {
00274 if (GetBestTransformP8x8(currMB) == 0)
00275 {
00276 min_cost = p_RDO->tr4x4->mb_p8x8_cost;
00277 currMB->luma_transform_size_8x8_flag = FALSE;
00278 }
00279 else
00280 {
00281 min_cost = p_RDO->tr8x8->mb_p8x8_cost;
00282 currMB->luma_transform_size_8x8_flag = TRUE;
00283 }
00284 }
00285 }
00286 else
00287 {
00288 min_cost = p_RDO->tr4x4->mb_p8x8_cost;
00289 currMB->luma_transform_size_8x8_flag = FALSE;
00290 }
00291 }
00292 p_Img->giRDOpt_B8OnlyFlag = FALSE;
00293 }
00294
00295
00296 if(pslice)
00297 FindSkipModeMotionVector (currMB);
00298 }
00299 else
00300 {
00301 min_cost = INT_MAX;
00302 }
00303
00304
00305
00306
00307 tmp_8x8_flag = currMB->luma_transform_size_8x8_flag;
00308 tmp_no_mbpart = currMB->NoMbPartLessThan8x8Flag;
00309 if ((p_Img->yuv_format != YUV400) && (p_Img->yuv_format != YUV444))
00310
00311 intra_chroma_prediction(currMB, NULL, NULL, NULL);
00312
00313 if (enc_mb.valid[0] && bslice)
00314 {
00315 if(have_direct)
00316 {
00317 switch(p_Inp->Transform8x8Mode)
00318 {
00319 case 1:
00320 cost = ((cost8x8_direct < cost_direct) || !(enc_mb.valid[5] && enc_mb.valid[6] && enc_mb.valid[7]))
00321 ? cost8x8_direct : cost_direct;
00322 break;
00323 case 2:
00324 cost = cost8x8_direct;
00325 break;
00326 default:
00327 cost = cost_direct;
00328 break;
00329 }
00330 }
00331 else
00332 {
00333 cost = GetDirectCostMB (currMB);
00334 }
00335 if (cost!=INT_MAX)
00336 {
00337 cost -= (int)floor(16 * enc_mb.lambda_md + 0.4999);
00338 }
00339
00340 if (cost <= min_cost)
00341 {
00342 if(p_Img->active_sps->direct_8x8_inference_flag && p_Inp->Transform8x8Mode)
00343 {
00344 if(p_Inp->Transform8x8Mode==2)
00345 currMB->luma_transform_size_8x8_flag = TRUE;
00346 else
00347 {
00348 if(cost8x8_direct < cost_direct)
00349 currMB->luma_transform_size_8x8_flag = TRUE;
00350 else
00351 currMB->luma_transform_size_8x8_flag = FALSE;
00352 }
00353 }
00354 else
00355 currMB->luma_transform_size_8x8_flag = FALSE;
00356
00357
00358 if (p_Inp->RCEnable)
00359 rc_store_diff(currSlice->diffy, &p_Img->pCurImg[currMB->opix_y], currMB->pix_x, mb_pred);
00360
00361 min_cost = cost;
00362 currMB->best_mode = 0;
00363 tmp_8x8_flag = currMB->luma_transform_size_8x8_flag;
00364 }
00365 else
00366 {
00367 currMB->luma_transform_size_8x8_flag = (byte) tmp_8x8_flag;
00368 currMB->NoMbPartLessThan8x8Flag = (byte) tmp_no_mbpart;
00369 }
00370 }
00371
00372 currMB->min_rdcost = (double) min_cost;
00373
00374 if (enc_mb.valid[I8MB])
00375 {
00376 currMB->luma_transform_size_8x8_flag = TRUE;
00377
00378 currMB->mb_type = currMB->ar_mode = I8MB;
00379 temp_cpb = Mode_Decision_for_Intra8x8Macroblock (currMB, enc_mb.lambda_md, &rd_cost);
00380
00381
00382 if (rd_cost <= currMB->min_rdcost)
00383 {
00384 currMB->cbp = temp_cpb;
00385 if (p_Img->P444_joined)
00386 {
00387 currSlice->curr_cbp[0] = currSlice->cmp_cbp[1];
00388 currSlice->curr_cbp[1] = currSlice->cmp_cbp[2];
00389 }
00390
00391 if(enc_mb.valid[I4MB])
00392 {
00393
00394 if (p_Inp->Transform8x8Mode != 2)
00395 {
00396 i4p = p_RDO->cofAC;
00397 p_RDO->cofAC = currSlice->cofAC;
00398 currSlice->cofAC = i4p;
00399 }
00400 }
00401
00402 copy_image_data_16x16(temp_img[0], &p_Img->enc_picture->imgY[currMB->pix_y], 0, currMB->pix_x);
00403
00404 if (p_Img->P444_joined)
00405 {
00406 copy_image_data_16x16(temp_img[1], &p_Img->enc_picture->imgUV[0][currMB->pix_y], 0, currMB->pix_x);
00407 copy_image_data_16x16(temp_img[2], &p_Img->enc_picture->imgUV[1][currMB->pix_y], 0, currMB->pix_x);
00408 }
00409
00410
00411 if (p_Inp->RCEnable)
00412 rc_store_diff(currSlice->diffy, &p_Img->pCurImg[currMB->opix_y], currMB->pix_x, mb_pred);
00413
00414 currMB->min_rdcost = rd_cost;
00415 currMB->best_mode = I8MB;
00416 tmp_8x8_flag = currMB->luma_transform_size_8x8_flag;
00417 }
00418 else
00419 {
00420 currMB->luma_transform_size_8x8_flag = (byte) tmp_8x8_flag;
00421 if (p_Img->P444_joined)
00422 {
00423 currMB->cbp |= currSlice->curr_cbp[0];
00424 currMB->cbp |= currSlice->curr_cbp[1];
00425 currSlice->cmp_cbp[1] = currMB->cbp;
00426 currSlice->cmp_cbp[2] = currMB->cbp;
00427 }
00428 }
00429 }
00430
00431 if (enc_mb.valid[I4MB])
00432 {
00433 currMB->luma_transform_size_8x8_flag = FALSE;
00434 currMB->mb_type = currMB->ar_mode = I4MB;
00435 temp_cpb = Mode_Decision_for_Intra4x4Macroblock (currMB, enc_mb.lambda_md, &rd_cost);
00436
00437 if (rd_cost <= currMB->min_rdcost)
00438 {
00439 currMB->cbp = temp_cpb;
00440
00441
00442 if (p_Inp->RCEnable)
00443 rc_store_diff(currSlice->diffy, &p_Img->pCurImg[currMB->opix_y], currMB->pix_x, mb_pred);
00444
00445 currMB->min_rdcost = rd_cost;
00446 currMB->best_mode = I4MB;
00447 tmp_8x8_flag = currMB->luma_transform_size_8x8_flag;
00448 }
00449 else
00450 {
00451 currMB->luma_transform_size_8x8_flag = (byte) tmp_8x8_flag;
00452 if (p_Img->P444_joined)
00453 {
00454 currMB->cbp |= currSlice->curr_cbp[0];
00455 currMB->cbp |= currSlice->curr_cbp[1];
00456 currSlice->cmp_cbp[1] = currMB->cbp;
00457 currSlice->cmp_cbp[2] = currMB->cbp;
00458 }
00459
00460 i4p = p_RDO->cofAC;
00461 p_RDO->cofAC = currSlice->cofAC;
00462 currSlice->cofAC=i4p;
00463 }
00464 }
00465 if (enc_mb.valid[I16MB])
00466 {
00467 currMB->luma_transform_size_8x8_flag = FALSE;
00468 intrapred_16x16 (currMB, PLANE_Y);
00469 if (p_Img->P444_joined)
00470 {
00471 select_plane(p_Img, PLANE_U);
00472 intrapred_16x16 (currMB, PLANE_U);
00473 select_plane(p_Img, PLANE_V);
00474 intrapred_16x16 (currMB, PLANE_V);
00475 select_plane(p_Img, PLANE_Y);
00476 }
00477
00478 rd_cost = currSlice->find_sad_16x16 (currMB);
00479
00480 if (rd_cost < currMB->min_rdcost)
00481 {
00482
00483 if (p_Inp->RCEnable)
00484 rc_store_diff(currSlice->diffy, &p_Img->pCurImg[currMB->opix_y], currMB->pix_x, currSlice->mpr_16x16[0][(short) currMB->i16mode]);
00485
00486 currMB->best_mode = I16MB;
00487 currMB->min_rdcost = rd_cost;
00488 currMB->cbp = currMB->trans_16x16 (currMB, PLANE_Y);
00489
00490 if (p_Img->P444_joined)
00491 {
00492 select_plane(p_Img, PLANE_U);
00493 currSlice->cmp_cbp[1] = currMB->trans_16x16(currMB, PLANE_U);
00494 select_plane(p_Img, PLANE_V);
00495 currSlice->cmp_cbp[2] = currMB->trans_16x16(currMB, PLANE_V);
00496
00497 select_plane(p_Img, PLANE_Y);
00498 currMB->cbp |= currSlice->cmp_cbp[1];
00499 currMB->cbp |= currSlice->cmp_cbp[2];
00500 currSlice->cmp_cbp[1] = currMB->cbp;
00501 currSlice->cmp_cbp[2] = currMB->cbp;
00502 }
00503
00504 }
00505 else
00506 {
00507 currMB->luma_transform_size_8x8_flag = (byte) tmp_8x8_flag;
00508 currMB->NoMbPartLessThan8x8Flag = (byte) tmp_no_mbpart;
00509 }
00510 }
00511
00512 intra1 = IS_INTRA(currMB);
00513
00514
00515
00516 {
00517
00518 SetModesAndRefframeForBlocks (currMB, currMB->best_mode);
00519
00520 if (currMB->best_mode == P8x8)
00521 {
00522 if (currMB->luma_transform_size_8x8_flag && (p_RDO->tr8x8->cbp8x8 == 0) && p_Inp->Transform8x8Mode != 2)
00523 currMB->luma_transform_size_8x8_flag = FALSE;
00524
00525 SetCoeffAndReconstruction8x8 (currMB);
00526
00527 memset(currMB->intra_pred_modes, DC_PRED, MB_BLOCK_PARTITIONS * sizeof(char));
00528 for (j = currMB->block_y; j < currMB->block_y + BLOCK_MULTIPLE; j++)
00529 memset(&ipredmodes[j][currMB->block_x], DC_PRED, BLOCK_MULTIPLE * sizeof(char));
00530 }
00531 else
00532 {
00533
00534 if (currMB->best_mode == I8MB)
00535 {
00536 memcpy(currMB->intra_pred_modes,currMB->intra_pred_modes8x8, MB_BLOCK_PARTITIONS * sizeof(char));
00537 for(j = currMB->block_y; j < currMB->block_y + BLOCK_MULTIPLE; j++)
00538 memcpy(&p_Img->ipredmode[j][currMB->block_x],&p_Img->ipredmode8x8[j][currMB->block_x], BLOCK_MULTIPLE * sizeof(char));
00539
00540
00541 copy_image_data_16x16(&p_Img->enc_picture->imgY[currMB->pix_y], temp_img[0], currMB->pix_x, 0);
00542
00543 if (p_Img->P444_joined)
00544 {
00545 copy_image_data_16x16(&p_Img->enc_picture->imgUV[0][currMB->pix_y], temp_img[1], currMB->pix_x, 0);
00546 copy_image_data_16x16(&p_Img->enc_picture->imgUV[1][currMB->pix_y], temp_img[2], currMB->pix_x, 0);
00547 }
00548 }
00549
00550 if ((currMB->best_mode!=I4MB)&&(currMB->best_mode != I8MB))
00551 {
00552 memset(currMB->intra_pred_modes,DC_PRED, MB_BLOCK_PARTITIONS * sizeof(char));
00553 for(j = currMB->block_y; j < currMB->block_y + BLOCK_MULTIPLE; j++)
00554 memset(&ipredmodes[j][currMB->block_x],DC_PRED, BLOCK_MULTIPLE * sizeof(char));
00555 currMB->ar_mode = currMB->best_mode;
00556
00557 if (currMB->best_mode!=I16MB)
00558 {
00559 if((currMB->best_mode >= 1) && (currMB->best_mode <= 3))
00560 currMB->luma_transform_size_8x8_flag = (byte) best_transform_flag;
00561
00562 if (currSlice->P444_joined)
00563 {
00564 luma_residual_coding_p444(currMB);
00565 if((currMB->cbp==0 && currSlice->cmp_cbp[1] == 0 && currSlice->cmp_cbp[2] == 0) &&(currMB->best_mode == 0))
00566 currMB->luma_transform_size_8x8_flag = FALSE;
00567 }
00568 else
00569 {
00570 luma_residual_coding(currMB);
00571 if((currMB->cbp==0)&&(currMB->best_mode == 0))
00572 currMB->luma_transform_size_8x8_flag = FALSE;
00573 }
00574
00575
00576 if (p_Inp->RCEnable)
00577 rc_store_diff(currSlice->diffy, &p_Img->pCurImg[currMB->opix_y], currMB->pix_x, mb_pred);
00578 }
00579 }
00580 }
00581
00582 if (((currMB->cbp&15) == 0) && currMB->mb_type != I4MB && currMB->mb_type != I8MB)
00583 currMB->luma_transform_size_8x8_flag = FALSE;
00584
00585
00586 if ((p_Img->yuv_format != YUV400) && (p_Img->yuv_format != YUV444))
00587 intra_chroma_prediction(currMB, NULL, NULL, NULL);
00588
00589 currMB->i16offset = 0;
00590
00591 if ((p_Img->yuv_format != YUV400) && (p_Img->yuv_format != YUV444))
00592 chroma_residual_coding (currMB);
00593
00594 if (currMB->best_mode == I16MB)
00595 {
00596 currMB->i16offset = I16Offset (currMB->cbp, currMB->i16mode);
00597 }
00598
00599 currSlice->SetMotionVectorsMB (currMB, motion);
00600
00601
00602 if(p_Img->P444_joined)
00603 {
00604 if ((pslice) && currMB->best_mode == 1 && currMB->cbp==0 && currSlice->cmp_cbp[1] == 0 && currSlice->cmp_cbp[2] == 0 &&
00605 motion->ref_idx[LIST_0][currMB->block_y][currMB->block_x] == 0 &&
00606 motion->mv [LIST_0][currMB->block_y][currMB->block_x][0] == allmvs[0] &&
00607 motion->mv [LIST_0][currMB->block_y][currMB->block_x][1] == allmvs[1])
00608 {
00609 currMB->mb_type = currMB->b8x8[0].mode = currMB->b8x8[1].mode = currMB->b8x8[2].mode = currMB->b8x8[3].mode = 0;
00610 currMB->luma_transform_size_8x8_flag = FALSE;
00611 }
00612 }
00613 else if ((pslice) && currMB->best_mode == 1 && currMB->cbp==0 &&
00614 motion->ref_idx[LIST_0][currMB->block_y][currMB->block_x] == 0 &&
00615 motion->mv [LIST_0][currMB->block_y][currMB->block_x][0] == allmvs[0] &&
00616 motion->mv [LIST_0][currMB->block_y][currMB->block_x][1] == allmvs[1])
00617 {
00618 currMB->mb_type = currMB->b8x8[0].mode = currMB->b8x8[1].mode = currMB->b8x8[2].mode = currMB->b8x8[3].mode = 0;
00619 currMB->luma_transform_size_8x8_flag = FALSE;
00620 }
00621
00622 if (currSlice->MbaffFrameFlag || (p_Inp->UseRDOQuant && currSlice->RDOQ_QP_Num > 1))
00623 set_mbaff_parameters(currMB);
00624 }
00625
00626
00627 if(p_Inp->RCEnable && p_Inp->RCUpdateMode <= MAX_RC_MODE)
00628 rc_store_mad(currMB);
00629
00630
00631 if (p_Inp->RestrictRef)
00632 update_refresh_map(currMB, intra, intra1);
00633
00634
00635
00636 if (p_Img->AdaptiveRounding)
00637 {
00638 update_offset_params(currMB, currMB->best_mode, currMB->luma_transform_size_8x8_flag);
00639 }
00640
00641 free_mem3Dpel(temp_img);
00642 }
00643