hardware/intel/common/libva
Révision | 2c78d8b2753f1edf785d570aa125c526b7daf081 (tree) |
---|---|
l'heure | 2017-11-22 16:27:31 |
Auteur | Jonathan Bian <jonathan.bian@inte...> |
Commiter | Xiang, Haihao |
add Encoding quantization
quary or get whether the driver supports certain types of quantization methods
for encoding (e.g. trellis).then set quantization setting by VAEncMiscParameterQuantization
Signed-off-by: Carl.Zhang <carl.zhang@intel.com>
@@ -536,6 +536,13 @@ typedef enum | ||
536 | 536 | */ |
537 | 537 | VAConfigAttribEncQualityRange = 21, |
538 | 538 | /** |
539 | + * \brief Encoding quantization attribute. Read-only. | |
540 | + * | |
541 | + * This attribute conveys whether the driver supports certain types of quantization methods | |
542 | + * for encoding (e.g. trellis). See \c VA_ENC_QUANTIZATION_xxx for the list of quantization methods | |
543 | + */ | |
544 | + VAConfigAttribEncQuantization = 22, | |
545 | + /** | |
539 | 546 | * \brief Encoding skip frame attribute. Read-only. |
540 | 547 | * |
541 | 548 | * This attribute conveys whether the driver supports sending skip frame parameters |
@@ -736,6 +743,13 @@ typedef union _VAConfigAttribValEncJPEG { | ||
736 | 743 | uint32_t value; |
737 | 744 | } VAConfigAttribValEncJPEG; |
738 | 745 | |
746 | +/** @name Attribute values for VAConfigAttribEncQuantization */ | |
747 | +/**@{*/ | |
748 | +/** \brief Driver does not support special types of quantization */ | |
749 | +#define VA_ENC_QUANTIZATION_NONE 0x00000000 | |
750 | +/** \brief Driver supports trellis quantization */ | |
751 | +#define VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED 0x00000001 | |
752 | +/**@}*/ | |
739 | 753 | /** \brief Attribute value for VAConfigAttribEncROI */ |
740 | 754 | typedef union _VAConfigAttribValEncROI { |
741 | 755 | struct { |
@@ -1380,6 +1394,8 @@ typedef enum | ||
1380 | 1394 | /** \brief Buffer type used for HRD parameters. */ |
1381 | 1395 | VAEncMiscParameterTypeHRD = 5, |
1382 | 1396 | VAEncMiscParameterTypeQualityLevel = 6, |
1397 | + /** \brief Buffer type used for quantization parameters, it's per-sequence parameter*/ | |
1398 | + VAEncMiscParameterTypeQuantization = 8, | |
1383 | 1399 | /** \brief Buffer type used for sending skip frame parameters to the encoder's |
1384 | 1400 | * rate control, when the user has externally skipped frames. */ |
1385 | 1401 | VAEncMiscParameterTypeSkipFrame = 9, |
@@ -1625,6 +1641,33 @@ typedef struct _VAEncMiscParameterBufferQualityLevel { | ||
1625 | 1641 | } VAEncMiscParameterBufferQualityLevel; |
1626 | 1642 | |
1627 | 1643 | /** |
1644 | + * \brief Quantization settings for encoding. | |
1645 | + * | |
1646 | + * Some encoders support special types of quantization such as trellis, and this structure | |
1647 | + * can be used by the app to control these special types of quantization by the encoder. | |
1648 | + */ | |
1649 | +typedef struct _VAEncMiscParameterQuantization | |
1650 | +{ | |
1651 | + union | |
1652 | + { | |
1653 | + /* if no flags is set then quantization is determined by the driver */ | |
1654 | + struct | |
1655 | + { | |
1656 | + /* \brief disable trellis for all frames/fields */ | |
1657 | + uint64_t disable_trellis : 1; | |
1658 | + /* \brief enable trellis for I frames/fields */ | |
1659 | + uint64_t enable_trellis_I : 1; | |
1660 | + /* \brief enable trellis for P frames/fields */ | |
1661 | + uint64_t enable_trellis_P : 1; | |
1662 | + /* \brief enable trellis for B frames/fields */ | |
1663 | + uint64_t enable_trellis_B : 1; | |
1664 | + uint64_t reserved : 28; | |
1665 | + } bits; | |
1666 | + uint64_t value; | |
1667 | + } quantization_flags; | |
1668 | +} VAEncMiscParameterQuantization; | |
1669 | + | |
1670 | +/** | |
1628 | 1671 | * \brief Encoding skip frame. |
1629 | 1672 | * |
1630 | 1673 | * The application may choose to skip frames externally to the encoder (e.g. drop completely or |
@@ -101,6 +101,7 @@ const char *vaConfigAttribTypeStr(VAConfigAttribType configAttribType) | ||
101 | 101 | TOSTR(VAConfigAttribDecJPEG); |
102 | 102 | TOSTR(VAConfigAttribMaxPictureWidth); |
103 | 103 | TOSTR(VAConfigAttribMaxPictureHeight); |
104 | + TOSTR(VAConfigAttribEncQuantization); | |
104 | 105 | case VAConfigAttribTypeMax: break; |
105 | 106 | } |
106 | 107 | return "<unknown config attribute type>"; |