1 /* flac - Command-line FLAC encoder/decoder
2 * Copyright (C) 2000,2001,2002,2003,2004,2005,2006 Josh Coalson
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.
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.
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.
19 #ifndef flac__encode_h
20 #define flac__encode_h
22 /* needed because of off_t */
27 #include "FLAC/metadata.h"
34 extern const int FLAC_ENCODE__DEFAULT_PADDING;
38 CST_COMPRESSION_LEVEL,
43 CST_QLP_COEFF_PRECISION,
44 CST_DO_QLP_COEFF_PREC_SEARCH,
46 CST_DO_EXHAUSTIVE_MODEL_SEARCH,
47 CST_MIN_RESIDUAL_PARTITION_ORDER,
48 CST_MAX_RESIDUAL_PARTITION_ORDER,
49 CST_RICE_PARAMETER_SEARCH_DIST
50 } compression_setting_type_t;
53 compression_setting_type_t type;
59 } compression_setting_t;
62 utils__SkipUntilSpecification skip_specification;
63 utils__SkipUntilSpecification until_specification;
71 size_t num_compression_settings;
72 compression_setting_t compression_settings[64];
73 char *requested_seek_points;
74 int num_requested_seek_points;
75 const char *cuesheet_filename;
76 FLAC__bool cued_seekpoints;
77 FLAC__bool channel_map_none; /* --channel-map=none specified, eventually will expand to take actual channel map */
79 /* options related to --replay-gain and --sector-align */
80 FLAC__bool is_first_file;
81 FLAC__bool is_last_file;
82 FLAC__int32 **align_reservoir;
83 unsigned *align_reservoir_samples;
84 FLAC__bool replay_gain;
85 FLAC__bool sector_align;
87 FLAC__StreamMetadata *vorbis_comment;
88 FLAC__StreamMetadata *pictures[64];
89 unsigned num_pictures;
92 FLAC__bool disable_constant_subframes;
93 FLAC__bool disable_fixed_subframes;
94 FLAC__bool disable_verbatim_subframes;
99 encode_options_t common;
100 } wav_encode_options_t;
103 encode_options_t common;
105 FLAC__bool is_big_endian;
106 FLAC__bool is_unsigned_samples;
109 unsigned sample_rate;
110 } raw_encode_options_t;
113 encode_options_t common;
114 } flac_encode_options_t;
116 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);
117 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);
118 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);
119 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, FLAC__bool input_is_ogg);