aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/tiffenc.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-10-12 15:13:42 +0000
committerPaul B Mahol <onemda@gmail.com>2012-10-12 15:31:42 +0000
commita51540d81167547f1c7c2b8f545c246711611071 (patch)
treeed001a8c92dbf84c5dcaf0f434cb9ccb4519a27e /libavcodec/tiffenc.c
parent27ccc82e1bb1b97a85e5fb33b92082267078b4d1 (diff)
downloadffmpeg-a51540d81167547f1c7c2b8f545c246711611071.tar.gz
lavc: do not use av_pix_fmt_descriptors directly
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/tiffenc.c')
-rw-r--r--libavcodec/tiffenc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index 8c30ed29dc..c675c55f71 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -239,6 +239,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet)
{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
TiffEncoderContext *s = avctx->priv_data;
AVFrame *const p = &s->picture;
int i;
@@ -260,8 +261,8 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
s->subsampling[1] = 1;
avctx->bits_per_coded_sample =
- s->bpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]);
- s->bpp_tab_size = av_pix_fmt_descriptors[avctx->pix_fmt].nb_components;
+ s->bpp = av_get_bits_per_pixel(desc);
+ s->bpp_tab_size = desc->nb_components;
switch (avctx->pix_fmt) {
case AV_PIX_FMT_RGBA64LE:
@@ -305,7 +306,7 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
}
for (i = 0; i < s->bpp_tab_size; i++)
- bpp_tab[i] = av_pix_fmt_descriptors[avctx->pix_fmt].comp[i].depth_minus1 + 1;
+ bpp_tab[i] = desc->comp[i].depth_minus1 + 1;
if (s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE || s->compr == TIFF_LZW)
//best choose for DEFLATE