mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
avfilter/vf_selectivecolor: no need to use doubles
This commit is contained in:
parent
7d463be590
commit
eda2a50c8e
@ -223,7 +223,7 @@ static int parse_psfile(AVFilterContext *ctx, const char *fname)
|
|||||||
int k;
|
int k;
|
||||||
for (k = 0; k < FF_ARRAY_ELEMS(s->cmyk_adjust[0]); k++) {
|
for (k = 0; k < FF_ARRAY_ELEMS(s->cmyk_adjust[0]); k++) {
|
||||||
READ16(val);
|
READ16(val);
|
||||||
s->cmyk_adjust[i][k] = val / 100.;
|
s->cmyk_adjust[i][k] = val / 100.f;
|
||||||
}
|
}
|
||||||
ret = register_range(s, i);
|
ret = register_range(s, i);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -299,11 +299,11 @@ static const enum AVPixelFormat pix_fmts[] = {
|
|||||||
static inline int comp_adjust(int scale, float value, float adjust, float k, int correction_method)
|
static inline int comp_adjust(int scale, float value, float adjust, float k, int correction_method)
|
||||||
{
|
{
|
||||||
const float min = -value;
|
const float min = -value;
|
||||||
const float max = 1. - value;
|
const float max = 1.f - value;
|
||||||
float res = (-1. - adjust) * k - adjust;
|
float res = (-1.f - adjust) * k - adjust;
|
||||||
if (correction_method == CORRECTION_METHOD_RELATIVE)
|
if (correction_method == CORRECTION_METHOD_RELATIVE)
|
||||||
res *= max;
|
res *= max;
|
||||||
return lrint(av_clipf(res, min, max) * scale);
|
return lrintf(av_clipf(res, min, max) * scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DECLARE_SELECTIVE_COLOR_FUNC(nbits) \
|
#define DECLARE_SELECTIVE_COLOR_FUNC(nbits) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user