aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-02-07 21:07:57 +0100
committerDiego Biurrun <diego@biurrun.de>2013-02-07 22:05:25 +0100
commitb5b7b75e91e291c810ebd01868a42b53f267a87c (patch)
tree9c7504bd79cee20cfa1a14c49f83340645357885 /libavcodec
parent0b016eb99d38738e2c53e36549a4732a0f863b2e (diff)
downloadffmpeg-b5b7b75e91e291c810ebd01868a42b53f267a87c.tar.gz
dsputil: Move get_penalty_factor() to the only place it is used.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dsputil.h20
-rw-r--r--libavcodec/motion_est.c20
2 files changed, 20 insertions, 20 deletions
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index 8898ece305..675fe29d84 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -460,26 +460,6 @@ static inline uint64_t no_rnd_avg64(uint64_t a, uint64_t b)
return (a & b) + (((a ^ b) & ~BYTE_VEC64(0x01)) >> 1);
}
-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_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index e791690244..e051191883 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -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)
{