[x264-devel] commit: Fix bug in reference frame autoadjustment (James Darnley )

git version control git at videolan.org
Sat Jul 11 09:13:31 CEST 2009


x264 | branch: master | James Darnley <james.darnley at gmail.com> | Thu Jul  9 11:25:55 2009 -0700| [b63f5919e3f5367a0df3dbf218d5a94d2fdba5fb] | committer: Jason Garrett-Glaser 

Fix bug in reference frame autoadjustment
For some types of input file, x264 did the adjustment before width/height were known.

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

 x264.c |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/x264.c b/x264.c
index e79f9ac..91d2ca1 100644
--- a/x264.c
+++ b/x264.c
@@ -822,24 +822,6 @@ generic_option:
         param->analyse.i_trellis = 0;
     }
 
-    /* Automatically reduce reference frame count to match the user's target level
-     * if the user didn't explicitly set a reference frame count. */
-    if( !b_user_ref )
-    {
-        int mbs = (((param->i_width)+15)>>4) * (((param->i_height)+15)>>4);
-        int i;
-        for( i = 0; x264_levels[i].level_idc != 0; i++ )
-            if( param->i_level_idc == x264_levels[i].level_idc )
-            {
-                while( mbs * 384 * param->i_frame_reference > x264_levels[i].dpb
-                       && param->i_frame_reference > 1 )
-                {
-                    param->i_frame_reference--;
-                }
-                break;
-            }
-    }
-
     /* Apply profile restrictions. */
     if( profile )
     {
@@ -972,6 +954,26 @@ generic_option:
     }
 #endif
 
+
+    /* Automatically reduce reference frame count to match the user's target level
+     * if the user didn't explicitly set a reference frame count. */
+    if( !b_user_ref )
+    {
+        int mbs = (((param->i_width)+15)>>4) * (((param->i_height)+15)>>4);
+        int i;
+        for( i = 0; x264_levels[i].level_idc != 0; i++ )
+            if( param->i_level_idc == x264_levels[i].level_idc )
+            {
+                while( mbs * 384 * param->i_frame_reference > x264_levels[i].dpb
+                       && param->i_frame_reference > 1 )
+                {
+                    param->i_frame_reference--;
+                }
+                break;
+            }
+    }
+
+
     return 0;
 }
 



More information about the x264-devel mailing list