[FFmpeg-devel] [PATCH] x264 pure interlaced mode config

Limin Wang lance.lmwang
Mon Jul 2 12:38:27 CEST 2007


Hi,

$subj, please review it.


Thanks,
Limin
-------------- next part --------------
Index: libavcodec/utils.c
===================================================================
--- libavcodec/utils.c	(revision 9458)
+++ libavcodec/utils.c	(working copy)
@@ -729,6 +729,7 @@
 {"timecode_frame_start", "GOP timecode frame start number, in non drop frame format", OFFSET(timecode_frame_start), FF_OPT_TYPE_INT, 0, 0, INT_MAX, V|E},
 {"drop_frame_timecode", NULL, 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_DROP_FRAME_TIMECODE, INT_MIN, INT_MAX, V|E, "flags2"},
 {"non_linear_q", "use non linear quantizer", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_NON_LINEAR_QUANT, INT_MIN, INT_MAX, V|E, "flags2"},
+{"interlaced", "Enable pure-interlaced mode (H.264)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_INTERLACED, INT_MIN, INT_MAX, V|E, "flags2"},
 {NULL},
 };
 
Index: libavcodec/libx264.c
===================================================================
--- libavcodec/libx264.c	(revision 9458)
+++ libavcodec/libx264.c	(working copy)
@@ -160,6 +160,7 @@
     // we do it this way because we cannot check if the bitrate has been set
     if(!(avctx->crf || (avctx->cqp > -1))) x4->params.rc.i_rc_method = X264_RC_ABR;
 
+    x4->params.b_interlaced = (avctx->flags2 & CODEC_FLAG2_INTERLACED);
     x4->params.i_bframe = avctx->max_b_frames;
     x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC;
     x4->params.b_bframe_adaptive = avctx->b_frame_strategy;
Index: libavcodec/avcodec.h
===================================================================
--- libavcodec/avcodec.h	(revision 9458)
+++ libavcodec/avcodec.h	(working copy)
@@ -406,6 +406,7 @@
 #define CODEC_FLAG2_SKIP_RD       0x00004000 ///< RD optimal MB level residual skipping
 #define CODEC_FLAG2_CHUNKS        0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
 #define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
+#define CODEC_FLAG2_INTERLACED       0x00020000 ///< H.264 pure interlaced mode.
 
 /* Unsupported options :
  *              Syntax Arithmetic coding (SAC)



More information about the ffmpeg-devel mailing list