25 #include <sys/types.h>
26 #include <mfx/mfxvideo.h>
47 { MFX_PROFILE_AVC_BASELINE,
"baseline" },
48 { MFX_PROFILE_AVC_MAIN,
"main" },
49 { MFX_PROFILE_AVC_EXTENDED,
"extended" },
50 { MFX_PROFILE_AVC_HIGH,
"high" },
51 #if QSV_VERSION_ATLEAST(1, 15)
52 { MFX_PROFILE_AVC_HIGH_422,
"high 422" },
54 #if QSV_VERSION_ATLEAST(1, 4)
55 { MFX_PROFILE_AVC_CONSTRAINED_BASELINE,
"constrained baseline" },
56 { MFX_PROFILE_AVC_CONSTRAINED_HIGH,
"constrained high" },
57 { MFX_PROFILE_AVC_PROGRESSIVE_HIGH,
"progressive high" },
59 { MFX_PROFILE_MPEG2_SIMPLE,
"simple" },
60 { MFX_PROFILE_MPEG2_MAIN,
"main" },
61 { MFX_PROFILE_MPEG2_HIGH,
"high" },
62 { MFX_PROFILE_VC1_SIMPLE,
"simple" },
63 { MFX_PROFILE_VC1_MAIN,
"main" },
64 { MFX_PROFILE_VC1_ADVANCED,
"advanced" },
65 #if QSV_VERSION_ATLEAST(1, 8)
66 { MFX_PROFILE_HEVC_MAIN,
"main" },
67 { MFX_PROFILE_HEVC_MAIN10,
"main10" },
68 { MFX_PROFILE_HEVC_MAINSP,
"mainsp" },
85 { MFX_RATECONTROL_CBR,
"CBR" },
86 { MFX_RATECONTROL_VBR,
"VBR" },
87 { MFX_RATECONTROL_CQP,
"CQP" },
89 { MFX_RATECONTROL_AVBR,
"AVBR" },
92 { MFX_RATECONTROL_LA,
"LA" },
95 { MFX_RATECONTROL_ICQ,
"ICQ" },
96 { MFX_RATECONTROL_LA_ICQ,
"LA_ICQ" },
99 { MFX_RATECONTROL_VCM,
"VCM" },
101 #if QSV_VERSION_ATLEAST(1, 10)
102 { MFX_RATECONTROL_LA_EXT,
"LA_EXT" },
105 { MFX_RATECONTROL_LA_HRD,
"LA_HRD" },
108 { MFX_RATECONTROL_QVBR,
"QVBR" },
123 if (
val == MFX_CODINGOPTION_ON)
125 else if (
val == MFX_CODINGOPTION_OFF)
131 mfxExtBuffer **coding_opts)
135 mfxExtCodingOption *co = (mfxExtCodingOption*)coding_opts[0];
137 mfxExtCodingOption2 *co2 = (mfxExtCodingOption2*)coding_opts[1];
140 mfxExtCodingOption3 *co3 = (mfxExtCodingOption3*)coding_opts[2];
147 info->GopPicSize,
info->GopRefDist);
148 if (
info->GopOptFlag & MFX_GOP_CLOSED)
150 if (
info->GopOptFlag & MFX_GOP_STRICT)
157 if (
info->RateControlMethod == MFX_RATECONTROL_CBR ||
158 info->RateControlMethod == MFX_RATECONTROL_VBR
160 ||
info->RateControlMethod == MFX_RATECONTROL_VCM
164 "BufferSizeInKB: %"PRIu16
"; InitialDelayInKB: %"PRIu16
"; TargetKbps: %"PRIu16
"; MaxKbps: %"PRIu16
"; BRCParamMultiplier: %"PRIu16
"\n",
165 info->BufferSizeInKB,
info->InitialDelayInKB,
info->TargetKbps,
info->MaxKbps,
info->BRCParamMultiplier);
166 }
else if (
info->RateControlMethod == MFX_RATECONTROL_CQP) {
171 else if (
info->RateControlMethod == MFX_RATECONTROL_AVBR) {
173 "TargetKbps: %"PRIu16
"; Accuracy: %"PRIu16
"; Convergence: %"PRIu16
"; BRCParamMultiplier: %"PRIu16
"\n",
174 info->TargetKbps,
info->Accuracy,
info->Convergence,
info->BRCParamMultiplier);
178 else if (
info->RateControlMethod == MFX_RATECONTROL_LA
180 ||
info->RateControlMethod == MFX_RATECONTROL_LA_HRD
184 "TargetKbps: %"PRIu16
"; LookAheadDepth: %"PRIu16
"; BRCParamMultiplier: %"PRIu16
"\n",
185 info->TargetKbps, co2->LookAheadDepth,
info->BRCParamMultiplier);
189 else if (
info->RateControlMethod == MFX_RATECONTROL_ICQ) {
191 }
else if (
info->RateControlMethod == MFX_RATECONTROL_LA_ICQ) {
193 info->ICQQuality, co2->LookAheadDepth);
197 else if (
info->RateControlMethod == MFX_RATECONTROL_QVBR) {
209 "RecoveryPointSEI: %s IntRefType: %"PRIu16
"; IntRefCycleSize: %"PRIu16
"; IntRefQPDelta: %"PRId16
"\n",
210 print_threestate(co->RecoveryPointSEI), co2->IntRefType, co2->IntRefCycleSize, co2->IntRefQPDelta);
213 #if QSV_HAVE_MAX_SLICE_SIZE
219 "BitrateLimit: %s; MBBRC: %s; ExtBRC: %s\n",
225 if (co2->Trellis & MFX_TRELLIS_OFF) {
227 }
else if (!co2->Trellis) {
241 #if QSV_VERSION_ATLEAST(1, 8)
243 "RepeatPPS: %s; NumMbPerSlice: %"PRIu16
"; LookAheadDS: ",
245 switch (co2->LookAheadDS) {
255 switch (co2->BRefType) {
263 #if QSV_VERSION_ATLEAST(1, 9)
265 "MinQPI: %"PRIu8
"; MaxQPI: %"PRIu8
"; MinQPP: %"PRIu8
"; MaxQPP: %"PRIu8
"; MinQPB: %"PRIu8
"; MaxQPB: %"PRIu8
"\n",
266 co2->MinQPI, co2->MaxQPI, co2->MinQPP, co2->MaxQPP, co2->MinQPB, co2->MaxQPB);
277 co->CAVLC == MFX_CODINGOPTION_ON ?
"CAVLC" :
"CABAC", co->MaxDecFrameBuffering);
279 "NalHrdConformance: %s; SingleSeiNalUnit: %s; VuiVclHrdParameters: %s VuiNalHrdParameters: %s\n",
285 info->FrameInfo.FrameRateExtD,
info->FrameInfo.FrameRateExtN);
296 int want_vcm = q->
vcm;
300 "Lookahead ratecontrol mode requested, but is not supported by this SDK version\n");
305 "VCM ratecontrol mode requested, but is not supported by this SDK version\n");
309 if (want_la + want_qscale + want_vcm > 1) {
311 "More than one of: { constant qscale, lookahead, VCM } requested, "
312 "only one of them can be used at a time.\n");
318 "ICQ ratecontrol mode requested, but is not supported by this SDK version\n");
324 rc_desc =
"constant quantization parameter (CQP)";
329 rc_desc =
"video conferencing mode (VCM)";
335 rc_desc =
"VBR with lookahead (LA)";
339 rc_mode = MFX_RATECONTROL_LA_ICQ;
340 rc_desc =
"intelligent constant quality with lookahead (LA_ICQ)";
348 rc_desc =
"intelligent constant quality (ICQ)";
353 rc_desc =
"constant bitrate (CBR)";
357 rc_mode = MFX_RATECONTROL_AVBR;
358 rc_desc =
"average variable bitrate (AVBR)";
363 rc_mode = MFX_RATECONTROL_QVBR;
364 rc_desc =
"constant quality with VBR algorithm (QVBR)";
369 rc_desc =
"variable bitrate (VBR)";
380 mfxVideoParam param_out = { .mfx.CodecId = q->
param.mfx.CodecId };
383 #define UNMATCH(x) (param_out.mfx.x != q->param.mfx.x)
392 if (
UNMATCH(RateControlMethod))
421 if (avctx->
level > 0)
431 q->
param.mfx.FrameInfo.CropX = 0;
432 q->
param.mfx.FrameInfo.CropY = 0;
437 q->
param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
438 q->
param.mfx.FrameInfo.BitDepthLuma =
desc->comp[0].depth;
439 q->
param.mfx.FrameInfo.BitDepthChroma =
desc->comp[0].depth;
440 q->
param.mfx.FrameInfo.Shift =
desc->comp[0].depth > 8;
448 q->
param.mfx.FrameInfo.Width = frames_hwctx->surfaces[0].Info.Width;
449 q->
param.mfx.FrameInfo.Height = frames_hwctx->surfaces[0].Info.Height;
460 q->
param.mfx.Interleaved = 1;
462 q->
param.mfx.RestartInterval = 0;
473 int target_bitrate_kbps, max_bitrate_kbps, brc_param_multiplier;
474 int buffer_size_in_kilobytes, initial_delay_in_kilobytes;
482 if (avctx->
level > 0)
490 "valid range is 0-%d, using %d instead\n",
491 MFX_TARGETUSAGE_BEST_SPEED, MFX_TARGETUSAGE_BEST_SPEED);
498 q->
param.mfx.LowPower = MFX_CODINGOPTION_ON;
501 "not supported with this MSDK version.\n");
503 q->
param.mfx.LowPower = MFX_CODINGOPTION_OFF;
506 q->
param.mfx.LowPower = MFX_CODINGOPTION_OFF;
517 q->
param.mfx.EncodedOrder = 0;
518 q->
param.mfx.BufferSizeInKB = 0;
526 q->
param.mfx.FrameInfo.CropX = 0;
527 q->
param.mfx.FrameInfo.CropY = 0;
532 q->
param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
533 q->
param.mfx.FrameInfo.BitDepthLuma =
desc->comp[0].depth;
534 q->
param.mfx.FrameInfo.BitDepthChroma =
desc->comp[0].depth;
535 q->
param.mfx.FrameInfo.Shift =
desc->comp[0].depth > 8;
547 q->
param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_FIELD_TFF;
551 q->
param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
562 q->
param.mfx.FrameInfo.Width = frames_hwctx->surfaces[0].Info.Width;
563 q->
param.mfx.FrameInfo.Height = frames_hwctx->surfaces[0].Info.Height;
581 target_bitrate_kbps = avctx->
bit_rate / 1000;
583 brc_param_multiplier = (
FFMAX(
FFMAX3(target_bitrate_kbps, max_bitrate_kbps, buffer_size_in_kilobytes),
584 initial_delay_in_kilobytes) + 0x10000) / 0x10000;
586 switch (q->
param.mfx.RateControlMethod) {
587 case MFX_RATECONTROL_CBR:
588 case MFX_RATECONTROL_VBR:
590 case MFX_RATECONTROL_VCM:
593 case MFX_RATECONTROL_QVBR:
595 q->
param.mfx.BufferSizeInKB = buffer_size_in_kilobytes / brc_param_multiplier;
596 q->
param.mfx.InitialDelayInKB = initial_delay_in_kilobytes / brc_param_multiplier;
597 q->
param.mfx.TargetKbps = target_bitrate_kbps / brc_param_multiplier;
598 q->
param.mfx.MaxKbps = max_bitrate_kbps / brc_param_multiplier;
599 q->
param.mfx.BRCParamMultiplier = brc_param_multiplier;
601 if (q->
param.mfx.RateControlMethod == MFX_RATECONTROL_QVBR)
605 case MFX_RATECONTROL_CQP:
614 case MFX_RATECONTROL_AVBR:
615 q->
param.mfx.TargetKbps = target_bitrate_kbps / brc_param_multiplier;
618 q->
param.mfx.BRCParamMultiplier = brc_param_multiplier;
622 case MFX_RATECONTROL_LA:
623 q->
param.mfx.TargetKbps = target_bitrate_kbps / brc_param_multiplier;
625 q->
param.mfx.BRCParamMultiplier = brc_param_multiplier;
628 case MFX_RATECONTROL_LA_ICQ:
630 case MFX_RATECONTROL_ICQ:
641 q->
extco.Header.BufferId = MFX_EXTBUFF_CODING_OPTION;
645 MFX_CODINGOPTION_ON : MFX_CODINGOPTION_UNKNOWN;
648 q->
extco.RateDistortionOpt = q->
rdo > 0 ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
651 #if FF_API_CODER_TYPE
657 q->
extco.CAVLC = q->
cavlc ? MFX_CODINGOPTION_ON
658 : MFX_CODINGOPTION_UNKNOWN;
662 MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
669 q->
extco.AUDelimiter = q->
aud ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
676 q->extco2.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2;
677 q->extco2.Header.BufferSz =
sizeof(q->extco2);
687 q->extco2.BitrateLimit = q->
bitrate_limit ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
689 q->extco2.MBBRC = q->
mbbrc ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
691 q->extco2.ExtBRC = q->
extbrc ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
695 #if QSV_HAVE_MAX_SLICE_SIZE
702 q->extco2.Trellis = (avctx->
trellis == 0) ? MFX_TRELLIS_OFF : (MFX_TRELLIS_I | MFX_TRELLIS_P | MFX_TRELLIS_B);
704 q->extco2.Trellis = MFX_TRELLIS_UNKNOWN;
707 #if QSV_VERSION_ATLEAST(1, 8)
709 q->extco2.RepeatPPS = q->
repeat_pps ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
711 #if FF_API_PRIVATE_OPT
718 q->extco2.BRefType = q->
b_strategy ? MFX_B_REF_PYRAMID : MFX_B_REF_OFF;
720 q->extco2.AdaptiveI = q->
adaptive_i ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
722 q->extco2.AdaptiveB = q->
adaptive_b ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
725 #if QSV_VERSION_ATLEAST(1, 9)
727 av_log(avctx,
AV_LOG_ERROR,
"qmin and or qmax are set but invalid, please make sure min <= max\n");
730 if (avctx->
qmin >= 0) {
731 q->extco2.MinQPI = avctx->
qmin > 51 ? 51 : avctx->
qmin;
732 q->extco2.MinQPP = q->extco2.MinQPB = q->extco2.MinQPI;
734 if (avctx->
qmax >= 0) {
735 q->extco2.MaxQPI = avctx->
qmax > 51 ? 51 : avctx->
qmax;
736 q->extco2.MaxQPP = q->extco2.MaxQPB = q->extco2.MaxQPI;
744 q->extmfp.Header.BufferId = MFX_EXTBUFF_MULTI_FRAME_PARAM;
745 q->extmfp.Header.BufferSz =
sizeof(q->extmfp);
747 q->extmfp.MFMode = q->mfmode;
754 q->extco3.Header.BufferId = MFX_EXTBUFF_CODING_OPTION3;
755 q->extco3.Header.BufferSz =
sizeof(q->extco3);
758 q->extco3.GPB = q->
gpb ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
766 "some encoding parameters are not supported by the QSV "
767 "runtime. Please double check the input parameters.\n");
781 "Error calling GetVideoParam");
799 mfxExtCodingOptionSPSPPS extradata = {
800 .Header.BufferId = MFX_EXTBUFF_CODING_OPTION_SPSPPS,
801 .Header.BufferSz =
sizeof(extradata),
802 .SPSBuffer = sps_buf, .SPSBufSize =
sizeof(sps_buf),
803 .PPSBuffer = pps_buf, .PPSBufSize =
sizeof(pps_buf)
806 mfxExtCodingOption co = {
807 .Header.BufferId = MFX_EXTBUFF_CODING_OPTION,
808 .Header.BufferSz =
sizeof(co),
811 mfxExtCodingOption2 co2 = {
812 .Header.BufferId = MFX_EXTBUFF_CODING_OPTION2,
813 .Header.BufferSz =
sizeof(co2),
817 mfxExtCodingOption3 co3 = {
818 .Header.BufferId = MFX_EXTBUFF_CODING_OPTION3,
819 .Header.BufferSz =
sizeof(co3),
825 mfxExtCodingOptionVPS extradata_vps = {
826 .Header.BufferId = MFX_EXTBUFF_CODING_OPTION_VPS,
827 .Header.BufferSz =
sizeof(extradata_vps),
828 .VPSBuffer = vps_buf,
829 .VPSBufSize =
sizeof(vps_buf),
836 int ret, ext_buf_num = 0, extradata_offset = 0;
838 ext_buffers[ext_buf_num++] = (mfxExtBuffer*)&extradata;
839 ext_buffers[ext_buf_num++] = (mfxExtBuffer*)&co;
841 ext_buffers[ext_buf_num++] = (mfxExtBuffer*)&co2;
844 ext_buffers[ext_buf_num++] = (mfxExtBuffer*)&co3;
849 ext_buffers[ext_buf_num++] = (mfxExtBuffer*)&extradata_vps;
852 q->
param.ExtParam = ext_buffers;
853 q->
param.NumExtParam = ext_buf_num;
858 "Error calling GetVideoParam");
862 if (!extradata.SPSBufSize || (need_pps && !extradata.PPSBufSize)
864 || (q->
hevc_vps && !extradata_vps.VPSBufSize)
871 avctx->
extradata_size = extradata.SPSBufSize + need_pps * extradata.PPSBufSize;
882 memcpy(avctx->
extradata, vps_buf, extradata_vps.VPSBufSize);
883 extradata_offset += extradata_vps.VPSBufSize;
887 memcpy(avctx->
extradata + extradata_offset, sps_buf, extradata.SPSBufSize);
888 extradata_offset += extradata.SPSBufSize;
890 memcpy(avctx->
extradata + extradata_offset, pps_buf, extradata.PPSBufSize);
891 extradata_offset += extradata.PPSBufSize;
911 mfxFrameSurface1 *surfaces;
925 for (
i = 0;
i < nb_surfaces;
i++) {
926 surfaces[
i].Info = q->
req.Info;
930 q->
opaque_alloc.Header.BufferId = MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION;
959 q->
param.IOPattern == MFX_IOPATTERN_IN_OPAQUE_MEMORY);
987 return sizeof(
AVPacket) +
sizeof(mfxSyncPoint*) +
sizeof(mfxBitstream*);
998 int opaque_alloc = 0;
1019 if (frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME)
1020 iopattern = MFX_IOPATTERN_IN_OPAQUE_MEMORY;
1021 else if (frames_hwctx->frame_type &
1022 (MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET | MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET))
1023 iopattern = MFX_IOPATTERN_IN_VIDEO_MEMORY;
1028 iopattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY;
1029 q->
param.IOPattern = iopattern;
1038 "Error querying mfx version");
1054 if (
ret == MFX_WRN_PARTIAL_ACCELERATION) {
1056 }
else if (
ret < 0) {
1058 "Error querying encoder params");
1064 "Error querying (IOSurf) the encoding parameters");
1091 if (j < qsv->nb_ext_buffers)
1104 "Error initializing the encoder");
1107 "Warning in encoder initialization");
1134 enc_ctrl->NumPayload = 0;
1168 last = &
frame->next;
1176 if (!
frame->frame) {
1181 if (!
frame->enc_ctrl.Payload) {
1250 !
frame->interlaced_frame ? MFX_PICSTRUCT_PROGRESSIVE :
1251 frame->top_field_first ? MFX_PICSTRUCT_FIELD_TFF :
1252 MFX_PICSTRUCT_FIELD_BFF;
1253 if (
frame->repeat_pict == 1)
1254 qf->
surface.Info.PicStruct |= MFX_PICSTRUCT_FIELD_REPEATED;
1255 else if (
frame->repeat_pict == 2)
1256 qf->
surface.Info.PicStruct |= MFX_PICSTRUCT_FRAME_DOUBLING;
1257 else if (
frame->repeat_pict == 4)
1258 qf->
surface.Info.PicStruct |= MFX_PICSTRUCT_FRAME_TRIPLING;
1274 if (q->
param.mfx.CodecId == MFX_CODEC_AVC) {
1275 if (q->
param.mfx.CodecProfile == MFX_PROFILE_AVC_BASELINE ||
1276 q->
param.mfx.CodecLevel < MFX_LEVEL_AVC_21 ||
1277 q->
param.mfx.CodecLevel > MFX_LEVEL_AVC_41)
1279 "Interlaced coding is supported"
1280 " at Main/High Profile Level 2.2-4.0\n");
1289 #if QSV_VERSION_ATLEAST(1, 26)
1290 mfxExtAVCEncodedFrameInfo *enc_info;
1291 mfxExtBuffer **enc_buf;
1294 mfxFrameSurface1 *surf =
NULL;
1295 mfxSyncPoint *sync =
NULL;
1297 mfxEncodeCtrl* enc_ctrl =
NULL;
1312 enc_ctrl->FrameType = MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF;
1314 enc_ctrl->FrameType |= MFX_FRAMETYPE_IDR;
1329 bs->Data = new_pkt.
data;
1330 bs->MaxLength = new_pkt.
size;
1332 #if QSV_VERSION_ATLEAST(1, 26)
1338 enc_info->Header.BufferId = MFX_EXTBUFF_ENCODED_FRAME_INFO;
1339 enc_info->Header.BufferSz =
sizeof (*enc_info);
1340 bs->NumExtParam = 1;
1341 enc_buf =
av_mallocz(
sizeof(mfxExtBuffer *));
1344 enc_buf[0] = (mfxExtBuffer *)enc_info;
1346 bs->ExtParam = enc_buf;
1357 #if QSV_VERSION_ATLEAST(1, 26)
1368 ret = MFXVideoENCODE_EncodeFrameAsync(q->
session, enc_ctrl, surf, bs, sync);
1369 if (
ret == MFX_WRN_DEVICE_BUSY)
1371 }
while (
ret == MFX_WRN_DEVICE_BUSY ||
ret == MFX_WRN_IN_EXECUTION);
1379 #if QSV_VERSION_ATLEAST(1, 26)
1386 return (
ret == MFX_ERR_MORE_DATA) ?
1390 if (
ret == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM &&
frame->interlaced_frame)
1401 #if QSV_VERSION_ATLEAST(1, 26)
1426 #if QSV_VERSION_ATLEAST(1, 26)
1427 mfxExtAVCEncodedFrameInfo *enc_info;
1428 mfxExtBuffer **enc_buf;
1437 ret = MFXVideoCORE_SyncOperation(q->
session, *sync, 1000);
1438 }
while (
ret == MFX_WRN_IN_EXECUTION);
1442 new_pkt.
size = bs->DataLength;
1444 if (bs->FrameType & MFX_FRAMETYPE_IDR || bs->FrameType & MFX_FRAMETYPE_xIDR) {
1447 }
else if (bs->FrameType & MFX_FRAMETYPE_I || bs->FrameType & MFX_FRAMETYPE_xI)
1449 else if (bs->FrameType & MFX_FRAMETYPE_P || bs->FrameType & MFX_FRAMETYPE_xP)
1451 else if (bs->FrameType & MFX_FRAMETYPE_B || bs->FrameType & MFX_FRAMETYPE_xB)
1453 else if (bs->FrameType == MFX_FRAMETYPE_UNKNOWN) {
1461 #if FF_API_CODED_FRAME
1467 #if QSV_VERSION_ATLEAST(1, 26)
1469 enc_buf = bs->ExtParam;
1470 enc_info = (mfxExtAVCEncodedFrameInfo *)(*bs->ExtParam);
1509 MFXVideoENCODE_Close(q->
session);