]> git.sesse.net Git - vlc/commitdiff
. correction d'un bug dans les sous-titres pour un scaling > 1
authorSam Hocevar <sam@videolan.org>
Sun, 28 May 2000 14:22:06 +0000 (14:22 +0000)
committerSam Hocevar <sam@videolan.org>
Sun, 28 May 2000 14:22:06 +0000 (14:22 +0000)
 . correction d'un bug dans l'affichage 8 bits pour un scaling < 1

Makefile.in
src/video_output/video_output.c
src/video_output/video_spu.c
src/video_output/video_yuv.c

index 053679dd6f9723a1803cd8d6090169c540ae4d47..541f251c5128e2427c25ba54f38088b40481ba20 100644 (file)
@@ -1,5 +1,3 @@
-# Generated automatically from Makefile.in by configure.
-# Generated automatically from Makefile.in by configure.
 ################################################################################
 # vlc (VideoLAN Client) main makefile
 # (c)1998 VideoLAN
@@ -71,13 +69,15 @@ DEBUG=0
 
 #----------------- do not change anything below this line ----------------------
 
-prefix=/usr/local
-INSTALL=/bin/install -c
+prefix=@prefix@
+INSTALL=@INSTALL@
 
 ################################################################################
 # Configuration pre-processing
 ################################################################################
 
+SNAPSHOTDIR=vlc-@VLC_VERSION@
+
 # PROGRAM_OPTIONS is an identification string of the compilation options
 PROGRAM_OPTIONS = $(SYS) $(ARCH)
 ifeq ($(DEBUG),1)
index 2bb47e83d0f1db102ffdb2acb1ecb37c11889c59..944c521c3c95a66b8b0f12081bb5fb79289aacd9 100644 (file)
@@ -1089,49 +1089,12 @@ last_display_date = display_date;
             {
                 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 );
             }
 
-            /* 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 */
         {
             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 )
             /* test if the picture really has to be displayed */
             if( mdate() < p_subpic->begin_date )
             {
+                /* not yet, see you later */
                 break;
             }
             if( mdate() > p_subpic->end_date )
index cc56c4fb22d653088bf74052de3aa0f367f7cd92..f3a0e2deda937e7f53835b1523612f742a151060 100644 (file)
@@ -43,10 +43,10 @@ typedef struct vout_spu_s
     int i_id;
     byte_t *p_data;
 
-    /* coordinates inside the spu */
+    /* drawing coordinates inside the spu */
     int x;
     int y;
-    /* size of the spu */
+    /* target size */
     int width;
     int height;
 
@@ -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_line = p_vout->i_bytes_per_line;
 
-    int i_width = 720;
-    int i_pic_width = p_vout->p_buffer[ p_vout->i_buffer_index ].i_pic_width;
-    int i_height = 576;
-    int i_pic_height = p_vout->p_buffer[ p_vout->i_buffer_index ].i_pic_height;
+    /* FIXME: we need a way to get this information from the stream */
+    #define TARGET_WIDTH     720
+    #define TARGET_HEIGHT    576
+    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 */
-    static int p_palette[4] = { 0x0000, 0xffff, 0x5555, 0x0000 };
+    static int p_palette[4] = { 0x0000, 0x0000, 0x5555, 0xffff };
 
     boolean_t b_aligned = 1;
     byte_t *p_from[2];
@@ -119,8 +124,8 @@ void vout_RenderSPU( vout_thread_t *p_vout, subpicture_t *p_subpic )
 
     vspu.x = 0;
     vspu.y = 0;
-    vspu.width = 720;
-    vspu.height = 576;
+    vspu.width = TARGET_WIDTH;
+    vspu.height = TARGET_HEIGHT;
     vspu.p_data = p_vout->p_buffer[ p_vout->i_buffer_index ].p_data
                     /* go to the picture coordinates */
                     + 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 )
             {
                 if( (i_color = i_code & 0x3) )
                 {
-                    u8 *p_target = &vspu.p_data[ i_bytes_per_pixel * (vspu.x * i_pic_width / i_width)
-                                        + ( vspu.y * i_pic_height / i_height) * i_bytes_per_line ];
+                    u8 *p_target = &vspu.p_data[
+                        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],
-                            ((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;
             }
index bc93d9e0008e3647374f54a0ebfbf4e62f126cb9..98ef79575593863fb49ea069617298e4bc0a5fc0 100644 (file)
@@ -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_u + dither20[i_real_y])   >> 5) * 9                            \
         + ((*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_u += *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
         (((*p_y + dither11[i_real_y]) >> 4) << 7)                             \
         + ((*p_u + dither21[i_real_y])   >> 5) * 9                            \
         + ((*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_u += *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
         (((*p_y + dither12[i_real_y]) >> 4) << 7)                             \
         + ((*p_u + dither22[i_real_y])   >> 5) * 9                            \
         + ((*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_u += *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
         (((*p_y + dither13[i_real_y]) >> 4) << 7)                             \
         + ((*p_u + dither23[i_real_y])   >> 5) * 9                            \
         + ((*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_u += *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_
     int dither22[4] = {  0x6, 0x16,  0x2, 0x12 };
     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] = { { 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] = { { 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] = { { 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