Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
d8e44fce
Commit
d8e44fce
authored
Dec 13, 2001
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixed aspect ratio handling. * Fixed potential compilation issues under eg. BSD/OS.
parent
fb39f2e7
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
747 additions
and
653 deletions
+747
-653
Makefile.opts.in
Makefile.opts.in
+3
-0
configure
configure
+189
-179
configure.in
configure.in
+9
-1
include/common.h
include/common.h
+4
-3
include/modules_export.h
include/modules_export.h
+2
-0
include/video.h
include/video.h
+36
-19
include/video_output.h
include/video_output.h
+24
-70
plugins/directx/vout_directx.c
plugins/directx/vout_directx.c
+2
-2
plugins/dummy/vout_dummy.c
plugins/dummy/vout_dummy.c
+104
-66
plugins/imdct/Makefile
plugins/imdct/Makefile
+3
-3
plugins/mpeg_vdec/video_parser.h
plugins/mpeg_vdec/video_parser.h
+2
-2
plugins/mpeg_vdec/vpar_headers.c
plugins/mpeg_vdec/vpar_headers.c
+9
-15
plugins/sdl/vout_sdl.c
plugins/sdl/vout_sdl.c
+61
-42
plugins/x11/vout_common.c
plugins/x11/vout_common.c
+17
-19
plugins/x11/vout_common.h
plugins/x11/vout_common.h
+3
-3
plugins/x11/vout_xvideo.c
plugins/x11/vout_xvideo.c
+72
-96
src/video_output/video_output.c
src/video_output/video_output.c
+68
-39
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+120
-81
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+19
-13
No files found.
Makefile.opts.in
View file @
d8e44fce
...
...
@@ -80,6 +80,9 @@ LIB_GGI = @LIB_GGI@
LIB_GLIDE
=
@LIB_GLIDE@
LIB_GNOME
=
@LIB_GNOME@
LIB_GTK
=
@LIB_GTK@
LIB_IMDCT
=
@LIB_IMDCT@
LIB_IMDCT3DN
=
@LIB_IMDCT3DN@
LIB_IMDCTSSE
=
@LIB_IMDCTSSE@
LIB_KDE
=
@LIB_KDE@
LIB_LIBDVDCSS
=
@LIB_LIBDVDCSS@
LIB_MACOSX
=
@LIB_MACOSX@
...
...
configure
View file @
d8e44fce
This diff is collapsed.
Click to expand it.
configure.in
View file @
d8e44fce
...
...
@@ -145,7 +145,12 @@ AC_FUNC_MMAP
AC_TYPE_SIGNAL
AC_CHECK_LIB(dl,dlopen,LIB="${LIB} -ldl")
AC_CHECK_LIB(m,cos,LIB_IMDCT="${LIB_IMDCT} -lm")
AC_CHECK_LIB(m,pow,LIB_YUV="${LIB_YUV} -lm")
AC_CHECK_LIB(m,pow,
LIB_YUV="${LIB_YUV} -lm"
LIB_IMDCT="${LIB_IMDCT} -lm"
LIB_IMDCT3DN="${LIB_IMDCT3DN} -lm"
LIB_IMDCTSSE="${LIB_IMDCTSSE} -lm"
)
dnl Check for pthreads - borrowed from XMMS
THREAD_LIB=error
...
...
@@ -1260,6 +1265,9 @@ AC_SUBST(LIB_GGI)
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GNOME)
AC_SUBST(LIB_GTK)
AC_SUBST(LIB_IMDCT)
AC_SUBST(LIB_IMDCT3DN)
AC_SUBST(LIB_IMDCTSSE)
AC_SUBST(LIB_KDE)
AC_SUBST(LIB_LIBDVDCSS)
AC_SUBST(LIB_MACOSX)
...
...
include/common.h
View file @
d8e44fce
...
...
@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: common.h,v 1.5
7
2001/12/1
2 02:13:50
sam Exp $
* $Id: common.h,v 1.5
8
2001/12/1
3 12:47:17
sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
...
...
@@ -544,8 +544,7 @@ typedef struct module_symbols_s
struct
vout_thread_s
*
(
*
vout_CreateThread
)
(
int
*
,
int
,
int
,
int
,
int
);
struct
subpicture_s
*
(
*
vout_CreateSubPicture
)
(
struct
vout_thread_s
*
,
int
,
int
);
struct
picture_s
*
(
*
vout_CreatePicture
)
(
struct
vout_thread_s
*
,
int
,
int
,
int
,
int
);
struct
picture_s
*
(
*
vout_CreatePicture
)
(
struct
vout_thread_s
*
);
void
(
*
vout_DestroySubPicture
)
(
struct
vout_thread_s
*
,
struct
subpicture_s
*
);
...
...
@@ -561,6 +560,8 @@ typedef struct module_symbols_s
struct
picture_s
*
);
void
(
*
vout_DatePicture
)
(
struct
vout_thread_s
*
p_vout
,
struct
picture_s
*
p_pic
,
mtime_t
);
void
(
*
vout_PlacePicture
)
(
struct
vout_thread_s
*
,
int
,
int
,
int
*
,
int
*
,
int
*
,
int
*
);
u32
(
*
UnalignedShowBits
)
(
struct
bit_stream_s
*
,
unsigned
int
);
void
(
*
UnalignedRemoveBits
)
(
struct
bit_stream_s
*
);
...
...
include/modules_export.h
View file @
d8e44fce
...
...
@@ -96,6 +96,7 @@
(p_symbols)->vout_DatePicture = vout_DatePicture; \
(p_symbols)->vout_LinkPicture = vout_LinkPicture; \
(p_symbols)->vout_UnlinkPicture = vout_UnlinkPicture; \
(p_symbols)->vout_PlacePicture = vout_PlacePicture; \
(p_symbols)->UnalignedGetBits = UnalignedGetBits; \
(p_symbols)->UnalignedRemoveBits = UnalignedRemoveBits; \
(p_symbols)->UnalignedShowBits = UnalignedShowBits; \
...
...
@@ -205,6 +206,7 @@
# define vout_DatePicture p_symbols->vout_DatePicture
# define vout_LinkPicture p_symbols->vout_LinkPicture
# define vout_UnlinkPicture p_symbols->vout_UnlinkPicture
# define vout_PlacePicture p_symbols->vout_PlacePicture
# define DecodeLanguage p_symbols->DecodeLanguage
...
...
include/video.h
View file @
d8e44fce
...
...
@@ -4,7 +4,7 @@
* includes all common video types and constants.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video.h,v 1.3
3
2001/12/
09 17:01:35
sam Exp $
* $Id: video.h,v 1.3
4
2001/12/
13 12:47:17
sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
...
...
@@ -60,6 +60,7 @@ typedef struct picture_s
/* Type and flags - should NOT be modified except by the vout thread */
int
i_status
;
/* picture flags */
int
i_type
;
/* is picture a direct buffer ? */
int
i_matrix_coefficients
;
/* in YUV type, encoding type */
/* Picture management properties - these properties can be modified using
...
...
@@ -67,14 +68,6 @@ typedef struct picture_s
int
i_refcount
;
/* link reference counter */
mtime_t
date
;
/* display date */
/* Picture static properties - those properties are fixed at initialization
* and should NOT be modified */
int
i_width
;
/* picture width */
int
i_height
;
/* picture height */
int
i_chroma
;
/* picture chroma */
int
i_aspect_ratio
;
/* aspect ratio */
boolean_t
b_directbuffer
;
/* is it a direct buffer ? */
/* These values can be calculated from i_chroma, i_width and i_height
* but we leave them to prevent unnecessary calculation */
int
i_size
;
...
...
@@ -104,16 +97,31 @@ typedef struct picture_s
}
picture_t
;
/* Pictures chromas */
#define EMPTY_PICTURE 0
/* picture slot is empty and available */
#define YUV_420_PICTURE 100
/* 4:2:0 YUV picture */
#define YUV_422_PICTURE 101
/* 4:2:2 YUV picture */
#define YUV_444_PICTURE 102
/* 4:4:4 YUV picture */
#define RGB_8BPP_PICTURE 200
/* RGB 8bpp picture */
#define RGB_16BPP_PICTURE 201
/* RGB 16bpp picture */
#define RGB_32BPP_PICTURE 202
/* RGB 32bpp picture */
/*****************************************************************************
* picture_heap_t: video picture heap
*****************************************************************************/
typedef
struct
picture_heap_s
{
int
i_pictures
;
/* current heap size */
/* Pictures status */
/* Picture static properties - those properties are fixed at initialization
* and should NOT be modified */
int
i_width
;
/* picture width */
int
i_height
;
/* picture height */
int
i_chroma
;
/* picture chroma */
int
i_aspect
;
/* aspect ratio */
/* Real pictures */
picture_t
*
pp_picture
[
VOUT_MAX_PICTURES
];
/* pictures */
}
picture_heap_t
;
/* Picture type */
#define EMPTY_PICTURE 0
/* empty buffer */
#define MEMORY_PICTURE 100
/* heap-allocated buffer */
#define DIRECT_PICTURE 200
/* direct buffer */
/* Picture status */
#define FREE_PICTURE 0
/* free and not allocated */
#define RESERVED_PICTURE 1
/* allocated and reserved */
#define RESERVED_DATED_PICTURE 2
/* waiting for DisplayPicture */
...
...
@@ -122,7 +130,16 @@ typedef struct picture_s
#define DISPLAYED_PICTURE 5
/* been displayed but is linked */
#define DESTROYED_PICTURE 6
/* allocated but no more used */
/* Aspect ratios (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
/* Picture chroma */
#define EMPTY_PICTURE 0
/* picture slot is empty and available */
#define YUV_420_PICTURE 100
/* 4:2:0 YUV picture */
#define YUV_422_PICTURE 101
/* 4:2:2 YUV picture */
#define YUV_444_PICTURE 102
/* 4:4:4 YUV picture */
#define RGB_8BPP_PICTURE 200
/* RGB 8bpp picture */
#define RGB_16BPP_PICTURE 201
/* RGB 16bpp picture */
#define RGB_32BPP_PICTURE 202
/* RGB 32bpp picture */
/* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
#define AR_SQUARE_PICTURE 1
/* square pixels */
#define AR_3_4_PICTURE 2
/* 3:4 picture (TV) */
#define AR_16_9_PICTURE 3
/* 16:9 picture (wide screen) */
...
...
include/video_output.h
View file @
d8e44fce
...
...
@@ -5,7 +5,7 @@
* thread, and destroy a previously oppenned video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.6
4
2001/12/
09 17:01:35
sam Exp $
* $Id: video_output.h,v 1.6
5
2001/12/
13 12:47:17
sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
...
...
@@ -68,27 +68,6 @@ typedef struct vout_chroma_s
}
vout_chroma_t
;
/*****************************************************************************
* vout_buffer_t: rendering buffer
*****************************************************************************
* This structure stores information about a buffer. Buffers are not completely
* cleared between displays, and modified areas need to be stored.
*****************************************************************************/
typedef
struct
vout_buffer_s
{
/* Picture area */
int
i_pic_x
,
i_pic_y
;
/* picture position */
int
i_pic_width
,
i_pic_height
;
/* picture size */
/* Other areas - only vertical extensions of areas are stored */
int
i_areas
;
/* number of areas */
int
pi_area_begin
[
VOUT_MAX_AREAS
];
/* beginning of area */
int
pi_area_end
[
VOUT_MAX_AREAS
];
/* end of area */
/* Picture data */
byte_t
*
p_data
;
/* memory address */
}
vout_buffer_t
;
/*****************************************************************************
* vout_fifo_t
*****************************************************************************/
...
...
@@ -128,32 +107,15 @@ typedef struct vout_thread_s
int
*
pi_status
;
/* temporary status flag */
p_vout_sys_t
p_sys
;
/* system output method */
/* Current input properties */
int
i_width
;
/* current input width */
int
i_height
;
/* current input height */
int
i_chroma
;
/* current input chroma */
int
i_aspect_ratio
;
/* current input aspect ratio */
/* Current display properties */
u16
i_changes
;
/* changes made to the thread */
float
f_gamma
;
/* gamma */
/* Color masks and shifts in RGB mode - masks are set by system
* initialization, shifts are calculated. A pixel color value can be
* obtained using the formula ((value >> rshift) << lshift) */
u32
i_red_mask
;
/* red mask */
u32
i_green_mask
;
/* green mask */
u32
i_blue_mask
;
/* blue mask */
int
i_red_lshift
,
i_red_rshift
;
/* red shifts */
int
i_green_lshift
,
i_green_rshift
;
/* green shifts */
int
i_blue_lshift
,
i_blue_rshift
;
/* blue shifts */
/* Useful pre-calculated pixel values - these are not supposed to be
* accurate values, but rather values looking nice, given their usage. */
u32
i_white_pixel
;
/* white */
u32
i_black_pixel
;
/* black */
u32
i_gray_pixel
;
/* gray */
u32
i_blue_pixel
;
/* blue */
boolean_t
b_grayscale
;
/* color or grayscale display */
boolean_t
b_info
;
/* print additional information */
boolean_t
b_interface
;
/* render interface */
boolean_t
b_scale
;
/* allow picture scaling */
boolean_t
b_fullscreen
;
/* toogle fullscreen display */
mtime_t
render_time
;
/* last picture render time */
/* Plugin used and shortcuts to access its capabilities */
struct
module_s
*
p_module
;
...
...
@@ -167,26 +129,21 @@ typedef struct vout_thread_s
void
(
*
pf_setpalette
)
(
struct
vout_thread_s
*
,
u16
*
,
u16
*
,
u16
*
);
/* Pictures and rendering properties */
boolean_t
b_grayscale
;
/* color or grayscale display */
boolean_t
b_info
;
/* print additional information */
boolean_t
b_interface
;
/* render interface */
boolean_t
b_scale
;
/* allow picture scaling */
boolean_t
b_fullscreen
;
/* toogle fullscreen display */
mtime_t
render_time
;
/* last picture render time */
/* Statistics - these numbers are not supposed to be accurate, but are a
* good indication of the thread status */
count_t
c_fps_samples
;
/* picture counts */
mtime_t
p_fps_sample
[
VOUT_FPS_SAMPLES
];
/* FPS samples dates */
/* Video heap and translation tables */
int
i_heap_size
;
/* heap size */
picture_heap_t
render
;
/* rendered pictures */
picture_heap_t
output
;
/* direct buffers */
boolean_t
b_direct
;
/* rendered are like direct ? */
vout_chroma_t
chroma
;
/* translation tables */
/* Picture and subpicture heaps */
picture_t
p_picture
[
VOUT_MAX_PICTURES
];
/* pictures */
subpicture_t
p_subpicture
[
VOUT_MAX_PICTURES
];
/* subpictures */
int
i_directbuffers
;
/* number of pictures in VRAM */
int
i_pictures
;
/* current heap size */
vout_chroma_t
chroma
;
/* translation tables */
/* Bitmap fonts */
p_vout_font_t
p_default_font
;
/* default font */
...
...
@@ -200,6 +157,11 @@ typedef struct vout_thread_s
* calculation of the jitter */
}
vout_thread_t
;
#define I_OUTPUTPICTURES p_vout->output.i_pictures
#define PP_OUTPUTPICTURE p_vout->output.pp_picture
#define I_RENDERPICTURES p_vout->render.i_pictures
#define PP_RENDERPICTURE p_vout->render.pp_picture
/* Flags for changes - these flags are set in the i_changes field when another
* thread changed a variable */
#define VOUT_INFO_CHANGE 0x0001
/* b_info changed */
...
...
@@ -218,17 +180,6 @@ typedef struct vout_thread_s
#define MAX_JITTER_SAMPLES 20
/*****************************************************************************
* Macros
*****************************************************************************/
/* RGB2PIXEL: assemble RGB components to a pixel value, returns a u32 */
#define RGB2PIXEL( p_vout, i_red, i_green, i_blue ) \
(((((u32)i_red) >> p_vout->i_red_rshift) << p_vout->i_red_lshift) | \
((((u32)i_green) >> p_vout->i_green_rshift) << p_vout->i_green_lshift) | \
((((u32)i_blue) >> p_vout->i_blue_rshift) << p_vout->i_blue_lshift))
/*****************************************************************************
* Prototypes
*****************************************************************************/
...
...
@@ -242,7 +193,7 @@ vout_fifo_t * vout_CreateFifo ( void );
void
vout_DestroyFifo
(
vout_fifo_t
*
);
void
vout_FreeFifo
(
vout_fifo_t
*
);
picture_t
*
vout_CreatePicture
(
vout_thread_t
*
,
int
,
int
,
int
,
int
);
picture_t
*
vout_CreatePicture
(
vout_thread_t
*
);
void
vout_DestroyPicture
(
vout_thread_t
*
,
picture_t
*
);
void
vout_DisplayPicture
(
vout_thread_t
*
,
picture_t
*
);
void
vout_DatePicture
(
vout_thread_t
*
,
picture_t
*
,
mtime_t
);
...
...
@@ -250,10 +201,13 @@ void vout_LinkPicture ( vout_thread_t *, picture_t * );
void
vout_UnlinkPicture
(
vout_thread_t
*
,
picture_t
*
);
picture_t
*
vout_RenderPicture
(
vout_thread_t
*
,
picture_t
*
,
subpicture_t
*
);
void
vout_PlacePicture
(
vout_thread_t
*
,
int
,
int
,
int
*
,
int
*
,
int
*
,
int
*
);
subpicture_t
*
vout_CreateSubPicture
(
vout_thread_t
*
,
int
,
int
);
void
vout_DestroySubPicture
(
vout_thread_t
*
,
subpicture_t
*
);
void
vout_DisplaySubPicture
(
vout_thread_t
*
,
subpicture_t
*
);
subpicture_t
*
vout_SortSubPictures
(
vout_thread_t
*
,
mtime_t
);
void
vout_RenderSubPictures
(
picture_t
*
,
subpicture_t
*
);
void
vout_RenderSubPictures
(
vout_thread_t
*
,
picture_t
*
,
subpicture_t
*
);
plugins/directx/vout_directx.c
View file @
d8e44fce
...
...
@@ -2,7 +2,7 @@
* vout_directx.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: vout_directx.c,v 1.1
5
2001/12/
07 18:33:0
7 sam Exp $
* $Id: vout_directx.c,v 1.1
6
2001/12/
13 12:47:1
7 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -1355,7 +1355,7 @@ static void DirectXKeepAspectRatio( vout_thread_t *p_vout, RECT *rect_window )
if
(
!
p_vout
->
p_rendered_pic
)
return
;
switch
(
p_vout
->
p_rendered_pic
->
i_aspect
_ratio
)
switch
(
p_vout
->
p_rendered_pic
->
i_aspect
)
{
case
AR_16_9_PICTURE
:
if
(
((
rect_window
->
right
-
rect_window
->
left
)
*
9
)
...
...
plugins/dummy/vout_dummy.c
View file @
d8e44fce
...
...
@@ -2,7 +2,7 @@
* vout_dummy.c: Dummy video output display method for testing purposes
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_dummy.c,v 1.1
0
2001/12/
09 17:01:36
sam Exp $
* $Id: vout_dummy.c,v 1.1
1
2001/12/
13 12:47:17
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -72,6 +72,8 @@ static void vout_Destroy ( struct vout_thread_s * );
static
int
vout_Manage
(
struct
vout_thread_s
*
);
static
void
vout_Display
(
struct
vout_thread_s
*
,
struct
picture_s
*
);
static
int
DummyNewPicture
(
struct
vout_thread_s
*
,
struct
picture_s
*
);
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
...
...
@@ -124,91 +126,62 @@ static int vout_Create( vout_thread_t *p_vout )
*****************************************************************************/
static
int
vout_Init
(
vout_thread_t
*
p_vout
)
{
int
i_index
;
picture_t
*
p_pic
;
int
i_index
=
0
;
int
i_luma_bytes
,
i_chroma_bytes
;
I_OUTPUTPICTURES
=
0
;
/*
Try to i
nitialize
DUMMY_MAX_DIRECTBUFFERS direct buffers
*/
while
(
i_index
<
DUMMY_MAX_DIRECTBUFFERS
)
/*
I
nitialize
the output structure
*/
switch
(
p_vout
->
render
.
i_chroma
)
{
p_pic
=
&
p_vout
->
p_picture
[
i_index
];
switch
(
p_vout
->
i_chroma
)
{
/* We know this chroma, allocate a buffer which will be used
* directly by the decoder */
case
YUV_420_PICTURE
:
p_pic
->
i_chroma
=
YUV_420_PICTURE
;
p_pic
->
i_width
=
p_vout
->
i_width
;
p_pic
->
i_height
=
p_vout
->
i_height
;
/* Precalculate some values */
p_pic
->
i_size
=
p_vout
->
i_width
*
p_vout
->
i_height
;
p_pic
->
i_chroma_width
=
p_vout
->
i_width
/
2
;
p_pic
->
i_chroma_size
=
p_vout
->
i_width
*
p_vout
->
i_height
/
2
;
/* Allocate the memory buffer */
i_luma_bytes
=
p_pic
->
i_size
*
sizeof
(
pixel_data_t
);
i_chroma_bytes
=
p_pic
->
i_chroma_size
*
sizeof
(
pixel_data_t
);
/* Y buffer */
p_pic
->
planes
[
Y_PLANE
].
p_data
=
malloc
(
i_luma_bytes
+
2
*
i_chroma_bytes
);
p_pic
->
planes
[
Y_PLANE
].
i_bytes
=
i_luma_bytes
;
/* U buffer */
p_pic
->
planes
[
U_PLANE
].
p_data
=
p_pic
->
planes
[
Y_PLANE
].
p_data
+
p_pic
->
i_height
*
p_pic
->
i_width
;
p_pic
->
planes
[
U_PLANE
].
i_bytes
=
i_chroma_bytes
;
/* V buffer */
p_pic
->
planes
[
V_PLANE
].
p_data
=
p_pic
->
planes
[
U_PLANE
].
p_data
+
p_pic
->
i_height
*
p_pic
->
i_chroma_width
;
p_pic
->
planes
[
V_PLANE
].
i_bytes
=
i_chroma_bytes
;
/* We allocated 3 planes */
p_pic
->
i_planes
=
3
;
p_vout
->
output
.
i_chroma
=
p_vout
->
render
.
i_chroma
;
p_vout
->
output
.
i_width
=
p_vout
->
render
.
i_width
;
p_vout
->
output
.
i_height
=
p_vout
->
render
.
i_height
;
p_vout
->
output
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
break
;
/* Unknown chroma, allocate an RGB buffer, the video output's job
* will be to do the chroma->RGB conversion */
default:
p_vout
->
output
.
i_chroma
=
RGB_16BPP_PICTURE
;
p_vout
->
output
.
i_width
=
p_vout
->
render
.
i_width
;
p_vout
->
output
.
i_height
=
p_vout
->
render
.
i_height
;
p_vout
->
output
.
i_aspect
=
p_vout
->
render
.
i_aspect
;
break
;
}
p_pic
->
i_chroma
=
RGB_16BPP_PICTURE
;
p_pic
->
i_width
=
DUMMY_WIDTH
;
p_pic
->
i_height
=
DUMMY_HEIGHT
;
/* Precalculate some values */
i_luma_bytes
=
sizeof
(
u16
)
*
DUMMY_WIDTH
*
DUMMY_HEIGHT
;
/* Allocate the memory buffer */
p_pic
->
planes
[
RGB_PLANE
].
p_data
=
malloc
(
i_luma_bytes
);
p_pic
->
planes
[
RGB_PLANE
].
i_bytes
=
i_luma_bytes
;
/* We allocated 1 plane */
p_pic
->
i_planes
=
1
;
/* Try to initialize DUMMY_MAX_DIRECTBUFFERS direct buffers */
while
(
I_OUTPUTPICTURES
<
DUMMY_MAX_DIRECTBUFFERS
)
{
p_pic
=
NULL
;
break
;
/* Find an empty picture slot */
for
(
i_index
=
0
;
i_index
<
VOUT_MAX_PICTURES
;
i_index
++
)
{
if
(
p_vout
->
p_picture
[
i_index
].
i_status
==
FREE_PICTURE
)
{
p_pic
=
p_vout
->
p_picture
+
i_index
;
break
;
}
}
if
(
p_pic
->
i_planes
==
0
)
/* Allocate the picture */
if
(
DummyNewPicture
(
p_vout
,
p_pic
)
)
{
break
;
}
p_pic
->
i_status
=
DESTROYED_PICTURE
;
p_pic
->
b_directbuffer
=
1
;
p_pic
->
i_type
=
DIRECT_PICTURE
;
p_pic
->
i_left_margin
=
p_pic
->
i_right_margin
=
p_pic
->
i_top_margin
=
p_pic
->
i_bottom_margin
=
0
;
i_index
++
;
}
PP_OUTPUTPICTURE
[
I_OUTPUTPICTURES
]
=
p_pic
;
/* How many directbuffers did we create ? */
p_vout
->
i_directbuffers
=
i_index
;
I_OUTPUTPICTURES
++
;
}
return
(
0
);
}
...
...
@@ -220,11 +193,11 @@ static void vout_End( vout_thread_t *p_vout )
{
int
i_index
;
/* Free the fake
direc
t buffers we allocated */
for
(
i_index
=
p_vout
->
i_directbuffers
;
i_index
;
)
/* Free the fake
outpu
t buffers we allocated */
for
(
i_index
=
I_OUTPUTPICTURES
;
i_index
;
)
{
i_index
--
;
free
(
p_vout
->
p_picture
[
i_index
]
.
planes
[
0
].
p_data
);
free
(
PP_OUTPUTPICTURE
[
i_index
]
->
planes
[
0
].
p_data
);
}
}
...
...
@@ -260,3 +233,68 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
/* No need to do anything, the fake direct buffers stay as they are */
}
/*****************************************************************************
* DummyNewPicture: allocate a picture
*****************************************************************************
* Returns 0 on success, -1 otherwise
*****************************************************************************/
static
int
DummyNewPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
)
{
int
i_luma_bytes
,
i_chroma_bytes
;
int
i_width
=
p_vout
->
output
.
i_width
;
int
i_height
=
p_vout
->
output
.
i_height
;
switch
(
p_vout
->
output
.
i_chroma
)
{
/* We know this chroma, allocate a buffer which will be used
* directly by the decoder */
case
YUV_420_PICTURE
:
/* Precalculate some values */
p_pic
->
i_size
=
i_width
*
i_height
;
p_pic
->
i_chroma_width
=
i_width
/
2
;
p_pic
->
i_chroma_size
=
i_width
*
i_height
/
2
;
/* Allocate the memory buffer */
i_luma_bytes
=
p_pic
->
i_size
*
sizeof
(
pixel_data_t
);
i_chroma_bytes
=
p_pic
->
i_chroma_size
*
sizeof
(
pixel_data_t
);
/* Y buffer */
p_pic
->
planes
[
Y_PLANE
].
p_data
=
malloc
(
i_luma_bytes
+
2
*
i_chroma_bytes
);
p_pic
->
planes
[
Y_PLANE
].
i_bytes
=
i_luma_bytes
;
/* U buffer */
p_pic
->
planes
[
U_PLANE
].
p_data
=
p_pic
->
planes
[
Y_PLANE
].
p_data
+
i_height
*
i_width
;
p_pic
->
planes
[
U_PLANE
].
i_bytes
=
i_chroma_bytes
;
/* V buffer */
p_pic
->
planes
[
V_PLANE
].
p_data
=
p_pic
->
planes
[
U_PLANE
].
p_data
+
i_height
*
p_pic
->
i_chroma_width
;
p_pic
->
planes
[
V_PLANE
].
i_bytes
=
i_chroma_bytes
;
/* We allocated 3 planes */
p_pic
->
i_planes
=
3
;
return
(
0
);
break
;
/* Unknown chroma, allocate an RGB buffer, the video output's job
* will be to do the chroma->RGB conversion */
default:
/* Precalculate some values */
i_luma_bytes
=
sizeof
(
u16
)
*
i_width
*
i_height
;
/* Allocate the memory buffer */
p_pic
->
planes
[
RGB_PLANE
].
p_data
=
malloc
(
i_luma_bytes
);
p_pic
->
planes
[
RGB_PLANE
].
i_bytes
=
i_luma_bytes
;
/* We allocated 1 plane */
p_pic
->
i_planes
=
1
;
return
(
0
);
break
;
}
}
plugins/imdct/Makefile
View file @
d8e44fce
...
...
@@ -44,21 +44,21 @@ $(BUILTIN_IMDCT3DN): BUILTIN_IMDCT3DN_%.o: %.c
# Real targets
#
../imdct.so
:
$(PLUGIN_IMDCT) $(PLUGIN_IMDCTCOMMON)
../imdct.so
:
$(PLUGIN_IMDCT) $(PLUGIN_IMDCTCOMMON)
$(LIB_IMDCT)
$(CC)
-o
$@
$^
$(PLCFLAGS)
../imdct.a
:
$(BUILTIN_IMDCT)
ar r
$@
$^
$(RANLIB)
$@
../imdctsse.so
:
$(PLUGIN_IMDCTSSE) $(PLUGIN_IMDCTCOMMON)
../imdctsse.so
:
$(PLUGIN_IMDCTSSE) $(PLUGIN_IMDCTCOMMON)
$(LIB_IMDCTSSE)
$(CC)
-o
$@
$^
$(PLCFLAGS)
../imdctsse.a
:
$(BUILTIN_IMDCTSSE)
ar r
$@
$^
$(RANLIB)
$@
../imdct3dn.so
:
$(PLUGIN_IMDCT3DN) $(PLUGIN_IMDCTCOMMON)
../imdct3dn.so
:
$(PLUGIN_IMDCT3DN) $(PLUGIN_IMDCTCOMMON)
$(LIB_IMDCT3DN)
$(CC)
-o
$@
$^
$(PLCFLAGS)
../imdct3dn.a
:
$(BUILTIN_IMDCT3DN)
...
...
plugins/mpeg_vdec/video_parser.h
View file @
d8e44fce
...
...
@@ -2,7 +2,7 @@
* video_parser.h : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.h,v 1.
1
2001/1
1
/13 12:
09:18 henri
Exp $
* $Id: video_parser.h,v 1.
2
2001/1
2
/13 12:
47:17 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr>
...
...
@@ -113,7 +113,7 @@ typedef struct sequence_s
u32
i_size
;
/* total number of pel of the lum comp */
u32
i_mb_height
,
i_mb_width
,
i_mb_size
;
/* the same, in macroblock units */
unsigned
int
i_aspect
_ratio
;
/* height/width display ratio */
unsigned
int
i_aspect
;
/* height/width display ratio */
unsigned
int
i_matrix_coefficients
;
/* coeffs of the YUV transform */
int
i_chroma_format
,
i_scalable_mode
;
int
i_chroma_nb_blocks
;
...
...
plugins/mpeg_vdec/vpar_headers.c
View file @
d8e44fce
...
...
@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: vpar_headers.c,v 1.
5
2001/12/1
0
1
0:58:54 massiot
Exp $
* $Id: vpar_headers.c,v 1.
6
2001/12/1
3
1
2:47:17 sam
Exp $
*