if (out_fmt == AV_SAMPLE_FMT_S32 && s->dither.output_sample_bits)
scale *= 1<<(32-s->dither.output_sample_bits);
+ if (scale == 0) {
+ s->dither.method = 0;
+ return 0;
+ }
+
s->dither.ns_pos = 0;
s->dither.noise_scale= scale;
s->dither.ns_scale = scale;
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;
- s->dither.noise_scale = 1;
- }
-
return 0;
}