From d165ce22a4a7cc4ed60238ce8f3d5dcbbad3e266 Mon Sep 17 00:00:00 2001 From: Wenbin Chen Date: Fri, 18 Feb 2022 11:07:47 +0800 Subject: libavcodec/vaapi_encode: Add async_depth to vaapi_encoder to increase performance Fix: #7706. After commit 5fdcf85bbffe7451c2, vaapi encoder's performance decrease. The reason is that vaRenderPicture() and vaSyncBuffer() are called at the same time (vaRenderPicture() always followed by a vaSyncBuffer()). Now I changed them to be called in a asynchronous way, which will make better use of hardware. Async_depth is added to increase encoder's performance. The frames that are sent to hardware are stored in a fifo. Encoder will sync output after async fifo is full. Signed-off-by: Wenbin Chen Signed-off-by: Haihao Xiang --- doc/encoders.texi | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/encoders.texi') diff --git a/doc/encoders.texi b/doc/encoders.texi index 9afb920f69..64e8c5d129 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -3591,6 +3591,12 @@ will refer only to P- or I-frames. When set to greater values multiple layers of B-frames will be present, frames in each layer only referring to frames in higher layers. +@item async_depth +Maximum processing parallelism. Increase this to improve single channel +performance. This option doesn't work if driver doesn't implement vaSyncBuffer +function. Please make sure there are enough hw_frames allocated if a large +number of async_depth is used. + @item rc_mode Set the rate control mode to use. A given driver may only support a subset of modes. -- cgit v1.2.3