shithub: libvpx

Download patch

ref: bb0e75463cf7ac1fd58711f0c54724261011f9aa
parent: 8d95d2682a6e4f1546f4c4cd6d3a7435925a27c4
author: Angie Chiang <angiebird@google.com>
date: Wed Sep 19 11:37:49 EDT 2018

Correct mv rows/cols bug in read_frame_dpl_stats

When the frame size is not multiples of mv search bsize,
the fractional part will increment the mv rows/cols by 1

Change-Id: I4333a207406610c540059a9356a82084832ca85b

--- a/tools/non_greedy_mv/non_greedy_mv.py
+++ b/tools/non_greedy_mv/non_greedy_mv.py
@@ -3,6 +3,7 @@
 from matplotlib.collections import LineCollection
 from matplotlib import colors as mcolors
 import numpy as np
+import math
 
 
 def draw_mv_ls(axis, mv_ls, mode=0):
@@ -92,7 +93,9 @@
   bs = int(word_ls[7])
   mi_size = bs / 8
   mv_ls = []
-  for i in range((mi_rows / mi_size) * (mi_cols / mi_size)):
+  mv_rows = int((math.ceil(mi_rows * 1. / mi_size)))
+  mv_cols = int((math.ceil(mi_cols * 1. / mi_size)))
+  for i in range(mv_rows * mv_cols):
     line = fp.readline()
     word_ls = line.split()
     row = int(word_ls[0]) * 8.