1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-03 13:32:16 +00:00

sws_utils: re-use avcolorspace for sws colorspaces

This lets us avoid having to maintain two separate copies of the
colorspace mapping functions.
This commit is contained in:
Niklas Haas 2015-05-04 01:27:55 +02:00
parent a2da53027b
commit 08d3ef3d9e
No known key found for this signature in database
GPG Key ID: 3BA77D4BFDB10BCE

View File

@ -107,12 +107,9 @@ bool mp_sws_supported_format(int imgfmt)
static int mp_csp_to_sws_colorspace(enum mp_csp csp) static int mp_csp_to_sws_colorspace(enum mp_csp csp)
{ {
switch (csp) { // The SWS_CS_* macros are just convenience redefinitions of the
case MP_CSP_BT_601: return SWS_CS_ITU601; // AVCOL_SPC_* macros, inside swscale.h.
case MP_CSP_BT_709: return SWS_CS_ITU709; return mp_csp_to_avcol_spc(csp);
case MP_CSP_SMPTE_240M: return SWS_CS_SMPTE240M;
default: return SWS_CS_DEFAULT;
}
} }
static bool cache_valid(struct mp_sws_context *ctx) static bool cache_valid(struct mp_sws_context *ctx)