[FFmpeg-devel] [PATCH V7 0/3] enable multi-slices in vaapi_h264/265 encoder

Mark Thompson sw at jkqxz.net
Wed Sep 19 01:38:52 EEST 2018


On 29/08/18 11:38, Jun Zhao wrote:
> V7: - Fix h264 first_mb_in_slice setting issue. (root cause by Mark)
>     - Refine the error handle
> 
> V6: - Use rectangular slices and refine the code.
> 
> V5: - In h265_vaapi encoder, when setting slice number > max slice number
>       supported by driver, report error and return. Same as h264_vaapi.
>     - Clean the logic when setting first_slice_segment_in_pic_flags.
>   
> V4: - Change the array malloc function.
>     - Clean the pointless condition check when free the memory.
> 
> V3: - Making pic->slices be VAAPIEncodeSlice* instead of VAAPIEncodeSlice**. 
>     - Fix resource (vaBuffer) lead when realloc pic->param_buffers fail. 
>     - Adjust max_slices location in VAAPIEncodeContext. 
>     - Re-work distributing the macro-blocks for multi-slices function.
>  
> V2: - Change the slice/parameter buffers to dynamic alloc and split the mutil-slice support for AVC/HEVC.
> 
> Jun Zhao (3):
>   lavc/vaapi_encode: Add max slices number query.
>   lavc/vaapi_encode_h264: respect "slices" option in h264 vaapi encoder
>   lavc/vaapi_encode_h265: respect "slices" option in h265 vaapi encoder
> 
>  libavcodec/vaapi_encode.c      |    4 +++
>  libavcodec/vaapi_encode.h      |    4 +++
>  libavcodec/vaapi_encode_h264.c |   39 +++++++++++++++++++++++++++++++++----
>  libavcodec/vaapi_encode_h265.c |   41 ++++++++++++++++++++++++++++++++++-----
>  4 files changed, 77 insertions(+), 11 deletions(-)

I've made a completely different patch which achieves the same result in I think a better way - see <https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2018-September/234356.html>, along with the following two which trivially enable it for H.264 and H.265.

Can you check that I've correctly characterised the Intel bug you mentioned earlier which I reference in comments when handling the rounding error?  The workaround is trivial, but if the bug isn't exactly that then of course it won't do anything useful.

- Mark


More information about the ffmpeg-devel mailing list