diff src/libSAD/dither.h @ 4232:704607c1f858

1st attempt to integrate dithering and RG engine
author Eugene Zagidullin <e.asphyx@gmail.com>
date Wed, 30 Jan 2008 01:22:37 +0300
parents
children 74c6f3d3cf1d
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/libSAD/dither.h	Wed Jan 30 01:22:37 2008 +0300
@@ -0,0 +1,28 @@
+#ifndef DITHER_H
+#define DITHER_H
+
+#include "common.h"
+
+#define SAD_ERROR_INCORRECT_INPUT_SAMPLEFORMAT -2
+#define SAD_ERROR_INCORRECT_OUTPUT_SAMPLEFORMAT -3
+#define SAD_ERROR_CORRUPTED_PRIVATE_DATA -4
+
+typedef sad_sint32 (*SAD_get_sample_proc) (void *buf, int nch, int ch, int i);
+typedef void (*SAD_put_sample_proc) (void *buf, sad_sint32 sample, int nch, int ch, int i);
+
+typedef struct {
+  SAD_get_sample_proc get_sample;
+  SAD_put_sample_proc put_sample;
+} SAD_buffer_ops;
+
+/* private data */
+typedef struct {} SAD_dither_t;
+
+SAD_dither_t* SAD_dither_init(SAD_buffer_format *inbuf_format, SAD_buffer_format *outbuf_format, int *error);
+int SAD_dither_free(SAD_dither_t* state);
+int SAD_dither_process_buffer (SAD_dither_t *state, void *inbuf, void *outbuf, int frames);
+int SAD_dither_apply_replaygain (SAD_dither_t *state, SAD_replaygain_info *rg_info, SAD_replaygain_mode *mode);
+int SAD_dither_set_scale (SAD_dither_t *state, float scale);
+int SAD_dither_set_dither (SAD_dither_t *state, int dither);
+
+#endif