Commit 407c070e authored by Sam Hocevar's avatar Sam Hocevar

. correction d'un bug dans les sous-titres pour un scaling > 1

 . correction d'un bug dans l'affichage 8 bits pour un scaling < 1
parent 43df12e7
# Generated automatically from Makefile.in by configure.
# Generated automatically from Makefile.in by configure.
################################################################################ ################################################################################
# vlc (VideoLAN Client) main makefile # vlc (VideoLAN Client) main makefile
# (c)1998 VideoLAN # (c)1998 VideoLAN
...@@ -71,13 +69,15 @@ DEBUG=0 ...@@ -71,13 +69,15 @@ DEBUG=0
#----------------- do not change anything below this line ---------------------- #----------------- do not change anything below this line ----------------------
prefix=/usr/local prefix=@prefix@
INSTALL=/bin/install -c INSTALL=@INSTALL@
################################################################################ ################################################################################
# Configuration pre-processing # Configuration pre-processing
################################################################################ ################################################################################
SNAPSHOTDIR=vlc-@VLC_VERSION@
# PROGRAM_OPTIONS is an identification string of the compilation options # PROGRAM_OPTIONS is an identification string of the compilation options
PROGRAM_OPTIONS = $(SYS) $(ARCH) PROGRAM_OPTIONS = $(SYS) $(ARCH)
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
......
...@@ -1089,49 +1089,12 @@ last_display_date = display_date; ...@@ -1089,49 +1089,12 @@ last_display_date = display_date;
{ {
RenderInterface( p_vout ); RenderInterface( p_vout );
} }
if( p_subpic ) if( b_display && p_subpic )
{ {
if( b_display )
{
RenderSubPicture( p_vout, p_subpic );
}
/* Remove subpicture from heap */
/*vlc_mutex_lock( &p_vout->subpicture_lock );
p_subpic->i_status = DESTROYED_SUBPICTURE;
vlc_mutex_unlock( &p_vout->subpicture_lock );*/
}
}
#if 0
else if( p_subpic ) /* subpicture alone */
{
b_display = p_vout->b_active;
p_vout->last_display_date = display_date;
if( b_display )
{
/* Clear buffer */
SetBufferPicture( p_vout, NULL );
/* Render informations, interface and subpicture */
if( p_vout->b_info )
{
RenderInfo( p_vout );
}
if( p_vout->b_interface )
{
RenderInterface( p_vout );
}
RenderSubPicture( p_vout, p_subpic ); RenderSubPicture( p_vout, p_subpic );
} }
/* Remove subpicture from heap */
/*vlc_mutex_lock( &p_vout->subpicture_lock );
p_subpic->i_status = DESTROYED_SUBPICTURE;
vlc_mutex_unlock( &p_vout->subpicture_lock );*/
} }
#endif
else if( p_vout->b_active ) /* idle or interface screen alone */ else if( p_vout->b_active ) /* idle or interface screen alone */
{ {
if( p_vout->b_interface && 0 /* && XXX?? intf_change */ ) if( p_vout->b_interface && 0 /* && XXX?? intf_change */ )
...@@ -1851,6 +1814,7 @@ static void RenderSubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic ) ...@@ -1851,6 +1814,7 @@ static void RenderSubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
/* test if the picture really has to be displayed */ /* test if the picture really has to be displayed */
if( mdate() < p_subpic->begin_date ) if( mdate() < p_subpic->begin_date )
{ {
/* not yet, see you later */
break; break;
} }
if( mdate() > p_subpic->end_date ) if( mdate() > p_subpic->end_date )
......
...@@ -43,10 +43,10 @@ typedef struct vout_spu_s ...@@ -43,10 +43,10 @@ typedef struct vout_spu_s
int i_id; int i_id;
byte_t *p_data; byte_t *p_data;
/* coordinates inside the spu */ /* drawing coordinates inside the spu */
int x; int x;
int y; int y;
/* size of the spu */ /* target size */
int width; int width;
int height; int height;
...@@ -102,13 +102,18 @@ void vout_RenderSPU( vout_thread_t *p_vout, subpicture_t *p_subpic ) ...@@ -102,13 +102,18 @@ void vout_RenderSPU( vout_thread_t *p_vout, subpicture_t *p_subpic )
int i_bytes_per_pixel = p_vout->i_bytes_per_pixel; int i_bytes_per_pixel = p_vout->i_bytes_per_pixel;
int i_bytes_per_line = p_vout->i_bytes_per_line; int i_bytes_per_line = p_vout->i_bytes_per_line;
int i_width = 720; /* FIXME: we need a way to get this information from the stream */
int i_pic_width = p_vout->p_buffer[ p_vout->i_buffer_index ].i_pic_width; #define TARGET_WIDTH 720
int i_height = 576; #define TARGET_HEIGHT 576
int i_pic_height = p_vout->p_buffer[ p_vout->i_buffer_index ].i_pic_height; int i_x_scale =
( p_vout->p_buffer[ p_vout->i_buffer_index ].i_pic_width << 6 )
/ TARGET_WIDTH;
int i_y_scale =
( p_vout->p_buffer[ p_vout->i_buffer_index ].i_pic_height << 6 )
/ TARGET_HEIGHT;
/* FIXME: fake palette - the real one has to be sought in the .IFO */ /* FIXME: fake palette - the real one has to be sought in the .IFO */
static int p_palette[4] = { 0x0000, 0xffff, 0x5555, 0x0000 }; static int p_palette[4] = { 0x0000, 0x0000, 0x5555, 0xffff };
boolean_t b_aligned = 1; boolean_t b_aligned = 1;
byte_t *p_from[2]; byte_t *p_from[2];
...@@ -119,8 +124,8 @@ void vout_RenderSPU( vout_thread_t *p_vout, subpicture_t *p_subpic ) ...@@ -119,8 +124,8 @@ void vout_RenderSPU( vout_thread_t *p_vout, subpicture_t *p_subpic )
vspu.x = 0; vspu.x = 0;
vspu.y = 0; vspu.y = 0;
vspu.width = 720; vspu.width = TARGET_WIDTH;
vspu.height = 576; vspu.height = TARGET_HEIGHT;
vspu.p_data = p_vout->p_buffer[ p_vout->i_buffer_index ].p_data vspu.p_data = p_vout->p_buffer[ p_vout->i_buffer_index ].p_data
/* go to the picture coordinates */ /* go to the picture coordinates */
+ p_vout->p_buffer->i_pic_x * p_vout->i_bytes_per_pixel + p_vout->p_buffer->i_pic_x * p_vout->i_bytes_per_pixel
...@@ -151,10 +156,25 @@ void vout_RenderSPU( vout_thread_t *p_vout, subpicture_t *p_subpic ) ...@@ -151,10 +156,25 @@ void vout_RenderSPU( vout_thread_t *p_vout, subpicture_t *p_subpic )
{ {
if( (i_color = i_code & 0x3) ) if( (i_color = i_code & 0x3) )
{ {
u8 *p_target = &vspu.p_data[ i_bytes_per_pixel * (vspu.x * i_pic_width / i_width) u8 *p_target = &vspu.p_data[
+ ( vspu.y * i_pic_height / i_height) * i_bytes_per_line ]; i_bytes_per_pixel * ((vspu.x * i_x_scale) >> 6)
+ i_bytes_per_line * ((vspu.y * i_y_scale) >> 6) ];
memset( p_target, p_palette[i_color], memset( p_target, p_palette[i_color],
((i_code * i_pic_width / i_width) >> 2) * i_bytes_per_pixel ); ((((i_code - 1) * i_x_scale) >> 8) + 1)
* i_bytes_per_pixel );
/* if we need some horizontal scaling (unlikely )
* we only scale up to 2x, someone watching a DVD
* with more than 2x zoom must be braindead */
if( i_y_scale >= (1 << 6) )
{
p_target += i_bytes_per_line;
memset( p_target, p_palette[i_color],
((((i_code - 1) * i_x_scale) >> 8) + 1)
* i_bytes_per_pixel );
}
} }
vspu.x += i_code >> 2; vspu.x += i_code >> 2;
} }
......
...@@ -180,7 +180,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data ...@@ -180,7 +180,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data
(((*p_y + dither10[i_real_y]) >> 4) << 7) \ (((*p_y + dither10[i_real_y]) >> 4) << 7) \
+ ((*p_u + dither20[i_real_y]) >> 5) * 9 \ + ((*p_u + dither20[i_real_y]) >> 5) * 9 \
+ ((*p_v + dither20[i_real_y]) >> 5) ]; \ + ((*p_v + dither20[i_real_y]) >> 5) ]; \
b_jump_uv = (b_jump_uv + *p_offset) & 0x1; \ b_jump_uv += *p_offset; \
p_y += *p_offset; \ p_y += *p_offset; \
p_u += *p_offset & b_jump_uv; \ p_u += *p_offset & b_jump_uv; \
p_v += *p_offset++ & b_jump_uv; \ p_v += *p_offset++ & b_jump_uv; \
...@@ -188,7 +188,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data ...@@ -188,7 +188,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data
(((*p_y + dither11[i_real_y]) >> 4) << 7) \ (((*p_y + dither11[i_real_y]) >> 4) << 7) \
+ ((*p_u + dither21[i_real_y]) >> 5) * 9 \ + ((*p_u + dither21[i_real_y]) >> 5) * 9 \
+ ((*p_v + dither21[i_real_y]) >> 5) ]; \ + ((*p_v + dither21[i_real_y]) >> 5) ]; \
b_jump_uv = (b_jump_uv + *p_offset) & 0x1; \ b_jump_uv += *p_offset; \
p_y += *p_offset; \ p_y += *p_offset; \
p_u += *p_offset & b_jump_uv; \ p_u += *p_offset & b_jump_uv; \
p_v += *p_offset++ & b_jump_uv; \ p_v += *p_offset++ & b_jump_uv; \
...@@ -196,7 +196,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data ...@@ -196,7 +196,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data
(((*p_y + dither12[i_real_y]) >> 4) << 7) \ (((*p_y + dither12[i_real_y]) >> 4) << 7) \
+ ((*p_u + dither22[i_real_y]) >> 5) * 9 \ + ((*p_u + dither22[i_real_y]) >> 5) * 9 \
+ ((*p_v + dither22[i_real_y]) >> 5) ]; \ + ((*p_v + dither22[i_real_y]) >> 5) ]; \
b_jump_uv = (b_jump_uv + *p_offset) & 0x1; \ b_jump_uv += *p_offset; \
p_y += *p_offset; \ p_y += *p_offset; \
p_u += *p_offset & b_jump_uv; \ p_u += *p_offset & b_jump_uv; \
p_v += *p_offset++ & b_jump_uv; \ p_v += *p_offset++ & b_jump_uv; \
...@@ -204,7 +204,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data ...@@ -204,7 +204,7 @@ static void ConvertYUV444RGB32( p_vout_thread_t p_vout, u32 *p_pic, yuv_data
(((*p_y + dither13[i_real_y]) >> 4) << 7) \ (((*p_y + dither13[i_real_y]) >> 4) << 7) \
+ ((*p_u + dither23[i_real_y]) >> 5) * 9 \ + ((*p_u + dither23[i_real_y]) >> 5) * 9 \
+ ((*p_v + dither23[i_real_y]) >> 5) ]; \ + ((*p_v + dither23[i_real_y]) >> 5) ]; \
b_jump_uv = (b_jump_uv + *p_offset) & 0x1; \ b_jump_uv += *p_offset; \
p_y += *p_offset; \ p_y += *p_offset; \
p_u += *p_offset & b_jump_uv; \ p_u += *p_offset & b_jump_uv; \
p_v += *p_offset++ & b_jump_uv; \ p_v += *p_offset++ & b_jump_uv; \
...@@ -1102,15 +1102,16 @@ static void ConvertYUV420RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_ ...@@ -1102,15 +1102,16 @@ static void ConvertYUV420RGB8( p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_
int dither22[4] = { 0x6, 0x16, 0x2, 0x12 }; int dither22[4] = { 0x6, 0x16, 0x2, 0x12 };
int dither23[4] = { 0x1e, 0xe, 0x1a, 0xa }; int dither23[4] = { 0x1e, 0xe, 0x1a, 0xa };
/* other matrices that can be interesting, either for debugging or for effects */ #if 0
#if 0 /* other matrices that can be interesting, either for debugging or for
* various effects */
int dither[4][4] = { { 0, 8, 2, 10 }, { 12, 4, 14, 16 }, { 3, 11, 1, 9}, {15, 7, 13, 5} }; int dither[4][4] = { { 0, 8, 2, 10 }, { 12, 4, 14, 16 }, { 3, 11, 1, 9}, {15, 7, 13, 5} };
int dither[4][4] = { { 7, 8, 0, 15 }, { 0, 15, 8, 7 }, { 7, 0, 15, 8 }, { 15, 7, 8, 0 } }; int dither[4][4] = { { 7, 8, 0, 15 }, { 0, 15, 8, 7 }, { 7, 0, 15, 8 }, { 15, 7, 8, 0 } };
int dither[4][4] = { { 0, 15, 0, 15 }, { 15, 0, 15, 0 }, { 0, 15, 0, 15 }, { 15, 0, 15, 0 } }; int dither[4][4] = { { 0, 15, 0, 15 }, { 15, 0, 15, 0 }, { 0, 15, 0, 15 }, { 15, 0, 15, 0 } };
int dither[4][4] = { { 15, 15, 0, 0 }, { 15, 15, 0, 0 }, { 0, 0, 15, 15 }, { 0, 0, 15, 15 } }; int dither[4][4] = { { 15, 15, 0, 0 }, { 15, 15, 0, 0 }, { 0, 0, 15, 15 }, { 0, 0, 15, 15 } };
int dither[4][4] = { { 8, 8, 8, 8 }, { 8, 8, 8, 8 }, { 8, 8, 8, 8 }, { 8, 8, 8, 8 } }; int dither[4][4] = { { 8, 8, 8, 8 }, { 8, 8, 8, 8 }, { 8, 8, 8, 8 }, { 8, 8, 8, 8 } };
int dither[4][4] = { { 0, 1, 2, 3 }, { 4, 5, 6, 7 }, { 8, 9, 10, 11 }, { 12, 13, 14, 15 } }; int dither[4][4] = { { 0, 1, 2, 3 }, { 4, 5, 6, 7 }, { 8, 9, 10, 11 }, { 12, 13, 14, 15 } };
#endif #endif
/* /*
* Initialize some values - i_pic_line_width will store the line skip * Initialize some values - i_pic_line_width will store the line skip
......
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