diff options
| author | 2012-01-29 16:34:26 +0000 | |
|---|---|---|
| committer | 2012-01-29 16:34:26 +0000 | |
| commit | 505442d0a0bdc2944f699d9102ae0829703a5407 (patch) | |
| tree | 1a4c2f72533c67984e0112d35905f480a3a9b0ea /src/lib/libflac | |
| parent | 5d0cb30e84215504e368130db9e4573c37e458f2 (diff) | |
Clean-ups and version bumpmame0144u7
Diffstat (limited to 'src/lib/libflac')
23 files changed, 1134 insertions, 1134 deletions
diff --git a/src/lib/libflac/include/flac++/decoder.h b/src/lib/libflac/include/flac++/decoder.h index b00a917a6e0..223602fa434 100644 --- a/src/lib/libflac/include/flac++/decoder.h +++ b/src/lib/libflac/include/flac++/decoder.h @@ -78,28 +78,28 @@ namespace FLAC { namespace Decoder { /** \ingroup flacpp_decoder - * \brief - * This class wraps the ::FLAC__StreamDecoder. If you are - * decoding from a file, FLAC::Decoder::File may be more - * convenient. - * - * The usage of this class is similar to FLAC__StreamDecoder, - * except instead of providing callbacks to - * FLAC__stream_decoder_init*_stream(), you will inherit from this - * class and override the virtual callback functions with your - * own implementations, then call init() or init_ogg(). The rest - * of the calls work the same as in the C layer. - * - * Only the read, write, and error callbacks are mandatory. The - * others are optional; this class provides default - * implementations that do nothing. In order for seeking to work - * you must overide seek_callback(), tell_callback(), - * length_callback(), and eof_callback(). - */ + * \brief + * This class wraps the ::FLAC__StreamDecoder. If you are + * decoding from a file, FLAC::Decoder::File may be more + * convenient. + * + * The usage of this class is similar to FLAC__StreamDecoder, + * except instead of providing callbacks to + * FLAC__stream_decoder_init*_stream(), you will inherit from this + * class and override the virtual callback functions with your + * own implementations, then call init() or init_ogg(). The rest + * of the calls work the same as in the C layer. + * + * Only the read, write, and error callbacks are mandatory. The + * others are optional; this class provides default + * implementations that do nothing. In order for seeking to work + * you must overide seek_callback(), tell_callback(), + * length_callback(), and eof_callback(). + */ class FLACPP_API Stream { public: /** This class is a wrapper around FLAC__StreamDecoderState. - */ + */ class FLACPP_API State { public: inline State(::FLAC__StreamDecoderState state): state_(state) { } @@ -115,8 +115,8 @@ namespace FLAC { //@{ /** Call after construction to check the that the object was created - * successfully. If not, use get_state() to find out why not. - */ + * successfully. If not, use get_state() to find out why not. + */ virtual bool is_valid() const; inline operator bool() const { return is_valid(); } ///< See is_valid() //@} @@ -201,24 +201,24 @@ namespace FLAC { }; /** \ingroup flacpp_decoder - * \brief - * This class wraps the ::FLAC__StreamDecoder. If you are - * not decoding from a file, you may need to use - * FLAC::Decoder::Stream. - * - * The usage of this class is similar to FLAC__StreamDecoder, - * except instead of providing callbacks to - * FLAC__stream_decoder_init*_FILE() or - * FLAC__stream_decoder_init*_file(), you will inherit from this - * class and override the virtual callback functions with your - * own implementations, then call init() or init_off(). The rest - * of the calls work the same as in the C layer. - * - * Only the write, and error callbacks from FLAC::Decoder::Stream - * are mandatory. The others are optional; this class provides - * full working implementations for all other callbacks and - * supports seeking. - */ + * \brief + * This class wraps the ::FLAC__StreamDecoder. If you are + * not decoding from a file, you may need to use + * FLAC::Decoder::Stream. + * + * The usage of this class is similar to FLAC__StreamDecoder, + * except instead of providing callbacks to + * FLAC__stream_decoder_init*_FILE() or + * FLAC__stream_decoder_init*_file(), you will inherit from this + * class and override the virtual callback functions with your + * own implementations, then call init() or init_off(). The rest + * of the calls work the same as in the C layer. + * + * Only the write, and error callbacks from FLAC::Decoder::Stream + * are mandatory. The others are optional; this class provides + * full working implementations for all other callbacks and + * supports seeking. + */ class FLACPP_API File: public Stream { public: File(); diff --git a/src/lib/libflac/include/flac++/encoder.h b/src/lib/libflac/include/flac++/encoder.h index d16d889d870..c89be19cfb6 100644 --- a/src/lib/libflac/include/flac++/encoder.h +++ b/src/lib/libflac/include/flac++/encoder.h @@ -79,29 +79,29 @@ namespace FLAC { namespace Encoder { /** \ingroup flacpp_encoder - * \brief - * This class wraps the ::FLAC__StreamEncoder. If you are - * encoding to a file, FLAC::Encoder::File may be more - * convenient. - * - * The usage of this class is similar to FLAC__StreamEncoder, - * except instead of providing callbacks to - * FLAC__stream_encoder_init*_stream(), you will inherit from this - * class and override the virtual callback functions with your - * own implementations, then call init() or init_ogg(). The rest of - * the calls work the same as in the C layer. - * - * Only the write callback is mandatory. The others are - * optional; this class provides default implementations that do - * nothing. In order for some STREAMINFO and SEEKTABLE data to - * be written properly, you must overide seek_callback() and - * tell_callback(); see FLAC__stream_encoder_init_stream() as to - * why. - */ + * \brief + * This class wraps the ::FLAC__StreamEncoder. If you are + * encoding to a file, FLAC::Encoder::File may be more + * convenient. + * + * The usage of this class is similar to FLAC__StreamEncoder, + * except instead of providing callbacks to + * FLAC__stream_encoder_init*_stream(), you will inherit from this + * class and override the virtual callback functions with your + * own implementations, then call init() or init_ogg(). The rest of + * the calls work the same as in the C layer. + * + * Only the write callback is mandatory. The others are + * optional; this class provides default implementations that do + * nothing. In order for some STREAMINFO and SEEKTABLE data to + * be written properly, you must overide seek_callback() and + * tell_callback(); see FLAC__stream_encoder_init_stream() as to + * why. + */ class FLACPP_API Stream { public: /** This class is a wrapper around FLAC__StreamEncoderState. - */ + */ class FLACPP_API State { public: inline State(::FLAC__StreamEncoderState state): state_(state) { } @@ -117,9 +117,9 @@ namespace FLAC { //@{ /** Call after construction to check the that the object was created - * successfully. If not, use get_state() to find out why not. - * - */ + * successfully. If not, use get_state() to find out why not. + * + */ virtual bool is_valid() const; inline operator bool() const { return is_valid(); } ///< See is_valid() //@} @@ -210,25 +210,25 @@ namespace FLAC { }; /** \ingroup flacpp_encoder - * \brief - * This class wraps the ::FLAC__StreamEncoder. If you are - * not encoding to a file, you may need to use - * FLAC::Encoder::Stream. - * - * The usage of this class is similar to FLAC__StreamEncoder, - * except instead of providing callbacks to - * FLAC__stream_encoder_init*_FILE() or - * FLAC__stream_encoder_init*_file(), you will inherit from this - * class and override the virtual callback functions with your - * own implementations, then call init() or init_ogg(). The rest - * of the calls work the same as in the C layer. - * - * There are no mandatory callbacks; all the callbacks from - * FLAC::Encoder::Stream are implemented here fully and support - * full post-encode STREAMINFO and SEEKTABLE updating. There is - * only an optional progress callback which you may override to - * get periodic reports on the progress of the encode. - */ + * \brief + * This class wraps the ::FLAC__StreamEncoder. If you are + * not encoding to a file, you may need to use + * FLAC::Encoder::Stream. + * + * The usage of this class is similar to FLAC__StreamEncoder, + * except instead of providing callbacks to + * FLAC__stream_encoder_init*_FILE() or + * FLAC__stream_encoder_init*_file(), you will inherit from this + * class and override the virtual callback functions with your + * own implementations, then call init() or init_ogg(). The rest + * of the calls work the same as in the C layer. + * + * There are no mandatory callbacks; all the callbacks from + * FLAC::Encoder::Stream are implemented here fully and support + * full post-encode STREAMINFO and SEEKTABLE updating. There is + * only an optional progress callback which you may override to + * get periodic reports on the progress of the encode. + */ class FLACPP_API File: public Stream { public: File(); diff --git a/src/lib/libflac/include/flac++/metadata.h b/src/lib/libflac/include/flac++/metadata.h index ba3bd385512..6e04f550d4e 100644 --- a/src/lib/libflac/include/flac++/metadata.h +++ b/src/lib/libflac/include/flac++/metadata.h @@ -81,51 +81,51 @@ namespace FLAC { // ============================================================ /** \defgroup flacpp_metadata_object FLAC++/metadata.h: metadata object classes - * \ingroup flacpp_metadata - * - * This module contains classes representing FLAC metadata - * blocks in memory. - * - * The behavior closely mimics the C layer interface; be - * sure to read the detailed description of the - * \link flac_metadata_object C metadata object module \endlink. - * - * Any time a metadata object is constructed or assigned, you - * should check is_valid() to make sure the underlying - * ::FLAC__StreamMetadata object was able to be created. - * - * \warning - * When the get_*() methods of any metadata object method - * return you a const pointer, DO NOT disobey and write into it. - * Always use the set_*() methods. - * - * \{ - */ + * \ingroup flacpp_metadata + * + * This module contains classes representing FLAC metadata + * blocks in memory. + * + * The behavior closely mimics the C layer interface; be + * sure to read the detailed description of the + * \link flac_metadata_object C metadata object module \endlink. + * + * Any time a metadata object is constructed or assigned, you + * should check is_valid() to make sure the underlying + * ::FLAC__StreamMetadata object was able to be created. + * + * \warning + * When the get_*() methods of any metadata object method + * return you a const pointer, DO NOT disobey and write into it. + * Always use the set_*() methods. + * + * \{ + */ /** Base class for all metadata block types. - * See the \link flacpp_metadata_object overview \endlink for more. - */ + * See the \link flacpp_metadata_object overview \endlink for more. + */ class FLACPP_API Prototype { protected: //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ Prototype(const Prototype &); Prototype(const ::FLAC__StreamMetadata &); Prototype(const ::FLAC__StreamMetadata *); //@} /** Constructs an object with copy control. When \a copy - * is \c true, behaves identically to - * FLAC::Metadata::Prototype::Prototype(const ::FLAC__StreamMetadata *object). - * When \a copy is \c false, the instance takes ownership of - * the pointer and the ::FLAC__StreamMetadata object will - * be freed by the destructor. - * - * \assert - * \code object != NULL \endcode - */ + * is \c true, behaves identically to + * FLAC::Metadata::Prototype::Prototype(const ::FLAC__StreamMetadata *object). + * When \a copy is \c false, the instance takes ownership of + * the pointer and the ::FLAC__StreamMetadata object will + * be freed by the destructor. + * + * \assert + * \code object != NULL \endcode + */ Prototype(::FLAC__StreamMetadata *object, bool copy); //@{ @@ -136,23 +136,23 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ Prototype &assign_object(::FLAC__StreamMetadata *object, bool copy); /** Deletes the underlying ::FLAC__StreamMetadata object. - */ + */ virtual void clear(); ::FLAC__StreamMetadata *object_; public: /** Deletes the underlying ::FLAC__StreamMetadata object. - */ + */ virtual ~Prototype(); //@{ /** Check for equality, performing a deep compare by following pointers. - */ + */ inline bool operator==(const Prototype &) const; inline bool operator==(const ::FLAC__StreamMetadata &) const; inline bool operator==(const ::FLAC__StreamMetadata *) const; @@ -169,52 +169,52 @@ namespace FLAC { friend class Iterator; /** Returns \c true if the object was correctly constructed - * (i.e. the underlying ::FLAC__StreamMetadata object was - * properly allocated), else \c false. - */ + * (i.e. the underlying ::FLAC__StreamMetadata object was + * properly allocated), else \c false. + */ inline bool is_valid() const; /** Returns \c true if this block is the last block in a - * stream, else \c false. - * - * \assert - * \code is_valid() \endcode - */ + * stream, else \c false. + * + * \assert + * \code is_valid() \endcode + */ bool get_is_last() const; /** Returns the type of the block. - * - * \assert - * \code is_valid() \endcode - */ + * + * \assert + * \code is_valid() \endcode + */ ::FLAC__MetadataType get_type() const; /** Returns the stream length of the metadata block. - * - * \note - * The length does not include the metadata block header, - * per spec. - * - * \assert - * \code is_valid() \endcode - */ + * + * \note + * The length does not include the metadata block header, + * per spec. + * + * \assert + * \code is_valid() \endcode + */ unsigned get_length() const; /** Sets the "is_last" flag for the block. When using the iterators - * it is not necessary to set this flag; they will do it for you. - * - * \assert - * \code is_valid() \endcode - */ + * it is not necessary to set this flag; they will do it for you. + * + * \assert + * \code is_valid() \endcode + */ void set_is_last(bool); /** Returns a pointer to the underlying ::FLAC__StreamMetadata - * object. This can be useful for plugging any holes between - * the C++ and C interfaces. - * - * \assert - * \code is_valid() \endcode - */ + * object. This can be useful for plugging any holes between + * the C++ and C interfaces. + * + * \assert + * \code is_valid() \endcode + */ inline operator const ::FLAC__StreamMetadata *() const; private: /** Private and undefined so you can't use it. */ @@ -264,25 +264,25 @@ namespace FLAC { /** STREAMINFO metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_streaminfo">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_streaminfo">format specification</A>. + */ class FLACPP_API StreamInfo : public Prototype { public: StreamInfo(); //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline StreamInfo(const StreamInfo &object): Prototype(object) { } inline StreamInfo(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline StreamInfo(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline StreamInfo(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~StreamInfo(); @@ -295,8 +295,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline StreamInfo &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -338,25 +338,25 @@ namespace FLAC { }; /** PADDING metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_padding">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_padding">format specification</A>. + */ class FLACPP_API Padding : public Prototype { public: Padding(); //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline Padding(const Padding &object): Prototype(object) { } inline Padding(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Padding(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline Padding(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~Padding(); @@ -369,8 +369,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline Padding &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -391,25 +391,25 @@ namespace FLAC { }; /** APPLICATION metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_application">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_application">format specification</A>. + */ class FLACPP_API Application : public Prototype { public: Application(); // //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline Application(const Application &object): Prototype(object) { } inline Application(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Application(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline Application(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~Application(); @@ -422,8 +422,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline Application &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -450,25 +450,25 @@ namespace FLAC { }; /** SEEKTABLE metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_seektable">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_seektable">format specification</A>. + */ class FLACPP_API SeekTable : public Prototype { public: SeekTable(); //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline SeekTable(const SeekTable &object): Prototype(object) { } inline SeekTable(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline SeekTable(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline SeekTable(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~SeekTable(); @@ -481,8 +481,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline SeekTable &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -516,40 +516,40 @@ namespace FLAC { }; /** VORBIS_COMMENT metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>. + */ class FLACPP_API VorbisComment : public Prototype { public: /** Convenience class for encapsulating Vorbis comment - * entries. An entry is a vendor string or a comment - * field. In the case of a vendor string, the field - * name is undefined; only the field value is relevant. - * - * A \a field as used in the methods refers to an - * entire 'NAME=VALUE' string; for convenience the - * string is NUL-terminated. A length field is - * required in the unlikely event that the value - * contains contain embedded NULs. - * - * A \a field_name is what is on the left side of the - * first '=' in the \a field. By definition it is ASCII - * and so is NUL-terminated and does not require a - * length to describe it. \a field_name is undefined - * for a vendor string entry. - * - * A \a field_value is what is on the right side of the - * first '=' in the \a field. By definition, this may - * contain embedded NULs and so a \a field_value_length - * is required to describe it. However in practice, - * embedded NULs are not known to be used, so it is - * generally safe to treat field values as NUL- - * terminated UTF-8 strings. - * - * Always check is_valid() after the constructor or operator= - * to make sure memory was properly allocated and that the - * Entry conforms to the Vorbis comment specification. - */ + * entries. An entry is a vendor string or a comment + * field. In the case of a vendor string, the field + * name is undefined; only the field value is relevant. + * + * A \a field as used in the methods refers to an + * entire 'NAME=VALUE' string; for convenience the + * string is NUL-terminated. A length field is + * required in the unlikely event that the value + * contains contain embedded NULs. + * + * A \a field_name is what is on the left side of the + * first '=' in the \a field. By definition it is ASCII + * and so is NUL-terminated and does not require a + * length to describe it. \a field_name is undefined + * for a vendor string entry. + * + * A \a field_value is what is on the right side of the + * first '=' in the \a field. By definition, this may + * contain embedded NULs and so a \a field_value_length + * is required to describe it. However in practice, + * embedded NULs are not known to be used, so it is + * generally safe to treat field values as NUL- + * terminated UTF-8 strings. + * + * Always check is_valid() after the constructor or operator= + * to make sure memory was properly allocated and that the + * Entry conforms to the Vorbis comment specification. + */ class FLACPP_API Entry { public: Entry(); @@ -607,16 +607,16 @@ namespace FLAC { //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline VorbisComment(const VorbisComment &object): Prototype(object) { } inline VorbisComment(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline VorbisComment(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline VorbisComment(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~VorbisComment(); @@ -629,8 +629,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline VorbisComment &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -668,17 +668,17 @@ namespace FLAC { }; /** CUESHEET metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_cuesheet">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_cuesheet">format specification</A>. + */ class FLACPP_API CueSheet : public Prototype { public: /** Convenience class for encapsulating a cue sheet - * track. - * - * Always check is_valid() after the constructor or operator= - * to make sure memory was properly allocated. - */ + * track. + * + * Always check is_valid() after the constructor or operator= + * to make sure memory was properly allocated. + */ class FLACPP_API Track { protected: ::FLAC__StreamMetadata_CueSheet_Track *object_; @@ -710,7 +710,7 @@ namespace FLAC { void set_type(unsigned value); inline void set_pre_emphasis(bool value) { object_->pre_emphasis = value? 1 : 0; } - void set_index(unsigned i, const ::FLAC__StreamMetadata_CueSheet_Index &index); + void set_index(unsigned i, const ::FLAC__StreamMetadata_CueSheet_Index &index); //@@@ It's awkward but to insert/delete index points //@@@ you must use the routines in the CueSheet class. }; @@ -719,16 +719,16 @@ namespace FLAC { //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline CueSheet(const CueSheet &object): Prototype(object) { } inline CueSheet(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline CueSheet(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline CueSheet(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~CueSheet(); @@ -741,8 +741,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline CueSheet &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -795,25 +795,25 @@ namespace FLAC { }; /** PICTURE metadata block. - * See the \link flacpp_metadata_object overview \endlink for more, - * and the <A HREF="../format.html#metadata_block_picture">format specification</A>. - */ + * See the \link flacpp_metadata_object overview \endlink for more, + * and the <A HREF="../format.html#metadata_block_picture">format specification</A>. + */ class FLACPP_API Picture : public Prototype { public: Picture(); //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline Picture(const Picture &object): Prototype(object) { } inline Picture(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Picture(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline Picture(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~Picture(); @@ -826,8 +826,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline Picture &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -872,27 +872,27 @@ namespace FLAC { }; /** Opaque metadata block for storing unknown types. - * This should not be used unless you know what you are doing; - * it is currently used only internally to support forward - * compatibility of metadata blocks. - * See the \link flacpp_metadata_object overview \endlink for more, - */ + * This should not be used unless you know what you are doing; + * it is currently used only internally to support forward + * compatibility of metadata blocks. + * See the \link flacpp_metadata_object overview \endlink for more, + */ class FLACPP_API Unknown : public Prototype { public: Unknown(); // //@{ /** Constructs a copy of the given object. This form - * always performs a deep copy. - */ + * always performs a deep copy. + */ inline Unknown(const Unknown &object): Prototype(object) { } inline Unknown(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Unknown(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See - * Prototype(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype(::FLAC__StreamMetadata *object, bool copy). + */ inline Unknown(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~Unknown(); @@ -905,8 +905,8 @@ namespace FLAC { //@} /** Assigns an object with copy control. See - * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). - */ + * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). + */ inline Unknown &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ @@ -934,16 +934,16 @@ namespace FLAC { /** \defgroup flacpp_metadata_level0 FLAC++/metadata.h: metadata level 0 interface - * \ingroup flacpp_metadata - * - * \brief - * Level 0 metadata iterators. - * - * See the \link flac_metadata_level0 C layer equivalent \endlink - * for more. - * - * \{ - */ + * \ingroup flacpp_metadata + * + * \brief + * Level 0 metadata iterators. + * + * See the \link flac_metadata_level0 C layer equivalent \endlink + * for more. + * + * \{ + */ FLACPP_API bool get_streaminfo(const char *filename, StreamInfo &streaminfo); ///< See FLAC__metadata_get_streaminfo(). @@ -960,43 +960,43 @@ namespace FLAC { /** \defgroup flacpp_metadata_level1 FLAC++/metadata.h: metadata level 1 interface - * \ingroup flacpp_metadata - * - * \brief - * Level 1 metadata iterator. - * - * The flow through the iterator in the C++ layer is similar - * to the C layer: - * - Create a SimpleIterator instance - * - Check SimpleIterator::is_valid() - * - Call SimpleIterator::init() and check the return - * - Traverse and/or edit. Edits are written to file - * immediately. - * - Destroy the SimpleIterator instance - * - * The ownership of pointers in the C++ layer follows that in - * the C layer, i.e. - * - The objects returned by get_block() are yours to - * modify, but changes are not reflected in the FLAC file - * until you call set_block(). The objects are also - * yours to delete; they are not automatically deleted - * when passed to set_block() or insert_block_after(). - * - * See the \link flac_metadata_level1 C layer equivalent \endlink - * for more. - * - * \{ - */ + * \ingroup flacpp_metadata + * + * \brief + * Level 1 metadata iterator. + * + * The flow through the iterator in the C++ layer is similar + * to the C layer: + * - Create a SimpleIterator instance + * - Check SimpleIterator::is_valid() + * - Call SimpleIterator::init() and check the return + * - Traverse and/or edit. Edits are written to file + * immediately. + * - Destroy the SimpleIterator instance + * + * The ownership of pointers in the C++ layer follows that in + * the C layer, i.e. + * - The objects returned by get_block() are yours to + * modify, but changes are not reflected in the FLAC file + * until you call set_block(). The objects are also + * yours to delete; they are not automatically deleted + * when passed to set_block() or insert_block_after(). + * + * See the \link flac_metadata_level1 C layer equivalent \endlink + * for more. + * + * \{ + */ /** This class is a wrapper around the FLAC__metadata_simple_iterator - * structures and methods; see the - * \link flacpp_metadata_level1 usage guide \endlink and - * ::FLAC__Metadata_SimpleIterator. - */ + * structures and methods; see the + * \link flacpp_metadata_level1 usage guide \endlink and + * ::FLAC__Metadata_SimpleIterator. + */ class FLACPP_API SimpleIterator { public: /** This class is a wrapper around FLAC__Metadata_SimpleIteratorStatus. - */ + */ class FLACPP_API Status { public: inline Status(::FLAC__Metadata_SimpleIteratorStatus status): status_(status) { } @@ -1038,51 +1038,51 @@ namespace FLAC { /** \defgroup flacpp_metadata_level2 FLAC++/metadata.h: metadata level 2 interface - * \ingroup flacpp_metadata - * - * \brief - * Level 2 metadata iterator. - * - * The flow through the iterator in the C++ layer is similar - * to the C layer: - * - Create a Chain instance - * - Check Chain::is_valid() - * - Call Chain::read() and check the return - * - Traverse and/or edit with an Iterator or with - * Chain::merge_padding() or Chain::sort_padding() - * - Write changes back to FLAC file with Chain::write() - * - Destroy the Chain instance - * - * The ownership of pointers in the C++ layer is slightly - * different than in the C layer, i.e. - * - The objects returned by Iterator::get_block() are NOT - * owned by the iterator and should be deleted by the - * caller when finished, BUT, when you modify the block, - * it will directly edit what's in the chain and you do - * not need to call Iterator::set_block(). However the - * changes will not be reflected in the FLAC file until - * the chain is written with Chain::write(). - * - When you pass an object to Iterator::set_block(), - * Iterator::insert_block_before(), or - * Iterator::insert_block_after(), the iterator takes - * ownership of the block and it will be deleted by the - * chain. - * - * See the \link flac_metadata_level2 C layer equivalent \endlink - * for more. - * - * \{ - */ + * \ingroup flacpp_metadata + * + * \brief + * Level 2 metadata iterator. + * + * The flow through the iterator in the C++ layer is similar + * to the C layer: + * - Create a Chain instance + * - Check Chain::is_valid() + * - Call Chain::read() and check the return + * - Traverse and/or edit with an Iterator or with + * Chain::merge_padding() or Chain::sort_padding() + * - Write changes back to FLAC file with Chain::write() + * - Destroy the Chain instance + * + * The ownership of pointers in the C++ layer is slightly + * different than in the C layer, i.e. + * - The objects returned by Iterator::get_block() are NOT + * owned by the iterator and should be deleted by the + * caller when finished, BUT, when you modify the block, + * it will directly edit what's in the chain and you do + * not need to call Iterator::set_block(). However the + * changes will not be reflected in the FLAC file until + * the chain is written with Chain::write(). + * - When you pass an object to Iterator::set_block(), + * Iterator::insert_block_before(), or + * Iterator::insert_block_after(), the iterator takes + * ownership of the block and it will be deleted by the + * chain. + * + * See the \link flac_metadata_level2 C layer equivalent \endlink + * for more. + * + * \{ + */ /** This class is a wrapper around the FLAC__metadata_chain - * structures and methods; see the - * \link flacpp_metadata_level2 usage guide \endlink and - * ::FLAC__Metadata_Chain. - */ + * structures and methods; see the + * \link flacpp_metadata_level2 usage guide \endlink and + * ::FLAC__Metadata_Chain. + */ class FLACPP_API Chain { public: /** This class is a wrapper around FLAC__Metadata_ChainStatus. - */ + */ class FLACPP_API Status { public: inline Status(::FLAC__Metadata_ChainStatus status): status_(status) { } @@ -1119,10 +1119,10 @@ namespace FLAC { }; /** This class is a wrapper around the FLAC__metadata_iterator - * structures and methods; see the - * \link flacpp_metadata_level2 usage guide \endlink and - * ::FLAC__Metadata_Iterator. - */ + * structures and methods; see the + * \link flacpp_metadata_level2 usage guide \endlink and + * ::FLAC__Metadata_Iterator. + */ class FLACPP_API Iterator { public: Iterator(); diff --git a/src/lib/libflac/include/flac/format.h b/src/lib/libflac/include/flac/format.h index 77e2d0130e5..a48e95c5e4d 100644 --- a/src/lib/libflac/include/flac/format.h +++ b/src/lib/libflac/include/flac/format.h @@ -84,8 +84,8 @@ extern "C" { /* - Most of the values described in this file are defined by the FLAC - format specification. There is nothing to tune here. + Most of the values described in this file are defined by the FLAC + format specification. There is nothing to tune here. */ /** The largest legal metadata type code. */ @@ -193,11 +193,11 @@ extern FLAC_API const unsigned FLAC__STREAM_SYNC_LEN; /* = 32 bits */ typedef enum { FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0, /**< Residual is coded by partitioning into contexts, each with it's own - * 4-bit Rice parameter. */ + * 4-bit Rice parameter. */ FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 = 1 /**< Residual is coded by partitioning into contexts, each with it's own - * 5-bit Rice parameter. */ + * 5-bit Rice parameter. */ } FLAC__EntropyCodingMethodType; /** Maps a FLAC__EntropyCodingMethodType to a C string. @@ -217,14 +217,14 @@ typedef struct { unsigned *raw_bits; /**< Widths for escape-coded partitions. Will be non-zero for escaped - * partitions and zero for unescaped partitions. - */ + * partitions and zero for unescaped partitions. + */ unsigned capacity_by_order; /**< The capacity of the \a parameters and \a raw_bits arrays - * specified as an order, i.e. the number of array elements - * allocated is 2 ^ \a capacity_by_order. - */ + * specified as an order, i.e. the number of array elements + * allocated is 2 ^ \a capacity_by_order. + */ } FLAC__EntropyCodingMethod_PartitionedRiceContents; /** Header for a Rice partitioned residual. (c.f. <A HREF="../format.html#partitioned_rice">format specification</A>) @@ -425,21 +425,21 @@ typedef struct { FLAC__FrameNumberType number_type; /**< The numbering scheme used for the frame. As a convenience, the - * decoder will always convert a frame number to a sample number because - * the rules are complex. */ + * decoder will always convert a frame number to a sample number because + * the rules are complex. */ union { FLAC__uint32 frame_number; FLAC__uint64 sample_number; } number; /**< The frame number or sample number of first sample in frame; - * use the \a number_type value to determine which to use. */ + * use the \a number_type value to determine which to use. */ FLAC__uint8 crc; /**< CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0) - * of the raw frame header bytes, meaning everything before the CRC byte - * including the sync code. - */ + * of the raw frame header bytes, meaning everything before the CRC byte + * including the sync code. + */ } FLAC__FrameHeader; extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC; /**< == 0x3ffe; the frame header sync code */ @@ -459,9 +459,9 @@ extern FLAC_API const unsigned FLAC__FRAME_HEADER_CRC_LEN; /**< == 8 (bits) */ typedef struct { FLAC__uint16 crc; /**< CRC-16 (polynomial = x^16 + x^15 + x^2 + x^0, initialized with - * 0) of the bytes before the crc, back to and including the frame header - * sync code. - */ + * 0) of the bytes before the crc, back to and including the frame header + * sync code. + */ } FLAC__FrameFooter; extern FLAC_API const unsigned FLAC__FRAME_FOOTER_CRC_LEN; /**< == 16 (bits) */ @@ -551,9 +551,9 @@ extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /**< typedef struct { int dummy; /**< Conceptually this is an empty struct since we don't store the - * padding bytes. Empty structs are not allowed by some C compilers, - * hence the dummy. - */ + * padding bytes. Empty structs are not allowed by some C compilers, + * hence the dummy. + */ } FLAC__StreamMetadata_Padding; @@ -574,7 +574,7 @@ typedef struct { FLAC__uint64 stream_offset; /**< The offset, in bytes, of the target frame with respect to - * beginning of the first frame. */ + * beginning of the first frame. */ unsigned frame_samples; /**< The number of samples in the target frame. */ @@ -644,8 +644,8 @@ extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS typedef struct { FLAC__uint64 offset; /**< Offset in samples, relative to the track offset, of the index - * point. - */ + * point. + */ FLAC__byte number; /**< The index point number. */ @@ -700,9 +700,9 @@ extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_ typedef struct { char media_catalog_number[129]; /**< Media catalog number, in ASCII printable characters 0x20-0x7e. In - * general, the media catalog number may be 0 to 128 bytes long; any - * unused characters should be right-padded with NUL characters. - */ + * general, the media catalog number may be 0 to 128 bytes long; any + * unused characters should be right-padded with NUL characters. + */ FLAC__uint64 lead_in; /**< The number of lead-in samples. */ @@ -769,21 +769,21 @@ typedef struct { char *mime_type; /**< Picture data's MIME type, in ASCII printable characters - * 0x20-0x7e, NUL terminated. For best compatibility with players, - * use picture data of MIME type \c image/jpeg or \c image/png. A - * MIME type of '-->' is also allowed, in which case the picture - * data should be a complete URL. In file storage, the MIME type is - * stored as a 32-bit length followed by the ASCII string with no NUL - * terminator, but is converted to a plain C string in this structure - * for convenience. - */ + * 0x20-0x7e, NUL terminated. For best compatibility with players, + * use picture data of MIME type \c image/jpeg or \c image/png. A + * MIME type of '-->' is also allowed, in which case the picture + * data should be a complete URL. In file storage, the MIME type is + * stored as a 32-bit length followed by the ASCII string with no NUL + * terminator, but is converted to a plain C string in this structure + * for convenience. + */ FLAC__byte *description; /**< Picture's description in UTF-8, NUL terminated. In file storage, - * the description is stored as a 32-bit length followed by the UTF-8 - * string with no NUL terminator, but is converted to a plain C string - * in this structure for convenience. - */ + * the description is stored as a 32-bit length followed by the UTF-8 + * string with no NUL terminator, but is converted to a plain C string + * in this structure for convenience. + */ FLAC__uint32 width; /**< Picture's width in pixels. */ @@ -796,8 +796,8 @@ typedef struct { FLAC__uint32 colors; /**< For indexed palettes (like GIF), picture's number of colors (the - * number of palette entries), or \c 0 for non-indexed (i.e. 2^depth). - */ + * number of palette entries), or \c 0 for non-indexed (i.e. 2^depth). + */ FLAC__uint32 data_length; /**< Length of binary picture data in bytes. */ @@ -831,8 +831,8 @@ typedef struct { typedef struct { FLAC__MetadataType type; /**< The type of the metadata block; used determine which member of the - * \a data union to dereference. If type >= FLAC__METADATA_TYPE_UNDEFINED - * then \a data.unknown must be used. */ + * \a data union to dereference. If type >= FLAC__METADATA_TYPE_UNDEFINED + * then \a data.unknown must be used. */ FLAC__bool is_last; /**< \c true if this metadata block is the last, else \a false */ @@ -851,7 +851,7 @@ typedef struct { FLAC__StreamMetadata_Unknown unknown; } data; /**< Polymorphic block data; use the \a type value to determine which - * to use. */ + * to use. */ } FLAC__StreamMetadata; extern FLAC_API const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN; /**< == 1 (bit) */ diff --git a/src/lib/libflac/include/flac/metadata.h b/src/lib/libflac/include/flac/metadata.h index fff90b0bafd..6453b748e99 100644 --- a/src/lib/libflac/include/flac/metadata.h +++ b/src/lib/libflac/include/flac/metadata.h @@ -762,22 +762,22 @@ typedef enum { FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH, /**< FLAC__metadata_chain_write() was called on a chain read by - * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), - * or - * FLAC__metadata_chain_write_with_callbacks()/FLAC__metadata_chain_write_with_callbacks_and_tempfile() - * was called on a chain read by - * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). - * Matching read/write methods must always be used. */ + * FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(), + * or + * FLAC__metadata_chain_write_with_callbacks()/FLAC__metadata_chain_write_with_callbacks_and_tempfile() + * was called on a chain read by + * FLAC__metadata_chain_read()/FLAC__metadata_chain_read_ogg(). + * Matching read/write methods must always be used. */ FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL /**< FLAC__metadata_chain_write_with_callbacks() was called when the - * chain write requires a tempfile; use - * FLAC__metadata_chain_write_with_callbacks_and_tempfile() instead. - * Or, FLAC__metadata_chain_write_with_callbacks_and_tempfile() was - * called when the chain write does not require a tempfile; use - * FLAC__metadata_chain_write_with_callbacks() instead. - * Always check FLAC__metadata_chain_check_if_tempfile_needed() - * before writing via callbacks. */ + * chain write requires a tempfile; use + * FLAC__metadata_chain_write_with_callbacks_and_tempfile() instead. + * Or, FLAC__metadata_chain_write_with_callbacks_and_tempfile() was + * called when the chain write does not require a tempfile; use + * FLAC__metadata_chain_write_with_callbacks() instead. + * Always check FLAC__metadata_chain_check_if_tempfile_needed() + * before writing via callbacks. */ } FLAC__Metadata_ChainStatus; diff --git a/src/lib/libflac/include/flac/stream_decoder.h b/src/lib/libflac/include/flac/stream_decoder.h index 9ac159474af..8c2dc51bfb4 100644 --- a/src/lib/libflac/include/flac/stream_decoder.h +++ b/src/lib/libflac/include/flac/stream_decoder.h @@ -208,8 +208,8 @@ typedef enum { FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC, /**< The decoder is ready to or is in the process of searching for the - * frame sync code. - */ + * frame sync code. + */ FLAC__STREAM_DECODER_READ_FRAME, /**< The decoder is ready to or is in the process of reading a frame. */ @@ -222,23 +222,23 @@ typedef enum { FLAC__STREAM_DECODER_SEEK_ERROR, /**< An error occurred while seeking. The decoder must be flushed - * with FLAC__stream_decoder_flush() or reset with - * FLAC__stream_decoder_reset() before decoding can continue. - */ + * with FLAC__stream_decoder_flush() or reset with + * FLAC__stream_decoder_reset() before decoding can continue. + */ FLAC__STREAM_DECODER_ABORTED, /**< The decoder was aborted by the read callback. */ FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR, /**< An error occurred allocating memory. The decoder is in an invalid - * state and can no longer be used. - */ + * state and can no longer be used. + */ FLAC__STREAM_DECODER_UNINITIALIZED /**< The decoder is in the uninitialized state; one of the - * FLAC__stream_decoder_init_*() functions must be called before samples - * can be processed. - */ + * FLAC__stream_decoder_init_*() functions must be called before samples + * can be processed. + */ } FLAC__StreamDecoderState; @@ -259,8 +259,8 @@ typedef enum { FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER, /**< The library was not compiled with support for the given container - * format. - */ + * format. + */ FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS, /**< A required callback was not supplied. */ @@ -270,13 +270,13 @@ typedef enum { FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE, /**< fopen() failed in FLAC__stream_decoder_init_file() or - * FLAC__stream_decoder_init_ogg_file(). */ + * FLAC__stream_decoder_init_ogg_file(). */ FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED /**< FLAC__stream_decoder_init_*() was called when the decoder was - * already initialized, usually because - * FLAC__stream_decoder_finish() was not called. - */ + * already initialized, usually because + * FLAC__stream_decoder_finish() was not called. + */ } FLAC__StreamDecoderInitStatus; @@ -297,14 +297,14 @@ typedef enum { FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM, /**< The read was attempted while at the end of the stream. Note that - * the client must only return this value when the read callback was - * called when already at the end of the stream. Otherwise, if the read - * itself moves to the end of the stream, the client should still return - * the data and \c FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, and then on - * the next read callback it should return - * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM with a byte count - * of \c 0. - */ + * the client must only return this value when the read callback was + * called when already at the end of the stream. Otherwise, if the read + * itself moves to the end of the stream, the client should still return + * the data and \c FLAC__STREAM_DECODER_READ_STATUS_CONTINUE, and then on + * the next read callback it should return + * \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM with a byte count + * of \c 0. + */ FLAC__STREAM_DECODER_READ_STATUS_ABORT /**< An unrecoverable error occurred. The decoder will return from the process call. */ diff --git a/src/lib/libflac/include/flac/stream_encoder.h b/src/lib/libflac/include/flac/stream_encoder.h index dbbbb23ee11..0f609a15ba0 100644 --- a/src/lib/libflac/include/flac/stream_encoder.h +++ b/src/lib/libflac/include/flac/stream_encoder.h @@ -244,35 +244,35 @@ typedef enum { FLAC__STREAM_ENCODER_UNINITIALIZED, /**< The encoder is in the uninitialized state; one of the - * FLAC__stream_encoder_init_*() functions must be called before samples - * can be processed. - */ + * FLAC__stream_encoder_init_*() functions must be called before samples + * can be processed. + */ FLAC__STREAM_ENCODER_OGG_ERROR, /**< An error occurred in the underlying Ogg layer. */ FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR, /**< An error occurred in the underlying verify stream decoder; - * check FLAC__stream_encoder_get_verify_decoder_state(). - */ + * check FLAC__stream_encoder_get_verify_decoder_state(). + */ FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA, /**< The verify decoder detected a mismatch between the original - * audio signal and the decoded audio signal. - */ + * audio signal and the decoded audio signal. + */ FLAC__STREAM_ENCODER_CLIENT_ERROR, /**< One of the callbacks returned a fatal error. */ FLAC__STREAM_ENCODER_IO_ERROR, /**< An I/O error occurred while opening/reading/writing a file. - * Check \c errno. - */ + * Check \c errno. + */ FLAC__STREAM_ENCODER_FRAMING_ERROR, /**< An error occurred while writing the stream; usually, the - * write_callback returned an error. - */ + * write_callback returned an error. + */ FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR /**< Memory allocation failed. */ @@ -299,8 +299,8 @@ typedef enum { FLAC__STREAM_ENCODER_INIT_STATUS_UNSUPPORTED_CONTAINER, /**< The library was not compiled with support for the given container - * format. - */ + * format. + */ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_CALLBACKS, /**< A required callback was not supplied. */ @@ -310,9 +310,9 @@ typedef enum { FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE, /**< The encoder has an invalid setting for bits-per-sample. - * FLAC supports 4-32 bps but the reference encoder currently supports - * only up to 24 bps. - */ + * FLAC supports 4-32 bps but the reference encoder currently supports + * only up to 24 bps. + */ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_SAMPLE_RATE, /**< The encoder has an invalid setting for the input sample rate. */ @@ -334,18 +334,18 @@ typedef enum { FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA, /**< The metadata input to the encoder is invalid, in one of the following ways: - * - FLAC__stream_encoder_set_metadata() was called with a null pointer but a block count > 0 - * - One of the metadata blocks contains an undefined type - * - It contains an illegal CUESHEET as checked by FLAC__format_cuesheet_is_legal() - * - It contains an illegal SEEKTABLE as checked by FLAC__format_seektable_is_legal() - * - It contains more than one SEEKTABLE block or more than one VORBIS_COMMENT block - */ + * - FLAC__stream_encoder_set_metadata() was called with a null pointer but a block count > 0 + * - One of the metadata blocks contains an undefined type + * - It contains an illegal CUESHEET as checked by FLAC__format_cuesheet_is_legal() + * - It contains an illegal SEEKTABLE as checked by FLAC__format_seektable_is_legal() + * - It contains more than one SEEKTABLE block or more than one VORBIS_COMMENT block + */ FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED /**< FLAC__stream_encoder_init_*() was called when the encoder was - * already initialized, usually because - * FLAC__stream_encoder_finish() was not called. - */ + * already initialized, usually because + * FLAC__stream_encoder_finish() was not called. + */ } FLAC__StreamEncoderInitStatus; diff --git a/src/lib/libflac/include/private/fixed.h b/src/lib/libflac/include/private/fixed.h index 85abf1d5374..34f8b728317 100644 --- a/src/lib/libflac/include/private/fixed.h +++ b/src/lib/libflac/include/private/fixed.h @@ -40,16 +40,16 @@ #include "flac/format.h" /* - * FLAC__fixed_compute_best_predictor() - * -------------------------------------------------------------------- - * Compute the best fixed predictor and the expected bits-per-sample + * FLAC__fixed_compute_best_predictor() + * -------------------------------------------------------------------- + * Compute the best fixed predictor and the expected bits-per-sample * of the residual signal for each order. The _wide() version uses * 64-bit integers which is statistically necessary when bits-per- * sample + log2(blocksize) > 30 * - * IN data[0,data_len-1] - * IN data_len - * OUT residual_bits_per_sample[0,FLAC__MAX_FIXED_ORDER] + * IN data[0,data_len-1] + * IN data_len + * OUT residual_bits_per_sample[0,FLAC__MAX_FIXED_ORDER] */ #ifndef FLAC__INTEGER_ONLY_LIBRARY unsigned FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]); @@ -67,30 +67,30 @@ unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsig #endif /* - * FLAC__fixed_compute_residual() - * -------------------------------------------------------------------- - * Compute the residual signal obtained from sutracting the predicted - * signal from the original. + * FLAC__fixed_compute_residual() + * -------------------------------------------------------------------- + * Compute the residual signal obtained from sutracting the predicted + * signal from the original. * - * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) - * IN data_len length of original signal - * IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order - * OUT residual[0,data_len-1] residual signal + * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) + * IN data_len length of original signal + * IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order + * OUT residual[0,data_len-1] residual signal */ void FLAC__fixed_compute_residual(const FLAC__int32 data[], unsigned data_len, unsigned order, FLAC__int32 residual[]); /* - * FLAC__fixed_restore_signal() - * -------------------------------------------------------------------- - * Restore the original signal by summing the residual and the - * predictor. + * FLAC__fixed_restore_signal() + * -------------------------------------------------------------------- + * Restore the original signal by summing the residual and the + * predictor. * - * IN residual[0,data_len-1] residual signal - * IN data_len length of original signal - * IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order - * *** IMPORTANT: the caller must pass in the historical samples: - * IN data[-order,-1] previously-reconstructed historical samples - * OUT data[0,data_len-1] original signal + * IN residual[0,data_len-1] residual signal + * IN data_len length of original signal + * IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order + * *** IMPORTANT: the caller must pass in the historical samples: + * IN data[-order,-1] previously-reconstructed historical samples + * OUT data[0,data_len-1] original signal */ void FLAC__fixed_restore_signal(const FLAC__int32 residual[], unsigned data_len, unsigned order, FLAC__int32 data[]); diff --git a/src/lib/libflac/include/private/float.h b/src/lib/libflac/include/private/float.h index 75b99503bf3..e6dca74caad 100644 --- a/src/lib/libflac/include/private/float.h +++ b/src/lib/libflac/include/private/float.h @@ -74,21 +74,21 @@ extern const FLAC__fixedpoint FLAC__FP_E; #define FLAC__fixedpoint_div(x, y) ( (FLAC__fixedpoint) ( ( ((FLAC__int64)(x)<<32) / (FLAC__int64)(y) ) >> 16 ) ) /* - * FLAC__fixedpoint_log2() - * -------------------------------------------------------------------- - * Returns the base-2 logarithm of the fixed-point number 'x' using an - * algorithm by Knuth for x >= 1.0 + * FLAC__fixedpoint_log2() + * -------------------------------------------------------------------- + * Returns the base-2 logarithm of the fixed-point number 'x' using an + * algorithm by Knuth for x >= 1.0 * - * 'fracbits' is the number of fractional bits of 'x'. 'fracbits' must - * be < 32 and evenly divisible by 4 (0 is OK but not very precise). + * 'fracbits' is the number of fractional bits of 'x'. 'fracbits' must + * be < 32 and evenly divisible by 4 (0 is OK but not very precise). * - * 'precision' roughly limits the number of iterations that are done; - * use (unsigned)(-1) for maximum precision. + * 'precision' roughly limits the number of iterations that are done; + * use (unsigned)(-1) for maximum precision. * - * If 'x' is less than one -- that is, x < (1<<fracbits) -- then this - * function will punt and return 0. + * If 'x' is less than one -- that is, x < (1<<fracbits) -- then this + * function will punt and return 0. * - * The return value will also have 'fracbits' fractional bits. + * The return value will also have 'fracbits' fractional bits. */ FLAC__uint32 FLAC__fixedpoint_log2(FLAC__uint32 x, unsigned fracbits, unsigned precision); diff --git a/src/lib/libflac/include/private/lpc.h b/src/lib/libflac/include/private/lpc.h index 5eb91f7d988..eda5c491935 100644 --- a/src/lib/libflac/include/private/lpc.h +++ b/src/lib/libflac/include/private/lpc.h @@ -42,29 +42,29 @@ #ifndef FLAC__INTEGER_ONLY_LIBRARY /* - * FLAC__lpc_window_data() - * -------------------------------------------------------------------- - * Applies the given window to the data. + * FLAC__lpc_window_data() + * -------------------------------------------------------------------- + * Applies the given window to the data. * OPT: asm implementation * - * IN in[0,data_len-1] - * IN window[0,data_len-1] - * OUT out[0,lag-1] - * IN data_len + * IN in[0,data_len-1] + * IN window[0,data_len-1] + * OUT out[0,lag-1] + * IN data_len */ void FLAC__lpc_window_data(const FLAC__int32 in[], const FLAC__real window[], FLAC__real out[], unsigned data_len); /* - * FLAC__lpc_compute_autocorrelation() - * -------------------------------------------------------------------- - * Compute the autocorrelation for lags between 0 and lag-1. - * Assumes data[] outside of [0,data_len-1] == 0. - * Asserts that lag > 0. + * FLAC__lpc_compute_autocorrelation() + * -------------------------------------------------------------------- + * Compute the autocorrelation for lags between 0 and lag-1. + * Assumes data[] outside of [0,data_len-1] == 0. + * Asserts that lag > 0. * - * IN data[0,data_len-1] - * IN data_len - * IN 0 < lag <= data_len - * OUT autoc[0,lag-1] + * IN data[0,data_len-1] + * IN data_len + * IN 0 < lag <= data_len + * OUT autoc[0,lag-1] */ void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); #ifndef FLAC__NO_ASM @@ -80,44 +80,44 @@ void FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow(const FLAC__real data[], u #endif /* - * FLAC__lpc_compute_lp_coefficients() - * -------------------------------------------------------------------- - * Computes LP coefficients for orders 1..max_order. - * Do not call if autoc[0] == 0.0. This means the signal is zero - * and there is no point in calculating a predictor. + * FLAC__lpc_compute_lp_coefficients() + * -------------------------------------------------------------------- + * Computes LP coefficients for orders 1..max_order. + * Do not call if autoc[0] == 0.0. This means the signal is zero + * and there is no point in calculating a predictor. * - * IN autoc[0,max_order] autocorrelation values - * IN 0 < max_order <= FLAC__MAX_LPC_ORDER max LP order to compute - * OUT lp_coeff[0,max_order-1][0,max_order-1] LP coefficients for each order - * *** IMPORTANT: - * *** lp_coeff[0,max_order-1][max_order,FLAC__MAX_LPC_ORDER-1] are untouched - * OUT error[0,max_order-1] error for each order (more - * specifically, the variance of - * the error signal times # of - * samples in the signal) + * IN autoc[0,max_order] autocorrelation values + * IN 0 < max_order <= FLAC__MAX_LPC_ORDER max LP order to compute + * OUT lp_coeff[0,max_order-1][0,max_order-1] LP coefficients for each order + * *** IMPORTANT: + * *** lp_coeff[0,max_order-1][max_order,FLAC__MAX_LPC_ORDER-1] are untouched + * OUT error[0,max_order-1] error for each order (more + * specifically, the variance of + * the error signal times # of + * samples in the signal) * - * Example: if max_order is 9, the LP coefficients for order 9 will be - * in lp_coeff[8][0,8], the LP coefficients for order 8 will be - * in lp_coeff[7][0,7], etc. + * Example: if max_order is 9, the LP coefficients for order 9 will be + * in lp_coeff[8][0,8], the LP coefficients for order 8 will be + * in lp_coeff[7][0,7], etc. */ void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], FLAC__double error[]); /* - * FLAC__lpc_quantize_coefficients() - * -------------------------------------------------------------------- - * Quantizes the LP coefficients. NOTE: precision + bits_per_sample - * must be less than 32 (sizeof(FLAC__int32)*8). + * FLAC__lpc_quantize_coefficients() + * -------------------------------------------------------------------- + * Quantizes the LP coefficients. NOTE: precision + bits_per_sample + * must be less than 32 (sizeof(FLAC__int32)*8). * - * IN lp_coeff[0,order-1] LP coefficients - * IN order LP order - * IN FLAC__MIN_QLP_COEFF_PRECISION < precision - * desired precision (in bits, including sign - * bit) of largest coefficient - * OUT qlp_coeff[0,order-1] quantized coefficients - * OUT shift # of bits to shift right to get approximated - * LP coefficients. NOTE: could be negative. - * RETURN 0 => quantization OK - * 1 => coefficients require too much shifting for *shift to + * IN lp_coeff[0,order-1] LP coefficients + * IN order LP order + * IN FLAC__MIN_QLP_COEFF_PRECISION < precision + * desired precision (in bits, including sign + * bit) of largest coefficient + * OUT qlp_coeff[0,order-1] quantized coefficients + * OUT shift # of bits to shift right to get approximated + * LP coefficients. NOTE: could be negative. + * RETURN 0 => quantization OK + * 1 => coefficients require too much shifting for *shift to * fit in the LPC subframe header. 'shift' is unset. * 2 => coefficients are all zero, which is bad. 'shift' is * unset. @@ -125,17 +125,17 @@ void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_o int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order, unsigned precision, FLAC__int32 qlp_coeff[], int *shift); /* - * FLAC__lpc_compute_residual_from_qlp_coefficients() - * -------------------------------------------------------------------- - * Compute the residual signal obtained from sutracting the predicted - * signal from the original. + * FLAC__lpc_compute_residual_from_qlp_coefficients() + * -------------------------------------------------------------------- + * Compute the residual signal obtained from sutracting the predicted + * signal from the original. * - * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) - * IN data_len length of original signal - * IN qlp_coeff[0,order-1] quantized LP coefficients - * IN order > 0 LP order - * IN lp_quantization quantization of LP coefficients in bits - * OUT residual[0,data_len-1] residual signal + * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) + * IN data_len length of original signal + * IN qlp_coeff[0,order-1] quantized LP coefficients + * IN order > 0 LP order + * IN lp_quantization quantization of LP coefficients in bits + * OUT residual[0,data_len-1] residual signal */ void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); @@ -151,19 +151,19 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx(const FLAC__i #endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ /* - * FLAC__lpc_restore_signal() - * -------------------------------------------------------------------- - * Restore the original signal by summing the residual and the - * predictor. + * FLAC__lpc_restore_signal() + * -------------------------------------------------------------------- + * Restore the original signal by summing the residual and the + * predictor. * - * IN residual[0,data_len-1] residual signal - * IN data_len length of original signal - * IN qlp_coeff[0,order-1] quantized LP coefficients - * IN order > 0 LP order - * IN lp_quantization quantization of LP coefficients in bits - * *** IMPORTANT: the caller must pass in the historical samples: - * IN data[-order,-1] previously-reconstructed historical samples - * OUT data[0,data_len-1] original signal + * IN residual[0,data_len-1] residual signal + * IN data_len length of original signal + * IN qlp_coeff[0,order-1] quantized LP coefficients + * IN order > 0 LP order + * IN lp_quantization quantization of LP coefficients in bits + * *** IMPORTANT: the caller must pass in the historical samples: + * IN data[-order,-1] previously-reconstructed historical samples + * OUT data[0,data_len-1] original signal */ void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); @@ -182,30 +182,30 @@ void FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8(const FLAC__int32 residu #ifndef FLAC__INTEGER_ONLY_LIBRARY /* - * FLAC__lpc_compute_expected_bits_per_residual_sample() - * -------------------------------------------------------------------- - * Compute the expected number of bits per residual signal sample - * based on the LP error (which is related to the residual variance). + * FLAC__lpc_compute_expected_bits_per_residual_sample() + * -------------------------------------------------------------------- + * Compute the expected number of bits per residual signal sample + * based on the LP error (which is related to the residual variance). * - * IN lpc_error >= 0.0 error returned from calculating LP coefficients - * IN total_samples > 0 # of samples in residual signal - * RETURN expected bits per sample + * IN lpc_error >= 0.0 error returned from calculating LP coefficients + * IN total_samples > 0 # of samples in residual signal + * RETURN expected bits per sample */ FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample(FLAC__double lpc_error, unsigned total_samples); FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scale(FLAC__double lpc_error, FLAC__double error_scale); /* - * FLAC__lpc_compute_best_order() - * -------------------------------------------------------------------- - * Compute the best order from the array of signal errors returned - * during coefficient computation. + * FLAC__lpc_compute_best_order() + * -------------------------------------------------------------------- + * Compute the best order from the array of signal errors returned + * during coefficient computation. * - * IN lpc_error[0,max_order-1] >= 0.0 error returned from calculating LP coefficients - * IN max_order > 0 max LP order - * IN total_samples > 0 # of samples in residual signal - * IN overhead_bits_per_order # of bits overhead for each increased LP order - * (includes warmup sample size and quantized LP coefficient) - * RETURN [1,max_order] best order + * IN lpc_error[0,max_order-1] >= 0.0 error returned from calculating LP coefficients + * IN max_order > 0 max LP order + * IN total_samples > 0 # of samples in residual signal + * IN overhead_bits_per_order # of bits overhead for each increased LP order + * (includes warmup sample size and quantized LP coefficient) + * RETURN [1,max_order] best order */ unsigned FLAC__lpc_compute_best_order(const FLAC__double lpc_error[], unsigned max_order, unsigned total_samples, unsigned overhead_bits_per_order); diff --git a/src/lib/libflac/include/private/window.h b/src/lib/libflac/include/private/window.h index e063b4636df..dbb2a73f52a 100644 --- a/src/lib/libflac/include/private/window.h +++ b/src/lib/libflac/include/private/window.h @@ -42,13 +42,13 @@ #ifndef FLAC__INTEGER_ONLY_LIBRARY /* - * FLAC__window_*() - * -------------------------------------------------------------------- - * Calculates window coefficients according to different apodization - * functions. + * FLAC__window_*() + * -------------------------------------------------------------------- + * Calculates window coefficients according to different apodization + * functions. * - * OUT window[0,L-1] - * IN L (number of points in window) + * OUT window[0,L-1] + * IN L (number of points in window) */ void FLAC__window_bartlett(FLAC__real *window, const FLAC__int32 L); void FLAC__window_bartlett_hann(FLAC__real *window, const FLAC__int32 L); diff --git a/src/lib/libflac/libflac/bitreader.c b/src/lib/libflac/libflac/bitreader.c index 9ae61705bb0..02e4d4ba4b0 100644 --- a/src/lib/libflac/libflac/bitreader.c +++ b/src/lib/libflac/libflac/bitreader.c @@ -217,21 +217,21 @@ FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br) } /* - * set the target for reading, taking into account word alignment and endianness - */ + * set the target for reading, taking into account word alignment and endianness + */ bytes = (br->capacity - br->words) * FLAC__BYTES_PER_WORD - br->bytes; if(bytes == 0) return false; /* no space left, buffer is too small; see note for FLAC__BITREADER_DEFAULT_CAPACITY */ target = ((FLAC__byte*)(br->buffer+br->words)) + br->bytes; /* before reading, if the existing reader looks like this (say brword is 32 bits wide) - * bitstream : 11 22 33 44 55 br->words=1 br->bytes=1 (partial tail word is left-justified) - * buffer[BE]: 11 22 33 44 55 ?? ?? ?? (shown layed out as bytes sequentially in memory) - * buffer[LE]: 44 33 22 11 ?? ?? ?? 55 (?? being don't-care) - * ^^-------target, bytes=3 - * on LE machines, have to byteswap the odd tail word so nothing is - * overwritten: - */ + * bitstream : 11 22 33 44 55 br->words=1 br->bytes=1 (partial tail word is left-justified) + * buffer[BE]: 11 22 33 44 55 ?? ?? ?? (shown layed out as bytes sequentially in memory) + * buffer[LE]: 44 33 22 11 ?? ?? ?? 55 (?? being don't-care) + * ^^-------target, bytes=3 + * on LE machines, have to byteswap the odd tail word so nothing is + * overwritten: + */ #if WORDS_BIGENDIAN #else if(br->bytes) @@ -239,22 +239,22 @@ FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br) #endif /* now it looks like: - * bitstream : 11 22 33 44 55 br->words=1 br->bytes=1 - * buffer[BE]: 11 22 33 44 55 ?? ?? ?? - * buffer[LE]: 44 33 22 11 55 ?? ?? ?? - * ^^-------target, bytes=3 - */ + * bitstream : 11 22 33 44 55 br->words=1 br->bytes=1 + * buffer[BE]: 11 22 33 44 55 ?? ?? ?? + * buffer[LE]: 44 33 22 11 55 ?? ?? ?? + * ^^-------target, bytes=3 + */ /* read in the data; note that the callback may return a smaller number of bytes */ if(!br->read_callback(target, &bytes, br->client_data)) return false; /* after reading bytes 66 77 88 99 AA BB CC DD EE FF from the client: - * bitstream : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF - * buffer[BE]: 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ?? - * buffer[LE]: 44 33 22 11 55 66 77 88 99 AA BB CC DD EE FF ?? - * now have to byteswap on LE machines: - */ + * bitstream : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF + * buffer[BE]: 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ?? + * buffer[LE]: 44 33 22 11 55 66 77 88 99 AA BB CC DD EE FF ?? + * now have to byteswap on LE machines: + */ #if WORDS_BIGENDIAN #else end = (br->words*FLAC__BYTES_PER_WORD + br->bytes + bytes + (FLAC__BYTES_PER_WORD-1)) / FLAC__BYTES_PER_WORD; @@ -270,11 +270,11 @@ FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br) #endif /* now it looks like: - * bitstream : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF - * buffer[BE]: 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ?? - * buffer[LE]: 44 33 22 11 88 77 66 55 CC BB AA 99 ?? FF EE DD - * finally we'll update the reader values: - */ + * bitstream : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF + * buffer[BE]: 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ?? + * buffer[LE]: 44 33 22 11 88 77 66 55 CC BB AA 99 ?? FF EE DD + * finally we'll update the reader values: + */ end = br->words*FLAC__BYTES_PER_WORD + br->bytes + bytes; br->words = end / FLAC__BYTES_PER_WORD; br->bytes = end % FLAC__BYTES_PER_WORD; @@ -293,14 +293,14 @@ FLAC__BitReader *FLAC__bitreader_new(void) FLAC__BitReader *br = (FLAC__BitReader*)calloc(1, sizeof(FLAC__BitReader)); /* calloc() implies: - memset(br, 0, sizeof(FLAC__BitReader)); - br->buffer = 0; - br->capacity = 0; - br->words = br->bytes = 0; - br->consumed_words = br->consumed_bits = 0; - br->read_callback = 0; - br->client_data = 0; - */ + memset(br, 0, sizeof(FLAC__BitReader)); + br->buffer = 0; + br->capacity = 0; + br->words = br->bytes = 0; + br->consumed_words = br->consumed_bits = 0; + br->read_callback = 0; + br->client_data = 0; + */ return br; } @@ -487,9 +487,9 @@ FLaC__INLINE FLAC__bool FLAC__bitreader_read_raw_uint32(FLAC__BitReader *br, FLA } else { /* in this case we're starting our read at a partial tail word; - * the reader has guaranteed that we have at least 'bits' bits - * available to read, which makes this case simpler. - */ + * the reader has guaranteed that we have at least 'bits' bits + * available to read, which makes this case simpler. + */ /* OPT: taking out the consumed_bits==0 "else" case below might make things faster if less code allows the compiler to inline this function */ if(br->consumed_bits) { /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ @@ -566,9 +566,9 @@ FLaC__INLINE FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReade FLAC__bool FLAC__bitreader_skip_bits_no_crc(FLAC__BitReader *br, unsigned bits) { /* - * OPT: a faster implementation is possible but probably not that useful - * since this is only called a couple of times in the metadata readers. - */ + * OPT: a faster implementation is possible but probably not that useful + * since this is only called a couple of times in the metadata readers. + */ FLAC__ASSERT(0 != br); FLAC__ASSERT(0 != br->buffer); @@ -740,12 +740,12 @@ FLaC__INLINE FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, } } /* at this point we've eaten up all the whole words; have to try - * reading through any tail bytes before calling the read callback. - * this is a repeat of the above logic adjusted for the fact we - * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ + * reading through any tail bytes before calling the read callback. + * this is a repeat of the above logic adjusted for the fact we + * don't have a whole word. note though if the client is feeding + * us data a byte at a time (unlikely), br->consumed_bits may not + * be zero. + */ if(br->bytes) { const unsigned end = br->bytes * 8; brword b = (br->buffer[br->consumed_words] & (FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << br->consumed_bits; @@ -808,8 +808,8 @@ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[ unsigned bits; /* the # of binary LSBs left to read to finish a rice codeword */ /* try and get br->consumed_words and br->consumed_bits into register; - * must remember to flush them back to *br before calling other - * bitwriter functions that use them, and before returning */ + * must remember to flush them back to *br before calling other + * bitwriter functions that use them, and before returning */ register unsigned cwords; register unsigned cbits; @@ -863,12 +863,12 @@ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[ } } /* at this point we've eaten up all the whole words; have to try - * reading through any tail bytes before calling the read callback. - * this is a repeat of the above logic adjusted for the fact we - * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ + * reading through any tail bytes before calling the read callback. + * this is a repeat of the above logic adjusted for the fact we + * don't have a whole word. note though if the client is feeding + * us data a byte at a time (unlikely), br->consumed_bits may not + * be zero. + */ if(br->bytes) { const unsigned end = br->bytes * 8; brword b = (br->buffer[cwords] & (FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << cbits; @@ -889,9 +889,9 @@ FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[ } } /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ + * not touch br->consumed_bits at all but we still need to set + * it in case it fails and we have to return false. + */ br->consumed_bits = cbits; br->consumed_words = cwords; if(!bitreader_read_from_client_(br)) @@ -905,9 +905,9 @@ break1: if(bits) { while((br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits < bits) { /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ + * not touch br->consumed_bits at all but we still need to set + * it in case it fails and we have to return false. + */ br->consumed_bits = cbits; br->consumed_words = cwords; if(!bitreader_read_from_client_(br)) @@ -948,9 +948,9 @@ break1: } else { /* in this case we're starting our read at a partial tail word; - * the reader has guaranteed that we have at least 'bits' bits - * available to read, which makes this case simpler. - */ + * the reader has guaranteed that we have at least 'bits' bits + * available to read, which makes this case simpler. + */ uval <<= bits; if(cbits) { /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ @@ -989,8 +989,8 @@ break2: unsigned uval = 0; /* try and get br->consumed_words and br->consumed_bits into register; - * must remember to flush them back to *br before calling other - * bitwriter functions that use them, and before returning */ + * must remember to flush them back to *br before calling other + * bitwriter functions that use them, and before returning */ register unsigned cwords; register unsigned cbits; unsigned ucbits; /* keep track of the number of unconsumed bits in the buffer */ @@ -1046,12 +1046,12 @@ break2: } } /* at this point we've eaten up all the whole words; have to try - * reading through any tail bytes before calling the read callback. - * this is a repeat of the above logic adjusted for the fact we - * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ + * reading through any tail bytes before calling the read callback. + * this is a repeat of the above logic adjusted for the fact we + * don't have a whole word. note though if the client is feeding + * us data a byte at a time (unlikely), br->consumed_bits may not + * be zero. + */ if(br->bytes) { const unsigned end = br->bytes * 8; brword b = (br->buffer[cwords] & ~(FLAC__WORD_ALL_ONES >> end)) << cbits; @@ -1071,9 +1071,9 @@ break2: } } /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ + * not touch br->consumed_bits at all but we still need to set + * it in case it fails and we have to return false. + */ br->consumed_bits = cbits; br->consumed_words = cwords; if(!bitreader_read_from_client_(br)) @@ -1081,9 +1081,9 @@ break2: cwords = br->consumed_words; ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits + uval; /* + uval to offset our count by the # of unary bits already - * consumed before the read, because we will add these back - * in all at once at break1 - */ + * consumed before the read, because we will add these back + * in all at once at break1 + */ } break1: ucbits -= uval; @@ -1095,9 +1095,9 @@ break1: if(parameter) { while(ucbits < parameter) { /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ + * not touch br->consumed_bits at all but we still need to set + * it in case it fails and we have to return false. + */ br->consumed_bits = cbits; br->consumed_words = cwords; if(!bitreader_read_from_client_(br)) @@ -1135,9 +1135,9 @@ break1: } else { /* in this case we're starting our read at a partial tail word; - * the reader has guaranteed that we have at least 'parameter' - * bits available to read, which makes this case simpler. - */ + * the reader has guaranteed that we have at least 'parameter' + * bits available to read, which makes this case simpler. + */ uval <<= parameter; if(cbits) { /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ diff --git a/src/lib/libflac/libflac/bitwriter.c b/src/lib/libflac/libflac/bitwriter.c index 7f2589ab002..250295d2528 100644 --- a/src/lib/libflac/libflac/bitwriter.c +++ b/src/lib/libflac/libflac/bitwriter.c @@ -123,8 +123,8 @@ static FLAC__bool bitwriter_grow_(FLAC__BitWriter *bw, unsigned bits_to_add) new_capacity = bw->words + ((bw->bits + bits_to_add + FLAC__BITS_PER_WORD - 1) / FLAC__BITS_PER_WORD); /* it's possible (due to pessimism in the growth estimation that - * leads to this call) that we don't actually need to grow - */ + * leads to this call) that we don't actually need to grow + */ if(bw->capacity >= new_capacity) return true; @@ -288,8 +288,8 @@ FLAC__bool FLAC__bitwriter_get_buffer(FLAC__BitWriter *bw, const FLAC__byte **bu void FLAC__bitwriter_release_buffer(FLAC__BitWriter *bw) { /* nothing to do. in the future, strict checking of a 'writer-is-in- - * get-mode' flag could be added everywhere and then cleared here - */ + * get-mode' flag could be added everywhere and then cleared here + */ (void)bw; } @@ -629,9 +629,9 @@ break1: } else { /* if bw->bits == 0, left==FLAC__BITS_PER_WORD which will always - * be > lsbits (because of previous assertions) so it would have - * triggered the (lsbits<left) case above. - */ + * be > lsbits (because of previous assertions) so it would have + * triggered the (lsbits<left) case above. + */ FLAC__ASSERT(bw->bits); FLAC__ASSERT(left < FLAC__BITS_PER_WORD); bw->accum <<= left; diff --git a/src/lib/libflac/libflac/cpu.c b/src/lib/libflac/libflac/cpu.c index 60b73bff143..73b51f58eae 100644 --- a/src/lib/libflac/libflac/cpu.c +++ b/src/lib/libflac/libflac/cpu.c @@ -211,8 +211,8 @@ void FLAC__cpu_info(FLAC__CPUInfo *info) #endif /* - * now have to check for OS support of SSE/SSE2 - */ + * now have to check for OS support of SSE/SSE2 + */ if(info->data.ia32.fxsr || info->data.ia32.sse || info->data.ia32.sse2) { #if defined FLAC__NO_SSE_OS /* assume user knows better than us; turn it off */ diff --git a/src/lib/libflac/libflac/fixed.c b/src/lib/libflac/libflac/fixed.c index 5871b1f5f5d..0bcdc36fc30 100644 --- a/src/lib/libflac/libflac/fixed.c +++ b/src/lib/libflac/libflac/fixed.c @@ -75,10 +75,10 @@ static FLAC__fixedpoint local__compute_rbps_integerized(FLAC__uint32 err, FLAC__ if(err <= n) return 0; /* - * The above two things tell us 1) n fits in 16 bits; 2) err/n > 1. - * These allow us later to know we won't lose too much precision in the - * fixed-point division (err<<fracbits)/n. - */ + * The above two things tell us 1) n fits in 16 bits; 2) err/n > 1. + * These allow us later to know we won't lose too much precision in the + * fixed-point division (err<<fracbits)/n. + */ fracbits = (8*sizeof(err)) - (FLAC__bitmath_ilog2(err)+1); @@ -87,9 +87,9 @@ static FLAC__fixedpoint local__compute_rbps_integerized(FLAC__uint32 err, FLAC__ /* err now holds err/n with fracbits fractional bits */ /* - * Whittle err down to 16 bits max. 16 significant bits is enough for - * our purposes. - */ + * Whittle err down to 16 bits max. 16 significant bits is enough for + * our purposes. + */ FLAC__ASSERT(err > 0); bits = FLAC__bitmath_ilog2(err)+1; if(bits > 16) { @@ -118,16 +118,16 @@ static FLAC__fixedpoint local__compute_rbps_integerized(FLAC__uint32 err, FLAC__ return 0; /* - * The return value must have 16 fractional bits. Since the whole part - * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits - * must be >= -3, these assertion allows us to be able to shift rbps - * left if necessary to get 16 fracbits without losing any bits of the - * whole part of rbps. - * - * There is a slight chance due to accumulated error that the whole part - * will require 6 bits, so we use 6 in the assertion. Really though as - * long as it fits in 13 bits (32 - (16 - (-3))) we are fine. - */ + * The return value must have 16 fractional bits. Since the whole part + * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits + * must be >= -3, these assertion allows us to be able to shift rbps + * left if necessary to get 16 fracbits without losing any bits of the + * whole part of rbps. + * + * There is a slight chance due to accumulated error that the whole part + * will require 6 bits, so we use 6 in the assertion. Really though as + * long as it fits in 13 bits (32 - (16 - (-3))) we are fine. + */ FLAC__ASSERT((int)FLAC__bitmath_ilog2(rbps)+1 <= fracbits + 6); FLAC__ASSERT(fracbits >= -3); @@ -154,10 +154,10 @@ static FLAC__fixedpoint local__compute_rbps_wide_integerized(FLAC__uint64 err, F if(err <= n) return 0; /* - * The above two things tell us 1) n fits in 16 bits; 2) err/n > 1. - * These allow us later to know we won't lose too much precision in the - * fixed-point division (err<<fracbits)/n. - */ + * The above two things tell us 1) n fits in 16 bits; 2) err/n > 1. + * These allow us later to know we won't lose too much precision in the + * fixed-point division (err<<fracbits)/n. + */ fracbits = (8*sizeof(err)) - (FLAC__bitmath_ilog2_wide(err)+1); @@ -166,9 +166,9 @@ static FLAC__fixedpoint local__compute_rbps_wide_integerized(FLAC__uint64 err, F /* err now holds err/n with fracbits fractional bits */ /* - * Whittle err down to 16 bits max. 16 significant bits is enough for - * our purposes. - */ + * Whittle err down to 16 bits max. 16 significant bits is enough for + * our purposes. + */ FLAC__ASSERT(err > 0); bits = FLAC__bitmath_ilog2_wide(err)+1; if(bits > 16) { @@ -197,16 +197,16 @@ static FLAC__fixedpoint local__compute_rbps_wide_integerized(FLAC__uint64 err, F return 0; /* - * The return value must have 16 fractional bits. Since the whole part - * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits - * must be >= -3, these assertion allows us to be able to shift rbps - * left if necessary to get 16 fracbits without losing any bits of the - * whole part of rbps. - * - * There is a slight chance due to accumulated error that the whole part - * will require 6 bits, so we use 6 in the assertion. Really though as - * long as it fits in 13 bits (32 - (16 - (-3))) we are fine. - */ + * The return value must have 16 fractional bits. Since the whole part + * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits + * must be >= -3, these assertion allows us to be able to shift rbps + * left if necessary to get 16 fracbits without losing any bits of the + * whole part of rbps. + * + * There is a slight chance due to accumulated error that the whole part + * will require 6 bits, so we use 6 in the assertion. Really though as + * long as it fits in 13 bits (32 - (16 - (-3))) we are fine. + */ FLAC__ASSERT((int)FLAC__bitmath_ilog2(rbps)+1 <= fracbits + 6); FLAC__ASSERT(fracbits >= -3); @@ -290,9 +290,9 @@ unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsig FLAC__int32 last_error_3 = last_error_2 - (data[-2] - 2*data[-3] + data[-4]); FLAC__int32 error, save; /* total_error_* are 64-bits to avoid overflow when encoding - * erratic signals when the bits-per-sample and blocksize are - * large. - */ + * erratic signals when the bits-per-sample and blocksize are + * large. + */ FLAC__uint64 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0; unsigned i, order; diff --git a/src/lib/libflac/libflac/float.c b/src/lib/libflac/libflac/float.c index dc0390eab89..24ea8bc4bf7 100644 --- a/src/lib/libflac/libflac/float.c +++ b/src/lib/libflac/libflac/float.c @@ -57,8 +57,8 @@ const FLAC__fixedpoint FLAC__FP_E = 178145; static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { { /* - * 0 fraction bits - */ + * 0 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00000001, /* lg(4/3) = */ 0x00000000, @@ -78,8 +78,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 4 fraction bits - */ + * 4 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00000010, /* lg(4/3) = */ 0x00000007, @@ -99,8 +99,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 8 fraction bits - */ + * 8 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00000100, /* lg(4/3) = */ 0x0000006a, @@ -120,8 +120,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 12 fraction bits - */ + * 12 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00001000, /* lg(4/3) = */ 0x000006a4, @@ -141,8 +141,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 16 fraction bits - */ + * 16 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00010000, /* lg(4/3) = */ 0x00006a40, @@ -162,8 +162,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 20 fraction bits - */ + * 20 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x00100000, /* lg(4/3) = */ 0x0006a3fe, @@ -183,8 +183,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 24 fraction bits - */ + * 24 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x01000000, /* lg(4/3) = */ 0x006a3fe6, @@ -204,8 +204,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { }, { /* - * 28 fraction bits - */ + * 28 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ 0x10000000, /* lg(4/3) = */ 0x06a3fe5c, @@ -229,8 +229,8 @@ static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { static const FLAC__uint64 log2_lookup_wide[] = { { /* - * 32 fraction bits - */ + * 32 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ FLAC__U64L(0x100000000), /* lg(4/3) = */ FLAC__U64L(0x6a3fe5c6), @@ -250,8 +250,8 @@ static const FLAC__uint64 log2_lookup_wide[] = { }, { /* - * 48 fraction bits - */ + * 48 fraction bits + */ /* undefined */ 0x00000000, /* lg(2/1) = */ FLAC__U64L(0x1000000000000), /* lg(4/3) = */ FLAC__U64L(0x6a3fe5c60429), @@ -282,7 +282,7 @@ FLAC__uint32 FLAC__fixedpoint_log2(FLAC__uint32 x, unsigned fracbits, unsigned p if(x < ONE) return 0; - + if(precision > LOG2_LOOKUP_PRECISION) precision = LOG2_LOOKUP_PRECISION; diff --git a/src/lib/libflac/libflac/lpc.c b/src/lib/libflac/libflac/lpc.c index 3fb80ab8896..1c15e5c0fec 100644 --- a/src/lib/libflac/libflac/lpc.c +++ b/src/lib/libflac/libflac/lpc.c @@ -71,12 +71,12 @@ void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_le FLAC__ASSERT(lag <= data_len); /* - * Technically we should subtract the mean first like so: - * for(i = 0; i < data_len; i++) - * data[i] -= mean; - * but it appears not to make enough of a difference to matter, and - * most signals are already closely centered around zero - */ + * Technically we should subtract the mean first like so: + * for(i = 0; i < data_len; i++) + * data[i] -= mean; + * but it appears not to make enough of a difference to matter, and + * most signals are already closely centered around zero + */ while(lag--) { for(i = lag, d = 0.0; i < data_len; i++) d += data[i] * data[i - lag]; @@ -85,9 +85,9 @@ void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_le #endif /* - * this version tends to run faster because of better data locality - * ('data_len' is usually much larger than 'lag') - */ + * this version tends to run faster because of better data locality + * ('data_len' is usually much larger than 'lag') + */ FLAC__real d; unsigned sample, coeff; const unsigned limit = data_len - lag; @@ -223,9 +223,9 @@ int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order, } } /* negative shift is very rare but due to design flaw, negative shift is - * a NOP in the decoder, so it must be handled specially by scaling down - * coeffs - */ + * a NOP in the decoder, so it must be handled specially by scaling down + * coeffs + */ else { const int nshift = -(*shift); FLAC__double error = 0.0; @@ -297,13 +297,13 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, u } /* Here's a slower but clearer version: - for(i = 0; i < data_len; i++) { - sum = 0; - for(j = 0; j < order; j++) - sum += qlp_coeff[j] * data[i-j-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - */ + for(i = 0; i < data_len; i++) { + sum = 0; + for(j = 0; j < order; j++) + sum += qlp_coeff[j] * data[i-j-1]; + residual[i] = data[i] - (sum >> lp_quantization); + } + */ } #else /* fully unrolled version for normal use */ { @@ -314,10 +314,10 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, u FLAC__ASSERT(order <= 32); /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ + * We do unique versions up to 12th order since that's the subset limit. + * Also they are roughly ordered to match frequency of occurrence to + * minimize branching. + */ if(order <= 12) { if(order > 8) { if(order > 10) { @@ -576,10 +576,10 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *da FLAC__ASSERT(order <= 32); /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ + * We do unique versions up to 12th order since that's the subset limit. + * Also they are roughly ordered to match frequency of occurrence to + * minimize branching. + */ if(order <= 12) { if(order > 8) { if(order > 10) { @@ -827,13 +827,13 @@ void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, c } /* Here's a slower but clearer version: - for(i = 0; i < data_len; i++) { - sum = 0; - for(j = 0; j < order; j++) - sum += qlp_coeff[j] * data[i-j-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - */ + for(i = 0; i < data_len; i++) { + sum = 0; + for(j = 0; j < order; j++) + sum += qlp_coeff[j] * data[i-j-1]; + data[i] = residual[i] + (sum >> lp_quantization); + } + */ } #else /* fully unrolled version for normal use */ { @@ -844,10 +844,10 @@ void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, c FLAC__ASSERT(order <= 32); /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ + * We do unique versions up to 12th order since that's the subset limit. + * Also they are roughly ordered to match frequency of occurrence to + * minimize branching. + */ if(order <= 12) { if(order > 8) { if(order > 10) { @@ -1106,10 +1106,10 @@ void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_l FLAC__ASSERT(order <= 32); /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ + * We do unique versions up to 12th order since that's the subset limit. + * Also they are roughly ordered to match frequency of occurrence to + * minimize branching. + */ if(order <= 12) { if(order > 8) { if(order > 10) { diff --git a/src/lib/libflac/libflac/md5.c b/src/lib/libflac/libflac/md5.c index 37cef67bdc8..70c395bc09a 100644 --- a/src/lib/libflac/libflac/md5.c +++ b/src/lib/libflac/libflac/md5.c @@ -143,7 +143,7 @@ static void byteSwap(FLAC__uint32 *buf, unsigned words) { register FLAC__uint32 x; do { - x = *buf; + x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); } while (--words); diff --git a/src/lib/libflac/libflac/metadata_iterators.c b/src/lib/libflac/libflac/metadata_iterators.c index e8504112b56..4ea6595d352 100644 --- a/src/lib/libflac/libflac/metadata_iterators.c +++ b/src/lib/libflac/libflac/metadata_iterators.c @@ -264,9 +264,9 @@ void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMe (void)decoder; /* - * we assume we only get here when the one metadata block we were - * looking for was passed to us - */ + * we assume we only get here when the one metadata block we were + * looking for was passed to us + */ if(!cd->got_error && 0 == cd->object) { if(0 == (cd->object = FLAC__metadata_object_clone(metadata))) cd->got_error = true; @@ -906,10 +906,10 @@ struct FLAC__Metadata_Chain { FLAC__Metadata_ChainStatus status; off_t first_offset, last_offset; /* - * This is the length of the chain initially read from the FLAC file. - * it is used to compare against the current length to decide whether - * or not the whole file has to be rewritten. - */ + * This is the length of the chain initially read from the FLAC file. + * it is used to compare against the current length to decide whether + * or not the whole file has to be rewritten. + */ off_t initial_length; /* @@@ hacky, these are currently only needed by ogg reader */ FLAC__IOHandle handle; @@ -1613,9 +1613,9 @@ FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg_with_callbacks(FLAC__Metadata_ FLAC_API FLAC__bool FLAC__metadata_chain_check_if_tempfile_needed(FLAC__Metadata_Chain *chain, FLAC__bool use_padding) { /* This does all the same checks that are in chain_prepare_for_write_() - * but doesn't actually alter the chain. Make sure to update the logic - * here if chain_prepare_for_write_() changes. - */ + * but doesn't actually alter the chain. Make sure to update the logic + * here if chain_prepare_for_write_() changes. + */ const off_t current_length = chain_calculate_length_(chain); FLAC__ASSERT(0 != chain); @@ -1811,9 +1811,9 @@ FLAC_API void FLAC__metadata_chain_sort_padding(FLAC__Metadata_Chain *chain) FLAC__ASSERT(0 != chain); /* - * Don't try and be too smart... this simple algo is good enough for - * the small number of nodes that we deal with. - */ + * Don't try and be too smart... this simple algo is good enough for + * the small number of nodes that we deal with. + */ for(i = 0, node = chain->head; i < chain->nodes; i++) { if(node->data->type == FLAC__METADATA_TYPE_PADDING) { save = node->next; @@ -1835,9 +1835,9 @@ FLAC_API FLAC__Metadata_Iterator *FLAC__metadata_iterator_new(void) FLAC__Metadata_Iterator *iterator = (FLAC__Metadata_Iterator*)calloc(1, sizeof(FLAC__Metadata_Iterator)); /* calloc() implies: - iterator->current = 0; - iterator->chain = 0; - */ + iterator->current = 0; + iterator->chain = 0; + */ return iterator; } @@ -2087,9 +2087,9 @@ FLAC__bool read_metadata_block_header_cb_(FLAC__IOHandle handle, FLAC__IOCallbac *length = unpack_uint32_(raw_header + 1, 3); /* Note that we don't check: - * if(iterator->type >= FLAC__METADATA_TYPE_UNDEFINED) - * we just will read in an opaque block - */ + * if(iterator->type >= FLAC__METADATA_TYPE_UNDEFINED) + * we just will read in an opaque block + */ return true; } @@ -2126,9 +2126,9 @@ FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_streaminfo_cb_(FLAC b = buffer; /* we are using hardcoded numbers for simplicity but we should - * probably eventually write a bit-level unpacker and use the - * _STREAMINFO_ constants. - */ + * probably eventually write a bit-level unpacker and use the + * _STREAMINFO_ constants. + */ block->min_blocksize = unpack_uint32_(b, 2); b += 2; block->max_blocksize = unpack_uint32_(b, 2); b += 2; block->min_framesize = unpack_uint32_(b, 3); b += 3; @@ -2555,9 +2555,9 @@ FLAC__bool write_metadata_block_data_streaminfo_cb_(FLAC__IOHandle handle, FLAC_ const unsigned bps1 = block->bits_per_sample - 1; /* we are using hardcoded numbers for simplicity but we should - * probably eventually write a bit-level packer and use the - * _STREAMINFO_ constants. - */ + * probably eventually write a bit-level packer and use the + * _STREAMINFO_ constants. + */ pack_uint32_(block->min_blocksize, buffer, 2); pack_uint32_(block->max_blocksize, buffer+2, 2); pack_uint32_(block->min_framesize, buffer+4, 3); @@ -3066,11 +3066,11 @@ FLAC__bool simple_iterator_copy_file_postfix_(FLAC__Metadata_SimpleIterator *ite if(fixup_is_last_code != 0) { /* - * if code == 1, it means a block was appended to the end so - * we have to clear the is_last flag of the previous block - * if code == -1, it means the last block was deleted so - * we have to set the is_last flag of the previous block - */ + * if code == 1, it means a block was appended to the end so + * we have to clear the is_last flag of the previous block + * if code == -1, it means the last block was deleted so + * we have to set the is_last flag of the previous block + */ /* MAGIC NUMBERs here; we know the is_last flag is the high bit of the byte at this location */ FLAC__byte x; if(0 != fseeko(*tempfile, fixup_is_last_flag_offset, SEEK_SET)) { diff --git a/src/lib/libflac/libflac/metadata_object.c b/src/lib/libflac/libflac/metadata_object.c index 253c4ba785e..f00e0d597f5 100644 --- a/src/lib/libflac/libflac/metadata_object.c +++ b/src/lib/libflac/libflac/metadata_object.c @@ -268,13 +268,13 @@ static FLAC__bool vorbiscomment_set_entry_(FLAC__StreamMetadata *object, FLAC__S /* we have to make sure that the string we're taking over is null-terminated */ /* - * Stripping the const from src->entry is OK since we're taking - * ownership of the pointer. This is a hack around a deficiency - * in the API where the same function is used for 'copy' and - * 'own', but the source entry is a const pointer. If we were - * precise, the 'own' flavor would be a separate function with a - * non-const source pointer. But it's not, so we hack away. - */ + * Stripping the const from src->entry is OK since we're taking + * ownership of the pointer. This is a hack around a deficiency + * in the API where the same function is used for 'copy' and + * 'own', but the source entry is a const pointer. If we were + * precise, the 'own' flavor would be a separate function with a + * non-const source pointer. But it's not, so we hack away. + */ if(!ensure_null_terminated_((FLAC__byte**)(&src->entry), src->length)) return false; *dest = *src; @@ -447,21 +447,21 @@ FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type break; case FLAC__METADATA_TYPE_PADDING: /* calloc() took care of this for us: - object->length = 0; - */ + object->length = 0; + */ break; case FLAC__METADATA_TYPE_APPLICATION: object->length = FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8; /* calloc() took care of this for us: - object->data.application.data = 0; - */ + object->data.application.data = 0; + */ break; case FLAC__METADATA_TYPE_SEEKTABLE: /* calloc() took care of this for us: - object->length = 0; - object->data.seek_table.num_points = 0; - object->data.seek_table.points = 0; - */ + object->length = 0; + object->data.seek_table.num_points = 0; + object->data.seek_table.points = 0; + */ break; case FLAC__METADATA_TYPE_VORBIS_COMMENT: object->data.vorbis_comment.vendor_string.length = (unsigned)strlen(FLAC__VENDOR_STRING); @@ -490,13 +490,13 @@ FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type object->data.picture.mime_type = 0; object->data.picture.description = 0; /* calloc() took care of this for us: - object->data.picture.width = 0; - object->data.picture.height = 0; - object->data.picture.depth = 0; - object->data.picture.colors = 0; - object->data.picture.data_length = 0; - object->data.picture.data = 0; - */ + object->data.picture.width = 0; + object->data.picture.height = 0; + object->data.picture.depth = 0; + object->data.picture.colors = 0; + object->data.picture.data_length = 0; + object->data.picture.data = 0; + */ /* now initialize mime_type and description with empty strings to make things easier on the client */ if(!copy_cstring_(&object->data.picture.mime_type, "")) { free(object); @@ -511,9 +511,9 @@ FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type break; default: /* calloc() took care of this for us: - object->length = 0; - object->data.unknown.data = 0; - */ + object->length = 0; + object->data.unknown.data = 0; + */ break; } } @@ -1330,7 +1330,7 @@ FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_from_name_value_pa memcpy(entry->entry+nn+1, field_value, nv); entry->entry[entry->length] = '\0'; } - + return true; } diff --git a/src/lib/libflac/libflac/stream_decoder.c b/src/lib/libflac/libflac/stream_decoder.c index 17bebd08e1f..131501914c8 100644 --- a/src/lib/libflac/libflac/stream_decoder.c +++ b/src/lib/libflac/libflac/stream_decoder.c @@ -398,8 +398,8 @@ static FLAC__StreamDecoderInitStatus init_stream_internal_( #endif /* - * get the CPU info and set the function pointers - */ + * get the CPU info and set the function pointers + */ FLAC__cpu_info(&decoder->private_->cpuinfo); /* first default to the non-asm routines */ decoder->private_->local_lpc_restore_signal = FLAC__lpc_restore_signal; @@ -547,10 +547,10 @@ static FLAC__StreamDecoderInitStatus init_FILE_internal_( return decoder->protected_->state = FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS; /* - * To make sure that our file does not go unclosed after an error, we - * must assign the FILE pointer before any further error can occur in - * this routine. - */ + * To make sure that our file does not go unclosed after an error, we + * must assign the FILE pointer before any further error can occur in + * this routine. + */ if(file == stdin) file = get_binary_stdin_(); /* just to be safe */ @@ -610,10 +610,10 @@ static FLAC__StreamDecoderInitStatus init_file_internal_( FLAC__ASSERT(0 != decoder); /* - * To make sure that our file does not go unclosed after an error, we - * have to do the same entrance checks here that are later performed - * in FLAC__stream_decoder_init_FILE() before the FILE* is assigned. - */ + * To make sure that our file does not go unclosed after an error, we + * have to do the same entrance checks here that are later performed + * in FLAC__stream_decoder_init_FILE() before the FILE* is assigned. + */ if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) return decoder->protected_->state = FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED; @@ -665,8 +665,8 @@ FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder) return true; /* see the comment in FLAC__seekable_stream_decoder_reset() as to why we - * always call FLAC__MD5Final() - */ + * always call FLAC__MD5Final() + */ FLAC__MD5Final(decoder->private_->computed_md5sum, &decoder->private_->md5context); if(decoder->private_->has_seek_table && 0 != decoder->private_->seek_table.data.seek_table.points) { @@ -677,11 +677,11 @@ FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder) FLAC__bitreader_free(decoder->private_->input); for(i = 0; i < FLAC__MAX_CHANNELS; i++) { /* WATCHOUT: - * FLAC__lpc_restore_signal_asm_ia32_mmx() requires that the - * output arrays have a buffer of up to 3 zeroes in front - * (at negative indices) for alignment purposes; we use 4 - * to keep the data well-aligned. - */ + * FLAC__lpc_restore_signal_asm_ia32_mmx() requires that the + * output arrays have a buffer of up to 3 zeroes in front + * (at negative indices) for alignment purposes; we use 4 + * to keep the data well-aligned. + */ if(0 != decoder->private_->output[i]) { free(decoder->private_->output[i]-4); decoder->private_->output[i] = 0; @@ -985,10 +985,10 @@ FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder) #endif /* Rewind if necessary. If FLAC__stream_decoder_init() is calling us, - * (internal_reset_hack) don't try to rewind since we are already at - * the beginning of the stream and don't want to fail if the input is - * not seekable. - */ + * (internal_reset_hack) don't try to rewind since we are already at + * the beginning of the stream and don't want to fail if the input is + * not seekable. + */ if(!decoder->private_->internal_reset_hack) { if(decoder->private_->file == stdin) return false; /* can't rewind stdin, reset fails */ @@ -1008,17 +1008,17 @@ FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder) } decoder->private_->do_md5_checking = decoder->protected_->md5_checking; /* - * This goes in reset() and not flush() because according to the spec, a - * fixed-blocksize stream must stay that way through the whole stream. - */ + * This goes in reset() and not flush() because according to the spec, a + * fixed-blocksize stream must stay that way through the whole stream. + */ decoder->private_->fixed_block_size = decoder->private_->next_fixed_block_size = 0; /* We initialize the FLAC__MD5Context even though we may never use it. This - * is because md5 checking may be turned on to start and then turned off if - * a seek occurs. So we init the context here and finalize it in - * FLAC__stream_decoder_finish() to make sure things are always cleaned up - * properly. - */ + * is because md5 checking may be turned on to start and then turned off if + * a seek occurs. So we init the context here and finalize it in + * FLAC__stream_decoder_finish() to make sure things are always cleaned up + * properly. + */ FLAC__MD5Init(&decoder->private_->md5context); decoder->private_->first_frame_offset = 0; @@ -1276,12 +1276,12 @@ FILE *get_binary_stdin_(void) { #if 0 /* if something breaks here it is probably due to the presence or - * absence of an underscore before the identifiers 'setmode', - * 'fileno', and/or 'O_BINARY'; check your system header files. - */ + * absence of an underscore before the identifiers 'setmode', + * 'fileno', and/or 'O_BINARY'; check your system header files. + */ #if defined _MSC_VER || defined __MINGW32__ _setmode(_fileno(stdin), _O_BINARY); -#elif defined __CYGWIN__ +#elif defined __CYGWIN__ /* almost certainly not needed for any modern Cygwin, but let's be safe... */ setmode(_fileno(stdin), _O_BINARY); #elif defined __EMX__ @@ -1314,11 +1314,11 @@ FLAC__bool allocate_output_(FLAC__StreamDecoder *decoder, unsigned size, unsigne for(i = 0; i < channels; i++) { /* WATCHOUT: - * FLAC__lpc_restore_signal_asm_ia32_mmx() requires that the - * output arrays have a buffer of up to 3 zeroes in front - * (at negative indices) for alignment purposes; we use 4 - * to keep the data well-aligned. - */ + * FLAC__lpc_restore_signal_asm_ia32_mmx() requires that the + * output arrays have a buffer of up to 3 zeroes in front + * (at negative indices) for alignment purposes; we use 4 + * to keep the data well-aligned. + */ tmp = (FLAC__int32*)safe_malloc_muladd2_(sizeof(FLAC__int32), /*times (*/size, /*+*/4/*)*/); if(tmp == 0) { decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; @@ -1328,8 +1328,8 @@ FLAC__bool allocate_output_(FLAC__StreamDecoder *decoder, unsigned size, unsigne decoder->private_->output[i] = tmp + 4; /* WATCHOUT: - * minimum of quadword alignment for PPC vector optimizations is REQUIRED: - */ + * minimum of quadword alignment for PPC vector optimizations is REQUIRED: + */ if(!FLAC__memory_alloc_aligned_int32_array(size, &decoder->private_->residual_unaligned[i], &decoder->private_->residual[i])) { decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; return false; @@ -2009,8 +2009,8 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL return false; for(channel = 0; channel < decoder->private_->frame.header.channels; channel++) { /* - * first figure the correct bits-per-sample of the subframe - */ + * first figure the correct bits-per-sample of the subframe + */ unsigned bps = decoder->private_->frame.header.bits_per_sample; switch(decoder->private_->frame.header.channel_assignment) { case FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT: @@ -2035,8 +2035,8 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL FLAC__ASSERT(0); } /* - * now read it - */ + * now read it + */ if(!read_subframe_(decoder, channel, bps, do_full_decode)) return false; if(decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC) /* means bad sync or got corruption */ @@ -2048,8 +2048,8 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL return true; /* - * Read the frame CRC-16 from the footer and check - */ + * Read the frame CRC-16 from the footer and check + */ frame_crc = FLAC__bitreader_get_read_crc16(decoder->private_->input); if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__FRAME_FOOTER_CRC_LEN)) return false; /* read_callback_ sets the state for us */ @@ -2151,27 +2151,27 @@ FLAC__bool read_frame_header_(FLAC__StreamDecoder *decoder) is_unparseable = true; /* - * Note that along the way as we read the header, we look for a sync - * code inside. If we find one it would indicate that our original - * sync was bad since there cannot be a sync code in a valid header. - * - * Three kinds of things can go wrong when reading the frame header: - * 1) We may have sync'ed incorrectly and not landed on a frame header. - * If we don't find a sync code, it can end up looking like we read - * a valid but unparseable header, until getting to the frame header - * CRC. Even then we could get a false positive on the CRC. - * 2) We may have sync'ed correctly but on an unparseable frame (from a - * future encoder). - * 3) We may be on a damaged frame which appears valid but unparseable. - * - * For all these reasons, we try and read a complete frame header as - * long as it seems valid, even if unparseable, up until the frame - * header CRC. - */ + * Note that along the way as we read the header, we look for a sync + * code inside. If we find one it would indicate that our original + * sync was bad since there cannot be a sync code in a valid header. + * + * Three kinds of things can go wrong when reading the frame header: + * 1) We may have sync'ed incorrectly and not landed on a frame header. + * If we don't find a sync code, it can end up looking like we read + * a valid but unparseable header, until getting to the frame header + * CRC. Even then we could get a false positive on the CRC. + * 2) We may have sync'ed correctly but on an unparseable frame (from a + * future encoder). + * 3) We may be on a damaged frame which appears valid but unparseable. + * + * For all these reasons, we try and read a complete frame header as + * long as it seems valid, even if unparseable, up until the frame + * header CRC. + */ /* - * read in the raw header as bytes so we can CRC it, and parse it on the way - */ + * read in the raw header as bytes so we can CRC it, and parse it on the way + */ for(i = 0; i < 2; i++) { if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) return false; /* read_callback_ sets the state for us */ @@ -2462,8 +2462,8 @@ FLAC__bool read_subframe_(FLAC__StreamDecoder *decoder, unsigned channel, unsign decoder->private_->frame.subframes[channel].wasted_bits = 0; /* - * Lots of magic numbers here - */ + * Lots of magic numbers here + */ if(x & 0x80) { send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC); decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; @@ -2663,8 +2663,8 @@ FLAC__bool read_subframe_lpc_(FLAC__StreamDecoder *decoder, unsigned channel, un if(do_full_decode) { memcpy(decoder->private_->output[channel], subframe->warmup, sizeof(FLAC__int32) * order); /*@@@@@@ technically not pessimistic enough, should be more like - if( (FLAC__uint64)order * ((((FLAC__uint64)1)<<bps)-1) * ((1<<subframe->qlp_coeff_precision)-1) < (((FLAC__uint64)-1) << 32) ) - */ + if( (FLAC__uint64)order * ((((FLAC__uint64)1)<<bps)-1) * ((1<<subframe->qlp_coeff_precision)-1) < (((FLAC__uint64)-1) << 32) ) + */ if(bps + subframe->qlp_coeff_precision + FLAC__bitmath_ilog2(order) <= 32) if(bps <= 16 && subframe->qlp_coeff_precision <= 16) { if(order <= 8) @@ -2793,15 +2793,15 @@ FLAC__bool read_callback_(FLAC__byte buffer[], size_t *bytes, void *client_data) } else if(*bytes > 0) { /* While seeking, it is possible for our seek to land in the - * middle of audio data that looks exactly like a frame header - * from a future version of an encoder. When that happens, our - * error callback will get an - * FLAC__STREAM_DECODER_UNPARSEABLE_STREAM and increment its - * unparseable_frame_count. But there is a remote possibility - * that it is properly synced at such a "future-codec frame", - * so to make sure, we wait to see many "unparseable" errors in - * a row before bailing out. - */ + * middle of audio data that looks exactly like a frame header + * from a future version of an encoder. When that happens, our + * error callback will get an + * FLAC__STREAM_DECODER_UNPARSEABLE_STREAM and increment its + * unparseable_frame_count. But there is a remote possibility + * that it is properly synced at such a "future-codec frame", + * so to make sure, we wait to see many "unparseable" errors in + * a row before bailing out. + */ if(decoder->private_->is_seeking && decoder->private_->unparseable_frame_count > 20) { decoder->protected_->state = FLAC__STREAM_DECODER_ABORTED; return false; @@ -2845,15 +2845,15 @@ FLAC__bool read_callback_(FLAC__byte buffer[], size_t *bytes, void *client_data) return false; } /* [1] @@@ HACK NOTE: The end-of-stream checking has to be hacked around - * for Ogg FLAC. This is because the ogg decoder aspect can lose sync - * and at the same time hit the end of the stream (for example, seeking - * to a point that is after the beginning of the last Ogg page). There - * is no way to report an Ogg sync loss through the callbacks (see note - * in read_callback_ogg_aspect_()) so it returns CONTINUE with *bytes==0. - * So to keep the decoder from stopping at this point we gate the call - * to the eof_callback and let the Ogg decoder aspect set the - * end-of-stream state when it is needed. - */ + * for Ogg FLAC. This is because the ogg decoder aspect can lose sync + * and at the same time hit the end of the stream (for example, seeking + * to a point that is after the beginning of the last Ogg page). There + * is no way to report an Ogg sync loss through the callbacks (see note + * in read_callback_ogg_aspect_()) so it returns CONTINUE with *bytes==0. + * So to keep the decoder from stopping at this point we gate the call + * to the eof_callback and let the Ogg decoder aspect set the + * end-of-stream state when it is needed. + */ } #if FLAC__HAS_OGG @@ -2863,9 +2863,9 @@ FLAC__StreamDecoderReadStatus read_callback_ogg_aspect_(const FLAC__StreamDecode case FLAC__OGG_DECODER_ASPECT_READ_STATUS_OK: return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; /* we don't really have a way to handle lost sync via read - * callback so we'll let it pass and let the underlying - * FLAC decoder catch the error - */ + * callback so we'll let it pass and let the underlying + * FLAC decoder catch the error + */ case FLAC__OGG_DECODER_ASPECT_READ_STATUS_LOST_SYNC: return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; case FLAC__OGG_DECODER_ASPECT_READ_STATUS_END_OF_STREAM: @@ -2941,9 +2941,9 @@ FLAC__StreamDecoderWriteStatus write_audio_frame_to_client_(FLAC__StreamDecoder } else { /* - * If we never got STREAMINFO, turn off MD5 checking to save - * cycles since we don't have a sum to compare to anyway - */ + * If we never got STREAMINFO, turn off MD5 checking to save + * cycles since we don't have a sum to compare to anyway + */ if(!decoder->private_->has_stream_info) decoder->private_->do_md5_checking = false; if(decoder->private_->do_md5_checking) { @@ -2989,11 +2989,11 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s if(max_framesize > 0) approx_bytes_per_frame = (max_framesize + min_framesize) / 2 + 1; /* - * Check if it's a known fixed-blocksize stream. Note that though - * the spec doesn't allow zeroes in the STREAMINFO block, we may - * never get a STREAMINFO block when decoding so the value of - * min_blocksize might be zero. - */ + * Check if it's a known fixed-blocksize stream. Note that though + * the spec doesn't allow zeroes in the STREAMINFO block, we may + * never get a STREAMINFO block when decoding so the value of + * min_blocksize might be zero. + */ else if(min_blocksize == max_blocksize && min_blocksize > 0) { /* note there are no () around 'bps/8' to keep precision up since it's an integer calulation */ approx_bytes_per_frame = min_blocksize * channels * bps/8 + 64; @@ -3002,24 +3002,24 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s approx_bytes_per_frame = 4096 * channels * bps/8 + 64; /* - * First, we set an upper and lower bound on where in the - * stream we will search. For now we assume the worst case - * scenario, which is our best guess at the beginning of - * the first frame and end of the stream. - */ + * First, we set an upper and lower bound on where in the + * stream we will search. For now we assume the worst case + * scenario, which is our best guess at the beginning of + * the first frame and end of the stream. + */ lower_bound = first_frame_offset; lower_bound_sample = 0; upper_bound = stream_length; upper_bound_sample = total_samples > 0 ? total_samples : target_sample /*estimate it*/; /* - * Now we refine the bounds if we have a seektable with - * suitable points. Note that according to the spec they - * must be ordered by ascending sample number. - * - * Note: to protect against invalid seek tables we will ignore points - * that have frame_samples==0 or sample_number>=total_samples - */ + * Now we refine the bounds if we have a seektable with + * suitable points. Note that according to the spec they + * must be ordered by ascending sample number. + * + * Note: to protect against invalid seek tables we will ignore points + * that have frame_samples==0 or sample_number>=total_samples + */ if(seek_table) { FLAC__uint64 new_lower_bound = lower_bound; FLAC__uint64 new_upper_bound = upper_bound; @@ -3066,14 +3066,14 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s FLAC__ASSERT(upper_bound_sample >= lower_bound_sample); /* there are 2 insidious ways that the following equality occurs, which - * we need to fix: - * 1) total_samples is 0 (unknown) and target_sample is 0 - * 2) total_samples is 0 (unknown) and target_sample happens to be - * exactly equal to the last seek point in the seek table; this - * means there is no seek point above it, and upper_bound_samples - * remains equal to the estimate (of target_samples) we made above - * in either case it does not hurt to move upper_bound_sample up by 1 - */ + * we need to fix: + * 1) total_samples is 0 (unknown) and target_sample is 0 + * 2) total_samples is 0 (unknown) and target_sample happens to be + * exactly equal to the last seek point in the seek table; this + * means there is no seek point above it, and upper_bound_samples + * remains equal to the estimate (of target_samples) we made above + * in either case it does not hurt to move upper_bound_sample up by 1 + */ if(upper_bound_sample == lower_bound_sample) upper_bound_sample++; @@ -3111,11 +3111,11 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s return false; } /* Now we need to get a frame. First we need to reset our - * unparseable_frame_count; if we get too many unparseable - * frames in a row, the read callback will return - * FLAC__STREAM_DECODER_READ_STATUS_ABORT, causing - * FLAC__stream_decoder_process_single() to return false. - */ + * unparseable_frame_count; if we get too many unparseable + * frames in a row, the read callback will return + * FLAC__STREAM_DECODER_READ_STATUS_ABORT, causing + * FLAC__stream_decoder_process_single() to return false. + */ decoder->private_->unparseable_frame_count = 0; if(!FLAC__stream_decoder_process_single(decoder)) { decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; @@ -3142,11 +3142,11 @@ FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 s } /* our last move backwards wasn't big enough, try again */ approx_bytes_per_frame = approx_bytes_per_frame? approx_bytes_per_frame * 2 : 16; - continue; + continue; } /* allow one seek over upper bound, so we can get a correct upper_bound_sample for streams with unknown total_samples */ first_seek = false; - + /* make sure we are not seeking in corrupted stream */ if (this_frame_sample < lower_bound_sample) { decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; @@ -3186,21 +3186,21 @@ FLAC__bool seek_to_absolute_sample_ogg_(FLAC__StreamDecoder *decoder, FLAC__uint FLAC__bool did_a_seek; unsigned iteration = 0; - /* In the first iterations, we will calculate the target byte position - * by the distance from the target sample to left_sample and - * right_sample (let's call it "proportional search"). After that, we - * will switch to binary search. - */ + /* In the first iterations, we will calculate the target byte position + * by the distance from the target sample to left_sample and + * right_sample (let's call it "proportional search"). After that, we + * will switch to binary search. + */ unsigned BINARY_SEARCH_AFTER_ITERATION = 2; /* We will switch to a linear search once our current sample is less - * than this number of samples ahead of the target sample - */ + * than this number of samples ahead of the target sample + */ static const FLAC__uint64 LINEAR_SEARCH_WITHIN_SAMPLES = FLAC__MAX_BLOCK_SIZE * 2; /* If the total number of samples is unknown, use a large value, and - * force binary search immediately. - */ + * force binary search immediately. + */ if(right_sample == 0) { right_sample = (FLAC__uint64)(-1); BINARY_SEARCH_AFTER_ITERATION = 0; @@ -3228,10 +3228,10 @@ FLAC__bool seek_to_absolute_sample_ogg_(FLAC__StreamDecoder *decoder, FLAC__uint pos = (FLAC__int64)((((target_sample-left_sample)>>8) * ((right_pos-left_pos)>>8)) / ((right_sample-left_sample)>>16)); #endif /* @@@ TODO: might want to limit pos to some distance - * before EOF, to make sure we land before the last frame, - * thereby getting a this_frame_sample and so having a better - * estimate. - */ + * before EOF, to make sure we land before the last frame, + * thereby getting a this_frame_sample and so having a better + * estimate. + */ } /* physical seek */ @@ -3256,16 +3256,16 @@ FLAC__bool seek_to_absolute_sample_ogg_(FLAC__StreamDecoder *decoder, FLAC__uint if(!decoder->private_->got_a_frame) { if(did_a_seek) { /* this can happen if we seek to a point after the last frame; we drop - * to binary search right away in this case to avoid any wasted - * iterations of proportional search. - */ + * to binary search right away in this case to avoid any wasted + * iterations of proportional search. + */ right_pos = pos; BINARY_SEARCH_AFTER_ITERATION = 0; } else { /* this can probably only happen if total_samples is unknown and the - * target_sample is past the end of the stream - */ + * target_sample is past the end of the stream + */ decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; return false; } @@ -3281,11 +3281,11 @@ FLAC__bool seek_to_absolute_sample_ogg_(FLAC__StreamDecoder *decoder, FLAC__uint if (did_a_seek) { if (this_frame_sample <= target_sample) { /* The 'equal' case should not happen, since - * FLAC__stream_decoder_process_single() - * should recognize that it has hit the - * target sample and we would exit through - * the 'break' above. - */ + * FLAC__stream_decoder_process_single() + * should recognize that it has hit the + * target sample and we would exit through + * the 'break' above. + */ FLAC__ASSERT(this_frame_sample != target_sample); left_sample = this_frame_sample; diff --git a/src/lib/libflac/libflac/stream_encoder.c b/src/lib/libflac/libflac/stream_encoder.c index bb619126489..cb71f134e12 100644 --- a/src/lib/libflac/libflac/stream_encoder.c +++ b/src/lib/libflac/libflac/stream_encoder.c @@ -88,7 +88,7 @@ * parameter estimation in this encoder is very good, almost always * yielding compression within 0.1% of the optimal parameters. */ -#undef ENABLE_RICE_PARAMETER_SEARCH +#undef ENABLE_RICE_PARAMETER_SEARCH typedef struct { @@ -224,7 +224,7 @@ static unsigned evaluate_lpc_subframe_( #endif static unsigned evaluate_verbatim_subframe_( - FLAC__StreamEncoder *encoder, + FLAC__StreamEncoder *encoder, const FLAC__int32 signal[], unsigned blocksize, unsigned subframe_bps, @@ -406,16 +406,16 @@ typedef struct FLAC__StreamEncoderPrivate { FLAC__uint64 *abs_residual_partition_sums_unaligned; unsigned *raw_bits_per_partition_unaligned; /* - * These fields have been moved here from private function local - * declarations merely to save stack space during encoding. - */ + * These fields have been moved here from private function local + * declarations merely to save stack space during encoding. + */ #ifndef FLAC__INTEGER_ONLY_LIBRARY FLAC__real lp_coeff[FLAC__MAX_LPC_ORDER][FLAC__MAX_LPC_ORDER]; /* from process_subframe_() */ #endif FLAC__EntropyCodingMethod_PartitionedRiceContents partitioned_rice_contents_extra[2]; /* from find_best_partition_order_() */ /* - * The data for the verify section - */ + * The data for the verify section + */ struct { FLAC__StreamDecoder *decoder; EncoderStateHint state_hint; @@ -825,7 +825,7 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( metadata_picture_has_type1 = true; /* standard icon must be 32x32 pixel PNG */ if( - m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD && + m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD && ( (strcmp(m->data.picture.mime_type, "image/png") && strcmp(m->data.picture.mime_type, "-->")) || m->data.picture.width != 32 || @@ -894,8 +894,8 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( encoder->private_->use_wide_by_partition = (false); /*@@@ need to set this */ /* - * get the CPU info and set the function pointers - */ + * get the CPU info and set the function pointers + */ FLAC__cpu_info(&encoder->private_->cpuinfo); /* first default to the non-asm routines */ #ifndef FLAC__INTEGER_ONLY_LIBRARY @@ -977,13 +977,13 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( } /* - * Set up the verify stuff if necessary - */ + * Set up the verify stuff if necessary + */ if(encoder->protected_->verify) { /* - * First, set up the fifo which will hold the - * original signal to compare against - */ + * First, set up the fifo which will hold the + * original signal to compare against + */ encoder->private_->verify.input_fifo.size = encoder->protected_->blocksize+OVERREAD_; for(i = 0; i < encoder->protected_->channels; i++) { if(0 == (encoder->private_->verify.input_fifo.data[i] = (FLAC__int32*)safe_malloc_mul_2op_(sizeof(FLAC__int32), /*times*/encoder->private_->verify.input_fifo.size))) { @@ -994,8 +994,8 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( encoder->private_->verify.input_fifo.tail = 0; /* - * Now set up a stream decoder for verification - */ + * Now set up a stream decoder for verification + */ encoder->private_->verify.decoder = FLAC__stream_decoder_new(); if(0 == encoder->private_->verify.decoder) { encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR; @@ -1015,9 +1015,9 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( encoder->private_->verify.error_stats.got = 0; /* - * These must be done before we write any metadata, because that - * calls the write_callback, which uses these values. - */ + * These must be done before we write any metadata, because that + * calls the write_callback, which uses these values. + */ encoder->private_->first_seekpoint_to_check = 0; encoder->private_->samples_written = 0; encoder->protected_->streaminfo_offset = 0; @@ -1025,8 +1025,8 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( encoder->protected_->audio_offset = 0; /* - * write the stream header - */ + * write the stream header + */ if(encoder->protected_->verify) encoder->private_->verify.state_hint = ENCODER_IN_MAGIC; if(!FLAC__bitwriter_write_raw_uint32(encoder->private_->frame, FLAC__STREAM_SYNC, FLAC__STREAM_SYNC_LEN)) { @@ -1039,8 +1039,8 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( } /* - * write the STREAMINFO metadata block - */ + * write the STREAMINFO metadata block + */ if(encoder->protected_->verify) encoder->private_->verify.state_hint = ENCODER_IN_METADATA; encoder->private_->streaminfo.type = FLAC__METADATA_TYPE_STREAMINFO; @@ -1067,23 +1067,23 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( } /* - * Now that the STREAMINFO block is written, we can init this to an - * absurdly-high value... - */ + * Now that the STREAMINFO block is written, we can init this to an + * absurdly-high value... + */ encoder->private_->streaminfo.data.stream_info.min_framesize = (1u << FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN) - 1; /* ... and clear this to 0 */ encoder->private_->streaminfo.data.stream_info.total_samples = 0; /* - * Check to see if the supplied metadata contains a VORBIS_COMMENT; - * if not, we will write an empty one (FLAC__add_metadata_block() - * automatically supplies the vendor string). - * - * WATCHOUT: the Ogg FLAC mapping requires us to write this block after - * the STREAMINFO. (In the case that metadata_has_vorbis_comment is - * true it will have already insured that the metadata list is properly - * ordered.) - */ + * Check to see if the supplied metadata contains a VORBIS_COMMENT; + * if not, we will write an empty one (FLAC__add_metadata_block() + * automatically supplies the vendor string). + * + * WATCHOUT: the Ogg FLAC mapping requires us to write this block after + * the STREAMINFO. (In the case that metadata_has_vorbis_comment is + * true it will have already insured that the metadata list is properly + * ordered.) + */ if(!metadata_has_vorbis_comment) { FLAC__StreamMetadata vorbis_comment; vorbis_comment.type = FLAC__METADATA_TYPE_VORBIS_COMMENT; @@ -1104,8 +1104,8 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( } /* - * write the user's metadata blocks - */ + * write the user's metadata blocks + */ for(i = 0; i < encoder->protected_->num_metadata_blocks; i++) { encoder->protected_->metadata[i]->is_last = (i == encoder->protected_->num_metadata_blocks - 1); if(!FLAC__add_metadata_block(encoder->protected_->metadata[i], encoder->private_->frame)) { @@ -1172,7 +1172,7 @@ FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_stream( /*is_ogg=*/true ); } - + static FLAC__StreamEncoderInitStatus init_FILE_internal_( FLAC__StreamEncoder *encoder, FILE *file, @@ -1196,10 +1196,10 @@ static FLAC__StreamEncoderInitStatus init_FILE_internal_( } /* - * To make sure that our file does not go unclosed after an error, we - * must assign the FILE pointer before any further error can occur in - * this routine. - */ + * To make sure that our file does not go unclosed after an error, we + * must assign the FILE pointer before any further error can occur in + * this routine. + */ if(file == stdout) file = get_binary_stdout_(); /* just to be safe */ @@ -1234,7 +1234,7 @@ static FLAC__StreamEncoderInitStatus init_FILE_internal_( return init_status; } - + FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_FILE( FLAC__StreamEncoder *encoder, FILE *file, @@ -1244,7 +1244,7 @@ FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_FILE( { return init_FILE_internal_(encoder, file, progress_callback, client_data, /*is_ogg=*/false); } - + FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_FILE( FLAC__StreamEncoder *encoder, FILE *file, @@ -1268,10 +1268,10 @@ static FLAC__StreamEncoderInitStatus init_file_internal_( FLAC__ASSERT(0 != encoder); /* - * To make sure that our file does not go unclosed after an error, we - * have to do the same entrance checks here that are later performed - * in FLAC__stream_encoder_init_FILE() before the FILE* is assigned. - */ + * To make sure that our file does not go unclosed after an error, we + * have to do the same entrance checks here that are later performed + * in FLAC__stream_encoder_init_FILE() before the FILE* is assigned. + */ if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) return FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED; @@ -2033,13 +2033,13 @@ FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder j = k = 0; /* - * we have several flavors of the same basic loop, optimized for - * different conditions: - */ + * we have several flavors of the same basic loop, optimized for + * different conditions: + */ if(encoder->protected_->do_mid_side_stereo && channels == 2) { /* - * stereo coding: unroll channel loop - */ + * stereo coding: unroll channel loop + */ do { if(encoder->protected_->verify) append_to_verify_fifo_interleaved_(&encoder->private_->verify.input_fifo, buffer, j, channels, min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j)); @@ -2073,8 +2073,8 @@ FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder } else { /* - * independent channel coding: buffer each channel in inner loop - */ + * independent channel coding: buffer each channel in inner loop + */ do { if(encoder->protected_->verify) append_to_verify_fifo_interleaved_(&encoder->private_->verify.input_fifo, buffer, j, channels, min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j)); @@ -2259,10 +2259,10 @@ FLAC__bool resize_buffers_(FLAC__StreamEncoder *encoder, unsigned new_blocksize) ok = true; /* WATCHOUT: FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx() - * requires that the input arrays (in our case the integer signals) - * have a buffer of up to 3 zeroes in front (at negative indices) for - * alignment purposes; we use 4 in front to keep the data well-aligned. - */ + * requires that the input arrays (in our case the integer signals) + * have a buffer of up to 3 zeroes in front (at negative indices) for + * alignment purposes; we use 4 in front to keep the data well-aligned. + */ for(i = 0; ok && i < encoder->protected_->channels; i++) { ok = ok && FLAC__memory_alloc_aligned_int32_array(new_blocksize+4+OVERREAD_, &encoder->private_->integer_signal_unaligned[i], &encoder->private_->integer_signal[i]); @@ -2436,8 +2436,8 @@ FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const } /* - * Watch for the STREAMINFO block and first SEEKTABLE block to go by and store their offsets. - */ + * Watch for the STREAMINFO block and first SEEKTABLE block to go by and store their offsets. + */ if(samples == 0) { FLAC__MetadataType type = (buffer[0] & 0x7f); if(type == FLAC__METADATA_TYPE_STREAMINFO) @@ -2447,10 +2447,10 @@ FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const } /* - * Mark the current seek point if hit (if audio_offset == 0 that - * means we're still writing metadata and haven't hit the first - * frame yet) - */ + * Mark the current seek point if hit (if audio_offset == 0 that + * means we're still writing metadata and haven't hit the first + * frame yet) + */ if(0 != encoder->private_->seek_table && encoder->protected_->audio_offset > 0 && encoder->private_->seek_table->num_points > 0) { const unsigned blocksize = FLAC__stream_encoder_get_blocksize(encoder); const FLAC__uint64 frame_first_sample = encoder->private_->samples_written; @@ -2468,11 +2468,11 @@ FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const encoder->private_->seek_table->points[i].frame_samples = blocksize; encoder->private_->first_seekpoint_to_check++; /* DO NOT: "break;" and here's why: - * The seektable template may contain more than one target - * sample for any given frame; we will keep looping, generating - * duplicate seekpoints for them, and we'll clean it up later, - * just before writing the seektable back to the metadata. - */ + * The seektable template may contain more than one target + * sample for any given frame; we will keep looping, generating + * duplicate seekpoints for them, and we'll clean it up later, + * just before writing the seektable back to the metadata. + */ } else { encoder->private_->first_seekpoint_to_check++; @@ -2502,9 +2502,9 @@ FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const encoder->private_->bytes_written += bytes; encoder->private_->samples_written += samples; /* we keep a high watermark on the number of frames written because - * when the encoder goes back to write metadata, 'current_frame' - * will drop back to 0. - */ + * when the encoder goes back to write metadata, 'current_frame' + * will drop back to 0. + */ encoder->private_->frames_written = max(encoder->private_->frames_written, encoder->private_->current_frame_number+1); } else @@ -2527,13 +2527,13 @@ void update_metadata_(const FLAC__StreamEncoder *encoder) FLAC__ASSERT(metadata->type == FLAC__METADATA_TYPE_STREAMINFO); /* All this is based on intimate knowledge of the stream header - * layout, but a change to the header format that would break this - * would also break all streams encoded in the previous format. - */ + * layout, but a change to the header format that would break this + * would also break all streams encoded in the previous format. + */ /* - * Write MD5 signature - */ + * Write MD5 signature + */ { const unsigned md5_offset = FLAC__STREAM_METADATA_HEADER_LENGTH + @@ -2560,8 +2560,8 @@ void update_metadata_(const FLAC__StreamEncoder *encoder) } /* - * Write total samples - */ + * Write total samples + */ { const unsigned total_samples_byte_offset = FLAC__STREAM_METADATA_HEADER_LENGTH + @@ -2593,8 +2593,8 @@ void update_metadata_(const FLAC__StreamEncoder *encoder) } /* - * Write min/max framesize - */ + * Write min/max framesize + */ { const unsigned min_framesize_offset = FLAC__STREAM_METADATA_HEADER_LENGTH + @@ -2621,8 +2621,8 @@ void update_metadata_(const FLAC__StreamEncoder *encoder) } /* - * Write seektable - */ + * Write seektable + */ if(0 != encoder->private_->seek_table && encoder->private_->seek_table->num_points > 0 && encoder->protected_->seektable_offset > 0) { unsigned i; @@ -2692,19 +2692,19 @@ void update_ogg_metadata_(FLAC__StreamEncoder *encoder) FLAC__ASSERT(0 != encoder->private_->seek_callback); /* Pre-check that client supports seeking, since we don't want the - * ogg_helper code to ever have to deal with this condition. - */ + * ogg_helper code to ever have to deal with this condition. + */ if(encoder->private_->seek_callback(encoder, 0, encoder->private_->client_data) == FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED) return; /* All this is based on intimate knowledge of the stream header - * layout, but a change to the header format that would break this - * would also break all streams encoded in the previous format. - */ + * layout, but a change to the header format that would break this + * would also break all streams encoded in the previous format. + */ /** - ** Write STREAMINFO stats - **/ + ** Write STREAMINFO stats + **/ simple_ogg_page__init(&page); if(!simple_ogg_page__get_at(encoder, encoder->protected_->streaminfo_offset, &page, encoder->private_->seek_callback, encoder->private_->read_callback, encoder->private_->client_data)) { simple_ogg_page__clear(&page); @@ -2712,8 +2712,8 @@ void update_ogg_metadata_(FLAC__StreamEncoder *encoder) } /* - * Write MD5 signature - */ + * Write MD5 signature + */ { const unsigned md5_offset = FIRST_OGG_PACKET_STREAMINFO_PREFIX_LENGTH + @@ -2738,8 +2738,8 @@ void update_ogg_metadata_(FLAC__StreamEncoder *encoder) } /* - * Write total samples - */ + * Write total samples + */ { const unsigned total_samples_byte_offset = FIRST_OGG_PACKET_STREAMINFO_PREFIX_LENGTH + @@ -2770,8 +2770,8 @@ void update_ogg_metadata_(FLAC__StreamEncoder *encoder) } /* - * Write min/max framesize - */ + * Write min/max framesize + */ { const unsigned min_framesize_offset = FIRST_OGG_PACKET_STREAMINFO_PREFIX_LENGTH + @@ -2801,8 +2801,8 @@ void update_ogg_metadata_(FLAC__StreamEncoder *encoder) simple_ogg_page__clear(&page); /* - * Write seektable - */ + * Write seektable + */ if(0 != encoder->private_->seek_table && encoder->private_->seek_table->num_points > 0 && encoder->protected_->seektable_offset > 0) { unsigned i; FLAC__byte *p; @@ -2865,32 +2865,32 @@ FLAC__bool process_frame_(FLAC__StreamEncoder *encoder, FLAC__bool is_fractional FLAC__ASSERT(encoder->protected_->state == FLAC__STREAM_ENCODER_OK); /* - * Accumulate raw signal to the MD5 signature - */ + * Accumulate raw signal to the MD5 signature + */ if(encoder->protected_->do_md5 && !FLAC__MD5Accumulate(&encoder->private_->md5context, (const FLAC__int32 * const *)encoder->private_->integer_signal, encoder->protected_->channels, encoder->protected_->blocksize, (encoder->protected_->bits_per_sample+7) / 8)) { encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; return false; } /* - * Process the frame header and subframes into the frame bitbuffer - */ + * Process the frame header and subframes into the frame bitbuffer + */ if(!process_subframes_(encoder, is_fractional_block)) { /* the above function sets the state for us in case of an error */ return false; } /* - * Zero-pad the frame to a byte_boundary - */ + * Zero-pad the frame to a byte_boundary + */ if(!FLAC__bitwriter_zero_pad_to_byte_boundary(encoder->private_->frame)) { encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; return false; } /* - * CRC-16 the whole thing - */ + * CRC-16 the whole thing + */ FLAC__ASSERT(FLAC__bitwriter_is_byte_aligned(encoder->private_->frame)); if( !FLAC__bitwriter_get_write_crc16(encoder->private_->frame, &crc) || @@ -2901,16 +2901,16 @@ FLAC__bool process_frame_(FLAC__StreamEncoder *encoder, FLAC__bool is_fractional } /* - * Write it - */ + * Write it + */ if(!write_bitbuffer_(encoder, encoder->protected_->blocksize, is_last_block)) { /* the above function sets the state for us in case of an error */ return false; } /* - * Get ready for the next frame - */ + * Get ready for the next frame + */ encoder->private_->current_sample_number = 0; encoder->private_->current_frame_number++; encoder->private_->streaminfo.data.stream_info.total_samples += (FLAC__uint64)encoder->protected_->blocksize; @@ -2925,8 +2925,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti FLAC__bool do_independent, do_mid_side; /* - * Calculate the min,max Rice partition orders - */ + * Calculate the min,max Rice partition orders + */ if(is_fractional_block) { max_partition_order = 0; } @@ -2937,8 +2937,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti min_partition_order = min(min_partition_order, max_partition_order); /* - * Setup the frame - */ + * Setup the frame + */ frame_header.blocksize = encoder->protected_->blocksize; frame_header.sample_rate = encoder->protected_->sample_rate; frame_header.channels = encoder->protected_->channels; @@ -2948,8 +2948,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti frame_header.number.frame_number = encoder->private_->current_frame_number; /* - * Figure out what channel assignments to try - */ + * Figure out what channel assignments to try + */ if(encoder->protected_->do_mid_side_stereo) { if(encoder->protected_->loose_mid_side_stereo) { if(encoder->private_->loose_mid_side_stereo_frame_count == 0) { @@ -2974,8 +2974,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti FLAC__ASSERT(do_independent || do_mid_side); /* - * Check for wasted bits; set effective bps for each subframe - */ + * Check for wasted bits; set effective bps for each subframe + */ if(do_independent) { for(channel = 0; channel < encoder->protected_->channels; channel++) { const unsigned w = get_wasted_bits_(encoder->private_->integer_signal[channel], encoder->protected_->blocksize); @@ -2993,8 +2993,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti } /* - * First do a normal encoding pass of each independent channel - */ + * First do a normal encoding pass of each independent channel + */ if(do_independent) { for(channel = 0; channel < encoder->protected_->channels; channel++) { if(! @@ -3017,8 +3017,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti } /* - * Now do mid and side channels if requested - */ + * Now do mid and side channels if requested + */ if(do_mid_side) { FLAC__ASSERT(encoder->protected_->channels == 2); @@ -3043,8 +3043,8 @@ FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fracti } /* - * Compose the frame bitbuffer - */ + * Compose the frame bitbuffer + */ if(do_mid_side) { unsigned left_bps = 0, right_bps = 0; /* initialized only to prevent superfluous compiler warning */ FLAC__Subframe *left_subframe = 0, *right_subframe = 0; /* initialized only to prevent superfluous compiler warning */ @@ -3734,9 +3734,9 @@ unsigned find_best_partition_order_( { /* - * We are allowed to de-const the pointer based on our special - * knowledge; it is const to the outside world. - */ + * We are allowed to de-const the pointer based on our special + * knowledge; it is const to the outside world. + */ FLAC__EntropyCodingMethod_PartitionedRiceContents* prc = (FLAC__EntropyCodingMethod_PartitionedRiceContents*)best_ecm->data.partitioned_rice.contents; unsigned partition; @@ -3746,10 +3746,10 @@ unsigned find_best_partition_order_( if(do_escape_coding) memcpy(prc->raw_bits, private_->partitioned_rice_contents_extra[best_parameters_index].raw_bits, sizeof(unsigned)*(1<<(best_partition_order))); /* - * Now need to check if the type should be changed to - * FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 based on the - * size of the rice parameters. - */ + * Now need to check if the type should be changed to + * FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 based on the + * size of the rice parameters. + */ for(partition = 0; partition < (1u<<best_partition_order); partition++) { if(prc->parameters[partition] >= FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER) { best_ecm->type = FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2; @@ -3932,11 +3932,11 @@ static FLaC__INLINE unsigned count_rice_bits_in_partition_( ) - (partition_samples >> 1) /* -(partition_samples>>1) to subtract out extra contributions to the abs_residual_partition_sum. - * The actual number of bits used is closer to the sum(for all i in the partition) of abs(residual[i])>>(rice_parameter-1) - * By using the abs_residual_partition sum, we also add in bits in the LSBs that would normally be shifted out. - * So the subtraction term tries to guess how many extra bits were contributed. - * If the LSBs are randomly distributed, this should average to 0.5 extra bits per sample. - */ + * The actual number of bits used is closer to the sum(for all i in the partition) of abs(residual[i])>>(rice_parameter-1) + * By using the abs_residual_partition sum, we also add in bits in the LSBs that would normally be shifted out. + * So the subtraction term tries to guess how many extra bits were contributed. + * If the LSBs are randomly distributed, this should average to 0.5 extra bits per sample. + */ ; } #endif @@ -4038,13 +4038,13 @@ FLAC__bool set_partitioned_rice_( } mean = abs_residual_partition_sums[partition]; /* we are basically calculating the size in bits of the - * average residual magnitude in the partition: - * rice_parameter = floor(log2(mean/partition_samples)) - * 'mean' is not a good name for the variable, it is - * actually the sum of magnitudes of all residual values - * in the partition, so the actual mean is - * mean/partition_samples - */ + * average residual magnitude in the partition: + * rice_parameter = floor(log2(mean/partition_samples)) + * 'mean' is not a good name for the variable, it is + * actually the sum of magnitudes of all residual values + * in the partition, so the actual mean is + * mean/partition_samples + */ for(rice_parameter = 0, k = partition_samples; k < mean; rice_parameter++, k <<= 1) ; if(rice_parameter >= rice_parameter_limit) { @@ -4174,9 +4174,9 @@ FLAC__StreamDecoderReadStatus verify_read_callback_(const FLAC__StreamDecoder *d else { if(encoded_bytes == 0) { /* - * If we get here, a FIFO underflow has occurred, - * which means there is a bug somewhere. - */ + * If we get here, a FIFO underflow has occurred, + * which means there is a bug somewhere. + */ FLAC__ASSERT(0); return FLAC__STREAM_DECODER_READ_STATUS_ABORT; } @@ -4306,21 +4306,21 @@ FLAC__StreamEncoderWriteStatus file_write_callback_(const FLAC__StreamEncoder *e FLAC__bool call_it = 0 != encoder->private_->progress_callback && ( #if FLAC__HAS_OGG /* We would like to be able to use 'samples > 0' in the - * clause here but currently because of the nature of our - * Ogg writing implementation, 'samples' is always 0 (see - * ogg_encoder_aspect.c). The downside is extra progress - * callbacks. - */ + * clause here but currently because of the nature of our + * Ogg writing implementation, 'samples' is always 0 (see + * ogg_encoder_aspect.c). The downside is extra progress + * callbacks. + */ encoder->private_->is_ogg? true : #endif samples > 0 ); if(call_it) { /* NOTE: We have to add +bytes, +samples, and +1 to the stats - * because at this point in the callback chain, the stats - * have not been updated. Only after we return and control - * gets back to write_frame_() are the stats updated - */ + * because at this point in the callback chain, the stats + * have not been updated. Only after we return and control + * gets back to write_frame_() are the stats updated + */ encoder->private_->progress_callback(encoder, encoder->private_->bytes_written+bytes, encoder->private_->samples_written+samples, encoder->private_->frames_written+(samples?1:0), encoder->private_->total_frames_estimate, encoder->private_->client_data); } return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; @@ -4336,9 +4336,9 @@ FILE *get_binary_stdout_(void) { #if 0 /* if something breaks here it is probably due to the presence or - * absence of an underscore before the identifiers 'setmode', - * 'fileno', and/or 'O_BINARY'; check your system header files. - */ + * absence of an underscore before the identifiers 'setmode', + * 'fileno', and/or 'O_BINARY'; check your system header files. + */ #if defined _MSC_VER || defined __MINGW32__ _setmode(_fileno(stdout), _O_BINARY); #elif defined __CYGWIN__ diff --git a/src/lib/libflac/libflac/stream_encoder_framing.c b/src/lib/libflac/libflac/stream_encoder_framing.c index 664b963bb62..eefb7cb6f3c 100644 --- a/src/lib/libflac/libflac/stream_encoder_framing.c +++ b/src/lib/libflac/libflac/stream_encoder_framing.c @@ -59,8 +59,8 @@ FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__ return false; /* - * First, for VORBIS_COMMENTs, adjust the length to reflect our vendor string - */ + * First, for VORBIS_COMMENTs, adjust the length to reflect our vendor string + */ i = metadata->length; if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { FLAC__ASSERT(metadata->data.vorbis_comment.vendor_string.length == 0 || 0 != metadata->data.vorbis_comment.vendor_string.entry); |
