mirror of https://git.ffmpeg.org/ffmpeg.git
parent
02026d08a9
commit
871e2f4fac
|
@ -111,10 +111,13 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
|
||||||
avctx->height = h;
|
avctx->height = h;
|
||||||
s->maxval = maxval;
|
s->maxval = maxval;
|
||||||
if (depth == 1) {
|
if (depth == 1) {
|
||||||
if (maxval == 1)
|
if (maxval == 1) {
|
||||||
avctx->pix_fmt = PIX_FMT_MONOWHITE;
|
avctx->pix_fmt = PIX_FMT_MONOWHITE;
|
||||||
else
|
} else if (maxval == 255) {
|
||||||
avctx->pix_fmt = PIX_FMT_GRAY8;
|
avctx->pix_fmt = PIX_FMT_GRAY8;
|
||||||
|
} else {
|
||||||
|
avctx->pix_fmt = PIX_FMT_GRAY16BE;
|
||||||
|
}
|
||||||
} else if (depth == 3) {
|
} else if (depth == 3) {
|
||||||
if (maxval < 256) {
|
if (maxval < 256) {
|
||||||
avctx->pix_fmt = PIX_FMT_RGB24;
|
avctx->pix_fmt = PIX_FMT_RGB24;
|
||||||
|
|
Loading…
Reference in New Issue