summaryrefslogtreecommitdiffstats
path: root/libavcodec/libopenjpegenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-12 16:48:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-12 16:48:26 +0200
commitaf7dd79a323090b14a7fb9ef24a3f6a24dc6d2db (patch)
treeca68b14693edd87a495f00e759f06d5eafe0eafb /libavcodec/libopenjpegenc.c
parent3d179edf6d2a987e7eb134eea541954338a19add (diff)
parent50ba57e0ce63d9904269ea0728936a0c79f8bfb5 (diff)
downloadffmpeg-streaming-af7dd79a323090b14a7fb9ef24a3f6a24dc6d2db.zip
ffmpeg-streaming-af7dd79a323090b14a7fb9ef24a3f6a24dc6d2db.tar.gz
Merge commit '50ba57e0ce63d9904269ea0728936a0c79f8bfb5'
* commit '50ba57e0ce63d9904269ea0728936a0c79f8bfb5': lavc: do not use av_pix_fmt_descriptors directly. Conflicts: libavcodec/imgconvert.c libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/mpegvideo.c libavcodec/rawdec.c libavcodec/rawenc.c libavcodec/tiffenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libopenjpegenc.c')
-rw-r--r--libavcodec/libopenjpegenc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index 0e4a257..a425731 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -69,6 +69,7 @@ static void info_callback(const char *msg, void *data)
static opj_image_t *mj2_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_image_t *img;
int i;
@@ -79,10 +80,10 @@ static opj_image_t *mj2_create_image(AVCodecContext *avctx, opj_cparameters_t *p
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_dy[1] = sub_dy[2] = 1<<av_pix_fmt_descriptors[avctx->pix_fmt].log2_chroma_h;
+ sub_dx[1] = sub_dx[2] = 1 << desc->log2_chroma_w;
+ sub_dy[1] = sub_dy[2] = 1 << desc->log2_chroma_h;
- numcomps = av_pix_fmt_descriptors[avctx->pix_fmt].nb_components;
+ numcomps = desc->nb_components;
switch (avctx->pix_fmt) {
case AV_PIX_FMT_GRAY8:
@@ -135,8 +136,8 @@ static opj_image_t *mj2_create_image(AVCodecContext *avctx, opj_cparameters_t *p
return NULL;
}
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];
OpenPOWER on IntegriCloud