870 |
MACROBLOCK * const pMB = frame->mbs + i + j * pParam->mb_width; |
MACROBLOCK * const pMB = frame->mbs + i + j * pParam->mb_width; |
871 |
const MACROBLOCK * const b_mb = b_mbs + i + j * pParam->mb_width; |
const MACROBLOCK * const b_mb = b_mbs + i + j * pParam->mb_width; |
872 |
int interpol_search; |
int interpol_search; |
|
int bf_search = 0; |
|
|
int bf_thresh1, bf_thresh2; |
|
873 |
|
|
874 |
/* special case, if collocated block is SKIPed in P-VOP: encoding is forward (0,0), cpb=0 without further ado */ |
/* special case, if collocated block is SKIPed in P-VOP: encoding is forward (0,0), cpb=0 without further ado */ |
875 |
if (b_reference->coding_type != S_VOP) |
if (b_reference->coding_type != S_VOP) |
905 |
} |
} |
906 |
|
|
907 |
if (frame->motion_flags & XVID_ME_BFRAME_EARLYSTOP) { |
if (frame->motion_flags & XVID_ME_BFRAME_EARLYSTOP) { |
908 |
|
int bf_search = 0; |
909 |
|
int bf_thresh = 0; |
910 |
|
|
911 |
if(i > 0 && j > 0 && i < pParam->mb_width) { |
if(i > 0 && j > 0 && i < pParam->mb_width) { |
912 |
bf_thresh1 = ((&pMBs[(i-1) + j * pParam->mb_width])->sad16 + |
bf_thresh = ((&pMBs[(i-1) + j * pParam->mb_width])->sad16 + |
913 |
(&pMBs[i + (j-1) * pParam->mb_width])->sad16 + |
(&pMBs[i + (j-1) * pParam->mb_width])->sad16 + |
914 |
(&pMBs[(i+1) + (j-1) * pParam->mb_width])->sad16) / 3; |
(&pMBs[(i+1) + (j-1) * pParam->mb_width])->sad16) / 3; |
915 |
|
|
929 |
bf_search++; |
bf_search++; |
930 |
} |
} |
931 |
|
|
932 |
if ((best_sad < bf_thresh1) && (bf_search == 3)) |
if ((best_sad < bf_thresh) && (bf_search == 3)) |
933 |
continue; |
continue; |
934 |
} |
} |
935 |
|
|