From: Loren Merritt Date: Sat, 4 Feb 2006 05:39:02 +0000 (+0000) Subject: fix order of frame evaluation in pre-me X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce237ab663525259ce64423341ce6893309cee88;p=libx264 fix order of frame evaluation in pre-me git-svn-id: svn://svn.videolan.org/x264/trunk@413 df754926-b1dd-0310-bc7b-ec298dee348c --- diff --git a/encoder/slicetype_decision.c b/encoder/slicetype_decision.c index 6bd1b1c9..1a8878ce 100644 --- a/encoder/slicetype_decision.c +++ b/encoder/slicetype_decision.c @@ -232,9 +232,9 @@ int x264_slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a, /* Init MVs so that we don't have to check edge conditions when loading predictors. */ /* FIXME: not needed every time */ - memset( frames[b]->mv[0], 0, h->sps->i_mb_height * h->sps->i_mb_width * 2*sizeof(int) ); + memset( frames[b]->mv[0], 0, h->sps->i_mb_height * h->sps->i_mb_width * 2*sizeof(int16_t) ); if( b != p1 ) - memset( frames[b]->mv[1], 0, h->sps->i_mb_height * h->sps->i_mb_width * 2*sizeof(int) ); + memset( frames[b]->mv[1], 0, h->sps->i_mb_height * h->sps->i_mb_width * 2*sizeof(int16_t) ); if( b == p1 ) frames[b]->i_intra_mbs[b-p0] = 0; @@ -288,9 +288,9 @@ no_b_frames: if( frames[2]->i_intra_mbs[2] > i_mb_count / 2 ) goto no_b_frames; - cost2p0 = x264_slicetype_frame_cost( h, &a, frames, 1, 2, 2 ); - cost1p0 = x264_slicetype_frame_cost( h, &a, frames, 0, 1, 1 ); cost1b1 = x264_slicetype_frame_cost( h, &a, frames, 0, 2, 1 ); + cost1p0 = x264_slicetype_frame_cost( h, &a, frames, 0, 1, 1 ); + cost2p0 = x264_slicetype_frame_cost( h, &a, frames, 1, 2, 2 ); // fprintf( stderr, "PP: %d + %d <=> BP: %d + %d \n", // cost1p0, cost2p0, cost1b1, cost2p1 ); if( cost1p0 + cost2p0 < cost1b1 + cost2p1 )