From 1125277bc64ebef1a7a6bee7349c7a8fab7fdcc7 Mon Sep 17 00:00:00 2001 From: Zhong Li Date: Fri, 11 Jan 2019 15:09:07 +0800 Subject: lavc/qsvenc: enable hevc gpb option GPB is the default type, just contains forward references but the slice_type is B slice with higher encoding efficiency than regular P slice, but lower performance. Add an option to allow user to set regular P slice. Fix ticket#6870 Test data on Intel Kabylake (i7-7567U CPU @ 3.50GHz): 1. ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 -vsync passthrough -vframes 1000 -c:v hevc_qsv -gpb 0 -bf 0 -q 25 test_gpb_off_bf0_kbl.mp4 transcoding fps: 85 encoded file size of test_gpb_off_bf0_kbl.mp4: 21960100 (bytes) 2. ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 -vsync passthrough -vframes 1000 -c:v hevc_qsv -gpb 1 -bf 0 -q 25 test_gpb_on_bf0_kbl.mp4 transcoding fps: 79 encoded file size oftest_gpb_on_bf0_kbl.mp4: 21211449 (bytes) In this case, enable gpb can bring about 7% performance drop but 3.4% encoding efficiency improvment. Signed-off-by: Zhong Li --- libavcodec/qsvenc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavcodec/qsvenc.h') diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h index f6d53d44cd..f2f4d38503 100644 --- a/libavcodec/qsvenc.h +++ b/libavcodec/qsvenc.h @@ -47,6 +47,8 @@ #define QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11) #define QSV_HAVE_VDENC QSV_VERSION_ATLEAST(1, 15) +#define QSV_HAVE_GPB QSV_VERSION_ATLEAST(1, 18) + #if defined(_WIN32) || defined(__CYGWIN__) #define QSV_HAVE_AVBR QSV_VERSION_ATLEAST(1, 3) #define QSV_HAVE_ICQ QSV_VERSION_ATLEAST(1, 8) @@ -173,6 +175,7 @@ typedef struct QSVEncContext { int repeat_pps; int low_power; + int gpb; int a53_cc; -- cgit v1.2.1