[FFmpeg-cvslog] avcodec: add avcodec_chroma_pos_to_enum()
Michael Niedermayer
git at videolan.org
Tue Jul 23 03:21:09 CEST 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jul 17 22:41:39 2013 +0200| [abc8110f7e54fc009895c659ce2a977fb0d697c5] | committer: Michael Niedermayer
avcodec: add avcodec_chroma_pos_to_enum()
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=abc8110f7e54fc009895c659ce2a977fb0d697c5
---
doc/APIchanges | 4 ++++
libavcodec/avcodec.h | 11 +++++++++++
libavcodec/utils.c | 11 +++++++++++
libavcodec/version.h | 4 ++--
4 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index aac9d8c..2bb45fa 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2012-10-22
API changes, most recent first:
+2013-07-XX - xxxxxxx - XXXXXXXXXXXXXX - avcodec.h
+ Add avcodec_chroma_pos_to_enum()
+ Add avcodec_enum_to_chroma_pos()
+
2013-07-03 - xxxxxxx - lavfi 3.78.100 - avfilter.h
Deprecate avfilter_graph_parse() in favor of the equivalent
avfilter_graph_parse_ptr().
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index bcef2a4..98217b8 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3617,6 +3617,17 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
*/
int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos);
+/**
+ * Converts swscale x/y chroma position to AVChromaLocation.
+ *
+ * The positions represent the chroma (0,0) position in a coordinates system
+ * with luma (0,0) representing the origin and luma(1,1) representing 256,256
+ *
+ * @param xpos horizontal chroma sample position
+ * @param ypos vertical chroma sample position
+ */
+enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos);
+
#if FF_API_OLD_DECODE_AUDIO
/**
* Wrapper function which calls avcodec_decode_audio4.
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 0b33170..64bae3e 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -350,6 +350,17 @@ int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos)
return 0;
}
+enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos)
+{
+ int pos, xout, yout;
+
+ for (pos = AVCHROMA_LOC_UNSPECIFIED + 1; pos < AVCHROMA_LOC_NB; pos++) {
+ if (avcodec_enum_to_chroma_pos(&xout, &yout, pos) == 0 && xout == xpos && yout == ypos)
+ return pos;
+ }
+ return AVCHROMA_LOC_UNSPECIFIED;
+}
+
int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
enum AVSampleFormat sample_fmt, const uint8_t *buf,
int buf_size, int align)
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 3283446..06777bf 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,8 +29,8 @@
#include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 55
-#define LIBAVCODEC_VERSION_MINOR 18
-#define LIBAVCODEC_VERSION_MICRO 102
+#define LIBAVCODEC_VERSION_MINOR 19
+#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
More information about the ffmpeg-cvslog
mailing list