annotate libvo/vo_fsdga.c @ 1895:0213c552aa70

*** empty log message ***
author jaf
date Sun, 16 Sep 2001 07:12:39 +0000
parents d40f2b686846
children ae79207a3055
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
1501
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
176 static void draw_osd(void)
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
177 {
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
178 }
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
179
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
180 static void flip_page( void ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
181 // printf("vo_dga: In flippage\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
182 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
183
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
184 static unsigned int pix_buf_y[4][2048];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
185 static unsigned int pix_buf_uv[2][2048*2];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
186 static int dga_srcypos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
187 static int dga_ypos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
188 static int dga_last_ypos=-1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
189 static unsigned int dga_xinc,dga_yinc,dga_xinc2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
190
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
191 static unsigned char clip_table[768];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
192
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
193 static int yuvtab_2568[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
194 static int yuvtab_3343[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
195 static int yuvtab_0c92[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
196 static int yuvtab_1a1e[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
197 static int yuvtab_40cf[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
198
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
199
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
200 static uint32_t draw_slice( uint8_t *srcptr[],int stride[],
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
201 int w,int h,int x,int y )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
202 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
203
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
204 if(y==0){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
205 dga_srcypos=-2*dga_yinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
206 dga_ypos=-2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
207 dga_last_ypos=-2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
208 } // reset counters
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
209
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
210 while(1){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
211 unsigned char *dest=vo_dga_base+(vo_dga_width * dga_ypos)*vo_dga_bpp;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
212 int y0=2+(dga_srcypos>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
213 int y1=1+(dga_srcypos>>17);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
214 int yalpha=(dga_srcypos&0xFFFF)>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
215 int yalpha1=yalpha^255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
216 int uvalpha=((dga_srcypos>>1)&0xFFFF)>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
217 int uvalpha1=uvalpha^255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
218 unsigned int *buf0=pix_buf_y[y0&3];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
219 unsigned int *buf1=pix_buf_y[((y0+1)&3)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
220 unsigned int *uvbuf0=pix_buf_uv[y1&1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
221 unsigned int *uvbuf1=pix_buf_uv[(y1&1)^1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
222 int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
223
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
224 if(y0>=y+h) break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
225
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
226 dga_ypos++; dga_srcypos+=dga_yinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
227
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
228 if(dga_last_ypos!=y0){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
229 unsigned char *src=srcptr[0]+(y0-y)*stride[0];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
230 unsigned int xpos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
231 dga_last_ypos=y0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
232 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
233 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
234 register unsigned int xx=xpos>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
235 register unsigned int xalpha=xpos&0xFF;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
236 buf1[i]=(src[xx]*(xalpha^255)+src[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
237 xpos+=dga_xinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
238 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
239 if(!(y0&1)){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
240 unsigned char *src1=srcptr[1]+(y1-y/2)*stride[1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
241 unsigned char *src2=srcptr[2]+(y1-y/2)*stride[2];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
242 xpos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
243 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
244 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
245 register unsigned int xx=xpos>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
246 register unsigned int xalpha=xpos&0xFF;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
247 uvbuf1[i]=(src1[xx]*(xalpha^255)+src1[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
248 uvbuf1[i+2048]=(src2[xx]*(xalpha^255)+src2[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
249 xpos+=dga_xinc2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
250 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
251 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
252 if(!y0) continue;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
253 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
254
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
255 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
256 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
257 // linear interpolation && yuv2rgb in a single step:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
258 int Y=yuvtab_2568[((buf0[i]*yalpha1+buf1[i]*yalpha)>>16)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
259 int U=((uvbuf0[i]*uvalpha1+uvbuf1[i]*uvalpha)>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
260 int V=((uvbuf0[i+2048]*uvalpha1+uvbuf1[i+2048]*uvalpha)>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
261 dest[0]=clip_table[((Y + yuvtab_3343[U]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
262 dest[1]=clip_table[((Y + yuvtab_0c92[V] + yuvtab_1a1e[U]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
263 dest[2]=clip_table[((Y + yuvtab_40cf[V]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
264 dest+=vo_dga_bpp;
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
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
269
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
270 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
271 };
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
272
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
273 static void Terminate_Display_Process( void ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
274
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
275 printf("vo_dga: Terminating display process\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
276 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
277
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
278 static const vo_info_t* get_info( void )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
279 { return &vo_info; }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
280
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
281 static uint32_t query_format( uint32_t format )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
282 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
283 printf("vo_dga: query_format\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
284
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
285 if( !vo_init() ) return 0; // Can't open X11
612
77e0094f0cce some warnings killed
szabii
parents: 354
diff changeset
286 printf("Format: %lx\n", (unsigned long) format);
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
287
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
288 if( format==IMGFMT_YV12 ) return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
289 if( ( format&IMGFMT_BGR_MASK )==IMGFMT_BGR &&
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
290 ( format&0xFF )==vo_depthonscreen ) return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
291 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
292 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
293
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
294
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
295 static void
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
296 uninit(void)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
297 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
298
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
299 vo_dga_is_running = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
300 printf("vo_dga: in uninit\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
301 XUngrabPointer (vo_dga_dpy, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
302 XUngrabKeyboard (vo_dga_dpy, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
303 XF86DGADirectVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
304 XCloseDisplay(vo_dga_dpy);
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
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
309
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
310 static uint32_t init( uint32_t width, uint32_t height,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
311 uint32_t d_width,uint32_t d_height,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
312 uint32_t fullscreen,char *title,uint32_t format )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
313 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
314
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
315 int bank, ram;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
316 int x_off, y_off;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
317
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
318 if( vo_dga_is_running )return -1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
319
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
320 if( !vo_init() ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
321 printf("vo_dga: vo_init() failed!\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
322 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
323 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
324
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
325 if((vo_dga_dpy = XOpenDisplay(0))==NULL)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
326 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
327 printf ("vo_dga: Can't open display\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
328 return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
329 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
330
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
331 XF86DGAGetVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
332 (char **)&vo_dga_base, &vo_dga_width, &bank, &ram);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
333 XF86DGAGetViewPortSize (vo_dga_dpy, XDefaultScreen (vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
334 &vo_dga_vp_width, &vo_dga_vp_height);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
335
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
336
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
337 // do some more checkings here ...
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
338 if( format==IMGFMT_YV12 )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
339 yuv2rgb_init( vo_depthonscreen, MODE_RGB );
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
340
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
341 vo_dga_src_format = format;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
342 vo_dga_src_width = width;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
343 vo_dga_src_height = height;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
344 vo_dga_bpp = (vo_depthonscreen+7) >> 3;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
345
612
77e0094f0cce some warnings killed
szabii
parents: 354
diff changeset
346 printf("vo_dga: bytes/line: %d, screen res: %dx%d, depth: %d, base: %p, bpp: %d\n",
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
347 vo_dga_width, vo_dga_vp_width,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
348 vo_dga_vp_height, vo_depthonscreen, vo_dga_base,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
349 vo_dga_bpp);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
350 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
351
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
352 if(vo_dga_src_width > vo_dga_vp_width ||
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
353 vo_dga_src_height > vo_dga_vp_height){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
354 printf("vo_dga: Sorry, video larger than viewport is not yet supported!\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
355 // ugly, do something nicer in the future ...
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
356 return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
357 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
358
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
359 x_off = (vo_dga_vp_width - vo_dga_src_width)>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
360 y_off = (vo_dga_vp_height - vo_dga_src_height)>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
361
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
362 vo_dga_bytes_per_line = vo_dga_src_width * vo_dga_bpp; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
363 vo_dga_lines = vo_dga_src_height; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
364
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
365
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
366 vo_dga_src_offset = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
367 vo_dga_vp_offset = (y_off * vo_dga_width + x_off ) * vo_dga_bpp;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
368
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
369 vo_dga_vp_skip = (vo_dga_width - vo_dga_src_width) * vo_dga_bpp; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
370
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
371 printf("vo_dga: vp_off=%d, vp_skip=%d, bpl=%d\n",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
372 vo_dga_vp_offset, vo_dga_vp_skip, vo_dga_bytes_per_line);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
373
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
374
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
375
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
376 XF86DGASetViewPort (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 0, 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
377 XF86DGADirectVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
378 XF86DGADirectGraphics | XF86DGADirectMouse |
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
379 XF86DGADirectKeyb);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
380
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
381 XGrabKeyboard (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
382 GrabModeAsync,GrabModeAsync, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
383 XGrabPointer (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
384 ButtonPressMask,GrabModeAsync, GrabModeAsync,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
385 None, None, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
386
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
387 // now clear screen
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
388
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
389 memset(vo_dga_base, 0, vo_dga_width * vo_dga_vp_height * vo_dga_bpp);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
390
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
391 dga_yinc=(vo_dga_src_height<<16)/vo_dga_vp_height;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
392 dga_xinc=(vo_dga_src_width<<8)/vo_dga_vp_width;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
393 dga_xinc2=dga_xinc>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
394
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
395 { int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
396 for(i=0;i<256;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
397 clip_table[i]=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
398 clip_table[i+256]=i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
399 clip_table[i+512]=255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
400 yuvtab_2568[i]=(0x2568*(i-16))+(256<<13);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
401 yuvtab_3343[i]=0x3343*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
402 yuvtab_0c92[i]=-0x0c92*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
403 yuvtab_1a1e[i]=-0x1a1e*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
404 yuvtab_40cf[i]=0x40cf*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
405 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
406 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
407
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
408 vo_dga_is_running = 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
409 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
410 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
411
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
412 #if 0
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
413 int vo_dga_query_event(void){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
414
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
415 XEvent myevent;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
416 char text[10];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
417 KeySym mykey;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
418 int retval = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
419 int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
420
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
421 if( vo_dga_is_running ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
422 if(XPending(vo_dga_dpy)>0)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
423 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
424 XNextEvent(vo_dga_dpy, &myevent);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
425 switch (myevent.type)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
426 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
427 case ButtonPress:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
428 /* Reaktion auf Knopfdruck ---> Textausgabe an der
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
429 Mauscursorposition */
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
430
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
431 retval = 'q';
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
432 break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
433 case KeyPress:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
434 /* Reaktion auf Tastendruck --> Testen ob Taste == "q",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
435 falls ja: Programmende */
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
436 i=XLookupString(&myevent, text, 10, &mykey, 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
437
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
438 if (mykey&0xff00 != 0) mykey=mykey&0x00ff + 256;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
439
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
440 switch ( mykey )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
441 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
442 case wsLeft: retval=KEY_LEFT; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
443 case wsRight: retval=KEY_RIGHT; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
444 case wsUp: retval=KEY_UP; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
445 case wsDown: retval=KEY_DOWN; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
446 case wsSpace: retval=' '; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
447 case wsEscape: retval=KEY_ESC; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
448 case wsEnter: retval=KEY_ENTER; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
449 case wsq:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
450 case wsQ: retval='q'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
451 case wsp:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
452 case wsP: retval='p'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
453 case wsMinus:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
454 case wsGrayMinus: retval='-'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
455 case wsPlus:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
456 case wsGrayPlus: retval='+'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
457 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
458 break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
459 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
460 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
461 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
462 return retval;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
463 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
464 #endif
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
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
469
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
470