hardware/intel/common/libva
Révision | 30c751f7b74c43021f33361c1baf2aa92acd0317 (tree) |
---|---|
l'heure | 2018-09-04 10:44:04 |
Auteur | FurongZhang <furong.zhang@inte...> |
Commiter | XinfengZhang |
High Dynamic Range
@@ -251,6 +251,8 @@ typedef enum _VAProcFilterType { | ||
251 | 251 | VAProcFilterTotalColorCorrection, |
252 | 252 | /** \brief Human Vision System(HVS) Noise reduction filter. */ |
253 | 253 | VAProcFilterHVSNoiseReduction, |
254 | + /** \brief High Dynamic Range Tone Mapping. */ | |
255 | + VAProcFilterHighDynamicRangeToneMapping, | |
254 | 256 | /** \brief Number of video filters. */ |
255 | 257 | VAProcFilterCount |
256 | 258 | } VAProcFilterType; |
@@ -401,6 +403,10 @@ typedef enum _VAProcColorStandardType { | ||
401 | 403 | /** \brief Explicitly specified color properties. |
402 | 404 | * |
403 | 405 | * Use corresponding color properties section. |
406 | + * For example, HDR10 content: | |
407 | + * colour_primaries = 9 (BT2020) | |
408 | + * transfer_characteristics = 16 (SMPTE ST2084) | |
409 | + * matrix_coefficients = 9 | |
404 | 410 | */ |
405 | 411 | VAProcColorStandardExplicit, |
406 | 412 | /** \brief Number of color standards. */ |
@@ -425,6 +431,34 @@ typedef enum _VAProcTotalColorCorrectionType { | ||
425 | 431 | /** \brief Number of color correction attributes. */ |
426 | 432 | VAProcTotalColorCorrectionCount |
427 | 433 | } VAProcTotalColorCorrectionType; |
434 | + | |
435 | +/** \brief High Dynamic Range Metadata types. */ | |
436 | +typedef enum _VAProcHighDynamicRangeMetadataType { | |
437 | + VAProcHighDynamicRangeMetadataNone = 0, | |
438 | + /** \brief Metadata type for HDR10. */ | |
439 | + VAProcHighDynamicRangeMetadataHDR10 | |
440 | +} VAProcHighDynamicRangeMetadataType; | |
441 | + | |
442 | +/** \brief Video Processing Mode. */ | |
443 | +typedef enum _VAProcMode { | |
444 | + /** | |
445 | + * \brief Default Mode. | |
446 | + * In this mode, pipeline is decided in driver to the appropriate mode. | |
447 | + * e.g. a mode that's a balance between power and performance. | |
448 | + */ | |
449 | + VAProcDefaultMode = 0, | |
450 | + /** | |
451 | + * \brief Power Saving Mode. | |
452 | + * In this mode, pipeline is optimized for power saving. | |
453 | + */ | |
454 | + VAProcPowerSavingMode, | |
455 | + /** | |
456 | + * \brief Performance Mode. | |
457 | + * In this mode, pipeline is optimized for performance. | |
458 | + */ | |
459 | + VAProcPerformanceMode | |
460 | +} VAProcMode; | |
461 | + | |
428 | 462 | /** @name Video blending flags */ |
429 | 463 | /**@{*/ |
430 | 464 | /** \brief Global alpha blending. */ |
@@ -522,6 +556,18 @@ typedef struct _VABlendState { | ||
522 | 556 | #define VA_SOURCE_RANGE_REDUCED 1 |
523 | 557 | #define VA_SOURCE_RANGE_FULL 2 |
524 | 558 | |
559 | +/** @name Tone Mapping flags multiple HDR mode*/ | |
560 | +/**@{*/ | |
561 | +/** \brief Tone Mapping from HDR content to HDR display. */ | |
562 | +#define VA_TONE_MAPPING_HDR_TO_HDR 0x0001 | |
563 | +/** \brief Tone Mapping from HDR content to SDR display. */ | |
564 | +#define VA_TONE_MAPPING_HDR_TO_SDR 0x0002 | |
565 | +/** \brief Tone Mapping from HDR content to EDR display. */ | |
566 | +#define VA_TONE_MAPPING_HDR_TO_EDR 0x0004 | |
567 | +/** \brief Tone Mapping from SDR content to HDR display. */ | |
568 | +#define VA_TONE_MAPPING_SDR_TO_HDR 0x0008 | |
569 | +/**@}*/ | |
570 | + | |
525 | 571 | /** \brief Video processing pipeline capabilities. */ |
526 | 572 | typedef struct _VAProcPipelineCaps { |
527 | 573 | /** \brief Pipeline flags. See VAProcPipelineParameterBuffer::pipeline_flags. */ |
@@ -609,9 +655,9 @@ typedef struct _VAProcPipelineCaps { | ||
609 | 655 | uint32_t min_output_height; |
610 | 656 | /** \brief Reserved bytes for future use, must be zero */ |
611 | 657 | #if defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) || defined(__LP64__) |
612 | - uint32_t va_reserved[VA_PADDING_HIGH - 2]; | |
658 | + uint32_t va_reserved[VA_PADDING_HIGH - 2]; | |
613 | 659 | #else |
614 | - uint32_t va_reserved[VA_PADDING_HIGH]; | |
660 | + uint32_t va_reserved[VA_PADDING_HIGH]; | |
615 | 661 | #endif |
616 | 662 | } VAProcPipelineCaps; |
617 | 663 |
@@ -627,7 +673,7 @@ typedef struct _VAProcFilterValueRange { | ||
627 | 673 | float step; |
628 | 674 | |
629 | 675 | /** \brief Reserved bytes for future use, must be zero */ |
630 | - uint32_t va_reserved[VA_PADDING_LOW]; | |
676 | + uint32_t va_reserved[VA_PADDING_LOW]; | |
631 | 677 | } VAProcFilterValueRange; |
632 | 678 | |
633 | 679 | typedef struct _VAProcColorProperties { |
@@ -657,6 +703,102 @@ typedef struct _VAProcColorProperties { | ||
657 | 703 | uint8_t reserved[3]; |
658 | 704 | } VAProcColorProperties; |
659 | 705 | |
706 | +/** \berief Describes High Dynamic Range Meta Data for HDR10. */ | |
707 | +typedef struct _VAHdrMetaDataHDR10 | |
708 | +{ | |
709 | + /** | |
710 | + * \brief X chromaticity coordinate of the mastering display. | |
711 | + * | |
712 | + * Index value c equal to 0 should correspond to the green primary. | |
713 | + * Index value c equal to 1 should correspond to the blue primary. | |
714 | + * Index value c equal to 2 should correspond to the red primary. | |
715 | + * The value for display_primaries_x shall be in the range of 0 to 50000 inclusive. | |
716 | + */ | |
717 | + uint16_t display_primaries_x[3]; | |
718 | + /** | |
719 | + * \brief Y chromaticity coordinate of the mastering display. | |
720 | + * | |
721 | + * Index value c equal to 0 should correspond to the green primary. | |
722 | + * Index value c equal to 1 should correspond to the blue primary. | |
723 | + * Index value c equal to 2 should correspond to the red primary. | |
724 | + * The value for display_primaries_y shall be in the range of 0 to 50000 inclusive. | |
725 | + */ | |
726 | + uint16_t display_primaries_y[3]; | |
727 | + /** | |
728 | + * \brief X chromaticity coordinate of the white point of the mastering display. | |
729 | + * | |
730 | + * The value for white_point_x shall be in the range of 0 to 50000 inclusive. | |
731 | + */ | |
732 | + uint16_t white_point_x; | |
733 | + /** | |
734 | + * \brief Y chromaticity coordinate of the white point of the mastering display. | |
735 | + * | |
736 | + * The value for white_point_y shall be in the range of 0 to 50000 inclusive. | |
737 | + */ | |
738 | + uint16_t white_point_y; | |
739 | + /** | |
740 | + * \brief The maximum display luminance of the mastering display. | |
741 | + * | |
742 | + * The value is in units of 0.0001 candelas per square metre. | |
743 | + */ | |
744 | + uint32_t max_display_mastering_luminance; | |
745 | + /** | |
746 | + * \brief The minumum display luminance of the mastering display. | |
747 | + * | |
748 | + * The value is in units of 0.0001 candelas per square metre. | |
749 | + */ | |
750 | + uint32_t min_display_mastering_luminance; | |
751 | + /** | |
752 | + * \brief The maximum content light level. | |
753 | + * | |
754 | + * The value is in units of 0.0001 candelas per square metre. | |
755 | + */ | |
756 | + uint16_t max_content_light_level; | |
757 | + /** | |
758 | + * \brief The maximum picture average light level. | |
759 | + * | |
760 | + * The value is in units of 0.0001 candelas per square metre. | |
761 | + */ | |
762 | + uint16_t max_pic_average_light_level; | |
763 | + /** Resevered */ | |
764 | + uint16_t reserved[VA_PADDING_HIGH]; | |
765 | +} VAHdrMetaDataHDR10; | |
766 | + | |
767 | +/** \brief Capabilities specification for the High Dynamic Range filter. */ | |
768 | +typedef struct _VAProcFilterCapHighDynamicRange { | |
769 | + /** \brief high dynamic range type. */ | |
770 | + VAProcHighDynamicRangeMetadataType metadata_type; | |
771 | + /** | |
772 | + * \brief flag for high dynamic range tone mapping | |
773 | + * | |
774 | + * The flag is the combination of VA_TONE_MAPPING_XXX_TO_XXX. | |
775 | + * It could be VA_TONE_MAPPING_HDR_TO_HDR | VA_TONE_MAPPING_HDR_TO_SDR. | |
776 | + * SDR content to SDR display is always supported by default since it is legacy path. | |
777 | + */ | |
778 | + uint16_t caps_flag; | |
779 | + /** \brief Reserved bytes for future use, must be zero */ | |
780 | + uint16_t va_reserved[VA_PADDING_HIGH]; | |
781 | +} VAProcFilterCapHighDynamicRange; | |
782 | + | |
783 | +/** \brief High Dynamic Range Meta Data. */ | |
784 | +typedef struct _VAHdrMetaData | |
785 | +{ | |
786 | + /** \brief high dynamic range metadata type, HDR10 etc. */ | |
787 | + VAProcHighDynamicRangeMetadataType metadata_type; | |
788 | + /** | |
789 | + * \brief Pointer to high dynamic range metadata. | |
790 | + * | |
791 | + * The pointer could point to VAHdrMetaDataHDR10 or other HDR meta data. | |
792 | + */ | |
793 | + void* metadata; | |
794 | + /** | |
795 | + * \brief Size of high dynamic range metadata. | |
796 | + */ | |
797 | + uint32_t metadata_size; | |
798 | + /** \brief Reserved bytes for future use, must be zero */ | |
799 | + uint32_t reserved[VA_PADDING_LOW]; | |
800 | +} VAHdrMetaData; | |
801 | + | |
660 | 802 | /** |
661 | 803 | * \brief Video processing pipeline configuration. |
662 | 804 | * |
@@ -719,7 +861,7 @@ typedef struct _VAProcPipelineParameterBuffer { | ||
719 | 861 | * |
720 | 862 | * Pointer to a #VARectangle defining the region within the output |
721 | 863 | * surface that receives the processed pixels. If NULL, \c output_region |
722 | - * implies the whole surface. | |
864 | + * implies the whole surface. | |
723 | 865 | * |
724 | 866 | * Note that any pixels residing outside the specified region will |
725 | 867 | * be filled in with the \ref output_background_color. |
@@ -768,7 +910,7 @@ typedef struct _VAProcPipelineParameterBuffer { | ||
768 | 910 | * \c VA_BOTTOM_FIELD. Note that any deinterlacing filter |
769 | 911 | * (#VAProcFilterDeinterlacing) will override those flags. |
770 | 912 | * - Color space conversion: \c VA_SRC_BT601, \c VA_SRC_BT709, |
771 | - * \c VA_SRC_SMPTE_240. | |
913 | + * \c VA_SRC_SMPTE_240. | |
772 | 914 | * - Scaling: \c VA_FILTER_SCALING_DEFAULT, \c VA_FILTER_SCALING_FAST, |
773 | 915 | * \c VA_FILTER_SCALING_HQ, \c VA_FILTER_SCALING_NL_ANAMORPHIC. |
774 | 916 | */ |
@@ -787,15 +929,15 @@ typedef struct _VAProcPipelineParameterBuffer { | ||
787 | 929 | */ |
788 | 930 | VABufferID *filters; |
789 | 931 | /** \brief Actual number of filters. */ |
790 | - uint32_t num_filters; | |
932 | + uint32_t num_filters; | |
791 | 933 | /** \brief Array of forward reference frames. */ |
792 | 934 | VASurfaceID *forward_references; |
793 | 935 | /** \brief Number of forward reference frames that were supplied. */ |
794 | - uint32_t num_forward_references; | |
936 | + uint32_t num_forward_references; | |
795 | 937 | /** \brief Array of backward reference frames. */ |
796 | 938 | VASurfaceID *backward_references; |
797 | 939 | /** \brief Number of backward reference frames that were supplied. */ |
798 | - uint32_t num_backward_references; | |
940 | + uint32_t num_backward_references; | |
799 | 941 | /** |
800 | 942 | * \brief Rotation state. See rotation angles. |
801 | 943 | * |
@@ -866,16 +1008,30 @@ typedef struct _VAProcPipelineParameterBuffer { | ||
866 | 1008 | * bit 1~31 for future |
867 | 1009 | */ |
868 | 1010 | uint32_t output_surface_flag; |
869 | - | |
1011 | + /** | |
1012 | + * \brief Input Color Properties. See "VAProcColorProperties". | |
1013 | + */ | |
870 | 1014 | VAProcColorProperties input_color_properties; |
871 | - | |
1015 | + /** | |
1016 | + * \brief Output Color Properties. See "VAProcColorProperties". | |
1017 | + */ | |
872 | 1018 | VAProcColorProperties output_color_properties; |
1019 | + /** | |
1020 | + * \brief Processing mode. See "VAProcMode". | |
1021 | + */ | |
1022 | + VAProcMode processing_mode; | |
1023 | + /** | |
1024 | + * \brief Output High Dynamic Metadata. | |
1025 | + * | |
1026 | + * If output_metadata is NULL, then output default to SDR. | |
1027 | + */ | |
1028 | + VAHdrMetaData *output_hdr_metadata; | |
873 | 1029 | |
874 | 1030 | /** \brief Reserved bytes for future use, must be zero */ |
875 | 1031 | #if defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__)|| defined(__LP64__) |
876 | - uint32_t va_reserved[VA_PADDING_LARGE - 13]; | |
1032 | + uint32_t va_reserved[VA_PADDING_LARGE - 16]; | |
877 | 1033 | #else |
878 | - uint32_t va_reserved[VA_PADDING_LARGE - 11]; | |
1034 | + uint32_t va_reserved[VA_PADDING_LARGE - 13]; | |
879 | 1035 | #endif |
880 | 1036 | } VAProcPipelineParameterBuffer; |
881 | 1037 |