[FFmpeg-cvslog] tiffenc: factorize code for monow/monob case in encode_frame() switch

Stefano Sabatini git at videolan.org
Fri May 13 17:01:53 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Fri May 13 02:03:18 2011 +0200| [ac8d6f120da3f342cd0fc8af35d9633dbaddcfe5] | committer: Stefano Sabatini

tiffenc: factorize code for monow/monob case in encode_frame() switch

Reduce code duplication, increase robustness.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac8d6f120da3f342cd0fc8af35d9633dbaddcfe5
---

 libavcodec/tiffenc.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index d0614f5..2d34429 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -255,12 +255,9 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf,
         s->photometric_interpretation = 3;
         break;
     case PIX_FMT_MONOBLACK:
-        s->bpp = 1;
-        s->photometric_interpretation = 1;
-        break;
     case PIX_FMT_MONOWHITE:
         s->bpp = 1;
-        s->photometric_interpretation = 0;
+        s->photometric_interpretation = avctx->pix_fmt == PIX_FMT_MONOBLACK;
         break;
     case PIX_FMT_YUV420P:
     case PIX_FMT_YUV422P:



More information about the ffmpeg-cvslog mailing list