News:

--

Main Menu

2.6/2.7 qt4 x264 Motion Extimation Settings

Started by KoolAidMan, January 17, 2013, 05:52:33 AM

Previous topic - Next topic

KoolAidMan

In the previous patch I submitted, I accidentally confused me_range with mv_range. I have fixed that, among other things.


  • Maximum Motion Vector Search Range now saves to me_range, not mv_range
  • Maximum Motion Vector Length option is now available, and saves to mv_range. In the case where the box is unchecked, it sets it to -1 for auto.
  • Minimum buffer between threads option is now available, and saves to mv_range_thread. In the case where the box is unchecked, it sets it to -1 for auto.
  • Added json serialization for any of the above options which were not available
  • Added logging to the x264 settings dump for any above settings which were missing


Index: avidemux_plugins/ADM_videoEncoder/x264/ADM_x264Setup.cpp
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/ADM_x264Setup.cpp (revision 8393)
+++ avidemux_plugins/ADM_videoEncoder/x264/ADM_x264Setup.cpp (working copy)
@@ -132,7 +132,9 @@
    MKPARAM (i_weighted_pred,weighted_pred)
    MKPARAM (i_direct_mv_pred,direct_mv_pred)
    MKPARAM (i_me_method,me_method)
+   MKPARAM (i_me_range,me_range)
    MKPARAM (i_mv_range,mv_range)
+   MKPARAM (i_mv_range_thread,mv_range_thread)
    MKPARAM (i_subpel_refine,subpel_refine)
    MKPARAMB(b_chroma_me,chroma_me)
    MKPARAMB(b_mixed_references,mixed_references)
@@ -359,6 +361,7 @@
     
     AI(i_me_method);
     AI(i_me_range);
+    AI(i_mv_range);
     AI(i_mv_range_thread);
     AI(i_subpel_refine);
     AI(b_chroma_me);
Index: avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.conf
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.conf (revision 8393)
+++ avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.conf (working copy)
@@ -34,7 +34,9 @@
uint32_t:direct_mv_pred;
uint32_t:chroma_offset;
uint32_t:me_method;
-uint32_t:mv_range;
+uint32_t:me_range;
+int32_t:mv_range;
+int32_t:mv_range_thread;
uint32_t:subpel_refine;
bool:chroma_me;
bool:mixed_references;
Index: avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.h
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.h (revision 8393)
+++ avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.h (working copy)
@@ -37,7 +37,9 @@
uint32_t direct_mv_pred;
uint32_t chroma_offset;
uint32_t me_method;
- uint32_t mv_range;
+ uint32_t me_range;
+ int32_t mv_range;
+ int32_t mv_range_thread;
uint32_t subpel_refine;
bool chroma_me;
bool mixed_references;
Index: avidemux_plugins/ADM_videoEncoder/x264/qt4/Q_x264.cpp
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/qt4/Q_x264.cpp (revision 8393)
+++ avidemux_plugins/ADM_videoEncoder/x264/qt4/Q_x264.cpp (working copy)
@@ -223,7 +223,22 @@
           MK_MENU(adaptiveBFrameComboBox,i_bframe_adaptive);

           MK_MENU(predictModeComboBox,analyze.direct_mv_pred);
-          MK_UINT(mvRangeSpinBox,analyze.mv_range);
+          MK_UINT(mvRangeSpinBox,analyze.me_range);
+         
+          int32_t mv_range = myCopy.analyze.mv_range;
+          if(mv_range >= 0)
+          {
+              ui.mvLengthCheckBox->setChecked(true);
+              MK_UINT(mvLengthSpinBox,analyze.mv_range);
+          }
+         
+          int32_t mv_range_thread = myCopy.analyze.mv_range_thread;
+         
+          if(mv_range_thread >= 0)
+          {
+              ui.minThreadBufferCheckBox->setChecked(true);
+              MK_UINT(minThreadBufferSpinBox,analyze.mv_range_thread);
+          }

           // udate idc
           QComboBox *idc=ui.idcLevelComboBox;
@@ -292,8 +307,6 @@
           DISABLE(interlacedCheckBox);
           DISABLE(intraRefreshCheckBox);
           DISABLE(noiseReductionSpinBox);
-          DISABLE(mvLengthCheckBox);
-          DISABLE(minThreadBufferCheckBox);
           DISABLE(constrainedIntraCheckBox);
           DISABLE(groupBox_14);
           DISABLE(tab_7);
