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.
This commit is contained in:
wm4 2017-10-16 10:35:37 +02:00
parent 6d534138ed
commit c6b97a4935
1 changed files with 7 additions and 0 deletions

View File

@ -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.