From a62276bf5635dc9c4d0b7a3a20e0e1b01d545d4a Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 8 Apr 2014 19:13:15 +0200 Subject: [PATCH] vo_vdpau: document what WRAP_ADD does This wasn't necessarily clear. --- video/out/vo_vdpau.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 47e8bd95e2..d7e7206291 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -50,6 +50,8 @@ #include "osdep/timer.h" #include "bitmap_packer.h" +// Returns x + a, but wrapped around to the range [0, m) +// a must be within [-m, m], x within [0, m) #define WRAP_ADD(x, a, m) ((a) < 0 \ ? ((x)+(a)+(m) < (m) ? (x)+(a)+(m) : (x)+(a)) \ : ((x)+(a) < (m) ? (x)+(a) : (x)+(a)-(m)))