shithub: libvpx

Download patch

ref: bd867f16191a5ec2c2ebbd2e63bcb2721f0a0d78
parent: 8fde07a3aeef421ed7b15c424e7fad2ede46f9bf
author: Ronald S. Bultje <rbultje@google.com>
date: Wed Jul 3 08:04:30 EDT 2013

Inline vp9_get_mv_joint().

Encode time for first 50 frames of bus (speed 0) @ 1500kbps goes from
2min10.9 to 2min10.5, i.e. 0.3% faster overall, basically because we
prevent the call overhead.

Change-Id: I1eab1a95dd3eae282f9b866f1f0b3dcadff073d5

--- a/vp9/common/vp9_entropymv.c
+++ b/vp9/common/vp9_entropymv.c
@@ -82,17 +82,6 @@
   },
 };
 
-MV_JOINT_TYPE vp9_get_mv_joint(const MV *mv) {
-  if (mv->row == 0 && mv->col == 0)
-    return MV_JOINT_ZERO;
-  else if (mv->row == 0 && mv->col != 0)
-    return MV_JOINT_HNZVZ;
-  else if (mv->row != 0 && mv->col == 0)
-    return MV_JOINT_HZVNZ;
-  else
-    return MV_JOINT_HNZVNZ;
-}
-
 #define mv_class_base(c) ((c) ? (CLASS0_SIZE << (c + 2)) : 0)
 
 MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset) {
--- a/vp9/common/vp9_entropymv.h
+++ b/vp9/common/vp9_entropymv.h
@@ -99,7 +99,14 @@
   nmv_component comps[2];
 } nmv_context;
 
-MV_JOINT_TYPE vp9_get_mv_joint(const MV *mv);
+static INLINE MV_JOINT_TYPE vp9_get_mv_joint(const MV *mv) {
+  if (mv->row == 0) {
+    return mv->col == 0 ? MV_JOINT_ZERO : MV_JOINT_HNZVZ;
+  } else {
+    return mv->col == 0 ? MV_JOINT_HZVNZ : MV_JOINT_HNZVNZ;
+  }
+}
+
 MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset);
 int vp9_get_mv_mag(MV_CLASS_TYPE c, int offset);
 
--