[vlc-devel] [PATCH] wrong-sized subtitles

Bernie Purcell b.purcell at adbglobal.com
Thu Sep 13 06:44:13 CEST 2007


Just some more info...

This is the last version of Hannes Domani's patch here. At the time it was 
submitted I was unable to see any impact it made - no improvement but no 
detriment either. I asked at the time for some screenshots to illustrate 
the problem but never heard anything more.
Hannes, does this code still fix your problem? If so I'm much happier 
committing it than the more recent contribution - I'd just like to see the 
before and after screenshots for this patch to know what the effect of the 
change is - I can't get to the ones on the ftp server, and in any case, as 
they are relevant to the more recent patch, I'd prefer to get them again 
on the original one. Could you send them to me please?

Bitmap

--- src/video_output/vout_subpictures.c          Thu Aug 16 18:24:57 2007
+++ src/video_output/vout_subpictures.c          Thu Aug 16 18:25:34 2007
@@ -601,19 +601,41 @@
             }
             if( p_text_region && ((p_text_region->i_align & 
REGION_RENDERED) == 0) )
             {
-                p_spu->p_text->fmt_out.video.i_width =
-                    p_spu->p_text->fmt_out.video.i_visible_width =
-                    p_fmt->i_width;
-                p_spu->p_text->fmt_out.video.i_height =
-                    p_spu->p_text->fmt_out.video.i_visible_height =
-                    p_fmt->i_height;
+                if( (p_subpic->i_original_picture_height > 0) &&
+                    (p_subpic->i_original_picture_width  > 0) )
+                {
+                    p_spu->p_text->fmt_out.video.i_width =
+                        p_spu->p_text->fmt_out.video.i_visible_width =
+                        p_subpic->i_original_picture_width;
+                    p_spu->p_text->fmt_out.video.i_height =
+                        p_spu->p_text->fmt_out.video.i_visible_height =
+                        p_subpic->i_original_picture_height;
+                }
+                else
+                {
+                    p_spu->p_text->fmt_out.video.i_width =
+                        p_spu->p_text->fmt_out.video.i_visible_width =
+                        p_fmt->i_width;
+                    p_spu->p_text->fmt_out.video.i_height =
+                        p_spu->p_text->fmt_out.video.i_visible_height =
+                        p_fmt->i_height;
+                }
             }
         }
 
         pi_scale_width[ SCALE_DEFAULT ]  = i_scale_width_orig;
         pi_scale_height[ SCALE_DEFAULT ] = i_scale_height_orig;
