]> granicus.if.org Git - libvpx/commitdiff
add flags for empty blocks
authorDan Zhu <zxdan@google.com>
Fri, 28 Jun 2019 21:07:44 +0000 (14:07 -0700)
committerDan Zhu <zxdan@google.com>
Fri, 28 Jun 2019 21:08:45 +0000 (14:08 -0700)
Change-Id: Iedf3bdd87d203db5163d3cc47fcbef1fd002218f

tools/3D-Reconstruction/sketch_3D_reconstruction/MotionField.pde

index 883a8f83103a21b653e2d57be55da90d6709bc0d..a5e04b6a9244fc582a673aa795eb6e88eaaf57ed 100644 (file)
@@ -61,6 +61,9 @@ class MotionField {
       PVector mv = motion_field.get(i);
       if (mv.z > 0) {
         motion_field.set(i, new PVector(mv.x / mv.z, mv.y / mv.z, 0));
+      } else  // there is nothing in the block, use -1 to mark it.
+      {
+        motion_field.set(i, new PVector(0.0, 0.0, -1));
       }
     }
   }
@@ -85,7 +88,12 @@ class MotionField {
       mvs[i] = "";
       for (int j = 0; j < c_num; j++) {
         PVector mv = motion_field.get(i * c_num + j);
-        mvs[i] += str(mv.x) + "," + str(mv.y);
+        if (mv.z != -1) {
+          mvs[i] += str(mv.x) + "," + str(mv.y);
+        } else  // there is nothing
+        {
+          mvs[i] += "-,-";
+        }
         if (j != c_num - 1) mvs[i] += ";";
       }
     }