You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
libavcodec/jpeg2000dec: Enhance pix fmt selection
This patch assigns default pix format values when a match does not take place. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
4091f4f780
commit
69522e0400
@@ -436,6 +436,18 @@ static int get_siz(Jpeg2000DecoderContext *s)
|
|||||||
s->cdef[3] = 3;
|
s->cdef[3] = 3;
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
|
} else if (ncomponents == 3 && s->precision == 8 &&
|
||||||
|
s->cdx[0] == s->cdx[1] && s->cdx[0] == s->cdx[2] &&
|
||||||
|
s->cdy[0] == s->cdy[1] && s->cdy[0] == s->cdy[2]) {
|
||||||
|
s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
|
||||||
|
i = 0;
|
||||||
|
} else if (ncomponents == 2 && s->precision == 8 &&
|
||||||
|
s->cdx[0] == s->cdx[1] && s->cdy[0] == s->cdy[1]) {
|
||||||
|
s->avctx->pix_fmt = AV_PIX_FMT_YA8;
|
||||||
|
i = 0;
|
||||||
|
} else if (ncomponents == 1 && s->precision == 8) {
|
||||||
|
s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
|
||||||
|
i = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user