From b04a2601088a855361169a3eb5236e8b998f7e70 Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Mon, 28 Feb 2005 18:50:55 +0000 Subject: [PATCH] 10l (fast1stpass was slower than non-fast) git-svn-id: svn://svn.videolan.org/x264/trunk@145 df754926-b1dd-0310-bc7b-ec298dee348c --- vfw/codec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vfw/codec.c b/vfw/codec.c index 18d2abc6..642cc669 100644 --- a/vfw/codec.c +++ b/vfw/codec.c @@ -28,6 +28,7 @@ #include #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 ); -- 2.40.0