]> git.sesse.net Git - vlc/commitdiff
* src/video_output/video_output.c, modules/codec/ogt: got rid of vout_AspectRatio().
authorGildas Bazin <gbazin@videolan.org>
Fri, 10 Sep 2004 18:03:25 +0000 (18:03 +0000)
committerGildas Bazin <gbazin@videolan.org>
Fri, 10 Sep 2004 18:03:25 +0000 (18:03 +0000)
include/vlc_video.h
modules/codec/ogt/common.c
modules/codec/ogt/render.c
src/video_output/video_output.c

index 5b059a9f8f008d27a157495eac85b1f6bd7b7aed..dd962a02d7a5477fd98d511b16fa951d943384f1 100644 (file)
@@ -291,16 +291,6 @@ struct subpicture_t
 /*****************************************************************************
  * 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
  *
index c1506fdd0d6cdf9e813bceabc64df961a8461eb1..73e126bb8c14866ba5f0448db705ec11df399904 100644 (file)
@@ -2,7 +2,7 @@
  * 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:
@@ -349,7 +349,7 @@ VCDSubHandleScaling( subpicture_t *p_spu, decoder_t *p_dec )
   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) {
@@ -405,11 +405,12 @@ VCDSubHandleScaling( subpicture_t *p_spu, decoder_t *p_dec )
             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 );
     }
index c241d56554131f6ae3697044a6f21ab7bfa2f49b..21824770237180e5d1941f8eae19b2a13072a3a7 100644 (file)
@@ -4,7 +4,7 @@
  *            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: 
@@ -1044,10 +1044,10 @@ BlendRV24( vout_thread_t *p_vout, picture_t *p_pic,
   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);
@@ -1336,10 +1336,10 @@ BlendRV32( vout_thread_t *p_vout, picture_t *p_pic,
     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);
@@ -1683,10 +1683,10 @@ BlendRGB2( vout_thread_t *p_vout, picture_t *p_pic,
     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);
index 7b502350b671487de7f0ea0655efa558073d45a3..5d9526a0545228526dbc568d7cd72f864a9e2b6c 100644 (file)
@@ -63,20 +63,6 @@ static int DeinterlaceCallback( vlc_object_t *, char const *,
 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.
  *****************************************************************************