forked from FFmpeg/FFmpeg
Merge commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e'
* commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e': qsvenc: cavlc option is only available for h264 Merged-by: James Almer <jamrial@gmail.com>
This commit is contained in:
commit
dde7b1d485
3 changed files with 13 additions and 10 deletions
|
@ -532,14 +532,6 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
|
|||
if (avctx->codec_id != AV_CODEC_ID_HEVC) {
|
||||
q->extco.Header.BufferId = MFX_EXTBUFF_CODING_OPTION;
|
||||
q->extco.Header.BufferSz = sizeof(q->extco);
|
||||
#if FF_API_CODER_TYPE
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
if (avctx->coder_type != 0)
|
||||
q->cavlc = avctx->coder_type == FF_CODER_TYPE_VLC;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
q->extco.CAVLC = q->cavlc ? MFX_CODINGOPTION_ON
|
||||
: MFX_CODINGOPTION_UNKNOWN;
|
||||
|
||||
q->extco.PicTimingSEI = q->pic_timing_sei ?
|
||||
MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;
|
||||
|
@ -548,6 +540,15 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||
q->extco.RateDistortionOpt = q->rdo > 0 ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
|
||||
|
||||
if (avctx->codec_id == AV_CODEC_ID_H264) {
|
||||
#if FF_API_CODER_TYPE
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
if (avctx->coder_type >= 0)
|
||||
q->cavlc = avctx->coder_type == FF_CODER_TYPE_VLC;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
q->extco.CAVLC = q->cavlc ? MFX_CODINGOPTION_ON
|
||||
: MFX_CODINGOPTION_UNKNOWN;
|
||||
|
||||
if (avctx->strict_std_compliance != FF_COMPLIANCE_NORMAL)
|
||||
q->extco.NalHrdConformance = avctx->strict_std_compliance > FF_COMPLIANCE_NORMAL ?
|
||||
MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
|
||||
|
|
|
@ -70,7 +70,6 @@
|
|||
{ "adaptive_i", "Adaptive I-frame placement", OFFSET(qsv.adaptive_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
|
||||
{ "adaptive_b", "Adaptive B-frame placement", OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
|
||||
{ "b_strategy", "Strategy to choose between I/P/B-frames", OFFSET(qsv.b_strategy), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
|
||||
{ "cavlc", "Enable CAVLC", OFFSET(qsv.cavlc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, \
|
||||
|
||||
typedef int SetEncodeCtrlCB (AVCodecContext *avctx,
|
||||
const AVFrame *frame, mfxEncodeCtrl* enc_ctrl);
|
||||
|
|
|
@ -102,6 +102,7 @@ static av_cold int qsv_enc_close(AVCodecContext *avctx)
|
|||
static const AVOption options[] = {
|
||||
QSV_COMMON_OPTS
|
||||
|
||||
{ "cavlc", "Enable CAVLC", OFFSET(qsv.cavlc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
|
||||
{ "idr_interval", "Distance (in I-frames) between IDR frames", OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
|
||||
{ "pic_timing_sei", "Insert picture timing SEI with pic_struct_syntax element", OFFSET(qsv.pic_timing_sei), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
|
||||
{ "single_sei_nal_unit", "Put all the SEI messages into one NALU", OFFSET(qsv.single_sei_nal_unit), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE },
|
||||
|
@ -154,7 +155,9 @@ static const AVCodecDefault qsv_enc_defaults[] = {
|
|||
// same as the x264 default
|
||||
{ "g", "250" },
|
||||
{ "bf", "3" },
|
||||
{ "coder", "ac" },
|
||||
#if FF_API_CODER_TYPE
|
||||
{ "coder", "-1" },
|
||||
#endif
|
||||
|
||||
{ "flags", "+cgop" },
|
||||
#if FF_API_PRIVATE_OPT
|
||||
|
|
Loading…
Add table
Reference in a new issue