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
532 if (avctx->codec_id != AV_CODEC_ID_HEVC) {532 if (avctx->codec_id != AV_CODEC_ID_HEVC) {
533 q->extco.Header.BufferId = MFX_EXTBUFF_CODING_OPTION;533 q->extco.Header.BufferId = MFX_EXTBUFF_CODING_OPTION;
534 q->extco.Header.BufferSz = sizeof(q->extco);534 q->extco.Header.BufferSz = sizeof(q->extco);
535#if FF_API_CODER_TYPE
536FF_DISABLE_DEPRECATION_WARNINGS
537 if (avctx->coder_type != 0)
538 q->cavlc = avctx->coder_type == FF_CODER_TYPE_VLC;
539FF_ENABLE_DEPRECATION_WARNINGS
540#endif
541 q->extco.CAVLC = q->cavlc ? MFX_CODINGOPTION_ON
542 : MFX_CODINGOPTION_UNKNOWN;
543 535
544 q->extco.PicTimingSEI = q->pic_timing_sei ?536 q->extco.PicTimingSEI = q->pic_timing_sei ?
545 MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;537 MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;
@@ -548,6 +540,15 @@ FF_ENABLE_DEPRECATION_WARNINGS · 2 unmodified lines
548 q->extco.RateDistortionOpt = q->rdo > 0 ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;540 q->extco.RateDistortionOpt = q->rdo > 0 ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
549 541
550 if (avctx->codec_id == AV_CODEC_ID_H264) {542 if (avctx->codec_id == AV_CODEC_ID_H264) {
543#if FF_API_CODER_TYPE
544FF_DISABLE_DEPRECATION_WARNINGS
545 if (avctx->coder_type >= 0)
546 q->cavlc = avctx->coder_type == FF_CODER_TYPE_VLC;
547FF_ENABLE_DEPRECATION_WARNINGS
548#endif
549 q->extco.CAVLC = q->cavlc ? MFX_CODINGOPTION_ON
550 : MFX_CODINGOPTION_UNKNOWN;
551
551 if (avctx->strict_std_compliance != FF_COMPLIANCE_NORMAL)552 if (avctx->strict_std_compliance != FF_COMPLIANCE_NORMAL)
552 q->extco.NalHrdConformance = avctx->strict_std_compliance > FF_COMPLIANCE_NORMAL ?553 q->extco.NalHrdConformance = avctx->strict_std_compliance > FF_COMPLIANCE_NORMAL ?
553 MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;554 MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
libavcodec/qsvenc.h+0−1
@@ -70,7 +70,6 @@ · 69 unmodified lines
70{ "adaptive_i", "Adaptive I-frame placement", OFFSET(qsv.adaptive_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \70{ "adaptive_i", "Adaptive I-frame placement", OFFSET(qsv.adaptive_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
71{ "adaptive_b", "Adaptive B-frame placement", OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \71{ "adaptive_b", "Adaptive B-frame placement", OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
72{ "b_strategy", "Strategy to choose between I/P/B-frames", OFFSET(qsv.b_strategy), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \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
75typedef int SetEncodeCtrlCB (AVCodecContext *avctx,74typedef int SetEncodeCtrlCB (AVCodecContext *avctx,
76 const AVFrame *frame, mfxEncodeCtrl* enc_ctrl);75 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
102static const AVOption options[] = {102static const AVOption options[] = {
103 QSV_COMMON_OPTS103 QSV_COMMON_OPTS
104 104
105 { "cavlc", "Enable CAVLC", OFFSET(qsv.cavlc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
105 { "idr_interval", "Distance (in I-frames) between IDR frames", OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },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 { "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 { "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 { "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 },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[] = { · 46 unmodified lines
154 // same as the x264 default155 // same as the x264 default
155 { "g", "250" },156 { "g", "250" },
156 { "bf", "3" },157 { "bf", "3" },
157 { "coder", "ac" },158#if FF_API_CODER_TYPE
159 { "coder", "-1" },
160#endif
158 161
159 { "flags", "+cgop" },162 { "flags", "+cgop" },
160#if FF_API_PRIVATE_OPT163#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