* commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e':
qsvenc: cavlc option is only available for h264
Merged-by: James Almer <jamrial@gmail.com>
... | ... |
@@ -532,14 +532,6 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) |
532 | 532 |
if (avctx->codec_id != AV_CODEC_ID_HEVC) { |
533 | 533 |
q->extco.Header.BufferId = MFX_EXTBUFF_CODING_OPTION; |
534 | 534 |
q->extco.Header.BufferSz = sizeof(q->extco); |
535 |
-#if FF_API_CODER_TYPE |
|
536 |
-FF_DISABLE_DEPRECATION_WARNINGS |
|
537 |
- if (avctx->coder_type != 0) |
|
538 |
- q->cavlc = avctx->coder_type == FF_CODER_TYPE_VLC; |
|
539 |
-FF_ENABLE_DEPRECATION_WARNINGS |
|
540 |
-#endif |
|
541 |
- q->extco.CAVLC = q->cavlc ? MFX_CODINGOPTION_ON |
|
542 |
- : MFX_CODINGOPTION_UNKNOWN; |
|
543 | 535 |
|
544 | 536 |
q->extco.PicTimingSEI = q->pic_timing_sei ? |
545 | 537 |
MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN; |
... | ... |
@@ -548,6 +540,15 @@ FF_ENABLE_DEPRECATION_WARNINGS |
548 | 548 |
q->extco.RateDistortionOpt = q->rdo > 0 ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; |
549 | 549 |
|
550 | 550 |
if (avctx->codec_id == AV_CODEC_ID_H264) { |
551 |
+#if FF_API_CODER_TYPE |
|
552 |
+FF_DISABLE_DEPRECATION_WARNINGS |
|
553 |
+ if (avctx->coder_type >= 0) |
|
554 |
+ q->cavlc = avctx->coder_type == FF_CODER_TYPE_VLC; |
|
555 |
+FF_ENABLE_DEPRECATION_WARNINGS |
|
556 |
+#endif |
|
557 |
+ q->extco.CAVLC = q->cavlc ? MFX_CODINGOPTION_ON |
|
558 |
+ : MFX_CODINGOPTION_UNKNOWN; |
|
559 |
+ |
|
551 | 560 |
if (avctx->strict_std_compliance != FF_COMPLIANCE_NORMAL) |
552 | 561 |
q->extco.NalHrdConformance = avctx->strict_std_compliance > FF_COMPLIANCE_NORMAL ? |
553 | 562 |
MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF; |
... | ... |
@@ -70,7 +70,6 @@ |
70 | 70 |
{ "adaptive_i", "Adaptive I-frame placement", OFFSET(qsv.adaptive_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \ |
71 | 71 |
{ "adaptive_b", "Adaptive B-frame placement", OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \ |
72 | 72 |
{ "b_strategy", "Strategy to choose between I/P/B-frames", OFFSET(qsv.b_strategy), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \ |
73 |
-{ "cavlc", "Enable CAVLC", OFFSET(qsv.cavlc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, \ |
|
74 | 73 |
|
75 | 74 |
typedef int SetEncodeCtrlCB (AVCodecContext *avctx, |
76 | 75 |
const AVFrame *frame, mfxEncodeCtrl* enc_ctrl); |
... | ... |
@@ -102,6 +102,7 @@ static av_cold int qsv_enc_close(AVCodecContext *avctx) |
102 | 102 |
static const AVOption options[] = { |
103 | 103 |
QSV_COMMON_OPTS |
104 | 104 |
|
105 |
+ { "cavlc", "Enable CAVLC", OFFSET(qsv.cavlc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, |
|
105 | 106 |
{ "idr_interval", "Distance (in I-frames) between IDR frames", OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, |
106 | 107 |
{ "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 }, |
107 | 108 |
{ "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[] = { |
154 | 154 |
// same as the x264 default |
155 | 155 |
{ "g", "250" }, |
156 | 156 |
{ "bf", "3" }, |
157 |
- { "coder", "ac" }, |
|
157 |
+#if FF_API_CODER_TYPE |
|
158 |
+ { "coder", "-1" }, |
|
159 |
+#endif |
|
158 | 160 |
|
159 | 161 |
{ "flags", "+cgop" }, |
160 | 162 |
#if FF_API_PRIVATE_OPT |