aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/pixdesc.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-09-21 02:30:39 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-09-26 03:02:25 +0200
commit8be6552aa4bff1ce1016739a77733a2dcbdfaa8b (patch)
tree1bace4dca8377a42da7a1854ccda46e84158ecee /libavutil/pixdesc.h
parentcf856d8957f82a3b15071b8f1f551b06a65b9b3f (diff)
downloadffmpeg-8be6552aa4bff1ce1016739a77733a2dcbdfaa8b.tar.gz
avutil/pixdesc: Add av_chroma_location_(enum_to_pos|pos_to_enum)
They are intended as replacements for avcodec_enum_to_chroma_pos() and avcodec_chroma_pos_to_enum(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavutil/pixdesc.h')
-rw-r--r--libavutil/pixdesc.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h
index 48d9300bfe..0df73e6efe 100644
--- a/libavutil/pixdesc.h
+++ b/libavutil/pixdesc.h
@@ -265,6 +265,28 @@ const char *av_chroma_location_name(enum AVChromaLocation location);
int av_chroma_location_from_name(const char *name);
/**
+ * Converts AVChromaLocation to swscale x/y chroma position.
+ *
+ * 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
+ */
+int av_chroma_location_enum_to_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 av_chroma_location_pos_to_enum(int xpos, int ypos);
+
+/**
* Return the pixel format corresponding to name.
*
* If there is no pixel format with name name, then looks for a