Mercurial > libavcodec.hg
comparison tiffenc.c @ 8590:7a463923ecd1 libavcodec
Change semantic of CONFIG_*, HAVE_* and ARCH_*.
They are now always defined to either 0 or 1.
author | aurel |
---|---|
date | Tue, 13 Jan 2009 23:44:16 +0000 |
parents | e943e1409077 |
children | e9d9d946f213 |
comparison
equal
deleted
inserted
replaced
8589:a29b5b5c3c9d | 8590:7a463923ecd1 |
---|---|
23 * TIFF image encoder | 23 * TIFF image encoder |
24 * @file tiffenc.c | 24 * @file tiffenc.c |
25 * @author Bartlomiej Wolowiec | 25 * @author Bartlomiej Wolowiec |
26 */ | 26 */ |
27 #include "avcodec.h" | 27 #include "avcodec.h" |
28 #ifdef CONFIG_ZLIB | 28 #if CONFIG_ZLIB |
29 #include <zlib.h> | 29 #include <zlib.h> |
30 #endif | 30 #endif |
31 #include "bytestream.h" | 31 #include "bytestream.h" |
32 #include "tiff.h" | 32 #include "tiff.h" |
33 #include "rle.h" | 33 #include "rle.h" |
149 static int encode_strip(TiffEncoderContext * s, const int8_t * src, | 149 static int encode_strip(TiffEncoderContext * s, const int8_t * src, |
150 uint8_t * dst, int n, int compr) | 150 uint8_t * dst, int n, int compr) |
151 { | 151 { |
152 | 152 |
153 switch (compr) { | 153 switch (compr) { |
154 #ifdef CONFIG_ZLIB | 154 #if CONFIG_ZLIB |
155 case TIFF_DEFLATE: | 155 case TIFF_DEFLATE: |
156 case TIFF_ADOBE_DEFLATE: | 156 case TIFF_ADOBE_DEFLATE: |
157 { | 157 { |
158 unsigned long zlen = s->buf_size - (*s->buf - s->buf_start); | 158 unsigned long zlen = s->buf_size - (*s->buf - s->buf_start); |
159 if (compress(dst, &zlen, src, n) != Z_OK) { | 159 if (compress(dst, &zlen, src, n) != Z_OK) { |
227 s->compr = TIFF_PACKBITS; | 227 s->compr = TIFF_PACKBITS; |
228 if (avctx->compression_level == 0) { | 228 if (avctx->compression_level == 0) { |
229 s->compr = TIFF_RAW; | 229 s->compr = TIFF_RAW; |
230 } else if(avctx->compression_level == 2) { | 230 } else if(avctx->compression_level == 2) { |
231 s->compr = TIFF_LZW; | 231 s->compr = TIFF_LZW; |
232 #ifdef CONFIG_ZLIB | 232 #if CONFIG_ZLIB |
233 } else if ((avctx->compression_level >= 3)) { | 233 } else if ((avctx->compression_level >= 3)) { |
234 s->compr = TIFF_DEFLATE; | 234 s->compr = TIFF_DEFLATE; |
235 #endif | 235 #endif |
236 } | 236 } |
237 | 237 |
313 av_log(s->avctx, AV_LOG_ERROR, "Not enough memory\n"); | 313 av_log(s->avctx, AV_LOG_ERROR, "Not enough memory\n"); |
314 goto fail; | 314 goto fail; |
315 } | 315 } |
316 } | 316 } |
317 | 317 |
318 #ifdef CONFIG_ZLIB | 318 #if CONFIG_ZLIB |
319 if (s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE) { | 319 if (s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE) { |
320 uint8_t *zbuf; | 320 uint8_t *zbuf; |
321 int zlen, zn; | 321 int zlen, zn; |
322 int j; | 322 int j; |
323 | 323 |