mirror of https://github.com/mpv-player/mpv
sws_utils: remove unused helper
sws_getContextFromCmdLine_hq() was used by the screenshot code, which now uses mp_image_swscale(). Also move the mp_sws_set_colorspace() declaration from sws_utils.h to vf_scale.c.
This commit is contained in:
parent
e6ed0b1d3c
commit
4c21ad1f55
|
@ -64,6 +64,9 @@ static struct vf_priv_s {
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int mp_sws_set_colorspace(struct SwsContext *sws,
|
||||||
|
struct mp_csp_details *csp);
|
||||||
|
|
||||||
//===========================================================================//
|
//===========================================================================//
|
||||||
|
|
||||||
static const unsigned int outfmt_list[]={
|
static const unsigned int outfmt_list[]={
|
||||||
|
@ -541,7 +544,8 @@ static const int mp_csp_to_swscale[MP_CSP_COUNT] = {
|
||||||
// do nothing or return an error.
|
// do nothing or return an error.
|
||||||
// The csp argument is set to the supported values.
|
// The csp argument is set to the supported values.
|
||||||
// Return 0 on success and -1 on error.
|
// Return 0 on success and -1 on error.
|
||||||
int mp_sws_set_colorspace(struct SwsContext *sws, struct mp_csp_details *csp)
|
static int mp_sws_set_colorspace(struct SwsContext *sws,
|
||||||
|
struct mp_csp_details *csp)
|
||||||
{
|
{
|
||||||
int *table, *inv_table;
|
int *table, *inv_table;
|
||||||
int brightness, contrast, saturation, srcRange, dstRange;
|
int brightness, contrast, saturation, srcRange, dstRange;
|
||||||
|
|
|
@ -93,10 +93,9 @@ void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam,
|
||||||
}
|
}
|
||||||
|
|
||||||
// will use sws_flags & src_filter (from cmd line)
|
// will use sws_flags & src_filter (from cmd line)
|
||||||
static struct SwsContext *sws_getContextFromCmdLine2(int srcW, int srcH,
|
struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH,
|
||||||
int srcFormat, int dstW,
|
int srcFormat, int dstW,
|
||||||
int dstH, int dstFormat,
|
int dstH, int dstFormat)
|
||||||
int extraflags)
|
|
||||||
{
|
{
|
||||||
int flags;
|
int flags;
|
||||||
SwsFilter *dstFilterParam, *srcFilterParam;
|
SwsFilter *dstFilterParam, *srcFilterParam;
|
||||||
|
@ -108,29 +107,8 @@ static struct SwsContext *sws_getContextFromCmdLine2(int srcW, int srcH,
|
||||||
sfmt = PIX_FMT_PAL8;
|
sfmt = PIX_FMT_PAL8;
|
||||||
sws_getFlagsAndFilterFromCmdLine(&flags, &srcFilterParam, &dstFilterParam);
|
sws_getFlagsAndFilterFromCmdLine(&flags, &srcFilterParam, &dstFilterParam);
|
||||||
|
|
||||||
return sws_getContext(srcW, srcH, sfmt, dstW, dstH, dfmt, flags |
|
return sws_getContext(srcW, srcH, sfmt, dstW, dstH, dfmt, flags,
|
||||||
extraflags, srcFilterParam, dstFilterParam,
|
srcFilterParam, dstFilterParam, NULL);
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat,
|
|
||||||
int dstW, int dstH,
|
|
||||||
int dstFormat)
|
|
||||||
{
|
|
||||||
return sws_getContextFromCmdLine2(srcW, srcH, srcFormat, dstW, dstH,
|
|
||||||
dstFormat,
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct SwsContext *sws_getContextFromCmdLine_hq(int srcW, int srcH,
|
|
||||||
int srcFormat, int dstW,
|
|
||||||
int dstH,
|
|
||||||
int dstFormat)
|
|
||||||
{
|
|
||||||
return sws_getContextFromCmdLine2(
|
|
||||||
srcW, srcH, srcFormat, dstW, dstH, dstFormat,
|
|
||||||
SWS_FULL_CHR_H_INT | SWS_FULL_CHR_H_INP |
|
|
||||||
SWS_ACCURATE_RND | SWS_BITEXACT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mp_sws_supported_format(int imgfmt)
|
bool mp_sws_supported_format(int imgfmt)
|
||||||
|
|
|
@ -17,11 +17,6 @@ void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam,
|
||||||
struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat,
|
struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat,
|
||||||
int dstW, int dstH,
|
int dstW, int dstH,
|
||||||
int dstFormat);
|
int dstFormat);
|
||||||
struct SwsContext *sws_getContextFromCmdLine_hq(int srcW, int srcH,
|
|
||||||
int srcFormat, int dstW,
|
|
||||||
int dstH,
|
|
||||||
int dstFormat);
|
|
||||||
int mp_sws_set_colorspace(struct SwsContext *sws, struct mp_csp_details *csp);
|
|
||||||
|
|
||||||
bool mp_sws_supported_format(int imgfmt);
|
bool mp_sws_supported_format(int imgfmt);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue