Merge commit '5e9c6ef8f3beb9ed7b271654a82349ac90fe43f2'
* commit '5e9c6ef8f3beb9ed7b271654a82349ac90fe43f2': x86: h264_weight_10bit: port to cpuflags libtheoraenc: add missing pixdesc.h header avcodec: remove ff_is_hwaccel_pix_fmt pixdesc: add av_pix_fmt_get_chroma_sub_sample hlsenc: stand alone hls segmenter Conflicts: doc/muxers.texi libavcodec/ffv1enc.c libavcodec/imgconvert.c libavcodec/mpegvideo_enc.c libavcodec/tiffenc.c libavformat/Makefile libavformat/allformats.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -1749,3 +1749,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;
|
||||
}
|
||||
|
||||
@@ -206,4 +206,18 @@ const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev);
|
||||
*/
|
||||
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
|
||||
|
||||
/**
|
||||
* Utility function to access log2_chroma_w log2_chroma_h from
|
||||
* the pixel format AVPixFmtDescriptor.
|
||||
*
|
||||
* @param[in] pix_fmt the pixel format
|
||||
* @param[out] h_shift store log2_chroma_h
|
||||
* @param[out] v_shift store log2_chroma_w
|
||||
*
|
||||
* @return 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format
|
||||
*/
|
||||
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
|
||||
int *h_shift, int *v_shift);
|
||||
|
||||
|
||||
#endif /* AVUTIL_PIXDESC_H */
|
||||
|
||||
Reference in New Issue
Block a user