On Tue, Oct 16, 2012 at 06:02:40PM +0200, Luca Barbato wrote:
> --- /dev/null
> +++ b/libavfilter/compare.h
> @@ -0,0 +1,40 @@
> +
> +typedef struct {
> +} CmpContext;

Please no more anonymously typedeffed structs in headers, I just removed
them everywhere else.

> --- /dev/null
> +++ b/libavfilter/dssim.c
> @@ -0,0 +1,326 @@
> +    return (LABA) {
> +               (116.0f * fy - 16.0f) / 100.0 * a,
> +             /* 86 is a fudge to make the value positive */
> +               (86.2f + 500.0f * (fx - fy)) / 220.0 * a,
> +             /* 107 is a fudge to make the value positive */
> +               (107.9f + 200.0f * (fy - fz)) / 220.0 * a,
> +               a };
> +}
> +
> +/* Macros to avoid repeating every line 4 times */
> +
> +#define LABA_OP(dst, X, op, Y) dst = (LABA) {   \
> +        (X).l op(Y).l,                          \
> +        (X).A op(Y).A,                          \
> +        (X).b op(Y).b,                          \
> +        (X).a op(Y).a }
> +
> +#define LABA_OPC(dst, X, op, Y) dst = (LABA) {  \
> +        (X).l op(Y),                            \
> +        (X).A op(Y),                            \
> +        (X).b op(Y),                            \
> +        (X).a op(Y) }
> +
> +#define LABA_OP1(dst, op, Y) dst = (LABA) {     \
> +        dst.l op(Y).l,                          \
> +        dst.A op(Y).A,                          \
> +        dst.b op(Y).b,                          \
> +        dst.a op(Y).a }

Indent by 4 spaces.

> +/*
> + * Blur image horizontally (width 2*size+1) and write it transposed to dst
> + * (called twice gives 2d blur)
> + * Run callback on every row before blurring
> + */

End sentences in periods; more below.

> +    img1      = av_malloc(width * height * sizeof(LABA));
> +    img2      = av_malloc(width * height * sizeof(LABA));
> +    img1_img2 = av_malloc(width * height * sizeof(LABA));
> +    tmp       = av_malloc(width * height * sizeof(LABA));
> +    sigma12   = av_malloc(width * height * sizeof(LABA));
> +    sigma1_sq = av_malloc(width * height * sizeof(LABA));
> +    sigma2_sq = av_malloc(width * height * sizeof(LABA));

sizeof(*variable) is preferable to sizeof(type), probably more in other places.

> +            r = (1.0 - ssim.a) + maxsq;

pointless ()

> +    av_log(NULL, AV_LOG_INFO, "pts %"PRId64" dssim value %.4f\n",
> +           dst->pts, 1.0 / (avgminssim) - 1.0);

same

> --- /dev/null
> +++ b/libavfilter/vf_compare.c
> @@ -0,0 +1,274 @@
> +static int config_output(AVFilterLink *outlink)
> +{
> +    AVFilterContext *ctx = outlink->src;
> +
> +    outlink->w = ctx->inputs[MAIN]->w;
> +    outlink->h = ctx->inputs[MAIN]->h;
> +    outlink->time_base = ctx->inputs[MAIN]->time_base;

align the =

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to