subtitles, disable aspect ratio, scaling up...

Rudolf Cornelissen rag.cornelissen at inter.nl.net
Wed Oct 24 17:29:50 CEST 2001


Hello there once again,

Sorry to bother you again...
-------------------
1.

Subtitles are difficult to read with some discs.  I suggest another setting 
for now: (I understand that you'll get this info from an .ifo file on the 
discs later..)

src/video_output/video_spu.c:
static int p_palette[4] = { 0x0000, 0xcccc, 0xffff, 0x0000 };

This way you get much less different intensities in the subtitles which makes 
it much better to read in all cases I have tested so far.. it still is a 
compromize of course.
(some discs need only the second value to be max while rest is zero, and some 
other discs need the third value max only. Above example makes both discs-
types good to read..)

---------------
2.

disable aspect ratio is simple to do apparantly. In:
src/video_output/video_output.c:

(it would be nice if a command line option to do this existed... Note please 
that this indeed improves picture quality on TV!)

'Kill' the aspect ratio scaling part in routine:

static void SetBufferPicture( vout_thread_t *p_vout, picture_t *p_pic ), 
so:

Find and change this part to how it is here:

    /*
     * Computes new picture size
     */

    if( p_pic != NULL )
    {
	//disable aspect ratio scaling:
	i_pic_height = p_pic->i_height;
	i_pic_width = p_pic->i_width;

        /* Try horizontal scaling first - width must be a mutiple of 16 */

/*	commented_out for disabled aspect ratio scaling:
        i_pic_width = (( p_vout->b_scale || (p_pic->i_width > i_vout_width)) 
?
                       i_vout_width : p_pic->i_width) & ~0xf;
        switch( p_pic->i_aspect_ratio )
        {
        case AR_3_4_PICTURE:
            i_pic_height = i_pic_width * 3 / 4;
            break;
        case AR_16_9_PICTURE:
            i_pic_height = i_pic_width * 9 / 16;
            break;
        case AR_221_1_PICTURE:
            i_pic_height = i_pic_width * 100 / 221;
            break;
        case AR_SQUARE_PICTURE:
        default:
            i_pic_height = p_pic->i_height * i_pic_width / p_pic->i_width;
            break;
        }
*/
        /* If picture dimensions using horizontal scaling are too large, use
         * vertical scaling. Since width must be a multiple of 16, height is
         * adjusted again after. */

/*	commented_out for disabled aspect ratio scaling:
        if( i_pic_height > i_vout_height )
        {
            i_pic_height = ( p_vout->b_scale || (p_pic->i_height > 
i_vout_height)) ?
                i_vout_height : p_pic->i_height;
            switch( p_pic->i_aspect_ratio )
            {
            case AR_3_4_PICTURE:
                i_pic_width = (i_pic_height * 4 / 3) & ~0xf;
                i_pic_height = i_pic_width * 3 / 4;
                break;
            case AR_16_9_PICTURE:
                i_pic_width = (i_pic_height * 16 / 9) & ~0xf;
                i_pic_height = i_pic_width * 9 / 16;
                break;
            case AR_221_1_PICTURE:
                i_pic_width = (i_pic_height * 221 / 100) & ~0xf;
                i_pic_height = i_pic_width * 100 / 221;
                break;
            case AR_SQUARE_PICTURE:
            default:
                i_pic_width = (p_pic->i_width * i_pic_height / p_pic->
i_height) & ~0xf;
                i_pic_height = p_pic->i_height * i_pic_width / p_pic->
i_width;
                break;
            }
        }
	//end of commented_out parts for disabled aspect ratio scaling.
*/

        /* Set picture position */
        i_pic_x = (p_vout->i_width - i_pic_width) / 2;
        i_pic_y = (p_vout->i_height - i_pic_height) / 2;

    }

----------------

3.
With the discs 'The Will Smith music video collection' (aspect 4:3)  and 
'Gloria Estefan - The evolution tour Live in Miami (16:9)' (all music DVD's 
??) there is a problem:
If played on VGA you'll see that de-interlacing does not work (you see the 
comb-effect almost always), while if looking on TV you won't see this of 
course (because of interlaced picture there..) you *will* see there that 
sometimes it looks like the even and odd frames get mixed up or something 
(picture starts to 'jump').

-------------------
4.

about aspect ratio correction on VGA again (16:9 movies):
You are scaling down to 405x720 for PAL and NTSC. It would be nice if this 
could be toggled (command line option?) with scaling up to 1024x576 (PAL), 
and 853x480 (NTSC). Scaling down does indeed introduce moire patters on 
screen. (but it still is handy if your monitor does not support resolutions 
above 800x600...)

-------------------
5.

I understand now that the whole process of playing a DVD is much more 
difficult that I thought. Maybe some plugins could be made still somehow 
sometime for optimized playback on TV? (as low as possible CPU load due to 
non-needed features I mean...)

Best regards (again),

Rudolf Cornelissen.





More information about the vlc-devel mailing list