annotate libmpcodecs/vd_xanim.c @ 7365:822923446b66

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