diff options
author | wm4 <wm4@nowhere> | 2013-03-17 21:58:11 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-03-17 22:07:13 +0100 |
commit | b049ffb33007997fbbaa553651eb3e3adc89ff28 (patch) | |
tree | e63a015eb9b9b51c0bc59601074e32a9260d1a74 | |
parent | 1ae1939742c6b95945af3c81852b949ac1c904ab (diff) | |
download | mpv-b049ffb33007997fbbaa553651eb3e3adc89ff28.tar.bz2 mpv-b049ffb33007997fbbaa553651eb3e3adc89ff28.tar.xz |
video: remove rounding of display size to multiples of 2
The code that is changed is responsible for scaling the video size to
display size, so that the resulting video rectangle is letter-boxed
inside the display window. This is before panscan calculations, which
can actually enlarge the video and make it larger than the display size
again. (src_dst_split_scaling() in vo.c takes cares of clipping the
video size to window size.)
I'm not sure why this rounding is done, as using panscan controls can
introduce odd sizes again. The rounding has been part of the code since
the initial commit. On the other hand, this rounding can slightly
influence the aspect ratio of the displayed image to the worse. It
forces the image to be scaled by an additional pixel, without actually
correcting the display size into the other direction.
Although video sizes are usually at least aligned on 2 (and often more),
odd sizes can still happen when playing e.g. anamorphic DVDs.
Remove the additional rounding.
(Note that we still round the _source_ image position and size when the
displayed image is larger than the screen, e.g. when panscan is used.
This is needed by some VOs so that the image source rectangle starts on
full chroma pixels. Maybe this rounding should be moved to the
respective VOs, which includes at least vo_direct3d.)
-rw-r--r-- | video/out/aspect.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/video/out/aspect.c b/video/out/aspect.c index 6b5d969ae5..10bf40c69f 100644 --- a/video/out/aspect.c +++ b/video/out/aspect.c @@ -72,12 +72,10 @@ static void aspect_calc(struct vo *vo, int *srcw, int *srch) fitw, fith, aspdat->monitor_par); *srcw = fitw; *srch = (float)fitw / aspdat->prew * aspdat->preh / pixelaspect; - *srch += *srch % 2; // round mp_msg(MSGT_VO, MSGL_DBG2, "aspect(1) wh: %dx%d (org: %dx%d)\n", *srcw, *srch, aspdat->prew, aspdat->preh); if (*srch > fith || *srch < aspdat->orgh) { int tmpw = (float)fith / aspdat->preh * aspdat->prew * pixelaspect; - tmpw += tmpw % 2; // round if (tmpw <= fitw) { *srch = fith; *srcw = tmpw; |