News:

--

Main Menu

2.6/2.7 x264 Settings Patch

Started by KoolAidMan, December 18, 2012, 04:44:52 AM

Previous topic - Next topic

KoolAidMan

This patch makes the following changes to the Avidemux X264 encoding plugin for versions 2.6 and 2.7:

Fixed the following settings which were either greyed out previously, or not working:

  • Custom pixel aspect ratio
  • Predefined pixel aspect ratio
  • Maximum motion vector search range
  • Psychovisual rate distortion optimization
  • Psychovisual trellis
  • Intra luma quantization deadzone
  • Inter luma quantization deadzone
  • Loop filter
  • Loop filter strength
  • Loop filter threshold
  • I-frame threshold
  • Adaptive quantization
  • Variance AQ
  • AQ strength

The following settings are now greyed out in the UI, as they are still not currently working:

  • Pixel aspect ratio as input
  • Maximum motion vector length
  • Minimum buffer between threads
  • Generate access unit delimeters

Miscellaneous:

  • Added logic which prompts the user when they are attempting to disable adaptive quantization while macroblock-tree rate control is still active, as this behavior is disallowed.
  • Uncommented logic which prompts the user when they are attempting to enable macroblock-tree rate control while adaptive quantization is not currently enabled, as this behavior is also disallowed.
  • Fixed a bug where if the IDC level was set to auto, the video would always fail to encode.
  • Fixed a bug in x264Setup where the unused floating point #Defines were dividing by 100, causing various settings (psy_trellis, psy_rdo, aq_strength) to be significantly smaller than they should have been when they were set to a positive, non-zero value.
  • Fixed some logging issues where floating points were being cast to ints, often causing them to display as 0.
  • Added luma quantization (inter and intra) to the x264 setup logging
  • Added i_scenecut_threshold, mv_range, psy_rd, psy_trellis, intra_luma, and inter_luma to the json settings serialization


Index: avidemux_plugins/ADM_videoEncoder/x264/ADM_x264Setup.cpp
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/ADM_x264Setup.cpp (revision 8315)
+++ avidemux_plugins/ADM_videoEncoder/x264/ADM_x264Setup.cpp (working copy)
@@ -89,11 +89,12 @@
         }
     }
#define MKPARAM(x,y) {param.x = x264Settings.y;aprintf("[x264] "#x" = %d\n",param.x);}
-#define MKPARAMF(x,y) {param.x = (float)x264Settings.y / 100; aprintf("[x264] "#x" = %.2f\n",param.x);}
+#define MKPARAMF(x,y) {param.x = (float)x264Settings.y; aprintf("[x264] "#x" = %.2f\n",param.x);}
#define MKPARAMB(x,y) {param.x = x264Settings.y ;aprintf("[x264] "#x" = %s\n",TrueFalse[param.x&1]);}
   MKPARAM(i_frame_reference,MaxRefFrames);
   MKPARAM(i_keyint_min,MinIdr);
   MKPARAM(i_keyint_max,MaxIdr);
+  MKPARAM(i_scenecut_threshold,i_scenecut_threshold);
   MKPARAM(i_bframe,MaxBFrame);

   MKPARAM(i_bframe_adaptive,i_bframe_adaptive);
@@ -107,12 +108,23 @@
   }
   MKPARAMB(b_cabac,cabac);
   MKPARAMB(b_interlaced,interlaced);
+
+  // -------------- vui------------
+#undef MKPARAM
+#undef MKPARAMF
+#undef MKPARAMB
+#define MKPARAM(x,y) {param.vui.x = x264Settings.vui.y;aprintf("[x264] vui."#x" = %d\n",param.vui.x);}
+#define MKPARAMF(x,y) {param.vui.x = (float)x264Settings.vui.y; aprintf("[x264] vui."#x" = %.2f\n",param.vui.x);}
+#define MKPARAMB(x,y) {param.vui.x = x264Settings.vui.y ;aprintf("[x264] vui."#x" = %s\n",TrueFalse[param.vui.x&1]);}
+   MKPARAM (i_sar_width,sar_width)
+   MKPARAM (i_sar_height,sar_height)
+
   // -------------- analyze------------
