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