]> granicus.if.org Git - libx264/commitdiff
10l (fast1stpass was slower than non-fast)
authorLoren Merritt <pengvado@videolan.org>
Mon, 28 Feb 2005 18:50:55 +0000 (18:50 +0000)
committerLoren Merritt <pengvado@videolan.org>
Mon, 28 Feb 2005 18:50:55 +0000 (18:50 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@145 df754926-b1dd-0310-bc7b-ec298dee348c

vfw/codec.c

index 18d2abc6554fb712fdf97802d7b2ebcbf963c1d3..642cc669dea63521af659dfea341f7a6ce887b98 100644 (file)
@@ -28,6 +28,7 @@
 #include <io.h>
 
 #define X264_MAX(a,b) ( (a)>(b) ? (a) : (b) )
+#define X264_MIN(a,b) ( (a)<(b) ? (a) : (b) )
 
 /* get_csp:
  *  return a valid x264 CSP or X264_CSP_NULL if unsuported */
@@ -285,7 +286,7 @@ LRESULT compress_begin(CODEC * codec, BITMAPINFO * lpbiInput, BITMAPINFO * lpbiO
                 if( config->b_fast1pass )
                 {
                     /* adjust or turn off some flags to gain speed, if needed */
-                    param.analyse.i_subpel_refine = X264_MAX( 3, param.analyse.i_subpel_refine - 1 );
+                    param.analyse.i_subpel_refine = X264_MAX( X264_MIN( 3, param.analyse.i_subpel_refine - 1 ), 1 );
                     param.i_frame_reference = ( param.i_frame_reference + 1 ) >> 1;
                     param.analyse.inter &= ( ~X264_ANALYSE_PSUB8x8 );
                     param.analyse.inter &= ( ~X264_ANALYSE_BSUB16x16 );