#undef MKPARAM
#undef MKPARAMF
#undef MKPARAMB
#define MKPARAM(x,y) {param.analyse.x = x264Settings.analyze.y;aprintf("[x264] analyse."#x" = %d\n",param.analyse.x);}
-#define MKPARAMF(x,y) {param.analyse.x = (float)x264Settings.analyze.y / 100; aprintf("[x264] analyse."#x" = %.2f\n",param.analyse.x);}
+#define MKPARAMF(x,y) {param.analyse.x = (float)x264Settings.analyze.y; aprintf("[x264] analyse."#x" = %.2f\n",param.analyse.x);}
#define MKPARAMB(x,y) {param.analyse.x = x264Settings.analyze.y ;aprintf("[x264] analyse."#x" = %s\n",TrueFalse[param.analyse.x&1]);}
#define MKFLAGS(fieldout,fieldin,mask) {if(x264Settings.analyze.fieldin) param.analyse.fieldout|=mask;}
    MKPARAMB(b_transform_8x8,b_8x8)
@@ -120,6 +132,7 @@
    MKPARAM (i_weighted_pred,weighted_pred)
    MKPARAM (i_direct_mv_pred,direct_mv_pred)
    MKPARAM (i_me_method,me_method)
+   MKPARAM (i_mv_range,mv_range)
    MKPARAM (i_subpel_refine,subpel_refine)
    MKPARAMB(b_chroma_me,chroma_me)
    MKPARAMB(b_mixed_references,mixed_references)
@@ -127,6 +140,10 @@
    MKPARAMB(b_fast_pskip,fast_pskip)
    MKPARAMB(b_dct_decimate,dct_decimate)
    MKPARAMB(b_psy,psy)
+   MKPARAMF(f_psy_rd,psy_rd)
+   MKPARAMF(f_psy_trellis,psy_trellis)
+   MKPARAM (i_luma_deadzone[0],inter_luma)
+   MKPARAM (i_luma_deadzone[1],intra_luma)

    MKFLAGS(inter,b_i4x4,X264_ANALYSE_I4x4)
    MKFLAGS(inter,b_i8x8,X264_ANALYSE_I8x8)
@@ -139,11 +156,13 @@
#undef MKPARAMF
#undef MKPARAMB
#define MKPARAM(x,y)  {param.rc.x = x264Settings.ratecontrol.y;aprintf("[x264] rc."#x" = %d\n",param.rc.x);}
-#define MKPARAMF(x,y) {param.rc.x = (float)x264Settings.ratecontrol.y / 100; aprintf("[x264] rc."#x" = %.2f\n",param.rc.x);}
+#define MKPARAMF(x,y) {param.rc.x = (float)x264Settings.ratecontrol.y; aprintf("[x264] rc."#x" = %.2f\n",param.rc.x);}
#define MKPARAMB(x,y) {param.rc.x = x264Settings.ratecontrol.y ;aprintf("[x264] rc."#x" = %s\n",TrueFalse[param.rc.x&1]);}

     MKPARAMB(b_mb_tree,mb_tree);
     MKPARAM(i_lookahead,lookahead);
+    MKPARAM(i_aq_mode,aq_mode);
+    MKPARAMF(f_aq_strength,aq_strength);
   // -------------------------
   

@@ -319,6 +338,7 @@
     PI(b_constrained_intra);

#define AI(x) printf(#x"\t:%d\n",(int)param->analyse.x);
+#define AF(x) printf(#x"\t:%f\n",(float)param->analyse.x);
     printf("*************************************\n");
     printf("*********     Analyse       *********\n");
     printf("*************************************\n");
@@ -343,8 +363,8 @@

     AI(b_dct_decimate);
     AI(i_noise_reduction);
-    AI(f_psy_rd);
-    AI(f_psy_trellis);
+    AF(f_psy_rd);
+    AF(f_psy_trellis);
     AI(b_psy);

     PI(b_aud);
@@ -352,6 +372,8 @@
     PI(b_annexb);
     PI(b_vfr_input);
     
+    AI(i_luma_deadzone[0]);
+    AI(i_luma_deadzone[1]);

     PI(i_sps_id);

