375 |
Data_d->CurU = Data_f->CurU = Data_b->CurU = Data_i->CurU = Cur[1]; |
Data_d->CurU = Data_f->CurU = Data_b->CurU = Data_i->CurU = Cur[1]; |
376 |
Data_d->CurV = Data_f->CurV = Data_b->CurV = Data_i->CurV = Cur[2]; |
Data_d->CurV = Data_f->CurV = Data_b->CurV = Data_i->CurV = Cur[2]; |
377 |
|
|
378 |
Data_d->lambda16 = lambda/4; |
Data_d->lambda16 = lambda; |
379 |
Data_f->lambda16 = Data_b->lambda16 = Data_i->lambda16 = lambda; |
Data_f->lambda16 = Data_b->lambda16 = Data_i->lambda16 = lambda; |
380 |
|
|
381 |
/* reset chroma-sad cache */ |
/* reset chroma-sad cache */ |
944 |
|
|
945 |
const int32_t TRB = time_pp - time_bp; |
const int32_t TRB = time_pp - time_bp; |
946 |
const int32_t TRD = time_pp; |
const int32_t TRD = time_pp; |
947 |
|
DECLARE_ALIGNED_MATRIX(dct_space, 3, 64, int16_t, CACHE_LINE); |
948 |
|
|
949 |
/* some pre-inintialized data for the rest of the search */ |
/* some pre-inintialized data for the rest of the search */ |
950 |
SearchData Data_d, Data_f, Data_b, Data_i; |
SearchData Data_d, Data_f, Data_b, Data_i; |
955 |
Data_d.rounding = 0; |
Data_d.rounding = 0; |
956 |
Data_d.chroma = frame->motion_flags & XVID_ME_CHROMA_BVOP; |
Data_d.chroma = frame->motion_flags & XVID_ME_CHROMA_BVOP; |
957 |
Data_d.iQuant = frame->quant; |
Data_d.iQuant = frame->quant; |
958 |
|
Data_d.dctSpace = dct_space; |
959 |
|
Data_d.quant_type = !(pParam->vol_flags & XVID_VOL_MPEGQUANT); |
960 |
|
Data_d.mpeg_quant_matrices = pParam->mpeg_quant_matrices; |
961 |
|
|
962 |
Data_d.RefQ = f_refV->u; /* a good place, also used in MC (for similar purpose) */ |
Data_d.RefQ = f_refV->u; /* a good place, also used in MC (for similar purpose) */ |
963 |
|
|
1010 |
|
|
1011 |
sad2 = best_sad; |
sad2 = best_sad; |
1012 |
|
|
1013 |
if (Data_f.iMinSAD[0] < 2*sad2+1500) |
if (Data_f.iMinSAD[0] < 2*sad2+2000) |
1014 |
SearchBF_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_f); |
SearchBF_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_f); |
1015 |
|
|
1016 |
if (Data_b.iMinSAD[0] < 2*sad2+1500) |
if (Data_b.iMinSAD[0] < 2*sad2+2000) |
1017 |
SearchBF_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_b); |
SearchBF_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_b); |
1018 |
|
|
1019 |
SearchInterpolate_initial(i, j, frame->motion_flags, pParam, &f_predMV, &b_predMV, &best_sad, |
SearchInterpolate_initial(i, j, frame->motion_flags, pParam, &f_predMV, &b_predMV, &best_sad, |
1024 |
|
|
1025 |
SearchInterpolate_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_i); |
SearchInterpolate_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_i); |
1026 |
|
|
1027 |
|
if ((Data_d.iMinSAD[0] <= 2*best_sad) && (!frame->motion_flags&XVID_ME_SKIP_DELTASEARCH)) |
|
if ((Data_d.iMinSAD[0] <= best_sad) && (!(frame->motion_flags&XVID_ME_SKIP_DELTASEARCH))) |
|
1028 |
SearchDirect_final(frame->motion_flags, b_mb, &best_sad, &Data_d); |
SearchDirect_final(frame->motion_flags, b_mb, &best_sad, &Data_d); |
1029 |
|
|
1030 |
|
|
1039 |
} |
} |
1040 |
} |
} |
1041 |
|
|
1042 |
|
if (frame->vop_flags & XVID_VOP_RD_BVOP) |
1043 |
|
ModeDecision_BVOP_RD(&Data_d, &Data_b, &Data_f, &Data_i, |
1044 |
|
pMB, b_mb, &f_predMV, &b_predMV, frame->motion_flags, pParam, i, j); |
1045 |
|
else |
1046 |
ModeDecision_BVOP_SAD(&Data_d, &Data_b, &Data_f, &Data_i, pMB, b_mb, &f_predMV, &b_predMV); |
ModeDecision_BVOP_SAD(&Data_d, &Data_b, &Data_f, &Data_i, pMB, b_mb, &f_predMV, &b_predMV); |
1047 |
|
|
1048 |
} |
} |