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] );
******************************* 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;
* 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},