diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-10-06 13:29:37 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-10-12 12:45:39 +0200 |
commit | 50ba57e0ce63d9904269ea0728936a0c79f8bfb5 (patch) | |
tree | 9afffc3a86a692d3cf454ed883e835af7d0a3a4f /libavcodec/libopenjpegenc.c | |
parent | 9953ff3cd844eb5f6d8dfce98cad94b78a0fc7dc (diff) | |
download | ffmpeg-50ba57e0ce63d9904269ea0728936a0c79f8bfb5.tar.gz |
lavc: do not use av_pix_fmt_descriptors directly.
Diffstat (limited to 'libavcodec/libopenjpegenc.c')
-rw-r--r-- | libavcodec/libopenjpegenc.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index 972259abf6..09b115bb60 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -69,22 +69,23 @@ static void info_callback(const char *msg, void *data) static opj_image_t *libopenjpeg_create_image(AVCodecContext *avctx, opj_cparameters_t *parameters) { + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); opj_image_cmptparm_t *cmptparm; OPJ_COLOR_SPACE color_space; opj_image_t *img; int i; int sub_dx[4]; int sub_dy[4]; - int numcomps = av_pix_fmt_descriptors[avctx->pix_fmt].nb_components; + int numcomps = desc->nb_components; sub_dx[0] = sub_dx[3] = 1; sub_dy[0] = sub_dy[3] = 1; sub_dx[1] = - sub_dx[2] = 1 << av_pix_fmt_descriptors[avctx->pix_fmt].log2_chroma_w; + sub_dx[2] = 1 << desc->log2_chroma_w; sub_dy[1] = - sub_dy[2] = 1 << av_pix_fmt_descriptors[avctx->pix_fmt].log2_chroma_h; + sub_dy[2] = 1 << desc->log2_chroma_h; switch (avctx->pix_fmt) { case AV_PIX_FMT_GRAY8: @@ -129,10 +130,8 @@ static opj_image_t *libopenjpeg_create_image(AVCodecContext *avctx, } for (i = 0; i < numcomps; i++) { - cmptparm[i].prec = - av_pix_fmt_descriptors[avctx->pix_fmt].comp[i].depth_minus1 + 1; - cmptparm[i].bpp = - av_pix_fmt_descriptors[avctx->pix_fmt].comp[i].depth_minus1 + 1; + cmptparm[i].prec = desc->comp[i].depth_minus1 + 1; + cmptparm[i].bpp = desc->comp[i].depth_minus1 + 1; cmptparm[i].sgnd = 0; cmptparm[i].dx = sub_dx[i]; cmptparm[i].dy = sub_dy[i]; |