forked from FFmpeg/FFmpeg
parent
02026d08a9
commit
871e2f4fac
1 changed files with 5 additions and 2 deletions
|
@ -111,10 +111,13 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
|
|||
avctx->height = h;
|
||||
s->maxval = maxval;
|
||||
if (depth == 1) {
|
||||
if (maxval == 1)
|
||||
if (maxval == 1) {
|
||||
avctx->pix_fmt = PIX_FMT_MONOWHITE;
|
||||
else
|
||||
} else if (maxval == 255) {
|
||||
avctx->pix_fmt = PIX_FMT_GRAY8;
|
||||
} else {
|
||||
avctx->pix_fmt = PIX_FMT_GRAY16BE;
|
||||
}
|
||||
} else if (depth == 3) {
|
||||
if (maxval < 256) {
|
||||
avctx->pix_fmt = PIX_FMT_RGB24;
|
||||
|
|
Loading…
Add table
Reference in a new issue