Revision deabd4fd

View differences:

libavcodec/Makefile
21 21

  
22 22
# codecs which are patented in some non free countries like the us
23 23
ifeq ($(CONFIG_RISKY),yes)
24
OBJS+= h263.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o
24
OBJS+= h263.o msmpeg4.o h263dec.o svq1.o rv10.o wmadec.o indeo3.o
25 25
endif
26 26

  
27 27
# currently using liba52 for ac3 decoding
libavcodec/allcodecs.c
82 82
    register_avcodec(&svq1_decoder);
83 83
    register_avcodec(&wmav1_decoder);
84 84
    register_avcodec(&wmav2_decoder);
85
    register_avcodec(&indeo3_decoder);
85 86
#endif
86 87
    register_avcodec(&mpeg_decoder);
87 88
    register_avcodec(&dvvideo_decoder);
libavcodec/avcodec.h
50 50
    CODEC_ID_HUFFYUV,
51 51
    CODEC_ID_CYUV,
52 52
    CODEC_ID_H264,
53
    CODEC_ID_INDEO3,
53 54

  
54 55
    /* various pcm "codecs" */
55 56
    CODEC_ID_PCM_S16LE,
......
1183 1184
extern AVCodec oggvorbis_decoder;
1184 1185
extern AVCodec cyuv_decoder;
1185 1186
extern AVCodec h264_decoder;
1187
extern AVCodec indeo3_decoder;
1186 1188

  
1187 1189
/* pcm codecs */
1188 1190
#define PCM_CODEC(id, name) \
libavcodec/indeo3.c
1
/*
2
 * Intel Indeo 3 (IV31, IV32, etc.) video decoder for ffmpeg
3
 * written, produced, and directed by Alan Smithee
4
 *
5
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 2 of the License, or (at your option) any later version.
9
 *
10
 * This library is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Lesser General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Lesser General Public
16
 * License along with this library; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 */
19

  
20
#include <stdio.h>
21
#include <stdlib.h>
22
#include <string.h>
23
#include <unistd.h>
24

  
25
#include "common.h"
26
#include "avcodec.h"
27
#include "dsputil.h"
28
#include "mpegvideo.h"
29
#include "bswap.h"
30

  
31
#include "indeo3data.h"
32

  
33
typedef struct
34
{
35
  unsigned char *Ybuf;
36
  unsigned char *Ubuf;
37
  unsigned char *Vbuf;
38
  unsigned char *the_buf;
39
  unsigned int the_buf_size;
40
  unsigned short y_w, y_h;
41
  unsigned short uv_w, uv_h;
42
} YUVBufs;
43

  
44
typedef struct Indeo3DecodeContext {
45
    AVCodecContext *avctx;
46
    int width, height;
47
    AVFrame frame;
48

  
49
    YUVBufs iv_frame[2];
50
    YUVBufs *cur_frame;
51
    YUVBufs *ref_frame;
52

  
53
    unsigned char *ModPred;
54
    unsigned short *corrector_type;
55
} Indeo3DecodeContext;
56

  
57
static int corrector_type_0[24] = {
58
  195, 159, 133, 115, 101,  93,  87,  77,
59
  195, 159, 133, 115, 101,  93,  87,  77,
60
  128,  79,  79,  79,  79,  79,  79,  79
61
};
62

  
63
static int corrector_type_2[8] = { 9, 7, 6, 8, 5, 4, 3, 2 };
64

  
65
static void build_modpred(Indeo3DecodeContext *s) 
66
{
67
  int i, j;
68

  
69
  s->ModPred = (unsigned char *) av_malloc (8 * 128);
70

  
71
  for (i=0; i < 128; ++i) {
72
    s->ModPred[i+0*128] = (i > 126) ? 254 : 2*((i + 1) - ((i + 1) % 2));
73
    s->ModPred[i+1*128] = (i == 7)  ?  20 : ((i == 119 || i == 120)
74
				 ? 236 : 2*((i + 2) - ((i + 1) % 3)));
75
    s->ModPred[i+2*128] = (i > 125) ? 248 : 2*((i + 2) - ((i + 2) % 4));
76
    s->ModPred[i+3*128] =			 2*((i + 1) - ((i - 3) % 5));
77
    s->ModPred[i+4*128] = (i == 8)  ?  20 : 2*((i + 1) - ((i - 3) % 6));
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));
80
    s->ModPred[i+7*128] =			 2*((i + 5) - ((i + 4) % 9));
81
  }
82

  
83
  s->corrector_type = (unsigned short *) av_malloc (24 * 256 * sizeof(unsigned short));
84

  
85
  for (i=0; i < 24; ++i) {
86
    for (j=0; j < 256; ++j) {
87
      s->corrector_type[i*256+j] = (j < corrector_type_0[i])
88
				? 1 : ((j < 248 || (i == 16 && j == 248))
89
				       ? 0 : corrector_type_2[j - 248]);
90
    }
91
  }
92
}
93

  
94
static void iv_Decode_Chunk(Indeo3DecodeContext *s, unsigned char *cur, 
95
  unsigned char *ref, int width, int height, unsigned char *buf1, 
96
  long fflags2, unsigned char *hdr,
97
  unsigned char *buf2, int min_width_160);
98

  
99
#define min(a,b) ((a) < (b) ? (a) : (b))
100

  
101
/* ---------------------------------------------------------------------- */
102
static void iv_alloc_frames(Indeo3DecodeContext *s) 
103
{
104
  int luma_width, luma_height, luma_pixels, chroma_width, chroma_height,
105
    chroma_pixels, bufsize, i;
106

  
107
  luma_width = (s->width + 15) & -0x10;
108
  luma_height = (s->height + 15) & -0x10;
109

  
110
  s->iv_frame[0].y_w = s->iv_frame[0].y_h = 
111
    s->iv_frame[0].the_buf_size = 0;
112
  s->iv_frame[1].y_w = s->iv_frame[1].y_h = 
113
    s->iv_frame[1].the_buf_size = 0;
114
  s->iv_frame[1].the_buf = NULL;
115

  
116
  chroma_width = luma_width >> 2;
117
  chroma_height = luma_height >> 2;
118
  luma_pixels = luma_width * luma_height;
119
  chroma_pixels = chroma_width * chroma_height;
120

  
121
  bufsize = luma_pixels * 2 + luma_width * 3 + 
122
    (chroma_pixels + chroma_width) * 4;
123

  
124
  if((s->iv_frame[0].the_buf = 
125
    (s->iv_frame[0].the_buf_size == 0 ? av_malloc(bufsize) : 
126
      av_realloc(s->iv_frame[0].the_buf, bufsize))) == NULL)
127
    return;
128
  s->iv_frame[0].y_w = s->iv_frame[1].y_w = luma_width;
129
  s->iv_frame[0].y_h = s->iv_frame[1].y_h = luma_height;
130
  s->iv_frame[0].uv_w = s->iv_frame[1].uv_w = chroma_width;
131
  s->iv_frame[0].uv_h = s->iv_frame[1].uv_h = chroma_height;
132
  s->iv_frame[0].the_buf_size = bufsize;
133

  
134
  s->iv_frame[0].Ybuf = s->iv_frame[0].the_buf + luma_width;
135
  i = luma_pixels + luma_width * 2;
136
  s->iv_frame[1].Ybuf = s->iv_frame[0].the_buf + i;
137
  i += (luma_pixels + luma_width);
138
  s->iv_frame[0].Ubuf = s->iv_frame[0].the_buf + i;
139
  i += (chroma_pixels + chroma_width);
140
  s->iv_frame[1].Ubuf = s->iv_frame[0].the_buf + i;
141
  i += (chroma_pixels + chroma_width);
142
  s->iv_frame[0].Vbuf = s->iv_frame[0].the_buf + i;
143
  i += (chroma_pixels + chroma_width);
144
  s->iv_frame[1].Vbuf = s->iv_frame[0].the_buf + i;
145

  
146
  for(i = 1; i <= luma_width; i++)
147
    s->iv_frame[0].Ybuf[-i] = s->iv_frame[1].Ybuf[-i] = 
148
      s->iv_frame[0].Ubuf[-i] = 0x80;
149

  
150
  for(i = 1; i <= chroma_width; i++) {
151
    s->iv_frame[1].Ubuf[-i] = 0x80;
152
    s->iv_frame[0].Vbuf[-i] = 0x80;
153
    s->iv_frame[1].Vbuf[-i] = 0x80;
154
    s->iv_frame[1].Vbuf[chroma_pixels+i-1] = 0x80;
155
  }
156
}
157

  
158
/* ---------------------------------------------------------------------- */
159
static void iv_free_func(Indeo3DecodeContext *s) 
160
{
161
  int i;
162

  
163
  for(i = 0 ; i < 2 ; i++) {
164
    if(s->iv_frame[i].the_buf != NULL) 
165
      av_free(s->iv_frame[i].the_buf);
166
    s->iv_frame[i].Ybuf = s->iv_frame[i].Ubuf = 
167
      s->iv_frame[i].Vbuf = NULL;
168
    s->iv_frame[i].the_buf = NULL;
169
    s->iv_frame[i].the_buf_size = 0;
170
    s->iv_frame[i].y_w = s->iv_frame[i].y_h = 0;
171
    s->iv_frame[i].uv_w = s->iv_frame[i].uv_h = 0;
172
  }
173

  
174
  av_free(s->ModPred);
175
  av_free(s->corrector_type);
176
}
177

  
178
/* ---------------------------------------------------------------------- */
179
static unsigned long iv_decode_frame(Indeo3DecodeContext *s, 
180
                                     unsigned char *buf, int buf_size) 
