diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-13 02:07:09 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-13 16:34:23 +0200 |
commit | 4d15f194b48ad1d92cca2559b6b0db3f0f234528 (patch) | |
tree | aa2f58ac1ee30e9902e6804461673d12a399800d | |
parent | ac8d6f120da3f342cd0fc8af35d9633dbaddcfe5 (diff) | |
download | ffmpeg-4d15f194b48ad1d92cca2559b6b0db3f0f234528.tar.gz |
tiffenc: set bpp table for monow/monob formats
Also makes the bpp_tab non static const, as it needs to be changed in
this case.
Fix encoding of monow/monob images, fix trac issue #193.
-rw-r--r-- | libavcodec/tiffenc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 2d3442943a..f7228f128f 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -210,7 +210,7 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf, uint32_t *strip_offsets = NULL; int bytes_per_row; uint32_t res[2] = { 72, 1 }; // image resolution (72/1) - static const uint16_t bpp_tab[] = { 8, 8, 8, 8 }; + uint16_t bpp_tab[] = { 8, 8, 8, 8 }; int ret = -1; int is_yuv = 0; uint8_t *yuv_line = NULL; @@ -258,6 +258,7 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf, case PIX_FMT_MONOWHITE: s->bpp = 1; s->photometric_interpretation = avctx->pix_fmt == PIX_FMT_MONOBLACK; + bpp_tab[0] = 1; break; case PIX_FMT_YUV420P: case PIX_FMT_YUV422P: |