Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-04 06:15:01 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-01-05 03:45:49 +0300
commit0f931b29f7e969a3c6159cb7173226e806f26f39 (patch)
treeb20f19d7697738fe415025c17afce7c926af07ec /libavutil
parent9bff052b51f27f6cce04e8d7d8b405c710d7ad67 (diff)
Factorize avpriv_mirror() out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 77af6f9512..0a201424de 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -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