181
{
182
  unsigned int hdr_width, hdr_height,
183
    chroma_width, chroma_height;
184
  unsigned long fflags1, fflags2, fflags3, offs1, offs2, offs3, offs;
185
  unsigned char *hdr_pos, *buf_pos;
186

  
187
  buf_pos = buf;
188
  buf_pos += 18;
189

  
190
  fflags1 = le2me_16(*(uint16_t *)buf_pos);
191
  buf_pos += 2;
192
  fflags3 = le2me_32(*(uint32_t *)buf_pos);
193
  buf_pos += 4;
194
  fflags2 = *buf_pos++;
195
  buf_pos += 3;
196
  hdr_height = le2me_16(*(uint16_t *)buf_pos);
197
  buf_pos += 2;
198
  hdr_width = le2me_16(*(uint16_t *)buf_pos);
199
  buf_pos += 2;
200
  chroma_height = ((hdr_height >> 2) + 3) & 0x7ffc;
201
  chroma_width = ((hdr_width >> 2) + 3) & 0x7ffc;
202
  offs1 = le2me_32(*(uint32_t *)buf_pos);
203
  buf_pos += 4;
204
  offs2 = le2me_32(*(uint32_t *)buf_pos);
205
  buf_pos += 4;
206
  offs3 = le2me_32(*(uint32_t *)buf_pos);
207
  buf_pos += 8;
208
  hdr_pos = buf_pos;
209
  if(fflags3 == 0x80) return 4;
210

  
211
  if(fflags1 & 0x200) {
212
    s->cur_frame = s->iv_frame + 1;
213
    s->ref_frame = s->iv_frame;
214
  } else {
215
    s->cur_frame = s->iv_frame;
216
    s->ref_frame = s->iv_frame + 1;
217
  }
218

  
219
  buf_pos = buf + 16 + offs1;
220
  offs = le2me_32(*(uint32_t *)buf_pos);
221
  buf_pos += 4;
222

  
223
  iv_Decode_Chunk(s, s->cur_frame->Ybuf, s->ref_frame->Ybuf, hdr_width, 
224
    hdr_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos, 
225
    min(hdr_width, 160));
226

  
227
  buf_pos = buf + 16 + offs2;
228
  offs = le2me_32(*(uint32_t *)buf_pos);
229
  buf_pos += 4;
230

  
231
  iv_Decode_Chunk(s, s->cur_frame->Vbuf, s->ref_frame->Vbuf, chroma_width, 
232
    chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos, 
233
    min(chroma_width, 40));
234

  
235
  buf_pos = buf + 16 + offs3;
236
  offs = le2me_32(*(uint32_t *)buf_pos);
237
  buf_pos += 4;
238

  
239
  iv_Decode_Chunk(s, s->cur_frame->Ubuf, s->ref_frame->Ubuf, chroma_width, 
240
    chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos, 
241
    min(chroma_width, 40));
242

  
243
  return 8;
244
}
245

  
246
typedef struct {
247
  long xpos;
248
  long ypos;
249
  long width;
250
  long height;
251
  long split_flag;
252
  long split_direction;
253
  long usl7;
254
} ustr_t;
255

  
256
/* ---------------------------------------------------------------------- */
257

  
258
static void iv_Decode_Chunk(Indeo3DecodeContext *s,
259
  unsigned char *cur, unsigned char *ref, int width, int height, 
260
  unsigned char *buf1, long fflags2, unsigned char *hdr,
261
  unsigned char *buf2, int min_width_160)
262
{
263
  unsigned char bit_buf;
264
  unsigned long bit_pos, lv, lv1, lv2;
265
  long *width_tbl, width_tbl_arr[10];
266
  char *ref_vectors;
267
  unsigned char *cur_frm_pos, *ref_frm_pos, *cp, *cp2;
268
  unsigned long *cur_lp, *ref_lp, *correction_lp[2], *correctionloworder_lp[2],
269
    *correctionhighorder_lp[2];
270
  unsigned short *correction_type_sp[2];
271
  ustr_t xustr[20], *ptr_ustr;
272
  int i, j, k, lp1, lp2, flag1, cmd, blks_width, blks_height, region_160_width,
273
    rle_v1, rle_v2, rle_v3;
274

  
275
  bit_buf = 0;
276
  ref_vectors = NULL;
277

  
278
  width_tbl = width_tbl_arr + 1;
279
  i = (width < 0 ? width + 3 : width)/4;
280
  for(j = -1; j < 8; j++) 
281
    width_tbl[j] = i * j;
282

  
283
  ptr_ustr = xustr;
284

  
285
  for(region_160_width = 0; region_160_width < (width - min_width_160); region_160_width += min_width_160);
286

  
287
  ptr_ustr->ypos = ptr_ustr->xpos = 0;
288
  for(ptr_ustr->width = min_width_160; width > ptr_ustr->width; ptr_ustr->width *= 2);
289
  ptr_ustr->height = height;
290
  ptr_ustr->split_direction = 0;
291
  ptr_ustr->split_flag = 0;
292
  ptr_ustr->usl7 = 0;
293

  
294
  bit_pos = 0;
295

  
296
  rle_v1 = rle_v2 = rle_v3 = 0;
297

  
298
  while(ptr_ustr >= xustr) {
299
    if(bit_pos <= 0) {
300
      bit_pos = 8;
301
      bit_buf = *buf1++;
302
    }
303

  
304
    bit_pos -= 2;
305
    cmd = (bit_buf >> bit_pos) & 0x03;
306

  
307
    if(cmd == 0) {
308
      ptr_ustr++;
309
      memcpy(ptr_ustr, ptr_ustr-1, sizeof(ustr_t));
310
      ptr_ustr->split_flag = 1;
311
      ptr_ustr->split_direction = 0;
312
      ptr_ustr->height = (ptr_ustr->height > 8 ? ((ptr_ustr->height+8)>>4)<<3 : 4);
313
      continue;
314
    } else if(cmd == 1) {
315
      ptr_ustr++;
316
      memcpy(ptr_ustr, ptr_ustr-1, sizeof(ustr_t));
317
      ptr_ustr->split_flag = 1;
318
      ptr_ustr->split_direction = 1;
319
      ptr_ustr->width = (ptr_ustr->width > 8 ? ((ptr_ustr->width+8)>>4)<<3 : 4);
320
      continue;
321
    } else if(cmd == 2) {
322
      if(ptr_ustr->usl7 == 0) {
323
        ptr_ustr->usl7 = 1;
324
        ref_vectors = NULL;
325
        continue;
326
      }
327
    } else if(cmd == 3) {
328
      if(ptr_ustr->usl7 == 0) {
329
        ptr_ustr->usl7 = 1;
330
        ref_vectors = buf2 + (*buf1 * 2);
331
        buf1++;
332
        continue;
333
      }
334
    }
335

  
336
    cur_frm_pos = cur + width * ptr_ustr->ypos + ptr_ustr->xpos;
337

  
338
    if((blks_width = ptr_ustr->width) < 0) 
339
      blks_width += 3;
340
    blks_width >>= 2;
341
    blks_height = ptr_ustr->height;
342

  
343
    if(ref_vectors != NULL) {
344
      ref_frm_pos = ref + (ref_vectors[0] + ptr_ustr->ypos) * width +
345
        ref_vectors[1] + ptr_ustr->xpos;
346
    } else 
347
      ref_frm_pos = cur_frm_pos - width_tbl[4];
348

  
349
    if(cmd == 2) {
350
      if(bit_pos <= 0) {
351
        bit_pos = 8;
352
        bit_buf = *buf1++;
353
      }
354

  
355
      bit_pos -= 2;
356
      cmd = (bit_buf >> bit_pos) & 0x03;
357

  
358
      if(cmd == 0 || ref_vectors != NULL) {
359
        for(lp1 = 0; lp1 < blks_width; lp1++) {
360
          for(i = 0, j = 0; i < blks_height; i++, j += width_tbl[1])
361
            ((unsigned long *)cur_frm_pos)[j] = ((unsigned long *)ref_frm_pos)[j];
362
          cur_frm_pos += 4;
363
          ref_frm_pos += 4;
364
        }
365
      } else if(cmd != 1) 
366
        return;
367
    } else {
368
      k = *buf1 >> 4;
369
      j = *buf1 & 0x0f;
370
      buf1++;
371
      lv = j + fflags2;
372

  
373
      if((lv - 8) <= 7 && (k == 0 || k == 3 || k == 10)) {
374
        cp2 = s->ModPred + ((lv - 8) << 7);
375
        cp = ref_frm_pos;
376
        for(i = 0; i < blks_width << 2; i++) { *(cp++) = cp2[*cp >> 1]; }
377
      }
378

  
379
      if(k == 1 || k == 4) {
380
        lv = (hdr[j] & 0xf) + fflags2;
381
        correction_type_sp[0] = s->corrector_type + (lv << 8);
382
        correction_lp[0] = correction + (lv << 8);
383
        lv = (hdr[j] >> 4) + fflags2;
384
        correction_lp[1] = correction + (lv << 8);
385
        correction_type_sp[1] = s->corrector_type + (lv << 8);
386
      } else {
387
        correctionloworder_lp[0] = correctionloworder_lp[1] = correctionloworder + (lv << 8);
388
        correctionhighorder_lp[0] = correctionhighorder_lp[1] = correctionhighorder + (lv << 8);
389
        correction_type_sp[0] = correction_type_sp[1] = s->corrector_type + (lv << 8);
390
        correction_lp[0] = correction_lp[1] = correction + (lv << 8);
391
      }
392

  
393
      switch(k) {
394
        case 1:
395
        case 0:                    /********** CASE 0 **********/
396
          for( ; blks_height > 0; blks_height -= 4) {
397
            for(lp1 = 0; lp1 < blks_width; lp1++) {
398
              for(lp2 = 0; lp2 < 4; ) {
399
                k = *buf1++;
400
                cur_lp = ((unsigned long *)cur_frm_pos) + width_tbl[lp2];
401
                ref_lp = ((unsigned long *)ref_frm_pos) + width_tbl[lp2];
402

  
403
                switch(correction_type_sp[0][k]) {
404
                  case 0:
405
                    *cur_lp = ((*ref_lp >> 1) + correction_lp[lp2 & 0x01][k]) << 1;
406
                    lp2++;
407
                    break;
408
                  case 1:
409
                    ((unsigned short *)cur_lp)[0] = ((((unsigned short *)(ref_lp))[0] >> 1)
410
                      + correction_lp[lp2 & 0x01][*buf1++]) << 1;
411
                    ((unsigned short *)cur_lp)[1] = ((((unsigned short *)(ref_lp))[1] >> 1)
412
                      + correction_lp[lp2 & 0x01][k]) << 1;
413
                    lp2++;
414
                    break;
415
                  case 2:
416
                    if(lp2 == 0) {
417
                      for(i = 0, j = 0; i < 2; i++, j += width_tbl[1])
418
                        cur_lp[j] = ref_lp[j];
419
                      lp2 += 2;
420
                    }
421
                    break;
422
                  case 3:
423
                    if(lp2 < 2) {
424
                      for(i = 0, j = 0; i < (3 - lp2); i++, j += width_tbl[1])
425
                        cur_lp[j] = ref_lp[j];
426
                      lp2 = 3;
427
                    }
428
                    break;
429
                  case 8:
430
                    if(lp2 == 0) {
431
                      if(rle_v3 == 0) {
432
                        rle_v2 = *buf1;
433
                        rle_v1 = 1;
434
                        if(rle_v2 > 32) {
435
                          rle_v2 -= 32;
436
                          rle_v1 = 0;
437
                        }
438
                        rle_v3 = 1;
439
                      }
440
                      buf1--;
441

  
442
                      if(rle_v1 == 1 || ref_vectors != NULL) {
443
                        for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
444
                          cur_lp[j] = ref_lp[j];
445
                      }
446

  
447
                      rle_v2--;
448
                      if(rle_v2 == 0) {
449
                        rle_v3 = 0;
450
                        buf1 += 2;
451
                      }
452
                      lp2 = 4;
453
                      break;
454
                    } else {
455
                      rle_v1 = 1;
456
                      rle_v2 = *buf1 - 1;
457
                    }
458
                  case 5:
459
                    if(lp2 == 0 && rle_v3 != 0) 
460
                      rle_v3 = 0;
461
                    else {
462
                      buf1--;
463
                      rle_v3 = 1;
464
                    }
465
                  case 4:
466
                    for(i = 0, j = 0; i < (4 - lp2); i++, j += width_tbl[1])
467
                      cur_lp[j] = ref_lp[j];
468
                    lp2 = 4;
469
                    break;
470

  
471
                  case 7:
472
                    if(rle_v3 != 0) 
473
                      rle_v3 = 0;
474
                    else {
475
                      buf1--;
476
                      rle_v3 = 1;
477
                    }
478
                  case 6:
479
                    if(ref_vectors != NULL) {
480
                      for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
481
                        cur_lp[j] = ref_lp[j];
482
                    }
483
                    lp2 = 4;
484
                    break;
485

  
486
                  case 9:
487
                    lv1 = *buf1++;
488
                    lv = (lv1 & 0x7F) << 1;
489
                    lv += (lv << 8);
490
                    lv += (lv << 16);
491
                    for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
492
                      cur_lp[j] = lv;
493

  
494
                    if((lv1 & 0x80) != 0) {
495
                      if(rle_v3 != 0) 
496
                        rle_v3 = 0;
497
                      else {
498
                        rle_v3 = 1;
499
                        buf1 -= 2;
500
                      }
501
                    }
502
                    lp2 = 4;
503
                    break;
504
                  default: 
505
                    return;
506
                }
507
              }
508

  
509
              cur_frm_pos += 4;
510
              ref_frm_pos += 4;
511
            }
512

  
513
            cur_frm_pos += ((width - blks_width) * 4);
514
            ref_frm_pos += ((width - blks_width) * 4);
515
          }
516
          break;
517

  
518
        case 4:
519
        case 3:                    /********** CASE 3 **********/
520
          if(ref_vectors != NULL) 
521
            return;
522
          flag1 = 1;
523

  
524
          for( ; blks_height > 0; blks_height -= 8) {
525
            for(lp1 = 0; lp1 < blks_width; lp1++) {
526
              for(lp2 = 0; lp2 < 4; ) {
527
                k = *buf1++;
528

  
529
                cur_lp = ((unsigned long *)cur_frm_pos) + width_tbl[lp2 * 2];
530
                ref_lp = ((unsigned long *)cur_frm_pos) + width_tbl[(lp2 * 2) - 1];
531

  
532
                switch(correction_type_sp[lp2 & 0x01][k]) {
533
                  case 0:
534
                    cur_lp[width_tbl[1]] = ((*ref_lp >> 1) + correction_lp[lp2 & 0x01][k]) << 1;
535
                    if(lp2 > 0 || flag1 == 0 || ptr_ustr->ypos != 0)
536
                      cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
537
                    else
538
                      cur_lp[0] = ((*ref_lp >> 1) + correction_lp[lp2 & 0x01][k]) << 1;
539
                    lp2++;
540
                    break;
541

  
542
                  case 1:
543
                    ((unsigned short *)cur_lp)[width_tbl[2]] =
544
                      ((((unsigned short *)ref_lp)[0] >> 1) + correction_lp[lp2 & 0x01][*buf1++]) << 1;
545
                    ((unsigned short *)cur_lp)[width_tbl[2]+1] =
546
                      ((((unsigned short *)ref_lp)[1] >> 1) + correction_lp[lp2 & 0x01][k]) << 1;
547
                    if(lp2 > 0 || flag1 == 0 || ptr_ustr->ypos != 0)
548
                      cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
549
                    else
550
                      cur_lp[0] = cur_lp[width_tbl[1]];
551
                    lp2++;
552
                    break;
553

  
554
                  case 2:
555
                    if(lp2 == 0) {
556
                      for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
557
                        cur_lp[j] = *ref_lp;
558
                      lp2 += 2;
559
                    }
560
                    break;
561

  
562
                  case 3:
563
                    if(lp2 < 2) {
564
                      for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1])
565
                        cur_lp[j] = *ref_lp;
566
                      lp2 = 3;
567
                    }
568
                    break;
569

  
570
                  case 6:
571
                    lp2 = 4;
572
                    break;
573

  
574
                  case 7:
575
                    if(rle_v3 != 0) 
576
                      rle_v3 = 0;
577
                    else {
578
                      buf1--;
579
                      rle_v3 = 1;
580
                    }
581
                    lp2 = 4;
582
                    break;
583

  
584
                  case 8:
585
                    if(lp2 == 0) {
586
                      if(rle_v3 == 0) {
587
                        rle_v2 = *buf1;
588
                        rle_v1 = 1;
589
                        if(rle_v2 > 32) {
590
                          rle_v2 -= 32;
591
                          rle_v1 = 0;
592
                        }
593
                        rle_v3 = 1;
594
                      }
595
                      buf1--;
596

  
597
                      if(rle_v1 == 1) {
598
                        for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
599
                          cur_lp[j] = ref_lp[j];
600
                      }
601

  
602
                      rle_v2--;
603
                      if(rle_v2 == 0) {
604
                        rle_v3 = 0;
605
                        buf1 += 2;
606
                      }
607
                      lp2 = 4;
608
                      break;
609
                    } else {
610
                      rle_v2 = (*buf1) - 1;
611
                      rle_v1 = 1;
612
                    }
613
                  case 5:
614
                    if(lp2 == 0 && rle_v3 != 0) 
615
                      rle_v3 = 0;
616
                    else {
617
                      buf1--;
618
                      rle_v3 = 1;
619
                    }
620
                  case 4:
621
                    for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1])
622
                      cur_lp[j] = *ref_lp;
623
                    lp2 = 4;
624
                    break;
625

  
626
                  case 9:
627
                    fprintf(stderr, "UNTESTED.\n");
628
                    lv1 = *buf1++;
629
                    lv = (lv1 & 0x7F) << 1;
630
                    lv += (lv << 8);
631
                    lv += (lv << 16);
632

  
633
                    for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
634
                      cur_lp[j] = lv;
635

  
636
                    if((lv1 & 0x80) != 0) {
637
                      if(rle_v3 != 0) 
638
                        rle_v3 = 0;
639
                      else {
640
                        rle_v3 = 1;
641
                        buf1 -= 2;
642
                      }
643
                    }
644
                    lp2 = 4;
645
                    break;
646

  
647
                  default: 
648
                    return;
649
                }
650
              }
651

  
652
              cur_frm_pos += 4;
653
            }
654

  
655
            cur_frm_pos += (((width * 2) - blks_width) * 4);
656
            flag1 = 0;
657
          }
