diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-13 02:03:18 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-13 16:34:14 +0200 |
commit | ac8d6f120da3f342cd0fc8af35d9633dbaddcfe5 (patch) | |
tree | a2eac3a2bf28aa16c02b925718e0ddbc939dfc7a | |
parent | 995013ebc847f9c7bdc5fd8dc1df53c9ad4a7066 (diff) | |
download | ffmpeg-ac8d6f120da3f342cd0fc8af35d9633dbaddcfe5.tar.gz |
tiffenc: factorize code for monow/monob case in encode_frame() switch
Reduce code duplication, increase robustness.
-rw-r--r-- | libavcodec/tiffenc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index d0614f5faf..2d3442943a 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: |