404{
406 unsigned long x,
y, y_bottom, cnum, strip_id, chunk_id,
408 long top_size, chunk_size;
409 unsigned char *frm_ptr;
410 unsigned int i, cur_strip,
addr;
411 int d0, d1, d2, d3, frm_stride,
bpp = 3;
414 struct frame_header
415 {
418 unsigned short width;
420 unsigned short strips;
421 } frame;
422
424 y_bottom = 0;
426
431
432 switch(bit_per_pixel)
433 {
434 case 15:
438 break;
439 case 16:
443 break;
444 case 24:
448 break;
449 case 32:
453 break;
454 }
455
457 frm_ptr = output;
458
459 if(frame.length !=
size)
460 {
461 if(frame.length & 0x01) frame.length++;
462 if(frame.length !=
size)
463 {
464 ERR(
"CVID: corruption %d (QT/AVI) != %ld (CV)\n",
size, frame.length);
465
466 }
467 }
468
472
474 {
476 {
478 return;
479 }
480
482 {
484 {
485 ERR(
"CVID: codebook v4 alloc err\n");
486 return;
487 }
488
490 {
491 ERR(
"CVID: codebook v1 alloc err\n");
492 return;
493 }
494 }
495 }
497
498 TRACE(
"CVID: %ux%u, strips %u, length %lu\n",
499 frame.width, frame.height, frame.strips, frame.length);
500
501 for(cur_strip = 0; cur_strip < frame.strips; cur_strip++)
502 {
505
506 if((cur_strip > 0) && (!(frame.flags & 0x01)))
507 {
510 }
511
518
520 top_size -= 12;
523 WARN(
"CVID: Warning x1 (%ld) != width (%d)\n",
x1, out_width);
524
525 TRACE(
" %d) %04lx %04ld <%ld,%ld> <%ld,%ld> yt %ld\n",
526 cur_strip, strip_id, top_size,
x0,
y0,
x1,
y1, y_bottom);
527
528 while(top_size > 0)
529 {
532
533 TRACE(
" %04lx %04ld\n", chunk_id, chunk_size);
534 top_size -= chunk_size;
535 chunk_size -= 4;
536
537 switch(chunk_id)
538 {
539
540 case 0x2000:
541 case 0x2200:
542 codebook = (chunk_id == 0x2200 ? v1_codebook : v4_codebook);
543 cnum = chunk_size/6;
545 break;
546
547 case 0x2400:
548 case 0x2600:
549 codebook = (chunk_id == 0x2600 ? v1_codebook : v4_codebook);
550 cnum = chunk_size/4;
552 break;
553
554 case 0x2100:
555 case 0x2300:
556 codebook = (chunk_id == 0x2300 ? v1_codebook : v4_codebook);
557
558 ci = 0;
559 while(chunk_size > 0)
560 {
562 chunk_size -= 4;
563
564 for(
i = 0;
i < 32;
i++)
565 {
566 if(
flag & 0x80000000)
567 {
568 chunk_size -= 6;
570 }
571
572 ci++;
574 }
575 }
576 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
577 break;
578
579 case 0x2500:
580 case 0x2700:
581 codebook = (chunk_id == 0x2700 ? v1_codebook : v4_codebook);
582
583 ci = 0;
584 while(chunk_size > 0)
585 {
587 chunk_size -= 4;
588
589 for(
i = 0;
i < 32;
i++)
590 {
591 if(
flag & 0x80000000)
592 {
593 chunk_size -= 4;
595 }
596
597 ci++;
599 }
600 }
601 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
602 break;
603
604
605 case 0x3000:
606 while((chunk_size > 0) && (
y < y_bottom))
607 {
609 chunk_size -= 4;
610
611 for(
i = 0;
i < 32;
i++)
612 {
613 if(
y >= y_bottom)
break;
614 if(
flag & 0x80000000)
615 {
620 chunk_size -= 4;
621
623 cvid_v4(frm_ptr +
addr, output, frm_stride, inverted, v4_codebook+d0, v4_codebook+d1, v4_codebook+d2, v4_codebook+d3);
624 }
625 else
626 {
628 cvid_v1(frm_ptr +
addr, output, frm_stride, inverted, v1_codebook +
get_byte());
629
630 chunk_size--;
631 }
632
635 {
638 }
640 }
641 }
642 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
643 break;
644
645 case 0x3100:
646 while((chunk_size > 0) && (
y < y_bottom))
647 {
648
650 chunk_size -= 4;
652
653 while((
mask) && (
y < y_bottom))
654 {
656 {
658 {
659 if(chunk_size < 0) break;
661 chunk_size -= 4;
663 }
665
667 {
672 chunk_size -= 4;
673
675 cvid_v4(frm_ptr +
addr, output, frm_stride, inverted, v4_codebook+d0, v4_codebook+d1, v4_codebook+d2, v4_codebook+d3);
676 }
677 else
678 {
679 chunk_size--;
680
682 cvid_v1(frm_ptr +
addr, output, frm_stride, inverted, v1_codebook +
get_byte());
683 }
684 }
685
689 {
692 }
693 }
694 }
695
696 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
697 break;
698
699 case 0x3200:
700 while((chunk_size > 0) && (
y < y_bottom))
701 {
703 cvid_v1(frm_ptr +
addr, output, frm_stride, inverted, v1_codebook +
get_byte());
704
705 chunk_size--;
708 {
711 }
712 }
713 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
714 break;
715
716 default:
717 ERR(
"CVID: unknown chunk_id %08lx\n", chunk_id);
718 while(chunk_size > 0) {
skip_byte(); chunk_size--; }
719 break;
720 }
721 }
722 }
723
724 if(frame.length !=
size)
725 {
726 if(frame.length & 0x01) frame.length++;
727 if(frame.length !=
size)
728 {
729 long xlen;
734 WARN(
"CVID: END INFO chunk size %d cvid size1 %ld cvid size2 %ld\n",
735 size, frame.length, xlen);
736 }
737 }
738}
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 x1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1