From: John Stebbins Date: Tue, 22 Jan 2019 16:48:09 +0000 (-0800) Subject: encavcodec: enable "row-mt=1" for vp9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=557a3311639315422e71145038d617e4d9e49dcd;p=handbrake encavcodec: enable "row-mt=1" for vp9 Improves encoding speed by about 20% for SD content and 35% for HD content in my testing on a 4 core 8 thread system. CPU utilization is around 60% as compared with 40% prior to the change. Fixes https://github.com/HandBrake/HandBrake/issues/1830 --- diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c index 8d8ad8b06..1ca9dbda5 100644 --- a/libhb/encavcodec.c +++ b/libhb/encavcodec.c @@ -1023,14 +1023,27 @@ static int apply_vpx_preset(AVDictionary ** av_opts, const char * preset) return 0; } +// VP8 and VP9 have some options in common and some different +static int apply_vp8_preset(AVDictionary ** av_opts, const char * preset) +{ + return apply_vpx_preset(av_opts, preset); +} + +static int apply_vp9_preset(AVDictionary ** av_opts, const char * preset) +{ + av_dict_set(av_opts, "row-mt", "1", 0); + return apply_vpx_preset(av_opts, preset); +} + static int apply_encoder_preset(int vcodec, AVDictionary ** av_opts, const char * preset) { switch (vcodec) { case HB_VCODEC_FFMPEG_VP8: + return apply_vp8_preset(av_opts, preset); case HB_VCODEC_FFMPEG_VP9: - return apply_vpx_preset(av_opts, preset); + return apply_vp9_preset(av_opts, preset); case HB_VCODEC_FFMPEG_NVENC_H264: case HB_VCODEC_FFMPEG_NVENC_H265: av_dict_set( av_opts, "preset", preset, 0);