annotate libmpcodecs/vd_qtvideo.c @ 9380:edfe34c5405d

linux->osdep
author arpi
date Sun, 09 Feb 2003 20:18:23 +0000
parents 12d19b01d4c6
children a4444e7ee56a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
1 #include <stdio.h>
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
2 #include <stdlib.h>
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
3
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
4 #include "config.h"
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
5
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
6 #ifdef USE_QTX_CODECS
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
7
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
8 #include "mp_msg.h"
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
9 #include "vd_internal.h"
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
10
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
11 #ifdef USE_WIN32DLL
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
12 #include "ldt_keeper.h"
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
13 #endif
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
14
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
15 static vd_info_t info = {
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
16 "Quicktime Video decoder",
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
17 "qtvideo",
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
18 "A'rpi",
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
19 "Faust3",
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
20 "win32"
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
21 };
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
22
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
23 LIBVD_EXTERN(qtvideo)
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
24
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
25 #include "../bswap.h"
8270
badd24741e4a loader support
arpi
parents: 8188
diff changeset
26 #include "qtx/qtxsdk/components.h"
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
27
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
28 //#include "wine/windef.h"
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
29
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
30 HMODULE WINAPI LoadLibraryA(LPCSTR);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
31 FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
32 int WINAPI FreeLibrary(HMODULE);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
33
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
34 //static ComponentDescription desc; // for FindNextComponent()
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
35 static ComponentInstance ci=NULL; // codec handle
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
36 //static CodecInfo cinfo; // for ImageCodecGetCodecInfo()
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
37 //Component prev=NULL;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
38 //ComponentResult cres; //
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
39 static CodecCapabilities codeccap; // for decpar
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
40 static CodecDecompressParams decpar; // for ImageCodecPreDecompress()
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
41 //static ImageSubCodecDecompressCapabilities icap; // for ImageCodecInitialize()
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
42 static Rect OutBufferRect; //the dimensions of our GWorld
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
43
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
44 static GWorldPtr OutBufferGWorld = NULL;//a GWorld is some kind of description for a drawing environment
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
45 static ImageDescriptionHandle framedescHandle;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
46 //static HINSTANCE qtml_dll;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
47 static HMODULE handler;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
48
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
49 static Component (*FindNextComponent)(Component prev,ComponentDescription* desc);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
50 static OSErr (*GetComponentInfo)(Component prev,ComponentDescription* desc,Handle h1,Handle h2,Handle h3);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
51 static long (*CountComponents)(ComponentDescription* desc);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
52 static OSErr (*InitializeQTML)(long flags);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
53 static OSErr (*EnterMovies)(void);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
54 static ComponentInstance (*OpenComponent)(Component c);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
55 static ComponentResult (*ImageCodecInitialize)(ComponentInstance ci,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
56 ImageSubCodecDecompressCapabilities * cap);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
57 static ComponentResult (*ImageCodecBeginBand)(ComponentInstance ci,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
58 CodecDecompressParams * params,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
59 ImageSubCodecDecompressRecord * drp,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
60 long flags);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
61 static ComponentResult (*ImageCodecDrawBand)(ComponentInstance ci,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
62 ImageSubCodecDecompressRecord * drp);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
63 static ComponentResult (*ImageCodecEndBand)(ComponentInstance ci,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
64 ImageSubCodecDecompressRecord * drp,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
65 OSErr result,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
66 long flags);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
67 static ComponentResult (*ImageCodecGetCodecInfo)(ComponentInstance ci,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
68 CodecInfo * info);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
69 static ComponentResult (*ImageCodecPreDecompress)(ComponentInstance ci,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
70 CodecDecompressParams * params);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
71 static ComponentResult (*ImageCodecBandDecompress)(ComponentInstance ci,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
72 CodecDecompressParams * params);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
73 static PixMapHandle (*GetGWorldPixMap)(GWorldPtr offscreenGWorld);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
74 static OSErr (*QTNewGWorldFromPtr)(GWorldPtr *gw,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
75 OSType pixelFormat,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
76 const Rect *boundsRect,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
77 CTabHandle cTable,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
78 /*GDHandle*/void* aGDevice, //unused anyway
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
79 GWorldFlags flags,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
80 void *baseAddr,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
81 long rowBytes);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
82 static OSErr (*NewHandleClear)(Size byteCount);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
83
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
84
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
85 // to set/get/query special features/parameters
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
86 static int control(sh_video_t *sh,int cmd,void* arg,...){
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
87 return CONTROL_UNKNOWN;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
88 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
89
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
90 static int codec_inited=0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
91
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
92 // init driver
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
93 static int init(sh_video_t *sh){
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
94 long result = 1;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
95 ComponentResult cres;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
96 ComponentDescription desc;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
97 Component prev=NULL;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
98 CodecInfo cinfo; // for ImageCodecGetCodecInfo()
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
99 ImageSubCodecDecompressCapabilities icap; // for ImageCodecInitialize()
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
100
8270
badd24741e4a loader support
arpi
parents: 8188
diff changeset
101 #ifdef USE_WIN32DLL
badd24741e4a loader support
arpi
parents: 8188
diff changeset
102 Setup_LDT_Keeper();
badd24741e4a loader support
arpi
parents: 8188
diff changeset
103 #endif
badd24741e4a loader support
arpi
parents: 8188
diff changeset
104
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
105 handler = LoadLibraryA("qtmlClient.dll");
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
106
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
107 InitializeQTML = (OSErr (*)(long))GetProcAddress(handler, "InitializeQTML");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
108 EnterMovies = (OSErr (*)(void))GetProcAddress(handler, "EnterMovies");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
109 FindNextComponent = (Component (*)(Component,ComponentDescription*))GetProcAddress(handler, "FindNextComponent");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
110 CountComponents = (long (*)(ComponentDescription*))GetProcAddress(handler, "CountComponents");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
111 GetComponentInfo = (OSErr (*)(Component,ComponentDescription*,Handle,Handle,Handle))GetProcAddress(handler, "GetComponentInfo");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
112 OpenComponent = (ComponentInstance (*)(Component))GetProcAddress(handler, "OpenComponent");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
113 ImageCodecInitialize = (ComponentResult (*)(ComponentInstance,ImageSubCodecDecompressCapabilities *))GetProcAddress(handler, "ImageCodecInitialize");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
114 ImageCodecGetCodecInfo = (ComponentResult (*)(ComponentInstance,CodecInfo *))GetProcAddress(handler, "ImageCodecGetCodecInfo");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
115 ImageCodecBeginBand = (ComponentResult (*)(ComponentInstance,CodecDecompressParams *,ImageSubCodecDecompressRecord *,long))GetProcAddress(handler, "ImageCodecBeginBand");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
116 ImageCodecPreDecompress = (ComponentResult (*)(ComponentInstance,CodecDecompressParams *))GetProcAddress(handler, "ImageCodecPreDecompress");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
117 ImageCodecBandDecompress = (ComponentResult (*)(ComponentInstance,CodecDecompressParams *))GetProcAddress(handler, "ImageCodecBandDecompress");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
118 GetGWorldPixMap = (PixMapHandle (*)(GWorldPtr))GetProcAddress(handler, "GetGWorldPixMap");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
119 QTNewGWorldFromPtr = (OSErr(*)(GWorldPtr *,OSType,const Rect *,CTabHandle,void*,GWorldFlags,void *,long))GetProcAddress(handler, "QTNewGWorldFromPtr");
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
120 NewHandleClear = (OSErr(*)(Size))GetProcAddress(handler, "NewHandleClear");
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
121 // = GetProcAddress(handler, "");
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
122
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
123 if(!InitializeQTML || !EnterMovies || !FindNextComponent || !ImageCodecBandDecompress){
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
124 printf("invalid qt DLL!\n");
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
125 return 0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
126 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
127
8162
98951b7331e1 no need to EnterMovies(), do minimal InitializeQTML only
arpi
parents: 8160
diff changeset
128 result=InitializeQTML(6+16);
98951b7331e1 no need to EnterMovies(), do minimal InitializeQTML only
arpi
parents: 8160
diff changeset
129 // result=InitializeQTML(0);
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
130 printf("InitializeQTML returned %i\n",result);
8162
98951b7331e1 no need to EnterMovies(), do minimal InitializeQTML only
arpi
parents: 8160
diff changeset
131 // result=EnterMovies();
98951b7331e1 no need to EnterMovies(), do minimal InitializeQTML only
arpi
parents: 8160
diff changeset
132 // printf("EnterMovies->%d\n",result);
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
133
8428
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
134 #if 0
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
135 memset(&desc,0,sizeof(desc));
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
136 while((prev=FindNextComponent(prev,&desc))){
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
137 ComponentDescription desc2;
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
138 unsigned char* c1=&desc2.componentType;
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
139 unsigned char* c2=&desc2.componentSubType;
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
140 memset(&desc2,0,sizeof(desc2));
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
141 // printf("juhee %p (%p)\n",prev,&desc);
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
142 GetComponentInfo(prev,&desc2,NULL,NULL,NULL);
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
143 printf("DESC: %c%c%c%c/%c%c%c%c [0x%X/0x%X] 0x%X\n",
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
144 c1[3],c1[2],c1[1],c1[0],
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
145 c2[3],c2[2],c2[1],c2[0],
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
146 desc2.componentType,desc2.componentSubType,
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
147 desc2.componentFlags);
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
148 }
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
149 #endif
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
150
2090c9d9bb03 moved component lister up, as it messes up 'desc'
arpi
parents: 8321
diff changeset
151
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
152 memset(&desc,0,sizeof(desc));
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
153 desc.componentType= (((unsigned char)'i')<<24)|
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
154 (((unsigned char)'m')<<16)|
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
155 (((unsigned char)'d')<<8)|
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
156 (((unsigned char)'c'));
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
157 #if 0
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
158 desc.componentSubType=
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
159 (((unsigned char)'S'<<24))|
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
160 (((unsigned char)'V')<<16)|
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
161 (((unsigned char)'Q')<<8)|
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
162 (((unsigned char)'3'));
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
163 #else
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
164 desc.componentSubType = bswap_32(sh->format);
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
165 #endif
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
166 desc.componentManufacturer=0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
167 desc.componentFlags=0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
168 desc.componentFlagsMask=0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
169
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
170 printf("Count = %d\n",CountComponents(&desc));
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
171 prev=FindNextComponent(NULL,&desc);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
172 if(!prev){
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
173 printf("Cannot find requested component\n");
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
174 return(0);
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
175 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
176 printf("Found it! ID = 0x%X\n",prev);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
177
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
178 ci=OpenComponent(prev);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
179 printf("ci=%p\n",ci);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
180
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
181 memset(&icap,0,sizeof(icap));
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
182 cres=ImageCodecInitialize(ci,&icap);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
183 printf("ImageCodecInitialize->%p size=%d (%d)\n",cres,icap.recordSize,icap.decompressRecordSize);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
184
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
185 memset(&cinfo,0,sizeof(cinfo));
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
186 cres=ImageCodecGetCodecInfo(ci,&cinfo);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
187 printf("Flags: compr: 0x%X decomp: 0x%X format: 0x%X\n",
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
188 cinfo.compressFlags, cinfo.decompressFlags, cinfo.formatFlags);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
189 printf("Codec name: %.*s\n",((unsigned char*)&cinfo.typeName)[0],
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
190 ((unsigned char*)&cinfo.typeName)+1);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
191
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
192 //make a yuy2 gworld
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
193 OutBufferRect.top=0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
194 OutBufferRect.left=0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
195 OutBufferRect.right=sh->disp_w;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
196 OutBufferRect.bottom=sh->disp_h;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
197
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
198 //Fill the imagedescription for our SVQ3 frame
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
199 //we can probably get this from Demuxer
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
200 #if 0
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
201 framedescHandle=(ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription)+200);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
202 printf("framedescHandle=%p *p=%p\n",framedescHandle,*framedescHandle);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
203 { FILE* f=fopen("/root/.wine/fake_windows/IDesc","r");
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
204 if(!f) printf("filenot found: IDesc\n");
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
205 fread(*framedescHandle,sizeof(ImageDescription)+200,1,f);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
206 fclose(f);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
207 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
208 #else
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents: 8451
diff changeset
209 if(!sh->ImageDesc) sh->ImageDesc=(sh->bih+1); // hack for SVQ3-in-AVI
8301
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
210 printf("ImageDescription size: %d\n",((ImageDescription*)(sh->ImageDesc))->idSize);
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
211 framedescHandle=(ImageDescriptionHandle)NewHandleClear(((ImageDescription*)(sh->ImageDesc))->idSize);
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
212 memcpy(*framedescHandle,sh->ImageDesc,((ImageDescription*)(sh->ImageDesc))->idSize);
8471
0b7839c27be9 Sorenson 1/3 encoding just for fun :)
arpi
parents: 8451
diff changeset
213 dump_ImageDescription(*framedescHandle);
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
214 #endif
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
215 //Find codecscomponent for video decompression
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
216 // result = FindCodec ('SVQ1',anyCodec,&compressor,&decompressor );
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
217 // printf("FindCodec SVQ1 returned:%i compressor: 0x%X decompressor: 0x%X\n",result,compressor,decompressor);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
218
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
219 sh->context = kYUVSPixelFormat;
8301
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
220 #if 1
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
221 {
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
222 int imgfmt = sh->codec->outfmt[sh->outfmtidx];
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
223 int qt_imgfmt;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
224 switch(imgfmt)
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
225 {
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
226 case IMGFMT_YUY2:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
227 qt_imgfmt = kYUVSPixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
228 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
229 case IMGFMT_YVU9:
8301
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
230 qt_imgfmt = 0x73797639; //kYVU9PixelFormat;
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
231 break;
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
232 case IMGFMT_YV12:
d867439e3940 - fixed 10l bug (imagedesc handle allocation)
arpi
parents: 8282
diff changeset
233 qt_imgfmt = 0x79343230;
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
234 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
235 case IMGFMT_UYVY:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
236 qt_imgfmt = kUYVY422PixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
237 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
238 case IMGFMT_YVYU:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
239 qt_imgfmt = kYVYU422PixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
240 imgfmt = IMGFMT_YUY2;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
241 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
242 case IMGFMT_RGB16:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
243 qt_imgfmt = k16LE555PixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
244 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
245 case IMGFMT_BGR24:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
246 qt_imgfmt = k24BGRPixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
247 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
248 case IMGFMT_BGR32:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
249 qt_imgfmt = k32BGRAPixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
250 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
251 case IMGFMT_RGB32:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
252 qt_imgfmt = k32RGBAPixelFormat;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
253 break;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
254 default:
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
255 printf("Unknown requested csp\n");
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
256 return(0);
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
257 }
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
258 printf("imgfmt: %s qt_imgfmt: %.4s\n", vo_format_name(imgfmt), &qt_imgfmt);
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
259 sh->context = qt_imgfmt;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
260 if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,imgfmt)) return 0;
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
261 }
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
262 #else
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
263 if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2)) return 0;
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
264 #endif
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
265
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
266 return 1;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
267 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
268
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
269 // uninit driver
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
270 static void uninit(sh_video_t *sh){
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
271 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
272
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
273 // decode a frame
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
274 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
275 long result = 1;
8321
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
276 int i;
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
277 mp_image_t* mpi;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
278 ComponentResult cres;
8473
12d19b01d4c6 handle mencoder's 0-byte 'skipped frames'
arpi
parents: 8471
diff changeset
279
12d19b01d4c6 handle mencoder's 0-byte 'skipped frames'
arpi
parents: 8471
diff changeset
280 if(len<=0) return NULL; // skipped frame
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
281
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
282 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_STATIC, MP_IMGFLAG_PRESERVE,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
283 sh->disp_w, sh->disp_h);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
284 if(!mpi) return NULL;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
285
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
286 decpar.data = (char*)data;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
287 decpar.bufferSize = len;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
288 (**framedescHandle).dataSize=len;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
289
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
290 if(!codec_inited){
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
291 result = QTNewGWorldFromPtr(
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
292 &OutBufferGWorld,
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
293 // kYUVSPixelFormat, //pixel format of new GWorld == YUY2
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
294 sh->context,
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
295 &OutBufferRect, //we should benchmark if yvu9 is faster for svq3, too
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
296 0,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
297 0,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
298 0,
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
299 mpi->planes[0],
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
300 mpi->stride[0]);
8282
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
301 printf("NewGWorldFromPtr returned:%d\n",65536-(result&0xffff));
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
302 // if (65536-(result&0xFFFF) != 10000)
b2c8b627d598 some fixes
alex
parents: 8270
diff changeset
303 // return NULL;
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
304
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
305 // printf("IDesc=%d\n",sizeof(ImageDescription));
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
306
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
307 decpar.imageDescription = framedescHandle;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
308 decpar.startLine=0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
309 decpar.stopLine=(**framedescHandle).height;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
310 decpar.frameNumber = 1; //1
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
311 // decpar.conditionFlags=0xFFD; // first
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
312 // decpar.callerFlags=0x2001; // first
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
313 decpar.matrixFlags = 0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
314 decpar.matrixType = 0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
315 decpar.matrix = 0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
316 decpar.capabilities=&codeccap;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
317 // decpar.accuracy = 0x1680000; //codecNormalQuality;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
318 decpar.accuracy = codecNormalQuality;
8431
e0a26ef29fc3 we don't need to pass gworld :)
arpi
parents: 8430
diff changeset
319 // decpar.port = OutBufferGWorld;
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
320 // decpar.preferredOffscreenPixelSize=17207;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
321
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
322 // decpar.sequenceID=malloc(1000);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
323 // memset(decpar.sequenceID,0,1000);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
324
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
325 // SrcRect.top=17207;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
326 // SrcRect.left=0;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
327 // SrcRect.right=0;//image_width;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
328 // SrcRect.bottom=0;//image_height;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
329
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
330 // decpar.srcRect = SrcRect;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
331 decpar.srcRect = OutBufferRect;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
332
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
333 decpar.transferMode = srcCopy;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
334 decpar.dstPixMap = **GetGWorldPixMap( OutBufferGWorld);//destPixmap;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
335
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
336 cres=ImageCodecPreDecompress(ci,&decpar);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
337 printf("ImageCodecPreDecompress cres=0x%X\n",cres);
8430
e3804a802aac print list of supported output colorspaces
arpi
parents: 8428
diff changeset
338
e3804a802aac print list of supported output colorspaces
arpi
parents: 8428
diff changeset
339 if(decpar.wantedDestinationPixelTypes)
e3804a802aac print list of supported output colorspaces
arpi
parents: 8428
diff changeset
340 { OSType *p=*(decpar.wantedDestinationPixelTypes);
e3804a802aac print list of supported output colorspaces
arpi
parents: 8428
diff changeset
341 if(p) while(*p){
e3804a802aac print list of supported output colorspaces
arpi
parents: 8428
diff changeset
342 printf("supported csp: 0x%08X %.4s\n",*p,p);
e3804a802aac print list of supported output colorspaces
arpi
parents: 8428
diff changeset
343 ++p;
e3804a802aac print list of supported output colorspaces
arpi
parents: 8428
diff changeset
344 }
e3804a802aac print list of supported output colorspaces
arpi
parents: 8428
diff changeset
345 }
e3804a802aac print list of supported output colorspaces
arpi
parents: 8428
diff changeset
346
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
347
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
348 // decpar.conditionFlags=0x10FFF; // first
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
349 // decpar.preferredOffscreenPixelSize=17207;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
350
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
351 // decpar.conditionFlags=0x10FFD; // first
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
352
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
353 // cres=ImageCodecPreDecompress(ci,&decpar);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
354 // printf("ImageCodecPreDecompress cres=0x%X\n",cres);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
355
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
356
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
357 codec_inited=1;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
358 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
359
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
360 #if 0
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
361 if(decpar.frameNumber==124){
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
362 decpar.frameNumber=1;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
363 cres=ImageCodecPreDecompress(ci,&decpar);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
364 printf("ImageCodecPreDecompress cres=0x%X\n",cres);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
365 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
366 #endif
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
367
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
368 cres=ImageCodecBandDecompress(ci,&decpar);
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
369
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
370 ++decpar.frameNumber;
8321
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
371
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
372 if(cres&0xFFFF){
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
373 printf("ImageCodecBandDecompress cres=0x%X (-0x%X) %d\n",cres,-cres,cres);
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
374 return NULL;
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
375 }
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
376
8321
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
377 // for(i=0;i<8;i++)
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
378 // printf("img_base[%d]=%p\n",i,((int*)decpar.dstPixMap.baseAddr)[i]);
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
379
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
380 if((int)sh->context==0x73797639){ // Sorenson 16-bit YUV -> std YVU9
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
381
8451
fb88ccbc5ccc compiler warning fixes
arpi
parents: 8431
diff changeset
382 short *src0=(short *)((char*)decpar.dstPixMap.baseAddr+0x20);
8321
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
383
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
384 for(i=0;i<mpi->h;i++){
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
385 int x;
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
386 unsigned char* dst=mpi->planes[0]+i*mpi->stride[0];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
387 unsigned short* src=src0+i*((mpi->w+15)&(~15));
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
388 for(x=0;x<mpi->w;x++) dst[x]=src[x];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
389 }
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
390 src0+=((mpi->w+15)&(~15))*((mpi->h+15)&(~15));
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
391 for(i=0;i<mpi->h/4;i++){
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
392 int x;
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
393 unsigned char* dst=mpi->planes[1]+i*mpi->stride[1];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
394 unsigned short* src=src0+i*(((mpi->w+63)&(~63))/4);
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
395 for(x=0;x<mpi->w/4;x++) dst[x]=src[x];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
396 src+=((mpi->w+63)&(~63))/4;
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
397 }
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
398 src0+=(((mpi->w+63)&(~63))/4)*(((mpi->h+63)&(~63))/4);
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
399 for(i=0;i<mpi->h/4;i++){
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
400 int x;
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
401 unsigned char* dst=mpi->planes[2]+i*mpi->stride[2];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
402 unsigned short* src=src0+i*(((mpi->w+63)&(~63))/4);
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
403 for(x=0;x<mpi->w/4;x++) dst[x]=src[x];
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
404 src+=((mpi->w+63)&(~63))/4;
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
405 }
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
406
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
407 }
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
408
ca24204fb547 SVQ1 support (ugly hack... - really we need 'syuv' support in swscaler :))
arpi
parents: 8301
diff changeset
409
8160
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
410 return mpi;
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
411 }
2be30233c532 qt video dll codecs support
arpi
parents:
diff changeset
412 #endif