You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
pixdesc: add a function for counting planes in a pixel format.
This commit is contained in:
@@ -13,6 +13,9 @@ libavutil: 2012-10-22
|
|||||||
|
|
||||||
API changes, most recent first:
|
API changes, most recent first:
|
||||||
|
|
||||||
|
2013-xx-xx - lavu 52.9.0 - pixdesc.h
|
||||||
|
Add av_pix_fmt_count_planes() function for counting planes in a pixel format.
|
||||||
|
|
||||||
2013-xx-xx - lavfi 3.6.0
|
2013-xx-xx - lavfi 3.6.0
|
||||||
Add AVFilterGraph.nb_filters, deprecate AVFilterGraph.filter_count.
|
Add AVFilterGraph.nb_filters, deprecate AVFilterGraph.filter_count.
|
||||||
|
|
||||||
|
@@ -1473,3 +1473,18 @@ int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
|
||||||
|
{
|
||||||
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
|
||||||
|
int i, planes[4] = { 0 }, ret = 0;
|
||||||
|
|
||||||
|
if (!desc)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
|
for (i = 0; i < desc->nb_components; i++)
|
||||||
|
planes[desc->comp[i].plane] = 1;
|
||||||
|
for (i = 0; i < FF_ARRAY_ELEMS(planes); i++)
|
||||||
|
ret += planes[i];
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
@@ -219,5 +219,11 @@ enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
|
|||||||
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
|
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
|
||||||
int *h_shift, int *v_shift);
|
int *h_shift, int *v_shift);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a
|
||||||
|
* valid pixel format.
|
||||||
|
*/
|
||||||
|
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt);
|
||||||
|
|
||||||
|
|
||||||
#endif /* AVUTIL_PIXDESC_H */
|
#endif /* AVUTIL_PIXDESC_H */
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define LIBAVUTIL_VERSION_MAJOR 52
|
#define LIBAVUTIL_VERSION_MAJOR 52
|
||||||
#define LIBAVUTIL_VERSION_MINOR 8
|
#define LIBAVUTIL_VERSION_MINOR 9
|
||||||
#define LIBAVUTIL_VERSION_MICRO 0
|
#define LIBAVUTIL_VERSION_MICRO 0
|
||||||
|
|
||||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||||
|
Reference in New Issue
Block a user