[FFmpeg-devel] [PATCH 5/5] pnmdec: keep bitdepth rather than rescaling

Christophe Gisquet christophe.gisquet at gmail.com
Wed Aug 20 10:10:48 CEST 2014


pnmdec currently respects the consign of rgb48 content. Instead, do not rescale
and make the bits_per_raw_sample valid and useful.
---
 libavcodec/pnmdec.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c
index c84b6eb..36bdfe7 100644
--- a/libavcodec/pnmdec.c
+++ b/libavcodec/pnmdec.c
@@ -67,15 +67,11 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
         n = avctx->width * 8;
         components=4;
         sample_len=16;
-        if (s->maxval < 65535)
-            upgrade = 2;
         goto do_read;
     case AV_PIX_FMT_RGB48:
         n = avctx->width * 6;
         components=3;
         sample_len=16;
-        if (s->maxval < 65535)
-            upgrade = 2;
         goto do_read;
     case AV_PIX_FMT_RGBA:
         n = avctx->width * 4;
@@ -105,8 +101,6 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
         n = avctx->width * 2;
         components=1;
         sample_len=16;
-        if (s->maxval < 65535)
-            upgrade = 2;
         goto do_read;
     case AV_PIX_FMT_MONOWHITE:
     case AV_PIX_FMT_MONOBLACK:
-- 
1.9.2.msysgit.0



More information about the ffmpeg-devel mailing list