From ef4d1fa4a99a23420708083c66e882d7cfd21d9f Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Thu, 10 Feb 2005 22:11:39 +0000 Subject: [PATCH] cosmetics git-svn-id: svn://svn.videolan.org/x264/trunk@120 df754926-b1dd-0310-bc7b-ec298dee348c --- encoder/analyse.c | 8 +++----- encoder/encoder.c | 2 +- encoder/me.c | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/encoder/analyse.c b/encoder/analyse.c index 2e5609cd..7f4cd7c0 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -1177,11 +1177,9 @@ void x264_macroblock_analyse( x264_t *h ) h->mb.qp[h->mb.i_mb_xy] = x264_ratecontrol_qp(h); - /* FIXME check if it's 12 */ - if( h->mb.qp[h->mb.i_mb_xy] - h->mb.i_last_qp < -12 ) - h->mb.qp[h->mb.i_mb_xy] = h->mb.i_last_qp - 12; - else if( h->mb.qp[h->mb.i_mb_xy] - h->mb.i_last_qp > 12 ) - h->mb.qp[h->mb.i_mb_xy] = h->mb.i_last_qp + 12; + /* prevent QP from varying too fast. FIXME what's a sane limit? */ + h->mb.qp[h->mb.i_mb_xy] = x264_clip3( h->mb.qp[h->mb.i_mb_xy], + h->mb.i_last_qp - 12, h->mb.i_last_qp + 12 ); /* init analysis */ x264_mb_analyse_init( h, &analysis, h->mb.qp[h->mb.i_mb_xy] ); diff --git a/encoder/encoder.c b/encoder/encoder.c index 8e4a2c73..3f485185 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -63,7 +63,7 @@ static int64_t i_mtime_filter = 0; ******************************* x264 libs ********************************** * ****************************************************************************/ -static float x264_sqe( uint8_t *pix1, int i_pix_stride, uint8_t *pix2, int i_pix2_stride, int i_width, int i_height ) +static int64_t x264_sqe( uint8_t *pix1, int i_pix_stride, uint8_t *pix2, int i_pix2_stride, int i_width, int i_height ) { int64_t i_sqe = 0; diff --git a/encoder/me.c b/encoder/me.c index 1b9a4489..660b5de2 100644 --- a/encoder/me.c +++ b/encoder/me.c @@ -33,7 +33,7 @@ * subpel_iters[i_subpel_refine] = { refine_hpel, refine_qpel, me_hpel, me_qpel } * where me_* are the number of EPZS iterations run on all candidate block types, * and refine_* are run only on the winner. */ -const static int subpel_iterations[][4] = +static const int subpel_iterations[][4] = {{1,0,0,0}, {1,1,0,0}, {1,2,0,0}, -- 2.40.0