Mercurial > mplayer.hg
annotate xacodec.c @ 6965:f8ea0af8edb0
optimization
author | michael |
---|---|
date | Sun, 11 Aug 2002 10:12:15 +0000 |
parents | 561de0125a61 |
children | b1397d95471f |
rev | line source |
---|---|
2372 | 1 /* |
2388 | 2 xacodec.c -- XAnim Video Codec DLL support |
2372 | 3 |
4 (C) 2001 Alex Beregszaszi <alex@naxine.org> | |
2388 | 5 and Arpad Gereoffy <arpi@thot.banki.hu> |
2372 | 6 */ |
7 | |
8 #include <stdio.h> | |
2376 | 9 #include <stdlib.h> |
2659 | 10 #include <string.h> /* strerror */ |
2376 | 11 |
5282
a5e0d4c469e0
dlfcn.h shouldn't be included if XANIM support disabled
arpi
parents:
4699
diff
changeset
|
12 #include "config.h" |
a5e0d4c469e0
dlfcn.h shouldn't be included if XANIM support disabled
arpi
parents:
4699
diff
changeset
|
13 |
a5e0d4c469e0
dlfcn.h shouldn't be included if XANIM support disabled
arpi
parents:
4699
diff
changeset
|
14 #ifdef USE_XANIM |
a5e0d4c469e0
dlfcn.h shouldn't be included if XANIM support disabled
arpi
parents:
4699
diff
changeset
|
15 |
2409 | 16 #ifdef __FreeBSD__ |
17 #include <unistd.h> | |
18 #endif | |
19 | |
2372 | 20 #include <dlfcn.h> /* dlsym, dlopen, dlclose */ |
21 #include <stdarg.h> /* va_alist, va_start, va_end */ | |
22 #include <errno.h> /* strerror, errno */ | |
23 | |
2373 | 24 #include "mp_msg.h" |
2376 | 25 #include "bswap.h" |
2372 | 26 |
27 #include "stream.h" | |
28 #include "demuxer.h" | |
29 #include "codec-cfg.h" | |
30 #include "stheader.h" | |
2376 | 31 |
2897 | 32 #ifdef USE_LIBVO2 |
33 #include "libvo2/img_format.h" | |
34 #else | |
2372 | 35 #include "libvo/img_format.h" |
2897 | 36 #endif |
2659 | 37 #include "linux/timer.h" |
2372 | 38 #include "xacodec.h" |
39 | |
2793 | 40 #include "fastmemcpy.h" |
41 | |
2659 | 42 #if 0 |
2381 | 43 typedef char xaBYTE; |
44 typedef short xaSHORT; | |
45 typedef int xaLONG; | |
46 | |
47 typedef unsigned char xaUBYTE; | |
48 typedef unsigned short xaUSHORT; | |
49 typedef unsigned int xaULONG; | |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
50 #endif |
2381 | 51 |
52 #define xaFALSE 0 | |
53 #define xaTRUE 1 | |
54 | |
2372 | 55 #ifndef RTLD_NOW |
56 #define RLTD_NOW 2 | |
57 #endif | |
58 #ifndef RTLD_LAZY | |
59 #define RLTD_LAZY 1 | |
60 #endif | |
61 #ifndef RTLD_GLOBAL | |
62 #define RLTD_GLOBAL 256 | |
63 #endif | |
64 | |
2382 | 65 #define XA_CLOSE_FUNCS 5 |
66 int xa_close_func = 0; | |
67 | |
2372 | 68 typedef struct xacodec_driver |
69 { | |
70 XA_DEC_INFO *decinfo; | |
71 void *file_handler; | |
72 long (*iq_func)(XA_CODEC_HDR *codec_hdr); | |
73 unsigned int (*dec_func)(unsigned char *image, unsigned char *delta, | |
74 unsigned int dsize, XA_DEC_INFO *dec_info); | |
2382 | 75 void *close_func[XA_CLOSE_FUNCS]; |
2384 | 76 xacodec_image_t image; |
2372 | 77 } xacodec_driver_t; |
78 | |
79 xacodec_driver_t *xacodec_driver = NULL; | |
80 | |
81 /* Needed by XAnim DLLs */ | |
2659 | 82 void XA_Print(char *fmt, ...) |
2372 | 83 { |
84 va_list vallist; | |
85 char buf[1024]; | |
86 | |
87 va_start(vallist, fmt); | |
88 vsnprintf(buf, 1024, fmt, vallist); | |
2787 | 89 mp_msg(MSGT_XACODEC, MSGL_DBG2, "[xacodec] %s\n", buf); |
2372 | 90 va_end(vallist); |
2659 | 91 |
92 return; | |
2372 | 93 } |
94 | |
2382 | 95 /* 0 is no debug (needed by 3ivX) */ |
2388 | 96 long xa_debug = 0; |
2382 | 97 |
2659 | 98 void TheEnd1(char *err_mess) |
2372 | 99 { |
100 XA_Print("error: %s - exiting\n", err_mess); | |
101 xacodec_exit(); | |
2659 | 102 |
103 return; | |
2372 | 104 } |
2382 | 105 |
2659 | 106 void XA_Add_Func_To_Free_Chain(XA_ANIM_HDR *anim_hdr, void (*function)()) |
2382 | 107 { |
2388 | 108 // XA_Print("XA_Add_Func_To_Free_Chain('anim_hdr: %08x', 'function: %08x')", |
109 // anim_hdr, function); | |
2382 | 110 xacodec_driver->close_func[xa_close_func] = function; |
111 if (xa_close_func+1 < XA_CLOSE_FUNCS) | |
112 xa_close_func++; | |
2659 | 113 |
114 return; | |
2382 | 115 } |
2372 | 116 /* end of crap */ |
117 | |
118 /* load, init and query */ | |
119 int xacodec_init(char *filename, xacodec_driver_t *codec_driver) | |
120 { | |
121 void *(*what_the)(); | |
122 char *error; | |
123 XAVID_MOD_HDR *mod_hdr; | |
124 XAVID_FUNC_HDR *func; | |
125 int i; | |
126 | |
127 codec_driver->file_handler = dlopen(filename, RTLD_NOW|RTLD_GLOBAL); | |
128 if (!codec_driver->file_handler) | |
129 { | |
130 error = dlerror(); | |
131 if (error) | |
2659 | 132 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: failed to dlopen %s while %s\n", filename, error); |
2372 | 133 else |
2659 | 134 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: failed to dlopen %s\n", filename); |
2372 | 135 return(0); |
136 } | |
137 | |
138 what_the = dlsym(codec_driver->file_handler, "What_The"); | |
139 if ((error = dlerror()) != NULL) | |
140 { | |
2373 | 141 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: failed to init %s while %s\n", filename, error); |
2372 | 142 dlclose(codec_driver->file_handler); |
143 return(0); | |
144 } | |
145 | |
146 mod_hdr = what_the(); | |
147 if (!mod_hdr) | |
148 { | |
2659 | 149 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: initializer function failed in %s\n", filename); |
2372 | 150 dlclose(codec_driver->file_handler); |
151 return(0); | |
152 } | |
153 | |
2373 | 154 mp_msg(MSGT_DECVIDEO, MSGL_INFO, "=== XAnim Codec ===\n"); |
155 mp_msg(MSGT_DECVIDEO, MSGL_INFO, " Filename: %s (API revision: %x)\n", filename, mod_hdr->api_rev); | |
156 mp_msg(MSGT_DECVIDEO, MSGL_INFO, " Codec: %s. Rev: %s\n", mod_hdr->desc, mod_hdr->rev); | |
2372 | 157 if (mod_hdr->copyright) |
2373 | 158 mp_msg(MSGT_DECVIDEO, MSGL_INFO, " %s\n", mod_hdr->copyright); |
2372 | 159 if (mod_hdr->mod_author) |
2373 | 160 mp_msg(MSGT_DECVIDEO, MSGL_INFO, " Module Author(s): %s\n", mod_hdr->mod_author); |
2372 | 161 if (mod_hdr->authors) |
2373 | 162 mp_msg(MSGT_DECVIDEO, MSGL_INFO, " Codec Author(s): %s\n", mod_hdr->authors); |
2372 | 163 |
164 if (mod_hdr->api_rev > XAVID_API_REV) | |
165 { | |
2414 | 166 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supported api revision (%d) in %s\n", |
167 mod_hdr->api_rev, filename); | |
2372 | 168 dlclose(codec_driver->file_handler); |
169 return(0); | |
170 } | |
171 | |
172 func = mod_hdr->funcs; | |
173 if (!func) | |
174 { | |
2373 | 175 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: function table error in %s\n", filename); |
2372 | 176 dlclose(codec_driver->file_handler); |
177 return(0); | |
178 } | |
179 | |
2659 | 180 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "Exported functions by codec: [functable: 0x%08x entries: %d]\n", |
181 mod_hdr->funcs, mod_hdr->num_funcs); | |
2372 | 182 for (i = 0; i < mod_hdr->num_funcs; i++) |
183 { | |
2659 | 184 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, " %d: %d %d [iq:0x%08x d:0x%08x]\n", |
185 i, func[i].what, func[i].id, func[i].iq_func, func[i].dec_func); | |
2372 | 186 if (func[i].what & XAVID_AVI_QUERY) |
187 { | |
2659 | 188 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, " 0x%08x: avi init/query func (id: %d)\n", |
2372 | 189 func[i].iq_func, func[i].id); |
2659 | 190 codec_driver->iq_func = (void *)func[i].iq_func; |
2372 | 191 } |
192 if (func[i].what & XAVID_QT_QUERY) | |
193 { | |
2659 | 194 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, " 0x%08x: qt init/query func (id: %d)\n", |
2372 | 195 func[i].iq_func, func[i].id); |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
196 codec_driver->iq_func = (void *)func[i].iq_func; |
2372 | 197 } |
198 if (func[i].what & XAVID_DEC_FUNC) | |
199 { | |
2659 | 200 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, " 0x%08x: decoder func (init/query: 0x%08x) (id: %d)\n", |
2372 | 201 func[i].dec_func, func[i].iq_func, func[i].id); |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
202 codec_driver->dec_func = (void *)func[i].dec_func; |
2372 | 203 } |
204 } | |
205 return(1); | |
206 } | |
207 | |
208 int xacodec_query(xacodec_driver_t *codec_driver, XA_CODEC_HDR *codec_hdr) | |
209 { | |
210 long codec_ret; | |
211 | |
2682
77a237be71a6
fixed api revision and input fourcc handling (mappings are working too :)
alex
parents:
2659
diff
changeset
|
212 #if 0 |
77a237be71a6
fixed api revision and input fourcc handling (mappings are working too :)
alex
parents:
2659
diff
changeset
|
213 /* the brute one */ |
77a237be71a6
fixed api revision and input fourcc handling (mappings are working too :)
alex
parents:
2659
diff
changeset
|
214 if (codec_driver->dec_func) |
77a237be71a6
fixed api revision and input fourcc handling (mappings are working too :)
alex
parents:
2659
diff
changeset
|
215 { |
77a237be71a6
fixed api revision and input fourcc handling (mappings are working too :)
alex
parents:
2659
diff
changeset
|
216 codec_hdr->decoder = codec_driver->dec_func; |
77a237be71a6
fixed api revision and input fourcc handling (mappings are working too :)
alex
parents:
2659
diff
changeset
|
217 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "We got decoder's address at init! %p\n", codec_hdr->decoder); |
77a237be71a6
fixed api revision and input fourcc handling (mappings are working too :)
alex
parents:
2659
diff
changeset
|
218 return(1); |
77a237be71a6
fixed api revision and input fourcc handling (mappings are working too :)
alex
parents:
2659
diff
changeset
|
219 } |
77a237be71a6
fixed api revision and input fourcc handling (mappings are working too :)
alex
parents:
2659
diff
changeset
|
220 #endif |
2372 | 221 codec_ret = codec_driver->iq_func(codec_hdr); |
222 switch(codec_ret) | |
223 { | |
224 case CODEC_SUPPORTED: | |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
225 codec_driver->dec_func = (void *)codec_hdr->decoder; |
2382 | 226 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "Codec is supported: found decoder for %s at 0x%08x\n", |
2372 | 227 codec_hdr->description, codec_hdr->decoder); |
228 return(1); | |
229 case CODEC_UNSUPPORTED: | |
2388 | 230 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "Codec (%s) is unsupported by driver\n", |
231 codec_hdr->description); | |
2372 | 232 return(0); |
233 case CODEC_UNKNOWN: | |
234 default: | |
2388 | 235 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "Codec (%s) is unknown by driver\n", |
236 codec_hdr->description); | |
2372 | 237 return(0); |
238 } | |
239 } | |
240 | |
241 char *xacodec_def_path = XACODEC_PATH; | |
242 | |
243 int xacodec_init_video(sh_video_t *vidinfo, int out_format) | |
244 { | |
245 char dll[1024]; | |
246 XA_CODEC_HDR codec_hdr; | |
2382 | 247 int i; |
2372 | 248 |
249 xacodec_driver = realloc(xacodec_driver, sizeof(struct xacodec_driver)); | |
250 if (xacodec_driver == NULL) | |
2414 | 251 { |
252 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: memory allocation error: %s\n", | |
253 strerror(errno)); | |
2372 | 254 return(0); |
2414 | 255 } |
2372 | 256 |
257 xacodec_driver->iq_func = NULL; | |
258 xacodec_driver->dec_func = NULL; | |
2382 | 259 |
260 for (i=0; i < XA_CLOSE_FUNCS; i++) | |
261 xacodec_driver->close_func[i] = NULL; | |
2372 | 262 |
4699
406d7fc6be4e
use the XANIM_MOD_DIR env. var as described in xanim's docs
alex
parents:
3115
diff
changeset
|
263 if (getenv("XANIM_MOD_DIR")) |
406d7fc6be4e
use the XANIM_MOD_DIR env. var as described in xanim's docs
alex
parents:
3115
diff
changeset
|
264 xacodec_def_path = getenv("XANIM_MOD_DIR"); |
406d7fc6be4e
use the XANIM_MOD_DIR env. var as described in xanim's docs
alex
parents:
3115
diff
changeset
|
265 |
2372 | 266 snprintf(dll, 1024, "%s/%s", xacodec_def_path, vidinfo->codec->dll); |
267 if (xacodec_init(dll, xacodec_driver) == 0) | |
268 return(0); | |
269 | |
2787 | 270 codec_hdr.xapi_rev = XAVID_API_REV; |
2372 | 271 codec_hdr.anim_hdr = malloc(4096); |
272 codec_hdr.description = vidinfo->codec->info; | |
2682
77a237be71a6
fixed api revision and input fourcc handling (mappings are working too :)
alex
parents:
2659
diff
changeset
|
273 codec_hdr.compression = bswap_32(vidinfo->bih->biCompression); |
2372 | 274 codec_hdr.decoder = NULL; |
2787 | 275 codec_hdr.x = vidinfo->bih->biWidth; /* ->disp_w */ |
276 codec_hdr.y = vidinfo->bih->biHeight; /* ->disp_h */ | |
277 /* extra fields to store palette */ | |
2372 | 278 codec_hdr.avi_ctab_flag = 0; |
279 codec_hdr.avi_read_ext = NULL; | |
280 codec_hdr.extra = NULL; | |
281 | |
282 switch(out_format) | |
283 { | |
2383 | 284 case IMGFMT_IYUV: |
2382 | 285 case IMGFMT_I420: |
2383 | 286 case IMGFMT_YV12: |
287 codec_hdr.depth = 12; | |
2382 | 288 break; |
6526 | 289 case IMGFMT_YVU9: |
290 if (vidinfo->bih->biCompression == mmioFOURCC('I','V','3','2') || | |
291 vidinfo->bih->biCompression == mmioFOURCC('i','v','3','2') || | |
292 vidinfo->bih->biCompression == mmioFOURCC('I','V','3','1') || | |
293 vidinfo->bih->biCompression == mmioFOURCC('i','v','3','2')) | |
294 { | |
295 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supporting YVU9 output with Indeo3\n"); | |
296 return(0); | |
297 } | |
298 codec_hdr.depth = 9; | |
299 break; | |
2372 | 300 default: |
2659 | 301 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supported image out format (%s)\n", |
2372 | 302 vo_format_name(out_format)); |
303 return(0); | |
304 } | |
2659 | 305 mp_msg(MSGT_DECVIDEO, MSGL_INFO, "xacodec: querying for input %dx%d %dbit [fourcc: %4x] (%s)...\n", |
306 codec_hdr.x, codec_hdr.y, codec_hdr.depth, codec_hdr.compression, codec_hdr.description); | |
2372 | 307 |
308 if (xacodec_query(xacodec_driver, &codec_hdr) == 0) | |
309 return(0); | |
310 | |
311 // free(codec_hdr.anim_hdr); | |
312 | |
313 xacodec_driver->decinfo = malloc(sizeof(XA_DEC_INFO)); | |
2414 | 314 if (xacodec_driver->decinfo == NULL) |
315 { | |
316 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: memory allocation error: %s\n", | |
317 strerror(errno)); | |
318 return(0); | |
319 } | |
2372 | 320 xacodec_driver->decinfo->cmd = 0; |
321 xacodec_driver->decinfo->skip_flag = 0; | |
322 xacodec_driver->decinfo->imagex = xacodec_driver->decinfo->xe = codec_hdr.x; | |
323 xacodec_driver->decinfo->imagey = xacodec_driver->decinfo->ye = codec_hdr.y; | |
324 xacodec_driver->decinfo->imaged = codec_hdr.depth; | |
325 xacodec_driver->decinfo->chdr = NULL; | |
326 xacodec_driver->decinfo->map_flag = 0; /* xaFALSE */ | |
327 xacodec_driver->decinfo->map = NULL; | |
328 xacodec_driver->decinfo->xs = xacodec_driver->decinfo->ys = 0; | |
329 xacodec_driver->decinfo->special = 0; | |
330 xacodec_driver->decinfo->extra = codec_hdr.extra; | |
2414 | 331 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "decinfo->extra, filled by codec: 0x%08x [%s]\n", |
332 &xacodec_driver->decinfo->extra, xacodec_driver->decinfo->extra); | |
2372 | 333 |
2377 | 334 // vidinfo->our_out_buffer = malloc(codec_hdr.y * codec_hdr.x * ((codec_hdr.depth+7)/8)); |
2384 | 335 // vidinfo->our_out_buffer = malloc(codec_hdr.y * codec_hdr.x * codec_hdr.depth); |
2414 | 336 xacodec_driver->image.out_fmt = out_format; |
337 xacodec_driver->image.bpp = codec_hdr.depth; | |
338 xacodec_driver->image.width = codec_hdr.x; | |
339 xacodec_driver->image.height = codec_hdr.y; | |
340 xacodec_driver->image.mem = malloc(codec_hdr.y * codec_hdr.x * ((codec_hdr.depth+7)/8)); | |
2372 | 341 |
2388 | 342 if (xacodec_driver->image.mem == NULL) |
2372 | 343 { |
2414 | 344 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: memory allocation error: %s\n", |
2372 | 345 strerror(errno)); |
346 return(0); | |
347 } | |
348 | |
349 return(1); | |
350 } | |
351 | |
2659 | 352 #define ACT_DLTA_NORM 0x00000000 |
353 #define ACT_DLTA_BODY 0x00000001 | |
354 #define ACT_DLTA_XOR 0x00000002 | |
355 #define ACT_DLTA_NOP 0x00000004 | |
356 #define ACT_DLTA_MAPD 0x00000008 | |
357 #define ACT_DLTA_DROP 0x00000010 | |
358 #define ACT_DLTA_BAD 0x80000000 | |
2372 | 359 |
360 // unsigned int (*dec_func)(unsigned char *image, unsigned char *delta, | |
361 // unsigned int dsize, XA_DEC_INFO *dec_info); | |
362 | |
2384 | 363 xacodec_image_t* xacodec_decode_frame(uint8_t *frame, int frame_size, int skip_flag) |
2372 | 364 { |
365 unsigned int ret; | |
2387 | 366 xacodec_image_t *image=&xacodec_driver->image; |
2384 | 367 |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
368 // ugyis kiirja a vegen h dropped vagy nem.. |
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
369 // if (skip_flag > 0) |
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
370 // mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "frame will be dropped..\n"); |
2372 | 371 |
372 xacodec_driver->decinfo->skip_flag = skip_flag; | |
373 | |
2387 | 374 image->planes[0]=image->mem; |
375 image->stride[0]=image->width; | |
376 switch(image->out_fmt){ | |
377 case IMGFMT_YV12: | |
378 image->planes[2]=image->planes[0]+image->width*image->height; | |
379 image->planes[1]=image->planes[2]+image->width*image->height/4; | |
6526 | 380 image->stride[1]=image->stride[2]=image->width/2; |
2387 | 381 break; |
382 case IMGFMT_I420: | |
383 case IMGFMT_IYUV: | |
384 image->planes[1]=image->planes[0]+image->width*image->height; | |
385 image->planes[2]=image->planes[1]+image->width*image->height/4; | |
6526 | 386 image->stride[1]=image->stride[2]=image->width/2; |
387 break; | |
388 case IMGFMT_YVU9: | |
389 image->planes[2]=image->planes[0]+image->width*image->height; | |
390 image->planes[1]=image->planes[2]+(image->width>>2)*(image->height>>2); | |
391 image->stride[1]=image->stride[2]=image->width/4; | |
2387 | 392 break; |
393 } | |
394 | |
2384 | 395 // printf("frame: %08x (size: %d) - dest: %08x\n", frame, frame_size, dest); |
396 | |
397 ret = xacodec_driver->dec_func((uint8_t*)&xacodec_driver->image, frame, frame_size, xacodec_driver->decinfo); | |
2372 | 398 |
2384 | 399 // printf("ret: %lu : ", ret); |
2372 | 400 |
401 | |
2659 | 402 if (ret == ACT_DLTA_NORM) |
2372 | 403 { |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
404 // mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "norm\n"); |
2384 | 405 return &xacodec_driver->image; |
2372 | 406 } |
407 | |
2659 | 408 if (ret & ACT_DLTA_MAPD) |
409 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "mapd\n"); | |
2372 | 410 /* |
411 if (!(ret & ACT_DLT_MAPD)) | |
412 xacodec_driver->decinfo->map_flag = 0; | |
413 else | |
414 { | |
415 xacodec_driver->decinfo->map_flag = 1; | |
416 xacodec_driver->decinfo->map = ... | |
417 } | |
418 */ | |
419 | |
2659 | 420 if (ret & ACT_DLTA_XOR) |
421 { | |
422 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "xor\n"); | |
423 return &xacodec_driver->image; | |
424 } | |
425 | |
426 /* nothing changed */ | |
427 if (ret & ACT_DLTA_NOP) | |
2372 | 428 { |
2388 | 429 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "nop\n"); |
2659 | 430 return NULL; |
2372 | 431 } |
432 | |
2659 | 433 /* frame dropped (also display latest frame) */ |
434 if (ret & ACT_DLTA_DROP) | |
2372 | 435 { |
2388 | 436 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "drop\n"); |
2384 | 437 return NULL; |
2372 | 438 } |
439 | |
2659 | 440 if (ret & ACT_DLTA_BAD) |
2372 | 441 { |
2388 | 442 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "bad\n"); |
2384 | 443 return NULL; |
2372 | 444 } |
445 | |
2659 | 446 /* used for double buffer */ |
447 if (ret & ACT_DLTA_BODY) | |
2372 | 448 { |
2388 | 449 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "body\n"); |
2384 | 450 return NULL; |
2372 | 451 } |
452 | |
2384 | 453 return NULL; |
2372 | 454 } |
455 | |
456 int xacodec_exit() | |
457 { | |
2382 | 458 int i; |
459 void (*close_func)(); | |
460 | |
461 for (i=0; i < XA_CLOSE_FUNCS; i++) | |
462 if (xacodec_driver->close_func[i]) | |
463 { | |
464 close_func = xacodec_driver->close_func[i]; | |
465 close_func(); | |
466 } | |
2372 | 467 dlclose(xacodec_driver->file_handler); |
468 if (xacodec_driver->decinfo != NULL) | |
469 free(xacodec_driver->decinfo); | |
2388 | 470 free(xacodec_driver); |
2372 | 471 return(TRUE); |
472 } | |
2373 | 473 |
474 | |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
475 /* *** XANIM Conversions *** */ |
2373 | 476 /* like loader/win32.c - mini XANIM library */ |
477 | |
2382 | 478 unsigned long XA_Time_Read() |
479 { | |
2384 | 480 return GetTimer(); //(GetRelativeTime()); |
2382 | 481 } |
482 | |
483 void XA_dummy() | |
484 { | |
485 XA_Print("dummy() called"); | |
486 } | |
487 | |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
488 void XA_Gen_YUV_Tabs(XA_ANIM_HDR *anim_hdr) |
2373 | 489 { |
490 XA_Print("XA_Gen_YUV_Tabs('anim_hdr: %08x')", anim_hdr); | |
491 | |
492 // XA_Print("anim type: %d - img[x: %d, y: %d, c: %d, d: %d]", | |
493 // anim_hdr->anim_type, anim_hdr->imagex, anim_hdr->imagey, | |
494 // anim_hdr->imagec, anim_hdr->imaged); | |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
495 return; |
2373 | 496 } |
497 | |
498 void JPG_Setup_Samp_Limit_Table(XA_ANIM_HDR *anim_hdr) | |
499 { | |
500 XA_Print("JPG_Setup_Samp_Limit_Table('anim_hdr: %08x')", anim_hdr); | |
2381 | 501 // xa_byte_limit = jpg_samp_limit + (MAXJSAMPLE + 1); |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
502 return; |
2373 | 503 } |
504 | |
505 void JPG_Alloc_MCU_Bufs(XA_ANIM_HDR *anim_hdr, unsigned int width, | |
506 unsigned int height, unsigned int full_flag) | |
507 { | |
508 XA_Print("JPG_Alloc_MCU_Bufs('anim_hdr: %08x', 'width: %d', 'height: %d', 'full_flag: %d')", | |
509 anim_hdr, width, height, full_flag); | |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
510 return; |
2373 | 511 } |
512 | |
2406 | 513 /* --------------- 4x4 pixel YUV block fillers [CVID] ----------------- */ |
2391 | 514 |
515 typedef struct | |
516 { | |
517 unsigned char r0, g0, b0; | |
518 unsigned char r1, g1, b1; | |
519 unsigned char r2, g2, b2; | |
520 unsigned char r3, g3, b3; | |
521 unsigned int clr0_0, clr0_1, clr0_2, clr0_3; | |
522 unsigned int clr1_0, clr1_1, clr1_2, clr1_3; | |
523 unsigned int clr2_0, clr2_1, clr2_2, clr2_3; | |
524 unsigned int clr3_0, clr3_1, clr3_2, clr3_3; | |
525 } XA_2x2_Color; | |
526 | |
527 #define SET_4_YUV_PIXELS(image,x,y,cmap2x2) \ | |
528 image->planes[0][((x)+0)+((y)+0)*image->stride[0]]=cmap2x2->clr0_0;\ | |
529 image->planes[0][((x)+1)+((y)+0)*image->stride[0]]=cmap2x2->clr0_1;\ | |
530 image->planes[0][((x)+0)+((y)+1)*image->stride[0]]=cmap2x2->clr0_2;\ | |
531 image->planes[0][((x)+1)+((y)+1)*image->stride[0]]=cmap2x2->clr0_3;\ | |
532 image->planes[1][((x)>>1)+((y)>>1)*image->stride[1]]=cmap2x2->clr1_0;\ | |
533 image->planes[2][((x)>>1)+((y)>>1)*image->stride[2]]=cmap2x2->clr1_1; | |
534 | |
2406 | 535 void XA_2x2_OUT_1BLK_Convert(unsigned char *image_p, unsigned int x, unsigned int y, |
2391 | 536 unsigned int imagex, XA_2x2_Color *cmap2x2) |
537 { | |
538 xacodec_image_t *image=(xacodec_image_t*)image_p; | |
539 | |
540 #if 0 | |
541 SET_4_YUV_PIXELS(image,x,y,cmap2x2) | |
542 #else | |
543 SET_4_YUV_PIXELS(image,x,y,cmap2x2) | |
544 SET_4_YUV_PIXELS(image,x+2,y,cmap2x2) | |
545 SET_4_YUV_PIXELS(image,x,y+2,cmap2x2) | |
546 SET_4_YUV_PIXELS(image,x+2,y+2,cmap2x2) | |
547 #endif | |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
548 return; |
2391 | 549 } |
550 | |
2406 | 551 void XA_2x2_OUT_4BLKS_Convert(unsigned char *image_p, unsigned int x, unsigned int y, |
2391 | 552 unsigned int imagex, XA_2x2_Color *cm0, XA_2x2_Color *cm1, XA_2x2_Color *cm2, |
553 XA_2x2_Color *cm3) | |
554 { | |
555 xacodec_image_t *image=(xacodec_image_t*)image_p; | |
556 | |
557 SET_4_YUV_PIXELS(image,x,y,cm0) | |
558 SET_4_YUV_PIXELS(image,x+2,y,cm1) | |
559 SET_4_YUV_PIXELS(image,x,y+2,cm2) | |
560 SET_4_YUV_PIXELS(image,x+2,y+2,cm3) | |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
561 return; |
2391 | 562 } |
563 | |
564 void *YUV2x2_Blk_Func(unsigned int image_type, int blks, unsigned int dith_flag) | |
565 { | |
2923
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
566 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "YUV2x2_Blk_Func(image_type=%d, blks=%d, dith_flag=%d)\n", |
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
567 image_type, blks, dith_flag); |
2391 | 568 switch(blks){ |
569 case 1: | |
2406 | 570 return (void*) XA_2x2_OUT_1BLK_Convert; |
2391 | 571 case 4: |
2406 | 572 return (void*) XA_2x2_OUT_4BLKS_Convert; |
2391 | 573 } |
574 | |
575 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Unimplemented: YUV2x2_Blk_Func(image_type=%d blks=%d dith=%d)\n",image_type,blks,dith_flag); | |
576 return (void*) XA_dummy; | |
577 } | |
578 | |
579 // Take Four Y's and UV and put them into a 2x2 Color structure. | |
580 | |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
581 void XA_YUV_2x2_clr(XA_2x2_Color *cmap2x2, unsigned int Y0, unsigned int Y1, |
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
582 unsigned int Y2, unsigned int Y3, unsigned int U, unsigned int V, |
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
583 unsigned int map_flag, unsigned int *map, XA_CHDR *chdr) |
2391 | 584 { |
585 | |
2923
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
586 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "XA_YUV_2x2_clr(%p [%d,%d,%d,%d][%d][%d] %d %p %p)\n", |
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
587 cmap2x2,Y0,Y1,Y2,Y3,U,V,map_flag,map,chdr); |
2391 | 588 |
589 cmap2x2->clr0_0=Y0; | |
590 cmap2x2->clr0_1=Y1; | |
591 cmap2x2->clr0_2=Y2; | |
592 cmap2x2->clr0_3=Y3; | |
593 cmap2x2->clr1_0=U; | |
594 cmap2x2->clr1_1=V; | |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
595 return; |
2391 | 596 } |
597 | |
598 void *YUV2x2_Map_Func(unsigned int image_type, unsigned int dith_type) | |
599 { | |
2923
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
600 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "YUV2x2_Map_Func('image_type: %d', 'dith_type: %d')", |
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
601 image_type, dith_type); |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
602 return((void*)XA_YUV_2x2_clr); |
2391 | 603 } |
604 | |
2406 | 605 /* -------------------- whole YUV frame converters ------------------------- */ |
2391 | 606 |
2373 | 607 typedef struct |
608 { | |
609 unsigned char *Ybuf; | |
610 unsigned char *Ubuf; | |
611 unsigned char *Vbuf; | |
612 unsigned char *the_buf; | |
613 unsigned int the_buf_size; | |
614 unsigned short y_w, y_h; | |
615 unsigned short uv_w, uv_h; | |
616 } YUVBufs; | |
617 | |
618 typedef struct | |
619 { | |
620 unsigned long Uskip_mask; | |
621 long *YUV_Y_tab; | |
622 long *YUV_UB_tab; | |
623 long *YUV_VR_tab; | |
624 long *YUV_UG_tab; | |
625 long *YUV_VG_tab; | |
626 } YUVTabs; | |
627 | |
2406 | 628 YUVBufs jpg_YUVBufs; |
629 YUVTabs def_yuv_tabs; | |
630 | |
6526 | 631 /* -------------- YUV 4x4 1x1 1x1 (4:1:0 aka YVU9) [Indeo 3,4,5] ------------------ */ |
2406 | 632 |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
633 void XA_YUV1611_Convert(unsigned char *image_p, unsigned int imagex, unsigned int imagey, |
2391 | 634 unsigned int i_x, unsigned int i_y, YUVBufs *yuv, YUVTabs *yuv_tabs, |
2373 | 635 unsigned int map_flag, unsigned int *map, XA_CHDR *chdr) |
636 { | |
2391 | 637 xacodec_image_t *image=(xacodec_image_t*)image_p; |
2395 | 638 int y; |
639 int uvstride; | |
2391 | 640 |
2923
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
641 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "YUVTabs: %d %p %p %p %p %p\n",yuv_tabs->Uskip_mask, |
2397 | 642 yuv_tabs->YUV_Y_tab, |
643 yuv_tabs->YUV_UB_tab, | |
644 yuv_tabs->YUV_VR_tab, | |
645 yuv_tabs->YUV_UG_tab, | |
646 yuv_tabs->YUV_VG_tab ); | |
647 | |
2923
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
648 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "XA_YUV1611_Convert('image: %08x', 'imagex: %d', 'imagey: %d', 'i_x: %d', 'i_y: %d', 'yuv_bufs: %08x', 'yuv_tabs: %08x', 'map_flag: %d', 'map: %08x', 'chdr: %08x')", |
2391 | 649 image, imagex, imagey, i_x, i_y, yuv, yuv_tabs, map_flag, map, chdr); |
2373 | 650 |
2923
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
651 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "YUV: %p %p %p %X (%d) %dx%d %dx%d\n", |
2395 | 652 yuv->Ybuf,yuv->Ubuf,yuv->Vbuf,yuv->the_buf,yuv->the_buf_size, |
653 yuv->y_w,yuv->y_h,yuv->uv_w,yuv->uv_h); | |
654 | |
6526 | 655 if(image->out_fmt == IMGFMT_YVU9 && !yuv_tabs->YUV_Y_tab) |
656 { | |
657 if(i_x==image->width && i_y==image->height){ | |
658 image->planes[0]=yuv->Ybuf; | |
659 image->planes[1]=yuv->Ubuf; | |
660 image->planes[2]=yuv->Vbuf; | |
661 image->stride[0]=i_x; // yuv->y_w | |
662 image->stride[1]=image->stride[2]=i_x/4; // yuv->uv_w | |
663 } else { | |
664 int y; | |
665 for(y=0;y<i_y;y++) | |
666 memcpy(image->planes[0]+y*image->stride[0],yuv->Ybuf+y*i_x,i_x); | |
667 i_x>>=2; i_y>>=2; | |
668 for(y=0;y<i_y;y++){ | |
669 memcpy(image->planes[1]+y*image->stride[1],yuv->Ubuf+y*i_x,i_x); | |
670 memcpy(image->planes[2]+y*image->stride[2],yuv->Vbuf+y*i_x,i_x); | |
671 } | |
672 } | |
673 return; | |
674 } | |
675 | |
2395 | 676 // copy Y plane: |
2397 | 677 if(yuv_tabs->YUV_Y_tab){ // dirty hack to detect iv32: |
678 for(y=0;y<imagey*imagex;y++) | |
679 image->planes[0][y]=yuv->Ybuf[y]<<1; | |
680 } else | |
681 memcpy(image->planes[0],yuv->Ybuf,imagex*imagey); | |
2395 | 682 |
683 // scale U,V planes by 2: | |
684 imagex>>=2; | |
685 imagey>>=2; | |
2391 | 686 |
2395 | 687 uvstride=(yuv->uv_w)?yuv->uv_w:imagex; |
688 | |
689 for(y=0;y<imagey;y++){ | |
690 unsigned char *su=yuv->Ubuf+uvstride*y; | |
691 unsigned char *sv=yuv->Vbuf+uvstride*y; | |
692 unsigned int strideu=image->stride[1]; | |
693 unsigned int stridev=image->stride[2]; | |
694 unsigned char *du=image->planes[1]+2*y*strideu; | |
695 unsigned char *dv=image->planes[2]+2*y*stridev; | |
696 int x; | |
2397 | 697 if(yuv_tabs->YUV_Y_tab){ // dirty hack to detect iv32: |
698 for(x=0;x<imagex;x++){ | |
699 du[2*x]=du[2*x+1]=du[2*x+strideu]=du[2*x+strideu+1]=su[x]*2; | |
700 dv[2*x]=dv[2*x+1]=dv[2*x+stridev]=dv[2*x+stridev+1]=sv[x]*2; | |
701 } | |
702 } else { | |
703 for(x=0;x<imagex;x++){ | |
704 du[2*x]=du[2*x+1]=du[2*x+strideu]=du[2*x+strideu+1]=su[x]; | |
705 dv[2*x]=dv[2*x+1]=dv[2*x+stridev]=dv[2*x+stridev+1]=sv[x]; | |
706 } | |
2395 | 707 } |
708 } | |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
709 return; |
2373 | 710 } |
711 | |
712 void *XA_YUV1611_Func(unsigned int image_type) | |
713 { | |
2923
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
714 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "XA_YUV1611_Func('image_type: %d')", image_type); |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
715 return((void *)XA_YUV1611_Convert); |
2373 | 716 } |
717 | |
6526 | 718 /* -------------- YUV 4x1 1x1 1x1 (4:1:1 but interleaved) [CYUV] ------------------ */ |
2395 | 719 |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
720 void XA_YUV411111_Convert(unsigned char *image, unsigned int imagex, unsigned int imagey, |
2373 | 721 unsigned int i_x, unsigned int i_y, YUVBufs *yuv_bufs, YUVTabs *yuv_tabs, |
722 unsigned int map_flag, unsigned int *map, XA_CHDR *chdr) | |
723 { | |
2923
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
724 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "XA_YUV411111_Convert('image: %d', 'imagex: %d', 'imagey: %d', 'i_x: %d', 'i_y: %d', 'yuv_bufs: %08x', 'yuv_tabs: %08x', 'map_flag: %d', 'map: %08x', 'chdr: %08x')", |
2373 | 725 image, imagex, imagey, i_x, i_y, yuv_bufs, yuv_tabs, map_flag, map, chdr); |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
726 return; |
2373 | 727 } |
728 | |
729 void *XA_YUV411111_Func(unsigned int image_type) | |
730 { | |
2923
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
731 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "XA_YUV411111_Func('image_type: %d')", image_type); |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
732 return((void*)XA_YUV411111_Convert); |
2373 | 733 } |
734 | |
2406 | 735 /* --------------- YUV 2x2 1x1 1x1 (4:2:0 aka YV12) [3ivX,H263] ------------ */ |
2391 | 736 |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
737 void XA_YUV221111_Convert(unsigned char *image_p, unsigned int imagex, unsigned int imagey, |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
738 unsigned int i_x, unsigned int i_y, YUVBufs *yuv, YUVTabs *yuv_tabs, unsigned int map_flag, |
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
739 unsigned int *map, XA_CHDR *chdr) |
2383 | 740 { |
2384 | 741 xacodec_image_t *image=(xacodec_image_t*)image_p; |
742 | |
2923
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
743 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "XA_YUV221111_Convert(%p %dx%d %d;%d [%dx%d] %p %p %d %p %p)\n", |
2384 | 744 image,imagex,imagey,i_x,i_y, image->width,image->height, |
745 yuv,yuv_tabs,map_flag,map,chdr); | |
2383 | 746 |
2923
7177ca35ad1a
do not fault with vivo2, and also inserted mp_dbg lines
alex
parents:
2897
diff
changeset
|
747 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "YUV: %p %p %p %X (%X) %Xx%X %Xx%X\n", |
2383 | 748 yuv->Ybuf,yuv->Ubuf,yuv->Vbuf,yuv->the_buf,yuv->the_buf_size, |
749 yuv->y_w,yuv->y_h,yuv->uv_w,yuv->uv_h); | |
750 | |
2403 | 751 if(i_x==image->width && i_y==image->height){ |
2384 | 752 // printf("Direct render!!!\n"); |
753 image->planes[0]=yuv->Ybuf; | |
754 if(image->out_fmt==IMGFMT_YV12){ | |
755 image->planes[1]=yuv->Ubuf; | |
756 image->planes[2]=yuv->Vbuf; | |
757 } else { | |
758 image->planes[1]=yuv->Vbuf; | |
759 image->planes[2]=yuv->Ubuf; | |
760 } | |
2403 | 761 image->stride[0]=i_x; // yuv->y_w |
762 image->stride[1]=image->stride[2]=i_x/2; // yuv->uv_w | |
2384 | 763 } else { |
2403 | 764 int y; |
765 for(y=0;y<i_y;y++) | |
766 memcpy(image->planes[0]+y*image->stride[0],yuv->Ybuf+y*i_x,i_x); | |
767 i_x>>=1; i_y>>=1; | |
768 for(y=0;y<i_y;y++){ | |
769 memcpy(image->planes[1]+y*image->stride[1],yuv->Ubuf+y*i_x,i_x); | |
770 memcpy(image->planes[2]+y*image->stride[2],yuv->Vbuf+y*i_x,i_x); | |
771 } | |
2384 | 772 } |
2402
f628c76bbc11
little cleanup to eleminate xanim typedefs and be more mplayer like
alex
parents:
2397
diff
changeset
|
773 return; |
2383 | 774 } |
775 | |
2382 | 776 void *XA_YUV221111_Func(unsigned int image_type) |
777 { | |
3115 | 778 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "XA_YUV221111_Func('image_type: %d')\n",image_type); |
779 return((void *)XA_YUV221111_Convert); | |
2382 | 780 } |
2373 | 781 |
2404
da766ceb7bdd
cleaned up, also removed some useless printf's to be more faster ;)
alex
parents:
2403
diff
changeset
|
782 /* *** EOF XANIM *** */ |
2659 | 783 #endif |