The input data is multiplied by `s->offset` to get normalized output. `s->target_tp` and `true_peak` is not in dB, so `s->offset` should be calculated by division instead of subtraction.
Unified · Split
| @@ -455,7 +455,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 454 unmodified lines | |||
| 455 | 455 | ||
| 456 | offset = pow(10., (s->target_i - global) / 20.); | 456 | offset = pow(10., (s->target_i - global) / 20.); |
| 457 | offset_tp = true_peak * offset; | 457 | offset_tp = true_peak * offset; |
| 458 | s->offset = offset_tp < s->target_tp ? offset : s->target_tp - true_peak; | 458 | s->offset = offset_tp < s->target_tp ? offset : s->target_tp / true_peak; |
| 459 | s->frame_type = LINEAR_MODE; | 459 | s->frame_type = LINEAR_MODE; |
| 460 | } | 460 | } |
| 461 | 461 | ||