/*****************************************************************************
* Prototypes
*****************************************************************************/
-/**
- * vout_AspectRatio
- *
- * Set the i_aspect_x and i_aspect_y from the encoded aspect ratio i_aspect.
- * \param i_aspect the encoded aspect ratio
- * \param i_aspect_x the decoded x-axis portion of i_aspect. This is set.
- * \param i_aspect_y the decoded y-axis portion of i_aspect This is set.
- */
-VLC_EXPORT( void, vout_AspectRatio, ( unsigned int i_aspect, unsigned int *i_aspect_x, unsigned int *i_aspect_y ) );
-
/**
* vout_CopyPicture
*
* Common SVCD and CVD subtitle routines.
*****************************************************************************
* Copyright (C) 2003, 2004 VideoLAN
- * $Id: common.c,v 1.13 2004/02/22 10:52:23 rocky Exp $
+ * $Id$
*
* Author: Rocky Bernstein <rocky@panix.com>
* based on code from:
vlc_object_t * p_input = p_spu->p_sys->p_input;
vout_thread_t *p_vout = vlc_object_find( p_input, VLC_OBJECT_VOUT,
FIND_CHILD );
- unsigned int i_aspect_x, i_aspect_y;
+ int i_aspect_x, i_aspect_y;
uint8_t *p_dest = (uint8_t *)p_spu->p_sys->p_data;
if (p_vout) {
break;
}
/* We get here only for scaled chromas. */
- vout_AspectRatio( p_vout->render.i_aspect, &i_aspect_y,
- &i_aspect_x );
+ vlc_reduce( &i_aspect_x, &i_aspect_y, p_vout->render.i_aspect,
+ VOUT_ASPECT_FACTOR, 0 );
} else {
/* User knows best? */
- vout_AspectRatio( i_new_aspect, &i_aspect_x, &i_aspect_y );
+ vlc_reduce( &i_aspect_x, &i_aspect_y, p_vout->render.i_aspect,
+ VOUT_ASPECT_FACTOR, 0 );
}
VCDSubScaleX( p_dec, p_spu, i_aspect_x, i_aspect_y );
}
* by DVD subtitles.
*****************************************************************************
* Copyright (C) 2003, 2004 VideoLAN
- * $Id: render.c,v 1.29 2004/02/02 12:53:20 fenrir Exp $
+ * $Id$
*
* Author: Rocky Bernstein <rocky@panix.com>
* based on code from:
int32_t i_x_start, i_y_start, i_x_end, i_y_end;
struct subpicture_sys_t *p_sys = p_spu->p_sys;
- unsigned int i_aspect_x, i_aspect_y;
+ int i_aspect_x, i_aspect_y;
- vout_AspectRatio( p_vout->render.i_aspect, &i_aspect_y,
- &i_aspect_x );
+ vlc_reduce( &i_aspect_x, &i_aspect_y, p_vout->render.i_aspect,
+ VOUT_ASPECT_FACTOR, 0 );
i_xscale = (( p_vout->output.i_width << ASCALE ) * i_aspect_x)
/ (i_aspect_y * p_vout->render.i_width);
int32_t i_x_start, i_y_start, i_x_end, i_y_end;
struct subpicture_sys_t *p_sys = p_spu->p_sys;
- unsigned int i_aspect_x, i_aspect_y;
+ int i_aspect_x, i_aspect_y;
- vout_AspectRatio( p_vout->render.i_aspect, &i_aspect_y,
- &i_aspect_x );
+ vlc_reduce( &i_aspect_x, &i_aspect_y, p_vout->render.i_aspect,
+ VOUT_ASPECT_FACTOR, 0 );
i_xscale = (( p_vout->output.i_width << ASCALE ) * i_aspect_x)
/ (i_aspect_y * p_vout->render.i_width);
int i_x_start, i_y_start, i_x_end, i_y_end;
struct subpicture_sys_t *p_sys = p_spu->p_sys;
- unsigned int i_aspect_x, i_aspect_y;
+ int i_aspect_x, i_aspect_y;
- vout_AspectRatio( p_vout->render.i_aspect, &i_aspect_y,
- &i_aspect_x );
+ vlc_reduce( &i_aspect_x, &i_aspect_y, p_vout->render.i_aspect,
+ VOUT_ASPECT_FACTOR, 0 );
i_xscale = (( p_vout->output.i_width << ASCALE ) * i_aspect_x)
/ (i_aspect_y * p_vout->render.i_width);
static int FilterCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
-/**
- * vout_AspectRatio
- *
- * Set the i_aspect_x and i_aspect_y from i_aspect.
- */
-void vout_AspectRatio( unsigned int i_aspect,
- /*out*/ unsigned int *i_aspect_x,
- /*out*/ unsigned int *i_aspect_y )
-{
- unsigned int i_pgcd = ReduceHeight( i_aspect );
- *i_aspect_x = i_aspect / i_pgcd;
- *i_aspect_y = VOUT_ASPECT_FACTOR / i_pgcd;
-}
-
/*****************************************************************************
* vout_Request: find a video output thread, create one, or destroy one.
*****************************************************************************