@@ -363,7 +376,17 @@
           MK_UINT(betaSpinBox,i_deblocking_filter_beta);

           MK_MENU(predictModeComboBox,analyze.direct_mv_pred);
-          MK_UINT(mvRangeSpinBox,analyze.mv_range);
+          MK_UINT(mvRangeSpinBox,analyze.me_range);
+         
+          if(ui.mvLengthCheckBox->isChecked())
+              MK_UINT(mvLengthSpinBox,analyze.mv_range);
+          else
+              myCopy.analyze.mv_range=-1;
+         
+          if(ui.minThreadBufferCheckBox->isChecked())
+              MK_UINT(minThreadBufferSpinBox,analyze.mv_range_thread);
+          else
+              myCopy.analyze.mv_range_thread=-1;

           MK_UINT(psychoRdoSpinBox,analyze.psy_rd);
           MK_UINT(psychoTrellisSpinBox,analyze.psy_trellis);
Index: avidemux_plugins/ADM_videoEncoder/x264/ADM_x264.h
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/ADM_x264.h (revision 8393)
+++ avidemux_plugins/ADM_videoEncoder/x264/ADM_x264.h (working copy)
@@ -71,7 +71,9 @@
     0, /*    uint32_t direct_mv_pred */ \
     0, /*    uint32_t chroma_offset */ \
     0, /*    uint32_t me_method */ \
-    16, /*   uint32_t mv_range */ \
+    16, /*   uint32_t me_range */ \
+    -1, /*   int32_t mv_range */ \
+    -1, /*   int32_t mv_range_thread */ \
     7, /*    uint32_t subpel_refine */ \
     false, /*    bool chroma_me */ \
     false, /*    bool mixed_references */ \
Index: avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_json.cpp
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_json.cpp (revision 8393)
+++ avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_json.cpp (working copy)
@@ -40,7 +40,9 @@
json.addUint32("direct_mv_pred",key->analyze.direct_mv_pred);
json.addUint32("chroma_offset",key->analyze.chroma_offset);
json.addUint32("me_method",key->analyze.me_method);
-json.addUint32("mv_range",key->analyze.mv_range);
+json.addUint32("me_range",key->analyze.me_range);
+json.addInt32("mv_range",key->analyze.mv_range);
+json.addInt32("mv_range_thread",key->analyze.mv_range_thread);
json.addUint32("subpel_refine",key->analyze.subpel_refine);
json.addBool("chroma_me",key->analyze.chroma_me);
json.addBool("mixed_references",key->analyze.mixed_references);
Index: avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_desc.cpp
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_desc.cpp (revision 8393)
+++ avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_desc.cpp (working copy)
@@ -30,7 +30,9 @@
  {"analyze.direct_mv_pred",offsetof(x264_encoder,analyze.direct_mv_pred),"uint32_t",ADM_param_uint32_t},
  {"analyze.chroma_offset",offsetof(x264_encoder,analyze.chroma_offset),"uint32_t",ADM_param_uint32_t},
  {"analyze.me_method",offsetof(x264_encoder,analyze.me_method),"uint32_t",ADM_param_uint32_t},
- {"analyze.mv_range",offsetof(x264_encoder,analyze.mv_range),"uint32_t",ADM_param_uint32_t},
+ {"analyze.me_range",offsetof(x264_encoder,analyze.me_range),"uint32_t",ADM_param_uint32_t},
+ {"analyze.mv_range",offsetof(x264_encoder,analyze.mv_range),"int32_t",ADM_param_int32_t},
+ {"analyze.mv_range_thread",offsetof(x264_encoder,analyze.mv_range_thread),"int32_t",ADM_param_int32_t},
  {"analyze.subpel_refine",offsetof(x264_encoder,analyze.subpel_refine),"uint32_t",ADM_param_uint32_t},
  {"analyze.chroma_me",offsetof(x264_encoder,analyze.chroma_me),"bool",ADM_param_bool},
  {"analyze.mixed_references",offsetof(x264_encoder,analyze.mixed_references),"bool",ADM_param_bool},

KoolAidMan

#1
Also mean, whenever I try to attach the .diff file to the forum, I get the following error (and the attached file is a 404):

An Error Has Occurred!
Your attachment couldn't be saved. This might happen because it took too long to upload or the file is bigger than the server will allow.

Please consult your server administrator for more information.

gruntster