]> granicus.if.org Git - handbrake/commitdiff
encavcodec: enable "row-mt=1" for vp9
authorJohn Stebbins <jstebbins.hb@gmail.com>
Tue, 22 Jan 2019 16:48:09 +0000 (08:48 -0800)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Tue, 22 Jan 2019 16:51:49 +0000 (08:51 -0800)
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

libhb/encavcodec.c

index 8d8ad8b06022b90e71dfd45090583900de2aae48..1ca9dbda55b7db7b9273ab5d7fb3ed3f2d61d17d 100644 (file)
@@ -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);