comparison indeo3.c @ 7947:70e83ea6a20a libavcodec

use uint8_t instead of unsigned char
author benoit
date Tue, 30 Sep 2008 09:32:14 +0000
parents cbb9b2f88ccb
children 290928686766
comparison
equal deleted inserted replaced
7946:cbb9b2f88ccb 7947:70e83ea6a20a
30 30
31 #include "indeo3data.h" 31 #include "indeo3data.h"
32 32
33 typedef struct 33 typedef struct
34 { 34 {
35 unsigned char *Ybuf; 35 uint8_t *Ybuf;
36 unsigned char *Ubuf; 36 uint8_t *Ubuf;
37 unsigned char *Vbuf; 37 uint8_t *Vbuf;
38 unsigned char *the_buf; 38 uint8_t *the_buf;
39 unsigned int the_buf_size; 39 unsigned int the_buf_size;
40 unsigned short y_w, y_h; 40 unsigned short y_w, y_h;
41 unsigned short uv_w, uv_h; 41 unsigned short uv_w, uv_h;
42 } YUVBufs; 42 } YUVBufs;
43 43
48 48
49 YUVBufs iv_frame[2]; 49 YUVBufs iv_frame[2];
50 YUVBufs *cur_frame; 50 YUVBufs *cur_frame;
51 YUVBufs *ref_frame; 51 YUVBufs *ref_frame;
52 52
53 unsigned char *ModPred; 53 uint8_t *ModPred;
54 uint8_t *corrector_type; 54 uint8_t *corrector_type;
55 } Indeo3DecodeContext; 55 } Indeo3DecodeContext;
56 56
57 static const uint8_t corrector_type_0[24] = { 57 static const uint8_t corrector_type_0[24] = {
58 195, 159, 133, 115, 101, 93, 87, 77, 58 195, 159, 133, 115, 101, 93, 87, 77,
89 ? 0 : corrector_type_2[j - 248]); 89 ? 0 : corrector_type_2[j - 248]);
90 } 90 }
91 } 91 }
92 } 92 }
93 93
94 static void iv_Decode_Chunk(Indeo3DecodeContext *s, unsigned char *cur, 94 static void iv_Decode_Chunk(Indeo3DecodeContext *s, uint8_t *cur,
95 unsigned char *ref, int width, int height, const unsigned char *buf1, 95 uint8_t *ref, int width, int height, const uint8_t *buf1,
96 long fflags2, const unsigned char *hdr, 96 long fflags2, const uint8_t *hdr,
97 const unsigned char *buf2, int min_width_160); 97 const uint8_t *buf2, int min_width_160);
98 98
99 /* ---------------------------------------------------------------------- */ 99 /* ---------------------------------------------------------------------- */
100 static av_cold void iv_alloc_frames(Indeo3DecodeContext *s) 100 static av_cold void iv_alloc_frames(Indeo3DecodeContext *s)
101 { 101 {
102 int luma_width, luma_height, luma_pixels, chroma_width, chroma_height, 102 int luma_width, luma_height, luma_pixels, chroma_width, chroma_height,
174 av_free(s->corrector_type); 174 av_free(s->corrector_type);
175 } 175 }
176 176
177 /* ---------------------------------------------------------------------- */ 177 /* ---------------------------------------------------------------------- */
178 static unsigned long iv_decode_frame(Indeo3DecodeContext *s, 178 static unsigned long iv_decode_frame(Indeo3DecodeContext *s,
179 const unsigned char *buf, int buf_size) 179 const uint8_t *buf, int buf_size)
180 { 180 {
181 unsigned int hdr_width, hdr_height, 181 unsigned int hdr_width, hdr_height,
182 chroma_width, chroma_height; 182 chroma_width, chroma_height;
183 unsigned long fflags1, fflags2, fflags3, offs1, offs2, offs3, offs; 183 unsigned long fflags1, fflags2, fflags3, offs1, offs2, offs3, offs;
184 const unsigned char *hdr_pos, *buf_pos; 184 const uint8_t *hdr_pos, *buf_pos;
185 185
186 buf_pos = buf; 186 buf_pos = buf;
187 buf_pos += 18; 187 buf_pos += 18;
188 188
189 fflags1 = bytestream_get_le16(&buf_pos); 189 fflags1 = bytestream_get_le16(&buf_pos);
295 buf1 += 2; \ 295 buf1 += 2; \
296 } \ 296 } \
297 lp2 = 4; 297 lp2 = 4;
298 298
299 static void iv_Decode_Chunk(Indeo3DecodeContext *s, 299 static void iv_Decode_Chunk(Indeo3DecodeContext *s,
300 unsigned char *cur, unsigned char *ref, int width, int height, 300 uint8_t *cur, uint8_t *ref, int width, int height,
301 const unsigned char *buf1, long fflags2, const unsigned char *hdr, 301 const uint8_t *buf1, long fflags2, const uint8_t *hdr,
302 const unsigned char *buf2, int min_width_160) 302 const uint8_t *buf2, int min_width_160)
303 { 303 {
304 unsigned char bit_buf; 304 uint8_t bit_buf;
305 unsigned long bit_pos, lv, lv1, lv2; 305 unsigned long bit_pos, lv, lv1, lv2;
306 long *width_tbl, width_tbl_arr[10]; 306 long *width_tbl, width_tbl_arr[10];
307 const signed char *ref_vectors; 307 const signed char *ref_vectors;
308 unsigned char *cur_frm_pos, *ref_frm_pos, *cp, *cp2; 308 uint8_t *cur_frm_pos, *ref_frm_pos, *cp, *cp2;
309 uint32_t *cur_lp, *ref_lp; 309 uint32_t *cur_lp, *ref_lp;
310 const uint32_t *correction_lp[2], *correctionloworder_lp[2], *correctionhighorder_lp[2]; 310 const uint32_t *correction_lp[2], *correctionloworder_lp[2], *correctionhighorder_lp[2];
311 uint8_t *correction_type_sp[2]; 311 uint8_t *correction_type_sp[2];
312 ustr_t strip_tbl[20], *strip; 312 ustr_t strip_tbl[20], *strip;
313 int i, j, k, lp1, lp2, flag1, cmd, blks_width, blks_height, region_160_width, 313 int i, j, k, lp1, lp2, flag1, cmd, blks_width, blks_height, region_160_width,
1063 return 0; 1063 return 0;
1064 } 1064 }
1065 1065
1066 static int indeo3_decode_frame(AVCodecContext *avctx, 1066 static int indeo3_decode_frame(AVCodecContext *avctx,
1067 void *data, int *data_size, 1067 void *data, int *data_size,
1068 const unsigned char *buf, int buf_size) 1068 const uint8_t *buf, int buf_size)
1069 { 1069 {
1070 Indeo3DecodeContext *s=avctx->priv_data; 1070 Indeo3DecodeContext *s=avctx->priv_data;
1071 unsigned char *src, *dest; 1071 uint8_t *src, *dest;
1072 int y; 1072 int y;
1073 1073
1074 iv_decode_frame(s, buf, buf_size); 1074 iv_decode_frame(s, buf, buf_size);
1075 1075
1076 if(s->frame.data[0]) 1076 if(s->frame.data[0])