video: switch from using display aspect to sample aspect

MPlayer traditionally always used the display aspect ratio, e.g. 16:9,
while FFmpeg uses the sample (aka pixel) aspect ratio.

Both have a bunch of advantages and disadvantages. Actually, it seems
using sample aspect ratio is generally nicer. The main reason for the
change is making mpv closer to how FFmpeg works in order to make life
easier. It's also nice that everything uses integer fractions instead
of floats now (except --video-aspect option/property).

Note that there is at least 1 user-visible change: vf_dsize now does
not set the display size, only the display aspect ratio. This is
because the image_params d_w/d_h fields did not just set the display
aspect, but also the size (except in encoding mode).
This commit is contained in:
wm4
2015-12-19 20:04:31 +01:00
parent 1f7c099dc0
commit 0a0bb9059f
37 changed files with 154 additions and 215 deletions

View File

@@ -291,8 +291,8 @@ const char *image_writer_file_ext(const struct image_writer_opts *opts)
struct mp_image *convert_image(struct mp_image *image, int destfmt,
struct mp_log *log)
{
int d_w = image->params.d_w;
int d_h = image->params.d_h;
int d_w, d_h;
mp_image_params_get_dsize(&image->params, &d_w, &d_h);
bool is_anamorphic = image->w != d_w || image->h != d_h;
// Caveat: no colorspace/levels conversion done if pixel formats equal