annotate libvo/vo_fsdga.c @ 354:7de9e48c83a5

memcpy() moved mmx.h -> fastmemcpy.h
author arpi_esp
date Wed, 11 Apr 2001 19:41:38 +0000
parents 46f3aa28aa83
children 77e0094f0cce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
1 #define DISP
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
2
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
3 /*
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
4 * video_out_dga.c, X11 interface
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
5 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
6 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
7 * Copyright ( C ) 2001, Andreas Ackermann. All Rights Reserved.
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
8 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
9 * <acki@acki-netz.de>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
10 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
11 * note well:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
12 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
13 * o this is alpha
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
14 * o covers only common video card formats
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
15 * o works only on intel architectures
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
16 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
17 */
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
18
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
19
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
20
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
21 #include <stdio.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
22 #include <stdlib.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
23 #include <string.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
24
354
7de9e48c83a5 memcpy() moved mmx.h -> fastmemcpy.h
arpi_esp
parents: 38
diff changeset
25 //#include "fastmemcpy.h"
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
26
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
27 #include "linux/keycodes.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
28 #include "config.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
29 #include "video_out.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
30 #include "video_out_internal.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
31 #include "yuv2rgb.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
32
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
33 LIBVO_EXTERN( fsdga )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
34
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
35 #include <X11/Xlib.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
36 #include <X11/extensions/xf86dga.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
37
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
38 #include "x11_common.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
39
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
40 static vo_info_t vo_info =
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
41 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
42 "FullScreen DGA ( Direct Graphic Access )",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
43 "fsdga",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
44 "A'rpi/ESP-team & Andreas Ackermann <acki@acki-netz.de>",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
45 ""
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
46 };
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
47
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
48 static int vo_dga_width; // bytes per line in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
49 static int vo_dga_vp_width; // visible pixels per line in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
50 static int vo_dga_vp_height; // visible lines in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
51 static int vo_dga_is_running = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
52 static int vo_dga_src_width; // width of video in pixels
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
53 static int vo_dga_src_height; // height of video in pixels
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
54 static int vo_dga_bpp; // bytes per pixel in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
55 static int vo_dga_src_offset=0; // offset in src
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
56 static int vo_dga_vp_offset=0; // offset in dest
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
57 static int vo_dga_bytes_per_line; // longwords per line to copy
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
58 static int vo_dga_src_skip; // bytes to skip after copying one line
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
59 // (not supported yet) in src
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
60 static int vo_dga_vp_skip; // dto. for dest
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
61 static int vo_dga_lines; // num of lines to copy
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
62 static int vo_dga_src_format;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
63
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
64 static unsigned char *vo_dga_base;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
65 static Display *vo_dga_dpy;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
66
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
67
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
68 #if defined (HAVE_SSE) || defined (HAVE_3DNOW)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
69 #define movntq "movntq" // use this for processors that have SSE or 3Dnow
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
70 #else
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
71 #define movntq "movq" // for MMX-only processors
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
72 #endif
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
73
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
74
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
75 #define rep_movsl(dest, src, numwords, d_add, count) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
76 __asm__ __volatile__( \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
77 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
78 xfer: \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
79 movl %%edx, %%ecx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
80 cld\n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
81 rep\n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
82 movsl \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
83 add %%eax, %%edi \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
84 dec %%ebx \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
85 jnz xfer \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
86 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
87 : \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
88 : "a" (d_add), "b" (count), "S" (src), "D" (dest), "d" (numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
89 : "memory" )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
90
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
91 #if 0
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
92 : "S" (src), "D" (dest), "c" (numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
93 movq (%%eax), %%mm0 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
94 add $64, %%edx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
95 movq 8(%%eax), %%mm1 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
96 add $64, %%eax \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
97 movq -48(%%eax), %%mm2 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
98 movq %%mm0, -64(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
99 movq -40(%%eax), %%mm3 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
100 movq %%mm1, -56(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
101 movq -32(%%eax), %%mm4 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
102 movq %%mm2, -48(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
103 movq -24(%%eax), %%mm5 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
104 movq %%mm3, -40(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
105 movq -16(%%eax), %%mm6 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
106 movq %%mm4, -32(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
107 movq -8(%%eax), %%mm7 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
108 movq %%mm5, -24(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
109 movq %%mm6, -16(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
110 dec %%ecx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
111 movq %%mm7, -8(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
112 jnz xfer \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
113
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
114 #endif
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
115
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
116 #define mmx_movsl(dest, src, numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
117 __asm__ __volatile__( \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
118 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
119 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
120 xfer: \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
121 movq (%%eax), %%mm0 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
122 add $64, %%edx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
123 movq 8(%%eax), %%mm1 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
124 add $64, %%eax \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
125 movq -48(%%eax), %%mm2 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
126 movq %%mm0, -64(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
127 movq -40(%%eax), %%mm3 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
128 movq %%mm1, -56(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
129 movq -32(%%eax), %%mm4 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
130 movq %%mm2, -48(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
131 movq -24(%%eax), %%mm5 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
132 movq %%mm3, -40(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
133 movq -16(%%eax), %%mm6 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
134 movq %%mm4, -32(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
135 movq -8(%%eax), %%mm7 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
136 movq %%mm5, -24(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
137 movq %%mm6, -16(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
138 dec %%ecx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
139 movq %%mm7, -8(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
140 jnz xfer \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
141 \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
142 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
143 : \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
144 : "a" (src), "d" (dest), "c" (numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
145 : "memory" )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
146
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
147 // src <= eax
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
148 // dst <= edx
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
149 // num <= ecx
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
150
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
151 static uint32_t draw_frame( uint8_t *src[] ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
152
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
153 int vp_skip = vo_dga_vp_skip;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
154 int lpl = vo_dga_bytes_per_line >> 2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
155 int numlines = vo_dga_lines;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
156
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
157 char *s, *d;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
158
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
159 if( vo_dga_src_format==IMGFMT_YV12 ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
160 // We'll never reach this point, because YV12 codecs always calls draw_slice
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
161 printf("vo_dga: draw_frame() doesn't support IMGFMT_YV12 (yet?)\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
162 }else{
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
163 s = *src;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
164 d = (&((char *)vo_dga_base)[vo_dga_vp_offset]);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
165 rep_movsl(d, s, lpl, vo_dga_vp_skip, numlines );
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
166 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
167
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
168 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
169 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
170
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
171 static void check_events(void)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
172 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
173 int e=vo_x11_check_events(vo_dga_dpy);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
174 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
175
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
176 static void flip_page( void ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
177 check_events();
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
178 // printf("vo_dga: In flippage\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
179
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
180 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
181
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
182 static unsigned int pix_buf_y[4][2048];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
183 static unsigned int pix_buf_uv[2][2048*2];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
184 static int dga_srcypos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
185 static int dga_ypos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
186 static int dga_last_ypos=-1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
187 static unsigned int dga_xinc,dga_yinc,dga_xinc2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
188
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
189 static unsigned char clip_table[768];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
190
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
191 static int yuvtab_2568[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
192 static int yuvtab_3343[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
193 static int yuvtab_0c92[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
194 static int yuvtab_1a1e[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
195 static int yuvtab_40cf[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
196
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
197
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
198 static uint32_t draw_slice( uint8_t *srcptr[],int stride[],
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
199 int w,int h,int x,int y )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
200 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
201
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
202 if(y==0){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
203 dga_srcypos=-2*dga_yinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
204 dga_ypos=-2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
205 dga_last_ypos=-2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
206 } // reset counters
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
207
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
208 while(1){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
209 unsigned char *dest=vo_dga_base+(vo_dga_width * dga_ypos)*vo_dga_bpp;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
210 int y0=2+(dga_srcypos>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
211 int y1=1+(dga_srcypos>>17);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
212 int yalpha=(dga_srcypos&0xFFFF)>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
213 int yalpha1=yalpha^255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
214 int uvalpha=((dga_srcypos>>1)&0xFFFF)>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
215 int uvalpha1=uvalpha^255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
216 unsigned int *buf0=pix_buf_y[y0&3];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
217 unsigned int *buf1=pix_buf_y[((y0+1)&3)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
218 unsigned int *uvbuf0=pix_buf_uv[y1&1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
219 unsigned int *uvbuf1=pix_buf_uv[(y1&1)^1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
220 int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
221
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
222 if(y0>=y+h) break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
223
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
224 dga_ypos++; dga_srcypos+=dga_yinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
225
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
226 if(dga_last_ypos!=y0){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
227 unsigned char *src=srcptr[0]+(y0-y)*stride[0];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
228 unsigned int xpos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
229 dga_last_ypos=y0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
230 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
231 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
232 register unsigned int xx=xpos>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
233 register unsigned int xalpha=xpos&0xFF;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
234 buf1[i]=(src[xx]*(xalpha^255)+src[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
235 xpos+=dga_xinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
236 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
237 if(!(y0&1)){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
238 unsigned char *src1=srcptr[1]+(y1-y/2)*stride[1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
239 unsigned char *src2=srcptr[2]+(y1-y/2)*stride[2];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
240 xpos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
241 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
242 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
243 register unsigned int xx=xpos>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
244 register unsigned int xalpha=xpos&0xFF;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
245 uvbuf1[i]=(src1[xx]*(xalpha^255)+src1[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
246 uvbuf1[i+2048]=(src2[xx]*(xalpha^255)+src2[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
247 xpos+=dga_xinc2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
248 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
249 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
250 if(!y0) continue;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
251 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
252
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
253 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
254 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
255 // linear interpolation && yuv2rgb in a single step:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
256 int Y=yuvtab_2568[((buf0[i]*yalpha1+buf1[i]*yalpha)>>16)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
257 int U=((uvbuf0[i]*uvalpha1+uvbuf1[i]*uvalpha)>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
258 int V=((uvbuf0[i+2048]*uvalpha1+uvbuf1[i+2048]*uvalpha)>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
259 dest[0]=clip_table[((Y + yuvtab_3343[U]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
260 dest[1]=clip_table[((Y + yuvtab_0c92[V] + yuvtab_1a1e[U]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
261 dest[2]=clip_table[((Y + yuvtab_40cf[V]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
262 dest+=vo_dga_bpp;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
263 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
264
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
265 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
266
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
267
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
268 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
269 };
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
270
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
271 static void Terminate_Display_Process( void ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
272
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
273 printf("vo_dga: Terminating display process\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
274 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
275
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
276 static const vo_info_t* get_info( void )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
277 { return &vo_info; }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
278
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
279 static uint32_t query_format( uint32_t format )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
280 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
281 printf("vo_dga: query_format\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
282
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
283 if( !vo_init() ) return 0; // Can't open X11
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
284 printf("Format: %lx\n", format);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
285
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
286 if( format==IMGFMT_YV12 ) return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
287 if( ( format&IMGFMT_BGR_MASK )==IMGFMT_BGR &&
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
288 ( format&0xFF )==vo_depthonscreen ) return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
289 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
290 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
291
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
292
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
293 static void
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
294 uninit(void)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
295 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
296
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
297 vo_dga_is_running = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
298 printf("vo_dga: in uninit\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
299 XUngrabPointer (vo_dga_dpy, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
300 XUngrabKeyboard (vo_dga_dpy, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
301 XF86DGADirectVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
302 XCloseDisplay(vo_dga_dpy);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
303 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
304
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
305
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
306
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
307
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
308 static uint32_t init( uint32_t width, uint32_t height,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
309 uint32_t d_width,uint32_t d_height,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
310 uint32_t fullscreen,char *title,uint32_t format )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
311 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
312
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
313 int bank, ram;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
314 int x_off, y_off;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
315
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
316 if( vo_dga_is_running )return -1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
317
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
318 if( !vo_init() ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
319 printf("vo_dga: vo_init() failed!\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
320 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
321 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
322
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
323 if((vo_dga_dpy = XOpenDisplay(0))==NULL)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
324 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
325 printf ("vo_dga: Can't open display\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
326 return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
327 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
328
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
329 XF86DGAGetVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
330 (char **)&vo_dga_base, &vo_dga_width, &bank, &ram);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
331 XF86DGAGetViewPortSize (vo_dga_dpy, XDefaultScreen (vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
332 &vo_dga_vp_width, &vo_dga_vp_height);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
333
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
334
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
335 // do some more checkings here ...
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
336 if( format==IMGFMT_YV12 )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
337 yuv2rgb_init( vo_depthonscreen, MODE_RGB );
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
338
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
339 vo_dga_src_format = format;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
340 vo_dga_src_width = width;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
341 vo_dga_src_height = height;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
342 vo_dga_bpp = (vo_depthonscreen+7) >> 3;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
343
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
344 printf("vo_dga: bytes/line: %d, screen res: %dx%d, depth: %d, base: %08x, bpp: %d\n",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
345 vo_dga_width, vo_dga_vp_width,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
346 vo_dga_vp_height, vo_depthonscreen, vo_dga_base,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
347 vo_dga_bpp);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
348 printf("vo_dga: video res: %dx%d\n", vo_dga_src_width, vo_dga_src_height);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
349
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
350 if(vo_dga_src_width > vo_dga_vp_width ||
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
351 vo_dga_src_height > vo_dga_vp_height){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
352 printf("vo_dga: Sorry, video larger than viewport is not yet supported!\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
353 // ugly, do something nicer in the future ...
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
354 return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
355 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
356
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
357 x_off = (vo_dga_vp_width - vo_dga_src_width)>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
358 y_off = (vo_dga_vp_height - vo_dga_src_height)>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
359
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
360 vo_dga_bytes_per_line = vo_dga_src_width * vo_dga_bpp; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
361 vo_dga_lines = vo_dga_src_height; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
362
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
363
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
364 vo_dga_src_offset = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
365 vo_dga_vp_offset = (y_off * vo_dga_width + x_off ) * vo_dga_bpp;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
366
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
367 vo_dga_vp_skip = (vo_dga_width - vo_dga_src_width) * vo_dga_bpp; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
368
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
369 printf("vo_dga: vp_off=%d, vp_skip=%d, bpl=%d\n",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
370 vo_dga_vp_offset, vo_dga_vp_skip, vo_dga_bytes_per_line);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
371
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
372
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
373
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
374 XF86DGASetViewPort (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 0, 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
375 XF86DGADirectVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
376 XF86DGADirectGraphics | XF86DGADirectMouse |
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
377 XF86DGADirectKeyb);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
378
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
379 XGrabKeyboard (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
380 GrabModeAsync,GrabModeAsync, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
381 XGrabPointer (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
382 ButtonPressMask,GrabModeAsync, GrabModeAsync,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
383 None, None, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
384
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
385 // now clear screen
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
386
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
387 memset(vo_dga_base, 0, vo_dga_width * vo_dga_vp_height * vo_dga_bpp);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
388
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
389 dga_yinc=(vo_dga_src_height<<16)/vo_dga_vp_height;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
390 dga_xinc=(vo_dga_src_width<<8)/vo_dga_vp_width;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
391 dga_xinc2=dga_xinc>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
392
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
393 { int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
394 for(i=0;i<256;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
395 clip_table[i]=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
396 clip_table[i+256]=i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
397 clip_table[i+512]=255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
398 yuvtab_2568[i]=(0x2568*(i-16))+(256<<13);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
399 yuvtab_3343[i]=0x3343*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
400 yuvtab_0c92[i]=-0x0c92*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
401 yuvtab_1a1e[i]=-0x1a1e*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
402 yuvtab_40cf[i]=0x40cf*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
403 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
404 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
405
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
406 vo_dga_is_running = 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
407 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
408 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
409
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
410 #if 0
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
411 int vo_dga_query_event(void){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
412
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
413 XEvent myevent;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
414 char text[10];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
415 KeySym mykey;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
416 int retval = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
417 int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
418
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
419 if( vo_dga_is_running ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
420 if(XPending(vo_dga_dpy)>0)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
421 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
422 XNextEvent(vo_dga_dpy, &myevent);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
423 switch (myevent.type)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
424 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
425 case ButtonPress:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
426 /* Reaktion auf Knopfdruck ---> Textausgabe an der
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
427 Mauscursorposition */
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
428
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
429 retval = 'q';
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
430 break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
431 case KeyPress:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
432 /* Reaktion auf Tastendruck --> Testen ob Taste == "q",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
433 falls ja: Programmende */
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
434 i=XLookupString(&myevent, text, 10, &mykey, 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
435
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
436 if (mykey&0xff00 != 0) mykey=mykey&0x00ff + 256;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
437
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
438 switch ( mykey )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
439 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
440 case wsLeft: retval=KEY_LEFT; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
441 case wsRight: retval=KEY_RIGHT; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
442 case wsUp: retval=KEY_UP; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
443 case wsDown: retval=KEY_DOWN; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
444 case wsSpace: retval=' '; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
445 case wsEscape: retval=KEY_ESC; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
446 case wsEnter: retval=KEY_ENTER; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
447 case wsq:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
448 case wsQ: retval='q'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
449 case wsp:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
450 case wsP: retval='p'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
451 case wsMinus:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
452 case wsGrayMinus: retval='-'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
453 case wsPlus:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
454 case wsGrayPlus: retval='+'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
455 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
456 break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
457 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
458 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
459 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
460 return retval;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
461 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
462 #endif
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
463
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
464
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
465
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
466
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
467
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
468