658
          break;
659

  
660
        case 10:                    /********** CASE 10 **********/
661
          if(ref_vectors == NULL) {
662
            flag1 = 1;
663

  
664
            for( ; blks_height > 0; blks_height -= 8) {
665
              for(lp1 = 0; lp1 < blks_width; lp1 += 2) {
666
                for(lp2 = 0; lp2 < 4; ) {
667
                  k = *buf1++;
668
                  cur_lp = ((unsigned long *)cur_frm_pos) + width_tbl[lp2 * 2];
669
                  ref_lp = ((unsigned long *)cur_frm_pos) + width_tbl[(lp2 * 2) - 1];
670
                  lv1 = ref_lp[0];
671
                  lv2 = ref_lp[1];
672
                  if(lp2 == 0 && flag1 != 0) {
673
                    lv1 = lv1 & 0x00FF00FF;
674
                    lv1 = (lv1 << 8) | lv1;
675
                    lv2 = lv2 & 0x00FF00FF;
676
                    lv2 = (lv2 << 8) | lv2;
677
                  }
678

  
679
                  switch(correction_type_sp[lp2 & 0x01][k]) {
680
                    case 0:
681
                      cur_lp[width_tbl[1]] = ((lv1 >> 1) + correctionloworder_lp[lp2 & 0x01][k]) << 1;
682
                      cur_lp[width_tbl[1]+1] = ((lv2 >> 1) + correctionhighorder_lp[lp2 & 0x01][k]) << 1;
683
                      if(lp2 > 0 || ptr_ustr->ypos != 0 || flag1 == 0) {
684
                        cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
685
                        cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
686
                      } else {
687
                        cur_lp[0] = cur_lp[width_tbl[1]];
688
                        cur_lp[1] = cur_lp[width_tbl[1]+1];
689
                      }
690
                      lp2++;
691
                      break;
692

  
693
                    case 1:
694
                      cur_lp[width_tbl[1]] = ((lv1 >> 1) + correctionloworder_lp[lp2 & 0x01][*buf1++]) << 1;
695
                      cur_lp[width_tbl[1]+1] = ((lv2 >> 1) + correctionloworder_lp[lp2 & 0x01][k]) << 1;
696
                      if(lp2 > 0 || ptr_ustr->ypos != 0 || flag1 == 0) {
697
                        cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
698
                        cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
699
                      } else {
700
                        cur_lp[0] = cur_lp[width_tbl[1]];
701
                        cur_lp[1] = cur_lp[width_tbl[1]+1];
702
                      }
703
                      lp2++;
704
                      break;
705

  
706
                    case 2:
707
                      if(lp2 == 0) {
708
                        if(flag1 != 0) {
709
                          for(i = 0, j = width_tbl[1]; i < 3; i++, j += width_tbl[1]) {
710
                            cur_lp[j] = lv1;
711
                            cur_lp[j+1] = lv2;
712
                          }
713
                          cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
714
                          cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
715
                        } else {
716
                          for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) {
717
                            cur_lp[j] = lv1;
718
                            cur_lp[j+1] = lv2;
719
                          }
720
                        }
721
                        lp2 += 2;
722
                      }
723
                      break;
724

  
725
                    case 3:
726
                      if(lp2 < 2) {
727
                        if(lp2 == 0 && flag1 != 0) {
728
                          for(i = 0, j = width_tbl[1]; i < 5; i++, j += width_tbl[1]) {
729
                            cur_lp[j] = lv1;
730
                            cur_lp[j+1] = lv2;
731
                          }
732
                          cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
733
                          cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
734
                        } else {
735
                          for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) {
736
                            cur_lp[j] = lv1;
737
                            cur_lp[j+1] = lv2;
738
                          }
739
                        }
740
                        lp2 = 3;
741
                      }
742
                      break;
743

  
744
                    case 8:
745
                      if(lp2 == 0) {
746
                        if(rle_v3 == 0) {
747
                          rle_v2 = *buf1;
748
                          rle_v1 = 1;
749
                          if(rle_v2 > 32) {
750
                            rle_v2 -= 32;
751
                            rle_v1 = 0;
752
                          }
753
                          rle_v3 = 1;
754
                        }
755
                        buf1--;
756
                        if(rle_v1 == 1) {
757
                          if(flag1 != 0) {
758
                            for(i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) {
759
                              cur_lp[j] = lv1;
760
                              cur_lp[j+1] = lv2;
761
                            }
762
                            cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
763
                            cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
764
                          } else {
765
                            for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) {
766
                              cur_lp[j] = lv1;
767
                              cur_lp[j+1] = lv2;
768
                            }
769
                          }
770
                        }
771
                        rle_v2--;
772
                        if(rle_v2 == 0) {
773
                          rle_v3 = 0;
774
                          buf1 += 2;
775
                        }
776
                        lp2 = 4;
777
                        break;
778
                      } else {
779
                        rle_v1 = 1;
780
                        rle_v2 = (*buf1) - 1;
781
                      }
782
                    case 5:
783
                      if(lp2 == 0 && rle_v3 != 0) 
784
                        rle_v3 = 0;
785
                      else {
786
                        buf1--;
787
                        rle_v3 = 1;
788
                      }
789
                    case 4:
790
                      if(lp2 == 0 && flag1 != 0) {
791
                        for(i = 0, j = width_tbl[1]; i < 7; i++, j += width_tbl[1]) {
792
                          cur_lp[j] = lv1;
793
                          cur_lp[j+1] = lv2;
794
                        }
795
                        cur_lp[0] = ((cur_lp[-width_tbl[1]] >> 1) + (cur_lp[width_tbl[1]] >> 1)) & 0xFEFEFEFE;
796
                        cur_lp[1] = ((cur_lp[-width_tbl[1]+1] >> 1) + (cur_lp[width_tbl[1]+1] >> 1)) & 0xFEFEFEFE;
797
                      } else {
798
                        for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) {
799
                          cur_lp[j] = lv1;
800
                          cur_lp[j+1] = lv2;
801
                        }
802
                      }
803
                      lp2 = 4;
804
                      break;
805

  
806
                    case 6:
807
                      lp2 = 4;
808
                      break;
809

  
810
                    case 7:
811
                      if(lp2 == 0) {
812
                        if(rle_v3 != 0) 
813
                          rle_v3 = 0;
814
                        else {
815
                          buf1--;
816
                          rle_v3 = 1;
817
                        }
818
                        lp2 = 4;
819
                      }
820
                      break;
821

  
822
                    case 9:
823
                      fprintf(stderr, "UNTESTED.\n");
824
                      lv1 = *buf1;
825
                      lv = (lv1 & 0x7F) << 1;
826
                      lv += (lv << 8);
827
                      lv += (lv << 16);
828
                      for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
829
                        cur_lp[j] = lv;
830
                      if((lv1 & 0x80) != 0) {
831
                        if(rle_v3 != 0) 
832
                          rle_v3 = 0;
833
                        else {
834
                          rle_v3 = 1;
835
                          buf1 -= 2;
836
                        }
837
                      }
838
                      lp2 = 4;
839
                      break;
840

  
841
                    default: 
842
                      return;
843
                  }
