s->dither.ns_pos = 0;
s->dither.noise_scale= scale;
s->dither.ns_scale = scale;
- s->dither.ns_scale_1 = 1/scale;
+ s->dither.ns_scale_1 = scale ? 1/scale : 0;
memset(s->dither.ns_errors, 0, sizeof(s->dither.ns_errors));
for (i=0; filters[i].coefs; i++) {
const filter_t *f = &filters[i];
s->dither.method = SWR_DITHER_TRIANGULAR_HIGHPASS;
}
+ av_assert0(!s->preout.count);
s->dither.noise = s->preout;
+ s->dither.temp = s->preout;
if (s->dither.method > SWR_DITHER_NS) {
s->dither.noise.bps = 4;
s->dither.noise.fmt = AV_SAMPLE_FMT_FLTP;