hardware/intel/common/libva
リビジョン | a0ec74e194283b1cb8a0d2e5ffa961644fcab31f (tree) |
---|---|
日時 | 2018-05-14 12:19:16 |
作者 | Mark Thompson <sw@jkqx...> |
コミッター | Xiang, Haihao |
Improve documentation for rate control parameters
Signed-off-by: Mark Thompson <sw@jkqxz.net>
@@ -1822,37 +1822,70 @@ typedef struct _VAEncMiscParameterTemporalLayerStructure | ||
1822 | 1822 | /** \brief Rate control parameters */ |
1823 | 1823 | typedef struct _VAEncMiscParameterRateControl |
1824 | 1824 | { |
1825 | - /* this is the maximum bit-rate to be constrained by the rate control implementation */ | |
1825 | + /** The maximum bit-rate which the the rate controller should generate. */ | |
1826 | 1826 | uint32_t bits_per_second; |
1827 | - /* this is the bit-rate the rate control is targeting, as a percentage of the maximum | |
1828 | - * bit-rate for example if target_percentage is 95 then the rate control will target | |
1829 | - * a bit-rate that is 95% of the maximum bit-rate | |
1827 | + /** The target bit-rate which the rate controller should generate, as a percentage of the | |
1828 | + * maximum bit-rate. | |
1829 | + * | |
1830 | + * In CBR mode this value is ignored (treated as 100%). | |
1830 | 1831 | */ |
1831 | 1832 | uint32_t target_percentage; |
1832 | - /* windows size in milliseconds. For example if this is set to 500, | |
1833 | - * then the rate control will guarantee the target bit-rate over a 500 ms window | |
1833 | + /** Rate control window size in milliseconds. | |
1834 | + * | |
1835 | + * The rate controller will attempt to guarantee that the target and maximum bit-rates are | |
1836 | + * correct over this window. | |
1834 | 1837 | */ |
1835 | 1838 | uint32_t window_size; |
1836 | - /* initial QP at I frames */ | |
1839 | + /** Initial quantiser value used at the start of the stream. | |
1840 | + * | |
1841 | + * Ignored if set to zero. | |
1842 | + */ | |
1837 | 1843 | uint32_t initial_qp; |
1844 | + /** Minimum quantiser value to use. | |
1845 | + * | |
1846 | + * The quantiser will not go below the value - if this limit is hit, the output bitrate may | |
1847 | + * be lower than the target. Ignored if set to zero. | |
1848 | + */ | |
1838 | 1849 | uint32_t min_qp; |
1850 | + /** Basic unit size. | |
1851 | + * | |
1852 | + * Only used by some drivers - see driver documentation for details. Set to zero if unused. | |
1853 | + */ | |
1839 | 1854 | uint32_t basic_unit_size; |
1840 | 1855 | union |
1841 | 1856 | { |
1842 | 1857 | struct |
1843 | 1858 | { |
1859 | + /** Force rate controller reset. | |
1860 | + * | |
1861 | + * The next frame will be treated as the start of a new stream, with all rate | |
1862 | + * controller state reset to its initial values. | |
1863 | + */ | |
1844 | 1864 | uint32_t reset : 1; |
1845 | - uint32_t disable_frame_skip : 1; /* Disable frame skip in rate control mode */ | |
1846 | - uint32_t disable_bit_stuffing : 1; /* Disable bit stuffing in rate control mode */ | |
1847 | - uint32_t mb_rate_control : 4; /* Control VA_RC_MB 0: default, 1: enable, 2: disable, other: reserved*/ | |
1848 | - /* | |
1849 | - * The temporal layer that the rate control parameters are specified for. | |
1865 | + /** Disable frame skip in rate control mode. */ | |
1866 | + uint32_t disable_frame_skip : 1; | |
1867 | + /** Disable bit stuffing in rate control mode. */ | |
1868 | + uint32_t disable_bit_stuffing : 1; | |
1869 | + /** Macroblock-level rate control. | |
1870 | + * | |
1871 | + * 0: use default, 1: always enable, 2: always disable, other: reserved. | |
1872 | + * | |
1873 | + * This feature is only available if VAConfigAttribRateControl has the | |
1874 | + * \ref VA_RC_MB bit set. | |
1850 | 1875 | */ |
1876 | + uint32_t mb_rate_control : 4; | |
1877 | + /** The temporal layer that these rate control parameters apply to. */ | |
1851 | 1878 | uint32_t temporal_id : 8; |
1852 | - uint32_t cfs_I_frames : 1; /* I frame also follows CFS */ | |
1879 | + /** Ensure that intra frames also conform to the constant frame size. */ | |
1880 | + uint32_t cfs_I_frames : 1; | |
1881 | + /** Enable parallel rate control for hierarchical B frames. | |
1882 | + * | |
1883 | + * See \ref VA_RC_PARALLEL. | |
1884 | + */ | |
1853 | 1885 | uint32_t enable_parallel_brc : 1; |
1854 | 1886 | uint32_t enable_dynamic_scaling : 1; |
1855 | - /** \brief Frame Tolerance Mode | |
1887 | + /** Frame tolerance mode. | |
1888 | + * | |
1856 | 1889 | * Indicates the tolerance the application has to variations in the frame size. |
1857 | 1890 | * For example, wireless display scenarios may require very steady bit rate to |
1858 | 1891 | * reduce buffering time. It affects the rate control algorithm used, |
@@ -1866,13 +1899,23 @@ typedef struct _VAEncMiscParameterRateControl | ||
1866 | 1899 | * other -- invalid. |
1867 | 1900 | */ |
1868 | 1901 | uint32_t frame_tolerance_mode : 2; |
1902 | + /** Reserved for future use, must be zero. */ | |
1869 | 1903 | uint32_t reserved : 12; |
1870 | 1904 | } bits; |
1871 | 1905 | uint32_t value; |
1872 | 1906 | } rc_flags; |
1873 | - uint32_t ICQ_quality_factor; /* Initial ICQ quality factor: 1-51. */ | |
1874 | - /** \brief Reserved bytes for future use, must be zero */ | |
1907 | + /** Initial quality factor used in ICQ mode. | |
1908 | + * | |
1909 | + * This value must be between 1 and 51. | |
1910 | + */ | |
1911 | + uint32_t ICQ_quality_factor; | |
1912 | + /** Maximum quantiser value to use. | |
1913 | + * | |
1914 | + * The quantiser will not go above this value - if this limit is hit, the output bitrate | |
1915 | + * may exceed the target. Ignored if set to zero. | |
1916 | + */ | |
1875 | 1917 | uint32_t max_qp; |
1918 | + /** Reserved bytes for future use, must be zero. */ | |
1876 | 1919 | uint32_t va_reserved[VA_PADDING_MEDIUM - 2]; |
1877 | 1920 | } VAEncMiscParameterRateControl; |
1878 | 1921 |