History

Merge commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e'

* commit 'b843b343d8a3210ae37a2342b1904a5bd1e5fc6e': qsvenc: cavlc option is only available for h264

James Almer committed 8 years ago

Commit dde7b1d2 parents b0d9eab b843b343 files · +13 −10Browse files

Unified · Split

3 files
  1. libavcodec/qsvenc.c +9 −8
  2. libavcodec/qsvenc.h +0 −1
  3. libavcodec/qsvenc_h264.c +4 −1
libavcodec/qsvenc.c+9−8
@@ -532,14 +532,6 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) · 531 unmodified lines
532532 if (avctx->codec_id != AV_CODEC_ID_HEVC) {
533533 q->extco.Header.BufferId = MFX_EXTBUFF_CODING_OPTION;
534534 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;
543535
544536 q->extco.PicTimingSEI = q->pic_timing_sei ?
545537 MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;
@@ -548,6 +540,15 @@ FF_ENABLE_DEPRECATION_WARNINGS · 2 unmodified lines
548540 q->extco.RateDistortionOpt = q->rdo > 0 ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
549541
550542 if (avctx->codec_id == AV_CODEC_ID_H264) {
543+#if FF_API_CODER_TYPE
544+FF_DISABLE_DEPRECATION_WARNINGS
545+ if (avctx->coder_type >= 0)
546+ q->cavlc = avctx->coder_type == FF_CODER_TYPE_VLC;
547+FF_ENABLE_DEPRECATION_WARNINGS
548+#endif
549+ q->extco.CAVLC = q->cavlc ? MFX_CODINGOPTION_ON
550+ : MFX_CODINGOPTION_UNKNOWN;
551+
551552 if (avctx->strict_std_compliance != FF_COMPLIANCE_NORMAL)
552553 q->extco.NalHrdConformance = avctx->strict_std_compliance > FF_COMPLIANCE_NORMAL ?
553554 MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
libavcodec/qsvenc.h+0−1
@@ -70,7 +70,6 @@ · 69 unmodified lines
7070 { "adaptive_i", "Adaptive I-frame placement", OFFSET(qsv.adaptive_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
7171 { "adaptive_b", "Adaptive B-frame placement", OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
7272 { "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 }, \
7473
7574 typedef int SetEncodeCtrlCB (AVCodecContext *avctx,
7675 const AVFrame *frame, mfxEncodeCtrl* enc_ctrl);
libavcodec/qsvenc_h264.c+4−1
@@ -102,6 +102,7 @@ static av_cold int qsv_enc_close(AVCodecContext *avctx) · 101 unmodified lines
102102 static const AVOption options[] = {
103103 QSV_COMMON_OPTS
104104
105+ { "cavlc", "Enable CAVLC", OFFSET(qsv.cavlc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
105106 { "idr_interval", "Distance (in I-frames) between IDR frames", OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
106107 { "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 },
107108 { "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[] = { · 46 unmodified lines
154155 // same as the x264 default
155156 { "g", "250" },
156157 { "bf", "3" },
157− { "coder", "ac" },
158+#if FF_API_CODER_TYPE
159+ { "coder", "-1" },
160+#endif
158161
159162 { "flags", "+cgop" },
160163 #if FF_API_PRIVATE_OPT

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t