shithub: libvpx

Download patch

ref: a2192701b1ff5f79bc53f75199f2d9e3bc42df12
parent: e407b1a616aaec55f0dd2957e23026b0375b5d64
parent: 9868499e4b6a2f986017c62a5adc6f1933fe992f
author: Jingning Han <jingning@google.com>
date: Tue Sep 11 00:04:31 EDT 2018

Merge "Rework two_pass_first_group_inter()"

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -2921,9 +2921,12 @@
 static int two_pass_first_group_inter(VP9_COMP *cpi) {
   TWO_PASS *const twopass = &cpi->twopass;
   GF_GROUP *const gf_group = &twopass->gf_group;
-  if ((cpi->oxcf.pass == 2) &&
-      (gf_group->index == gf_group->first_inter_index)) {
-    return 1;
+  const int gfg_index = gf_group->index;
+
+  if (cpi->oxcf.pass == 2) {
+    if (gfg_index == 0) return gf_group->update_type[gfg_index] == LF_UPDATE;
+    return gf_group->update_type[gfg_index - 1] != LF_UPDATE &&
+           gf_group->update_type[gfg_index] == LF_UPDATE;
   } else {
     return 0;
   }