stream_encoder.h revision c74663799493f2b1e6123c18def94295d0afab7b
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* libFLAC - Free Lossless Audio Codec library 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Redistribution and use in source and binary forms, with or without 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * modification, are permitted provided that the following conditions 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * are met: 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * - Redistributions of source code must retain the above copyright 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * notice, this list of conditions and the following disclaimer. 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * - Redistributions in binary form must reproduce the above copyright 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * notice, this list of conditions and the following disclaimer in the 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * documentation and/or other materials provided with the distribution. 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * - Neither the name of the Xiph.org Foundation nor the names of its 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * contributors may be used to endorse or promote products derived from 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * this software without specific prior written permission. 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef FLAC__PROTECTED__STREAM_ENCODER_H 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define FLAC__PROTECTED__STREAM_ENCODER_H 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "FLAC/stream_encoder.h" 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if FLAC__HAS_OGG 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "private/ogg_encoder_aspect.h" 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef FLAC__INTEGER_ONLY_LIBRARY 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "private/float.h" 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define FLAC__MAX_APODIZATION_FUNCTIONS 32 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef enum { 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_BARTLETT, 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_BARTLETT_HANN, 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_BLACKMAN, 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_BLACKMAN_HARRIS_4TERM_92DB_SIDELOBE, 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_CONNES, 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_FLATTOP, 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_GAUSS, 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_HAMMING, 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_HANN, 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_KAISER_BESSEL, 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_NUTTALL, 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_RECTANGLE, 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_TRIANGLE, 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_TUKEY, 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__APODIZATION_WELCH 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} FLAC__ApodizationFunction; 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct { 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__ApodizationFunction type; 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) union { 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) struct { 685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__real stddev; 695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } gauss; 705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) struct { 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__real p; 725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } tukey; 735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } parameters; 745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} FLAC__ApodizationSpecification; 755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif // #ifndef FLAC__INTEGER_ONLY_LIBRARY 775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)typedef struct FLAC__StreamEncoderProtected { 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__StreamEncoderState state; 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__bool verify; 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__bool streamable_subset; 825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__bool do_md5; 835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__bool do_mid_side_stereo; 845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__bool loose_mid_side_stereo; 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned channels; 865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned bits_per_sample; 875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned sample_rate; 885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned blocksize; 895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef FLAC__INTEGER_ONLY_LIBRARY 905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned num_apodizations; 915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__ApodizationSpecification apodizations[FLAC__MAX_APODIZATION_FUNCTIONS]; 925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif 935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned max_lpc_order; 945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned qlp_coeff_precision; 955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__bool do_qlp_coeff_prec_search; 965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__bool do_exhaustive_model_search; 975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__bool do_escape_coding; 985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned min_residual_partition_order; 995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned max_residual_partition_order; 1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned rice_parameter_search_dist; 1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__uint64 total_samples_estimate; 1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__StreamMetadata **metadata; 1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) unsigned num_metadata_blocks; 1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__uint64 streaminfo_offset, seektable_offset, audio_offset; 1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if FLAC__HAS_OGG 1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) FLAC__OggEncoderAspect ogg_encoder_aspect; 1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif 1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} FLAC__StreamEncoderProtected; 1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif 1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)