opusenc_psy: Typo, use all coeffs in range for band tonality calculation
authorDaniil Cherednik <dan.cherednik@gmail.com>
Tue, 9 Jan 2018 18:15:20 +0000 (21:15 +0300)
committerRostislav Pehlivanov <atomnuker@gmail.com>
Sat, 13 Jan 2018 17:54:20 +0000 (17:54 +0000)
libavcodec/opusenc_psy.c

index b712603..8aded21 100644 (file)
@@ -119,7 +119,7 @@ static void step_collect_psy_metrics(OpusPsyContext *s, int index)
 
             for (j = 0; j < range; j++) {
                 const float c_s = coeffs[j]*coeffs[j];
-                dist_dev = (avg_c_s - c_s)*(avg_c_s - c_s);
+                dist_dev += (avg_c_s - c_s)*(avg_c_s - c_s);
             }
 
             st->tone[ch][i] += sqrtf(dist_dev);