summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-09 23:57:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-09 23:57:20 +0200
commitc67690f854452df397f3f735d0ff107a3fe51d87 (patch)
tree2bd4414d0a72eb3eb8cbf70d426039a475254e9d
parente8a966e361a7512ecfb03073074c8b9084229e69 (diff)
parenta54f03bf07da964a1b04b03b85bc39deba76efa4 (diff)
downloadffmpeg-streaming-c67690f854452df397f3f735d0ff107a3fe51d87.zip
ffmpeg-streaming-c67690f854452df397f3f735d0ff107a3fe51d87.tar.gz
Merge commit 'a54f03bf07da964a1b04b03b85bc39deba76efa4'
* commit 'a54f03bf07da964a1b04b03b85bc39deba76efa4': display: add matrix flip api Conflicts: libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--doc/APIchanges3
-rw-r--r--libavutil/display.c10
-rw-r--r--libavutil/display.h9
-rw-r--r--libavutil/version.h2
4 files changed, 23 insertions, 1 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index 9763769..3def491 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2012-10-22
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 da47cee..53e8aa2 100644
--- a/libavutil/display.c
+++ b/libavutil/display.c
@@ -61,3 +61,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 7a338d7..2cb930d 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 0f4b571..0d254b1 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -56,7 +56,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
-#define LIBAVUTIL_VERSION_MINOR 91
+#define LIBAVUTIL_VERSION_MINOR 92
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
OpenPOWER on IntegriCloud