comparison vqavideo.c @ 1506:e0c02032d0f2 libavcodec

support a few more types of VQA files
author melanson
date Sat, 11 Oct 2003 01:11:29 +0000
parents dc6f46cd4a7b
children 6b224ca24033
comparison
equal deleted inserted replaced
1505:010f76d07a27 1506:e0c02032d0f2
310 int byte_skip; 310 int byte_skip;
311 unsigned int index = 0; 311 unsigned int index = 0;
312 int i; 312 int i;
313 unsigned char r, g, b; 313 unsigned char r, g, b;
314 unsigned int *palette32; 314 unsigned int *palette32;
315 int index_shift;
315 316
316 int cbf0_chunk = -1; 317 int cbf0_chunk = -1;
317 int cbfz_chunk = -1; 318 int cbfz_chunk = -1;
318 int cbp0_chunk = -1; 319 int cbp0_chunk = -1;
319 int cbpz_chunk = -1; 320 int cbpz_chunk = -1;
460 vptz_chunk += CHUNK_PREAMBLE_SIZE; 461 vptz_chunk += CHUNK_PREAMBLE_SIZE;
461 decode_format80(&s->buf[vptz_chunk], chunk_size, 462 decode_format80(&s->buf[vptz_chunk], chunk_size,
462 s->decode_buffer, s->decode_buffer_size, 1); 463 s->decode_buffer, s->decode_buffer_size, 1);
463 464
464 /* render the final PAL8 frame */ 465 /* render the final PAL8 frame */
466 if (s->vector_height == 4)
467 index_shift = 4;
468 else
469 index_shift = 3;
465 for (y = 0; y < s->frame.linesize[0] * s->height; 470 for (y = 0; y < s->frame.linesize[0] * s->height;
466 y += s->frame.linesize[0] * s->vector_height) { 471 y += s->frame.linesize[0] * s->vector_height) {
467 472
468 for (x = y; x < y + s->width; x += 4, lobytes++, hibytes++) { 473 for (x = y; x < y + s->width; x += 4, lobytes++, hibytes++) {
469 pixel_ptr = x; 474 pixel_ptr = x;
480 485
481 case 2: 486 case 2:
482 lobyte = s->decode_buffer[lobytes]; 487 lobyte = s->decode_buffer[lobytes];
483 hibyte = s->decode_buffer[hibytes]; 488 hibyte = s->decode_buffer[hibytes];
484 vector_index = (hibyte << 8) | lobyte; 489 vector_index = (hibyte << 8) | lobyte;
485 vector_index *= 8; 490 vector_index <<= index_shift;
486 lines = s->vector_height; 491 lines = s->vector_height;
487 break; 492 break;
488 493
489 case 3: 494 case 3:
490 /* not implemented yet */ 495 /* not implemented yet */