844
                }
845

  
846
                cur_frm_pos += 8;
847
              }
848

  
849
              cur_frm_pos += (((width * 2) - blks_width) * 4);
850
              flag1 = 0;
851
            }
852
          } else {
853
            for( ; blks_height > 0; blks_height -= 8) {
854
              for(lp1 = 0; lp1 < blks_width; lp1 += 2) {
855
                for(lp2 = 0; lp2 < 4; ) {
856
                  k = *buf1++;
857
                  cur_lp = ((unsigned long *)cur_frm_pos) + width_tbl[lp2 * 2];
858
                  ref_lp = ((unsigned long *)ref_frm_pos) + width_tbl[lp2 * 2];
859

  
860
                  switch(correction_type_sp[lp2 & 0x01][k]) {
861
                    case 0:
862
                      lv1 = correctionloworder_lp[lp2 & 0x01][k];
863
                      lv2 = correctionhighorder_lp[lp2 & 0x01][k];
864
                      cur_lp[0] = ((ref_lp[0] >> 1) + lv1) << 1;
865
                      cur_lp[1] = ((ref_lp[1] >> 1) + lv2) << 1;
866
                      cur_lp[width_tbl[1]] = ((ref_lp[width_tbl[1]] >> 1) + lv1) << 1;
867
                      cur_lp[width_tbl[1]+1] = ((ref_lp[width_tbl[1]+1] >> 1) + lv2) << 1;
868
                      lp2++;
869
                      break;
870

  
871
                    case 1:
872
                      lv1 = correctionloworder_lp[lp2 & 0x01][*buf1++];
873
                      lv2 = correctionloworder_lp[lp2 & 0x01][k];
874
                      cur_lp[0] = ((ref_lp[0] >> 1) + lv1) << 1;
875
                      cur_lp[1] = ((ref_lp[1] >> 1) + lv2) << 1;
876
                      cur_lp[width_tbl[1]] = ((ref_lp[width_tbl[1]] >> 1) + lv1) << 1;
877
                      cur_lp[width_tbl[1]+1] = ((ref_lp[width_tbl[1]+1] >> 1) + lv2) << 1;
878
                      lp2++;
879
                      break;
880

  
881
                    case 2:
882
                      if(lp2 == 0) {
883
                        for(i = 0, j = 0; i < 4; i++, j += width_tbl[1]) {
884
                          cur_lp[j] = ref_lp[j];
885
                          cur_lp[j+1] = ref_lp[j+1];
886
                        }
887
                        lp2 += 2;
888
                      }
889
                      break;
890

  
891
                    case 3:
892
                      if(lp2 < 2) {
893
                        for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1]) {
894
                          cur_lp[j] = ref_lp[j];
895
                          cur_lp[j+1] = ref_lp[j+1];
896
                        }
897
                        lp2 = 3;
898
                      }
899
                      break;
900

  
901
                    case 8:
902
                      if(lp2 == 0) {
903
                        if(rle_v3 == 0) {
904
                          rle_v2 = *buf1;
905
                          rle_v1 = 1;
906
                          if(rle_v2 > 32) {
907
                            rle_v2 -= 32;
908
                            rle_v1 = 0;
909
                          }
910
                          rle_v3 = 1;
911
                        }
912
                        buf1--;
913
                        for(i = 0, j = 0; i < 8; i++, j += width_tbl[1]) {
914
                          ((unsigned long *)cur_frm_pos)[j] = ((unsigned long *)ref_frm_pos)[j];
915
                          ((unsigned long *)cur_frm_pos)[j+1] = ((unsigned long *)ref_frm_pos)[j+1];
916
                        }
917
                        rle_v2--;
918
                        if(rle_v2 == 0) {
919
                          rle_v3 = 0;
920
                          buf1 += 2;
921
                        }
922
                        lp2 = 4;
923
                        break;
924
                      } else {
925
                        rle_v1 = 1;
926
                        rle_v2 = (*buf1) - 1;
927
                      }
928
                    case 5:
929
                    case 7:
930
                      if(lp2 == 0 && rle_v3 != 0) 
931
                        rle_v3 = 0;
932
                      else {
933
                        buf1--;
934
                        rle_v3 = 1;
935
                      }
936
                    case 6:
937
                    case 4:
938
                      for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1]) {
939
                        cur_lp[j] = ref_lp[j];
940
                        cur_lp[j+1] = ref_lp[j+1];
941
                      }
942
                      lp2 = 4;
943
                      break;
944

  
945
                    case 9:
946
                      fprintf(stderr, "UNTESTED.\n");
947
                      lv1 = *buf1;
948
                      lv = (lv1 & 0x7F) << 1;
949
                      lv += (lv << 8);
950
                      lv += (lv << 16);
951
                      for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
952
                        ((unsigned long *)cur_frm_pos)[j] = ((unsigned long *)cur_frm_pos)[j+1] = lv;
953
                      if((lv1 & 0x80) != 0) {
954
                        if(rle_v3 != 0) 
955
                          rle_v3 = 0;
956
                        else {
957
                          rle_v3 = 1;
958
                          buf1 -= 2;
959
                        }
960
                      }
961
                      lp2 = 4;
962
                      break;
963

  
964
                    default: 
965
                      return;
966
                  }
967
                }
968

  
969
                cur_frm_pos += 8;
970
                ref_frm_pos += 8;
971
              }
972

  
973
              cur_frm_pos += (((width * 2) - blks_width) * 4);
974
              ref_frm_pos += (((width * 2) - blks_width) * 4);
975
            }
976
          }
977
          break;
978

  
979
        case 11:                    /********** CASE 11 **********/
980
          if(ref_vectors == NULL) 
981
            return;
982

  
983
          for( ; blks_height > 0; blks_height -= 8) {
984
            for(lp1 = 0; lp1 < blks_width; lp1++) {
985
              for(lp2 = 0; lp2 < 4; ) {
986
                k = *buf1++;
987
                cur_lp = ((unsigned long *)cur_frm_pos) + width_tbl[lp2 * 2];
988
                ref_lp = ((unsigned long *)ref_frm_pos) + width_tbl[lp2 * 2];
989

  
990
                switch(correction_type_sp[lp2 & 0x01][k]) {
991
                  case 0:
992
                    cur_lp[0] = ((*ref_lp >> 1) + correction_lp[lp2 & 0x01][k]) << 1;
993
                    cur_lp[width_tbl[1]] = ((ref_lp[width_tbl[1]] >> 1) + correction_lp[lp2 & 0x01][k]) << 1;
994
                    lp2++;
995
                    break;
996

  
997
                  case 1:
998
                    lv1 = (unsigned short)(correction_lp[lp2 & 0x01][*buf1++]);
999
                    lv2 = (unsigned short)(correction_lp[lp2 & 0x01][k]);
1000
                    ((unsigned short *)cur_lp)[0] = ((((unsigned short *)ref_lp)[0] >> 1) + lv1) << 1;
1001
                    ((unsigned short *)cur_lp)[1] = ((((unsigned short *)ref_lp)[1] >> 1) + lv2) << 1;
1002
                    ((unsigned short *)cur_lp)[width_tbl[2]] = ((((unsigned short *)ref_lp)[width_tbl[2]] >> 1) + lv1) << 1;
1003
                    ((unsigned short *)cur_lp)[width_tbl[2]+1] = ((((unsigned short *)ref_lp)[width_tbl[2]+1] >> 1) + lv2) << 1;
1004
                    lp2++;
1005
                    break;
1006

  
1007
                  case 2:
1008
                    if(lp2 == 0) {
1009
                      for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
1010
                        cur_lp[j] = ref_lp[j];
1011
                      lp2 += 2;
1012
                    }
1013
                    break;
1014

  
1015
                  case 3:
1016
                    if(lp2 < 2) {
1017
                      for(i = 0, j = 0; i < 6 - (lp2 * 2); i++, j += width_tbl[1])
1018
                        cur_lp[j] = ref_lp[j];
1019
                      lp2 = 3;
1020
                    }
1021
                    break;
1022

  
1023
                  case 8:
1024
                    if(lp2 == 0) {
1025
                      if(rle_v3 == 0) {
1026
                        rle_v2 = *buf1;
1027
                        rle_v1 = 1;
1028
                        if(rle_v2 > 32) {
1029
                          rle_v2 -= 32;
1030
                          rle_v1 = 0;
1031
                        }
1032
                        rle_v3 = 1;
1033
                      }
1034
                      buf1--;
1035

  
1036
                      for(i = 0, j = 0; i < 8; i++, j += width_tbl[1])
1037
                        cur_lp[j] = ref_lp[j];
1038

  
1039
                      rle_v2--;
1040
                      if(rle_v2 == 0) {
1041
                        rle_v3 = 0;
1042
                        buf1 += 2;
1043
                      }
1044
                      lp2 = 4;
1045
                      break;
1046
                    } else {
1047
                      rle_v1 = 1;
1048
                      rle_v2 = (*buf1) - 1;
1049
                    }
1050
                  case 5:
1051
                  case 7:
1052
                    if(lp2 == 0 && rle_v3 != 0) 
1053
                      rle_v3 = 0;
1054
                    else {
1055
                      buf1--;
1056
                      rle_v3 = 1;
1057
                    }
1058
                  case 4:
1059
                  case 6:
1060
                    for(i = 0, j = 0; i < 8 - (lp2 * 2); i++, j += width_tbl[1])
1061
                      cur_lp[j] = ref_lp[j];
1062
                    lp2 = 4;
1063
                    break;
1064

  
1065
                case 9:
1066
                  fprintf(stderr, "UNTESTED.\n");
1067
                  lv1 = *buf1++;
1068
                  lv = (lv1 & 0x7F) << 1;
1069
                  lv += (lv << 8);
1070
                  lv += (lv << 16);
1071
                  for(i = 0, j = 0; i < 4; i++, j += width_tbl[1])
1072
                    cur_lp[j] = lv;
1073
                  if((lv1 & 0x80) != 0) {
1074
                    if(rle_v3 != 0) 
1075
                      rle_v3 = 0;
1076
                    else {
1077
                      rle_v3 = 1;
1078
                      buf1 -= 2;
1079
                    }
1080
                  }
1081
                  lp2 = 4;
1082
                  break;
1083

  
1084
                  default: 
1085
                    return;
1086
                }
1087
              }
1088

  
1089
              cur_frm_pos += 4;
1090
              ref_frm_pos += 4;
1091
            }
1092

  
1093
            cur_frm_pos += (((width * 2) - blks_width) * 4);
1094
            ref_frm_pos += (((width * 2) - blks_width) * 4);
1095
          }
