]> granicus.if.org Git - libvpx/commitdiff
Add VPX_SWAP macro
authorYury Gitman <yuryg@google.com>
Fri, 15 Jul 2016 17:32:04 +0000 (10:32 -0700)
committerYury Gitman <yuryg@google.com>
Fri, 22 Jul 2016 22:41:25 +0000 (15:41 -0700)
Change-Id: I60e233eddef238ad918183392794084673f27d2d

vpx_dsp/vpx_dsp_common.h

index a1d0a51ef565ff84f4abc2b42694cfb5d8b0bfa4..8d4f514182a4b675490e147758083a98a9a0d017 100644 (file)
@@ -22,6 +22,13 @@ extern "C" {
 #define VPXMIN(x, y) (((x) < (y)) ? (x) : (y))
 #define VPXMAX(x, y) (((x) > (y)) ? (x) : (y))
 
+#define VPX_SWAP(type, a, b) \
+  do {                       \
+    type c = (b);            \
+    b = a;                   \
+    a = c;                   \
+  } while (0)
+
 #if CONFIG_VP9_HIGHBITDEPTH
 // Note:
 // tran_low_t  is the datatype used for final transform coefficients.