if (s->preserve_lightness)
preservel(&r, &g, &b, l);
- dstr[j] = av_clip_uint8(r * max);
- dstg[j] = av_clip_uint8(g * max);
- dstb[j] = av_clip_uint8(b * max);
+ dstr[j] = av_clip_uint8(lrintf(r * max));
+ dstg[j] = av_clip_uint8(lrintf(g * max));
+ dstb[j] = av_clip_uint8(lrintf(b * max));
if (in != out && out->linesize[3])
dsta[j] = srca[j];
}
if (s->preserve_lightness)
preservel(&r, &g, &b, l);
- dstr[j] = av_clip_uintp2_c(r * max, depth);
- dstg[j] = av_clip_uintp2_c(g * max, depth);
- dstb[j] = av_clip_uintp2_c(b * max, depth);
+ dstr[j] = av_clip_uintp2_c(lrintf(r * max), depth);
+ dstg[j] = av_clip_uintp2_c(lrintf(g * max), depth);
+ dstb[j] = av_clip_uintp2_c(lrintf(b * max), depth);
if (in != out && out->linesize[3])
dsta[j] = srca[j];
}
if (s->preserve_lightness)
preservel(&r, &g, &b, l);
- dst[j + roffset] = av_clip_uint8(r * max);
- dst[j + goffset] = av_clip_uint8(g * max);
- dst[j + boffset] = av_clip_uint8(b * max);
+ dst[j + roffset] = av_clip_uint8(lrintf(r * max));
+ dst[j + goffset] = av_clip_uint8(lrintf(g * max));
+ dst[j + boffset] = av_clip_uint8(lrintf(b * max));
if (in != out && step == 4)
dst[j + aoffset] = src[j + aoffset];
}
if (s->preserve_lightness)
preservel(&r, &g, &b, l);
- dst[j + roffset] = av_clip_uintp2_c(r * max, depth);
- dst[j + goffset] = av_clip_uintp2_c(g * max, depth);
- dst[j + boffset] = av_clip_uintp2_c(b * max, depth);
+ dst[j + roffset] = av_clip_uintp2_c(lrintf(r * max), depth);
+ dst[j + goffset] = av_clip_uintp2_c(lrintf(g * max), depth);
+ dst[j + boffset] = av_clip_uintp2_c(lrintf(b * max), depth);
if (in != out && step == 4)
dst[j + aoffset] = src[j + aoffset];
}
{ NULL }
};
-AVFilter ff_vf_colorbalance = {
+const AVFilter ff_vf_colorbalance = {
.name = "colorbalance",
.description = NULL_IF_CONFIG_SMALL("Adjust the color balance."),
.priv_size = sizeof(ColorBalanceContext),