[MPlayer-dev-eng] [libass] Ignore PlayResX/Y aspect ratio for font aspect ratio.

Nicolas George nicolas.george at normalesup.org
Wed Aug 19 16:13:34 CEST 2009


Hi.

Before anything else, to help the discussion, I would like to define some
vocabulary:

- I will call "anamorphic scripts" ASS files that expect the font to be
  scaled according to both PlayResX and PlayResY. In other words, scripts
  that expect the k = -2 behaviour, or the behaviour of mplayer six months
  ago.

- And I will call "overcompensated scripts" ASS files that expect the font
  to be scaled only according to PlayResY. In other words, scripts that
  expect the k = 1 behaviour, or the behaviour of current mplayer.


Le duodi 2 fructidor, an CCXVII, Grigori Goronzy a écrit :
> Actually I've never seen that.

There are TV shows where "dubious" encodings can be found both in downscaled
XviD and in unscaled anamorphic x264. There are fan-made subtitles for these
shows, some are in ASS to avoid subtitles over on-screen texts: they are
supposed to fit both versions.

> > - k = -1 (default): heuristic guess:
> > 
> >   - if any style in the script has ScaleX != 1, then behave as if k = 1
> >     (assuming that ScaleX is there to compensate for anamorphic content);
> > 
> >   - otherwise, behave as if k = -2
> > 
> This doesn't.  Often, ScaleX is used for complex typesetting (i.e.
> squishing/stretching on purpose) and if there's a style with ScaleX !=
> 100 it doesn't really mean anything. So you would possibly misdetect
> scripts that need k = -2 as scripts that need k = 1.

Any heuristic is bound to sometimes make the wrong guess. We could simply
take k = 1 as the default, this will be identical to the current behaviour.
Still, I believe that a smart heuristic is a better choice by default. Those
who disagree can set the option in ~/.mplayer/config.

The heuristic I proposed can be wrong in the following situations:

1. The script is anamorphic but the heuristic detects it as overcompensated:
   1a. The script is anamorphic.
   1b. It uses ScaleX in its styles.

2. The script is overcompensated but the heuristic detects it as anamorphic:
   2a. The script is overcompensated.
   2b. It does not use ScaleX to do its overcompensation
       (either it uses ScaleY or \fsc[xy], or it finds stretched text nice).

And obviously, this is only relevant if the contents is itself anamorphic.

You seem to be worried about case 1. But according to you, 1a is quite
uncommon. In fact, that was a deliberate choice to make the heuristic
strongly biaised towards the overcompensated k = 1 case because you told me
it was the default behaviour of the reference software.

In fact, I am more worried about case 2, point b in particular.

> Maybe it's a better idea to determine the scaling mode from the content
> or container.  If you've got Matroska with embedded ASS/SSA subtitles,
> you can be almost 100% sure the "k = 1" behavior is expected. If you
> have text (SRT/DVB etc.) subtitles that are converted by MPlayer and
> rendered with libass, the "k = -2" behavior is needed, for example.

I am pretty sure I encountered at least once Matroska with embedded ASS that
looked fine with the old (k = -2) behaviour. This heuristic is not perfect
either.

To gain time, I can submit a patch that adds the option with k = 1 the
default, and therefore with no visible change from the user's point of view,
and later submit another patch implementing the best heuristic we could
devise in the meantime.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090819/1d3cb720/attachment.pgp>


More information about the MPlayer-dev-eng mailing list