]> granicus.if.org Git - libx264/commitdiff
fix order of frame evaluation in pre-me
authorLoren Merritt <pengvado@videolan.org>
Sat, 4 Feb 2006 05:39:02 +0000 (05:39 +0000)
committerLoren Merritt <pengvado@videolan.org>
Sat, 4 Feb 2006 05:39:02 +0000 (05:39 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@413 df754926-b1dd-0310-bc7b-ec298dee348c

encoder/slicetype_decision.c

index 6bd1b1c9fc700475fee2643ebd70cb4c93bd6247..1a8878ceaef45374310943a5f8d8ac54b08ae31b 100644 (file)
@@ -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 )