[FFmpeg-cvslog] avcodec/libx264: add avcintra-class

Michael Niedermayer git at videolan.org
Wed Oct 1 16:40:23 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Oct  1 16:19:45 2014 +0200| [0a7afedc4819167a50516a4402a4638c7439df6e] | committer: Michael Niedermayer

avcodec/libx264: add avcintra-class

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0a7afedc4819167a50516a4402a4638c7439df6e
---

 doc/encoders.texi    |    4 ++++
 libavcodec/libx264.c |    7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 44b49ce..d67bf89 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1745,6 +1745,10 @@ Enable calculation and printing SSIM stats after the encoding.
 Enable the use of Periodic Intra Refresh instead of IDR frames when set
 to 1.
 
+ at item avcintra-class (@emph{class})
+Configure the encoder to generate AVC-Intra.
+Valid values are 50,100 and 200
+
 @item bluray-compat (@emph{bluray-compat})
 Configure the encoder to be compatible with the bluray standard.
 It is a shorthand for setting "bluray-compat=1 force-cfr=1".
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index add3d98..7839248 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -80,6 +80,7 @@ typedef struct X264Context {
     int slice_max_size;
     char *stats;
     int nal_hrd;
+    int avcintra_class;
     char *x264_params;
 } X264Context;
 
@@ -183,6 +184,8 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
             frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
             frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
                                             X264_TYPE_AUTO;
+
+        if (x4->avcintra_class < 0) {
         if (x4->params.b_interlaced && x4->params.b_tff != frame->top_field_first) {
             x4->params.b_tff = frame->top_field_first;
             x264_encoder_reconfig(x4->enc, &x4->params);
@@ -226,6 +229,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
             x4->params.rc.f_rf_constant_max = x4->crf_max;
             x264_encoder_reconfig(x4->enc, &x4->params);
         }
+        }
 
         side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_STEREO3D);
         if (side_data) {
@@ -528,6 +532,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
         x4->params.b_bluray_compat = x4->bluray_compat;
         x4->params.b_vfr_input = 0;
     }
+    if (x4->avcintra_class >= 0)
+        x4->params.i_avcintra_class = x4->avcintra_class;
     if (x4->b_bias != INT_MIN)
         x4->params.i_bframe_bias              = x4->b_bias;
     if (x4->b_pyramid >= 0)
@@ -805,6 +811,7 @@ static const AVOption options[] = {
     { "none",          NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_NONE}, INT_MIN, INT_MAX, VE, "nal-hrd" },
     { "vbr",           NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_VBR},  INT_MIN, INT_MAX, VE, "nal-hrd" },
     { "cbr",           NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_CBR},  INT_MIN, INT_MAX, VE, "nal-hrd" },
+    { "avcintra-class","AVC-Intra class 50/100/200",                      OFFSET(avcintra_class),AV_OPT_TYPE_INT,     { .i64 = -1 }, -1, 200   , VE},
     { "x264-params",  "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
     { NULL },
 };



More information about the ffmpeg-cvslog mailing list