Commit e70d9d1f authored by Vincent Seguin's avatar Vincent Seguin

Changement de l'API de vout (chroma_width)

Nettoyage des YUV.

Ne marche qu'en -g pour le moment, le reste arrive.
parent c871659c
...@@ -22,7 +22,7 @@ VIDEO=X11 ...@@ -22,7 +22,7 @@ VIDEO=X11
# Target architecture and optimization # Target architecture and optimization
#ARCH= #ARCH=
ARCH=MMX #ARCH=MMX
#ARCH=PPC #ARCH=PPC
# Decoder choice - ?? old decoder will be removed soon # Decoder choice - ?? old decoder will be removed soon
...@@ -174,7 +174,7 @@ audio_output_obj = audio_output/audio_output.o \ ...@@ -174,7 +174,7 @@ audio_output_obj = audio_output/audio_output.o \
video_output_obj = video_output/video_output.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 video_output/video_yuv.o
ac3_decoder_obj = ac3_decoder/ac3_decoder.o \ ac3_decoder_obj = ac3_decoder/ac3_decoder.o \
ac3_decoder/ac3_parse.o \ ac3_decoder/ac3_parse.o \
......
...@@ -338,7 +338,7 @@ ...@@ -338,7 +338,7 @@
/* Define to enable messages queues - disabling messages queue can be usefull /* Define to enable messages queues - disabling messages queue can be usefull
* when debugging, since it allows messages which would not otherwise be printed, * when debugging, since it allows messages which would not otherwise be printed,
* due to a crash, to be printed anyway */ * due to a crash, to be printed anyway */
#define INTF_MSG_QUEUE //#define INTF_MSG_QUEUE
/* Format of the header for debug messages. The arguments following this header /* Format of the header for debug messages. The arguments following this header
* are the file (char *), the function (char *) and the line (int) in which the * are the file (char *), the function (char *) and the line (int) in which the
......
...@@ -32,11 +32,10 @@ typedef struct ...@@ -32,11 +32,10 @@ typedef struct
int i_matrix_coefficients; /* in YUV type, encoding type */ int i_matrix_coefficients; /* in YUV type, encoding type */
/* Picture static properties - those properties are fixed at initialization /* Picture static properties - those properties are fixed at initialization
* and should NOT be modified. Note that for YUV pictures, i_bytes_per_line * and should NOT be modified */
* has no signification and is replaced by i_width */
int i_width; /* picture width */ int i_width; /* picture width */
int i_height; /* picture height */ int i_height; /* picture height */
int i_bytes_per_line; /* total number of bytes per line */ int i_chroma_width; /* chroma width */
/* Picture dynamic properties - those properties can be changed by the /* Picture dynamic properties - those properties can be changed by the
* decoder */ * decoder */
......
...@@ -7,6 +7,70 @@ ...@@ -7,6 +7,70 @@
* thread, and destroy a previously oppenned video output thread. * thread, and destroy a previously oppenned video output thread.
*******************************************************************************/ *******************************************************************************/
/*******************************************************************************
* vout_tables_t: pre-calculated convertion tables
*******************************************************************************
* These tables are used by convertion and scaling functions.
*******************************************************************************/
typedef struct vout_tables_s
{
void * p_base; /* base for all translation tables */
union
{
struct { u16 *p_red, *p_green, *p_blue; } rgb16; /* color 15, 16 bpp */
struct { u32 *p_red, *p_green, *p_blue; } rgb32; /* color 24, 32 bpp */
struct { u16 *p_gray; } gray16; /* gray 15, 16 bpp */
struct { u32 *p_gray; } gray32; /* gray 24, 32 bpp */
} yuv;
void * p_trans_optimized; /* optimized (all colors) */
} vout_tables_t;
/*******************************************************************************
* vout_convert_t: convertion function
*******************************************************************************
* This is the prototype common to all convertion functions. The type of p_pic
* will change depending of the screen depth treated.
* Parameters:
* p_vout video output thread
* p_pic picture address (start address in picture)
* p_y, p_u, p_v Y,U,V samples addresses
* i_width Y samples width
* i_height Y samples height
* i_eol number of Y samples to reach the next line
* i_pic_eol number or pixels to reach the next line
* i_scale if non 0, vertical scaling is 1 - 1/i_scale
* Conditions:
* start x + i_width < picture width
* start y + i_height * (scaling factor) < picture height
* i_width % 16 == 0
*******************************************************************************/
typedef void (vout_convert_t)( p_vout_thread_t p_vout, void *p_pic,
yuv_data_t *p_y, yuv_data_t *p_u, yuv_data_t *p_v,
int i_width, int i_height, int i_eol, int i_pic_eol,
int i_scale );
/*******************************************************************************
* vout_scale_t: scaling function
*******************************************************************************
* When a picture can't be scaled unsing the fast i_y_scale parameter of a
* transformation, it is rendered in a temporary buffer then scaled using a
* totally accurate (but also very slow) method.
* This is the prototype common to all scaling functions. The types of p_buffer
* and p_pic will change depending of the screen depth treated.
* Parameters:
* p_vout video output thread
* p_pic picture address (start address in picture)
* p_buffer source picture
* i_width buffer width
* i_height buffer height
* i_eol number of pixels to reach next buffer line
* i_pic_eol number of pixels to reach next picture line
* f_alpha, f_beta horizontal and vertical scaling factors
*******************************************************************************/
typedef void (vout_scale_t)( p_vout_thread_t p_vout, void *p_pic, void *p_buffer,
int i_width, int i_height, int i_eol, int i_pic_eol,
float f_alpha, float f_beta );
/******************************************************************************* /*******************************************************************************
* vout_thread_t: video output thread descriptor * vout_thread_t: video output thread descriptor
******************************************************************************* *******************************************************************************
...@@ -16,34 +80,37 @@ ...@@ -16,34 +80,37 @@
*******************************************************************************/ *******************************************************************************/
typedef struct vout_thread_s typedef struct vout_thread_s
{ {
/* Thread properties and locks */ /* Thread properties and lock */
boolean_t b_die; /* `die' flag */ boolean_t b_die; /* `die' flag */
boolean_t b_error; /* `error' flag */ boolean_t b_error; /* `error' flag */
boolean_t b_active; /* `active' flag */ boolean_t b_active; /* `active' flag */
pthread_t thread_id; /* id for pthread functions */ pthread_t thread_id; /* id for pthread functions */
pthread_mutex_t lock; /* thread lock */ pthread_mutex_t lock; /* thread lock */
int * pi_status; /* temporary status flag */ int * pi_status; /* temporary status flag */
p_vout_sys_t p_sys; /* system output method */
/* Common display properties */ /* Current display properties */
boolean_t b_info; /* print additionnal informations */ boolean_t b_info; /* print additionnal informations */
boolean_t b_grayscale; /* color or grayscale display */ boolean_t b_grayscale; /* color or grayscale display */
int i_width; /* current output method width */ int i_width; /* current output method width */
int i_height; /* current output method height */ int i_height; /* current output method height */
int i_bytes_per_line;/* bytes per line (including virtual) */ int i_bytes_per_line;/* bytes per line (including virtual) */
int i_screen_depth; /* bits per pixel */ int i_screen_depth; /* bits per pixel - FIXED */
int i_bytes_per_pixel; /* real screen depth */ int i_bytes_per_pixel; /* real screen depth - FIXED */
float f_x_ratio; /* horizontal display ratio */ float f_x_ratio; /* horizontal display ratio */
float f_y_ratio; /* vertical display ratio */ float f_y_ratio; /* vertical display ratio */
float f_gamma; /* gamma */ float f_gamma; /* gamma */
/* Changed properties values - some of them are treated directly by the /* Changed properties values - some of them are treated directly by the
* thread, the over may be ignored or handled by vout_SysManage */ * thread, the over may be ignored or handled by vout_SysManage */
//?? info, grayscale, width, height, bytes per line, x ratio, y ratio, gamma
boolean_t b_gamma_change; /* gamma change indicator */ boolean_t b_gamma_change; /* gamma change indicator */
int i_new_width; /* new width */ int i_new_width; /* new width */
int i_new_height; /* new height */ int i_new_height; /* new height */
#ifdef STATS #ifdef STATS
/* Statistics - these numbers are not supposed to be accurate */ /* Statistics - these numbers are not supposed to be accurate, but are a
* good indication of the thread status */
count_t c_loops; /* number of loops */ count_t c_loops; /* number of loops */
count_t c_idle_loops; /* number of idle loops */ count_t c_idle_loops; /* number of idle loops */
count_t c_fps_samples; /* picture counts */ count_t c_fps_samples; /* picture counts */
...@@ -51,25 +118,17 @@ typedef struct vout_thread_s ...@@ -51,25 +118,17 @@ typedef struct vout_thread_s
#endif #endif
#ifdef DEBUG_VIDEO #ifdef DEBUG_VIDEO
/* Video debugging informations */ /* Additionnal video debugging informations */
mtime_t picture_render_time; /* last picture rendering time */ mtime_t picture_render_time; /* last picture rendering time */
#endif #endif
/* Output method */ /* Video heap and translation tables */
p_vout_sys_t p_sys; /* system output method */
/* Video heap */
picture_t p_picture[VOUT_MAX_PICTURES]; /* pictures */ picture_t p_picture[VOUT_MAX_PICTURES]; /* pictures */
vout_tables_t tables; /* translation tables */
/* YUV translation tables - they have to be casted to the appropriate width vout_convert_t * p_ConvertYUV420; /* YUV 4:2:0 converter */
* on use. All tables are allocated in the same memory block, based at vout_convert_t * p_ConvertYUV422; /* YUV 4:2:2 converter */
* p_trans_base, and shifted depending of the output thread configuration */ vout_convert_t * p_ConvertYUV444; /* YUV 4:4:4 converter */
byte_t * p_trans_base; /* base for all translation tables */ vout_scale_t * p_Scale; /* scaler */
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; } vout_thread_t;
/******************************************************************************* /*******************************************************************************
...@@ -85,7 +144,7 @@ vout_thread_t * vout_CreateThread ( ...@@ -85,7 +144,7 @@ vout_thread_t * vout_CreateThread (
void vout_DestroyThread ( vout_thread_t *p_vout, int *pi_status ); void vout_DestroyThread ( vout_thread_t *p_vout, int *pi_status );
picture_t * vout_CreatePicture ( vout_thread_t *p_vout, int i_type, picture_t * vout_CreatePicture ( vout_thread_t *p_vout, int i_type,
int i_width, int i_height, int i_bytes_per_line ); int i_width, int i_height );
void vout_DestroyPicture ( vout_thread_t *p_vout, picture_t *p_pic ); void vout_DestroyPicture ( vout_thread_t *p_vout, picture_t *p_pic );
void vout_DisplayPicture ( vout_thread_t *p_vout, picture_t *p_pic ); void vout_DisplayPicture ( vout_thread_t *p_vout, picture_t *p_pic );
void vout_LinkPicture ( vout_thread_t *p_vout, picture_t *p_pic ); void vout_LinkPicture ( vout_thread_t *p_vout, picture_t *p_pic );
......
/*******************************************************************************
* video_yuv.h: YUV transformation functions
* (c)1999 VideoLAN
*******************************************************************************
* Provides functions prototypes to perform the YUV conversion. The functions
* may be implemented in one of the video_yuv_* files.
*******************************************************************************/
/*******************************************************************************
* Prototypes
*******************************************************************************/
int vout_InitTables ( vout_thread_t *p_vout );
int vout_ResetTables ( vout_thread_t *p_vout );
void vout_EndTables ( vout_thread_t *p_vout );
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment