On Sat, Aug 13, 2011 at 04:36:46PM +0200, Stefano Sabatini wrote:
Make setting params less awkward.
The old syntax is kept for backward compatibility. [...] @@ -130,17 +154,49 @@ static void set_filter_param(FilterParam *fp, int msize_x, int msize_y, double a fp->halfscale = 1 << (fp->scalebits - 1); }
+static int parse_component_params(int *msize_x, int *msize_y, double *amount, + char *params, void *log_ctx) +{ + int n; + char sign; + + n = sscanf(params, "%dx%d%c%lf", msize_x, msize_y, &sign, amount); + if (n != 4 || (sign != '+' && sign != '-')) { + av_log(log_ctx, AV_LOG_ERROR, + "Invalid component parameters '%s', must be of the form " + "'XxY[+-]A'\n", params); + return AVERROR(EINVAL); + }
libmpcodecs can handle l7x7:5 (and l7:5) above code seems to need +- in there [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 2 "100% positive feedback" - "All either got their money back or didnt complain" "Best seller ever, very honest" - "Seller refunded buyer after failed scam"