summaryrefslogtreecommitdiffstats
path: root/video/mp_image.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-10-16 10:35:37 +0200
committerwm4 <wm4@nowhere>2017-10-16 10:35:37 +0200
commitc6b97a4935cf2e5d1008e4b0d03c8cece415fec1 (patch)
tree75db017cdf880663af9d2d3546ff922973fa4071 /video/mp_image.c
parent6d534138edf54be8414ce871e8b1edbf4f159828 (diff)
downloadmpv-c6b97a4935cf2e5d1008e4b0d03c8cece415fec1.tar.bz2
mpv-c6b97a4935cf2e5d1008e4b0d03c8cece415fec1.tar.xz
mp_image: select an explicit fallback for chroma location
If the chroma location is missing, vo_gpu will use centered chroma. Select a better chroma location by default: normally, it will always be MPEG video chroma location. If full levels are used, use JPEG chroma location, because that sort of sounds like it could make sense as it might coincide with JPEG being decoded. See e.g. #4804.
Diffstat (limited to 'video/mp_image.c')
-rw-r--r--video/mp_image.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index 1281c5c1dd..d2299bfcc2 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -800,6 +800,13 @@ void mp_image_params_guess_csp(struct mp_image_params *params)
}
}
+ if (params->chroma_location == MP_CHROMA_AUTO) {
+ if (params->color.levels == MP_CSP_LEVELS_TV)
+ params->chroma_location = MP_CHROMA_LEFT;
+ if (params->color.levels == MP_CSP_LEVELS_PC)
+ params->chroma_location = MP_CHROMA_CENTER;
+ }
+
if (params->color.light == MP_CSP_LIGHT_AUTO) {
// HLG is always scene-referred (using its own OOTF), everything else
// we assume is display-refered by default.