From: Loren Merritt Date: Fri, 10 Feb 2006 01:16:40 +0000 (+0000) Subject: lowres can reuse the normal mv cost table X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fed2847ca9c4b9f8240be78145681d12ea85e1e9;p=libx264 lowres can reuse the normal mv cost table git-svn-id: svn://svn.videolan.org/x264/trunk@427 df754926-b1dd-0310-bc7b-ec298dee348c --- diff --git a/encoder/slicetype_decision.c b/encoder/slicetype_decision.c index 1a8878ce..7f378166 100644 --- a/encoder/slicetype_decision.c +++ b/encoder/slicetype_decision.c @@ -30,29 +30,11 @@ #include "me.h" -static void x264_mb_analyse_load_costs_lowres( x264_t *h, x264_mb_analysis_t *a ) -{ - static int16_t *p_cost_mv; - - if( !p_cost_mv ) - { - int i; - x264_cpu_restore( h->param.cpu ); - p_cost_mv = x264_malloc( (2*2*h->param.analyse.i_mv_range + 1) * sizeof(int16_t) ); - p_cost_mv += 2*h->param.analyse.i_mv_range; - for( i = 0; i <= 2*h->param.analyse.i_mv_range; i++ ) - p_cost_mv[-i] = - p_cost_mv[i] = (int)( a->i_lambda * (1 + 2*log(2*i+1)/log(2)) ); - } - - a->p_cost_mv = p_cost_mv; -} - static void x264_lowres_context_init( x264_t *h, x264_mb_analysis_t *a ) { a->i_qp = 12; // arbitrary, but low because SATD scores are 1/4 normal a->i_lambda = i_qp0_cost_table[ a->i_qp ]; - x264_mb_analyse_load_costs_lowres( h, a ); + x264_mb_analyse_load_costs( h, a ); h->mb.i_me_method = X264_MIN( X264_ME_HEX, h->param.analyse.i_me_method ); // maybe dia? h->mb.i_subpel_refine = 4; // 3 should be enough, but not tweaking for speed now h->mb.b_chroma_me = 0;