aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/pixdesc.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-11-12 01:25:43 +0100
committerLuca Barbato <lu_zero@gentoo.org>2012-11-13 16:14:55 +0100
commitc1a02e884ac785033baab356a5437adf057a4189 (patch)
treecaa6e75ce56cbc0d15cae71eb38947ed730e46c9 /libavutil/pixdesc.c
parent22a0827dff29a94e7fd07ad2782f169b2703c70d (diff)
downloadffmpeg-c1a02e884ac785033baab356a5437adf057a4189.tar.gz
pixdesc: add av_pix_fmt_get_chroma_sub_sample
Deprecate avcodec_get_chroma_sub_sample.
Diffstat (limited to 'libavutil/pixdesc.c')
-rw-r--r--libavutil/pixdesc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index bc446b1fab..d0889b4b38 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1454,3 +1454,15 @@ enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
return desc - av_pix_fmt_descriptors;
}
+
+int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
+ int *h_shift, int *v_shift)
+{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
+ if (!desc)
+ return AVERROR(ENOSYS);
+ *h_shift = desc->log2_chroma_w;
+ *v_shift = desc->log2_chroma_h;
+
+ return 0;
+}