dsputil: Move get_penalty_factor() to the only place it is used.

This commit is contained in:
Diego Biurrun 2013-02-07 21:07:57 +01:00
parent 0b016eb99d
commit b5b7b75e91
2 changed files with 20 additions and 20 deletions

View file

@ -972,6 +972,26 @@ static inline int check_input_motion(MpegEncContext * s, int mb_x, int mb_y, int
return d;
}
static inline int get_penalty_factor(int lambda, int lambda2, int type){
switch(type&0xFF){
default:
case FF_CMP_SAD:
return lambda>>FF_LAMBDA_SHIFT;
case FF_CMP_DCT:
return (3*lambda)>>(FF_LAMBDA_SHIFT+1);
case FF_CMP_SATD:
case FF_CMP_DCT264:
return (2*lambda)>>FF_LAMBDA_SHIFT;
case FF_CMP_RD:
case FF_CMP_PSNR:
case FF_CMP_SSE:
case FF_CMP_NSSE:
return lambda2>>FF_LAMBDA_SHIFT;
case FF_CMP_BIT:
return 1;
}
}
void ff_estimate_p_frame_motion(MpegEncContext * s,
int mb_x, int mb_y)
{