-
Notifications
You must be signed in to change notification settings - Fork 92
/
mfxstructures.h
4882 lines (4263 loc) · 276 KB
/
mfxstructures.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*############################################################################
# Copyright Intel Corporation
#
# SPDX-License-Identifier: MIT
############################################################################*/
#ifndef __MFXSTRUCTURES_H__
#define __MFXSTRUCTURES_H__
#include "mfxcommon.h"
#if !defined (__GNUC__)
#pragma warning(disable: 4201)
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Frame ID for MVC */
MFX_PACK_BEGIN_USUAL_STRUCT()
/*! Describes the view and layer of a frame picture. */
typedef struct {
mfxU16 TemporalId; /*!< The temporal identifier as defined in the annex H of the ITU*-T H.264 specification. */
mfxU16 PriorityId; /*!< Reserved and must be zero. */
union {
struct {
mfxU16 DependencyId; /*!< Reserved for future use. */
mfxU16 QualityId; /*!< Reserved for future use. */
};
struct {
mfxU16 ViewId; /*!< The view identifier as defined in the annex H of the ITU-T H.264 specification. */
};
};
} mfxFrameId;
MFX_PACK_END()
/* This struct has 4-byte alignment for binary compatibility with previously released versions of API. */
MFX_PACK_BEGIN_USUAL_STRUCT()
/*! Specifies properties of video frames. See also "Configuration Parameter Constraints" chapter. */
typedef struct {
mfxU32 reserved[4]; /*!< Reserved for future use. */
/*! The unique ID of each VPP channel set by application. It's required that during Init/Reset application fills ChannelId for
each mfxVideoChannelParam provided by the application and the SDK sets it back to the correspondent
mfxSurfaceArray::mfxFrameSurface1 to distinguish different channels. It's expected that surfaces for some channels might be
returned with some delay so application has to use mfxFrameInfo::ChannelId to distinguish what returned surface belongs to
what VPP channel. Decoder's initialization parameters are always sent through channel with mfxFrameInfo::ChannelId equals to
zero. It's allowed to skip setting of decoder's parameters for simplified decoding procedure */
mfxU16 ChannelId;
/*! Number of bits used to represent luma samples.
@note Not all codecs and implementations support this value. Use the Query API function to check if this feature is supported. */
mfxU16 BitDepthLuma;
/*! Number of bits used to represent chroma samples.
@note Not all codecs and implementations support this value. Use the Query API function to check if this feature is supported. */
mfxU16 BitDepthChroma;
/*! When the value is not zero, indicates that values of luma and chroma samples are shifted. Use BitDepthLuma and BitDepthChroma to calculate
shift size. Use zero value to indicate absence of shift. See example data alignment below.
@note Not all codecs and implementations support this value. Use the Query API function to check if this feature is supported.
*/
mfxU16 Shift;
mfxFrameId FrameId; /*!< Describes the view and layer of a frame picture. */
mfxU32 FourCC; /*!< FourCC code of the color format. See the ColorFourCC enumerator for details. */
union {
struct { /* Frame parameters */
mfxU16 Width; /*!< Width of the video frame in pixels. Must be a multiple of 16. */
mfxU16 Height; /*!< Height of the video frame in pixels. Must be a multiple of 16 for progressive frame sequence and a multiple of 32 otherwise. */
/*! @{
@name ROI
The region of interest of the frame. Specify the display width and height in mfxVideoParam. */
mfxU16 CropX; /*!< X coordinate. */
mfxU16 CropY; /*!< Y coordinate. */
mfxU16 CropW; /*!< Width in pixels. */
mfxU16 CropH; /*!< Height in pixels. */
/*! @} */
};
struct { /* Buffer parameters (for plain formats like P8) */
mfxU64 BufferSize; /*!< Size of frame buffer in bytes. Valid only for plain formats (when FourCC is P8). In this case, Width, Height, and crop values are invalid. */
mfxU32 reserved5;
};
};
/*! @{
@name FrameRate
Specify the frame rate with the following formula: FrameRateExtN / FrameRateExtD.
For encoding, frame rate must be specified. For decoding, frame rate may be unspecified (FrameRateExtN and FrameRateExtD
are all zeros.) In this case, the frame rate is defaulted to 30 frames per second.
*/
mfxU32 FrameRateExtN; /*!< Frame rate numerator. */
mfxU32 FrameRateExtD; /*!< Frame rate denominator. */
/*! @} */
mfxU16 reserved3;
/*! @{
@name AspectRatio
AspectRatioW and AspectRatioH are used to specify the sample aspect ratio. If sample aspect ratio is explicitly defined by the standards (see
Table 6-3 in the MPEG-2 specification or Table E-1 in the H.264 specification), AspectRatioW and AspectRatioH should be the defined values.
Otherwise, the sample aspect ratio can be derived as follows:
@li @c AspectRatioW=display_aspect_ratio_width*display_height
@li @c AspectRatioH=display_aspect_ratio_height*display_width
For MPEG-2, the above display aspect ratio must be one of the defined values in Table 6-3 in the MPEG-2 specification. For H.264, there is no restriction
on display aspect ratio values.
If both parameters are zero, the encoder uses the default value of sample aspect ratio.
*/
mfxU16 AspectRatioW; /*!< Aspect Ratio for width. */
mfxU16 AspectRatioH; /*!< Aspect Ratio for height. */
/*! @} */
mfxU16 PicStruct; /*!< Picture type as specified in the PicStruct enumerator. */
mfxU16 ChromaFormat; /*!< Color sampling method. Value is the same as that of ChromaFormatIdc.
ChromaFormat is not defined if FourCC is zero.*/
mfxU16 reserved2;
} mfxFrameInfo;
MFX_PACK_END()
/*! The ColorFourCC enumerator itemizes color formats. */
enum {
MFX_FOURCC_NV12 = MFX_MAKEFOURCC('N','V','1','2'), /*!< NV12 color planes. Native format for 4:2:0/8b Gen hardware implementation. */
MFX_FOURCC_YV12 = MFX_MAKEFOURCC('Y','V','1','2'), /*!< YV12 color planes. */
MFX_FOURCC_NV16 = MFX_MAKEFOURCC('N','V','1','6'), /*!< 4:2:2 color format with similar to NV12 layout. */
MFX_FOURCC_YUY2 = MFX_MAKEFOURCC('Y','U','Y','2'), /*!< YUY2 color planes. */
MFX_FOURCC_RGB565 = MFX_MAKEFOURCC('R','G','B','2'), /*!< 2 bytes per pixel, uint16 in little-endian format, where 0-4 bits are blue, bits 5-10 are green and bits 11-15 are red. */
/*! RGB 24 bit planar layout (3 separate channels, 8-bits per sample each). This format should be mapped to D3DFMT_R8G8B8 or VA_FOURCC_RGBP. */
MFX_FOURCC_RGBP = MFX_MAKEFOURCC('R','G','B','P'),
MFX_DEPRECATED_ENUM_FIELD_INSIDE(MFX_FOURCC_RGB3) = MFX_MAKEFOURCC('R','G','B','3'), /* Deprecated. */
MFX_FOURCC_RGB4 = MFX_MAKEFOURCC('R','G','B','4'), /*!< RGB4 (RGB32) color planes. BGRA is the order, 'B' is 8 MSBs, then 8 bits for 'G' channel, then 'R' and 'A' channels. */
/*!
Internal color format. The application should use the following functions to create a surface that corresponds to the Direct3D* version in use.
For Direct3D* 9: IDirectXVideoDecoderService::CreateSurface()
For Direct3D* 11: ID3D11Device::CreateBuffer()
*/
MFX_FOURCC_P8 = 41,
/*!
Internal color format. The application should use the following functions to create a surface that corresponds to the Direct3D* version in use.
For Direct3D 9: IDirectXVideoDecoderService::CreateSurface()
For Direct3D 11: ID3D11Device::CreateTexture2D()
*/
MFX_FOURCC_P8_TEXTURE = MFX_MAKEFOURCC('P','8','M','B'),
MFX_FOURCC_P010 = MFX_MAKEFOURCC('P','0','1','0'), /*!< P010 color format. This is 10 bit per sample format with similar to NV12 layout. This format should be mapped to DXGI_FORMAT_P010. */
MFX_FOURCC_P016 = MFX_MAKEFOURCC('P','0','1','6'), /*!< P016 color format. This is 16 bit per sample format with similar to NV12 layout. This format should be mapped to DXGI_FORMAT_P016. */
MFX_FOURCC_P210 = MFX_MAKEFOURCC('P','2','1','0'), /*!< 10 bit per sample 4:2:2 color format with similar to NV12 layout. */
MFX_FOURCC_BGR4 = MFX_MAKEFOURCC('B','G','R','4'), /*!< RGBA color format. It is similar to MFX_FOURCC_RGB4 but with different order of channels. 'R' is 8 MSBs, then 8 bits for 'G' channel, then 'B' and 'A' channels. */
MFX_FOURCC_A2RGB10 = MFX_MAKEFOURCC('R','G','1','0'), /*!< 10 bits ARGB color format packed in 32 bits. 'A' channel is two MSBs, then 'R', then 'G' and then 'B' channels. This format should be mapped to DXGI_FORMAT_R10G10B10A2_UNORM or D3DFMT_A2R10G10B10. */
MFX_FOURCC_ARGB16 = MFX_MAKEFOURCC('R','G','1','6'), /*!< 10 bits ARGB color format packed in 64 bits. 'A' channel is 16 MSBs, then 'R', then 'G' and then 'B' channels. This format should be mapped to DXGI_FORMAT_R16G16B16A16_UINT or D3DFMT_A16B16G16R16 formats. */
MFX_FOURCC_ABGR16 = MFX_MAKEFOURCC('B','G','1','6'), /*!< 10 bits ABGR color format packed in 64 bits. 'A' channel is 16 MSBs, then 'B', then 'G' and then 'R' channels. This format should be mapped to DXGI_FORMAT_R16G16B16A16_UINT or D3DFMT_A16B16G16R16 formats. */
MFX_FOURCC_R16 = MFX_MAKEFOURCC('R','1','6','U'), /*!< 16 bits single channel color format. This format should be mapped to DXGI_FORMAT_R16_TYPELESS or D3DFMT_R16F. */
MFX_FOURCC_AYUV = MFX_MAKEFOURCC('A','Y','U','V'), /*!< YUV 4:4:4, AYUV color format. This format should be mapped to DXGI_FORMAT_AYUV. */
MFX_FOURCC_AYUV_RGB4 = MFX_MAKEFOURCC('A','V','U','Y'), /*!< RGB4 stored in AYUV surface. This format should be mapped to DXGI_FORMAT_AYUV. */
MFX_FOURCC_UYVY = MFX_MAKEFOURCC('U','Y','V','Y'), /*!< UYVY color planes. Same as YUY2 except the byte order is reversed. */
MFX_FOURCC_Y210 = MFX_MAKEFOURCC('Y','2','1','0'), /*!< 10 bit per sample 4:2:2 packed color format with similar to YUY2 layout. This format should be mapped to DXGI_FORMAT_Y210. */
MFX_FOURCC_Y410 = MFX_MAKEFOURCC('Y','4','1','0'), /*!< 10 bit per sample 4:4:4 packed color format. This format should be mapped to DXGI_FORMAT_Y410. */
MFX_FOURCC_Y216 = MFX_MAKEFOURCC('Y','2','1','6'), /*!< 16 bit per sample 4:2:2 packed color format with similar to YUY2 layout. This format should be mapped to DXGI_FORMAT_Y216. */
MFX_FOURCC_Y416 = MFX_MAKEFOURCC('Y','4','1','6'), /*!< 16 bit per sample 4:4:4 packed color format. This format should be mapped to DXGI_FORMAT_Y416. */
MFX_FOURCC_NV21 = MFX_MAKEFOURCC('N', 'V', '2', '1'), /*!< Same as NV12 but with weaved V and U values. */
MFX_FOURCC_IYUV = MFX_MAKEFOURCC('I', 'Y', 'U', 'V'), /*!< Same as YV12 except that the U and V plane order is reversed. */
MFX_FOURCC_I010 = MFX_MAKEFOURCC('I', '0', '1', '0'), /*!< 10-bit YUV 4:2:0, each component has its own plane. */
MFX_FOURCC_I210 = MFX_MAKEFOURCC('I', '2', '1', '0'), /*!< 10-bit YUV 4:2:2, each component has its own plane. */
MFX_FOURCC_I420 = MFX_FOURCC_IYUV, /*!< Alias for the IYUV color format. */
MFX_FOURCC_I422 = MFX_MAKEFOURCC('I', '4', '2', '2'), /*!< Same as YV16 except that the U and V plane order is reversed */
MFX_FOURCC_BGRA = MFX_FOURCC_RGB4, /*!< Alias for the RGB4 color format. */
/*! BGR 24 bit planar layout (3 separate channels, 8-bits per sample each). This format should be mapped to VA_FOURCC_BGRP. */
MFX_FOURCC_BGRP = MFX_MAKEFOURCC('B','G','R','P'),
#ifdef ONEVPL_EXPERIMENTAL
/*! 8bit per sample 4:4:4 format packed in 32 bits, X=unused/undefined, 'X' channel is 8 MSBs, then 'Y', then 'U', and then 'V' channels. This format should be mapped to VA_FOURCC_XYUV. */
MFX_FOURCC_XYUV = MFX_MAKEFOURCC('X','Y','U','V'),
#endif
#ifdef ONEVPL_EXPERIMENTAL
MFX_FOURCC_ABGR16F = MFX_MAKEFOURCC('B', 'G', 'R', 'F'), /*!< 16 bits float point ABGR color format packed in 64 bits. 'A' channel is 16 MSBs, then 'B', then 'G' and then 'R' channels. This format should be mapped to DXGI_FORMAT_R16G16B16A16_FLOAT or D3DFMT_A16B16G16R16F formats.. */
#endif
};
/* PicStruct */
enum {
MFX_PICSTRUCT_UNKNOWN =0x00, /*!< Unspecified or mixed progressive/interlaced/field pictures. */
MFX_PICSTRUCT_PROGRESSIVE =0x01, /*!< Progressive picture. */
MFX_PICSTRUCT_FIELD_TFF =0x02, /*!< Top field in first interlaced picture. */
MFX_PICSTRUCT_FIELD_BFF =0x04, /*!< Bottom field in first interlaced picture. */
MFX_PICSTRUCT_FIELD_REPEATED=0x10, /*!< First field repeated: pic_struct=5 or 6 in H.264. */
MFX_PICSTRUCT_FRAME_DOUBLING=0x20, /*!< Double the frame for display: pic_struct=7 in H.264. */
MFX_PICSTRUCT_FRAME_TRIPLING=0x40, /*!< Triple the frame for display: pic_struct=8 in H.264. */
MFX_PICSTRUCT_FIELD_SINGLE =0x100, /*!< Single field in a picture. */
MFX_PICSTRUCT_FIELD_TOP =MFX_PICSTRUCT_FIELD_SINGLE | MFX_PICSTRUCT_FIELD_TFF, /*!< Top field in a picture: pic_struct = 1 in H.265. */
MFX_PICSTRUCT_FIELD_BOTTOM =MFX_PICSTRUCT_FIELD_SINGLE | MFX_PICSTRUCT_FIELD_BFF, /*!< Bottom field in a picture: pic_struct = 2 in H.265. */
MFX_PICSTRUCT_FIELD_PAIRED_PREV =0x200, /*!< Paired with previous field: pic_struct = 9 or 10 in H.265. */
MFX_PICSTRUCT_FIELD_PAIRED_NEXT =0x400, /*!< Paired with next field: pic_struct = 11 or 12 in H.265 */
};
/* The ChromaFormatIdc enumerator itemizes color-sampling formats. */
enum {
MFX_CHROMAFORMAT_MONOCHROME =0, /*!< Monochrome. */
MFX_CHROMAFORMAT_YUV420 =1, /*!< 4:2:0 color. */
MFX_CHROMAFORMAT_YUV422 =2, /*!< 4:2:2 color. */
MFX_CHROMAFORMAT_YUV444 =3, /*!< 4:4:4 color. */
MFX_CHROMAFORMAT_YUV400 = MFX_CHROMAFORMAT_MONOCHROME, /*!< Equal to monochrome. */
MFX_CHROMAFORMAT_YUV411 = 4, /*!< 4:1:1 color. */
MFX_CHROMAFORMAT_YUV422H = MFX_CHROMAFORMAT_YUV422, /*!< 4:2:2 color, horizontal sub-sampling. It is equal to 4:2:2 color. */
MFX_CHROMAFORMAT_YUV422V = 5, /*!< 4:2:2 color, vertical sub-sampling. */
MFX_CHROMAFORMAT_RESERVED1 = 6 /*!< Reserved. */
};
enum {
MFX_TIMESTAMP_UNKNOWN = -1 /*!< Indicates that time stamp is unknown for this frame/bitstream portion. */
};
enum {
MFX_FRAMEORDER_UNKNOWN = -1 /*!< Unused entry or API functions that generate the frame output do not use this frame. */
};
/* The FrameDataFlag enumerator itemizes DataFlag value in mfxFrameData. */
enum {
MFX_FRAMEDATA_TIMESTAMP_UNKNOWN = 0x0000,/*!< Indicates the time stamp of this frame is unknown and will be calculated by SDK. */
MFX_FRAMEDATA_ORIGINAL_TIMESTAMP = 0x0001 /*!< Indicates the time stamp of this frame is not calculated and is a pass-through of the original time stamp. */
};
/* Corrupted in mfxFrameData */
enum {
MFX_CORRUPTION_NO = 0x0000, /*!< No corruption. */
MFX_CORRUPTION_MINOR = 0x0001, /*!< Minor corruption in decoding certain macro-blocks. */
MFX_CORRUPTION_MAJOR = 0x0002, /*!< Major corruption in decoding the frame - incomplete data, for example. */
MFX_CORRUPTION_ABSENT_TOP_FIELD = 0x0004, /*!< Top field of frame is absent in bitstream. Only bottom field has been decoded. */
MFX_CORRUPTION_ABSENT_BOTTOM_FIELD = 0x0008, /*!< Bottom field of frame is absent in bitstream. Only top filed has been decoded. */
MFX_CORRUPTION_REFERENCE_FRAME = 0x0010, /*!< Decoding used a corrupted reference frame. A corrupted reference frame was used for decoding this
frame. For example, if the frame uses a reference frame that was decoded with minor/major corruption flag, then this
frame is also marked with a reference corruption flag. */
MFX_CORRUPTION_REFERENCE_LIST = 0x0020 /*!< The reference list information of this frame does not match what is specified in the Reference Picture Marking
Repetition SEI message. (ITU-T H.264 D.1.8 dec_ref_pic_marking_repetition) */
};
MFX_PACK_BEGIN_USUAL_STRUCT()
/*! Specifies "pixel" in Y410 color format. */
typedef struct
{
mfxU32 U : 10; /*!< U component. */
mfxU32 Y : 10; /*!< Y component. */
mfxU32 V : 10; /*!< V component. */
mfxU32 A : 2; /*!< A component. */
} mfxY410;
MFX_PACK_END()
MFX_PACK_BEGIN_USUAL_STRUCT()
/*! Specifies "pixel" in Y416 color format. */
typedef struct
{
mfxU32 U : 16; /*!< U component. */
mfxU32 Y : 16; /*!< Y component. */
mfxU32 V : 16; /*!< V component. */
mfxU32 A : 16; /*!< A component. */
} mfxY416;
MFX_PACK_END()
MFX_PACK_BEGIN_USUAL_STRUCT()
/*! Specifies "pixel" in A2RGB10 color format */
typedef struct
{
mfxU32 B : 10; /*!< B component. */
mfxU32 G : 10; /*!< G component. */
mfxU32 R : 10; /*!< R component. */
mfxU32 A : 2; /*!< A component. */
} mfxA2RGB10;
MFX_PACK_END()
#ifdef ONEVPL_EXPERIMENTAL
MFX_PACK_BEGIN_USUAL_STRUCT()
/*! Specifies "pixel" in ABGR 16 bit half float point color format */
typedef struct
{
mfxFP16 R; /*!< R component. */
mfxFP16 G; /*!< G component. */
mfxFP16 B; /*!< B component. */
mfxFP16 A; /*!< A component. */
} mfxABGR16FP;
MFX_PACK_END()
#endif
/*! Describes frame buffer pointers. */
MFX_PACK_BEGIN_STRUCT_W_L_TYPE()
typedef struct {
/*! @name Extension Buffers */
/*! @{ */
union {
mfxExtBuffer **ExtParam; /*!< Points to an array of pointers to the extra configuration structures. See the ExtendedBufferID
enumerator for a list of extended configurations. */
mfxU64 reserved2;
};
mfxU16 NumExtParam; /*!< The number of extra configuration structures attached to this structure. */
/*! @} */
/*! @name General members */
/*! @{ */
mfxU16 reserved[9]; /*!< Reserved for future use. */
mfxU16 MemType; /*!< Allocated memory type. See the ExtMemFrameType enumerator for details. Used for better integration of
3rd party plugins into the pipeline. */
mfxU16 PitchHigh; /*!< Distance in bytes between the start of two consecutive rows in a frame. */
mfxU64 TimeStamp; /*!< Time stamp of the video frame in units of 90KHz. Divide TimeStamp by 90,000 (90 KHz) to obtain the time in seconds.
A value of MFX_TIMESTAMP_UNKNOWN indicates that there is no time stamp. */
mfxU32 FrameOrder; /*!< Current frame counter for the top field of the current frame. An invalid value of MFX_FRAMEORDER_UNKNOWN indicates that
API functions that generate the frame output do not use this frame. */
mfxU16 Locked; /*!< Counter flag for the application. If Locked is greater than zero then the application locks the frame or field pair.
Do not move, alter or delete the frame. */
union{
mfxU16 Pitch;
mfxU16 PitchLow; /*!< Distance in bytes between the start of two consecutive rows in a frame. */
};
/*! @} */
/*!
@name Color Planes
Data pointers to corresponding color channels (planes). The frame buffer pointers must be 16-byte aligned. The application has to specify pointers to
all color channels even for packed formats. For example, for YUY2 format the application must specify Y, U, and V pointers.
For RGB32 format, the application must specify R, G, B, and A pointers.
*/
/*! @{ */
union {
mfxU8 *Y; /*!< Y channel. */
mfxU16 *Y16; /*!< Y16 channel. */
mfxU8 *R; /*!< R channel. */
};
union {
mfxU8 *UV; /*!< UV channel for UV merged formats. */
mfxU8 *VU; /*!< YU channel for VU merged formats. */
mfxU8 *CbCr; /*!< CbCr channel for CbCr merged formats. */
mfxU8 *CrCb; /*!< CrCb channel for CrCb merged formats. */
mfxU8 *Cb; /*!< Cb channel. */
mfxU8 *U; /*!< U channel. */
mfxU16 *U16; /*!< U16 channel. */
mfxU8 *G; /*!< G channel. */
mfxY410 *Y410; /*!< T410 channel for Y410 format (merged AVYU). */
mfxY416 *Y416; /*!< This format is a packed 16-bit representation that includes 16 bits of alpha. */
};
union {
mfxU8 *Cr; /*!< Cr channel. */
mfxU8 *V; /*!< V channel. */
mfxU16 *V16; /*!< V16 channel. */
mfxU8 *B; /*!< B channel. */
mfxA2RGB10 *A2RGB10; /*!< A2RGB10 channel for A2RGB10 format (merged ARGB). */
#ifdef ONEVPL_EXPERIMENTAL
mfxABGR16FP* ABGRFP16; /*!< ABGRFP16 channel for half float ARGB format (use this merged one due to no separate FP16 Alpha Channel). */
#endif
};
mfxU8 *A; /*!< A channel. */
mfxMemId MemId; /*!< Memory ID of the data buffers. Ignored if any of the preceding data pointers is non-zero. */
/*! @} */
/*!
@name Additional Flags
*/
/*! @{ */
mfxU16 Corrupted; /*!< Some part of the frame or field pair is corrupted. See the Corruption enumerator for details. */
mfxU16 DataFlag; /*!< Additional flags to indicate frame data properties. See the FrameDataFlag enumerator for details. */
/*! @} */
} mfxFrameData;
MFX_PACK_END()
/*! The mfxHandleType enumerator itemizes system handle types that implementations might use. */
typedef enum {
MFX_HANDLE_DIRECT3D_DEVICE_MANAGER9 =1, /*!< Pointer to the IDirect3DDeviceManager9 interface. See Working with Microsoft* DirectX* Applications for more details on how to use this handle. */
MFX_HANDLE_D3D9_DEVICE_MANAGER = MFX_HANDLE_DIRECT3D_DEVICE_MANAGER9, /*!< Pointer to the IDirect3DDeviceManager9 interface. See Working with Microsoft* DirectX* Applications for more details on how to use this handle. */
MFX_HANDLE_RESERVED1 = 2, /* Reserved. */
MFX_HANDLE_D3D11_DEVICE = 3, /*!< Pointer to the ID3D11Device interface. See Working with Microsoft* DirectX* Applications for more details on how to use this handle. */
MFX_HANDLE_VA_DISPLAY = 4, /*!< Pointer to VADisplay interface. See Working with VA-API Applications for more details on how to use this handle. */
MFX_HANDLE_RESERVED3 = 5, /* Reserved. */
MFX_HANDLE_VA_CONFIG_ID = 6, /*!< Pointer to VAConfigID interface. It represents external VA config for Common Encryption usage model. */
MFX_HANDLE_VA_CONTEXT_ID = 7, /*!< Pointer to VAContextID interface. It represents external VA context for Common Encryption usage model. */
MFX_HANDLE_CM_DEVICE = 8, /*!< Pointer to CmDevice interface ( Intel(r) C for Metal Runtime ). */
MFX_HANDLE_HDDLUNITE_WORKLOADCONTEXT = 9, /*!< Pointer to HddlUnite::WorkloadContext interface. */
MFX_HANDLE_PXP_CONTEXT = 10, /*!< Pointer to PXP context for protected content support. */
} mfxHandleType;
/*! The mfxMemoryFlags enumerator specifies memory access mode. */
typedef enum
{
MFX_MAP_READ = 0x1, /*!< The surface is mapped for reading. */
MFX_MAP_WRITE = 0x2, /*!< The surface is mapped for writing. */
MFX_MAP_READ_WRITE = MFX_MAP_READ|MFX_MAP_WRITE, /*!< The surface is mapped for reading and writing. */
/*!
* The mapping would be done immediately without any implicit synchronizations.
* \attention This flag is optional.
*/
MFX_MAP_NOWAIT = 0x10
} mfxMemoryFlags;
#define MFX_FRAMESURFACE1_VERSION MFX_STRUCT_VERSION(1, 1)
/* Frame Surface */
MFX_PACK_BEGIN_STRUCT_W_L_TYPE()
/*! Defines the uncompressed frames surface information and data buffers.
The frame surface is in the frame or complementary field pairs of pixels up to four color-channels, in two parts:
mfxFrameInfo and mfxFrameData.
*/
typedef struct {
union
{
struct mfxFrameSurfaceInterface* FrameInterface; /*!< Specifies interface to work with surface. */
mfxU32 reserved[2];
};
mfxStructVersion Version; /* Specifies version of mfxFrameSurface1 structure. */
mfxU16 reserved1[3];
mfxFrameInfo Info; /*!< Specifies surface properties. */
mfxFrameData Data; /*!< Describes the actual frame buffer. */
} mfxFrameSurface1;
MFX_PACK_END()
#define MFX_FRAMESURFACEINTERFACE_VERSION MFX_STRUCT_VERSION(1, 0)
MFX_PACK_BEGIN_STRUCT_W_L_TYPE()
/* Specifies frame surface interface. */
typedef struct mfxFrameSurfaceInterface {
mfxHDL Context; /*!< The context of the memory interface. User should not touch (change, set, null) this pointer. */
mfxStructVersion Version; /*!< The version of the structure. */
mfxU16 reserved1[3];
/*! @brief
Increments the internal reference counter of the surface. The surface is not destroyed until the surface is released using the mfxFrameSurfaceInterface::Release function.
mfxFrameSurfaceInterface::AddRef should be used each time a new link to the surface is created (for example, copy structure) for proper surface management.
@param[in] surface Valid surface.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If surface is NULL. \n
MFX_ERR_INVALID_HANDLE If mfxFrameSurfaceInterface->Context is invalid (for example NULL). \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *AddRef)(mfxFrameSurface1* surface);
/*! @brief
Decrements the internal reference counter of the surface. mfxFrameSurfaceInterface::Release should be called after using the
mfxFrameSurfaceInterface::AddRef function to add a surface or when allocation logic requires it. For example, call
mfxFrameSurfaceInterface::Release to release a surface obtained with the GetSurfaceForXXX function.
@param[in] surface Valid surface.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If surface is NULL. \n
MFX_ERR_INVALID_HANDLE If mfxFrameSurfaceInterface->Context is invalid (for example NULL). \n
MFX_ERR_UNDEFINED_BEHAVIOR If Reference Counter of surface is zero before call. \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *Release)(mfxFrameSurface1* surface);
/*! @brief
Returns current reference counter of mfxFrameSurface1 structure.
@param[in] surface Valid surface.
@param[out] counter Sets counter to the current reference counter value.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If surface or counter is NULL. \n
MFX_ERR_INVALID_HANDLE If mfxFrameSurfaceInterface->Context is invalid (for example NULL). \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *GetRefCounter)(mfxFrameSurface1* surface, mfxU32* counter);
/*! @brief
Sets pointers of surface->Info.Data to actual pixel data, providing read-write access.
In case of video memory, the surface with data in video memory becomes mapped to system memory.
An application can map a surface for read access with any value of mfxFrameSurface1::Data::Locked, but can map a surface for write access only when mfxFrameSurface1::Data::Locked equals to 0.
Note: A surface allows shared read access, but exclusive write access. Consider the following cases:
@li Map with Write or Read|Write flags. A request during active another read or write access returns MFX_ERR_LOCK_MEMORY error immediately, without waiting.
MFX_MAP_NOWAIT does not impact behavior. This type of request does not lead to any implicit synchronizations.
@li Map with Read flag. A request during active write access will wait for resource to become free,
or exits immediately with error if MFX_MAP_NOWAIT flag was set. This request may lead to the implicit synchronization (with same logic as Synchronize call)
waiting for surface to become ready to use (all dependencies should be resolved and upstream components finished writing to this surface).
It is guaranteed that read access will be acquired right after synchronization without allowing another thread to acquire this surface for writing.
If MFX_MAP_NOWAIT was set and the surface is not ready yet (for example the surface has unresolved data dependencies or active processing), the read access request exits immediately with error.
Read-write access with MFX_MAP_READ_WRITE provides exclusive simultaneous reading and writing access.
@note Bitwise copying of mfxFrameSurface1 object between map / unmap calls may result in having dangling data pointers in copies.
@param[in] surface Valid surface.
@param[out] flags Specify mapping mode.
@param[out] surface->Info.Data Pointers set to actual pixel data.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If surface is NULL. \n
MFX_ERR_INVALID_HANDLE If mfxFrameSurfaceInterface->Context is invalid (for example NULL). \n
MFX_ERR_UNSUPPORTED If flags are invalid. \n
MFX_ERR_LOCK_MEMORY If user wants to map the surface for write and surface->Data.Locked does not equal to 0. \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *Map)(mfxFrameSurface1* surface, mfxU32 flags);
/*! @brief
Invalidates pointers of surface->Info.Data and sets them to NULL.
In case of video memory, the underlying texture becomes unmapped after last reader or writer unmap.
@param[in] surface Valid surface.
@param[out] surface->Info.Data Pointers set to NULL.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If surface is NULL. \n
MFX_ERR_INVALID_HANDLE If mfxFrameSurfaceInterface->Context is invalid (for example NULL). \n
MFX_ERR_UNSUPPORTED If surface is already unmapped. \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *Unmap)(mfxFrameSurface1* surface);
/*! @brief
Returns a native resource's handle and type. The handle is returned *as-is*, meaning that the reference counter of base resources is not incremented.
The native resource is not detached from surface and the library still owns the resource. User must not destroy
the native resource or assume that the resource will be alive after mfxFrameSurfaceInterface::Release.
@param[in] surface Valid surface.
@param[out] resource Pointer is set to the native handle of the resource.
@param[out] resource_type Type of native resource. See mfxResourceType enumeration).
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If any of surface, resource or resource_type is NULL. \n
MFX_ERR_INVALID_HANDLE If any of surface, resource or resource_type is not valid object (no native resource was allocated). \n
MFX_ERR_UNSUPPORTED If surface is in system memory. \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *GetNativeHandle)(mfxFrameSurface1* surface, mfxHDL* resource, mfxResourceType* resource_type);
/*! @brief
Returns a device abstraction that was used to create that resource.
The handle is returned *as-is*, meaning that the reference counter for the device abstraction is not incremented.
The native resource is not detached from the surface and the library still has a reference to the resource.
User must not destroy the device or assume that the device will be alive after mfxFrameSurfaceInterface::Release.
@param[in] surface Valid surface.
@param[out] device_handle Pointer is set to the device which created the resource
@param[out] device_type Type of device (see mfxHandleType enumeration).
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If any of surface, device_handle or device_type is NULL. \n
MFX_ERR_INVALID_HANDLE If any of surface, resource or resource_type is not valid object (no native resource was allocated). \n
MFX_ERR_UNSUPPORTED If surface is in system memory. \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *GetDeviceHandle)(mfxFrameSurface1* surface, mfxHDL* device_handle, mfxHandleType* device_type);
/*! @brief
Guarantees readiness of both the data (pixels) and any frame's meta information (for example corruption flags) after a function completes.
Instead of MFXVideoCORE_SyncOperation, users may directly call the mfxFrameSurfaceInterface::Synchronize function after the corresponding
Decode or VPP function calls (MFXVideoDECODE_DecodeFrameAsync or MFXVideoVPP_RunFrameVPPAsync).
The prerequisites to call the functions are:
@li The main processing functions return MFX_ERR_NONE.
@li A valid mfxFrameSurface1 object.
@param[in] surface Valid surface.
@param[out] wait Wait time in milliseconds.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If surface is NULL. \n
MFX_ERR_INVALID_HANDLE If any of surface is not valid object . \n
MFX_WRN_IN_EXECUTION If the given timeout is expired and the surface is not ready. \n
MFX_ERR_ABORTED If the specified asynchronous function aborted due to data dependency on a previous asynchronous function that did not complete. \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *Synchronize)(mfxFrameSurface1* surface, mfxU32 wait);
/*! @brief
The library calls the function after complete of associated video operation
notifying the application that frame surface is ready.
@attention This is callback function and intended to be called by
the library only.
@note The library calls this callback only when this surface is used as the output surface.
It is expected that the function is low-intrusive designed otherwise it may
impact performance.
@param[in] sts The status of completed operation.
*/
void (MFX_CDECL *OnComplete)(mfxStatus sts);
/*! @brief
Returns an interface defined by the GUID. If the returned interface is a reference
counted object the caller should release the obtained interface to avoid memory leaks.
@param[in] surface Valid surface.
@param[in] guid GUID of the requested interface.
@param[out] iface Interface.
@return
MFX_ERR_NONE If no error. \n
MFX_ERR_NULL_PTR If interface or surface is NULL. \n
MFX_ERR_UNSUPPORTED If requested interface is not supported. \n
MFX_ERR_NOT_IMPLEMENTED If requested interface is not implemented. \n
MFX_ERR_NOT_INITIALIZED If requested interface is not available (not created or already deleted). \n
MFX_ERR_UNKNOWN Any internal error.
*/
mfxStatus (MFX_CDECL *QueryInterface)(mfxFrameSurface1* surface, mfxGUID guid, mfxHDL* iface);
mfxHDL reserved2[2];
} mfxFrameSurfaceInterface;
MFX_PACK_END()
/*! The TimeStampCalc enumerator itemizes time-stamp calculation methods. */
enum {
/*! The time stamp calculation is based on the input frame rate if time stamp is not explicitly specified. */
MFX_TIMESTAMPCALC_UNKNOWN = 0,
/*! Adjust time stamp to 29.97fps on 24fps progressively encoded sequences if telecine attributes are available in the bitstream and
time stamp is not explicitly specified. The input frame rate must be specified. */
MFX_TIMESTAMPCALC_TELECINE = 1,
};
/* Transcoding Info */
MFX_PACK_BEGIN_USUAL_STRUCT()
/*! Specifies configurations for decoding, encoding, and transcoding processes.
A zero value in any of these fields indicates that the field is not explicitly specified. */
typedef struct {
mfxU32 reserved[7]; /*!< Reserved for future use. */
/*! Hint to enable low power consumption mode for encoders. See the CodingOptionValue enumerator for values
of this option. Use the Query API function to check if this feature is supported. */
mfxU16 LowPower;
/*! Specifies a multiplier for bitrate control parameters. Affects the following variables: InitialDelayInKB, BufferSizeInKB,
TargetKbps, MaxKbps. If this value is not equal to zero, the encoder calculates BRC parameters as ``value * BRCParamMultiplier``. */
mfxU16 BRCParamMultiplier;
mfxFrameInfo FrameInfo; /*!< mfxFrameInfo structure that specifies frame parameters. */
mfxU32 CodecId; /*!< Specifies the codec format identifier in the FourCC code; see the CodecFormatFourCC enumerator for details.
This is a mandated input parameter for the QueryIOSurf and Init API functions. */
mfxU16 CodecProfile; /*!< Specifies the codec profile; see the CodecProfile enumerator for details. Specify the codec profile explicitly or the API functions will determine
the correct profile from other sources, such as resolution and bitrate. */
mfxU16 CodecLevel; /*!< Codec level; see the CodecLevel enumerator for details. Specify the codec level explicitly or the functions will determine the correct level from other sources,
such as resolution and bitrate. */
mfxU16 NumThread;
union {
struct { /* Encoding Options */
mfxU16 TargetUsage; /*!< Target usage model that guides the encoding process; see the TargetUsage enumerator for details. */
/*! Number of pictures within the current GOP (Group of Pictures); if GopPicSize = 0, then the GOP size is unspecified. If GopPicSize = 1, only I-frames are used.
The following pseudo-code that shows how the library uses this parameter:
@code
mfxU16 get_gop_sequence (...) {
pos=display_frame_order;
if (pos == 0)
return MFX_FRAMETYPE_I | MFX_FRAMETYPE_IDR | MFX_FRAMETYPE_REF;
If (GopPicSize == 1) // Only I-frames
return MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF;
if (GopPicSize == 0)
frameInGOP = pos; //Unlimited GOP
else
frameInGOP = pos%GopPicSize;
if (frameInGOP == 0)
return MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF;
if (GopRefDist == 1 || GopRefDist == 0) // Only I,P frames
return MFX_FRAMETYPE_P | MFX_FRAMETYPE_REF;
frameInPattern = (frameInGOP-1)%GopRefDist;
if (frameInPattern == GopRefDist - 1)
return MFX_FRAMETYPE_P | MFX_FRAMETYPE_REF;
return MFX_FRAMETYPE_B;
}
@endcode */
mfxU16 GopPicSize;
/*! Distance between I- or P (or GPB) - key frames; if it is zero, the GOP structure is unspecified. Note: If GopRefDist = 1,
there are no regular B-frames used (only P or GPB); if mfxExtCodingOption3::GPB is ON, GPB frames (B without backward
references) are used instead of P. */
mfxU16 GopRefDist;
/*! ORs of the GopOptFlag enumerator indicate the additional flags for the GOP specification. */
mfxU16 GopOptFlag;
/*! For H.264, specifies IDR-frame interval in terms of I-frames.
For example:
@li If IdrInterval = 0, then every I-frame is an IDR-frame.
@li If IdrInterval = 1, then every other I-frame is an IDR-frame.
For HEVC, if IdrInterval = 0, then only first I-frame is an IDR-frame. For example:
@li If IdrInterval = 1, then every I-frame is an IDR-frame.
@li If IdrInterval = 2, then every other I-frame is an IDR-frame.
For MPEG2, IdrInterval defines sequence header interval in terms of I-frames. For example:
@li If IdrInterval = 0 (default), then the sequence header is inserted once at the beginning of the stream.
@li If IdrInterval = N, then the sequence header is inserted before every Nth I-frame.
If GopPicSize or GopRefDist is zero, IdrInterval is undefined. */
mfxU16 IdrInterval;
mfxU16 RateControlMethod; /*! Rate control method; see the RateControlMethod enumerator for details. */
union {
/*! Initial size of the Video Buffering Verifier (VBV) buffer.
@note In this context, KB is 1000 bytes and Kbps is 1000 bps. */
mfxU16 InitialDelayInKB;
/*! Quantization Parameter (QP) for I-frames for constant QP mode (CQP). Zero QP is not valid and means that the default value is assigned by the library.
Non-zero QPI might be clipped to supported QPI range.
@note In the HEVC design, a further adjustment to QPs can occur based on bit depth.
Adjusted QPI value = QPI - (6 * (BitDepthLuma - 8)) for BitDepthLuma in the range [8,14].
For HEVC_MAIN10, we minus (6*(10-8)=12) on our side and continue.
@note Default QPI value is implementation dependent and subject to change without additional notice in this document. */
mfxU16 QPI;
mfxU16 Accuracy; /*!< Specifies accuracy range in the unit of tenth of percent. */
};
mfxU16 BufferSizeInKB; /*!< Represents the maximum possible size of any compressed frames. */
union {
/*! Constant bitrate TargetKbps. Used to estimate the targeted frame size by dividing the frame rate by the bitrate. */
mfxU16 TargetKbps;
/*! Quantization Parameter (QP) for P-frames for constant QP mode (CQP). Zero QP is not valid and means that the default value is assigned by the library.
Non-zero QPP might be clipped to supported QPI range.
@note In the HEVC design, a further adjustment to QPs can occur based on bit depth.
Adjusted QPP value = QPP - (6 * (BitDepthLuma - 8)) for BitDepthLuma in the range [8,14].
For HEVC_MAIN10, we minus (6*(10-8)=12) on our side and continue.
@note Default QPP value is implementation dependent and subject to change without additional notice in this document. */
mfxU16 QPP;
mfxU16 ICQQuality; /*!< Used by the Intelligent Constant Quality (ICQ) bitrate control algorithm. Values are in the 1 to 51 range, where 1 corresponds the best quality. */
};
union {
/*! The maximum bitrate at which the encoded data enters the Video Buffering Verifier (VBV) buffer. */
mfxU16 MaxKbps;
/*! Quantization Parameter (QP) for B-frames for constant QP mode (CQP). Zero QP is not valid and means that the default value is assigned by the library.
Non-zero QPI might be clipped to supported QPB range.
@note In the HEVC design, a further adjustment to QPs can occur based on bit depth.
Adjusted QPB value = QPB - (6 * (BitDepthLuma - 8)) for BitDepthLuma in the range [8,14].
For HEVC_MAIN10, we minus (6*(10-8)=12) on our side and continue.
@note Default QPB value is implementation dependent and subject to change without additional notice in this document. */
mfxU16 QPB;
mfxU16 Convergence; /*!< Convergence period in the unit of 100 frames. */
};
/*! Number of slices in each video frame. Each slice contains one or more macro-block rows. If NumSlice equals zero, the encoder may choose any slice partitioning
allowed by the codec standard. See also mfxExtCodingOption2::NumMbPerSlice. */
mfxU16 NumSlice;
/*! Max number of all available reference frames (for AVC/HEVC, NumRefFrame defines DPB size). If NumRefFrame = 0, this parameter is not specified.
See also NumRefActiveP, NumRefActiveBL0, and NumRefActiveBL1 in the mfxExtCodingOption3 structure, which set a number of active references. */
mfxU16 NumRefFrame;
/*! If not zero, specifies that ENCODE takes the input surfaces in the encoded order and uses explicit frame type control.
The application must still provide GopRefDist and mfxExtCodingOption2::BRefType so the library can pack headers and build reference
lists correctly. */
mfxU16 EncodedOrder;
};
struct { /* Decoding Options */
/*! For AVC and HEVC, used to instruct the decoder to return output frames in the decoded order. Must be zero for all other decoders.
When enabled, correctness of mfxFrameData::TimeStamp and FrameOrder for output surface is not guaranteed, the application should ignore them. */
mfxU16 DecodedOrder;
/*! Instructs DECODE to output extended picture structure values for additional display attributes. See the PicStruct description for details. */
mfxU16 ExtendedPicStruct;
/*! Time stamp calculation method. See the TimeStampCalc description for details. */
mfxU16 TimeStampCalc;
/*! Nonzero value indicates that slice groups are present in the bitstream. Used only by AVC decoder. */
mfxU16 SliceGroupsPresent;
/*! Nonzero value specifies the maximum required size of the decoded picture buffer in frames for AVC and HEVC decoders. */
mfxU16 MaxDecFrameBuffering;
/*! For decoders supporting dynamic resolution change (VP9), set this option to ON to allow MFXVideoDECODE_DecodeFrameAsync
return MFX_ERR_REALLOC_SURFACE. See the CodingOptionValue enumerator for values of this option. Use the Query API
function to check if this feature is supported. */
mfxU16 EnableReallocRequest;
/*! Special parameter for AV1 decoder. Indicates presence/absence of film grain parameters in bitstream.
Also controls decoding behavior for streams with film grain parameters. MFXVideoDECODE_DecodeHeader returns nonzero FilmGrain
for streams with film grain parameters and zero for streams w/o them. Decoding with film grain requires additional output surfaces.
If FilmGrain` is non-zero then MFXVideoDECODE_QueryIOSurf will request more surfaces in case of external allocated video memory at decoder output.
FilmGrain is passed to MFXVideoDECODE_Init function to control decoding operation for AV1 streams with film grain parameters.
If FilmGrain is nonzero decoding of each frame require two output surfaces (one for reconstructed frame and one for output frame with film grain applied).
The decoder returns MFX_ERR_MORE_SURFACE from MFXVideoDECODE_DecodeFrameAsync if it has insufficient output surfaces to decode frame.
Application can forcibly disable the feature passing zero value of `FilmGrain` to `MFXVideoDECODE_Init`.
In this case the decoder will output reconstructed frames w/o film grain applied.
Application can retrieve film grain parameters for a frame by attaching extended buffer mfxExtAV1FilmGrainParam to mfxFrameSurface1.
If stream has no film grain parameters `FilmGrain` passed to `MFXVideoDECODE_Init` is ignored by the decoder. */
mfxU16 FilmGrain;
/*! If not zero, it forces SDK to attempt to decode bitstream even if a decoder may not support all features associated with given CodecLevel. Decoder may produce visual artifacts. Only AVC decoder supports this field. */
mfxU16 IgnoreLevelConstrain;
/*! This flag is used to disable output of main decoding channel. When it's ON SkipOutput = MFX_CODINGOPTION_ON decoder outputs only video processed channels. For pure decode this flag should be always disabled. */
mfxU16 SkipOutput;
mfxU16 reserved2[4];
};
struct { /* JPEG Decoding Options */
/*! Specify the chroma sampling format that has been used to encode a JPEG picture. See the ChromaFormat enumerator for details. */
mfxU16 JPEGChromaFormat;
/*! Rotation option of the output JPEG picture. See the Rotation enumerator for details. */
mfxU16 Rotation;
/*! Specify the color format that has been used to encode a JPEG picture. See the JPEGColorFormat enumerator for details. */
mfxU16 JPEGColorFormat;
/*! Specify JPEG scan type for decoder. See the JPEGScanType enumerator for details. */
mfxU16 InterleavedDec;
mfxU8 SamplingFactorH[4]; /*!< Horizontal sampling factor. */
mfxU8 SamplingFactorV[4]; /*!< Vertical sampling factor. */
mfxU16 reserved3[5];
};
struct { /* JPEG Encoding Options */
/*! Specify interleaved or non-interleaved scans. If it is equal to MFX_SCANTYPE_INTERLEAVED then the image is encoded as interleaved,
all components are encoded in one scan. See the JPEG Scan Type enumerator for details. */
mfxU16 Interleaved;
/*! Specifies the image quality if the application does not specified quantization table.
The value is from 1 to 100 inclusive. "100" is the best quality. */
mfxU16 Quality;
/*! Specifies the number of MCU in the restart interval. "0" means no restart interval. */
mfxU16 RestartInterval;
mfxU16 reserved5[10];
};
};
} mfxInfoMFX;
MFX_PACK_END()
MFX_PACK_BEGIN_USUAL_STRUCT()
/*! Specifies configurations for video processing. A zero value in any of the fields indicates
that the corresponding field is not explicitly specified. */
typedef struct {
mfxU32 reserved[8];
mfxFrameInfo In; /*!< Input format for video processing. */
mfxFrameInfo Out; /*!< Output format for video processing. */
} mfxInfoVPP;
MFX_PACK_END()
MFX_PACK_BEGIN_STRUCT_W_PTR()
/*! Configuration parameters for encoding, decoding, transcoding, and video processing. */
typedef struct {
/*! Unique component ID that will be passed by the library to mfxFrameAllocRequest. Useful in pipelines where several
components of the same type share the same allocator. */
mfxU32 AllocId;
mfxU32 reserved[2];
mfxU16 reserved3;
/*! Specifies how many asynchronous operations an application performs before the application explicitly synchronizes the result.
If zero, the value is not specified. */
mfxU16 AsyncDepth;
union {
mfxInfoMFX mfx; /*!< Configurations related to encoding, decoding, and transcoding. See the definition of the mfxInfoMFX structure for details. */
mfxInfoVPP vpp; /*!< Configurations related to video processing. See the definition of the mfxInfoVPP structure for details. */
};
/*! Specifies the content protection mechanism. See the Protected enumerator for a list of supported protection schemes. */
mfxU16 Protected;
/*! Input and output memory access types for functions. See the enumerator IOPattern for details.
The Query API functions return the natively supported IOPattern if the Query input argument is NULL.
This parameter is a mandated input for QueryIOSurf and Init API functions. The output pattern must be specified for DECODE.
The input pattern must be specified for ENCODE. Both input and output pattern must be specified for VPP. */
mfxU16 IOPattern;
mfxExtBuffer** ExtParam; /*!< The number of extra configuration structures attached to this structure. */
mfxU16 NumExtParam; /*!< Points to an array of pointers to the extra configuration structures. See the ExtendedBufferID enumerator
for a list of extended configurations.
The list of extended buffers should not contain duplicated entries, such as entries of the same type.
If the mfxVideoParam structure is used to query library capability, then the list of extended buffers attached to the input
and output mfxVideoParam structure should be equal, that is, it should contain the same number of extended
buffers of the same type. */
mfxU16 reserved2;
} mfxVideoParam;
MFX_PACK_END()
/*! The IOPattern enumerator itemizes memory access patterns for API functions. Use bit-ORed values to specify an input access
pattern and an output access pattern. */
enum {
MFX_IOPATTERN_IN_VIDEO_MEMORY = 0x01, /*!< Input to functions is a video memory surface. */
MFX_IOPATTERN_IN_SYSTEM_MEMORY = 0x02, /*!< Input to functions is a linear buffer directly in system memory or in system memory through an external allocator. */
MFX_IOPATTERN_OUT_VIDEO_MEMORY = 0x10, /*!< Output to functions is a video memory surface. */
MFX_IOPATTERN_OUT_SYSTEM_MEMORY = 0x20 /*!< Output to functions is a linear buffer directly in system memory or in system memory through an external allocator. */
};
/*! The CodecFormatFourCC enumerator itemizes codecs in the FourCC format. */
enum {
MFX_CODEC_AVC =MFX_MAKEFOURCC('A','V','C',' '), /*!< AVC, H.264, or MPEG-4, part 10 codec. */
MFX_CODEC_HEVC =MFX_MAKEFOURCC('H','E','V','C'), /*!< HEVC codec. */
MFX_CODEC_MPEG2 =MFX_MAKEFOURCC('M','P','G','2'), /*!< MPEG-2 codec. */
MFX_CODEC_VC1 =MFX_MAKEFOURCC('V','C','1',' '), /*!< VC-1 codec. */
MFX_CODEC_CAPTURE =MFX_MAKEFOURCC('C','A','P','T'), /*!< */
MFX_CODEC_VP9 =MFX_MAKEFOURCC('V','P','9',' '), /*!< VP9 codec. */
MFX_CODEC_AV1 =MFX_MAKEFOURCC('A','V','1',' ') /*!< AV1 codec. */
};
/*!
The CodecProfile enumerator itemizes codec profiles for all codecs.
CodecLevel
*/
enum {
MFX_PROFILE_UNKNOWN =0, /*!< Unspecified profile. */
MFX_LEVEL_UNKNOWN =0, /*!< Unspecified level. */
/*! @{ */
/* Combined with H.264 profile these flags impose additional constrains. See H.264 specification for the list of constrains. */
MFX_PROFILE_AVC_CONSTRAINT_SET0 = (0x100 << 0),
MFX_PROFILE_AVC_CONSTRAINT_SET1 = (0x100 << 1),
MFX_PROFILE_AVC_CONSTRAINT_SET2 = (0x100 << 2),
MFX_PROFILE_AVC_CONSTRAINT_SET3 = (0x100 << 3),
MFX_PROFILE_AVC_CONSTRAINT_SET4 = (0x100 << 4),
MFX_PROFILE_AVC_CONSTRAINT_SET5 = (0x100 << 5),
/*! @} */
/*! @{ */
/* H.264 Profiles. */
MFX_PROFILE_AVC_BASELINE =66,
MFX_PROFILE_AVC_MAIN =77,
MFX_PROFILE_AVC_EXTENDED =88,
MFX_PROFILE_AVC_HIGH =100,
MFX_PROFILE_AVC_HIGH10 =110,
MFX_PROFILE_AVC_HIGH_422 =122,
MFX_PROFILE_AVC_CONSTRAINED_BASELINE =MFX_PROFILE_AVC_BASELINE + MFX_PROFILE_AVC_CONSTRAINT_SET1,
MFX_PROFILE_AVC_CONSTRAINED_HIGH =MFX_PROFILE_AVC_HIGH + MFX_PROFILE_AVC_CONSTRAINT_SET4
+ MFX_PROFILE_AVC_CONSTRAINT_SET5,
MFX_PROFILE_AVC_PROGRESSIVE_HIGH =MFX_PROFILE_AVC_HIGH + MFX_PROFILE_AVC_CONSTRAINT_SET4,
/*! @} */
/*! @{ */
/* H.264 level 1-1.3 */
MFX_LEVEL_AVC_1 =10,
MFX_LEVEL_AVC_1b =9,
MFX_LEVEL_AVC_11 =11,
MFX_LEVEL_AVC_12 =12,
MFX_LEVEL_AVC_13 =13,
/*! @} */
/*! @{ */
/* H.264 level 2-2.2 */
MFX_LEVEL_AVC_2 =20,
MFX_LEVEL_AVC_21 =21,
MFX_LEVEL_AVC_22 =22,
/*! @} */
/*! @{ */
/* H.264 level 3-3.2 */
MFX_LEVEL_AVC_3 =30,
MFX_LEVEL_AVC_31 =31,
MFX_LEVEL_AVC_32 =32,
/*! @} */
/*! @{ */
/* H.264 level 4-4.2 */
MFX_LEVEL_AVC_4 =40,
MFX_LEVEL_AVC_41 =41,
MFX_LEVEL_AVC_42 =42,
/*! @} */
/*! @{ */
/* H.264 level 5-5.2 */
MFX_LEVEL_AVC_5 =50,
MFX_LEVEL_AVC_51 =51,
MFX_LEVEL_AVC_52 =52,
/*! @} */
/*! @{ */
/* H.264 level 6-6.2 */
MFX_LEVEL_AVC_6 =60,
MFX_LEVEL_AVC_61 =61,
MFX_LEVEL_AVC_62 =62,
/*! @} */
/*! @{ */
/* MPEG2 Profiles. */
MFX_PROFILE_MPEG2_SIMPLE =0x50,
MFX_PROFILE_MPEG2_MAIN =0x40,
MFX_PROFILE_MPEG2_HIGH =0x10,
/*! @} */
/*! @{ */
/* MPEG2 Levels. */
MFX_LEVEL_MPEG2_LOW =0xA,
MFX_LEVEL_MPEG2_MAIN =0x8,
MFX_LEVEL_MPEG2_HIGH =0x4,
MFX_LEVEL_MPEG2_HIGH1440 =0x6,
/*! @} */
/*! @{ */
/* VC-1 Profiles. */
MFX_PROFILE_VC1_SIMPLE =(0+1),
MFX_PROFILE_VC1_MAIN =(4+1),
MFX_PROFILE_VC1_ADVANCED =(12+1),
/*! @} */
/*! @{ */
/* VC-1 Level Low (simple & main profiles) */
MFX_LEVEL_VC1_LOW =(0+1),
MFX_LEVEL_VC1_MEDIAN =(2+1),
MFX_LEVEL_VC1_HIGH =(4+1),
/*! @} */
/*! @{ */
/* VC-1 advanced profile levels */
MFX_LEVEL_VC1_0 =(0x00+1),
MFX_LEVEL_VC1_1 =(0x01+1),
MFX_LEVEL_VC1_2 =(0x02+1),
MFX_LEVEL_VC1_3 =(0x03+1),