Lines Matching refs:dither
27 double scale = s->dither.noise_scale;
39 switch(s->dither.method){
42 av_assert0(s->dither.method < SWR_DITHER_NB);
54 switch(s->dither.method){
56 av_assert0(s->dither.method < SWR_DITHER_NB);
84 if (s->dither.method > SWR_DITHER_TRIANGULAR_HIGHPASS && s->dither.method <= SWR_DITHER_NS)
95 if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_S32 && (s->dither.output_sample_bits&31)) scale = 1;
100 scale *= s->dither.scale;
102 if (out_fmt == AV_SAMPLE_FMT_S32 && s->dither.output_sample_bits)
103 scale *= 1<<(32-s->dither.output_sample_bits);
106 s->dither.method = 0;
110 s->dither.ns_pos = 0;
111 s->dither.noise_scale= scale;
112 s->dither.ns_scale = scale;
113 s->dither.ns_scale_1 = scale ? 1/scale : 0;
114 memset(s->dither.ns_errors, 0, sizeof(s->dither.ns_errors));
117 if (llabs(s->out_sample_rate - f->rate)*20 <= f->rate && f->name == s->dither.method) {
119 s->dither.ns_taps = f->len;
121 s->dither.ns_coeffs[j] = f->coefs[j];
122 s->dither.ns_scale_1 *= 1 - exp(f->gain_cB * M_LN10 * 0.005) * 2 / (1<<(8*av_get_bytes_per_sample(out_fmt)));
126 if (!filters[i].coefs && s->dither.method > SWR_DITHER_NS) {
127 av_log(s, AV_LOG_WARNING, "Requested noise shaping dither not available at this sampling rate, using triangular hp dither\n");
128 s->dither.method = SWR_DITHER_TRIANGULAR_HIGHPASS;