]> git.videolan.org Git - x264.git/commitdiff
Save a bit of memory with weightp + high bit depth
authorJason Garrett-Glaser <darkshikari@gmail.com>
Fri, 12 Nov 2010 06:25:31 +0000 (22:25 -0800)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Sun, 14 Nov 2010 06:12:49 +0000 (22:12 -0800)
common/macroblock.c

index 1a28418eb512793111f07df848e0ba61855fe7b2..99302d03b495d31f110ed5e580c1792fba6639a1 100644 (file)
@@ -238,7 +238,7 @@ int x264_macroblock_cache_allocate( x264_t *h )
     {
         int i_refs = X264_MIN(X264_REF_MAX, (i ? 1 + !!h->param.i_bframe_pyramid : h->param.i_frame_reference) ) << h->param.b_interlaced;
         if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_SMART )
-            i_refs = X264_MIN(X264_REF_MAX, i_refs + 2); //smart weights add two duplicate frames
+            i_refs = X264_MIN(X264_REF_MAX, i_refs + 1 + (BIT_DEPTH == 8)); //smart weights add two duplicate frames, one in >8-bit
         else if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_BLIND )
             i_refs = X264_MIN(X264_REF_MAX, i_refs + 1); //blind weights add one duplicate frame