• Home
  • Raw
  • Download

Lines Matching refs:quant

39 typedef void (*QuantizeFunc) (GstAudioQuantize * quant, const gpointer src,
79 gst_audio_quantize_quantize_memcpy (GstAudioQuantize * quant, in gst_audio_quantize_quantize_memcpy() argument
83 memcpy (dst, src, samples * sizeof (gint32) * quant->stride); in gst_audio_quantize_quantize_memcpy()
88 gst_audio_quantize_quantize_int_none_none (GstAudioQuantize * quant, in gst_audio_quantize_quantize_int_none_none() argument
91 audio_orc_int_bias (dst, src, quant->bias, ~quant->mask, in gst_audio_quantize_quantize_int_none_none()
92 samples * quant->stride); in gst_audio_quantize_quantize_int_none_none()
118 setup_dither_buf (GstAudioQuantize * quant, gint samples) in setup_dither_buf() argument
121 gint stride = quant->stride; in setup_dither_buf()
123 guint shift = quant->shift; in setup_dither_buf()
127 if (quant->dither_size < len) { in setup_dither_buf()
128 quant->dither_size = len; in setup_dither_buf()
129 quant->dither_buf = g_realloc (quant->dither_buf, len * sizeof (gint32)); in setup_dither_buf()
133 bias = quant->bias; in setup_dither_buf()
134 d = quant->dither_buf; in setup_dither_buf()
136 switch (quant->dither) { in setup_dither_buf()
158 gint32 tmp, *last_random = quant->last_random; in setup_dither_buf()
172 gst_audio_quantize_quantize_int_dither_none (GstAudioQuantize * quant, in gst_audio_quantize_quantize_int_dither_none() argument
175 setup_dither_buf (quant, samples); in gst_audio_quantize_quantize_int_dither_none()
177 audio_orc_int_dither (dst, src, quant->dither_buf, ~quant->mask, in gst_audio_quantize_quantize_int_dither_none()
178 samples * quant->stride); in gst_audio_quantize_quantize_int_dither_none()
182 setup_error_buf (GstAudioQuantize * quant, gint samples, gint extra) in setup_error_buf() argument
184 gint stride = quant->stride; in setup_error_buf()
187 if (quant->error_size < len) { in setup_error_buf()
188 quant->error_buf = g_realloc (quant->error_buf, len * sizeof (gint32)); in setup_error_buf()
189 if (quant->error_size == 0) in setup_error_buf()
190 memset ((gint32 *) quant->error_buf, 0, stride * extra * sizeof (gint32)); in setup_error_buf()
191 quant->error_size = len; in setup_error_buf()
196 gst_audio_quantize_quantize_int_dither_feedback (GstAudioQuantize * quant, in gst_audio_quantize_quantize_int_dither_feedback() argument
204 setup_dither_buf (quant, samples); in gst_audio_quantize_quantize_int_dither_feedback()
205 setup_error_buf (quant, samples, 1); in gst_audio_quantize_quantize_int_dither_feedback()
207 stride = quant->stride; in gst_audio_quantize_quantize_int_dither_feedback()
209 dith = quant->dither_buf; in gst_audio_quantize_quantize_int_dither_feedback()
210 e = quant->error_buf; in gst_audio_quantize_quantize_int_dither_feedback()
211 mask = ~quant->mask; in gst_audio_quantize_quantize_int_dither_feedback()
236 gst_audio_quantize_quantize_int_dither_noise_shape (GstAudioQuantize * quant, in gst_audio_quantize_quantize_int_dither_noise_shape() argument
244 nc = quant->n_coeffs; in gst_audio_quantize_quantize_int_dither_noise_shape()
246 setup_dither_buf (quant, samples); in gst_audio_quantize_quantize_int_dither_noise_shape()
247 setup_error_buf (quant, samples, nc); in gst_audio_quantize_quantize_int_dither_noise_shape()
249 stride = quant->stride; in gst_audio_quantize_quantize_int_dither_noise_shape()
251 dith = quant->dither_buf; in gst_audio_quantize_quantize_int_dither_noise_shape()
252 e = quant->error_buf; in gst_audio_quantize_quantize_int_dither_noise_shape()
253 c = quant->coeffs; in gst_audio_quantize_quantize_int_dither_noise_shape()
254 mask = ~quant->mask; in gst_audio_quantize_quantize_int_dither_noise_shape()
330 gst_audio_quantize_setup_noise_shaping (GstAudioQuantize * quant) in gst_audio_quantize_setup_noise_shaping() argument
336 switch (quant->ns) { in gst_audio_quantize_setup_noise_shaping()
361 quant->n_coeffs = n_coeffs; in gst_audio_quantize_setup_noise_shaping()
362 q = quant->coeffs = g_new0 (gint32, n_coeffs); in gst_audio_quantize_setup_noise_shaping()
370 gst_audio_quantize_setup_dither (GstAudioQuantize * quant) in gst_audio_quantize_setup_dither() argument
372 switch (quant->dither) { in gst_audio_quantize_setup_dither()
374 quant->last_random = g_new0 (gint32, quant->stride); in gst_audio_quantize_setup_dither()
378 quant->last_random = NULL; in gst_audio_quantize_setup_dither()
382 quant->last_random = NULL; in gst_audio_quantize_setup_dither()
389 gst_audio_quantize_setup_quantize_func (GstAudioQuantize * quant) in gst_audio_quantize_setup_quantize_func() argument
393 if (quant->shift == 0) { in gst_audio_quantize_setup_quantize_func()
394 quant->quantize = (QuantizeFunc) MAKE_QUANTIZE_FUNC_NAME (memcpy); in gst_audio_quantize_setup_quantize_func()
398 index = 5 * quant->dither + quant->ns; in gst_audio_quantize_setup_quantize_func()
399 quant->quantize = quantize_funcs[index]; in gst_audio_quantize_setup_quantize_func()
437 GstAudioQuantize *quant; in gst_audio_quantize_new() local
442 quant = g_slice_new0 (GstAudioQuantize); in gst_audio_quantize_new()
443 quant->dither = dither; in gst_audio_quantize_new()
444 quant->ns = ns; in gst_audio_quantize_new()
445 quant->flags = flags; in gst_audio_quantize_new()
446 quant->format = format; in gst_audio_quantize_new()
448 quant->stride = 1; in gst_audio_quantize_new()
449 quant->blocks = channels; in gst_audio_quantize_new()
451 quant->stride = channels; in gst_audio_quantize_new()
452 quant->blocks = 1; in gst_audio_quantize_new()
454 quant->quantizer = quantizer; in gst_audio_quantize_new()
456 quant->shift = count_power (quantizer); in gst_audio_quantize_new()
457 if (quant->shift > 0) in gst_audio_quantize_new()
458 quant->bias = (1U << (quant->shift - 1)); in gst_audio_quantize_new()
460 quant->bias = 0; in gst_audio_quantize_new()
461 quant->mask = (1U << quant->shift) - 1; in gst_audio_quantize_new()
463 gst_audio_quantize_setup_dither (quant); in gst_audio_quantize_new()
464 gst_audio_quantize_setup_noise_shaping (quant); in gst_audio_quantize_new()
465 gst_audio_quantize_setup_quantize_func (quant); in gst_audio_quantize_new()
467 return quant; in gst_audio_quantize_new()
477 gst_audio_quantize_free (GstAudioQuantize * quant) in gst_audio_quantize_free() argument
479 g_return_if_fail (quant != NULL); in gst_audio_quantize_free()
481 g_free (quant->error_buf); in gst_audio_quantize_free()
482 g_free (quant->coeffs); in gst_audio_quantize_free()
483 g_free (quant->last_random); in gst_audio_quantize_free()
484 g_free (quant->dither_buf); in gst_audio_quantize_free()
486 g_slice_free (GstAudioQuantize, quant); in gst_audio_quantize_free()
497 gst_audio_quantize_reset (GstAudioQuantize * quant) in gst_audio_quantize_reset() argument
499 g_free (quant->error_buf); in gst_audio_quantize_reset()
500 quant->error_buf = NULL; in gst_audio_quantize_reset()
501 quant->error_size = 0; in gst_audio_quantize_reset()
523 gst_audio_quantize_samples (GstAudioQuantize * quant, in gst_audio_quantize_samples() argument
528 g_return_if_fail (quant != NULL); in gst_audio_quantize_samples()
532 for (i = 0; i < quant->blocks; i++) in gst_audio_quantize_samples()
533 quant->quantize (quant, in[i], out[i], samples); in gst_audio_quantize_samples()