]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/internal.h
Merge commit '71ec3d36fa6122b3b6c5c68a21b9c70cb2e668e8'
[ffmpeg] / libavutil / internal.h
index 77af6f9512fd98e7d9dac4da345ef473ca7a9deb..0a201424de969272939796d25f808527259d87f4 100644 (file)
@@ -256,6 +256,19 @@ int avpriv_open(const char *filename, int flags, ...);
 
 int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt);
 
+static av_always_inline av_const int avpriv_mirror(int x, int w)
+{
+    if (!w)
+        return 0;
+
+    while ((unsigned)x > (unsigned)w) {
+        x = -x;
+        if (x < 0)
+            x += 2 * w;
+    }
+    return x;
+}
+
 #if FF_API_GET_CHANNEL_LAYOUT_COMPAT
 uint64_t ff_get_channel_layout(const char *name, int compat);
 #endif