]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_deband.c
avfilter: add rubberband wrapper
[ffmpeg] / libavfilter / vf_deband.c
index 5de3db171d59c82e5afade66349b6711efadeab4..f25cbdd593636b785e10fa77ec57d8a760b626e1 100644 (file)
@@ -58,7 +58,7 @@ static const AVOption deband_options[] = {
     { "r",         "set range",               OFFSET(range),        AV_OPT_TYPE_INT,   {.i64=16},    INT_MIN, INT_MAX, FLAGS },
     { "direction", "set direction",           OFFSET(direction),    AV_OPT_TYPE_FLOAT, {.dbl=2*M_PI},-2*M_PI,  2*M_PI, FLAGS },
     { "d",         "set direction",           OFFSET(direction),    AV_OPT_TYPE_FLOAT, {.dbl=2*M_PI},-2*M_PI,  2*M_PI, FLAGS },
-    { "blur",      "enable blur",             OFFSET(blur),         AV_OPT_TYPE_INT,   {.i64=1},           0,       1, FLAGS },
+    { "blur",      "set blur",                OFFSET(blur),         AV_OPT_TYPE_BOOL,  {.i64=1},           0,       1, FLAGS },
     { NULL }
 };
 
@@ -223,12 +223,12 @@ static int config_input(AVFilterLink *inlink)
     s->planewidth[1]  = s->planewidth[2]  = FF_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
     s->planewidth[0]  = s->planewidth[3]  = inlink->w;
 
-    s->deband = desc->comp[0].depth_minus1 > 7 ? deband_16_c : deband_8_c;
+    s->deband = desc->comp[0].depth > 8 ? deband_16_c : deband_8_c;
 
-    s->thr[0] = ((1 << (desc->comp[0].depth_minus1 + 1)) - 1) * s->threshold[0];
-    s->thr[1] = ((1 << (desc->comp[1].depth_minus1 + 1)) - 1) * s->threshold[1];
-    s->thr[2] = ((1 << (desc->comp[2].depth_minus1 + 1)) - 1) * s->threshold[2];
-    s->thr[3] = ((1 << (desc->comp[3].depth_minus1 + 1)) - 1) * s->threshold[3];
+    s->thr[0] = ((1 << desc->comp[0].depth) - 1) * s->threshold[0];
+    s->thr[1] = ((1 << desc->comp[1].depth) - 1) * s->threshold[1];
+    s->thr[2] = ((1 << desc->comp[2].depth) - 1) * s->threshold[2];
+    s->thr[3] = ((1 << desc->comp[3].depth) - 1) * s->threshold[3];
 
     s->x_pos = av_malloc(s->planewidth[0] * s->planeheight[0] * sizeof(*s->x_pos));
     s->y_pos = av_malloc(s->planewidth[0] * s->planeheight[0] * sizeof(*s->y_pos));