[x264-devel] commit: Fix different output with differing sync-lookahead ( Anton Mitrofanov )

git at videolan.org git at videolan.org
Fri May 21 10:33:14 CEST 2010


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Fri May 21 10:33:45 2010 +0400| [9b47cb08b5ecf9a38ba82f299304c95c178f4690] | committer: Jason Garrett-Glaser 

Fix different output with differing sync-lookahead
Also reduce memory consumption.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=9b47cb08b5ecf9a38ba82f299304c95c178f4690
---

 encoder/encoder.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/encoder/encoder.c b/encoder/encoder.c
index c72114b..de06251 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -603,8 +603,9 @@ static int x264_validate_parameters( x264_t *h )
     if( h->param.rc.b_stat_read )
         h->param.rc.i_lookahead = 0;
 #ifdef HAVE_PTHREAD
-    if( h->param.i_sync_lookahead )
-        h->param.i_sync_lookahead = x264_clip3( h->param.i_sync_lookahead, h->i_thread_frames + h->param.i_bframe, X264_LOOKAHEAD_MAX );
+    if( h->param.i_sync_lookahead < 0 )
+        h->param.i_sync_lookahead = h->param.i_bframe + 1;
+    h->param.i_sync_lookahead = X264_MIN( h->param.i_sync_lookahead, X264_LOOKAHEAD_MAX );
     if( h->param.rc.b_stat_read || h->i_thread_frames == 1 )
         h->param.i_sync_lookahead = 0;
 #else
@@ -937,7 +938,6 @@ x264_t *x264_encoder_open( x264_param_t *param )
         h->frames.i_delay = X264_MAX( h->frames.i_delay, h->param.rc.i_lookahead );
     i_slicetype_length = h->frames.i_delay;
     h->frames.i_delay += h->i_thread_frames - 1;
-    h->frames.i_delay = X264_MIN( h->frames.i_delay, X264_LOOKAHEAD_MAX );
     h->frames.i_delay += h->param.i_sync_lookahead;
     h->frames.i_delay += h->param.b_vfr_input && (h->param.rc.i_rc_method == X264_RC_ABR || h->param.rc.b_stat_write
                                                  || h->param.rc.i_vbv_buffer_size);



More information about the x264-devel mailing list