Blame gst-libs/gst/audio/audio-quantize.h

Packit 0652a1
/* GStreamer
Packit 0652a1
 * Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
Packit 0652a1
 *           (C) 2015 Wim Taymans <wim.taymans@gmail.com>
Packit 0652a1
 *
Packit 0652a1
 * gstaudioquantize.h: quantizes audio to the target format and optionally
Packit 0652a1
 *                     applies dithering and noise shaping.
Packit 0652a1
 *
Packit 0652a1
 * This library is free software; you can redistribute it and/or
Packit 0652a1
 * modify it under the terms of the GNU Library General Public
Packit 0652a1
 * License as published by the Free Software Foundation; either
Packit 0652a1
 * version 2 of the License, or (at your option) any later version.
Packit 0652a1
 *
Packit 0652a1
 * This library is distributed in the hope that it will be useful,
Packit 0652a1
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 0652a1
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 0652a1
 * Library General Public License for more details.
Packit 0652a1
 *
Packit 0652a1
 * You should have received a copy of the GNU Library General Public
Packit 0652a1
 * License along with this library; if not, write to the
Packit 0652a1
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit 0652a1
 * Boston, MA 02110-1301, USA.
Packit 0652a1
 */
Packit 0652a1
Packit 0652a1
#include <gst/gst.h>
Packit 0652a1
Packit 0652a1
#include <gst/audio/audio.h>
Packit 0652a1
Packit 0652a1
Packit 0652a1
#ifndef __GST_AUDIO_QUANTIZE_H__
Packit 0652a1
#define __GST_AUDIO_QUANTIZE_H__
Packit 0652a1
Packit 0652a1
/**
Packit 0652a1
 * GstAudioDitherMethod:
Packit 0652a1
 * @GST_AUDIO_DITHER_NONE: No dithering
Packit 0652a1
 * @GST_AUDIO_DITHER_RPDF: Rectangular dithering
Packit 0652a1
 * @GST_AUDIO_DITHER_TPDF: Triangular dithering (default)
Packit 0652a1
 * @GST_AUDIO_DITHER_TPDF_HF: High frequency triangular dithering
Packit 0652a1
 *
Packit 0652a1
 * Set of available dithering methods.
Packit 0652a1
 */
Packit 0652a1
typedef enum
Packit 0652a1
{
Packit 0652a1
  GST_AUDIO_DITHER_NONE = 0,
Packit 0652a1
  GST_AUDIO_DITHER_RPDF,
Packit 0652a1
  GST_AUDIO_DITHER_TPDF,
Packit 0652a1
  GST_AUDIO_DITHER_TPDF_HF
Packit 0652a1
} GstAudioDitherMethod;
Packit 0652a1
Packit 0652a1
/**
Packit 0652a1
 * GstAudioNoiseShapingMethod:
Packit 0652a1
 * @GST_AUDIO_NOISE_SHAPING_NONE: No noise shaping (default)
Packit 0652a1
 * @GST_AUDIO_NOISE_SHAPING_ERROR_FEEDBACK: Error feedback
Packit 0652a1
 * @GST_AUDIO_NOISE_SHAPING_SIMPLE: Simple 2-pole noise shaping
Packit 0652a1
 * @GST_AUDIO_NOISE_SHAPING_MEDIUM: Medium 5-pole noise shaping
Packit 0652a1
 * @GST_AUDIO_NOISE_SHAPING_HIGH: High 8-pole noise shaping
Packit 0652a1
 *
Packit 0652a1
 * Set of available noise shaping methods
Packit 0652a1
 */
Packit 0652a1
typedef enum
Packit 0652a1
{
Packit 0652a1
  GST_AUDIO_NOISE_SHAPING_NONE = 0,
Packit 0652a1
  GST_AUDIO_NOISE_SHAPING_ERROR_FEEDBACK,
Packit 0652a1
  GST_AUDIO_NOISE_SHAPING_SIMPLE,
Packit 0652a1
  GST_AUDIO_NOISE_SHAPING_MEDIUM,
Packit 0652a1
  GST_AUDIO_NOISE_SHAPING_HIGH
Packit 0652a1
} GstAudioNoiseShapingMethod;
Packit 0652a1
Packit 0652a1
/**
Packit 0652a1
 * GstAudioQuantizeFlags:
Packit 0652a1
 * @GST_AUDIO_QUANTIZE_FLAG_NONE: no flags
Packit 0652a1
 * @GST_AUDIO_QUANTIZE_FLAG_NON_INTERLEAVED: samples are non-interleaved
Packit 0652a1
 *
Packit 0652a1
 * Extra flags that can be passed to gst_audio_quantize_new()
Packit 0652a1
 */
Packit 0652a1
typedef enum
Packit 0652a1
{
Packit 0652a1
  GST_AUDIO_QUANTIZE_FLAG_NONE            = 0,
Packit 0652a1
  GST_AUDIO_QUANTIZE_FLAG_NON_INTERLEAVED = (1 << 0)
Packit 0652a1
} GstAudioQuantizeFlags;
Packit 0652a1
Packit 0652a1
Packit 0652a1
typedef struct _GstAudioQuantize GstAudioQuantize;
Packit 0652a1
Packit 0652a1
GST_AUDIO_API
Packit 0652a1
GstAudioQuantize *  gst_audio_quantize_new      (GstAudioDitherMethod dither,
Packit 0652a1
                                                 GstAudioNoiseShapingMethod ns,
Packit 0652a1
                                                 GstAudioQuantizeFlags flags,
Packit 0652a1
                                                 GstAudioFormat format,
Packit 0652a1
                                                 guint channels,
Packit 0652a1
                                                 guint quantizer);
Packit 0652a1
Packit 0652a1
GST_AUDIO_API
Packit 0652a1
void                gst_audio_quantize_free     (GstAudioQuantize * quant);
Packit 0652a1
Packit 0652a1
GST_AUDIO_API
Packit 0652a1
void                gst_audio_quantize_reset    (GstAudioQuantize * quant);
Packit 0652a1
Packit 0652a1
GST_AUDIO_API
Packit 0652a1
void                gst_audio_quantize_samples  (GstAudioQuantize * quant,
Packit 0652a1
                                                 const gpointer in[],
Packit 0652a1
                                                 gpointer out[], guint samples);
Packit 0652a1
Packit 0652a1
#endif /* __GST_AUDIO_QUANTIZE_H__ */