169
|
1 #include <stdio.h>
|
|
2 #include <stdlib.h>
|
25584
|
3 #include <string.h>
|
169
|
4
|
25583
|
5 #include "wine/mmreg.h"
|
|
6 #include "wine/vfw.h"
|
|
7
|
169
|
8 #include "formats.h"
|
|
9 #include "com.h"
|
|
10
|
|
11 #include "DS_VideoDec.h"
|
|
12
|
|
13 int main(int argc,char* argv[]){
|
|
14 FILE *f;
|
|
15 BITMAPINFOHEADER bih;
|
|
16 int len;
|
|
17 char *src;
|
|
18 char *dst=0;
|
|
19 GUID CLSID_DivxDecompressorCF={0x82CCd3E0, 0xF71A, 0x11D0,
|
|
20 { 0x9f, 0xe5, 0x00, 0x60, 0x97, 0x78, 0xaa, 0xaa}};
|
|
21
|
|
22 f=fopen("test.divx","rb");
|
|
23
|
|
24 fread(&bih,sizeof(BITMAPINFOHEADER),1,f);
|
170
|
25 printf("frame dim: %d x %d \n",(int)bih.biWidth,(int)bih.biHeight);
|
169
|
26
|
18878
|
27 src=malloc(512000);
|
169
|
28 len=fread(src,1,512000,f);
|
|
29 printf("frame len = %d\n",len);
|
|
30
|
|
31 DS_VideoDecoder_Open("divx_c32.ax", &CLSID_DivxDecompressorCF, &bih, 0, &dst);
|
|
32
|
|
33 // DS_VideoDecoder_SetDestFmt(16,fccYUY2);
|
|
34 DS_VideoDecoder_SetDestFmt(24,0);
|
|
35
|
184
|
36 printf("DivX setting result = %d\n", DS_SetAttr_DivX("Quality",4) );
|
|
37
|
169
|
38 DS_VideoDecoder_Start();
|
|
39
|
|
40 printf("DivX setting result = %d\n", DS_SetValue_DivX("Brightness",60) );
|
|
41
|
|
42 DS_VideoDecoder_DecodeFrame(src, len, 1, 1);
|
|
43
|
|
44 #if 0
|
|
45 f2=fopen("test.yuy2","wb");
|
|
46 fwrite(dst,bih.biWidth*bih.biHeight*2,1,f2);
|
|
47 fclose(f2);
|
|
48 #endif
|
|
49
|
|
50 { unsigned char raw_head[32];
|
|
51 FILE *f=fopen("test.raw","wb");
|
|
52
|
|
53 strcpy((char*)raw_head,"mhwanh");
|
|
54 raw_head[7]=4;
|
|
55 raw_head[8]=bih.biWidth>>8;
|
|
56 raw_head[9]=bih.biWidth&0xFF;
|
|
57 raw_head[10]=bih.biHeight>>8;
|
|
58 raw_head[11]=bih.biHeight&0xFF;
|
|
59 raw_head[12]=raw_head[13]=0; // 24bit
|
|
60 raw_head[14]=1;raw_head[15]=0x2C;
|
|
61 raw_head[16]=1;raw_head[17]=0x2C;
|
|
62 memset(raw_head+18,0,32-18);
|
|
63 fwrite(raw_head,32,1,f);
|
|
64
|
|
65 fwrite(dst,bih.biWidth*bih.biHeight*3,1,f);
|
|
66 fclose(f);
|
|
67 }
|
|
68
|
|
69
|
|
70 return 0;
|
|
71 }
|