compress: Overhaul the meaning of --aggressiveness.
[paraslash.git] / compress_filter.c
index 0c76fd7..15bed6d 100644 (file)
@@ -123,7 +123,7 @@ static void compress_open(struct filter_node *fn)
        fn->private_data = pcd;
        fn->min_iqs = 2; /* 16 bit audio */
        pcd->current_gain = 1U << inertia;
-       pcd->max_gain = 1U << (inertia + aggressiveness);
+       pcd->max_gain = (1U << inertia) * (1.0 + 3.0 * aggressiveness / 10.0);
 }
 
 static void *compress_setup(const struct lls_parse_result *lpr)
@@ -136,20 +136,15 @@ static void *compress_setup(const struct lls_parse_result *lpr)
                exit(EXIT_FAILURE);
        }
        val = U32_OPTVAL(AGGRESSIVENESS, lpr);
-       if (val == 0 || val > 15) {
+       if (val > 10) {
                PARA_EMERG_LOG("aggressiveness (%u) out of range\n", val);
                exit(EXIT_FAILURE);
        }
        val = U32_OPTVAL(INERTIA, lpr);
-       if (val == 0 || val > 15) {
+       if (val == 0 || val > 14) {
                PARA_EMERG_LOG("inertia (%u) out of range\n", val);
                exit(EXIT_FAILURE);
        }
-       val = U32_OPTVAL(AGGRESSIVENESS, lpr) + U32_OPTVAL(INERTIA, lpr);
-       if (val > 16) {
-               PARA_EMERG_LOG("inertia + aggressiveness (%u) > 16\n", val);
-               exit(EXIT_FAILURE);
-       }
        val = U32_OPTVAL(TARGET_LEVEL, lpr);
        if (val > 32767) {
                PARA_EMERG_LOG("target-level (%u) out of range\n", val);