zimg: set correct primaries for XYZ

This commit is contained in:
Kacper Michajłow 2023-02-01 22:42:24 +01:00 committed by Leo Izen
parent 2101e77d1e
commit 7ceadbb3c1
1 changed files with 4 additions and 1 deletions

View File

@ -431,7 +431,10 @@ static bool setup_format(zimg_image_format *zfmt, struct mp_zimg_repack *r,
zfmt->matrix_coefficients = mp_to_z_matrix(fmt.color.space);
zfmt->transfer_characteristics = mp_to_z_trc(fmt.color.gamma);
zfmt->color_primaries = mp_to_z_prim(fmt.color.primaries);
// For MP_CSP_XYZ only valid primaries are defined in ST 428-1
zfmt->color_primaries = fmt.color.space == MP_CSP_XYZ
? ZIMG_PRIMARIES_ST428
: mp_to_z_prim(fmt.color.primaries);
zfmt->chroma_location = mp_to_z_chroma(fmt.chroma_location);
if (ctx && ctx->opts.fast) {