History

qsv: Make the hevc idr_interval consistent with the h264 one

According to the MediaSDK documentation the idr_interval value has a different meaning depending on the codec: 0 in H264 means make every I-frame IDR, in HEVC it means to have it only at the beginning. 1 in H264 means every other I-frame is not-IDR, in HEVC it means that every I-frame is IDR. Keep the behaviour consistent between the two encoders by increasing by 1 internally the idr_interval value for HEVC.

Luca Barbato committed 9 years ago

Commit 98afe3f1 parent 41df62f1 file · +5 −1Browse files

Unified · Split

libavcodec/qsvenc_hevc.c+5−1
@@ -181,6 +181,9 @@ static av_cold int qsv_enc_init(AVCodecContext *avctx) · 180 unmodified lines
181 }181 }
182 }182 }
183 183
184 // HEVC and H264 meaning of the value is shifted by 1, make it consistent
185 q->qsv.idr_interval++;
186
184 ret = ff_qsv_enc_init(avctx, &q->qsv);187 ret = ff_qsv_enc_init(avctx, &q->qsv);
185 if (ret < 0)188 if (ret < 0)
186 return ret;189 return ret;
@@ -220,7 +223,8 @@ static av_cold int qsv_enc_close(AVCodecContext *avctx) · 33 unmodified lines
220static const AVOption options[] = {223static const AVOption options[] = {
221 QSV_COMMON_OPTS224 QSV_COMMON_OPTS
222 225
223 { "idr_interval", "Distance (in I-frames) between IDR frames", OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },226 { "idr_interval", "Distance (in I-frames) between IDR frames", OFFSET(qsv.idr_interval), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT_MAX, VE, "idr_interval" },
227 { "begin_only", "Output an IDR-frame only at the beginning of the stream", 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, 0, 0, VE, "idr_interval" },
224 { "load_plugin", "A user plugin to load in an internal session", OFFSET(load_plugin), AV_OPT_TYPE_INT, { .i64 = LOAD_PLUGIN_DEFAULT }, LOAD_PLUGIN_NONE, LOAD_PLUGIN_HEVC_HW, VE, "load_plugin" },228 { "load_plugin", "A user plugin to load in an internal session", OFFSET(load_plugin), AV_OPT_TYPE_INT, { .i64 = LOAD_PLUGIN_DEFAULT }, LOAD_PLUGIN_NONE, LOAD_PLUGIN_HEVC_HW, VE, "load_plugin" },
225 { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_NONE }, 0, 0, VE, "load_plugin" },229 { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_NONE }, 0, 0, VE, "load_plugin" },
226 { "hevc_sw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_SW }, 0, 0, VE, "load_plugin" },230 { "hevc_sw", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_SW }, 0, 0, VE, "load_plugin" },

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