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