Skip to content

Commit 3cc8fa1

Browse files
ChaoX A Liulizhong1008
authored andcommitted
add the left mfxExtCodingOption param for AVC encode
(cherry picked from commit 76e7b9a0f6f52708ca40a5a89be6e4aacec7b4d3) Signed-off-by: ChaoX A Liu <chaox.a.liu@intel.com> Change-Id: I1c22196e15488096145b20b383bf9d1a4cd3fd79
1 parent ea7c45f commit 3cc8fa1

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

libavcodec/qsvenc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
595595
if (q->recovery_point_sei >= 0)
596596
q->extco.RecoveryPointSEI = q->recovery_point_sei ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
597597
q->extco.MaxDecFrameBuffering = q->max_dec_frame_buffering;
598+
599+
q->extco.ResetRefList = q->reset_reflist ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
600+
q->extco.RefPicMarkRep = q->ref_pic_mark_rep ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
601+
q->extco.FieldOutput = q->field_output ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
602+
q->extco.AUDelimiter = q->audelimiter ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
603+
q->extco.VuiNalHrdParameters = q->vui_nal_hrd_parameters ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
604+
q->extco.FramePicture = q->frame_picture ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
605+
598606
}
599607

600608
q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extco;

libavcodec/qsvenc.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ typedef struct QSVEncContext {
141141
int max_frame_size;
142142
int max_slice_size;
143143

144+
// options for mfxExtCodingOption
145+
int reset_reflist;
146+
int ref_pic_mark_rep;
147+
int field_output;
148+
int audelimiter;
149+
int vui_nal_hrd_parameters;
150+
int frame_picture;
151+
144152
int maxQPI;
145153
int minQPI;
146154
int maxQPP;

libavcodec/qsvenc_h264.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ static const AVOption options[] = {
122122
{ "4x" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_LOOKAHEAD_DS_4x }, INT_MIN, INT_MAX, VE, "look_ahead_downsampling" },
123123
#endif
124124

125+
{ "resetreflist", "Set this flag to reset the reference list to non-IDR I-frames of a GOP sequence", OFFSET(qsv.reset_reflist), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
126+
{ "refpicmarkrep", "Set this flag to write the reference picture marking repetition SEI message into the output bitstream", OFFSET(qsv.ref_pic_mark_rep), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
127+
{ "fieldoutput", "Set this flag to instruct the AVC encoder to output bitstreams immediately after the encoder encodes a field", OFFSET(qsv.field_output), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
128+
{ "audelimiter", "Set this flag to insert the Access Unit Delimiter NAL", OFFSET(qsv.audelimiter), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
129+
{ "vuinalhrdparam", "Set this flag to insert NAL HRD parameters in the VUI header", OFFSET(qsv.vui_nal_hrd_parameters), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
130+
{ "framepicture", "Set this flag to encode interlaced fields as interlaced frames", OFFSET(qsv.frame_picture), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
131+
125132
{ "int_ref_type", "Intra refresh type", OFFSET(qsv.int_ref_type), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT16_MAX, VE, "int_ref_type" },
126133
{ "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, .flags = VE, "int_ref_type" },
127134
{ "vertical", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, .flags = VE, "int_ref_type" },

0 commit comments

Comments
 (0)