comparison indeo3.c @ 7946:cbb9b2f88ccb libavcodec

Corrector type fits in 8 bits.
author benoit
date Tue, 30 Sep 2008 09:26:49 +0000
parents 25fa57ac17d4
children 70e83ea6a20a
comparison
equal deleted inserted replaced
7945:25fa57ac17d4 7946:cbb9b2f88ccb
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 unsigned char *ModPred;
54 unsigned short *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,
59 195, 159, 133, 115, 101, 93, 87, 77, 59 195, 159, 133, 115, 101, 93, 87, 77,
78 s->ModPred[i+5*128] = 2*((i + 4) - ((i + 3) % 7)); 78 s->ModPred[i+5*128] = 2*((i + 4) - ((i + 3) % 7));
79 s->ModPred[i+6*128] = (i > 123) ? 240 : 2*((i + 4) - ((i + 4) % 8)); 79 s->ModPred[i+6*128] = (i > 123) ? 240 : 2*((i + 4) - ((i + 4) % 8));
80 s->ModPred[i+7*128] = 2*((i + 5) - ((i + 4) % 9)); 80 s->ModPred[i+7*128] = 2*((i + 5) - ((i + 4) % 9));
81 } 81 }
82 82
83 s->corrector_type = av_malloc(24 * 256 * sizeof(*s->corrector_type)); 83 s->corrector_type = av_malloc(24 * 256);
84 84
85 for (i=0; i < 24; ++i) { 85 for (i=0; i < 24; ++i) {
86 for (j=0; j < 256; ++j) { 86 for (j=0; j < 256; ++j) {
87 s->corrector_type[i*256+j] = (j < corrector_type_0[i]) 87 s->corrector_type[i*256+j] = (j < corrector_type_0[i])
88 ? 1 : ((j < 248 || (i == 16 && j == 248)) 88 ? 1 : ((j < 248 || (i == 16 && j == 248))
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 unsigned char *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 unsigned short *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,
314 rle_v1, rle_v2, rle_v3; 314 rle_v1, rle_v2, rle_v3;
315 unsigned short res; 315 unsigned short res;
316 316