break;
case 0x05:
/* 05xxxyyyxxxyyy (coordinates) */
- GetWord( i_word );
- GetWord( i_word );
- GetWord( i_word );
+ i_word = GetByte( &p_spudec->bit_stream );
+ p_spu->type.spu.i_x1 = (i_word << 4) | GetBits( &p_spudec->bit_stream, 4 );
+ i_word = GetBits( &p_spudec->bit_stream, 4 );
+ p_spu->type.spu.i_x2 = (i_word << 8) | GetByte( &p_spudec->bit_stream );
+ i_word = GetByte( &p_spudec->bit_stream );
+ p_spu->type.spu.i_y1 = (i_word << 4) | GetBits( &p_spudec->bit_stream, 4 );
+ i_word = GetBits( &p_spudec->bit_stream, 4 );
+ p_spu->type.spu.i_y2 = (i_word << 8) | GetByte( &p_spudec->bit_stream );
+ i_index += 6;
break;
case 0x06:
/* 06xxxxyyyy (byte offsets) */
#endif
if( display_date > current_date + VOUT_DISPLAY_DELAY )
{
- /* A picture is ready to be rendered, but its rendering date is
- * far from the current one so the thread will perform an empty loop
- * as if no picture were found. The picture state is unchanged */
+ /* A picture is ready to be rendered, but its rendering date
+ * is far from the current one so the thread will perform an
+ * empty loop as if no picture were found. The picture state
+ * is unchanged */
p_pic = NULL;
display_date = 0;
}
}
}
+#if 0
else if( p_subpic ) /* subpicture alone */
{
b_display = p_vout->b_active;
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 */
{
if( p_vout->b_interface && 0 /* && XXX?? intf_change */ )
{
case DVD_SUBPICTURE: /* DVD subpicture unit */
vout_RenderSPU( p_subpic->p_data, p_subpic->type.spu.i_offset,
+ p_subpic->type.spu.i_x1, p_subpic->type.spu.i_y1,
p_vout->p_buffer[ p_vout->i_buffer_index ].p_data,
p_vout->i_bytes_per_pixel, p_vout->i_bytes_per_line );
break;
#define GET_NIBBLE( i ) \
if( b_aligned ) \
{ \
- i_next = *p_dest[i_id]; \
+ i_next = *p_from[i_id]; \
/*printf("%.1x", i_next >> 4);*/ \
- p_dest[ i_id ]++; \
+ p_from[ i_id ]++; \
b_aligned = 0; \
i = i_next >> 4; \
} \
#define ADD_NIBBLE( i, j ) \
if( b_aligned ) \
{ \
- i_next = *p_dest[i_id]; \
+ i_next = *p_from[i_id]; \
/*printf("%.1x", i_next >> 4);*/ \
- p_dest[ i_id ]++; \
+ p_from[ i_id ]++; \
b_aligned = 0; \
i = (j) + (i_next >> 4); \
} \
*****************************************************************************
*
*****************************************************************************/
-void vout_RenderSPU( byte_t *p_data, int p_offset[2], byte_t *p_pic,
+void vout_RenderSPU( byte_t *p_data, int p_offset[2],
+ int i_x, int i_y, byte_t *p_pic,
int i_bytes_per_pixel, int i_bytes_per_line )
{
int i_code = 0x00;
int i_next = 0;
int i_id = 0;
boolean_t b_aligned = 1;
- byte_t *p_dest[2];
+ byte_t *p_from[2];
spu_t spu;
- p_dest[0] = p_data + p_offset[0];
- p_dest[1] = p_data + p_offset[1];
+ p_from[1] = p_data + p_offset[1];
+ p_from[0] = p_data + p_offset[0];
spu.x = 0;
spu.y = 0;
spu.width = 720;
spu.height = 576;
- spu.p_data = p_pic;
+ spu.p_data = p_pic + i_x * i_bytes_per_pixel + i_y * i_bytes_per_line;
- while( p_dest[0] < p_data + p_offset[1] + 2 )
+ while( p_from[0] < p_data + p_offset[1] + 2 )
{
GET_NIBBLE( i_code );
{
intf_DbgMsg( "video_spu: unknown code 0x%x "
"(dest %x side %x, x=%d, y=%d)\n",
- i_code, p_dest[i_id], i_id, spu.x, spu.y );
+ i_code, p_from[i_id], i_id, spu.x, spu.y );
if( NewLine( &spu, &i_id ) < 0 )
return;
continue;
static int PutPixel ( spu_t *p_spu, int i_len, u8 i_color )
{
//static int p_palette[4] = { 0x0000, 0xfef8, 0x7777, 0xffff };
- static int p_palette[4] = { 0x0000, 0xffff, 0x0000, 0xffff };
+ static int p_palette[4] = { 0x0000, 0xffff, 0x5555, 0x0000 };
if( (i_len + p_spu->x + p_spu->y * p_spu->width)
> p_spu->height * p_spu->width )
/*****************************************************************************
* Prototypes
*****************************************************************************/
-void vout_RenderSPU ( byte_t *p_data, int p_offset[2], byte_t *p_pic,
+void vout_RenderSPU ( byte_t *p_data, int p_offset[2],
+ int i_x, int i_y, byte_t *p_pic,
int i_bytes_per_pixel, int i_bytes_per_line );