[MPlayer-dev-eng] [PATCH] synch to x264 r50

Loren Merritt lorenm at u.washington.edu
Wed Sep 29 20:12:12 CEST 2004


Adds a parameter 'scenecut', to control the threshold for inserting extra 
I-frames.

--Loren Merritt
-------------- next part --------------
Index: libmpcodecs/ve_x264.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_x264.c,v
retrieving revision 1.6
diff -u -r1.6 ve_x264.c
--- libmpcodecs/ve_x264.c	27 Sep 2004 21:04:42 -0000	1.6
+++ libmpcodecs/ve_x264.c	29 Sep 2004 18:08:07 -0000
@@ -63,6 +63,7 @@
 static int frame_ref = 1;
 static int iframe = 250;
 static int idrframe = 2;
+static int scenecut = 40;
 static int bframe = 0;
 static int deblock = 1;
 static int deblockalpha = 0;
@@ -92,6 +93,7 @@
     {"frameref", &frame_ref, CONF_TYPE_INT, CONF_RANGE, 1, 15, NULL},
     {"keyint", &iframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
     {"idrint", &idrframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
+    {"scenecut", &scenecut, CONF_TYPE_INT, CONF_RANGE, -1, 100, NULL},
     {"bframes", &bframe, CONF_TYPE_INT, CONF_RANGE, 0, 16, NULL},
     {"deblock", &deblock, CONF_TYPE_FLAG, 0, 0, 1, NULL},
     {"nodeblock", &deblock, CONF_TYPE_FLAG, 0, 1, 0, NULL},
@@ -132,6 +134,7 @@
     mod->param.i_frame_reference = frame_ref;
     mod->param.i_idrframe = idrframe;
     mod->param.i_iframe = iframe;
+    mod->param.i_scenecut_threshold = scenecut;
     mod->param.i_bframe = bframe;
     mod->param.b_deblocking_filter = deblock;
     mod->param.i_deblocking_filter_alphac0 = deblockalpha;
Index: DOCS/man/en/mplayer.1
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/man/en/mplayer.1,v
retrieving revision 1.756
diff -u -r1.756 mplayer.1
--- DOCS/man/en/mplayer.1	29 Sep 2004 01:46:30 -0000	1.756
+++ DOCS/man/en/mplayer.1	29 Sep 2004 18:08:10 -0000
@@ -6763,6 +6763,15 @@
 prior to the IDR-Frame.
 .
 .TP
+.B scenecut=<-1\-100>
+Controls how aggressively to insert extra I-frames (default: 40).
+With small values of scenecut, the codec often has to force an I-frame
+when it would exceed keyint.
+Good values of scenecut may find a better location for the I-frame.
+Large values use more I-frames than necessary, thus wasting bits.
+-1 disables scene-cut detection.
+.
+.TP
 .B frameref=<1\-15>
 Number of previous frames used as predictors in a P frame (default: 1).
 This is effective in Anime, but seems to make little difference in


More information about the MPlayer-dev-eng mailing list