comparison indeo3.c @ 4591:16c24b902f43 libavcodec

use FFMIN patch by ramiro _at_ lisha.ufsc.br
author aurel
date Sun, 25 Feb 2007 00:35:30 +0000
parents c8c591fe26f8
children 66ef3690d108
comparison
equal deleted inserted replaced
4590:7cb6b1272f34 4591:16c24b902f43
95 static void iv_Decode_Chunk(Indeo3DecodeContext *s, unsigned char *cur, 95 static void iv_Decode_Chunk(Indeo3DecodeContext *s, unsigned char *cur,
96 unsigned char *ref, int width, int height, unsigned char *buf1, 96 unsigned char *ref, int width, int height, unsigned char *buf1,
97 long fflags2, unsigned char *hdr, 97 long fflags2, unsigned char *hdr,
98 unsigned char *buf2, int min_width_160); 98 unsigned char *buf2, int min_width_160);
99 99
100 #ifndef min
101 #define min(a,b) ((a) < (b) ? (a) : (b))
102 #endif
103
104 /* ---------------------------------------------------------------------- */ 100 /* ---------------------------------------------------------------------- */
105 static void iv_alloc_frames(Indeo3DecodeContext *s) 101 static void iv_alloc_frames(Indeo3DecodeContext *s)
106 { 102 {
107 int luma_width, luma_height, luma_pixels, chroma_width, chroma_height, 103 int luma_width, luma_height, luma_pixels, chroma_width, chroma_height,
108 chroma_pixels, i; 104 chroma_pixels, i;
228 offs = le2me_32(*(uint32_t *)buf_pos); 224 offs = le2me_32(*(uint32_t *)buf_pos);
229 buf_pos += 4; 225 buf_pos += 4;
230 226
231 iv_Decode_Chunk(s, s->cur_frame->Ybuf, s->ref_frame->Ybuf, hdr_width, 227 iv_Decode_Chunk(s, s->cur_frame->Ybuf, s->ref_frame->Ybuf, hdr_width,
232 hdr_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos, 228 hdr_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
233 min(hdr_width, 160)); 229 FFMIN(hdr_width, 160));
234 230
235 if (!(s->avctx->flags & CODEC_FLAG_GRAY)) 231 if (!(s->avctx->flags & CODEC_FLAG_GRAY))
236 { 232 {
237 233
238 buf_pos = buf + 16 + offs2; 234 buf_pos = buf + 16 + offs2;
239 offs = le2me_32(*(uint32_t *)buf_pos); 235 offs = le2me_32(*(uint32_t *)buf_pos);
240 buf_pos += 4; 236 buf_pos += 4;
241 237
242 iv_Decode_Chunk(s, s->cur_frame->Vbuf, s->ref_frame->Vbuf, chroma_width, 238 iv_Decode_Chunk(s, s->cur_frame->Vbuf, s->ref_frame->Vbuf, chroma_width,
243 chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos, 239 chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
244 min(chroma_width, 40)); 240 FFMIN(chroma_width, 40));
245 241
246 buf_pos = buf + 16 + offs3; 242 buf_pos = buf + 16 + offs3;
247 offs = le2me_32(*(uint32_t *)buf_pos); 243 offs = le2me_32(*(uint32_t *)buf_pos);
248 buf_pos += 4; 244 buf_pos += 4;
249 245
250 iv_Decode_Chunk(s, s->cur_frame->Ubuf, s->ref_frame->Ubuf, chroma_width, 246 iv_Decode_Chunk(s, s->cur_frame->Ubuf, s->ref_frame->Ubuf, chroma_width,
251 chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos, 247 chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos,
252 min(chroma_width, 40)); 248 FFMIN(chroma_width, 40));
253 249
254 } 250 }
255 251
256 return 8; 252 return 8;
257 } 253 }