aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-06-18 18:08:20 -0400
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-07-09 10:14:12 -0400
commita54f03bf07da964a1b04b03b85bc39deba76efa4 (patch)
treebc25fa712a44e0bb1afca2ce48edd99a88048110
parent33a7b453a8e1f090c694ea4f36769dc837be88f0 (diff)
downloadffmpeg-a54f03bf07da964a1b04b03b85bc39deba76efa4.tar.gz
display: add matrix flip api
-rw-r--r--doc/APIchanges3
-rw-r--r--libavutil/display.c10
-rw-r--r--libavutil/display.h9
-rw-r--r--libavutil/version.h4
4 files changed, 24 insertions, 2 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index 91bc290019..9535b88914 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil: 2013-12-xx
API changes, most recent first:
+2014-07-xx - xxxxxxx - lavu 53.18.0 - display.h
+ Add av_display_matrix_flip() to flip the transformation matrix.
+
2014-07-xx - xxxxxxx - lavc 55.56.0 - dv_profile.h
Add a public API for DV profile handling.
diff --git a/libavutil/display.c b/libavutil/display.c
index b2b98329a0..74aceb2847 100644
--- a/libavutil/display.c
+++ b/libavutil/display.c
@@ -63,3 +63,13 @@ void av_display_rotation_set(int32_t matrix[9], double angle)
matrix[4] = CONV_DB(c);
matrix[8] = 1 << 30;
}
+
+void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip)
+{
+ int i;
+ const int flip[] = { 1 - 2 * (!!hflip), 1 - 2 * (!!vflip), 1 };
+
+ if (hflip || vflip)
+ for (i = 0; i < 9; i++)
+ matrix[i] *= flip[i % 3];
+}
diff --git a/libavutil/display.h b/libavutil/display.h
index ea762a4249..7e37627637 100644
--- a/libavutil/display.h
+++ b/libavutil/display.h
@@ -74,4 +74,13 @@ double av_display_rotation_get(const int32_t matrix[9]);
*/
void av_display_rotation_set(int32_t matrix[9], double angle);
+/**
+ * Flip the input matrix horizontally and/or vertically.
+ *
+ * @param matrix an allocated transformation matrix
+ * @param hflip whether the matrix should be flipped horizontally
+ * @param vflip whether the matrix should be flipped vertically
+ */
+void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip);
+
#endif /* AVUTIL_DISPLAY_H */
diff --git a/libavutil/version.h b/libavutil/version.h
index ef38404e05..a2625b5ee5 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -54,8 +54,8 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 53
-#define LIBAVUTIL_VERSION_MINOR 17
-#define LIBAVUTIL_VERSION_MICRO 1
+#define LIBAVUTIL_VERSION_MINOR 18
+#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \