]> granicus.if.org Git - libass/commitdiff
Clarify the AR parameter meanings
authorGrigori Goronzy <greg@blackbox>
Wed, 5 Aug 2009 01:19:32 +0000 (03:19 +0200)
committerGrigori Goronzy <greg@blackbox>
Wed, 5 Aug 2009 01:21:36 +0000 (03:21 +0200)
Use the correct terms (SAR/DAR) for the aspect ratio parameters.

libass/ass.h
libass/ass_render.c

index 8c261531f99121cfcdfa8029aef75e72f185a67a..16e739958d712e8e1a5dc6a8c9c3996133bcdc08 100644 (file)
@@ -167,10 +167,10 @@ void ass_set_use_margins(ass_renderer_t *priv, int use);
 /**
  * \brief Set aspect ratio parameters.
  * \param priv renderer handle
- * \param ar physical aspect ratio
- * \param par pixel ratio, e.g. width / height of the video
+ * \param dar display aspect ratio (DAR), prescaled for output PAR
+ * \param sar storage aspect ratio (SAR)
  */
-void ass_set_aspect_ratio(ass_renderer_t *priv, double ar, double par);
+void ass_set_aspect_ratio(ass_renderer_t *priv, double dar, double sar);
 
 /**
  * \brief Set a fixed font scaling factor.
index 8c249e04eb870c2c912eb08512e1aae763c20775..b1cfd1a8fedfaa0004ee54980a93a0925d0eba42 100644 (file)
@@ -76,7 +76,7 @@ typedef struct {
     int use_margins;            // 0 - place all subtitles inside original frame
     // 1 - use margins for placing toptitles and subtitles
     double aspect;              // frame aspect ratio, d_width / d_height.
-    double pixel_ratio;         // pixel ratio of the source image
+    double storage_aspect;      // pixel ratio of the source image
     ass_hinting_t hinting;
 
     char *default_font;
@@ -3162,7 +3162,7 @@ void ass_set_frame_size(ass_renderer_t *priv, int w, int h)
         priv->settings.frame_height = h;
         if (priv->settings.aspect == 0.) {
             priv->settings.aspect = ((double) w) / h;
-            priv->settings.pixel_ratio = ((double) w) / h;
+            priv->settings.storage_aspect = ((double) w) / h;
         }
         ass_reconfigure(priv);
     }
@@ -3187,11 +3187,11 @@ void ass_set_use_margins(ass_renderer_t *priv, int use)
     priv->settings.use_margins = use;
 }
 
-void ass_set_aspect_ratio(ass_renderer_t *priv, double ar, double par)
+void ass_set_aspect_ratio(ass_renderer_t *priv, double dar, double sar)
 {
-    if (priv->settings.aspect != ar || priv->settings.pixel_ratio != par) {
-        priv->settings.aspect = ar;
-        priv->settings.pixel_ratio = par;
+    if (priv->settings.aspect != dar || priv->settings.storage_aspect != sar) {
+        priv->settings.aspect = dar;
+        priv->settings.storage_aspect = sar;
         ass_reconfigure(priv);
     }
 }
@@ -3293,7 +3293,7 @@ ass_start_frame(ass_renderer_t *render_priv, ass_track_t *track,
 
     // PAR correction
     render_priv->font_scale_x = render_priv->settings.aspect /
-                                render_priv->settings.pixel_ratio;
+                                render_priv->settings.storage_aspect;
 
     render_priv->prev_images_root = render_priv->images_root;
     render_priv->images_root = 0;