Index: avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.h
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.h (revision 8315)
+++ avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.h (working copy)
@@ -15,6 +15,7 @@
uint32_t MaxRefFrames;
uint32_t MinIdr;
uint32_t MaxIdr;
+uint32_t i_scenecut_threshold;
uint32_t MaxBFrame;
uint32_t i_bframe_adaptive;
uint32_t i_bframe_bias;
@@ -36,14 +37,19 @@
uint32_t direct_mv_pred;
uint32_t chroma_offset;
uint32_t me_method;
+ uint32_t mv_range;
uint32_t subpel_refine;
bool chroma_me;
bool mixed_references;
uint32_t trellis;
+ float psy_rd;
+ float psy_trellis;
bool fast_pskip;
bool dct_decimate;
uint32_t noise_reduction;
bool psy;
+ uint32_t intra_luma;
+ uint32_t inter_luma;
}analyze;
struct  {
uint32_t rc_method;
Index: avidemux_plugins/ADM_videoEncoder/x264/ADM_x264.h
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/ADM_x264.h (revision 8315)
+++ avidemux_plugins/ADM_videoEncoder/x264/ADM_x264.h (working copy)
@@ -50,6 +50,7 @@
     2, /* uint32_t MaxRefFrames */ \
     100, /* uint32_t MinIdr */ \
     500, /* uint32_t MaxIdr */ \
+    40, /* uint32_t i_scenecut_threshold */ \
     2, /* uint32_t MaxBFrame */ \
     0, /* uint32_t i_bframe_adaptative */ \
     0, /* uint32_t i_bframe_bias */ \
@@ -70,14 +71,19 @@
     0, /*    uint32_t direct_mv_pred */ \
     0, /*    uint32_t chroma_offset */ \
     0, /*    uint32_t me_method */ \
+    16, /*   uint32_t mv_range */ \
     7, /*    uint32_t subpel_refine */ \
     false, /*    bool chroma_me */ \
     false, /*    bool mixed_references */ \
     1, /*    uint32_t trellis */ \
+    0.0, /*     float psy_rd */ \
+    0.0, /*     float psy_trellis */ \
     true, /*    bool fast_pskip */ \
     false, /*    bool dct_decimate */ \
     0, /*    uint32_t noise_reduction */ \
     true, /*    bool psy */ \
+    21, /*   uint32_t intra_luma */ \
+    21, /*   uint32_t inter_luma */ \
}

