ReactOS 0.4.17-dev-966-gf06eace
iccvid.c
Go to the documentation of this file.
1/*
2 * Radius Cinepak Video Decoder
3 *
4 * Copyright 2001 Dr. Tim Ferguson (see below)
5 * Portions Copyright 2003 Mike McCormack for CodeWeavers
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22/* Copyright notice from original source:
23 * ------------------------------------------------------------------------
24 * Radius Cinepak Video Decoder
25 *
26 * Dr. Tim Ferguson, 2001.
27 * For more details on the algorithm:
28 * http://www.csse.monash.edu.au/~timf/videocodec.html
29 *
30 * This is basically a vector quantiser with adaptive vector density. The
31 * frame is segmented into 4x4 pixel blocks, and each block is coded using
32 * either 1 or 4 vectors.
33 *
34 * There are still some issues with this code yet to be resolved. In
35 * particular with decoding in the strip boundaries. However, I have not
36 * yet found a sequence it doesn't work on. Ill keep trying :)
37 *
38 * You may freely use this source code. I only ask that you reference its
39 * source in your projects documentation:
40 * Tim Ferguson: http://www.csse.monash.edu.au/~timf/
41 * ------------------------------------------------------------------------ */
42
43#include <stdarg.h>
44#include "windef.h"
45#include "winbase.h"
46#include "wingdi.h"
47#include "winuser.h"
48#include "commdlg.h"
49#include "vfw.h"
50#include "mmsystem.h"
51#include "iccvid_private.h"
52
53#include "wine/debug.h"
54
56
58
59#define ICCVID_MAGIC mmioFOURCC('c', 'v', 'i', 'd')
60#define compare_fourcc(fcc1, fcc2) (((fcc1)^(fcc2))&~0x20202020)
61#define MAX_STRIPS 32
62
63/* ------------------------------------------------------------------------ */
64typedef struct
65{
66 unsigned char y0, y1, y2, y3;
67 char u, v;
68 unsigned char r[4], g[4], b[4];
70
71typedef struct {
74 unsigned int strip_num;
76
77typedef struct _ICCVID_Info
78{
83
84
85/* ------------------------------------------------------------------------ */
86static unsigned char *in_buffer, uiclip[1024], *uiclp = NULL;
87
88#define get_byte() *(in_buffer++)
89#define skip_byte() in_buffer++
90#define get_word() ((unsigned short)(in_buffer += 2, \
91 (in_buffer[-2] << 8 | in_buffer[-1])))
92#define get_long() ((unsigned long)(in_buffer += 4, \
93 (in_buffer[-4] << 24 | in_buffer[-3] << 16 | in_buffer[-2] << 8 | in_buffer[-1])))
94
95
96/* ---------------------------------------------------------------------- */
97static inline void read_codebook(cvid_codebook *c, int mode)
98{
99int uvr, uvg, uvb;
100
101 if(mode) /* black and white */
102 {
103 c->y0 = get_byte();
104 c->y1 = get_byte();
105 c->y2 = get_byte();
106 c->y3 = get_byte();
107 c->u = c->v = 0;
108
109 c->r[0] = c->g[0] = c->b[0] = c->y0;
110 c->r[1] = c->g[1] = c->b[1] = c->y1;
111 c->r[2] = c->g[2] = c->b[2] = c->y2;
112 c->r[3] = c->g[3] = c->b[3] = c->y3;
113 }
114 else /* colour */
115 {
116 c->y0 = get_byte(); /* luma */
117 c->y1 = get_byte();
118 c->y2 = get_byte();
119 c->y3 = get_byte();
120 c->u = get_byte(); /* chroma */
121 c->v = get_byte();
122
123 uvr = c->v << 1;
124 uvg = -((c->u+1) >> 1) - c->v;
125 uvb = c->u << 1;
126
127 c->r[0] = uiclp[c->y0 + uvr]; c->g[0] = uiclp[c->y0 + uvg]; c->b[0] = uiclp[c->y0 + uvb];
128 c->r[1] = uiclp[c->y1 + uvr]; c->g[1] = uiclp[c->y1 + uvg]; c->b[1] = uiclp[c->y1 + uvb];
129 c->r[2] = uiclp[c->y2 + uvr]; c->g[2] = uiclp[c->y2 + uvg]; c->b[2] = uiclp[c->y2 + uvb];
130 c->r[3] = uiclp[c->y3 + uvr]; c->g[3] = uiclp[c->y3 + uvg]; c->b[3] = uiclp[c->y3 + uvb];
131 }
132}
133
134static inline long get_addr(BOOL inverted, unsigned long x, unsigned long y,
135 int frm_stride, int bpp, unsigned int out_height)
136{
137 /* Returns the starting position of a line from top-down or bottom-up */
138 if (inverted)
139 return y * frm_stride + x * bpp;
140 else
141 return (out_height - 1 - y) * frm_stride + x * bpp;
142}
143
144#define MAKECOLOUR32(r,g,b) (((r) << 16) | ((g) << 8) | (b))
145/*#define MAKECOLOUR24(r,g,b) (((r) << 16) | ((g) << 8) | (b))*/
146#define MAKECOLOUR16(r,g,b) (((r) >> 3) << 11)| (((g) >> 2) << 5)| (((b) >> 3) << 0)
147#define MAKECOLOUR15(r,g,b) (((r) >> 3) << 10)| (((g) >> 3) << 5)| (((b) >> 3) << 0)
148
149/* ------------------------------------------------------------------------ */
150static void cvid_v1_32(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted,
152{
153unsigned long *vptr = (unsigned long *)frm;
154int row_inc;
155int x, y;
156
157 if (!inverted)
158 row_inc = -stride/4;
159 else
160 row_inc = stride/4;
161
162 /* fill 4x4 block of pixels with colour values from codebook */
163 for (y = 0; y < 4; y++)
164 {
165 if (&vptr[y*row_inc] < (unsigned long *)limit) return;
166 for (x = 0; x < 4; x++)
167 vptr[y*row_inc + x] = MAKECOLOUR32(cb->r[x/2+(y/2)*2], cb->g[x/2+(y/2)*2], cb->b[x/2+(y/2)*2]);
168 }
169}
170
171static inline int get_stride(int width, int depth)
172{
173 return ((depth * width + 31) >> 3) & ~3;
174}
175
176/* ------------------------------------------------------------------------ */
177static void cvid_v4_32(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted,
179{
180unsigned long *vptr = (unsigned long *)frm;
181int row_inc;
182int x, y;
183cvid_codebook * cb[] = {cb0,cb1,cb2,cb3};
184
185 if (!inverted)
186 row_inc = -stride/4;
187 else
188 row_inc = stride/4;
189
190 /* fill 4x4 block of pixels with colour values from codebooks */
191 for (y = 0; y < 4; y++)
192 {
193 if (&vptr[y*row_inc] < (unsigned long *)limit) return;
194 for (x = 0; x < 4; x++)
195 vptr[y*row_inc + x] = MAKECOLOUR32(cb[x/2+(y/2)*2]->r[x%2+(y%2)*2], cb[x/2+(y/2)*2]->g[x%2+(y%2)*2], cb[x/2+(y/2)*2]->b[x%2+(y%2)*2]);
196 }
197}
198
199
200/* ------------------------------------------------------------------------ */
201static void cvid_v1_24(unsigned char *vptr, unsigned char *limit, int stride, BOOL inverted,
203{
204int row_inc;
205int x, y;
206
207 if (!inverted)
208 row_inc = -stride;
209 else
210 row_inc = stride;
211
212 /* fill 4x4 block of pixels with colour values from codebook */
213 for (y = 0; y < 4; y++)
214 {
215 if (&vptr[y*row_inc] < limit) return;
216 for (x = 0; x < 4; x++)
217 {
218 vptr[y*row_inc + x*3 + 0] = cb->b[x/2+(y/2)*2];
219 vptr[y*row_inc + x*3 + 1] = cb->g[x/2+(y/2)*2];
220 vptr[y*row_inc + x*3 + 2] = cb->r[x/2+(y/2)*2];
221 }
222 }
223}
224
225
226/* ------------------------------------------------------------------------ */
227static void cvid_v4_24(unsigned char *vptr, unsigned char *limit, int stride, BOOL inverted,
229{
230int row_inc;
231cvid_codebook * cb[] = {cb0,cb1,cb2,cb3};
232int x, y;
233
234 if (!inverted)
235 row_inc = -stride;
236 else
237 row_inc = stride;
238
239 /* fill 4x4 block of pixels with colour values from codebooks */
240 for (y = 0; y < 4; y++)
241 {
242 if (&vptr[y*row_inc] < limit) return;
243 for (x = 0; x < 4; x++)
244 {
245 vptr[y*row_inc + x*3 + 0] = cb[x/2+(y/2)*2]->b[x%2+(y%2)*2];
246 vptr[y*row_inc + x*3 + 1] = cb[x/2+(y/2)*2]->g[x%2+(y%2)*2];
247 vptr[y*row_inc + x*3 + 2] = cb[x/2+(y/2)*2]->r[x%2+(y%2)*2];
248 }
249 }
250}
251
252
253/* ------------------------------------------------------------------------ */
254static void cvid_v1_16(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted,
256{
257unsigned short *vptr = (unsigned short *)frm;
258int row_inc;
259int x, y;
260
261 if (!inverted)
262 row_inc = -stride/2;
263 else
264 row_inc = stride/2;
265
266 /* fill 4x4 block of pixels with colour values from codebook */
267 for (y = 0; y < 4; y++)
268 {
269 if (&vptr[y*row_inc] < (unsigned short *)limit) return;
270 for (x = 0; x < 4; x++)
271 vptr[y*row_inc + x] = MAKECOLOUR16(cb->r[x/2+(y/2)*2], cb->g[x/2+(y/2)*2], cb->b[x/2+(y/2)*2]);
272 }
273}
274
275
276/* ------------------------------------------------------------------------ */
277static void cvid_v4_16(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted,
279{
280unsigned short *vptr = (unsigned short *)frm;
281int row_inc;
282cvid_codebook * cb[] = {cb0,cb1,cb2,cb3};
283int x, y;
284
285 if (!inverted)
286 row_inc = -stride/2;
287 else
288 row_inc = stride/2;
289
290 /* fill 4x4 block of pixels with colour values from codebooks */
291 for (y = 0; y < 4; y++)
292 {
293 if (&vptr[y*row_inc] < (unsigned short *)limit) return;
294 for (x = 0; x < 4; x++)
295 vptr[y*row_inc + x] = MAKECOLOUR16(cb[x/2+(y/2)*2]->r[x%2+(y%2)*2], cb[x/2+(y/2)*2]->g[x%2+(y%2)*2], cb[x/2+(y/2)*2]->b[x%2+(y%2)*2]);
296 }
297}
298
299/* ------------------------------------------------------------------------ */
300static void cvid_v1_15(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted,
302{
303unsigned short *vptr = (unsigned short *)frm;
304int row_inc;
305int x, y;
306
307 if (!inverted)
308 row_inc = -stride/2;
309 else
310 row_inc = stride/2;
311
312 /* fill 4x4 block of pixels with colour values from codebook */
313 for (y = 0; y < 4; y++)
314 {
315 if (&vptr[y*row_inc] < (unsigned short *)limit) return;
316 for (x = 0; x < 4; x++)
317 vptr[y*row_inc + x] = MAKECOLOUR15(cb->r[x/2+(y/2)*2], cb->g[x/2+(y/2)*2], cb->b[x/2+(y/2)*2]);
318 }
319}
320
321
322/* ------------------------------------------------------------------------ */
323static void cvid_v4_15(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted,
325{
326unsigned short *vptr = (unsigned short *)frm;
327int row_inc;
328cvid_codebook * cb[] = {cb0,cb1,cb2,cb3};
329int x, y;
330
331 if (!inverted)
332 row_inc = -stride/2;
333 else
334 row_inc = stride/2;
335
336 /* fill 4x4 block of pixels with colour values from codebooks */
337 for (y = 0; y < 4; y++)
338 {
339 if (&vptr[y*row_inc] < (unsigned short *)limit) return;
340 for (x = 0; x < 4; x++)
341 vptr[y*row_inc + x] = MAKECOLOUR15(cb[x/2+(y/2)*2]->r[x%2+(y%2)*2], cb[x/2+(y/2)*2]->g[x%2+(y%2)*2], cb[x/2+(y/2)*2]->b[x%2+(y%2)*2]);
342 }
343}
344
345
346/* ------------------------------------------------------------------------
347 * Call this function once at the start of the sequence and save the
348 * returned context for calls to decode_cinepak().
349 */
351{
352 cinepak_info *cvinfo;
353 int i;
354
355 cvinfo = malloc(sizeof(cinepak_info));
356 if( !cvinfo )
357 return NULL;
358 cvinfo->strip_num = 0;
359
360 if(uiclp == NULL)
361 {
362 uiclp = uiclip+512;
363 for(i = -512; i < 512; i++)
364 uiclp[i] = (i < 0 ? 0 : (i > 255 ? 255 : i));
365 }
366
367 return cvinfo;
368}
369
370static void free_cvinfo( cinepak_info *cvinfo )
371{
372 unsigned int i;
373
374 for( i=0; i<cvinfo->strip_num; i++ )
375 {
376 free(cvinfo->v4_codebook[i]);
377 free(cvinfo->v1_codebook[i]);
378 }
379 free( cvinfo );
380}
381
382typedef void (*fn_cvid_v1)(unsigned char *frm, unsigned char *limit,
383 int stride, BOOL inverted, cvid_codebook *cb);
384typedef void (*fn_cvid_v4)(unsigned char *frm, unsigned char *limit,
385 int stride, BOOL inverted,
386 cvid_codebook *cb0, cvid_codebook *cb1,
387 cvid_codebook *cb2, cvid_codebook *cb3);
388
389/* ------------------------------------------------------------------------
390 * This function decodes a buffer containing a Cinepak encoded frame.
391 *
392 * context - the context created by decode_cinepak_init().
393 * buf - the input buffer to be decoded
394 * size - the size of the input buffer
395 * output - the output frame buffer (24 or 32 bit per pixel)
396 * out_width - the width of the output frame
397 * out_height - the height of the output frame
398 * bit_per_pixel - the number of bits per pixel allocated to the output
399 * frame (only 24 or 32 bpp are supported)
400 * inverted - if true the output frame is written top-down
401 */
402static void decode_cinepak(cinepak_info *cvinfo, unsigned char *buf, int size,
403 unsigned char *output, unsigned int out_width, unsigned int out_height, int bit_per_pixel, BOOL inverted)
404{
405 cvid_codebook *v4_codebook, *v1_codebook, *codebook = NULL;
406 unsigned long x, y, y_bottom, cnum, strip_id, chunk_id,
407 x0, y0, x1, y1, ci, flag, mask;
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;
412 fn_cvid_v1 cvid_v1 = cvid_v1_24;
413 fn_cvid_v4 cvid_v4 = cvid_v4_24;
414 struct frame_header
415 {
416 unsigned char flags;
417 unsigned long length;
418 unsigned short width;
419 unsigned short height;
420 unsigned short strips;
421 } frame;
422
423 y = 0;
424 y_bottom = 0;
425 in_buffer = buf;
426
427 frame.flags = get_byte();
428 frame.length = get_byte() << 16;
429 frame.length |= get_byte() << 8;
430 frame.length |= get_byte();
431
432 switch(bit_per_pixel)
433 {
434 case 15:
435 bpp = 2;
436 cvid_v1 = cvid_v1_15;
437 cvid_v4 = cvid_v4_15;
438 break;
439 case 16:
440 bpp = 2;
441 cvid_v1 = cvid_v1_16;
442 cvid_v4 = cvid_v4_16;
443 break;
444 case 24:
445 bpp = 3;
446 cvid_v1 = cvid_v1_24;
447 cvid_v4 = cvid_v4_24;
448 break;
449 case 32:
450 bpp = 4;
451 cvid_v1 = cvid_v1_32;
452 cvid_v4 = cvid_v4_32;
453 break;
454 }
455
456 frm_stride = get_stride(out_width, bpp * 8);
457 frm_ptr = output;
458
459 if(frame.length != size)
460 {
461 if(frame.length & 0x01) frame.length++; /* AVIs tend to have a size mismatch */
462 if(frame.length != size)
463 {
464 ERR("CVID: corruption %d (QT/AVI) != %ld (CV)\n", size, frame.length);
465 /* return; */
466 }
467 }
468
469 frame.width = get_word();
470 frame.height = get_word();
471 frame.strips = get_word();
472
473 if(frame.strips > cvinfo->strip_num)
474 {
475 if(frame.strips >= MAX_STRIPS)
476 {
477 ERR("CVID: strip overflow (more than %d)\n", MAX_STRIPS);
478 return;
479 }
480
481 for(i = cvinfo->strip_num; i < frame.strips; i++)
482 {
483 if((cvinfo->v4_codebook[i] = malloc(sizeof(cvid_codebook) * 260)) == NULL)
484 {
485 ERR("CVID: codebook v4 alloc err\n");
486 return;
487 }
488
489 if((cvinfo->v1_codebook[i] = malloc(sizeof(cvid_codebook) * 260)) == NULL)
490 {
491 ERR("CVID: codebook v1 alloc err\n");
492 return;
493 }
494 }
495 }
496 cvinfo->strip_num = frame.strips;
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 {
503 v4_codebook = cvinfo->v4_codebook[cur_strip];
504 v1_codebook = cvinfo->v1_codebook[cur_strip];
505
506 if((cur_strip > 0) && (!(frame.flags & 0x01)))
507 {
508 memcpy(cvinfo->v4_codebook[cur_strip], cvinfo->v4_codebook[cur_strip-1], 260 * sizeof(cvid_codebook));
509 memcpy(cvinfo->v1_codebook[cur_strip], cvinfo->v1_codebook[cur_strip-1], 260 * sizeof(cvid_codebook));
510 }
511
512 strip_id = get_word(); /* 1000 = key strip, 1100 = iter strip */
513 top_size = get_word();
514 y0 = get_word(); /* FIXME: most of these are ignored at the moment */
515 x0 = get_word();
516 y1 = get_word();
517 x1 = get_word();
518
519 y_bottom += y1;
520 top_size -= 12;
521 x = 0;
522 if(x1 != out_width)
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 {
530 chunk_id = get_word();
531 chunk_size = get_word();
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 /* -------------------- Codebook Entries -------------------- */
540 case 0x2000:
541 case 0x2200:
542 codebook = (chunk_id == 0x2200 ? v1_codebook : v4_codebook);
543 cnum = chunk_size/6;
544 for(i = 0; i < cnum; i++) read_codebook(codebook+i, 0);
545 break;
546
547 case 0x2400:
548 case 0x2600: /* 8 bit per pixel */
549 codebook = (chunk_id == 0x2600 ? v1_codebook : v4_codebook);
550 cnum = chunk_size/4;
551 for(i = 0; i < cnum; i++) read_codebook(codebook+i, 1);
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 {
561 flag = get_long();
562 chunk_size -= 4;
563
564 for(i = 0; i < 32; i++)
565 {
566 if(flag & 0x80000000)
567 {
568 chunk_size -= 6;
569 read_codebook(codebook+ci, 0);
570 }
571
572 ci++;
573 flag <<= 1;
574 }
575 }
576 while(chunk_size > 0) { skip_byte(); chunk_size--; }
577 break;
578
579 case 0x2500:
580 case 0x2700: /* 8 bit per pixel */
581 codebook = (chunk_id == 0x2700 ? v1_codebook : v4_codebook);
582
583 ci = 0;
584 while(chunk_size > 0)
585 {
586 flag = get_long();
587 chunk_size -= 4;
588
589 for(i = 0; i < 32; i++)
590 {
591 if(flag & 0x80000000)
592 {
593 chunk_size -= 4;
594 read_codebook(codebook+ci, 1);
595 }
596
597 ci++;
598 flag <<= 1;
599 }
600 }
601 while(chunk_size > 0) { skip_byte(); chunk_size--; }
602 break;
603
604 /* -------------------- Frame -------------------- */
605 case 0x3000:
606 while((chunk_size > 0) && (y < y_bottom))
607 {
608 flag = get_long();
609 chunk_size -= 4;
610
611 for(i = 0; i < 32; i++)
612 {
613 if(y >= y_bottom) break;
614 if(flag & 0x80000000) /* 4 bytes per block */
615 {
616 d0 = get_byte();
617 d1 = get_byte();
618 d2 = get_byte();
619 d3 = get_byte();
620 chunk_size -= 4;
621
622 addr = get_addr(inverted, x, y, frm_stride, bpp, out_height);
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 /* 1 byte per block */
626 {
627 addr = get_addr(inverted, x, y, frm_stride, bpp, out_height);
628 cvid_v1(frm_ptr + addr, output, frm_stride, inverted, v1_codebook + get_byte());
629
630 chunk_size--;
631 }
632
633 x += 4;
634 if(x >= out_width)
635 {
636 x = 0;
637 y += 4;
638 }
639 flag <<= 1;
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 /* ---- flag bits: 0 = SKIP, 10 = V1, 11 = V4 ---- */
649 flag = get_long();
650 chunk_size -= 4;
651 mask = 0x80000000;
652
653 while((mask) && (y < y_bottom))
654 {
655 if(flag & mask)
656 {
657 if(mask == 1)
658 {
659 if(chunk_size < 0) break;
660 flag = get_long();
661 chunk_size -= 4;
662 mask = 0x80000000;
663 }
664 else mask >>= 1;
665
666 if(flag & mask) /* V4 */
667 {
668 d0 = get_byte();
669 d1 = get_byte();
670 d2 = get_byte();
671 d3 = get_byte();
672 chunk_size -= 4;
673
674 addr = get_addr(inverted, x, y, frm_stride, bpp, out_height);
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 /* V1 */
678 {
679 chunk_size--;
680
681 addr = get_addr(inverted, x, y, frm_stride, bpp, out_height);
682 cvid_v1(frm_ptr + addr, output, frm_stride, inverted, v1_codebook + get_byte());
683 }
684 } /* else SKIP */
685
686 mask >>= 1;
687 x += 4;
688 if(x >= out_width)
689 {
690 x = 0;
691 y += 4;
692 }
693 }
694 }
695
696 while(chunk_size > 0) { skip_byte(); chunk_size--; }
697 break;
698
699 case 0x3200: /* each byte is a V1 codebook */
700 while((chunk_size > 0) && (y < y_bottom))
701 {
702 addr = get_addr(inverted, x, y, frm_stride, bpp, out_height);
703 cvid_v1(frm_ptr + addr, output, frm_stride, inverted, v1_codebook + get_byte());
704
705 chunk_size--;
706 x += 4;
707 if(x >= out_width)
708 {
709 x = 0;
710 y += 4;
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++; /* AVIs tend to have a size mismatch */
727 if(frame.length != size)
728 {
729 long xlen;
730 skip_byte();
731 xlen = get_byte() << 16;
732 xlen |= get_byte() << 8;
733 xlen |= get_byte(); /* Read Len */
734 WARN("CVID: END INFO chunk size %d cvid size1 %ld cvid size2 %ld\n",
735 size, frame.length, xlen);
736 }
737 }
738}
739
740static void ICCVID_dump_BITMAPINFO(const BITMAPINFO * bmi)
741{
742 TRACE(
743 "planes = %d\n"
744 "bpp = %d\n"
745 "height = %ld\n"
746 "width = %ld\n"
747 "compr = %s\n",
748 bmi->bmiHeader.biPlanes,
750 bmi->bmiHeader.biHeight,
751 bmi->bmiHeader.biWidth,
753}
754
755static inline int ICCVID_CheckMask(RGBQUAD bmiColors[3], COLORREF redMask, COLORREF blueMask, COLORREF greenMask)
756{
757 COLORREF realRedMask = MAKECOLOUR32(bmiColors[0].rgbRed, bmiColors[0].rgbGreen, bmiColors[0].rgbBlue);
758 COLORREF realBlueMask = MAKECOLOUR32(bmiColors[1].rgbRed, bmiColors[1].rgbGreen, bmiColors[1].rgbBlue);
759 COLORREF realGreenMask = MAKECOLOUR32(bmiColors[2].rgbRed, bmiColors[2].rgbGreen, bmiColors[2].rgbBlue);
760
761 TRACE("\nbmiColors[0] = 0x%08lx\nbmiColors[1] = 0x%08lx\nbmiColors[2] = 0x%08lx\n",
762 realRedMask, realBlueMask, realGreenMask);
763
764 if ((realRedMask == redMask) &&
765 (realBlueMask == blueMask) &&
766 (realGreenMask == greenMask))
767 return TRUE;
768 return FALSE;
769}
770
772{
773 TRACE("ICM_DECOMPRESS_QUERY %p %p %p\n", info, in, out);
774
775 if( (info==NULL) || (info->dwMagic!=ICCVID_MAGIC) )
776 return ICERR_BADPARAM;
777
778 TRACE("in: ");
780
781 if( in->bmiHeader.biCompression != ICCVID_MAGIC )
782 return ICERR_BADFORMAT;
783
784 if( out )
785 {
786 TRACE("out: ");
788
789 if( in->bmiHeader.biPlanes != out->bmiHeader.biPlanes )
790 return ICERR_BADFORMAT;
791 if( in->bmiHeader.biHeight != out->bmiHeader.biHeight )
792 {
793 if( in->bmiHeader.biHeight != -out->bmiHeader.biHeight )
794 return ICERR_BADFORMAT;
795 TRACE("Detected inverted height for video output\n");
796 }
797 if( in->bmiHeader.biWidth != out->bmiHeader.biWidth )
798 return ICERR_BADFORMAT;
799
800 switch( out->bmiHeader.biCompression )
801 {
802 case BI_RGB:
803 if ( out->bmiHeader.biBitCount == 16 || out->bmiHeader.biBitCount == 24 || out->bmiHeader.biBitCount == 32 )
804 return ICERR_OK;
805 break;
806 case BI_BITFIELDS:
807 if ( out->bmiHeader.biBitCount == 16 && ICCVID_CheckMask(out->bmiColors, 0x7C00, 0x03E0, 0x001F) )
808 return ICERR_OK;
809 if ( out->bmiHeader.biBitCount == 16 && ICCVID_CheckMask(out->bmiColors, 0xF800, 0x07E0, 0x001F) )
810 return ICERR_OK;
811 break;
812 }
813 TRACE("unsupported output format\n");
814 return ICERR_BADFORMAT;
815 }
816
817 return ICERR_OK;
818}
819
821{
822 DWORD size;
823
824 TRACE("ICM_DECOMPRESS_GETFORMAT %p %p %p\n", info, in, out);
825
826 if( (info==NULL) || (info->dwMagic!=ICCVID_MAGIC) )
827 return ICERR_BADPARAM;
828
829 size = in->bmiHeader.biSize;
830 if (in->bmiHeader.biBitCount <= 8)
831 size += in->bmiHeader.biClrUsed * sizeof(RGBQUAD);
832
833 if( out )
834 {
835 memcpy( out, in, size );
836 out->bmiHeader.biBitCount = 24;
837 out->bmiHeader.biCompression = BI_RGB;
838 out->bmiHeader.biSizeImage = get_stride(in->bmiHeader.biWidth, 24) * in->bmiHeader.biHeight;
839 return ICERR_OK;
840 }
841 return size;
842}
843
845{
846 TRACE("ICM_DECOMPRESS_BEGIN %p %p %p\n", info, in, out);
847
848 if( (info==NULL) || (info->dwMagic!=ICCVID_MAGIC) )
849 return ICERR_BADPARAM;
850
851 info->bits_per_pixel = out->bmiHeader.biBitCount;
852
853 if (info->bits_per_pixel == 16)
854 {
855 if ( out->bmiHeader.biCompression == BI_BITFIELDS )
856 {
857 if ( ICCVID_CheckMask(out->bmiColors, 0x7C00, 0x03E0, 0x001F) )
858 info->bits_per_pixel = 15;
859 else if ( ICCVID_CheckMask(out->bmiColors, 0xF800, 0x07E0, 0x001F) )
860 info->bits_per_pixel = 16;
861 else
862 {
863 TRACE("unsupported output bit field(s) for 16-bit colors\n");
864 return ICERR_UNSUPPORTED;
865 }
866 }
867 else
868 info->bits_per_pixel = 15;
869 }
870
871 TRACE("bit_per_pixel = %d\n", info->bits_per_pixel);
872
873 if( info->cvinfo )
874 free_cvinfo( info->cvinfo );
875 info->cvinfo = decode_cinepak_init();
876
877 return ICERR_OK;
878}
879
881{
883 BOOL inverted;
884
885 TRACE("ICM_DECOMPRESS %p %p %ld\n", info, icd, size);
886
887 if( (info==NULL) || (info->dwMagic!=ICCVID_MAGIC) )
888 return ICERR_BADPARAM;
889 if (info->cvinfo==NULL)
890 {
891 ERR("ICM_DECOMPRESS sent after ICM_DECOMPRESS_END\n");
892 return ICERR_BADPARAM;
893 }
894
895 width = icd->lpbiInput->biWidth;
896 height = icd->lpbiInput->biHeight;
897 inverted = -icd->lpbiOutput->biHeight == height;
898
899 decode_cinepak(info->cvinfo, icd->lpInput, icd->lpbiInput->biSizeImage,
900 icd->lpOutput, width, height, info->bits_per_pixel, inverted);
901
902 return ICERR_OK;
903}
904
906{
908 BOOL inverted;
909
910 TRACE("ICM_DECOMPRESSEX %p %p %ld\n", info, icd, size);
911
912 if( (info==NULL) || (info->dwMagic!=ICCVID_MAGIC) )
913 return ICERR_BADPARAM;
914 if (info->cvinfo==NULL)
915 {
916 ERR("ICM_DECOMPRESSEX sent after ICM_DECOMPRESS_END\n");
917 return ICERR_BADPARAM;
918 }
919
920 /* FIXME: flags are ignored */
921
922 width = icd->lpbiSrc->biWidth;
923 height = icd->lpbiSrc->biHeight;
924 inverted = -icd->lpbiDst->biHeight == height;
925
926 decode_cinepak(info->cvinfo, icd->lpSrc, icd->lpbiSrc->biSizeImage,
927 icd->lpDst, width, height, info->bits_per_pixel, inverted);
928
929 return ICERR_OK;
930}
931
933{
934 if( (info==NULL) || (info->dwMagic!=ICCVID_MAGIC) )
935 return 0;
936 if( info->cvinfo )
937 free_cvinfo( info->cvinfo );
938 free( info );
939 return 1;
940}
941
943{
944 if (!icinfo) return sizeof(ICINFO);
945 if (dwSize < sizeof(ICINFO)) return 0;
946
947 icinfo->dwSize = sizeof(ICINFO);
948 icinfo->fccType = ICTYPE_VIDEO;
949 icinfo->fccHandler = info ? info->dwMagic : ICCVID_MAGIC;
950 icinfo->dwFlags = 0;
951 icinfo->dwVersion = ICVERSION;
952 icinfo->dwVersionICM = ICVERSION;
953
956 /* msvfw32 will fill icinfo->szDriver for us */
957
958 return sizeof(ICINFO);
959}
960
962{
963 if( info->cvinfo )
964 {
965 free_cvinfo( info->cvinfo );
966 info->cvinfo = NULL;
967 }
968 return ICERR_OK;
969}
970
972 LPARAM lParam1, LPARAM lParam2)
973{
974 ICCVID_Info *info = (ICCVID_Info *) dwDriverId;
975
976 TRACE("%Id %p %d %Id %Id\n", dwDriverId, hdrvr, msg, lParam1, lParam2);
977
978 switch( msg )
979 {
980 case DRV_LOAD:
981 TRACE("Loaded\n");
982 return 1;
983 case DRV_ENABLE:
984 return 0;
985 case DRV_DISABLE:
986 return 0;
987 case DRV_FREE:
988 return 0;
989
990 case DRV_OPEN:
991 {
992 ICINFO *icinfo = (ICINFO *)lParam2;
993
994 TRACE("Opened\n");
995
996 if (icinfo && compare_fourcc(icinfo->fccType, ICTYPE_VIDEO)) return 0;
997
998 info = malloc(sizeof(ICCVID_Info));
999 if( info )
1000 {
1001 info->dwMagic = ICCVID_MAGIC;
1002 info->cvinfo = NULL;
1003 }
1004 return (LRESULT) info;
1005 }
1006
1007 case DRV_CLOSE:
1008 return ICCVID_Close( info );
1009
1010 case ICM_GETINFO:
1011 return ICCVID_GetInfo( info, (ICINFO *)lParam1, (DWORD)lParam2 );
1012
1014 return ICCVID_DecompressQuery( info, (LPBITMAPINFO) lParam1,
1015 (LPBITMAPINFO) lParam2 );
1017 return ICCVID_DecompressGetFormat( info, (LPBITMAPINFO) lParam1,
1018 (LPBITMAPINFO) lParam2 );
1020 return ICCVID_DecompressBegin( info, (LPBITMAPINFO) lParam1,
1021 (LPBITMAPINFO) lParam2 );
1022 case ICM_DECOMPRESS:
1023 return ICCVID_Decompress( info, (ICDECOMPRESS*) lParam1,
1024 (DWORD) lParam2 );
1025 case ICM_DECOMPRESSEX:
1026 return ICCVID_DecompressEx( info, (ICDECOMPRESSEX*) lParam1,
1027 (DWORD) lParam2 );
1028
1029 case ICM_DECOMPRESS_END:
1030 return ICCVID_DecompressEnd( info );
1031
1032 case ICM_COMPRESS_QUERY:
1033 FIXME("compression not implemented\n");
1034 return ICERR_BADFORMAT;
1035
1036 case ICM_CONFIGURE:
1037 return ICERR_UNSUPPORTED;
1038
1039 default:
1040 FIXME("Unknown message: %04x %Id %Id\n", msg, lParam1, lParam2);
1041 }
1042 return ICERR_UNSUPPORTED;
1043}
1044
1046{
1047 TRACE("(%p,%ld,%p)\n", hModule, dwReason, lpReserved);
1048
1049 switch (dwReason)
1050 {
1051 case DLL_PROCESS_ATTACH:
1054 break;
1055 }
1056 return TRUE;
1057}
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define IDS_DESCRIPTION
Definition: resource.h:4
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
DWORD dwReason
Definition: misc.cpp:135
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDS_NAME
Definition: resource.h:90
HMODULE hModule
Definition: animate.c:44
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
ULONG RGBQUAD
Definition: precomp.h:47
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const GLdouble * v
Definition: gl.h:2040
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizei stride
Definition: glext.h:5848
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
GLenum GLint GLuint mask
Definition: glext.h:6028
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLint limit
Definition: glext.h:10326
GLenum mode
Definition: glext.h:6217
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint in
Definition: glext.h:9616
GLbitfield flags
Definition: glext.h:7161
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLenum const GLvoid * addr
Definition: glext.h:9621
GLboolean GLboolean g
Definition: glext.h:6204
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
Definition: glfuncs.h:52
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
Definition: glfuncs.h:248
unsigned int UINT
Definition: sysinfo.c:13
static HINSTANCE ICCVID_hModule
Definition: iccvid.c:57
static LRESULT ICCVID_Decompress(ICCVID_Info *info, ICDECOMPRESS *icd, DWORD size)
Definition: iccvid.c:880
#define ICCVID_MAGIC
Definition: iccvid.c:59
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)
Definition: iccvid.c:177
static void read_codebook(cvid_codebook *c, int mode)
Definition: iccvid.c:97
void(* fn_cvid_v1)(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb)
Definition: iccvid.c:382
static int get_stride(int width, int depth)
Definition: iccvid.c:171
#define MAKECOLOUR32(r, g, b)
Definition: iccvid.c:144
static void free_cvinfo(cinepak_info *cvinfo)
Definition: iccvid.c:370
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)
Definition: iccvid.c:384
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)
Definition: iccvid.c:277
static LRESULT ICCVID_DecompressGetFormat(ICCVID_Info *info, LPBITMAPINFO in, LPBITMAPINFO out)
Definition: iccvid.c:820
static void cvid_v1_16(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb)
Definition: iccvid.c:254
static int ICCVID_CheckMask(RGBQUAD bmiColors[3], COLORREF redMask, COLORREF blueMask, COLORREF greenMask)
Definition: iccvid.c:755
static LRESULT ICCVID_DecompressBegin(ICCVID_Info *info, LPBITMAPINFO in, LPBITMAPINFO out)
Definition: iccvid.c:844
static void cvid_v1_15(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb)
Definition: iccvid.c:300
#define MAKECOLOUR15(r, g, b)
Definition: iccvid.c:147
BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
Definition: iccvid.c:1045
static cinepak_info * decode_cinepak_init(void)
Definition: iccvid.c:350
#define get_byte()
Definition: iccvid.c:88
static LRESULT ICCVID_DecompressEx(ICCVID_Info *info, ICDECOMPRESSEX *icd, DWORD size)
Definition: iccvid.c:905
#define get_word()
Definition: iccvid.c:90
static unsigned char * in_buffer
Definition: iccvid.c:86
static void decode_cinepak(cinepak_info *cvinfo, unsigned char *buf, int size, unsigned char *output, unsigned int out_width, unsigned int out_height, int bit_per_pixel, BOOL inverted)
Definition: iccvid.c:402
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)
Definition: iccvid.c:227
#define compare_fourcc(fcc1, fcc2)
Definition: iccvid.c:60
static LRESULT ICCVID_DecompressEnd(ICCVID_Info *info)
Definition: iccvid.c:961
#define MAKECOLOUR16(r, g, b)
Definition: iccvid.c:146
#define get_long()
Definition: iccvid.c:92
static void cvid_v1_32(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb)
Definition: iccvid.c:150
static LRESULT ICCVID_Close(ICCVID_Info *info)
Definition: iccvid.c:932
static long get_addr(BOOL inverted, unsigned long x, unsigned long y, int frm_stride, int bpp, unsigned int out_height)
Definition: iccvid.c:134
static unsigned char uiclip[1024]
Definition: iccvid.c:86
LRESULT WINAPI ICCVID_DriverProc(DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg, LPARAM lParam1, LPARAM lParam2)
Definition: iccvid.c:971
static unsigned char * uiclp
Definition: iccvid.c:86
static LRESULT ICCVID_DecompressQuery(ICCVID_Info *info, LPBITMAPINFO in, LPBITMAPINFO out)
Definition: iccvid.c:771
struct _ICCVID_Info ICCVID_Info
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)
Definition: iccvid.c:323
static void cvid_v1_24(unsigned char *vptr, unsigned char *limit, int stride, BOOL inverted, cvid_codebook *cb)
Definition: iccvid.c:201
static LRESULT ICCVID_GetInfo(ICCVID_Info *info, ICINFO *icinfo, DWORD dwSize)
Definition: iccvid.c:942
#define MAX_STRIPS
Definition: iccvid.c:61
static void ICCVID_dump_BITMAPINFO(const BITMAPINFO *bmi)
Definition: iccvid.c:740
#define skip_byte()
Definition: iccvid.c:89
#define DRV_LOAD(x)
GLint x0
Definition: linetemp.h:95
GLint y0
Definition: linetemp.h:96
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define BI_BITFIELDS
Definition: mmreg.h:507
#define ICTYPE_VIDEO
Definition: mmreg.h:531
#define DRV_CLOSE
Definition: mmsystem.h:122
#define DRV_ENABLE
Definition: mmsystem.h:120
#define DRV_OPEN
Definition: mmsystem.h:121
#define DRV_FREE
Definition: mmsystem.h:124
#define DRV_DISABLE
Definition: mmsystem.h:123
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static float int float int float int float y3
Definition: server.c:79
long LONG
Definition: pedump.c:60
static __inline const char * debugstr_fourcc(unsigned int cc)
Definition: debug.h:397
#define LoadStringW
Definition: utils.h:64
#define TRACE(s)
Definition: solgame.cpp:4
DWORD biSizeImage
Definition: amvideo.idl:36
LPBITMAPINFOHEADER lpbiSrc
Definition: vfw.h:344
LPVOID lpDst
Definition: vfw.h:347
LPVOID lpSrc
Definition: vfw.h:345
LPBITMAPINFOHEADER lpbiDst
Definition: vfw.h:346
LPBITMAPINFOHEADER lpbiInput
Definition: vfw.h:335
LPBITMAPINFOHEADER lpbiOutput
Definition: vfw.h:337
Definition: vfw.h:280
DWORD dwSize
Definition: vfw.h:281
DWORD dwVersionICM
Definition: vfw.h:286
DWORD fccType
Definition: vfw.h:282
DWORD dwFlags
Definition: vfw.h:284
DWORD dwVersion
Definition: vfw.h:285
DWORD fccHandler
Definition: vfw.h:283
WCHAR szDescription[128]
Definition: vfw.h:291
WCHAR szName[16]
Definition: vfw.h:290
int bits_per_pixel
Definition: iccvid.c:80
DWORD dwMagic
Definition: iccvid.c:79
cinepak_info * cvinfo
Definition: iccvid.c:81
cvid_codebook * v4_codebook[MAX_STRIPS]
Definition: iccvid.c:72
unsigned int strip_num
Definition: iccvid.c:74
cvid_codebook * v1_codebook[MAX_STRIPS]
Definition: iccvid.c:73
char u
Definition: iccvid.c:67
unsigned char y0
Definition: iccvid.c:66
USHORT biBitCount
Definition: precomp.h:34
ULONG biCompression
Definition: precomp.h:35
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1922
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define BI_RGB
Definition: uefivid.c:46
#define ICVERSION
Definition: vfw.h:45
#define ICERR_BADPARAM
Definition: vfw.h:61
#define ICERR_OK
Definition: vfw.h:50
#define ICM_COMPRESS_QUERY
Definition: vfw.h:101
#define ICM_DECOMPRESS_QUERY
Definition: vfw.h:107
#define ICERR_UNSUPPORTED
Definition: vfw.h:56
#define ICM_GETINFO
Definition: vfw.h:82
#define ICM_DECOMPRESSEX
Definition: vfw.h:140
#define ICERR_BADFORMAT
Definition: vfw.h:57
#define ICM_DECOMPRESS_GET_FORMAT
Definition: vfw.h:106
#define ICM_CONFIGURE
Definition: vfw.h:84
#define ICM_DECOMPRESS_END
Definition: vfw.h:110
#define ICM_DECOMPRESS_BEGIN
Definition: vfw.h:108
#define ICM_DECOMPRESS
Definition: vfw.h:109
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3711
DWORD COLORREF
Definition: windef.h:100
#define WINAPI
Definition: msvc.h:6
_In_ DWORD _In_ int _In_ int _In_opt_ LPNLSVERSIONINFO _In_opt_ LPVOID lpReserved
Definition: winnls.h:1279
ULONG bpp[]
Definition: xlate.c:19