vo_vdpau: document what WRAP_ADD does

This wasn't necessarily clear.
This commit is contained in:
wm4 2014-04-08 19:13:15 +02:00
parent a748b62709
commit a62276bf56
1 changed files with 2 additions and 0 deletions

View File

@ -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)))