annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4232
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
1 #ifndef DITHER_H
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
2 #define DITHER_H
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
3
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
4 #include "common.h"
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
5
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
6 #define SAD_ERROR_INCORRECT_INPUT_SAMPLEFORMAT -2
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
7 #define SAD_ERROR_INCORRECT_OUTPUT_SAMPLEFORMAT -3
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
8 #define SAD_ERROR_CORRUPTED_PRIVATE_DATA -4
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
9
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
10 typedef sad_sint32 (*SAD_get_sample_proc) (void *buf, int nch, int ch, int i);
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
11 typedef void (*SAD_put_sample_proc) (void *buf, sad_sint32 sample, int nch, int ch, int i);
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
12
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
13 typedef struct {
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
14 SAD_get_sample_proc get_sample;
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
15 SAD_put_sample_proc put_sample;
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
16 } SAD_buffer_ops;
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
17
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
18 /* private data */
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
19 typedef struct {} SAD_dither_t;
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
20
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
21 SAD_dither_t* SAD_dither_init(SAD_buffer_format *inbuf_format, SAD_buffer_format *outbuf_format, int *error);
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
22 int SAD_dither_free(SAD_dither_t* state);
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
23 int SAD_dither_process_buffer (SAD_dither_t *state, void *inbuf, void *outbuf, int frames);
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
24 int SAD_dither_apply_replaygain (SAD_dither_t *state, SAD_replaygain_info *rg_info, SAD_replaygain_mode *mode);
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
25 int SAD_dither_set_scale (SAD_dither_t *state, float scale);
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
26 int SAD_dither_set_dither (SAD_dither_t *state, int dither);
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
27
704607c1f858 1st attempt to integrate dithering and RG engine
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
diff changeset
28 #endif