encode.h 2.9 KB
Newer Older
Josh Coalson's avatar
Josh Coalson committed
1
/* flac - Command-line FLAC encoder/decoder
Josh Coalson's avatar
Josh Coalson committed
2
 * Copyright (C) 2000,2001,2002,2003,2004,2005  Josh Coalson
Josh Coalson's avatar
Josh Coalson committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

#ifndef flac__encode_h
#define flac__encode_h

Josh Coalson's avatar
Josh Coalson committed
22
#include "FLAC/metadata.h"
23
#include "utils.h"
Josh Coalson's avatar
Josh Coalson committed
24

25
26
27
28
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

29
typedef struct {
30
	utils__SkipUntilSpecification skip_specification;
31
	utils__SkipUntilSpecification until_specification;
32
	FLAC__bool verify;
33
#ifdef FLAC__HAS_OGG
34
	FLAC__bool use_ogg;
35
	long serial_number;
36
37
38
39
40
41
42
43
44
45
46
47
48
#endif
	FLAC__bool lax;
	FLAC__bool do_mid_side;
	FLAC__bool loose_mid_side;
	FLAC__bool do_exhaustive_model_search;
	FLAC__bool do_escape_coding;
	FLAC__bool do_qlp_coeff_prec_search;
	unsigned min_residual_partition_order;
	unsigned max_residual_partition_order;
	unsigned rice_parameter_search_dist;
	unsigned max_lpc_order;
	unsigned blocksize;
	unsigned qlp_coeff_precision;
49
	int padding;
50
51
	char *requested_seek_points;
	int num_requested_seek_points;
52
53
	const char *cuesheet_filename;
	FLAC__bool cued_seekpoints;
54

55
56
	/* options related to --replay-gain and --sector-align */
	FLAC__bool is_first_file;
57
58
59
	FLAC__bool is_last_file;
	FLAC__int32 **align_reservoir;
	unsigned *align_reservoir_samples;
60
	FLAC__bool replay_gain;
61
	FLAC__bool sector_align;
Josh Coalson's avatar
Josh Coalson committed
62
63

	FLAC__StreamMetadata *vorbis_comment;
64
65
66
67
68
69

	struct {
		FLAC__bool disable_constant_subframes;
		FLAC__bool disable_fixed_subframes;
		FLAC__bool disable_verbatim_subframes;
	} debug;
70
71
72
73
} encode_options_t;

typedef struct {
	encode_options_t common;
74
75
76
77
78
79
80
81
82
83
84
85
} wav_encode_options_t;

typedef struct {
	encode_options_t common;

	FLAC__bool is_big_endian;
	FLAC__bool is_unsigned_samples;
	unsigned channels;
	unsigned bps;
	unsigned sample_rate;
} raw_encode_options_t;

86
int flac__encode_aif(FILE *infile, long infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, wav_encode_options_t options, FLAC__bool is_aifc);
87
88
int flac__encode_wav(FILE *infile, long infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, wav_encode_options_t options);
int flac__encode_raw(FILE *infile, long infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, raw_encode_options_t options);
Josh Coalson's avatar
Josh Coalson committed
89
90

#endif