39 #define HUE_DEFAULT_VAL 0
40 #define SAT_DEFAULT_VAL 1
42 #define HUE_DEFAULT_VAL_STRING AV_STRINGIFY(HUE_DEFAULT_VAL)
43 #define SAT_DEFAULT_VAL_STRING AV_STRINGIFY(SAT_DEFAULT_VAL)
45 #define SAT_MIN_VAL -10
46 #define SAT_MAX_VAL 10
85 #define OFFSET(x) offsetof(HueContext, x)
86 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
110 #define SET_EXPRESSION(attr, name) do { \
111 if (hue->attr##_expr) { \
112 if ((ret = av_expr_parse(&hue->attr##_pexpr, hue->attr##_expr, var_names, \
113 NULL, NULL, NULL, NULL, 0, ctx)) < 0) { \
114 av_log(ctx, AV_LOG_ERROR, \
115 "Parsing failed for expression " #name "='%s'", \
117 hue->attr##_expr = old_##attr##_expr; \
118 hue->attr##_pexpr = old_##attr##_pexpr; \
119 return AVERROR(EINVAL); \
120 } else if (old_##attr##_pexpr) { \
121 av_freep(&old_##attr##_expr); \
122 av_expr_free(old_##attr##_pexpr); \
123 old_##attr##_pexpr = NULL; \
126 hue->attr##_expr = old_##attr##_expr; \
134 char *old_hue_expr, *old_hue_deg_expr, *old_saturation_expr;
135 AVExpr *old_hue_pexpr, *old_hue_deg_pexpr, *old_saturation_pexpr;
136 static const char *shorthand[] = {
"h",
"s",
NULL };
153 "H and h options are incompatible and cannot be specified "
154 "at the same time\n");
168 "H_expr:%s h_deg_expr:%s s_expr:%s\n",
180 hue->
class = &hue_class;
250 for (i = 0; i < w; i++) {
261 new_u = ((c *
u) - (s * v) + (1 << 15) + (128 << 16)) >> 16;
262 new_v = ((s *
u) + (c * v) + (1 << 15) + (128 << 16)) >> 16;
269 usrc += src_linesize;
270 vsrc += src_linesize;
271 udst += dst_linesize;
272 vdst += dst_linesize;
276 #define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
277 #define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb))
302 "Saturation value not in range [%d,%d]: clipping value to %0.1f\n",
315 "H:%0.1f s:%0.f t:%0.1f n:%d\n",
326 inlink->
w, inlink->
h);
330 inlink->
w >> hue->
hsub, inlink->
h >> hue->
vsub,
338 char *res,
int res_len,
int flags)
340 if (!strcmp(cmd,
"reinit"))
377 .priv_class = &hue_class,