diff options
author | Niklas Haas <git@nand.wakku.to> | 2015-05-04 01:27:55 +0200 |
---|---|---|
committer | Niklas Haas <git@nand.wakku.to> | 2015-05-04 01:34:25 +0200 |
commit | 08d3ef3d9e94609d1fc6c4c0892b17945bc7d0f8 (patch) | |
tree | c73dc538c5c1818d5e7ccf741cb3b6cdea8aa0cc /video/sws_utils.c | |
parent | a2da53027b3fcb232121c38e79d7daae651f099d (diff) | |
download | mpv-08d3ef3d9e94609d1fc6c4c0892b17945bc7d0f8.tar.bz2 mpv-08d3ef3d9e94609d1fc6c4c0892b17945bc7d0f8.tar.xz |
sws_utils: re-use avcolorspace for sws colorspaces
This lets us avoid having to maintain two separate copies of the
colorspace mapping functions.
Diffstat (limited to 'video/sws_utils.c')
-rw-r--r-- | video/sws_utils.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/video/sws_utils.c b/video/sws_utils.c index 8997b20649..bf5ad8f1a4 100644 --- a/video/sws_utils.c +++ b/video/sws_utils.c @@ -107,12 +107,9 @@ bool mp_sws_supported_format(int imgfmt) static int mp_csp_to_sws_colorspace(enum mp_csp csp) { - switch (csp) { - case MP_CSP_BT_601: return SWS_CS_ITU601; - case MP_CSP_BT_709: return SWS_CS_ITU709; - case MP_CSP_SMPTE_240M: return SWS_CS_SMPTE240M; - default: return SWS_CS_DEFAULT; - } + // The SWS_CS_* macros are just convenience redefinitions of the + // AVCOL_SPC_* macros, inside swscale.h. + return mp_csp_to_avcol_spc(csp); } static bool cache_valid(struct mp_sws_context *ctx) |