1096
          break;
1097

  
1098
        default: 
1099
          return;
1100
      }
1101
    }
1102

  
1103
    if(ptr_ustr < xustr) 
1104
      return;
1105

  
1106
    for( ; ptr_ustr >= xustr; ptr_ustr--) {
1107
      if(ptr_ustr->split_flag != 0) {
1108
        ptr_ustr->split_flag = 0;
1109
        ptr_ustr->usl7 = (ptr_ustr-1)->usl7;
1110

  
1111
        if(ptr_ustr->split_direction) {
1112
          ptr_ustr->xpos += ptr_ustr->width;
1113
          ptr_ustr->width = (ptr_ustr-1)->width - ptr_ustr->width;
1114
          if(region_160_width <= ptr_ustr->xpos && width < ptr_ustr->width + ptr_ustr->xpos)
1115
            ptr_ustr->width = width - ptr_ustr->xpos;
1116
        } else {
1117
          ptr_ustr->ypos += ptr_ustr->height;
1118
          ptr_ustr->height = (ptr_ustr-1)->height - ptr_ustr->height;
1119
        }
1120
        break;
1121
      }
1122
    }
1123
  }
1124
}
1125

  
1126
static int indeo3_decode_init(AVCodecContext *avctx)
1127
{
1128
    Indeo3DecodeContext *s = avctx->priv_data;
1129

  
1130
    s->avctx = avctx;
1131
    s->width = avctx->width;
1132
    s->height = avctx->height;
1133
    avctx->pix_fmt = PIX_FMT_YUV410P;
1134
    avctx->has_b_frames = 0;
1135

  
1136
    build_modpred(s);
1137
    iv_alloc_frames(s);
1138

  
1139
    return 0;
1140
}
1141

  
1142
static int indeo3_decode_frame(AVCodecContext *avctx,
1143
                               void *data, int *data_size,
1144
                               unsigned char *buf, int buf_size)
