]> granicus.if.org Git - libvpx/commitdiff
Print subpel_q4 and step_q4 behaviour
authorYi Luo <luoyi@google.com>
Fri, 3 Jun 2016 16:38:03 +0000 (09:38 -0700)
committerYi Luo <luoyi@google.com>
Fri, 3 Jun 2016 16:38:03 +0000 (09:38 -0700)
convolve/convolve.c [new file with mode: 0644]

diff --git a/convolve/convolve.c b/convolve/convolve.c
new file mode 100644 (file)
index 0000000..94a832d
--- /dev/null
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv)
+{
+  int i;
+  int height = 27;
+  int x_q4 = 8;
+  int x_step_q4 = 16;
+  const int subpel_bits = 4;
+  const int subpel_mask = (1 << subpel_bits) - 1;
+
+  if (3 != argc) {
+    printf("Usage: convolve <q4> <step_q4>\n");
+    return -1;
+  }
+
+  x_q4 = atoi(argv[1]);
+  x_step_q4 = atoi(argv[2]);
+
+  for (i = 0; i < height; ++i) {
+    printf("x_q4: 0x%X, sigidx: 0x%X, filidx: 0x%X\n",
+           x_q4, x_q4 >> subpel_bits, x_q4 & subpel_mask);
+    x_q4 += x_step_q4;
+  }
+
+  return 0;
+}