]> git.videolan.org Git - x264.git/commitdiff
Fix satd predictors with high bit depth
authorJason Garrett-Glaser <darkshikari@gmail.com>
Fri, 24 Dec 2010 22:28:42 +0000 (17:28 -0500)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Sat, 8 Jan 2011 23:00:15 +0000 (18:00 -0500)
Resulted in odd CRF-mode results with --no-mbtree, as well as suboptimal VBV handling.

encoder/slicetype.c

index 7eff5701b41a74b79efcd79b612a7e38ce60b44a..9d5718c53bed2e883f810d5c3954bbd5137ada98 100644 (file)
@@ -1647,5 +1647,9 @@ int x264_rc_analyse_slice( x264_t *h )
         }
     }
 
-    return cost;
+    if( BIT_DEPTH > 8 )
+        for( int y = 0; y < h->mb.i_mb_height; y++ )
+            h->fdec->i_row_satd[y] >>= (BIT_DEPTH - 8);
+
+    return cost >> (BIT_DEPTH - 8);
 }