-        pi_scale_width[ SCALE_TEXT ]     = p_fmt->i_width  * 1000 / 
p_spu->p_text->fmt_out.video.i_width;
-        pi_scale_height[ SCALE_TEXT ]    = p_fmt->i_height * 1000 / 
p_spu->p_text->fmt_out.video.i_height;
+        if( (p_subpic->i_original_picture_height > 0) &&
+            (p_subpic->i_original_picture_width  > 0) )
+        {
+            pi_scale_width[ SCALE_TEXT ]     = 
p_subpic->i_original_picture_width  * 1000 / 
p_spu->p_text->fmt_out.video.i_width;
+            pi_scale_height[ SCALE_TEXT ]    = 
p_subpic->i_original_picture_height * 1000 / 
p_spu->p_text->fmt_out.video.i_height;
+        }
+        else
+        {
+            pi_scale_width[ SCALE_TEXT ]     = p_fmt->i_width  * 1000 / 
p_spu->p_text->fmt_out.video.i_width;
+            pi_scale_height[ SCALE_TEXT ]    = p_fmt->i_height * 1000 / 
p_spu->p_text->fmt_out.video.i_height;
+        }
 
         for( k=0; k< SCALE_SIZE ; k++ )
         {
----- Forwarded by Bernie Purcell/ADB on 13/09/2007 02:45 PM -----

Bernie Purcell <b.purcell at adbglobal.com> 
Sent by: vlc-devel-bounces at videolan.org
13/09/2007 02:10 PM
Please respond to
Mailing list for VLC media player developers <vlc-devel at videolan.org>


To
Mailing list for VLC media player developers <vlc-devel at videolan.org>
cc

Subject
Re: [vlc-devel] [PATCH] wrong-sized subtitles







Hi Hannes, 

This patch undoes the font smoothing that I went to some trouble to get 
working - ie. rendering text at native resolution when possible, rather 
than using the video resolution. I really don't want to commit it like 
this. 
You submitted an earlier patch that didn't have this problem. I'm still 
prepared to consider that one if it fixes your problem. Could you please 
email me the screenshots you've put on the FTP server as I can't access 
them though. 

Bitmap 


Hannes Domani <ssbssa at yahoo.de> 
Sent by: vlc-devel-bounces at videolan.org 
12/09/2007 08:42 PM 

Please respond to
Mailing list for VLC media player developers <vlc-devel at videolan.org>


To
vlc-devel <vlc-devel at videolan.org> 
cc

Subject
[vlc-devel] [PATCH] wrong-sized subtitles








Hello

this is my new try to fix the subtitles.

this time i made some screenshots to show what needed
to be fixed (but am not sure if they made it to the
ftp):
ftp://ftp.videolan.org/incoming/shot1.png
ftp://ftp.videolan.org/incoming/shot1-patched.png
ftp://ftp.videolan.org/incoming/shot2.png
ftp://ftp.videolan.org/incoming/shot2-patched.png

regards
Domani Hannes


     Machen Sie Yahoo! zu Ihrer Startseite. Los geht's: 
http://de.yahoo.com/set--- src/video_output/vout_subpictures.c     Mon Sep 
10 17:50:01 2007
+++ src/video_output/vout_subpictures.c                 Mon Sep 10 
18:16:14 2007
@@ -509,9 +509,6 @@
                            subpicture_t *p_subpic,
                            int i_scale_width_orig, int 
i_scale_height_orig )
{
-    int i_source_video_width  = p_fmt->i_width  * 1000 / 
i_scale_width_orig;
-    int i_source_video_height = p_fmt->i_height * 1000 / 
i_scale_height_orig;
-
    /* Get lock */
    vlc_mutex_lock( &p_spu->subpicture_lock );

@@ -610,25 +607,6 @@
        pi_scale_width[ SCALE_TEXT ]     = p_fmt->i_width  * 1000 / 
p_spu->p_text->fmt_out.video.i_width;
        pi_scale_height[ SCALE_TEXT ]    = p_fmt->i_height * 1000 / 
p_spu->p_text->fmt_out.video.i_height;

-        for( k=0; k< SCALE_SIZE ; k++ )
-        {
-            if( (p_subpic->i_original_picture_height > 0) &&
-                (p_subpic->i_original_picture_width  > 0) )
-            {
-                pi_scale_width[ k ]  = pi_scale_width[ k ]  * 
i_source_video_width /
-                                 p_subpic->i_original_picture_width;
-                pi_scale_height[ k ] = pi_scale_height[ k ] * 
i_source_video_height /
-                                 p_subpic->i_original_picture_height;
-            }
-            else if( p_subpic->i_original_picture_height > 0 )
-            {
-                pi_scale_height[ k ] = pi_scale_height[ k ] * 
i_source_video_height /
-                                 p_subpic->i_original_picture_height;
-                pi_scale_width[ k ]  = pi_scale_width[ k ]  * 
i_source_video_height /
-                                 p_subpic->i_original_picture_height;
-            }
-        }
-
        /* Set default subpicture aspect ratio */
        if( p_region && p_region->fmt.i_aspect &&
            (!p_region->fmt.i_sar_num || !p_region->fmt.i_sar_den) )
@@ -696,6 +674,7 @@
                if( p_spu->p_text && p_spu->p_text->p_module )
                {
                    vlc_value_t  val;
+                    int i_scale;

                    /* Setup 3 variables which can be used to render
                     * time-dependent text (and effects). The first 
indicates
@@ -729,8 +708,11 @@
                    var_SetBool( p_spu->p_text, "text-rerender", VLC_FALSE 
);

                    var_Create( p_spu->p_text, "scale", VLC_VAR_INTEGER );
-                    var_SetInteger( p_spu->p_text, "scale",
-                              __MIN(i_scale_width_orig, 
i_scale_height_orig) );
+                    i_scale = __MIN( i_scale_width_orig, 
i_scale_height_orig );
+                    if( p_subpic->i_original_picture_height > 0 )
+                        i_scale = i_scale * p_fmt->i_height /
+                            p_subpic->i_original_picture_height;
+                    var_SetInteger( p_spu->p_text, "scale", i_scale );

                    if( p_spu->p_text->pf_render_html && 
p_region->psz_html )
                    {
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
http://mailman.videolan.org/listinfo/vlc-devel
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
http://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070913/3964d85e/attachment.html>


More information about the vlc-devel mailing list