/**
Index: avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_json.cpp
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_json.cpp (revision 8315)
+++ avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_json.cpp (working copy)
@@ -2,7 +2,7 @@
#include "ADM_default.h"
#include "ADM_paramList.h"
#include "ADM_coreJson.h"
-#include "x264_encoder.h"
+#include "../avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.h"
bool  x264_encoder_jserialize(const char *file, const x264_encoder *key){
admJson json;
json.addNode("general");
@@ -18,6 +18,7 @@
json.addUint32("MaxRefFrames",key->MaxRefFrames);
json.addUint32("MinIdr",key->MinIdr);
json.addUint32("MaxIdr",key->MaxIdr);
+json.addUint32("i_scenecut_threshold",key->i_scenecut_threshold);
json.addUint32("MaxBFrame",key->MaxBFrame);
json.addUint32("i_bframe_adaptive",key->i_bframe_adaptive);
json.addUint32("i_bframe_bias",key->i_bframe_bias);
@@ -39,14 +40,19 @@
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("subpel_refine",key->analyze.subpel_refine);
json.addBool("chroma_me",key->analyze.chroma_me);
json.addBool("mixed_references",key->analyze.mixed_references);
json.addUint32("trellis",key->analyze.trellis);
+json.addFloat("psy_rd",key->analyze.psy_rd);
+json.addFloat("psy_trellis",key->analyze.psy_trellis);
json.addBool("fast_pskip",key->analyze.fast_pskip);
json.addBool("dct_decimate",key->analyze.dct_decimate);
json.addUint32("noise_reduction",key->analyze.noise_reduction);
json.addBool("psy",key->analyze.psy);
+json.addUint32("intra_luma",key->analyze.intra_luma);
+json.addUint32("inter_luma",key->analyze.inter_luma);
json.endNode();
json.addNode("ratecontrol");
json.addUint32("rc_method",key->ratecontrol.rc_method);
Index: avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.conf
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.conf (revision 8315)
+++ avidemux_plugins/ADM_videoEncoder/x264/x264_encoder.conf (working copy)
@@ -12,6 +12,7 @@
uint32_t:MaxRefFrames;
uint32_t:MinIdr;
uint32_t:MaxIdr;
+uint32_t:i_scenecut_threshold;
uint32_t:MaxBFrame;
uint32_t:i_bframe_adaptive;
uint32_t:i_bframe_bias;
@@ -33,14 +34,19 @@
uint32_t:direct_mv_pred;
uint32_t:chroma_offset;
uint32_t:me_method;
+uint32_t:mv_range;
uint32_t:subpel_refine;
bool:chroma_me;
bool:mixed_references;
uint32_t:trellis;
+float:psy_rd;
+float:psy_trellis;
bool:fast_pskip;
bool:dct_decimate;
uint32_t:noise_reduction;
bool:psy;
+uint32_t:intra_luma;
+uint32_t:inter_luma;
} // analyze
ratecontrol{
uint32_t:rc_method;
Index: avidemux_plugins/ADM_videoEncoder/x264/qt4/Q_x264.h
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/qt4/Q_x264.h (revision 8315)
+++ avidemux_plugins/ADM_videoEncoder/x264/qt4/Q_x264.h (working copy)
@@ -36,6 +36,9 @@
         void quantiserSlider_valueChanged(int value);
         void quantiserSpinBox_valueChanged(int value);
         void targetRateControlSpinBox_valueChanged(int value);
+        void loopFilterCheckBox_toggled(bool checked);
+        void mbTreeCheckBox_toggled(bool checked);
+        void aqVarianceCheckBox_toggled(bool checked);

         void configurationComboBox_currentIndexChanged(int index);
         void saveAsButton_pressed(void);
@@ -47,7 +50,6 @@
#if 0
         void maxCrfSlider_valueChanged(int value);
         void maxCrfSpinBox_valueChanged(int value);
-        void mbTreeCheckBox_toggled(bool checked);
#endif

};

KoolAidMan

#1
Continuation of the patch above, as it was greater than 20,000 characters and too long to fit in one post.


Index: avidemux_plugins/ADM_videoEncoder/x264/qt4/Q_x264.cpp
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/qt4/Q_x264.cpp (revision 8315)
+++ avidemux_plugins/ADM_videoEncoder/x264/qt4/Q_x264.cpp (working copy)
@@ -38,7 +38,7 @@
}idcToken;

static const idcToken listOfIdc[]={
-        {0,"Auto"},
+        {-1,"Auto"},
         {10,"1"},
         {11,"1.1"},
         {12,"1.2"},
@@ -57,6 +57,22 @@

};
#define NB_IDC sizeof(listOfIdc)/sizeof(idcToken)
+
+typedef struct
+{
+    uint32_t sarWidth;
+    uint32_t sarHeight;
+}aspectRatio;
+
+static const aspectRatio predefinedARs[]={
+    {16,15},
+    {64,45},
+    {8,9},
+    {32,27},
+   
+};
+
+#define NB_SAR sizeof(predefinedARs)/sizeof(aspectRatio)
/**
     \fn x264_ui
     \brief hook to enter UI specific dialog
@@ -91,10 +107,12 @@
         connect(ui.quantiserSpinBox, SIGNAL(valueChanged(int)), this, SLOT(quantiserSpinBox_valueChanged(int)));
         connect(ui.meSpinBox, SIGNAL(valueChanged(int)), this, SLOT(meSpinBox_valueChanged(int)));
         connect(ui.targetRateControlSpinBox, SIGNAL(valueChanged(int)), this, SLOT(targetRateControlSpinBox_valueChanged(int)));
+        connect(ui.loopFilterCheckBox, SIGNAL(toggled(bool)), this, SLOT(loopFilterCheckBox_toggled(bool)));
+        connect(ui.mbTreeCheckBox, SIGNAL(toggled(bool)), this, SLOT(mbTreeCheckBox_toggled(bool)));
+        connect(ui.aqVarianceCheckBox, SIGNAL(toggled(bool)), this, SLOT(aqVarianceCheckBox_toggled(bool)));
#if 0
         connect(ui.maxCrfSlider, SIGNAL(valueChanged(int)), this, SLOT(maxCrfSlider_valueChanged(int)));
         connect(ui.maxCrfSpinBox, SIGNAL(valueChanged(int)), this, SLOT(maxCrfSpinBox_valueChanged(int)));
-        connect(ui.mbTreeCheckBox, SIGNAL(toggled(bool)), this, SLOT(mbTreeCheckBox_toggled(bool)));
#endif
        memcpy(&myCopy,param,sizeof(myCopy));
#define ENCODING(x)  myCopy.general.params.x       
@@ -148,6 +166,7 @@
#define MK_UINT(x,y)  ui.x->setValue(myCopy.y)
#define DISABLE(x) ui.x->setEnabled(false);
#define MK_MENU(x,y) ui.x->setCurrentIndex(myCopy.y)
+#define MK_RADIOBUTTON(x) ui.x->setChecked(true);
bool x264Dialog::upload(void)
{
           
@@ -161,6 +180,10 @@
           MK_CHECKBOX(p8x8CheckBox,analyze.b_p16x16);
           MK_CHECKBOX(b8x8CheckBox,analyze.b_b16x16);
           MK_CHECKBOX(trellisCheckBox,analyze.trellis);
+          MK_UINT(psychoRdoSpinBox,analyze.psy_rd);
+          MK_UINT(psychoTrellisSpinBox,analyze.psy_trellis);
+          MK_UINT(intraLumaSpinBox,analyze.intra_luma);
+          MK_UINT(interLumaSpinBox,analyze.inter_luma);
           if(myCopy.analyze.trellis)
           {
                 ui.trellisComboBox->setCurrentIndex(myCopy.analyze.trellis-1);
@@ -176,11 +199,23 @@
           MK_UINT(refFramesSpinBox,MaxRefFrames);
           MK_UINT(minGopSizeSpinBox,MinIdr);
           MK_UINT(maxGopSizeSpinBox,MaxIdr);
+          MK_UINT(IFrameThresholdSpinBox,i_scenecut_threshold);
           MK_UINT(meSpinBox,analyze.subpel_refine);

+          uint32_t aq_mode = myCopy.ratecontrol.aq_mode;
+          if (aq_mode > 0)
+          {
+                ui.aqVarianceCheckBox->setChecked(true);
+                ui.aqAlgoComboBox->setCurrentIndex(aq_mode-1);
+                MK_UINT(aqStrengthSpinBox,ratecontrol.aq_strength);
+          }
+
           MK_UINT(lookaheadSpinBox,ratecontrol.lookahead);
           MK_CHECKBOX(mbTreeCheckBox,ratecontrol.mb_tree);
           
+          MK_CHECKBOX(loopFilterCheckBox,b_deblocking_filter);
+          MK_UINT(alphaC0SpinBox,i_deblocking_filter_alphac0);
+          MK_UINT(betaSpinBox,i_deblocking_filter_beta);

           MK_MENU(meMethodComboBox,analyze.me_method);
           MK_MENU(weightedPPredictComboBox,analyze.weighted_pred);
@@ -188,6 +223,7 @@
           MK_MENU(adaptiveBFrameComboBox,i_bframe_adaptive);

           MK_MENU(predictModeComboBox,analyze.direct_mv_pred);
+          MK_UINT(mvRangeSpinBox,analyze.mv_range);

           // udate idc
           QComboBox *idc=ui.idcLevelComboBox;
@@ -231,34 +267,52 @@
             default: ADM_assert(0);break;
         }

+        bool predefined = false;

-          DISABLE(loopFilterCheckBox);
+        for (int i= 0;i<NB_SAR;i++)
+ {
+                if (myCopy.vui.sar_width == predefinedARs[i].sarWidth && myCopy.vui.sar_height == predefinedARs[i].sarHeight)
+                {
+                     MK_RADIOBUTTON(sarPredefinedRadioButton);
+                     ui.sarPredefinedComboBox->setCurrentIndex(i);
+                     predefined = true;
+                     break;
+                }
+ }
+
+ if (!predefined)
+ {
+                MK_RADIOBUTTON(sarCustomRadioButton);
+                MK_UINT(sarCustomSpinBox1,vui.sar_width);
+                MK_UINT(sarCustomSpinBox2,vui.sar_height);
+ }
+
           DISABLE(openGopCheckBox);
           DISABLE(interlacedCheckBox);
           DISABLE(intraRefreshCheckBox);
           DISABLE(noiseReductionSpinBox);
-          DISABLE(mvRangeSpinBox);
-          DISABLE(mvLengthSpinBox);
-          DISABLE(minThreadBufferSpinBox);
+          DISABLE(mvLengthCheckBox);
+          DISABLE(minThreadBufferCheckBox);
           DISABLE(constrainedIntraCheckBox);
-          DISABLE(IFrameThresholdSpinBox);
-          DISABLE(intraLumaSpinBox);
-          DISABLE(interLumaSpinBox);
           DISABLE(groupBox_14);
           DISABLE(tab_7);
-          DISABLE(tab_6);
           DISABLE(tab_9);
           DISABLE(tab);
           DISABLE(maxCrfCheckBox);
-          DISABLE(psychoRdoSpinBox);
+          DISABLE(sarAsInputRadioButton);
+          DISABLE(groupBox_4);
+          DISABLE(groupBox_3);
+          DISABLE(accessUnitCheckBox);
           return true;
}
#undef MK_CHECKBOX
#undef MK_UINT
#undef MK_MENU
+#undef MK_RADIOBUTTON
#define MK_CHECKBOX(x,y)    myCopy.y=ui.x->isChecked()
#define MK_UINT(x,y)        myCopy.y=ui.x->value()
#define MK_MENU(x,y)        myCopy.y=ui.x->currentIndex()
+#define MK_RADIOBUTTON(x,y)   myCopy.y=ui.x->setChecked(true);
bool x264Dialog::download(void)
{
           MK_CHECKBOX(fastFirstPassCheckBox,general.fast_first_pass);
@@ -281,6 +335,7 @@
           MK_UINT(refFramesSpinBox,MaxRefFrames);
           MK_UINT(minGopSizeSpinBox,MinIdr);
           MK_UINT(maxGopSizeSpinBox,MaxIdr);
+          MK_UINT(IFrameThresholdSpinBox,i_scenecut_threshold);
           MK_UINT(meSpinBox,analyze.subpel_refine);
           MK_UINT(BFrameBiasSpinBox,i_bframe_bias);

@@ -289,11 +344,31 @@
           MK_MENU(bFrameRefComboBox,i_bframe_pyramid);
           MK_MENU(adaptiveBFrameComboBox,i_bframe_adaptive);

+          int a=ui.aqAlgoComboBox->currentIndex();
+          if(!ui.aqVarianceCheckBox->isChecked())
+          {
+                myCopy.ratecontrol.aq_mode=0;
+          }else
+          {
+                myCopy.ratecontrol.aq_mode=a+1;
+                MK_UINT(aqStrengthSpinBox,ratecontrol.aq_strength);
+          }
+         
           MK_UINT(lookaheadSpinBox,ratecontrol.lookahead);
           MK_CHECKBOX(mbTreeCheckBox,ratecontrol.mb_tree);

+          MK_CHECKBOX(loopFilterCheckBox,b_deblocking_filter);
+          MK_UINT(alphaC0SpinBox,i_deblocking_filter_alphac0);
+          MK_UINT(betaSpinBox,i_deblocking_filter_beta);
+
           MK_MENU(predictModeComboBox,analyze.direct_mv_pred);
+          MK_UINT(mvRangeSpinBox,analyze.mv_range);

+          MK_UINT(psychoRdoSpinBox,analyze.psy_rd);
+          MK_UINT(psychoTrellisSpinBox,analyze.psy_trellis);
+          MK_UINT(intraLumaSpinBox,analyze.intra_luma);
+          MK_UINT(interLumaSpinBox,analyze.inter_luma);
+         
           QComboBox *idc=ui.idcLevelComboBox;
           int dex=idc->currentIndex();
           ADM_assert(dex<NB_IDC);
@@ -315,6 +390,17 @@
           }else
                 myCopy.analyze.trellis=t+1;

+          if(ui.sarPredefinedRadioButton->isChecked())
+          {
+                const aspectRatio *r=predefinedARs+ui.sarPredefinedComboBox->currentIndex();
+                myCopy.vui.sar_width=r->sarWidth;
+                myCopy.vui.sar_height=r->sarHeight;
+          }else
+          {
+                MK_UINT(sarCustomSpinBox1,vui.sar_width);
+                MK_UINT(sarCustomSpinBox2,vui.sar_height);
+          }
+
           return true;
}

@@ -392,20 +478,19 @@
else
lastBitrate = value;
}
-#if 0
-void x264Dialog::maxCrfSlider_valueChanged(int value)
-{
- ui.maxCrfSpinBox->setValue(value);
-}

-void x264Dialog::maxCrfSpinBox_valueChanged(int value)
+void x264Dialog::loopFilterCheckBox_toggled(bool checked)
{
- ui.maxCrfSlider->setValue(value);
+ if (!checked)
+ {
+                ui.alphaC0SpinBox->setValue(0);
+                ui.betaSpinBox->setValue(0);
+ }
}

void x264Dialog::mbTreeCheckBox_toggled(bool checked)
{
- if (!disableGenericSlots && checked && !ui.aqVarianceCheckBox->isChecked())
+ if (checked && !ui.aqVarianceCheckBox->isChecked())
{
if (GUI_Question(tr("Macroblock-Tree optimisation requires Variance Adaptive Quantisation to be enabled.  Variance Adaptive Quantisation will automatically be enabled.\n\nDo you wish to continue?").toUtf8().constData()))
ui.aqVarianceCheckBox->setChecked(true);
@@ -413,6 +498,27 @@
ui.mbTreeCheckBox->setChecked(false);
}
}
+
+void x264Dialog::aqVarianceCheckBox_toggled(bool checked)
+{
+ if (!checked && ui.mbTreeCheckBox->isChecked())
+ {
+ if (GUI_Question(tr("Macroblock-Tree optimisation requires Variance Adaptive Quantisation to be enabled.  Macroblock-Tree optimisation will automatically be disabled.\n\nDo you wish to continue?").toUtf8().constData()))
+ ui.mbTreeCheckBox->setChecked(false);
+ else
+ ui.aqVarianceCheckBox->setChecked(true);
+ }
+}
+#if 0
+void x264Dialog::maxCrfSlider_valueChanged(int value)
+{
+ ui.maxCrfSpinBox->setValue(value);
+}
+
+void x264Dialog::maxCrfSpinBox_valueChanged(int value)
+{
+ ui.maxCrfSlider->setValue(value);
+}
#endif

/**
Index: avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_desc.cpp
===================================================================
--- avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_desc.cpp (revision 8315)
+++ avidemux_plugins/ADM_videoEncoder/x264/x264_encoder_desc.cpp (working copy)
@@ -9,6 +9,7 @@
  {"MaxRefFrames",offsetof(x264_encoder,MaxRefFrames),"uint32_t",ADM_param_uint32_t},
  {"MinIdr",offsetof(x264_encoder,MinIdr),"uint32_t",ADM_param_uint32_t},
  {"MaxIdr",offsetof(x264_encoder,MaxIdr),"uint32_t",ADM_param_uint32_t},
+ {"i_scenecut_threshold",offsetof(x264_encoder,i_scenecut_threshold),"uint32_t",ADM_param_uint32_t},
  {"MaxBFrame",offsetof(x264_encoder,MaxBFrame),"uint32_t",ADM_param_uint32_t},
  {"i_bframe_adaptive",offsetof(x264_encoder,i_bframe_adaptive),"uint32_t",ADM_param_uint32_t},
  {"i_bframe_bias",offsetof(x264_encoder,i_bframe_bias),"uint32_t",ADM_param_uint32_t},
@@ -29,14 +30,19 @@
  {"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.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},
  {"analyze.trellis",offsetof(x264_encoder,analyze.trellis),"uint32_t",ADM_param_uint32_t},
+ {"analyze.psy_rd",offsetof(x264_encoder,analyze.psy_rd),"float",ADM_param_float},
+ {"analyze.psy_trellis",offsetof(x264_encoder,analyze.psy_trellis),"float",ADM_param_float},
  {"analyze.fast_pskip",offsetof(x264_encoder,analyze.fast_pskip),"bool",ADM_param_bool},
  {"analyze.dct_decimate",offsetof(x264_encoder,analyze.dct_decimate),"bool",ADM_param_bool},
  {"analyze.noise_reduction",offsetof(x264_encoder,analyze.noise_reduction),"uint32_t",ADM_param_uint32_t},
  {"analyze.psy",offsetof(x264_encoder,analyze.psy),"bool",ADM_param_bool},
+ {"analyze.intra_luma",offsetof(x264_encoder,analyze.intra_luma),"uint32_t",ADM_param_uint32_t},
+ {"analyze.inter_luma",offsetof(x264_encoder,analyze.inter_luma),"uint32_t",ADM_param_uint32_t},
  {"ratecontrol.rc_method",offsetof(x264_encoder,ratecontrol.rc_method),"uint32_t",ADM_param_uint32_t},
  {"ratecontrol.qp_constant",offsetof(x264_encoder,ratecontrol.qp_constant),"uint32_t",ADM_param_uint32_t},
  {"ratecontrol.qp_min",offsetof(x264_encoder,ratecontrol.qp_min),"uint32_t",ADM_param_uint32_t},

mean


steginger

Hi,

interlaced x264 encoding seems to be still greyed out even with this patch... is that on purpose or just missing?
In 2.5.? it seemed to work...


Regards,
steginger