[FFmpeg-devel] [PATCH]Set bits_per_raw_sample for pnm

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Jul 29 10:07:06 CEST 2013


Hi!

Setting bits_per_raw_sample allows to forward bitdepth != 8 and != 16.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c
index d0c7295..d6f9462 100644
--- a/libavcodec/pnmdec.c
+++ b/libavcodec/pnmdec.c
@@ -47,6 +47,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
         return ret;
     p->pict_type = AV_PICTURE_TYPE_I;
     p->key_frame = 1;
+    avctx->bits_per_raw_sample = av_log2(s->maxval) + 1;
 
     switch (avctx->pix_fmt) {
     default:


More information about the ffmpeg-devel mailing list