diff options
author | Zhong Li <zhong.li@intel.com> | 2019-01-23 19:16:17 +0800 |
---|---|---|
committer | Zhong Li <zhong.li@intel.com> | 2019-01-25 16:53:27 +0800 |
commit | 74cf2dc3ac405c5e55b7ecd4d17b40e26d59eb84 (patch) | |
tree | 44dd369aad5ac5034a18fef803ae2b4acfd10da4 /libavcodec/qsvenc.h | |
parent | 3224d6691cdc59ef0d31cdb35efac27494ff515b (diff) | |
download | ffmpeg-74cf2dc3ac405c5e55b7ecd4d17b40e26d59eb84.tar.gz |
lavc/qsvenc: enable QVBR mode
QVBR mode is to use the variable bitrate control algorithm
with constant quality.
mfxExtCodingOption3 should be supported to enable QVBR mode.
It is neccesary to specify a max_rate for QVBR, else it may be ICQ mode.
Example usage: ffmpeg -hwaccel qsv -c:v h264_qsv -i input.mp4 -c:v
h264_qsv -global_quality 25 -maxrate 2M test_qvbr.mp4 -v verbose
Clip QVBR quality range to be [0, 51] as Mark's commments.
It is similar to qp range of CQP but possibly should be updated when VP8/VP9
encoding can be supported.
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Zhong Li <zhong.li@intel.com>
Diffstat (limited to 'libavcodec/qsvenc.h')
-rw-r--r-- | libavcodec/qsvenc.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h index 47a70a4898..00afbd80aa 100644 --- a/libavcodec/qsvenc.h +++ b/libavcodec/qsvenc.h @@ -56,7 +56,7 @@ #define QSV_HAVE_AVBR 0 #define QSV_HAVE_ICQ QSV_VERSION_ATLEAST(1, 28) #define QSV_HAVE_VCM 0 -#define QSV_HAVE_QVBR 0 +#define QSV_HAVE_QVBR QSV_VERSION_ATLEAST(1, 28) #define QSV_HAVE_MF QSV_VERSION_ATLEAST(1, 25) #endif @@ -111,6 +111,9 @@ typedef struct QSVEncContext { #if QSV_HAVE_CO2 mfxExtCodingOption2 extco2; #endif +#if QSV_HAVE_CO3 + mfxExtCodingOption3 extco3; +#endif #if QSV_HAVE_MF mfxExtMultiFrameParam extmfp; mfxExtMultiFrameControl extmfc; @@ -119,7 +122,7 @@ typedef struct QSVEncContext { mfxFrameSurface1 **opaque_surfaces; AVBufferRef *opaque_alloc_buf; - mfxExtBuffer *extparam_internal[2 + QSV_HAVE_CO2 + (QSV_HAVE_MF * 2)]; + mfxExtBuffer *extparam_internal[2 + QSV_HAVE_CO2 + QSV_HAVE_CO3 + (QSV_HAVE_MF * 2)]; int nb_extparam_internal; mfxExtBuffer **extparam; |