405{
407 unsigned long x,
y, y_bottom, cnum, strip_id, chunk_id,
409 long top_size, chunk_size;
410 unsigned char *frm_ptr;
411 unsigned int i, cur_strip,
addr;
412 int d0, d1, d2, d3, frm_stride,
bpp = 3;
415 struct frame_header
416 {
419 unsigned short width;
421 unsigned short strips;
422 } frame;
423
425 y_bottom = 0;
427
432
433 switch(bit_per_pixel)
434 {
435 case 15:
439 break;
440 case 16:
444 break;
445 case 24:
449 break;
450 case 32:
454 break;
455 }
456
458 frm_ptr = output;
459
460 if(frame.length !=
size)
461 {
462 if(frame.length & 0x01) frame.length++;
463 if(frame.length !=
size)
464 {
465 ERR(
"CVID: corruption %d (QT/AVI) != %ld (CV)\n",
size, frame.length);
466
467 }
468 }
469
473
475 {
477 {
479 return;
480 }
481
483 {
485 {
486 ERR(
"CVID: codebook v4 alloc err\n");
487 return;
488 }
489
491 {
492 ERR(
"CVID: codebook v1 alloc err\n");
493 return;
494 }
495 }
496 }
498
499 TRACE(
"CVID: %ux%u, strips %u, length %lu\n",
500 frame.width, frame.height, frame.strips, frame.length);
501
502 for(cur_strip = 0; cur_strip < frame.strips; cur_strip++)
503 {
506
507 if((cur_strip > 0) && (!(frame.flags & 0x01)))
508 {
511 }
512
519
521 top_size -= 12;
524 WARN(
"CVID: Warning x1 (%ld) != width (%d)\n",
x1, out_width);
525
526 TRACE(
" %d) %04lx %04ld <%ld,%ld> <%ld,%ld> yt %ld\n",
527 cur_strip, strip_id, top_size,
x0,
y0,
x1,
y1, y_bottom);
528
529 while(top_size > 0)
530 {
533
534 TRACE(
" %04lx %04ld\n", chunk_id, chunk_size);
535 top_size -= chunk_size;
536 chunk_size -= 4;
537
538 switch(chunk_id)
539 {
540
541 case 0x2000:
542 case 0x2200:
543 codebook = (chunk_id == 0x2200 ? v1_codebook : v4_codebook);
544 cnum = chunk_size/6;
546 break;
547
548 case 0x2400:
549 case 0x2600:
550 codebook = (chunk_id == 0x2600 ? v1_codebook : v4_codebook);
551 cnum = chunk_size/4;
553 break;
554
555 case 0x2100:
556 case 0x2300:
557 codebook = (chunk_id == 0x2300 ? v1_codebook : v4_codebook);
558
559 ci = 0;
560 while(chunk_size > 0)
561 {
563 chunk_size -= 4;
564
565 for(
i = 0;
i < 32;
i++)
566 {
567 if(
flag & 0x80000000)
568 {
569 chunk_size -= 6;
571 }
572
573 ci++;
575 }
576 }
577 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
578 break;
579
580 case 0x2500:
581 case 0x2700:
582 codebook = (chunk_id == 0x2700 ? v1_codebook : v4_codebook);
583
584 ci = 0;
585 while(chunk_size > 0)
586 {
588 chunk_size -= 4;
589
590 for(
i = 0;
i < 32;
i++)
591 {
592 if(
flag & 0x80000000)
593 {
594 chunk_size -= 4;
596 }
597
598 ci++;
600 }
601 }
602 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
603 break;
604
605
606 case 0x3000:
607 while((chunk_size > 0) && (
y < y_bottom))
608 {
610 chunk_size -= 4;
611
612 for(
i = 0;
i < 32;
i++)
613 {
614 if(
y >= y_bottom)
break;
615 if(
flag & 0x80000000)
616 {
621 chunk_size -= 4;
622
624 cvid_v4(frm_ptr +
addr, output, frm_stride, inverted, v4_codebook+d0, v4_codebook+d1, v4_codebook+d2, v4_codebook+d3);
625 }
626 else
627 {
629 cvid_v1(frm_ptr +
addr, output, frm_stride, inverted, v1_codebook +
get_byte());
630
631 chunk_size--;
632 }
633
636 {
639 }
641 }
642 }
643 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
644 break;
645
646 case 0x3100:
647 while((chunk_size > 0) && (
y < y_bottom))
648 {
649
651 chunk_size -= 4;
653
654 while((
mask) && (
y < y_bottom))
655 {
657 {
659 {
660 if(chunk_size < 0) break;
662 chunk_size -= 4;
664 }
666
668 {
673 chunk_size -= 4;
674
676 cvid_v4(frm_ptr +
addr, output, frm_stride, inverted, v4_codebook+d0, v4_codebook+d1, v4_codebook+d2, v4_codebook+d3);
677 }
678 else
679 {
680 chunk_size--;
681
683 cvid_v1(frm_ptr +
addr, output, frm_stride, inverted, v1_codebook +
get_byte());
684 }
685 }
686
690 {
693 }
694 }
695 }
696
697 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
698 break;
699
700 case 0x3200:
701 while((chunk_size > 0) && (
y < y_bottom))
702 {
704 cvid_v1(frm_ptr +
addr, output, frm_stride, inverted, v1_codebook +
get_byte());
705
706 chunk_size--;
709 {
712 }
713 }
714 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
715 break;
716
717 default:
718 ERR(
"CVID: unknown chunk_id %08lx\n", chunk_id);
719 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
720 break;
721 }
722 }
723 }
724
725 if(frame.length !=
size)
726 {
727 if(frame.length & 0x01) frame.length++;
728 if(frame.length !=
size)
729 {
730 long xlen;
735 WARN(
"CVID: END INFO chunk size %d cvid size1 %ld cvid size2 %ld\n",
736 size, frame.length, xlen);
737 }
738 }
739}
static void * heap_alloc(size_t len)
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLenum const GLvoid * addr
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static void cvid_v4_32(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb0, cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3)
static void read_codebook(cvid_codebook *c, int mode)
void(* fn_cvid_v1)(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb)
static int get_stride(int width, int depth)
void(* fn_cvid_v4)(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb0, cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3)
static void cvid_v4_16(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb0, cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3)
static void cvid_v1_16(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb)
static void cvid_v1_15(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb)
static void cvid_v4_24(unsigned char *vptr, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb0, cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3)
static void cvid_v1_32(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb)
static long get_addr(BOOL inverted, unsigned long x, unsigned long y, int frm_stride, int bpp, unsigned int out_height)
static void cvid_v4_15(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb0, cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3)
static void cvid_v1_24(unsigned char *vptr, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb)
#define memcpy(s1, s2, n)
cvid_codebook * v4_codebook[MAX_STRIPS]
cvid_codebook * v1_codebook[MAX_STRIPS]
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1