1145
{
1146
    Indeo3DecodeContext *s=avctx->priv_data;
1147
    unsigned char *src, *dest;
1148
    int y;
1149

  
1150
    iv_decode_frame(s, buf, buf_size);
1151

  
1152
    s->frame.reference = 0;
1153
    if(avctx->get_buffer(avctx, &s->frame) < 0) {
1154
        fprintf(stderr, "get_buffer() failed\n");
1155
        return -1;
1156
    }
1157

  
1158
    src = s->cur_frame->Ybuf;
1159
    dest = s->frame.data[0];
1160
    for (y = 0; y < s->height; y++) {
1161
      memcpy(dest, src, s->cur_frame->y_w);
1162
      src += s->cur_frame->y_w;
1163
      dest += s->frame.linesize[0];
1164
    }
1165

  
1166
    src = s->cur_frame->Ubuf;
1167
    dest = s->frame.data[1];
1168
    for (y = 0; y < s->height / 4; y++) {
1169
      memcpy(dest, src, s->cur_frame->uv_w);
1170
      src += s->cur_frame->uv_w;
1171
      dest += s->frame.linesize[1];
1172
    }
1173

  
1174
    src = s->cur_frame->Vbuf;
1175
    dest = s->frame.data[2];
1176
    for (y = 0; y < s->height / 4; y++) {
1177
      memcpy(dest, src, s->cur_frame->uv_w);
1178
      src += s->cur_frame->uv_w;
1179
      dest += s->frame.linesize[2];
1180
    }
1181

  
1182
    *data_size=sizeof(AVFrame);
1183
    *(AVFrame*)data= s->frame;
1184

  
1185
    avctx->release_buffer(avctx, &s->frame);
1186

  
1187
    return buf_size;
1188
}
1189

  
1190
static int indeo3_decode_end(AVCodecContext *avctx)
1191
{
1192
    Indeo3DecodeContext *s = avctx->priv_data;
1193

  
1194
    iv_free_func(s);
1195

  
1196
    return 0;
1197
}
1198

  
1199
AVCodec indeo3_decoder = {
1200
    "indeo3",
1201
    CODEC_TYPE_VIDEO,
1202
    CODEC_ID_INDEO3,
1203
    sizeof(Indeo3DecodeContext),
1204
    indeo3_decode_init,
1205
    NULL,
1206
    indeo3_decode_end,
1207
    indeo3_decode_frame,
1208
    0,
1209
    NULL
1210
};
libavcodec/indeo3data.h
1

  
2
unsigned long correction[] = {
3
	0x00000000, 0x00000202, 0xfffffdfe, 0x000002ff, 0xfffffd01, 0xffffff03, 0x000000fd, 0x00000404, 
4
	0xfffffbfc, 0x00000501, 0xfffffaff, 0x00000105, 0xfffffefb, 0x000003fc, 0xfffffc04, 0x000005fe, 
5
	0xfffffa02, 0xfffffe06, 0x000001fa, 0x00000904, 0xfffff6fc, 0x00000409, 0xfffffbf7, 0x00000909, 
6
	0xfffff6f7, 0x00000a01, 0xfffff5ff, 0x0000010a, 0xfffffef6, 0x000007fb, 0xfffff805, 0xfffffb08, 
7
	0x000004f8, 0x00000f09, 0xfffff0f7, 0x0000090f, 0xfffff6f1, 0x00000bfd, 0xfffff403, 0xfffffd0c, 
8
	0x000002f4, 0x00001004, 0xffffeffc, 0x00000410, 0xfffffbf0, 0x00001010, 0xffffeff0, 0x00001200, 
9
	0xffffee00, 0x00000012, 0xffffffee, 0x00000bf4, 0xfffff40c, 0x00000ff7, 0xfffff009, 0xfffff710, 
10
	0x000008f0, 0x00001b0b, 0xffffe4f5, 0x00000b1b, 0xfffff4e5, 0x00001c13, 0xffffe3ed, 0x0000131c, 
11
	0xffffece4, 0x000015fa, 0xffffea06, 0xfffffa16, 0x000005ea, 0x00001d04, 0xffffe2fc, 0x0000041d, 
12
	0xfffffbe3, 0x00001e1e, 0xffffe1e2, 0x000020fe, 0xffffdf02, 0xfffffe21, 0x000001df, 0x000016ee, 
13
	0xffffe912, 0xffffee17, 0x000011e9, 0x00001df1, 0xffffe20f, 0xfffff11e, 0x00000ee2, 0x00002e16, 
14
	0xffffd1ea, 0x0000162e, 0xffffe9d2, 0x00002f0d, 0xffffd0f3, 0x00000d2f, 0xfffff2d1, 0x00003123, 
15
	0xffffcedd, 0x00002331, 0xffffdccf, 0x000028f5, 0xffffd70b, 0xfffff529, 0x00000ad7, 0x00003304, 
16
	0xffffccfc, 0x00000433, 0xfffffbcd, 0x00003636, 0xffffc9ca, 0x000021de, 0xffffde22, 0x000029e3, 
17
	0xffffd61d, 0xffffe32a, 0x00001cd6, 0x00003bfa, 0xffffc406, 0xfffffa3c, 0x000005c4, 0x00004c1b, 
18
	0xffffb3e5, 0x00001b4c, 0xffffe4b4, 0x00004d2b, 0xffffb2d5, 0x00002b4d, 0xffffd4b3, 0x000036e8, 
19
	0xffffc918, 0xffffe837, 0x000017c9, 0x00004f0e, 0xffffb0f2, 0x00000e4f, 0xfffff1b1, 0x0000533f, 
20
	0xffffacc1, 0x00003f53, 0xffffc0ad, 0x000049ec, 0xffffb614, 0xffffec4a, 0x000013b6, 0x00005802, 
21
	0xffffa7fe, 0x00000258, 0xfffffda8, 0x00005d5d, 0xffffa2a3, 0x00003ccc, 0xffffc334, 0xffffcc3d, 
22
	0x000033c3, 0x00007834, 0xffff87cc, 0x00003478, 0xffffcb88, 0x00004ad3, 0xffffb52d, 0xffffd34b, 
23
	0x00002cb5, 0x00007d4b, 0xffff82b5, 0x00004b7d, 0xffffb483, 0x00007a21, 0xffff85df, 0x0000217a, 
24
	0xffffde86, 0x000066f3, 0xffff990d, 0xfffff367, 0x00000c99, 0x00005fd8, 0xffffa028, 0xffffd860, 
25
	0x000027a0, 0x00007ede, 0xffff8122, 0xffffde7f, 0x00002181, 0x000058a7, 0xffffa759, 0x000068b2, 
26
	0xffff974e, 0xffffb269, 0x00004d97, 0x00000c0c, 0xfffff3f4, 0x00001717, 0xffffe8e9, 0x00002a2a, 
27
	0xffffd5d6, 0x00004949, 0xffffb6b7, 0x00000000, 0x02020000, 0xfdfe0000, 0x02ff0000, 0xfd010000, 
28
	0xff030000, 0x00fd0000, 0x00000202, 0x02020202, 0xfdfe0202, 0x02ff0202, 0xfd010202, 0xff030202, 
29
	0x00fd0202, 0xfffffdfe, 0x0201fdfe, 0xfdfdfdfe, 0x02fefdfe, 0xfd00fdfe, 0xff02fdfe, 0x00fcfdfe, 
30
	0x000002ff, 0x020202ff, 0xfdfe02ff, 0x02ff02ff, 0xfd0102ff, 0xff0302ff, 0x00fd02ff, 0xfffffd01, 
31
	0x0201fd01, 0xfdfdfd01, 0x02fefd01, 0xfd00fd01, 0xff02fd01, 0x00fcfd01, 0xffffff03, 0x0201ff03, 
32
	0xfdfdff03, 0x02feff03, 0xfd00ff03, 0xff02ff03, 0x00fcff03, 0x000000fd, 0x020200fd, 0xfdfe00fd, 
33
	0x02ff00fd, 0xfd0100fd, 0xff0300fd, 0x00fd00fd, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
34
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
35
	0x00000000, 0x00000303, 0xfffffcfd, 0x000003ff, 0xfffffc01, 0xffffff04, 0x000000fc, 0x00000707, 
36
	0xfffff8f9, 0x00000802, 0xfffff7fe, 0x00000208, 0xfffffdf8, 0x000008fe, 0xfffff702, 0xfffffe09, 
37
	0x000001f7, 0x000005fa, 0xfffffa06, 0x00000d06, 0xfffff2fa, 0x0000060d, 0xfffff9f3, 0x00000d0d, 
38
	0xfffff2f3, 0x00000e01, 0xfffff1ff, 0x0000010e, 0xfffffef2, 0x00000bf8, 0xfffff408, 0xfffff80c, 
39
	0x000007f4, 0x0000170e, 0xffffe8f2, 0x00000e17, 0xfffff1e9, 0x000011fb, 0xffffee05, 0xfffffb12, 
40
	0x000004ee, 0x00001806, 0xffffe7fa, 0x00000618, 0xfffff9e8, 0x00001818, 0xffffe7e8, 0x00001aff, 
41
	0xffffe501, 0xffffff1b, 0x000000e5, 0x000010ef, 0xffffef11, 0x000016f3, 0xffffe90d, 0xfffff317, 
42
	0x00000ce9, 0x00002810, 0xffffd7f0, 0x00001028, 0xffffefd8, 0x0000291c, 0xffffd6e4, 0x00001c29, 
43
	0xffffe3d7, 0x000020f7, 0xffffdf09, 0xfffff721, 0x000008df, 0x00002b06, 0xffffd4fa, 0x0000062b, 
44
	0xfffff9d5, 0x00002e2e, 0xffffd1d2, 0x000031fc, 0xffffce04, 0xfffffc32, 0x000003ce, 0x000021e5, 
45
	0xffffde1b, 0xffffe522, 0x00001ade, 0x00002cea, 0xffffd316, 0xffffea2d, 0x000015d3, 0x00004522, 
46
	0xffffbade, 0x00002245, 0xffffddbb, 0x00004613, 0xffffb9ed, 0x00001346, 0xffffecba, 0x00004935, 
47
	0xffffb6cb, 0x00003549, 0xffffcab7, 0x00003def, 0xffffc211, 0xffffef3e, 0x000010c2, 0x00004d05, 
48
	0xffffb2fb, 0x0000054d, 0xfffffab3, 0x00005252, 0xffffadae, 0x000032cd, 0xffffcd33, 0x00003fd5, 
49
	0xffffc02b, 0xffffd540, 0x00002ac0, 0x000059f6, 0xffffa60a, 0xfffff65a, 0x000009a6, 0x00007229, 
50
	0xffff8dd7, 0x00002972, 0xffffd68e, 0x00007440, 0xffff8bc0, 0x00004074, 0xffffbf8c, 0x000051db, 
51
	0xffffae25, 0xffffdb52, 0x000024ae, 0x00007716, 0xffff88ea, 0x00001677, 0xffffe989, 0x00007c5f, 
52
	0xffff83a1, 0x00005f7c, 0xffffa084, 0x00006ee2, 0xffff911e, 0xffffe26f, 0x00001d91, 0x00005bb2, 
53
	0xffffa44e, 0xffffb25c, 0x00004da4, 0x000070bc, 0xffff8f44, 0xffffbc71, 0x0000438f, 0x00001212, 
54
	0xffffedee, 0x00002222, 0xffffddde, 0x00003f3f, 0xffffc0c1, 0x00006d6d, 0xffff9293, 0x00000000, 
55
	0x03030000, 0xfcfd0000, 0x03ff0000, 0xfc010000, 0xff040000, 0x00fc0000, 0x07070000, 0xf8f90000, 
56
	0x00000303, 0x03030303, 0xfcfd0303, 0x03ff0303, 0xfc010303, 0xff040303, 0x00fc0303, 0x07070303, 
57
	0xf8f90303, 0xfffffcfd, 0x0302fcfd, 0xfcfcfcfd, 0x03fefcfd, 0xfc00fcfd, 0xff03fcfd, 0x00fbfcfd, 
58
	0x0706fcfd, 0xf8f8fcfd, 0x000003ff, 0x030303ff, 0xfcfd03ff, 0x03ff03ff, 0xfc0103ff, 0xff0403ff, 
59
	0x00fc03ff, 0x070703ff, 0xf8f903ff, 0xfffffc01, 0x0302fc01, 0xfcfcfc01, 0x03fefc01, 0xfc00fc01, 
60
	0xff03fc01, 0x00fbfc01, 0x0706fc01, 0xf8f8fc01, 0xffffff04, 0x0302ff04, 0xfcfcff04, 0x03feff04, 
61
	0xfc00ff04, 0xff03ff04, 0x00fbff04, 0x0706ff04, 0xf8f8ff04, 0x000000fc, 0x030300fc, 0xfcfd00fc, 
62
	0x03ff00fc, 0xfc0100fc, 0xff0400fc, 0x00fc00fc, 0x070700fc, 0xf8f900fc, 0x00000707, 0x03030707, 
63
	0xfcfd0707, 0x03ff0707, 0xfc010707, 0xff040707, 0x00fc0707, 0x07070707, 0xf8f90707, 0xfffff8f9, 
64
	0x0302f8f9, 0xfcfcf8f9, 0x03fef8f9, 0xfc00f8f9, 0xff03f8f9, 0x00fbf8f9, 0x0706f8f9, 0xf8f8f8f9, 
65
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
66
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
67
	0x00000000, 0x00000404, 0xfffffbfc, 0x000004ff, 0xfffffb01, 0xffffff05, 0x000000fb, 0x00000a03, 
68
	0xfffff5fd, 0x0000030a, 0xfffffcf6, 0x00000909, 0xfffff6f7, 0x000006f9, 0xfffff907, 0x00000bfd, 
69
	0xfffff403, 0xfffffd0c, 0x000002f4, 0x00001108, 0xffffeef8, 0x00000811, 0xfffff7ef, 0x00001111, 
70
	0xffffeeef, 0x00001301, 0xffffecff, 0x00000113, 0xfffffeed, 0x00000ff5, 0xfffff00b, 0xfffff510, 
71
	0x00000af0, 0x000016fa, 0xffffe906, 0xfffffa17, 0x000005e9, 0x00001f12, 0xffffe0ee, 0x0000121f, 
72
	0xffffede1, 0x00002008, 0xffffdff8, 0x00000820, 0xfffff7e0, 0x00002121, 0xffffdedf, 0x000023ff, 
73
	0xffffdc01, 0xffffff24, 0x000000dc, 0x000016e9, 0xffffe917, 0x00001eef, 0xffffe111, 0xffffef1f, 
74
	0x000010e1, 0x00003615, 0xffffc9eb, 0x00001536, 0xffffeaca, 0x00003725, 0xffffc8db, 0x00002537, 
75
	0xffffdac9, 0x00002bf4, 0xffffd40c, 0xfffff42c, 0x00000bd4, 0x00003908, 0xffffc6f8, 0x00000839, 
76
	0xfffff7c7, 0x00003d3d, 0xffffc2c3, 0x000041fb, 0xffffbe05, 0xfffffb42, 0x000004be, 0x00002cdc, 
77
	0xffffd324, 0xffffdc2d, 0x000023d3, 0x00003be3, 0xffffc41d, 0xffffe33c, 0x00001cc4, 0x00005c2d, 
78
	0xffffa3d3, 0x00002d5c, 0xffffd2a4, 0x00005d19, 0xffffa2e7, 0x0000195d, 0xffffe6a3, 0x00006147, 
79
	0xffff9eb9, 0x00004761, 0xffffb89f, 0x000052ea, 0xffffad16, 0xffffea53, 0x000015ad, 0x00006607, 
80
	0xffff99f9, 0x00000766, 0xfffff89a, 0x00006d6d, 0xffff9293, 0x000043bc, 0xffffbc44, 0x000054c7, 
81
	0xffffab39, 0xffffc755, 0x000038ab, 0x000077f3, 0xffff880d, 0xfffff378, 0x00000c88, 0x00006dcf, 
82
	0xffff9231, 0xffffcf6e, 0x00003092, 0x00007a98, 0xffff8568, 0xffff987b, 0x00006785, 0x00001818, 
83
	0xffffe7e8, 0x00002e2e, 0xffffd1d2, 0x00005454, 0xffffabac, 0x00000000, 0x04040000, 0xfbfc0000, 
84
	0x04ff0000, 0xfb010000, 0xff050000, 0x00fb0000, 0x0a030000, 0xf5fd0000, 0x030a0000, 0x00000404, 
85
	0x04040404, 0xfbfc0404, 0x04ff0404, 0xfb010404, 0xff050404, 0x00fb0404, 0x0a030404, 0xf5fd0404, 
86
	0x030a0404, 0xfffffbfc, 0x0403fbfc, 0xfbfbfbfc, 0x04fefbfc, 0xfb00fbfc, 0xff04fbfc, 0x00fafbfc, 
87
	0x0a02fbfc, 0xf5fcfbfc, 0x0309fbfc, 0x000004ff, 0x040404ff, 0xfbfc04ff, 0x04ff04ff, 0xfb0104ff, 
88
	0xff0504ff, 0x00fb04ff, 0x0a0304ff, 0xf5fd04ff, 0x030a04ff, 0xfffffb01, 0x0403fb01, 0xfbfbfb01, 
89
	0x04fefb01, 0xfb00fb01, 0xff04fb01, 0x00fafb01, 0x0a02fb01, 0xf5fcfb01, 0x0309fb01, 0xffffff05, 
90
	0x0403ff05, 0xfbfbff05, 0x04feff05, 0xfb00ff05, 0xff04ff05, 0x00faff05, 0x0a02ff05, 0xf5fcff05, 
91
	0x0309ff05, 0x000000fb, 0x040400fb, 0xfbfc00fb, 0x04ff00fb, 0xfb0100fb, 0xff0500fb, 0x00fb00fb, 
92
	0x0a0300fb, 0xf5fd00fb, 0x030a00fb, 0x00000a03, 0x04040a03, 0xfbfc0a03, 0x04ff0a03, 0xfb010a03, 
93
	0xff050a03, 0x00fb0a03, 0x0a030a03, 0xf5fd0a03, 0x030a0a03, 0xfffff5fd, 0x0403f5fd, 0xfbfbf5fd, 
94
	0x04fef5fd, 0xfb00f5fd, 0xff04f5fd, 0x00faf5fd, 0x0a02f5fd, 0xf5fcf5fd, 0x0309f5fd, 0x0000030a, 
95
	0x0404030a, 0xfbfc030a, 0x04ff030a, 0xfb01030a, 0xff05030a, 0x00fb030a, 0x0a03030a, 0xf5fd030a, 
96
	0x030a030a, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
97
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
98
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
99
	0x00000000, 0x00000505, 0xfffffafb, 0x000006fe, 0xfffff902, 0xfffffe07, 0x000001f9, 0x00000b0b, 
100
	0xfffff4f5, 0x00000d03, 0xfffff2fd, 0x0000030d, 0xfffffcf3, 0x000008f7, 0xfffff709, 0x00000efc, 
101
	0xfffff104, 0xfffffc0f, 0x000003f1, 0x0000160b, 0xffffe9f5, 0x00000b16, 0xfffff4ea, 0x00001515, 
102
	0xffffeaeb, 0x00001802, 0xffffe7fe, 0x00000218, 0xfffffde8, 0x000013f2, 0xffffec0e, 0xfffff214, 
103
	0x00000dec, 0x00002617, 0xffffd9e9, 0x00001726, 0xffffe8da, 0x00001cf8, 0xffffe308, 0xfffff81d, 
104
	0x000007e3, 0x0000270b, 0xffffd8f5, 0x00000b27, 0xfffff4d9, 0x00002929, 0xffffd6d7, 0x00002cff, 
105
	0xffffd301, 0xffffff2d, 0x000000d3, 0x00001ce3, 0xffffe31d, 0x000026ea, 0xffffd916, 0xffffea27, 
106
	0x000015d9, 0x0000431b, 0xffffbce5, 0x00001b43, 0xffffe4bd, 0x0000452f, 0xffffbad1, 0x00002f45, 
107
	0xffffd0bb, 0x000037f1, 0xffffc80f, 0xfffff138, 0x00000ec8, 0x0000470b, 0xffffb8f5, 0x00000b47, 
108
	0xfffff4b9, 0x00004c4c, 0xffffb3b4, 0x000052fa, 0xffffad06, 0xfffffa53, 0x000005ad, 0x000038d3, 
109
	0xffffc72d, 0xffffd339, 0x00002cc7, 0x00004adc, 0xffffb524, 0xffffdc4b, 0x000023b5, 0x00007338, 
110
	0xffff8cc8, 0x00003873, 0xffffc78d, 0x0000751f, 0xffff8ae1, 0x00001f75, 0xffffe08b, 0x00007a58, 
111
	0xffff85a8, 0x0000587a, 0xffffa786, 0x000067e4, 0xffff981c, 0xffffe468, 0x00001b98, 0x000054ab, 
112
	0xffffab55, 0x000069b8, 0xffff9648, 0xffffb86a, 0x00004796, 0x00001e1e, 0xffffe1e2, 0x00003a3a, 
113
	0xffffc5c6, 0x00006969, 0xffff9697, 0x00000000, 0x05050000, 0xfafb0000, 0x06fe0000, 0xf9020000, 
114
	0xfe070000, 0x01f90000, 0x0b0b0000, 0xf4f50000, 0x0d030000, 0xf2fd0000, 0x00000505, 0x05050505, 
115
	0xfafb0505, 0x06fe0505, 0xf9020505, 0xfe070505, 0x01f90505, 0x0b0b0505, 0xf4f50505, 0x0d030505, 
116
	0xf2fd0505, 0xfffffafb, 0x0504fafb, 0xfafafafb, 0x06fdfafb, 0xf901fafb, 0xfe06fafb, 0x01f8fafb, 
117
	0x0b0afafb, 0xf4f4fafb, 0x0d02fafb, 0xf2fcfafb, 0x000006fe, 0x050506fe, 0xfafb06fe, 0x06fe06fe, 
118
	0xf90206fe, 0xfe0706fe, 0x01f906fe, 0x0b0b06fe, 0xf4f506fe, 0x0d0306fe, 0xf2fd06fe, 0xfffff902, 
119
	0x0504f902, 0xfafaf902, 0x06fdf902, 0xf901f902, 0xfe06f902, 0x01f8f902, 0x0b0af902, 0xf4f4f902, 
120
	0x0d02f902, 0xf2fcf902, 0xfffffe07, 0x0504fe07, 0xfafafe07, 0x06fdfe07, 0xf901fe07, 0xfe06fe07, 
121
	0x01f8fe07, 0x0b0afe07, 0xf4f4fe07, 0x0d02fe07, 0xf2fcfe07, 0x000001f9, 0x050501f9, 0xfafb01f9, 
122
	0x06fe01f9, 0xf90201f9, 0xfe0701f9, 0x01f901f9, 0x0b0b01f9, 0xf4f501f9, 0x0d0301f9, 0xf2fd01f9, 
123
	0x00000b0b, 0x05050b0b, 0xfafb0b0b, 0x06fe0b0b, 0xf9020b0b, 0xfe070b0b, 0x01f90b0b, 0x0b0b0b0b, 
124
	0xf4f50b0b, 0x0d030b0b, 0xf2fd0b0b, 0xfffff4f5, 0x0504f4f5, 0xfafaf4f5, 0x06fdf4f5, 0xf901f4f5, 
125
	0xfe06f4f5, 0x01f8f4f5, 0x0b0af4f5, 0xf4f4f4f5, 0x0d02f4f5, 0xf2fcf4f5, 0x00000d03, 0x05050d03, 
126
	0xfafb0d03, 0x06fe0d03, 0xf9020d03, 0xfe070d03, 0x01f90d03, 0x0b0b0d03, 0xf4f50d03, 0x0d030d03, 
127
	0xf2fd0d03, 0xfffff2fd, 0x0504f2fd, 0xfafaf2fd, 0x06fdf2fd, 0xf901f2fd, 0xfe06f2fd, 0x01f8f2fd, 
128
	0x0b0af2fd, 0xf4f4f2fd, 0x0d02f2fd, 0xf2fcf2fd, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
129
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
130
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
131
	0x00000000, 0x00000606, 0xfffff9fa, 0x000007fe, 0xfffff802, 0xfffffe08, 0x000001f8, 0x00000d0d, 
132
	0xfffff2f3, 0x00000f04, 0xfffff0fc, 0x0000040f, 0xfffffbf1, 0x00000af5, 0xfffff50b, 0x000011fb, 
133
	0xffffee05, 0xfffffb12, 0x000004ee, 0x00001a0d, 0xffffe5f3, 0x00000d1a, 0xfffff2e6, 0x00001a1a, 
134
	0xffffe5e6, 0x00001d02, 0xffffe2fe, 0x0000021d, 0xfffffde3, 0x000017f0, 0xffffe810, 0xfffff018, 
135
	0x00000fe8, 0x00002e1c, 0xffffd1e4, 0x00001c2e, 0xffffe3d2, 0x000022f7, 0xffffdd09, 0xfffff723, 
136
	0x000008dd, 0x00002f0d, 0xffffd0f3, 0x00000d2f, 0xfffff2d1, 0x00003131, 0xffffcecf, 0x000035ff, 
137
	0xffffca01, 0xffffff36, 0x000000ca, 0x000022dd, 0xffffdd23, 0x00002ee6, 0xffffd11a, 0xffffe62f, 
138
	0x000019d1, 0x00005120, 0xffffaee0, 0x00002051, 0xffffdfaf, 0x00005338, 0xffffacc8, 0x00003853, 
139
	0xffffc7ad, 0x000042ee, 0xffffbd12, 0xffffee43, 0x000011bd, 0x0000560d, 0xffffa9f3, 0x00000d56, 
140
	0xfffff2aa, 0x00005b5b, 0xffffa4a5, 0x000062f9, 0xffff9d07, 0xfffff963, 0x0000069d, 0x000043ca, 
141
	0xffffbc36, 0xffffca44, 0x000035bc, 0x000059d4, 0xffffa62c, 0xffffd45a, 0x00002ba6, 0x00007bdf, 
142
	0xffff8421, 0xffffdf7c, 0x00002084, 0x00006699, 0xffff9967, 0x00007eaa, 0xffff8156, 0xffffaa7f, 
143
	0x00005581, 0x00002525, 0xffffdadb, 0x00004545, 0xffffbabb, 0x00000000, 0x06060000, 0xf9fa0000, 
144
	0x07fe0000, 0xf8020000, 0xfe080000, 0x01f80000, 0x0d0d0000, 0xf2f30000, 0x0f040000, 0xf0fc0000, 
145
	0x040f0000, 0x00000606, 0x06060606, 0xf9fa0606, 0x07fe0606, 0xf8020606, 0xfe080606, 0x01f80606, 
146
	0x0d0d0606, 0xf2f30606, 0x0f040606, 0xf0fc0606, 0x040f0606, 0xfffff9fa, 0x0605f9fa, 0xf9f9f9fa, 
147
	0x07fdf9fa, 0xf801f9fa, 0xfe07f9fa, 0x01f7f9fa, 0x0d0cf9fa, 0xf2f2f9fa, 0x0f03f9fa, 0xf0fbf9fa, 
148
	0x040ef9fa, 0x000007fe, 0x060607fe, 0xf9fa07fe, 0x07fe07fe, 0xf80207fe, 0xfe0807fe, 0x01f807fe, 
149
	0x0d0d07fe, 0xf2f307fe, 0x0f0407fe, 0xf0fc07fe, 0x040f07fe, 0xfffff802, 0x0605f802, 0xf9f9f802, 
150
	0x07fdf802, 0xf801f802, 0xfe07f802, 0x01f7f802, 0x0d0cf802, 0xf2f2f802, 0x0f03f802, 0xf0fbf802, 
151
	0x040ef802, 0xfffffe08, 0x0605fe08, 0xf9f9fe08, 0x07fdfe08, 0xf801fe08, 0xfe07fe08, 0x01f7fe08, 
152
	0x0d0cfe08, 0xf2f2fe08, 0x0f03fe08, 0xf0fbfe08, 0x040efe08, 0x000001f8, 0x060601f8, 0xf9fa01f8, 
153
	0x07fe01f8, 0xf80201f8, 0xfe0801f8, 0x01f801f8, 0x0d0d01f8, 0xf2f301f8, 0x0f0401f8, 0xf0fc01f8, 
154
	0x040f01f8, 0x00000d0d, 0x06060d0d, 0xf9fa0d0d, 0x07fe0d0d, 0xf8020d0d, 0xfe080d0d, 0x01f80d0d, 
155
	0x0d0d0d0d, 0xf2f30d0d, 0x0f040d0d, 0xf0fc0d0d, 0x040f0d0d, 0xfffff2f3, 0x0605f2f3, 0xf9f9f2f3, 
156
	0x07fdf2f3, 0xf801f2f3, 0xfe07f2f3, 0x01f7f2f3, 0x0d0cf2f3, 0xf2f2f2f3, 0x0f03f2f3, 0xf0fbf2f3, 
157
	0x040ef2f3, 0x00000f04, 0x06060f04, 0xf9fa0f04, 0x07fe0f04, 0xf8020f04, 0xfe080f04, 0x01f80f04, 
158
	0x0d0d0f04, 0xf2f30f04, 0x0f040f04, 0xf0fc0f04, 0x040f0f04, 0xfffff0fc, 0x0605f0fc, 0xf9f9f0fc, 
159
	0x07fdf0fc, 0xf801f0fc, 0xfe07f0fc, 0x01f7f0fc, 0x0d0cf0fc, 0xf2f2f0fc, 0x0f03f0fc, 0xf0fbf0fc, 
160
	0x040ef0fc, 0x0000040f, 0x0606040f, 0xf9fa040f, 0x07fe040f, 0xf802040f, 0xfe08040f, 0x01f8040f, 
161
	0x0d0d040f, 0xf2f3040f, 0x0f04040f, 0xf0fc040f, 0x040f040f, 0x00000000, 0x00000000, 0x00000000, 
162
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
163
	0x00000000, 0x00000707, 0xfffff8f9, 0x000009fd, 0xfffff603, 0xfffffd0a, 0x000002f6, 0x00001010, 
164
	0xffffeff0, 0x00001205, 0xffffedfb, 0x00000512, 0xfffffaee, 0x00000cf3, 0xfffff30d, 0x000014fa, 
165
	0xffffeb06, 0xfffffa15, 0x000005eb, 0x00001e0f, 0xffffe1f1, 0x00000f1e, 0xfffff0e2, 0x00001e1e, 
166
	0xffffe1e2, 0x00002202, 0xffffddfe, 0x00000222, 0xfffffdde, 0x00001bed, 0xffffe413, 0xffffed1c, 
167
	0x000012e4, 0x00003620, 0xffffc9e0, 0x00002036, 0xffffdfca, 0x000028f5, 0xffffd70b, 0xfffff529, 
168
	0x00000ad7, 0x0000370f, 0xffffc8f1, 0x00000f37, 0xfffff0c9, 0x00003939, 0xffffc6c7, 0x00003eff, 
169
	0xffffc101, 0xffffff3f, 0x000000c1, 0x000027d8, 0xffffd828, 0x000036e2, 0xffffc91e, 0xffffe237, 
170
	0x00001dc9, 0x00005e25, 0xffffa1db, 0x0000255e, 0xffffdaa2, 0x00006041, 0xffff9fbf, 0x00004160, 
171
	0xffffbea0, 0x00004deb, 0xffffb215, 0xffffeb4e, 0x000014b2, 0x0000640f, 0xffff9bf1, 0x00000f64, 
172
	0xfffff09c, 0x00006a6a, 0xffff9596, 0x000073f8, 0xffff8c08, 0xfffff874, 0x0000078c, 0x00004ec1, 
173
	0xffffb13f, 0xffffc14f, 0x00003eb1, 0x000068cd, 0xffff9733, 0xffffcd69, 0x00003297, 0x00007788, 
174
	0xffff8878, 0x00002b2b, 0xffffd4d5, 0x00005050, 0xffffafb0, 0x00000000, 0x07070000, 0xf8f90000, 
175
	0x09fd0000, 0xf6030000, 0xfd0a0000, 0x02f60000, 0x10100000, 0xeff00000, 0x12050000, 0xedfb0000, 
176
	0x05120000, 0x00000707, 0x07070707, 0xf8f90707, 0x09fd0707, 0xf6030707, 0xfd0a0707, 0x02f60707, 
177
	0x10100707, 0xeff00707, 0x12050707, 0xedfb0707, 0x05120707, 0xfffff8f9, 0x0706f8f9, 0xf8f8f8f9, 
178
	0x09fcf8f9, 0xf602f8f9, 0xfd09f8f9, 0x02f5f8f9, 0x100ff8f9, 0xefeff8f9, 0x1204f8f9, 0xedfaf8f9, 
179
	0x0511f8f9, 0x000009fd, 0x070709fd, 0xf8f909fd, 0x09fd09fd, 0xf60309fd, 0xfd0a09fd, 0x02f609fd, 
180
	0x101009fd, 0xeff009fd, 0x120509fd, 0xedfb09fd, 0x051209fd, 0xfffff603, 0x0706f603, 0xf8f8f603, 
181
	0x09fcf603, 0xf602f603, 0xfd09f603, 0x02f5f603, 0x100ff603, 0xefeff603, 0x1204f603, 0xedfaf603, 
182
	0x0511f603, 0xfffffd0a, 0x0706fd0a, 0xf8f8fd0a, 0x09fcfd0a, 0xf602fd0a, 0xfd09fd0a, 0x02f5fd0a, 
183
	0x100ffd0a, 0xefeffd0a, 0x1204fd0a, 0xedfafd0a, 0x0511fd0a, 0x000002f6, 0x070702f6, 0xf8f902f6, 
184
	0x09fd02f6, 0xf60302f6, 0xfd0a02f6, 0x02f602f6, 0x101002f6, 0xeff002f6, 0x120502f6, 0xedfb02f6, 
185
	0x051202f6, 0x00001010, 0x07071010, 0xf8f91010, 0x09fd1010, 0xf6031010, 0xfd0a1010, 0x02f61010, 
186
	0x10101010, 0xeff01010, 0x12051010, 0xedfb1010, 0x05121010, 0xffffeff0, 0x0706eff0, 0xf8f8eff0, 
187
	0x09fceff0, 0xf602eff0, 0xfd09eff0, 0x02f5eff0, 0x100feff0, 0xefefeff0, 0x1204eff0, 0xedfaeff0, 
188
	0x0511eff0, 0x00001205, 0x07071205, 0xf8f91205, 0x09fd1205, 0xf6031205, 0xfd0a1205, 0x02f61205, 
189
	0x10101205, 0xeff01205, 0x12051205, 0xedfb1205, 0x05121205, 0xffffedfb, 0x0706edfb, 0xf8f8edfb, 
190
	0x09fcedfb, 0xf602edfb, 0xfd09edfb, 0x02f5edfb, 0x100fedfb, 0xefefedfb, 0x1204edfb, 0xedfaedfb, 
191
	0x0511edfb, 0x00000512, 0x07070512, 0xf8f90512, 0x09fd0512, 0xf6030512, 0xfd0a0512, 0x02f60512, 
192
	0x10100512, 0xeff00512, 0x12050512, 0xedfb0512, 0x05120512, 0x00000000, 0x00000000, 0x00000000, 
193
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
194
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
195
	0x00000000, 0x00000808, 0xfffff7f8, 0x00000afd, 0xfffff503, 0xfffffd0b, 0x000002f5, 0x00001212, 
196
	0xffffedee, 0x00001405, 0xffffebfb, 0x00000514, 0xfffffaec, 0x00000ef1, 0xfffff10f, 0x000017f9, 
197
	0xffffe807, 0xfffff918, 0x000006e8, 0x00002311, 0xffffdcef, 0x00001123, 0xffffeedd, 0x00002222, 
198
	0xffffddde, 0x00002603, 0xffffd9fd, 0x00000326, 0xfffffcda, 0x00001fea, 0xffffe016, 0xffffea20, 
199
	0x000015e0, 0x00003d25, 0xffffc2db, 0x0000253d, 0xffffdac3, 0x00002ef3, 0xffffd10d, 0xfffff32f, 
200
	0x00000cd1, 0x00003f11, 0xffffc0ef, 0x0000113f, 0xffffeec1, 0x00004141, 0xffffbebf, 0x000047ff, 
201
	0xffffb801, 0xffffff48, 0x000000b8, 0x00002dd2, 0xffffd22e, 0x00003edd, 0xffffc123, 0xffffdd3f, 
202
	0x000022c1, 0x00006b2b, 0xffff94d5, 0x00002b6b, 0xffffd495, 0x00006e4b, 0xffff91b5, 0x00004b6e, 
203
	0xffffb492, 0x000058e8, 0xffffa718, 0xffffe859, 0x000017a7, 0x00007211, 0xffff8def, 0x00001172, 
204
	0xffffee8e, 0x00007979, 0xffff8687, 0x00005ab8, 0xffffa548, 0xffffb85b, 0x000047a5, 0x000077c6, 
205
	0xffff883a, 0xffffc678, 0x00003988, 0x00003131, 0xffffcecf, 0x00005c5c, 0xffffa3a4, 0x00000000, 
206
	0x08080000, 0xf7f80000, 0x0afd0000, 0xf5030000, 0xfd0b0000, 0x02f50000, 0x12120000, 0xedee0000, 
207
	0x14050000, 0xebfb0000, 0x05140000, 0x00000808, 0x08080808, 0xf7f80808, 0x0afd0808, 0xf5030808, 
208
	0xfd0b0808, 0x02f50808, 0x12120808, 0xedee0808, 0x14050808, 0xebfb0808, 0x05140808, 0xfffff7f8, 
209
	0x0807f7f8, 0xf7f7f7f8, 0x0afcf7f8, 0xf502f7f8, 0xfd0af7f8, 0x02f4f7f8, 0x1211f7f8, 0xededf7f8, 
210
	0x1404f7f8, 0xebfaf7f8, 0x0513f7f8, 0x00000afd, 0x08080afd, 0xf7f80afd, 0x0afd0afd, 0xf5030afd, 
211
	0xfd0b0afd, 0x02f50afd, 0x12120afd, 0xedee0afd, 0x14050afd, 0xebfb0afd, 0x05140afd, 0xfffff503, 
212
	0x0807f503, 0xf7f7f503, 0x0afcf503, 0xf502f503, 0xfd0af503, 0x02f4f503, 0x1211f503, 0xededf503, 
213
	0x1404f503, 0xebfaf503, 0x0513f503, 0xfffffd0b, 0x0807fd0b, 0xf7f7fd0b, 0x0afcfd0b, 0xf502fd0b, 
214
	0xfd0afd0b, 0x02f4fd0b, 0x1211fd0b, 0xededfd0b, 0x1404fd0b, 0xebfafd0b, 0x0513fd0b, 0x000002f5, 
215
	0x080802f5, 0xf7f802f5, 0x0afd02f5, 0xf50302f5, 0xfd0b02f5, 0x02f502f5, 0x121202f5, 0xedee02f5, 
216
	0x140502f5, 0xebfb02f5, 0x051402f5, 0x00001212, 0x08081212, 0xf7f81212, 0x0afd1212, 0xf5031212, 
217
	0xfd0b1212, 0x02f51212, 0x12121212, 0xedee1212, 0x14051212, 0xebfb1212, 0x05141212, 0xffffedee, 
218
	0x0807edee, 0xf7f7edee, 0x0afcedee, 0xf502edee, 0xfd0aedee, 0x02f4edee, 0x1211edee, 0xedededee, 
219
	0x1404edee, 0xebfaedee, 0x0513edee, 0x00001405, 0x08081405, 0xf7f81405, 0x0afd1405, 0xf5031405, 
220
	0xfd0b1405, 0x02f51405, 0x12121405, 0xedee1405, 0x14051405, 0xebfb1405, 0x05141405, 0xffffebfb, 
221
	0x0807ebfb, 0xf7f7ebfb, 0x0afcebfb, 0xf502ebfb, 0xfd0aebfb, 0x02f4ebfb, 0x1211ebfb, 0xededebfb, 
222
	0x1404ebfb, 0xebfaebfb, 0x0513ebfb, 0x00000514, 0x08080514, 0xf7f80514, 0x0afd0514, 0xf5030514, 
223
	0xfd0b0514, 0x02f50514, 0x12120514, 0xedee0514, 0x14050514, 0xebfb0514, 0x05140514, 0x00000000, 
224
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
225
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
226
	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff