Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
9b4528b5
Commit
9b4528b5
authored
Jan 17, 2000
by
Vincent Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gestion des touches en GGI (ouf !)
parent
22c1b3b1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
127 deletions
+69
-127
Makefile
Makefile
+4
-3
include/video.h
include/video.h
+2
-2
include/video_output.h
include/video_output.h
+5
-6
src/interface/intf_msg.c
src/interface/intf_msg.c
+2
-2
src/video_output/video_ggi.c
src/video_output/video_ggi.c
+12
-0
src/video_output/video_output.c
src/video_output/video_output.c
+41
-9
src/video_output/video_yuv_c.c
src/video_output/video_yuv_c.c
+3
-105
No files found.
Makefile
View file @
9b4528b5
...
...
@@ -14,10 +14,10 @@
#SHELL = /bin/sh
# Video output settings
VIDEO
=
X11
#
VIDEO=X11
#VIDEO=DGA (not yet supported)
#VIDEO=FB
#
VIDEO=GGI
VIDEO
=
GGI
#VIDEO=BEOS (not yet supported)
# Target architecture and optimization
...
...
@@ -173,7 +173,8 @@ audio_output_obj = audio_output/audio_output.o \
audio_output/audio_dsp.o
video_output_obj
=
video_output/video_output.o
\
video_output/video_
$(video)
.o
video_output/video_
$(video)
.o
\
video_output/video_yuv_c.o
ac3_decoder_obj
=
ac3_decoder/ac3_decoder.o
...
...
include/video.h
View file @
9b4528b5
...
...
@@ -33,8 +33,8 @@ typedef struct
/* Picture properties - those properties are fixed at initialization and
* should NOT be modified. Note that for YUV pictures, i_bytes_per_line is
* the number of bytes for
ONE of the Y, U or V pictures, and therefore the
*
number of bytes in the picture is 3 * i_height * i_bytes_per_line
*/
* the number of bytes for
Y samples - the total size allocated will depend
*
of the picture format
*/
int
i_width
;
/* picture width */
int
i_height
;
/* picture height */
int
i_bytes_per_line
;
/* total number of bytes per line */
...
...
include/video_output.h
View file @
9b4528b5
...
...
@@ -65,12 +65,11 @@ typedef struct vout_thread_s
* on use. All tables are allocated in the same memory block, based at
* p_trans_base, and shifted depending of the output thread configuration */
byte_t
*
p_trans_base
;
/* base for all translation tables */
void
*
p_trans_red
;
void
*
p_trans_green
;
void
*
p_trans_blue
;
void
*
p_trans_gray
;
/* YUV translation tables, for optimized C YUV transform ?? */
void
*
p_trans_red
;
/* regular red */
void
*
p_trans_green
;
/* regular green */
void
*
p_trans_blue
;
/* regular blue */
void
*
p_trans_gray
;
/* regular gray */
void
*
p_trans_optimized
;
/* optimized (all colors) */
}
vout_thread_t
;
/*******************************************************************************
...
...
src/interface/intf_msg.c
View file @
9b4528b5
...
...
@@ -128,8 +128,8 @@ p_intf_msg_t intf_MsgCreate( void )
* and no log will be issued, but this is not considered as an
* error */
p_msg
->
i_log_file
=
open
(
DEBUG_LOG
,
O_CREAT
|
O_
APPEND
|
O_SYNC
|
O_WRONLY
,
0
777
);
O_CREAT
|
O_
TRUNC
|
O_SYNC
|
O_WRONLY
,
0
666
);
#endif
}
return
(
p_msg
);
...
...
src/video_output/video_ggi.c
View file @
9b4528b5
...
...
@@ -204,6 +204,18 @@ void vout_SysPrint( vout_thread_t *p_vout, int i_x, int i_y, int i_halign,
ggiPuts
(
p_vout
->
p_sys
->
p_display
,
i_x
,
i_y
,
psz_text
);
}
/*******************************************************************************
* vout_SysGetVisual: send visual to interface driver
*******************************************************************************
* This function is not part of the regular vout_Sys* API, but is used by GGI
* interface to get back visual display pointer once the output thread has
* been spawned. This visual is used to keep track of keyboard events.
*******************************************************************************/
ggi_visual_t
vout_SysGetVisual
(
vout_thread_t
*
p_vout
)
{
return
(
p_vout
->
p_sys
->
p_display
);
}
/* following functions are local */
/*******************************************************************************
...
...
src/video_output/video_output.c
View file @
9b4528b5
...
...
@@ -134,7 +134,7 @@ const int MATRIX_COEFFICIENTS_TABLE[8][4] =
* External prototypes
*******************************************************************************/
#ifdef HAVE_MMX
/* YUV transformations for MMX - in
yuv-
mmx.S
/* YUV transformations for MMX - in
video_yuv_
mmx.S
* p_y, p_u, p_v: Y U and V planes
* i_width, i_height: frames dimensions (pixels)
* i_ypitch, i_vpitch: Y and V lines sizes (bytes)
...
...
@@ -152,6 +152,16 @@ void vout_YUV420_16_MMX( u8* p_y, u8* p_u, u8 *p_v,
int
CCOPitch
,
int
i_colortype
);
#endif
/* Optimized YUV functions: translations and tables building - in video_yuv_c.c
* ??? looks efficient, but does not work well - ask walken */
void
yuvToRgb16
(
unsigned
char
*
Y
,
unsigned
char
*
U
,
unsigned
char
*
V
,
short
*
dest
,
short
table
[
1935
],
int
width
);
int
rgbTable16
(
short
table
[
1935
],
int
redMask
,
int
greenMask
,
int
blueMask
,
unsigned
char
gamma
[
256
]);
/*******************************************************************************
* Local prototypes
*******************************************************************************/
...
...
@@ -413,9 +423,19 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, int i_type,
/* Allocate memory */
switch
(
i_type
)
{
case
YUV_420_PICTURE
:
/* YUV picture: bits per pixel */
case
YUV_422_PICTURE
:
case
YUV_444_PICTURE
:
case
YUV_420_PICTURE
:
/* YUV 420: 1,1/4,1/4 samples per pixel */
p_free_picture
->
p_data
=
malloc
(
i_height
*
i_bytes_per_line
*
3
/
2
);
p_free_picture
->
p_y
=
(
yuv_data_t
*
)
p_free_picture
->
p_data
;
p_free_picture
->
p_u
=
(
yuv_data_t
*
)(
p_free_picture
->
p_data
+
i_height
*
i_bytes_per_line
);
p_free_picture
->
p_v
=
(
yuv_data_t
*
)(
p_free_picture
->
p_data
+
i_height
*
i_bytes_per_line
*
5
/
4
);
break
;
case
YUV_422_PICTURE
:
/* YUV 422: 1,1/2,1/2 samples per pixel */
p_free_picture
->
p_data
=
malloc
(
2
*
i_height
*
i_bytes_per_line
);
p_free_picture
->
p_y
=
(
yuv_data_t
*
)
p_free_picture
->
p_data
;
p_free_picture
->
p_u
=
(
yuv_data_t
*
)(
p_free_picture
->
p_data
+
i_height
*
i_bytes_per_line
);
p_free_picture
->
p_v
=
(
yuv_data_t
*
)(
p_free_picture
->
p_data
+
i_height
*
i_bytes_per_line
*
3
/
2
);
break
;
case
YUV_444_PICTURE
:
/* YUV 444: 1,1,1 samples per pixel */
p_free_picture
->
p_data
=
malloc
(
3
*
i_height
*
i_bytes_per_line
);
p_free_picture
->
p_y
=
(
yuv_data_t
*
)
p_free_picture
->
p_data
;
p_free_picture
->
p_u
=
(
yuv_data_t
*
)(
p_free_picture
->
p_data
+
i_height
*
i_bytes_per_line
);
...
...
@@ -556,16 +576,17 @@ static int InitThread( vout_thread_t *p_vout )
}
/* Allocate translation tables */
p_vout
->
p_trans_base
=
malloc
(
4
*
1024
*
p_vout
->
i_bytes_per_pixel
);
p_vout
->
p_trans_base
=
malloc
(
(
4
*
1024
+
1935
)
*
p_vout
->
i_bytes_per_pixel
);
if
(
p_vout
->
p_trans_base
==
NULL
)
{
intf_ErrMsg
(
"error: %s
\n
"
,
strerror
(
ENOMEM
));
return
(
1
);
}
p_vout
->
p_trans_red
=
p_vout
->
p_trans_base
+
384
*
p_vout
->
i_bytes_per_pixel
;
p_vout
->
p_trans_green
=
p_vout
->
p_trans_base
+
(
1024
+
384
)
*
p_vout
->
i_bytes_per_pixel
;
p_vout
->
p_trans_blue
=
p_vout
->
p_trans_base
+
(
2
*
1024
+
384
)
*
p_vout
->
i_bytes_per_pixel
;
p_vout
->
p_trans_gray
=
p_vout
->
p_trans_base
+
(
3
*
1024
+
384
)
*
p_vout
->
i_bytes_per_pixel
;
p_vout
->
p_trans_red
=
p_vout
->
p_trans_base
+
384
*
p_vout
->
i_bytes_per_pixel
;
p_vout
->
p_trans_green
=
p_vout
->
p_trans_base
+
(
1024
+
384
)
*
p_vout
->
i_bytes_per_pixel
;
p_vout
->
p_trans_blue
=
p_vout
->
p_trans_base
+
(
2
*
1024
+
384
)
*
p_vout
->
i_bytes_per_pixel
;
p_vout
->
p_trans_gray
=
p_vout
->
p_trans_base
+
(
3
*
1024
+
384
)
*
p_vout
->
i_bytes_per_pixel
;
p_vout
->
p_trans_optimized
=
p_vout
->
p_trans_base
+
(
4
*
1024
)
*
p_vout
->
i_bytes_per_pixel
;
/* Build translation tables */
BuildTables
(
p_vout
);
...
...
@@ -832,6 +853,7 @@ static void BuildTables( vout_thread_t *p_vout )
/* Build gamma table */
for
(
i_index
=
0
;
i_index
<
256
;
i_index
++
)
{
//?? add contrast and brightness
i_gamma
[
i_index
]
=
255
.
*
pow
(
(
double
)
i_index
/
255
.,
p_vout
->
f_gamma
);
}
...
...
@@ -874,6 +896,15 @@ static void BuildTables( vout_thread_t *p_vout )
break
;
#endif
}
/* Build red, green and blue tables for optimized transformation */
//????
switch
(
p_vout
->
i_screen_depth
)
{
case
16
:
rgbTable16
(
(
short
*
)
p_vout
->
p_trans_optimized
,
0xf800
,
0x07e0
,
0x01f
,
i_gamma
);
break
;
}
}
/*******************************************************************************
...
...
@@ -1033,6 +1064,7 @@ static void RenderYUV16Picture( vout_thread_t *p_vout, picture_t *p_pic )
p_trans_green
,
p_trans_blue
,
p_data
);
//??? yuvToRgb16( p_y, p_u, p_v, p_data, p_vout->p_trans_optimized, i_width*i_height );
#endif
break
;
case
YUV_422_PICTURE
:
/* 15 or 16 bpp 422 transformation */
...
...
src/video_output/video_yuv_c.c
View file @
9b4528b5
...
...
@@ -7,7 +7,7 @@
#include <stdlib.h>
/* malloc */
#include "convert.h"
//
#include "convert.h"
static
int
binaryLog
(
int
i
)
{
...
...
@@ -68,7 +68,7 @@ static int colorMaskToShift (int * right, int * left, int mask)
* calculated to minimize the cache interactions of the 3 tables.
*/
static
int
rgbTable16
(
short
table
[
1935
],
int
rgbTable16
(
short
table
[
1935
],
int
redMask
,
int
greenMask
,
int
blueMask
,
unsigned
char
gamma
[
256
])
{
...
...
@@ -184,7 +184,7 @@ static int rgbTable32 (int table [1935],
#define V_RED_COEF ((int)(1.596 * (1<<SHIFT) / 1.164))
#define V_GREEN_COEF ((int)(-0.813 * (1<<SHIFT) / 1.164))
static
void
yuvToRgb16
(
unsigned
char
*
Y
,
void
yuvToRgb16
(
unsigned
char
*
Y
,
unsigned
char
*
U
,
unsigned
char
*
V
,
short
*
dest
,
short
table
[
1935
],
int
width
)
{
...
...
@@ -733,105 +733,3 @@ static void yuvToRgb32 (unsigned char * Y,
/* API routines */
int
convertGrey
(
CONVERTER
*
convert
,
DISPLAY
*
disp
)
{
if
((
convert
==
NULL
)
||
(
disp
==
NULL
))
return
1
;
if
(
greyRgbTable
(
disp
))
return
1
;
switch
(
disp
->
bytesPerPixel
)
{
case
2
:
convert
->
convert
=
&
greyToRgb16
;
break
;
case
3
:
convert
->
convert
=
&
greyToRgb24
;
break
;
case
4
:
convert
->
convert
=
&
greyToRgb32
;
break
;
default:
return
1
;
}
convert
->
table
=
disp
->
greyRgbTable
;
return
0
;
}
static
void
*
greyRgbTable
(
DISP_COLORS
*
colors
,
unsigned
char
gamma
[
256
])
{
/* FIXME could avoid recalculating the same table */
void
*
table
;
for
(
i
=
0
;
i
<
16
;
i
++
)
gamma
[
i
]
=
0
;
#define Y_COEF ((int)(1.164 * 65536))
for
(;
i
<=
235
;
i
++
)
gamma
[
i
]
=
(
Y_COEF
*
i
-
Y_COEF
*
16
)
>>
16
;
#undef Y_COEF
for
(;
i
<
256
;
i
++
)
gamma
[
i
]
=
255
;
}
switch
(
colors
->
bytesPerPixel
)
{
case
2
:
table
=
malloc
(
256
*
sizeof
(
short
));
if
(
table
==
NULL
)
break
;
if
(
greyRgb16Table
(
table
,
colors
->
redMask
,
colors
->
greenMask
,
colors
->
blueMask
,
gamma
))
goto
error
;
return
table
;
case
3
:
case
4
:
table
=
malloc
(
256
*
sizeof
(
int
));
if
(
table
==
NULL
)
break
;
if
(
greyRgb32Table
(
table
,
colors
->
redMask
,
colors
->
greenMask
,
colors
->
blueMask
,
gamma
))
goto
error
;
return
table
;
error:
free
(
table
);
}
return
NULL
;
}
static
void
*
rgbTable
(
DISP_COLORS
*
colors
,
unsigned
char
gamma
[
256
])
{
/* FIXME could avoid recalculating the same table */
void
*
table
;
switch
(
colors
->
bytesPerPixel
)
{
case
2
:
table
=
malloc
(
1935
*
sizeof
(
short
));
if
(
table
==
NULL
)
break
;
if
(
rgbTable16
(
table
,
colors
->
redMask
,
colors
->
greenMask
,
colors
->
blueMask
,
gamma
))
goto
error
;
return
table
;
case
3
:
case
4
:
table
=
malloc
(
1935
*
sizeof
(
int
));
if
(
table
==
NULL
)
break
;
if
(
rgbTable32
(
table
,
colors
->
redMask
,
colors
->
greenMask
,
colors
->
blueMask
,
gamma
))
goto
error
;
return
table
;
error:
free
(
table
);
}
return
NULL
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment