diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2012-11-12 01:25:43 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2012-11-13 16:14:55 +0100 |
commit | c1a02e884ac785033baab356a5437adf057a4189 (patch) | |
tree | caa6e75ce56cbc0d15cae71eb38947ed730e46c9 /libavcodec | |
parent | 22a0827dff29a94e7fd07ad2782f169b2703c70d (diff) | |
download | ffmpeg-c1a02e884ac785033baab356a5437adf057a4189.tar.gz |
pixdesc: add av_pix_fmt_get_chroma_sub_sample
Deprecate avcodec_get_chroma_sub_sample.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avcodec.h | 6 | ||||
-rw-r--r-- | libavcodec/ffv1enc.c | 4 | ||||
-rw-r--r-- | libavcodec/libtheoraenc.c | 3 | ||||
-rw-r--r-- | libavcodec/mpegvideo.c | 9 | ||||
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 10 | ||||
-rw-r--r-- | libavcodec/tiffenc.c | 4 | ||||
-rw-r--r-- | libavcodec/utils.c | 3 | ||||
-rw-r--r-- | libavcodec/vp3.c | 3 |
8 files changed, 26 insertions, 16 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index d5968f9e55..58ea1bce3e 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -4285,7 +4285,11 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, * @{ */ -void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift); +/** + * @deprecated Use av_pix_fmt_get_chroma_sub_sample + */ + +void attribute_deprecated avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift); /** * Return a value representing the fourCC code associated to the diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index efc1b11a85..8c6fc9a9c9 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -725,8 +725,8 @@ static av_cold int ffv1_encode_init(AVCodecContext *avctx) if (!s->transparency) s->plane_count = 2; - avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift, - &s->chroma_v_shift); + av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift, + &s->chroma_v_shift); s->picture_number = 0; diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c index 6c4eddf301..469c6fd467 100644 --- a/libavcodec/libtheoraenc.c +++ b/libavcodec/libtheoraenc.c @@ -197,7 +197,8 @@ static av_cold int encode_init(AVCodecContext* avc_context) av_log(avc_context, AV_LOG_ERROR, "Unsupported pix_fmt\n"); return -1; } - avcodec_get_chroma_sub_sample(avc_context->pix_fmt, &h->uv_hshift, &h->uv_vshift); + av_pix_fmt_get_chroma_sub_sample(avc_context->pix_fmt, + &h->uv_hshift, &h->uv_vshift); if (avc_context->flags & CODEC_FLAG_QSCALE) { /* to be constant with the libvorbis implementation, clip global_quality to 0 - 10 diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index af9e0403de..8a48d9937a 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -867,8 +867,9 @@ av_cold int ff_MPV_common_init(MpegEncContext *s) if (s->width && s->height) { /* set chroma shifts */ - avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &s->chroma_x_shift, - &s->chroma_y_shift); + av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, + &s->chroma_x_shift, + &s->chroma_y_shift); /* convert fourcc to upper case */ s->codec_tag = avpriv_toupper4(s->avctx->codec_tag); @@ -1781,8 +1782,8 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict) (s->codec_id == AV_CODEC_ID_H264 ? 0 : 1); s->low_delay = 0; // needed to see the vectors without trashing the buffers - avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, - &h_chroma_shift, &v_chroma_shift); + av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, + &h_chroma_shift, &v_chroma_shift); for (i = 0; i < 3; i++) { memcpy(s->visualization_buffer[i], pict->data[i], (i == 0) ? pict->linesize[i] * height: diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index d2719fe8ee..7c92ad2374 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -29,6 +29,7 @@ #include "libavutil/intmath.h" #include "libavutil/mathematics.h" +#include "libavutil/pixdesc.h" #include "libavutil/opt.h" #include "avcodec.h" #include "dsputil.h" @@ -601,8 +602,8 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) if (avctx->inter_quant_bias != FF_DEFAULT_QUANT_BIAS) s->inter_quant_bias = avctx->inter_quant_bias; - avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift, - &chroma_v_shift); + av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift, + &chroma_v_shift); if (avctx->codec_id == AV_CODEC_ID_MPEG4 && s->avctx->time_base.den > (1 << 16) - 1) { @@ -994,8 +995,9 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg) // empty } else { int h_chroma_shift, v_chroma_shift; - avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, - &v_chroma_shift); + av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, + &h_chroma_shift, + &v_chroma_shift); for (i = 0; i < 3; i++) { int src_stride = pic_arg->linesize[i]; diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 9811404313..8162c407d6 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -270,8 +270,8 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt, case AV_PIX_FMT_YUV410P: case AV_PIX_FMT_YUV411P: s->photometric_interpretation = 6; - avcodec_get_chroma_sub_sample(avctx->pix_fmt, - &shift_h, &shift_v); + av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, + &shift_h, &shift_v); s->bpp = 8 + (16 >> (shift_h + shift_v)); s->subsampling[0] = 1 << shift_h; s->subsampling[1] = 1 << shift_v; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 8c203b92fb..054dc693e9 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -427,7 +427,8 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic) const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt); const int pixel_size = desc->comp[0].step_minus1 + 1; - avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift); + av_pix_fmt_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, + &v_chroma_shift); avcodec_align_dimensions2(s, &w, &h, stride_align); diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 90532cbe54..e8127597c6 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -1687,7 +1687,8 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) for (i = 0; i < 3; i++) s->qps[i] = -1; - avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift, &s->chroma_y_shift); + av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift, + &s->chroma_y_shift); s->y_superblock_width = (s->width + 31) / 32; s->y_superblock_height = (s->height + 31) / 32; |