diff options
author | wm4 <wm4@nowhere> | 2015-12-19 20:04:31 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-19 20:45:36 +0100 |
commit | 0a0bb9059f42671c267ea5d0c8faa3ac71a8c742 (patch) | |
tree | 89cbdee7748d36f98cc5d0efbfc8a3fc810b2016 /video/filter/vf.c | |
parent | 1f7c099dc0feb9a160d9018ad6ad068e0295341a (diff) | |
download | mpv-0a0bb9059f42671c267ea5d0c8faa3ac71a8c742.tar.bz2 mpv-0a0bb9059f42671c267ea5d0c8faa3ac71a8c742.tar.xz |
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).
Diffstat (limited to 'video/filter/vf.c')
-rw-r--r-- | video/filter/vf.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c index c5d11ef222..dd5b560df3 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -700,28 +700,3 @@ void vf_destroy(struct vf_chain *c) vf_chain_forget_frames(c); talloc_free(c); } - -// When changing the size of an image that had old_w/old_h with -// DAR *d_width/*d_height to the new size new_w/new_h, adjust -// *d_width/*d_height such that the new image has the same pixel aspect ratio. -void vf_rescale_dsize(int *d_width, int *d_height, int old_w, int old_h, - int new_w, int new_h) -{ - *d_width = *d_width * new_w / old_w; - *d_height = *d_height * new_h / old_h; -} - -// Set *d_width/*d_height to display aspect ratio with the givem source size -void vf_set_dar(int *d_w, int *d_h, int w, int h, double dar) -{ - *d_w = w; - *d_h = h; - if (dar > 0.01) { - *d_w = h * dar + 0.5; - // we don't like horizontal downscale - if (*d_w < w) { - *d_w = w; - *d_h = w / dar + 0.5; - } - } -} |