complete WAVEFORMATEXTENSIBLE support, multichannel assignments in format and documen...
[platform/upstream/flac.git] / src / flac / encode.h
1 /* flac - Command-line FLAC encoder/decoder
2  * Copyright (C) 2000,2001,2002,2003,2004,2005,2006  Josh Coalson
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17  */
18
19 #ifndef flac__encode_h
20 #define flac__encode_h
21
22 /* needed because of off_t */
23 #if HAVE_CONFIG_H
24 #  include <config.h>
25 #endif
26
27 #include "FLAC/metadata.h"
28 #include "utils.h"
29
30 #ifdef HAVE_CONFIG_H
31 #include <config.h>
32 #endif
33
34 extern const int FLAC_ENCODE__DEFAULT_PADDING;
35
36 typedef struct {
37         utils__SkipUntilSpecification skip_specification;
38         utils__SkipUntilSpecification until_specification;
39         FLAC__bool verify;
40 #ifdef FLAC__HAS_OGG
41         FLAC__bool use_ogg;
42         long serial_number;
43 #endif
44         FLAC__bool lax;
45         FLAC__bool do_mid_side;
46         FLAC__bool loose_mid_side;
47         FLAC__bool do_exhaustive_model_search;
48         FLAC__bool do_escape_coding;
49         FLAC__bool do_qlp_coeff_prec_search;
50         unsigned min_residual_partition_order;
51         unsigned max_residual_partition_order;
52         unsigned rice_parameter_search_dist;
53         char *apodizations;
54         unsigned max_lpc_order;
55         unsigned blocksize;
56         unsigned qlp_coeff_precision;
57         int padding;
58         char *requested_seek_points;
59         int num_requested_seek_points;
60         const char *cuesheet_filename;
61         FLAC__bool cued_seekpoints;
62         FLAC__bool channel_map_none; /* --channel-map=none specified, eventually will expand to take actual channel map */
63
64         /* options related to --replay-gain and --sector-align */
65         FLAC__bool is_first_file;
66         FLAC__bool is_last_file;
67         FLAC__int32 **align_reservoir;
68         unsigned *align_reservoir_samples;
69         FLAC__bool replay_gain;
70         FLAC__bool sector_align;
71
72         FLAC__StreamMetadata *vorbis_comment;
73         FLAC__StreamMetadata *pictures[64];
74         unsigned num_pictures;
75
76         struct {
77                 FLAC__bool disable_constant_subframes;
78                 FLAC__bool disable_fixed_subframes;
79                 FLAC__bool disable_verbatim_subframes;
80         } debug;
81 } encode_options_t;
82
83 typedef struct {
84         encode_options_t common;
85 } wav_encode_options_t;
86
87 typedef struct {
88         encode_options_t common;
89
90         FLAC__bool is_big_endian;
91         FLAC__bool is_unsigned_samples;
92         unsigned channels;
93         unsigned bps;
94         unsigned sample_rate;
95 } raw_encode_options_t;
96
97 typedef struct {
98         encode_options_t common;
99 } flac_encode_options_t;
100
101 int flac__encode_aif(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, wav_encode_options_t options, FLAC__bool is_aifc);
102 int flac__encode_wav(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, wav_encode_options_t options);
103 int flac__encode_raw(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, raw_encode_options_t options);
104 int flac__encode_flac(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, flac_encode_options_t options);
105
106 #endif