Mercurial > mplayer.hg
annotate libmpcodecs/vd_xanim.c @ 22768:7989c3586b9e
add mf://bmp wish, remove deinterlace filter during playback
author | compn |
---|---|
date | Fri, 23 Mar 2007 01:48:54 +0000 |
parents | a1807995e2ab |
children | 71b3e04d0555 |
rev | line source |
---|---|
7285 | 1 /* |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
2 XAnim Video Codec DLL support |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
3 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
4 It partly emulates the Xanim codebase. |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
5 You need the -rdynamic flag to use this with gcc. |
7285 | 6 |
10368 | 7 (C) 2001-2002 Alex Beregszaszi |
7355 | 8 and Arpad Gereoffy <arpi@thot.banki.hu> |
7285 | 9 */ |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
10 |
4969 | 11 #include <stdio.h> |
12 #include <stdlib.h> | |
7285 | 13 #include <string.h> /* strerror */ |
4969 | 14 |
15 #include "config.h" | |
7285 | 16 |
4969 | 17 #include "mp_msg.h" |
18 | |
19 #include "vd_internal.h" | |
20 | |
21 static vd_info_t info = { | |
22 "XAnim codecs", | |
23 "xanim", | |
24 "A'rpi & Alex", | |
5272 | 25 "Xanim (http://xanim.va.pubnix.com/)", |
4969 | 26 "binary codec plugins" |
27 }; | |
28 | |
29 LIBVD_EXTERN(xanim) | |
30 | |
7285 | 31 #ifdef __FreeBSD__ |
32 #include <unistd.h> | |
33 #endif | |
34 | |
35 #include <dlfcn.h> /* dlsym, dlopen, dlclose */ | |
36 #include <stdarg.h> /* va_alist, va_start, va_end */ | |
37 #include <errno.h> /* strerror, errno */ | |
38 | |
39 #include "mp_msg.h" | |
40 #include "bswap.h" | |
41 | |
9380 | 42 #include "osdep/timer.h" |
7285 | 43 #include "libvo/fastmemcpy.h" |
44 | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
45 #if 0 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
46 /* this should be removed */ |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
47 #ifndef RTLD_NOW |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
48 #define RLTD_NOW 2 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
49 #endif |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
50 #ifndef RTLD_LAZY |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
51 #define RLTD_LAZY 1 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
52 #endif |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
53 #ifndef RTLD_GLOBAL |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
54 #define RLTD_GLOBAL 256 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
55 #endif |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
56 #endif |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
57 |
7285 | 58 typedef struct |
59 { | |
60 unsigned int what; | |
61 unsigned int id; | |
62 int (*iq_func)(); /* init/query function */ | |
63 unsigned int (*dec_func)(); /* opt decode function */ | |
64 } XAVID_FUNC_HDR; | |
65 | |
66 #define XAVID_WHAT_NO_MORE 0x0000 | |
67 #define XAVID_AVI_QUERY 0x0001 | |
68 #define XAVID_QT_QUERY 0x0002 | |
69 #define XAVID_DEC_FUNC 0x0100 | |
70 | |
71 #define XAVID_API_REV 0x0003 | |
72 | |
73 typedef struct | |
74 { | |
75 unsigned int api_rev; | |
76 char *desc; | |
77 char *rev; | |
78 char *copyright; | |
79 char *mod_author; | |
80 char *authors; | |
81 unsigned int num_funcs; | |
82 XAVID_FUNC_HDR *funcs; | |
83 } XAVID_MOD_HDR; | |
84 | |
85 /* XA CODEC .. */ | |
86 typedef struct | |
87 { | |
88 void *anim_hdr; | |
89 unsigned int compression; | |
90 unsigned int x, y; | |
91 unsigned int depth; | |
92 void *extra; | |
93 unsigned int xapi_rev; | |
94 unsigned int (*decoder)(); | |
95 char *description; | |
96 unsigned int avi_ctab_flag; | |
97 unsigned int (*avi_read_ext)(); | |
98 } XA_CODEC_HDR; | |
99 | |
100 #define CODEC_SUPPORTED 1 | |
101 #define CODEC_UNKNOWN 0 | |
102 #define CODEC_UNSUPPORTED -1 | |
103 | |
104 /* fuckin colormap structures for xanim */ | |
105 typedef struct | |
106 { | |
107 unsigned short red; | |
108 unsigned short green; | |
109 unsigned short blue; | |
110 unsigned short gray; | |
111 } ColorReg; | |
112 | |
113 typedef struct XA_ACTION_STRUCT | |
114 { | |
115 int type; | |
116 int cmap_rev; | |
117 unsigned char *data; | |
118 struct XA_ACTION_STRUCT *next; | |
119 struct XA_CHDR_STRUCT *chdr; | |
120 ColorReg *h_cmap; | |
121 unsigned int *map; | |
122 struct XA_ACTION_STRUCT *next_same_chdr; | |
123 } XA_ACTION; | |
124 | |
125 typedef struct XA_CHDR_STRUCT | |
126 { | |
127 unsigned int rev; | |
128 ColorReg *cmap; | |
129 unsigned int csize, coff; | |
130 unsigned int *map; | |
131 unsigned int msize, moff; | |
132 struct XA_CHDR_STRUCT *next; | |
133 XA_ACTION *acts; | |
134 struct XA_CHDR_STRUCT *new_chdr; | |
135 } XA_CHDR; | |
136 | |
137 typedef struct | |
138 { | |
139 unsigned int cmd; | |
140 unsigned int skip_flag; | |
141 unsigned int imagex, imagey; /* image buffer size */ | |
142 unsigned int imaged; /* image depth */ | |
143 XA_CHDR *chdr; /* color map header */ | |
144 unsigned int map_flag; | |
145 unsigned int *map; | |
146 unsigned int xs, ys; | |
147 unsigned int xe, ye; | |
148 unsigned int special; | |
149 void *extra; | |
150 } XA_DEC_INFO; | |
151 | |
152 typedef struct | |
153 { | |
154 unsigned int file_num; | |
155 unsigned int anim_type; | |
156 unsigned int imagex; | |
157 unsigned int imagey; | |
158 unsigned int imagec; | |
159 unsigned int imaged; | |
160 } XA_ANIM_HDR; | |
161 | |
162 typedef struct { | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
163 XA_DEC_INFO *decinfo; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
164 void *file_handler; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
165 long (*iq_func)(XA_CODEC_HDR *codec_hdr); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
166 unsigned int (*dec_func)(unsigned char *image, unsigned char *delta, |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
167 unsigned int dsize, XA_DEC_INFO *dec_info); |
7355 | 168 mp_image_t *mpi; |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
169 } vd_xanim_ctx; |
7285 | 170 |
171 #if 0 | |
172 typedef char xaBYTE; | |
173 typedef short xaSHORT; | |
174 typedef int xaLONG; | |
175 | |
176 typedef unsigned char xaUBYTE; | |
177 typedef unsigned short xaUSHORT; | |
178 typedef unsigned int xaULONG; | |
179 #endif | |
180 | |
181 #define xaFALSE 0 | |
182 #define xaTRUE 1 | |
183 | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
184 #define ACT_DLTA_NORM 0x00000000 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
185 #define ACT_DLTA_BODY 0x00000001 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
186 #define ACT_DLTA_XOR 0x00000002 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
187 #define ACT_DLTA_NOP 0x00000004 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
188 #define ACT_DLTA_MAPD 0x00000008 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
189 #define ACT_DLTA_DROP 0x00000010 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
190 #define ACT_DLTA_BAD 0x80000000 |
7285 | 191 |
192 #define XA_CLOSE_FUNCS 5 | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
193 int xa_close_funcs = 0; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
194 void *xa_close_func[XA_CLOSE_FUNCS]; |
7285 | 195 |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
196 /* load, init and query */ |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
197 static int xacodec_load(sh_video_t *sh, char *filename) |
7285 | 198 { |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
199 vd_xanim_ctx *priv = sh->context; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
200 void *(*what_the)(); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
201 char *error; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
202 XAVID_MOD_HDR *mod_hdr; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
203 XAVID_FUNC_HDR *func; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
204 int i; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
205 |
7383 | 206 // priv->file_handler = dlopen(filename, RTLD_NOW|RTLD_GLOBAL); |
207 priv->file_handler = dlopen(filename, RTLD_LAZY); | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
208 if (!priv->file_handler) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
209 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
210 error = dlerror(); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
211 if (error) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
212 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: failed to dlopen %s while %s\n", filename, error); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
213 else |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
214 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: failed to dlopen %s\n", filename); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
215 return(0); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
216 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
217 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
218 what_the = dlsym(priv->file_handler, "What_The"); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
219 if ((error = dlerror()) != NULL) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
220 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
221 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: failed to init %s while %s\n", filename, error); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
222 dlclose(priv->file_handler); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
223 return(0); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
224 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
225 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
226 mod_hdr = what_the(); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
227 if (!mod_hdr) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
228 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
229 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: initializer function failed in %s\n", filename); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
230 dlclose(priv->file_handler); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
231 return(0); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
232 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
233 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
234 mp_msg(MSGT_DECVIDEO, MSGL_V, "=== XAnim Codec ===\n"); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
235 mp_msg(MSGT_DECVIDEO, MSGL_V, " Filename: %s (API revision: %x)\n", filename, mod_hdr->api_rev); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
236 mp_msg(MSGT_DECVIDEO, MSGL_V, " Codec: %s. Rev: %s\n", mod_hdr->desc, mod_hdr->rev); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
237 if (mod_hdr->copyright) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
238 mp_msg(MSGT_DECVIDEO, MSGL_V, " %s\n", mod_hdr->copyright); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
239 if (mod_hdr->mod_author) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
240 mp_msg(MSGT_DECVIDEO, MSGL_V, " Module Author(s): %s\n", mod_hdr->mod_author); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
241 if (mod_hdr->authors) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
242 mp_msg(MSGT_DECVIDEO, MSGL_V, " Codec Author(s): %s\n", mod_hdr->authors); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
243 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
244 if (mod_hdr->api_rev > XAVID_API_REV) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
245 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
246 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supported api revision (%d) in %s\n", |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
247 mod_hdr->api_rev, filename); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
248 dlclose(priv->file_handler); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
249 return(0); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
250 } |
7285 | 251 |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
252 func = mod_hdr->funcs; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
253 if (!func) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
254 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
255 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: function table error in %s\n", filename); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
256 dlclose(priv->file_handler); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
257 return(0); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
258 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
259 |
17366 | 260 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "Exported functions by codec: [functable: %p entries: %d]\n", |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
261 mod_hdr->funcs, mod_hdr->num_funcs); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
262 for (i = 0; i < (int)mod_hdr->num_funcs; i++) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
263 { |
17366 | 264 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, " %d: %d %d [iq:%p d:%p]\n", |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
265 i, func[i].what, func[i].id, func[i].iq_func, func[i].dec_func); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
266 if (func[i].what & XAVID_AVI_QUERY) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
267 { |
17366 | 268 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, " %p: avi init/query func (id: %d)\n", |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
269 func[i].iq_func, func[i].id); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
270 priv->iq_func = (void *)func[i].iq_func; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
271 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
272 if (func[i].what & XAVID_QT_QUERY) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
273 { |
17366 | 274 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, " %p: qt init/query func (id: %d)\n", |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
275 func[i].iq_func, func[i].id); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
276 priv->iq_func = (void *)func[i].iq_func; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
277 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
278 if (func[i].what & XAVID_DEC_FUNC) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
279 { |
17366 | 280 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, " %p: decoder func (init/query: %p) (id: %d)\n", |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
281 func[i].dec_func, func[i].iq_func, func[i].id); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
282 priv->dec_func = (void *)func[i].dec_func; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
283 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
284 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
285 return(1); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
286 } |
7285 | 287 |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
288 static int xacodec_query(sh_video_t *sh, XA_CODEC_HDR *codec_hdr) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
289 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
290 vd_xanim_ctx *priv = sh->context; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
291 long ret; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
292 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
293 #if 0 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
294 /* the brute one */ |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
295 if (priv->dec_func) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
296 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
297 codec_hdr->decoder = priv->dec_func; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
298 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "We got decoder's address at init! %p\n", codec_hdr->decoder); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
299 return(1); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
300 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
301 #endif |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
302 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
303 ret = priv->iq_func(codec_hdr); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
304 switch(ret) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
305 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
306 case CODEC_SUPPORTED: |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
307 priv->dec_func = (void *)codec_hdr->decoder; |
17366 | 308 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "Codec is supported: found decoder for %s at %p\n", |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
309 codec_hdr->description, codec_hdr->decoder); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
310 return(1); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
311 case CODEC_UNSUPPORTED: |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
312 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "Codec (%s) is unsupported by dll\n", |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
313 codec_hdr->description); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
314 return(0); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
315 case CODEC_UNKNOWN: |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
316 default: |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
317 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "Codec (%s) is unknown by dll\n", |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
318 codec_hdr->description); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
319 return(0); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
320 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
321 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
322 |
7285 | 323 void XA_Print(char *fmt, ...) |
324 { | |
325 va_list vallist; | |
326 char buf[1024]; | |
327 | |
328 va_start(vallist, fmt); | |
329 vsnprintf(buf, 1024, fmt, vallist); | |
330 mp_msg(MSGT_XACODEC, MSGL_DBG2, "[xacodec] %s\n", buf); | |
331 va_end(vallist); | |
332 | |
333 return; | |
334 } | |
335 | |
336 /* 0 is no debug (needed by 3ivX) */ | |
337 long xa_debug = 0; | |
338 | |
339 void TheEnd1(char *err_mess) | |
340 { | |
341 XA_Print("error: %s - exiting\n", err_mess); | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
342 /* we should exit here... */ |
7285 | 343 |
344 return; | |
345 } | |
346 | |
347 void XA_Add_Func_To_Free_Chain(XA_ANIM_HDR *anim_hdr, void (*function)()) | |
348 { | |
349 // XA_Print("XA_Add_Func_To_Free_Chain('anim_hdr: %08x', 'function: %08x')", | |
350 // anim_hdr, function); | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
351 xa_close_func[xa_close_funcs] = function; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
352 if (xa_close_funcs+1 < XA_CLOSE_FUNCS) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
353 xa_close_funcs++; |
7285 | 354 |
355 return; | |
356 } | |
357 | |
358 | |
359 unsigned long XA_Time_Read() | |
360 { | |
361 return GetTimer(); //(GetRelativeTime()); | |
362 } | |
363 | |
364 void XA_dummy() | |
365 { | |
366 XA_Print("dummy() called"); | |
367 } | |
368 | |
369 void XA_Gen_YUV_Tabs(XA_ANIM_HDR *anim_hdr) | |
370 { | |
371 XA_Print("XA_Gen_YUV_Tabs('anim_hdr: %08x')", anim_hdr); | |
372 return; | |
373 } | |
374 | |
375 void JPG_Setup_Samp_Limit_Table(XA_ANIM_HDR *anim_hdr) | |
376 { | |
377 XA_Print("JPG_Setup_Samp_Limit_Table('anim_hdr: %08x')", anim_hdr); | |
378 return; | |
379 } | |
380 | |
381 void JPG_Alloc_MCU_Bufs(XA_ANIM_HDR *anim_hdr, unsigned int width, | |
382 unsigned int height, unsigned int full_flag) | |
383 { | |
384 XA_Print("JPG_Alloc_MCU_Bufs('anim_hdr: %08x', 'width: %d', 'height: %d', 'full_flag: %d')", | |
385 anim_hdr, width, height, full_flag); | |
386 return; | |
387 } | |
388 | |
389 /* --------------- 4x4 pixel YUV block fillers [CVID] ----------------- */ | |
390 | |
391 typedef struct | |
392 { | |
393 unsigned char r0, g0, b0; | |
394 unsigned char r1, g1, b1; | |
395 unsigned char r2, g2, b2; | |
396 unsigned char r3, g3, b3; | |
397 unsigned int clr0_0, clr0_1, clr0_2, clr0_3; | |
398 unsigned int clr1_0, clr1_1, clr1_2, clr1_3; | |
399 unsigned int clr2_0, clr2_1, clr2_2, clr2_3; | |
400 unsigned int clr3_0, clr3_1, clr3_2, clr3_3; | |
401 } XA_2x2_Color; | |
402 | |
403 #define SET_4_YUV_PIXELS(image,x,y,cmap2x2) \ | |
404 image->planes[0][((x)+0)+((y)+0)*image->stride[0]]=cmap2x2->clr0_0;\ | |
405 image->planes[0][((x)+1)+((y)+0)*image->stride[0]]=cmap2x2->clr0_1;\ | |
406 image->planes[0][((x)+0)+((y)+1)*image->stride[0]]=cmap2x2->clr0_2;\ | |
407 image->planes[0][((x)+1)+((y)+1)*image->stride[0]]=cmap2x2->clr0_3;\ | |
408 image->planes[1][((x)>>1)+((y)>>1)*image->stride[1]]=cmap2x2->clr1_0;\ | |
409 image->planes[2][((x)>>1)+((y)>>1)*image->stride[2]]=cmap2x2->clr1_1; | |
410 | |
411 void XA_2x2_OUT_1BLK_Convert(unsigned char *image_p, unsigned int x, unsigned int y, | |
412 unsigned int imagex, XA_2x2_Color *cmap2x2) | |
413 { | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
414 mp_image_t *mpi = (mp_image_t *)image_p; |
7285 | 415 |
416 #if 0 | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
417 SET_4_YUV_PIXELS(mpi,x,y,cmap2x2) |
7285 | 418 #else |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
419 SET_4_YUV_PIXELS(mpi,x,y,cmap2x2) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
420 SET_4_YUV_PIXELS(mpi,x+2,y,cmap2x2) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
421 SET_4_YUV_PIXELS(mpi,x,y+2,cmap2x2) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
422 SET_4_YUV_PIXELS(mpi,x+2,y+2,cmap2x2) |
7285 | 423 #endif |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
424 |
7285 | 425 return; |
426 } | |
427 | |
428 void XA_2x2_OUT_4BLKS_Convert(unsigned char *image_p, unsigned int x, unsigned int y, | |
429 unsigned int imagex, XA_2x2_Color *cm0, XA_2x2_Color *cm1, XA_2x2_Color *cm2, | |
430 XA_2x2_Color *cm3) | |
431 { | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
432 mp_image_t *mpi = (mp_image_t *)image_p; |
7285 | 433 |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
434 SET_4_YUV_PIXELS(mpi,x,y,cm0) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
435 SET_4_YUV_PIXELS(mpi,x+2,y,cm1) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
436 SET_4_YUV_PIXELS(mpi,x,y+2,cm2) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
437 SET_4_YUV_PIXELS(mpi,x+2,y+2,cm3) |
7285 | 438 return; |
439 } | |
440 | |
441 void *YUV2x2_Blk_Func(unsigned int image_type, int blks, unsigned int dith_flag) | |
442 { | |
7355 | 443 mp_dbg(MSGT_DECVIDEO,MSGL_DBG2, "YUV2x2_Blk_Func(image_type=%d, blks=%d, dith_flag=%d)\n", |
7285 | 444 image_type, blks, dith_flag); |
445 switch(blks){ | |
446 case 1: | |
447 return (void*) XA_2x2_OUT_1BLK_Convert; | |
448 case 4: | |
449 return (void*) XA_2x2_OUT_4BLKS_Convert; | |
450 } | |
451 | |
452 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Unimplemented: YUV2x2_Blk_Func(image_type=%d blks=%d dith=%d)\n",image_type,blks,dith_flag); | |
453 return (void*) XA_dummy; | |
454 } | |
455 | |
456 // Take Four Y's and UV and put them into a 2x2 Color structure. | |
457 | |
458 void XA_YUV_2x2_clr(XA_2x2_Color *cmap2x2, unsigned int Y0, unsigned int Y1, | |
459 unsigned int Y2, unsigned int Y3, unsigned int U, unsigned int V, | |
460 unsigned int map_flag, unsigned int *map, XA_CHDR *chdr) | |
461 { | |
462 | |
463 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "XA_YUV_2x2_clr(%p [%d,%d,%d,%d][%d][%d] %d %p %p)\n", | |
464 cmap2x2,Y0,Y1,Y2,Y3,U,V,map_flag,map,chdr); | |
465 | |
466 cmap2x2->clr0_0=Y0; | |
467 cmap2x2->clr0_1=Y1; | |
468 cmap2x2->clr0_2=Y2; | |
469 cmap2x2->clr0_3=Y3; | |
470 cmap2x2->clr1_0=U; | |
471 cmap2x2->clr1_1=V; | |
472 return; | |
473 } | |
474 | |
475 void *YUV2x2_Map_Func(unsigned int image_type, unsigned int dith_type) | |
476 { | |
7355 | 477 mp_dbg(MSGT_DECVIDEO,MSGL_DBG2, "YUV2x2_Map_Func('image_type: %d', 'dith_type: %d')", |
7285 | 478 image_type, dith_type); |
479 return((void*)XA_YUV_2x2_clr); | |
480 } | |
481 | |
482 /* -------------------- whole YUV frame converters ------------------------- */ | |
483 | |
484 typedef struct | |
485 { | |
486 unsigned char *Ybuf; | |
487 unsigned char *Ubuf; | |
488 unsigned char *Vbuf; | |
489 unsigned char *the_buf; | |
490 unsigned int the_buf_size; | |
491 unsigned short y_w, y_h; | |
492 unsigned short uv_w, uv_h; | |
493 } YUVBufs; | |
494 | |
495 typedef struct | |
496 { | |
497 unsigned long Uskip_mask; | |
498 long *YUV_Y_tab; | |
499 long *YUV_UB_tab; | |
500 long *YUV_VR_tab; | |
501 long *YUV_UG_tab; | |
502 long *YUV_VG_tab; | |
503 } YUVTabs; | |
504 | |
505 YUVBufs jpg_YUVBufs; | |
506 YUVTabs def_yuv_tabs; | |
507 | |
508 /* -------------- YUV 4x4 1x1 1x1 (4:1:0 aka YVU9) [Indeo 3,4,5] ------------------ */ | |
509 | |
510 void XA_YUV1611_Convert(unsigned char *image_p, unsigned int imagex, unsigned int imagey, | |
511 unsigned int i_x, unsigned int i_y, YUVBufs *yuv, YUVTabs *yuv_tabs, | |
512 unsigned int map_flag, unsigned int *map, XA_CHDR *chdr) | |
513 { | |
7355 | 514 sh_video_t *sh = (sh_video_t*)image_p; |
515 vd_xanim_ctx *priv = sh->context; | |
516 mp_image_t *mpi; | |
7285 | 517 int y; |
7355 | 518 int ystride=(yuv->y_w)?yuv->y_w:imagex; |
519 int uvstride=(yuv->uv_w)?yuv->uv_w:(imagex/4); | |
7285 | 520 |
521 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "YUVTabs: %d %p %p %p %p %p\n",yuv_tabs->Uskip_mask, | |
522 yuv_tabs->YUV_Y_tab, | |
523 yuv_tabs->YUV_UB_tab, | |
524 yuv_tabs->YUV_VR_tab, | |
525 yuv_tabs->YUV_UG_tab, | |
526 yuv_tabs->YUV_VG_tab ); | |
527 | |
528 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')", | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
529 image_p, imagex, imagey, i_x, i_y, yuv, yuv_tabs, map_flag, map, chdr); |
7285 | 530 |
531 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "YUV: %p %p %p %X (%d) %dx%d %dx%d\n", | |
532 yuv->Ybuf,yuv->Ubuf,yuv->Vbuf,yuv->the_buf,yuv->the_buf_size, | |
533 yuv->y_w,yuv->y_h,yuv->uv_w,yuv->uv_h); | |
534 | |
7355 | 535 if(!yuv_tabs->YUV_Y_tab){ |
536 // standard YVU9 - simply export it! | |
537 mpi = mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0, | |
538 sh->disp_w, sh->disp_h); | |
539 priv->mpi=mpi; if(!mpi) return; // ERROR! | |
540 mpi->planes[0]=yuv->Ybuf; | |
541 mpi->planes[1]=yuv->Ubuf; | |
542 mpi->planes[2]=yuv->Vbuf; | |
543 mpi->width=imagex; | |
544 mpi->stride[0]=ystride; //i_x; // yuv->y_w | |
545 mpi->stride[1]=mpi->stride[2]=uvstride; //i_x/4; // yuv->uv_w | |
7285 | 546 return; |
547 } | |
548 | |
7355 | 549 // allocate TEMP buffer and convert the image: |
550 mpi = mpcodecs_get_image(sh, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, | |
551 sh->disp_w, sh->disp_h); | |
552 priv->mpi=mpi; if(!mpi) return; // ERROR! | |
7285 | 553 |
7355 | 554 // convert the Y plane: |
555 for(y=0;y<(int)imagey;y++){ | |
556 unsigned int x; | |
557 unsigned char* s=yuv->Ybuf+ystride*y; | |
558 unsigned char* d=mpi->planes[0]+mpi->stride[0]*y; | |
559 for(x=0;x<imagex;x++) d[x]=s[x]<<1; | |
560 } | |
561 | |
7285 | 562 imagex>>=2; |
563 imagey>>=2; | |
564 | |
7355 | 565 // convert the U plane: |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
566 for(y=0;y<(int)imagey;y++){ |
7355 | 567 unsigned int x; |
568 unsigned char* s=yuv->Ubuf+uvstride*y; | |
569 unsigned char* d=mpi->planes[1]+mpi->stride[1]*y; | |
570 for(x=0;x<imagex;x++) d[x]=s[x]<<1; | |
7285 | 571 } |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
572 |
7355 | 573 // convert the V plane: |
574 for(y=0;y<(int)imagey;y++){ | |
575 unsigned int x; | |
576 unsigned char* s=yuv->Vbuf+uvstride*y; | |
577 unsigned char* d=mpi->planes[2]+mpi->stride[2]*y; | |
578 for(x=0;x<imagex;x++) d[x]=s[x]<<1; | |
579 } | |
7285 | 580 } |
581 | |
582 void *XA_YUV1611_Func(unsigned int image_type) | |
583 { | |
7355 | 584 mp_dbg(MSGT_DECVIDEO,MSGL_DBG2, "XA_YUV1611_Func('image_type: %d')", image_type); |
7285 | 585 return((void *)XA_YUV1611_Convert); |
586 } | |
587 | |
588 /* --------------- YUV 2x2 1x1 1x1 (4:2:0 aka YV12) [3ivX,H263] ------------ */ | |
589 | |
590 void XA_YUV221111_Convert(unsigned char *image_p, unsigned int imagex, unsigned int imagey, | |
591 unsigned int i_x, unsigned int i_y, YUVBufs *yuv, YUVTabs *yuv_tabs, unsigned int map_flag, | |
592 unsigned int *map, XA_CHDR *chdr) | |
593 { | |
7355 | 594 sh_video_t *sh = (sh_video_t*)image_p; |
595 vd_xanim_ctx *priv = sh->context; | |
596 mp_image_t *mpi; | |
597 // note: 3ivX codec doesn't set y_w, uv_w, they are random junk :( | |
598 int ystride=imagex; //(yuv->y_w)?yuv->y_w:imagex; | |
599 int uvstride=imagex/2; //(yuv->uv_w)?yuv->uv_w:(imagex/2); | |
7285 | 600 |
601 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "XA_YUV221111_Convert(%p %dx%d %d;%d [%dx%d] %p %p %d %p %p)\n", | |
7383 | 602 image_p,imagex,imagey,i_x,i_y, sh->disp_w, sh->disp_h, |
7285 | 603 yuv,yuv_tabs,map_flag,map,chdr); |
604 | |
605 mp_dbg(MSGT_DECVIDEO,MSGL_DBG3, "YUV: %p %p %p %X (%X) %Xx%X %Xx%X\n", | |
606 yuv->Ybuf,yuv->Ubuf,yuv->Vbuf,yuv->the_buf,yuv->the_buf_size, | |
607 yuv->y_w,yuv->y_h,yuv->uv_w,yuv->uv_h); | |
608 | |
7355 | 609 // standard YV12 - simply export it! |
610 mpi = mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0, sh->disp_w, sh->disp_h); | |
611 priv->mpi=mpi; if(!mpi) return; // ERROR! | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
612 mpi->planes[0]=yuv->Ybuf; |
7355 | 613 mpi->planes[1]=yuv->Ubuf; |
614 mpi->planes[2]=yuv->Vbuf; | |
615 mpi->width=imagex; | |
616 mpi->stride[0]=ystride; //i_x; // yuv->y_w | |
617 mpi->stride[1]=mpi->stride[2]=uvstride; //=i_x/4; // yuv->uv_w | |
7285 | 618 } |
619 | |
620 void *XA_YUV221111_Func(unsigned int image_type) | |
621 { | |
7355 | 622 mp_dbg(MSGT_DECVIDEO,MSGL_DBG2, "XA_YUV221111_Func('image_type: %d')\n",image_type); |
7285 | 623 return((void *)XA_YUV221111_Convert); |
624 } | |
625 | |
626 /* *** EOF XANIM *** */ | |
4969 | 627 |
628 // to set/get/query special features/parameters | |
629 static int control(sh_video_t *sh,int cmd,void* arg,...){ | |
630 return CONTROL_UNKNOWN; | |
631 } | |
632 | |
633 // init driver | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
634 static int init(sh_video_t *sh) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
635 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
636 vd_xanim_ctx *priv; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
637 char *def_path = XACODEC_PATH; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
638 char dll[1024]; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
639 XA_CODEC_HDR codec_hdr; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
640 int i; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
641 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
642 priv = malloc(sizeof(vd_xanim_ctx)); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
643 if (!priv) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
644 return 0; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
645 sh->context = priv; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
646 memset(priv, 0, sizeof(vd_xanim_ctx)); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
647 |
6525 | 648 if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12)) return 0; |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
649 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
650 priv->iq_func = NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
651 priv->dec_func = NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
652 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
653 for (i=0; i < XA_CLOSE_FUNCS; i++) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
654 xa_close_func[i] = NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
655 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
656 if (getenv("XANIM_MOD_DIR")) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
657 def_path = getenv("XANIM_MOD_DIR"); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
658 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
659 snprintf(dll, 1024, "%s/%s", def_path, sh->codec->dll); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
660 if (xacodec_load(sh, dll) == 0) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
661 return(0); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
662 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
663 codec_hdr.xapi_rev = XAVID_API_REV; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
664 codec_hdr.anim_hdr = malloc(4096); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
665 codec_hdr.description = sh->codec->info; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
666 codec_hdr.compression = bswap_32(sh->bih->biCompression); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
667 codec_hdr.decoder = NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
668 codec_hdr.x = sh->bih->biWidth; /* ->disp_w */ |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
669 codec_hdr.y = sh->bih->biHeight; /* ->disp_h */ |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
670 /* extra fields to store palette */ |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
671 codec_hdr.avi_ctab_flag = 0; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
672 codec_hdr.avi_read_ext = NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
673 codec_hdr.extra = NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
674 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
675 switch(sh->codec->outfmt[sh->outfmtidx]) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
676 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
677 case IMGFMT_BGR32: |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
678 codec_hdr.depth = 32; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
679 break; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
680 case IMGFMT_BGR24: |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
681 codec_hdr.depth = 24; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
682 break; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
683 case IMGFMT_IYUV: |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
684 case IMGFMT_I420: |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
685 case IMGFMT_YV12: |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
686 codec_hdr.depth = 12; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
687 break; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
688 case IMGFMT_YVU9: |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
689 codec_hdr.depth = 9; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
690 break; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
691 default: |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
692 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: not supported image out format (%s)\n", |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
693 vo_format_name(sh->codec->outfmt[sh->outfmtidx])); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
694 return(0); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
695 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
696 mp_msg(MSGT_DECVIDEO, MSGL_INFO, "xacodec: querying for input %dx%d %dbit [fourcc: %4x] (%s)...\n", |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
697 codec_hdr.x, codec_hdr.y, codec_hdr.depth, codec_hdr.compression, codec_hdr.description); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
698 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
699 if (xacodec_query(sh, &codec_hdr) == 0) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
700 return(0); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
701 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
702 // free(codec_hdr.anim_hdr); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
703 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
704 priv->decinfo = malloc(sizeof(XA_DEC_INFO)); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
705 if (priv->decinfo == NULL) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
706 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
707 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "xacodec: memory allocation error: %s\n", |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
708 strerror(errno)); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
709 return(0); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
710 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
711 priv->decinfo->cmd = 0; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
712 priv->decinfo->skip_flag = 0; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
713 priv->decinfo->imagex = priv->decinfo->xe = codec_hdr.x; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
714 priv->decinfo->imagey = priv->decinfo->ye = codec_hdr.y; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
715 priv->decinfo->imaged = codec_hdr.depth; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
716 priv->decinfo->chdr = NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
717 priv->decinfo->map_flag = 0; /* xaFALSE */ |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
718 priv->decinfo->map = NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
719 priv->decinfo->xs = priv->decinfo->ys = 0; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
720 priv->decinfo->special = 0; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
721 priv->decinfo->extra = codec_hdr.extra; |
17366 | 722 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "decinfo->extra, filled by codec: %p [%s]\n", |
723 &priv->decinfo->extra, (char *)priv->decinfo->extra); | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
724 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
725 return(1); |
4969 | 726 } |
727 | |
728 // uninit driver | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
729 static void uninit(sh_video_t *sh) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
730 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
731 vd_xanim_ctx *priv = sh->context; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
732 int i; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
733 void (*close_func)(); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
734 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
735 for (i=0; i < XA_CLOSE_FUNCS; i++) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
736 if (xa_close_func[i]) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
737 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
738 close_func = xa_close_func[i]; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
739 close_func(); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
740 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
741 dlclose(priv->file_handler); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
742 if (priv->decinfo != NULL) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
743 free(priv->decinfo); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
744 free(priv); |
4969 | 745 } |
746 | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
747 // unsigned int (*dec_func)(unsigned char *image, unsigned char *delta, |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
748 // unsigned int dsize, XA_DEC_INFO *dec_info); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
749 |
4969 | 750 // decode a frame |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
751 static mp_image_t* decode(sh_video_t *sh, void *data, int len, int flags) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
752 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
753 vd_xanim_ctx *priv = sh->context; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
754 unsigned int ret; |
4969 | 755 |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
756 if (len <= 0) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
757 return NULL; // skipped frame |
4969 | 758 |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
759 priv->decinfo->skip_flag = (flags&3)?1:0; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
760 |
7355 | 761 if(sh->codec->outflags[sh->outfmtidx] & CODECS_FLAG_STATIC){ |
762 // allocate static buffer for cvid-like codecs: | |
763 priv->mpi = mpcodecs_get_image(sh, MP_IMGTYPE_STATIC, | |
764 MP_IMGFLAG_ACCEPT_STRIDE|MP_IMGFLAG_PREFER_ALIGNED_STRIDE, | |
765 (sh->disp_w+3)&(~3), (sh->disp_h+3)&(~3)); | |
766 if (!priv->mpi) return NULL; | |
767 ret = priv->dec_func((uint8_t*)priv->mpi, data, len, priv->decinfo); | |
768 } else { | |
769 // left the buffer allocation to the codecs, pass sh_video && priv | |
770 priv->mpi=NULL; | |
771 ret = priv->dec_func((uint8_t*)sh, data, len, priv->decinfo); | |
772 } | |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
773 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
774 if (ret == ACT_DLTA_NORM) |
7355 | 775 return priv->mpi; |
4969 | 776 |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
777 if (ret & ACT_DLTA_MAPD) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
778 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "mapd\n"); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
779 /* |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
780 if (!(ret & ACT_DLT_MAPD)) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
781 xacodec_driver->decinfo->map_flag = 0; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
782 else |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
783 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
784 xacodec_driver->decinfo->map_flag = 1; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
785 xacodec_driver->decinfo->map = ... |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
786 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
787 */ |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
788 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
789 if (ret & ACT_DLTA_XOR) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
790 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
791 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "xor\n"); |
7355 | 792 return priv->mpi; |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
793 } |
4969 | 794 |
7298
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
795 /* nothing changed */ |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
796 if (ret & ACT_DLTA_NOP) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
797 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
798 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "nop\n"); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
799 return NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
800 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
801 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
802 /* frame dropped (also display latest frame) */ |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
803 if (ret & ACT_DLTA_DROP) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
804 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
805 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "drop\n"); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
806 return NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
807 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
808 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
809 if (ret & ACT_DLTA_BAD) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
810 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
811 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "bad\n"); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
812 return NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
813 } |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
814 |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
815 /* used for double buffer */ |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
816 if (ret & ACT_DLTA_BODY) |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
817 { |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
818 mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "body\n"); |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
819 return NULL; |
641b287f8b07
removed xacodec_driver, using sh->context instead, removed xacodec_image, using mpi instead, some warning fixes. note: mpi optimisations are still pending
alex
parents:
7285
diff
changeset
|
820 } |
4969 | 821 |
7355 | 822 return priv->mpi; |
4969 | 823 } |