comparison flicvideo.c @ 5632:cdc40afde7b8 libavcodec

Fix issue 123 (Support Magic-carpet fli version, https://roundup.mplayerhq.hu/roundup/ffmpeg/issue123 ) by rearranging the bit depth
author melanson
date Tue, 04 Sep 2007 17:31:25 +0000
parents 2b72f9bc4f06
children b854bbb8ded9
comparison
equal deleted inserted replaced
5631:550e37ec2204 5632:cdc40afde7b8
83 int depth; 83 int depth;
84 84
85 s->avctx = avctx; 85 s->avctx = avctx;
86 86
87 s->fli_type = AV_RL16(&fli_header[4]); /* Might be overridden if a Magic Carpet FLC */ 87 s->fli_type = AV_RL16(&fli_header[4]); /* Might be overridden if a Magic Carpet FLC */
88 depth = AV_RL16(&fli_header[12]); 88
89 89 depth = 0;
90 if (depth == 0) {
91 depth = 8; /* Some FLC generators set depth to zero, when they mean 8Bpp. Fix up here */
92 }
93
94 if (s->avctx->extradata_size == 12) { 90 if (s->avctx->extradata_size == 12) {
95 /* special case for magic carpet FLIs */ 91 /* special case for magic carpet FLIs */
96 s->fli_type = FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE; 92 s->fli_type = FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE;
93 depth = 8;
97 } else if (s->avctx->extradata_size != 128) { 94 } else if (s->avctx->extradata_size != 128) {
98 av_log(avctx, AV_LOG_ERROR, "Expected extradata of 12 or 128 bytes\n"); 95 av_log(avctx, AV_LOG_ERROR, "Expected extradata of 12 or 128 bytes\n");
99 return -1; 96 return -1;
97 } else {
98 depth = AV_RL16(&fli_header[12]);
99 }
100
101 if (depth == 0) {
102 depth = 8; /* Some FLC generators set depth to zero, when they mean 8Bpp. Fix up here */
100 } 103 }
101 104
102 if ((s->fli_type == FLC_FLX_TYPE_CODE) && (depth == 16)) { 105 if ((s->fli_type == FLC_FLX_TYPE_CODE) && (depth == 16)) {
103 depth = 15; /* Original Autodesk FLX's say the depth is 16Bpp when it is really 15Bpp */ 106 depth = 15; /* Original Autodesk FLX's say the depth is 16Bpp when it is really 15Bpp */
104 } 107 }