summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2012-01-29 16:34:26 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2012-01-29 16:34:26 +0000
commit505442d0a0bdc2944f699d9102ae0829703a5407 (patch)
tree1a4c2f72533c67984e0112d35905f480a3a9b0ea /src/lib
parent5d0cb30e84215504e368130db9e4573c37e458f2 (diff)
Clean-ups and version bumpmame0144u7
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/formats/flopimg.c2
-rw-r--r--src/lib/formats/flopimg.h218
-rw-r--r--src/lib/lib.mak2
-rw-r--r--src/lib/libflac/include/flac++/decoder.h78
-rw-r--r--src/lib/libflac/include/flac++/encoder.h84
-rw-r--r--src/lib/libflac/include/flac++/metadata.h526
-rw-r--r--src/lib/libflac/include/flac/format.h88
-rw-r--r--src/lib/libflac/include/flac/metadata.h26
-rw-r--r--src/lib/libflac/include/flac/stream_decoder.h48
-rw-r--r--src/lib/libflac/include/flac/stream_encoder.h50
-rw-r--r--src/lib/libflac/include/private/fixed.h48
-rw-r--r--src/lib/libflac/include/private/float.h22
-rw-r--r--src/lib/libflac/include/private/lpc.h172
-rw-r--r--src/lib/libflac/include/private/window.h12
-rw-r--r--src/lib/libflac/libflac/bitreader.c162
-rw-r--r--src/lib/libflac/libflac/bitwriter.c14
-rw-r--r--src/lib/libflac/libflac/cpu.c4
-rw-r--r--src/lib/libflac/libflac/fixed.c74
-rw-r--r--src/lib/libflac/libflac/float.c42
-rw-r--r--src/lib/libflac/libflac/lpc.c84
-rw-r--r--src/lib/libflac/libflac/md5.c2
-rw-r--r--src/lib/libflac/libflac/metadata_iterators.c60
-rw-r--r--src/lib/libflac/libflac/metadata_object.c52
-rw-r--r--src/lib/libflac/libflac/stream_decoder.c296
-rw-r--r--src/lib/libflac/libflac/stream_encoder.c320
-rw-r--r--src/lib/libflac/libflac/stream_encoder_framing.c4
-rw-r--r--src/lib/libjpeg/jcapimin.c18
-rw-r--r--src/lib/libjpeg/jcarith.c6
-rw-r--r--src/lib/libjpeg/jccolor.c6
-rw-r--r--src/lib/libjpeg/jcdctmgr.c56
-rw-r--r--src/lib/libjpeg/jchuff.c64
-rw-r--r--src/lib/libjpeg/jcmainct.c10
-rw-r--r--src/lib/libjpeg/jcmarker.c94
-rw-r--r--src/lib/libjpeg/jcmaster.c28
-rw-r--r--src/lib/libjpeg/jcparam.c8
-rw-r--r--src/lib/libjpeg/jctrans.c10
-rw-r--r--src/lib/libjpeg/jdapimin.c8
-rw-r--r--src/lib/libjpeg/jdarith.c12
-rw-r--r--src/lib/libjpeg/jdcoefct.c6
-rw-r--r--src/lib/libjpeg/jdcolor.c6
-rw-r--r--src/lib/libjpeg/jdct.h2
-rw-r--r--src/lib/libjpeg/jddctmgr.c26
-rw-r--r--src/lib/libjpeg/jdhuff.c68
-rw-r--r--src/lib/libjpeg/jdinput.c32
-rw-r--r--src/lib/libjpeg/jdmarker.c62
-rw-r--r--src/lib/libjpeg/jdmaster.c10
-rw-r--r--src/lib/libjpeg/jdmerge.c14
-rw-r--r--src/lib/libjpeg/jdsample.c2
-rw-r--r--src/lib/libjpeg/jerror.c6
-rw-r--r--src/lib/libjpeg/jidctflt.c16
-rw-r--r--src/lib/libjpeg/jidctfst.c16
-rw-r--r--src/lib/libjpeg/jidctint.c86
-rw-r--r--src/lib/libjpeg/jmemmgr.c4
-rw-r--r--src/lib/libjpeg/jpeglib.h24
-rw-r--r--src/lib/libjpeg/jpegtran.c2
-rw-r--r--src/lib/libjpeg/jquant1.c50
-rw-r--r--src/lib/libjpeg/jquant2.c30
-rw-r--r--src/lib/util/chd.c40
-rw-r--r--src/lib/util/tagmap.h18
59 files changed, 1665 insertions, 1665 deletions
diff --git a/src/lib/formats/flopimg.c b/src/lib/formats/flopimg.c
index d5a36ad32d8..bb551aeb5dd 100644
--- a/src/lib/formats/flopimg.c
+++ b/src/lib/formats/flopimg.c
@@ -940,7 +940,7 @@ LEGACY_FLOPPY_OPTIONS_END
/***************************************************************************
- New implementation
+ New implementation
****************************************************************************
diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h
index 73a7fa8c5aa..3539d52cd89 100644
--- a/src/lib/formats/flopimg.h
+++ b/src/lib/formats/flopimg.h
@@ -226,34 +226,34 @@ class floppy_image_format_t
public:
floppy_image_format_t();
virtual ~floppy_image_format_t();
-
+
/*! @brief Identify an image.
- The identify function tests if the image is valid
- for this particular format.
- @param io buffer containing the image data.
- @param form_factor Physical form factor of disk, from the enum
- in floppy_image
- @return 1 if image valid, 0 otherwise.
- */
+ The identify function tests if the image is valid
+ for this particular format.
+ @param io buffer containing the image data.
+ @param form_factor Physical form factor of disk, from the enum
+ in floppy_image
+ @return 1 if image valid, 0 otherwise.
+ */
virtual int identify(io_generic *io, UINT32 form_factor) = 0;
-
+
/*! @brief Load an image.
- The load function opens an image file and converts it to the
- internal MESS floppy representation.
- @param io source buffer containing the image data.
- @param form_factor Physical form factor of disk, from the enum
- in floppy_image
- @param image output buffer for data in MESS internal format.
- @return true on success, false otherwise.
- */
+ The load function opens an image file and converts it to the
+ internal MESS floppy representation.
+ @param io source buffer containing the image data.
+ @param form_factor Physical form factor of disk, from the enum
+ in floppy_image
+ @param image output buffer for data in MESS internal format.
+ @return true on success, false otherwise.
+ */
virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) = 0;
-
+
/*! @brief Save an image.
The save function writes back an image from the MESS internal
floppy representation to the appropriate format on disk.
@param io output buffer for the data in the on-disk format.
@param image source buffer containing data in MESS internal format.
- @return true on success, false otherwise.
+ @return true on success, false otherwise.
*/
virtual bool save(io_generic *io, floppy_image *image);
@@ -275,7 +275,7 @@ public:
//! @param file_name
//! @returns true if file matches the extension.
bool extension_matches(const char *file_name) const;
-
+
protected:
//! Input for convert_to_edge
enum {
@@ -289,16 +289,16 @@ protected:
// **** Reader helpers ****
//! Struct designed for easy track data description. Contains an opcode and two params.
-
+
//! Optional, you can always do things by hand, but useful nevertheless.
//! A vector of these structures describes one track.
-
+
struct desc_e {
int type, //!< An opcode
- p1, //!< first param
- p2; //!< second param
+ p1, //!< first param
+ p2; //!< second param
};
-
+
//! Opcodes of the format description language used by generate_track()
enum {
END, //!< End of description
@@ -347,40 +347,40 @@ protected:
/*! @brief Generate one track according to the description vector.
- @param desc track data description
- @param track
- @param head
- @param sect a vector indexed by sector id.
- @param sect_count number of sectors.
- @param track_size in _cells_, i.e. 100000 for a usual 2us-per-cell track at 300rpm.
- @param image
- */
+ @param desc track data description
+ @param track
+ @param head
+ @param sect a vector indexed by sector id.
+ @param sect_count number of sectors.
+ @param track_size in _cells_, i.e. 100000 for a usual 2us-per-cell track at 300rpm.
+ @param image
+ */
void generate_track(const desc_e *desc, int track, int head, const desc_s *sect, int sect_count, int track_size, floppy_image *image);
/*! @brief Generate a track from cell binary values, MSB-first.
- @param track
- @param head
- @param trackbuf track input buffer.
- @param track_size in cells, not bytes.
- @param image
- */
+ @param track
+ @param head
+ @param trackbuf track input buffer.
+ @param track_size in cells, not bytes.
+ @param image
+ */
void generate_track_from_bitstream(int track, int head, const UINT8 *trackbuf, int track_size, floppy_image *image);
//! @brief Generate a track from cell level values (0/1/W/D/N).
-
+
/*! Note that this function needs to be able to split cells in two,
- so no time value should be less than 2, and even values are a
- good idea.
- */
+ so no time value should be less than 2, and even values are a
+ good idea.
+ */
/*! @param track
- @param head
- @param trackbuf track input buffer.
- @param track_size in cells, not bytes.
- @param splice_pos is the position of the track splice. For normal
- formats, use -1. For protected formats, you're supposed to
- know. trackbuf may be modified at that position or after.
- @param image
- */
+ @param head
+ @param trackbuf track input buffer.
+ @param track_size in cells, not bytes.
+ @param splice_pos is the position of the track splice. For normal
+ formats, use -1. For protected formats, you're supposed to
+ know. trackbuf may be modified at that position or after.
+ @param image
+ */
void generate_track_from_levels(int track, int head, UINT32 *trackbuf, int track_size, int splice_pos, floppy_image *image);
//! Normalize the times in a cell buffer to sum up to 200000000
@@ -401,7 +401,7 @@ protected:
// Fastcopy Pro optimized formats, with fake sector header for
// faster verify and skew/interleave where appropriate
- static const desc_e atari_st_fcp_9[];
+ static const desc_e atari_st_fcp_9[];
static const desc_e *const atari_st_fcp_10[10];
static const desc_e atari_st_fcp_11[];
@@ -422,46 +422,46 @@ protected:
// **** Writer helpers ****
/*! @brief Rebuild a cell bitstream for a track.
- Takes the cell standard
- angular size as a parameter, gives out a msb-first bitstream.
-
- Beware that fuzzy bits will always give out the same value.
- @param track
- @param head
- @param cell_size
- @param trackbuf Output buffer size should be 34% more than the nominal number
- of cells (the dpll tolerates a cell size down to 75% of the
- nominal one, with gives a cell count of 1/0.75=1.333... times
- the nominal one).
- @param track_size Output size is given in bits (cells).
- @param image
- */
+ Takes the cell standard
+ angular size as a parameter, gives out a msb-first bitstream.
+
+ Beware that fuzzy bits will always give out the same value.
+ @param track
+ @param head
+ @param cell_size
+ @param trackbuf Output buffer size should be 34% more than the nominal number
+ of cells (the dpll tolerates a cell size down to 75% of the
+ nominal one, with gives a cell count of 1/0.75=1.333... times
+ the nominal one).
+ @param track_size Output size is given in bits (cells).
+ @param image
+ */
/*! @verbatim
- Computing the standard angular size of a cell is
- simple. Noting:
- d = standard cell duration in microseconds
- r = motor rotational speed in rpm
- then:
- a = r * d * 10 / 3.
- Some values:
- Type Cell RPM Size
-
- C1541 tr 1-17 3.25 300 3250
- C1541 tr 18-24 3.50 300 3500
- C1541 tr 25-30 3.75 300 3750
- C1541 tr 31+ 4.00 300 4000
- 5.25" SD 4 300 4000
- 5.25" DD 2 300 2000
- 5.25" HD 1 360 1200
- 3.5" SD 4 300 4000
- 3.5" DD 2 300 2000
- 3.5" HD 1 300 1000
- 3.5" ED 0.5 300 500
- @endverbatim
- */
+ Computing the standard angular size of a cell is
+ simple. Noting:
+ d = standard cell duration in microseconds
+ r = motor rotational speed in rpm
+ then:
+ a = r * d * 10 / 3.
+ Some values:
+ Type Cell RPM Size
+
+ C1541 tr 1-17 3.25 300 3250
+ C1541 tr 18-24 3.50 300 3500
+ C1541 tr 25-30 3.75 300 3750
+ C1541 tr 31+ 4.00 300 4000
+ 5.25" SD 4 300 4000
+ 5.25" DD 2 300 2000
+ 5.25" HD 1 360 1200
+ 3.5" SD 4 300 4000
+ 3.5" DD 2 300 2000
+ 3.5" HD 1 300 1000
+ 3.5" ED 0.5 300 500
+ @endverbatim
+ */
void generate_bitstream_from_track(int track, int head, int cell_size, UINT8 *trackbuf, int &track_size, floppy_image *image);
-
+
//! Defines a standard sector for extracting.
struct desc_xs {
int track, //!< Track for this sector
@@ -484,7 +484,7 @@ protected:
//! @brief Get a geometry (including sectors) from an image.
-
+
//! PC-type sectors with MFM encoding
void get_geometry_mfm_pc(floppy_image *image, int cell_size, int &track_count, int &head_count, int &sector_count);
@@ -519,7 +519,7 @@ protected:
private:
enum { CRC_NONE, CRC_AMIGA, CRC_CCITT, CRC_MACHEAD };
enum { MAX_CRC_COUNT = 64 };
-
+
//! Holds data used internally for generating CRCs.
struct gen_crc_info {
int type, //!< Type of CRC
@@ -598,7 +598,7 @@ public:
TIME_MASK = 0x0fffffff,
MG_MASK = 0xf0000000,
MG_SHIFT = 28, //!< Bitshift constant for magnetic orientation data
- MG_A = (0 << MG_SHIFT), //!< - 0, MG_A -> Magnetic orientation A
+ MG_A = (0 << MG_SHIFT), //!< - 0, MG_A -> Magnetic orientation A
MG_B = (1 << MG_SHIFT), //!< - 1, MG_B -> Magnetic orientation B
MG_N = (2 << MG_SHIFT), //!< - 2, MG_N -> Non-magnetized zone (neutral)
MG_D = (3 << MG_SHIFT) //!< - 3, MG_D -> Damaged zone, reads as neutral but cannot be changed by writing
@@ -626,30 +626,30 @@ public:
//! floppy_image constructor
/*!
- @param _tracks number of tracks.
- @param _heads number of heads.
- @param _form_factor form factor of drive (from enum)
- */
+ @param _tracks number of tracks.
+ @param _heads number of heads.
+ @param _form_factor form factor of drive (from enum)
+ */
floppy_image(int tracks, int heads, UINT32 form_factor);
virtual ~floppy_image();
-
+
//! @return the form factor.
UINT32 get_form_factor() { return form_factor; }
//! @return the variant.
UINT32 get_variant() { return variant; }
//! @param v the variant.
- void set_variant(UINT32 v) { variant = v; }
+ void set_variant(UINT32 v) { variant = v; }
/*!
- @param track
- @param head
- @param size size of this track
- */
+ @param track
+ @param head
+ @param size size of this track
+ */
void set_track_size(int track, int head, UINT32 size) { track_size[track][head] = size; ensure_alloc(track, head); }
-
+
/*!
@param track track number
- @param head head number
+ @param head head number
@return a pointer to the data buffer for this track and head
*/
UINT32 *get_buffer(int track, int head) { return cell_data[track][head]; }
@@ -657,7 +657,7 @@ public:
//! @param track
//! @param head
UINT32 get_track_size(int track, int head) { return track_size[track][head]; }
-
+
//! Sets the write splice position.
//! The "track splice" information indicates where to start writing
//! if you try to rewrite a physical disk with the data. Some
@@ -666,9 +666,9 @@ public:
//! representation is the angular position relative to the index.
/*! @param track
- @param head
- @param pos the position
- */
+ @param head
+ @param pos the position
+ */
void set_write_splice_position(int track, int head, UINT32 pos) { write_splice[track][head] = pos; }
//! @return the current write splice position.
UINT32 get_write_splice_position(int track, int head) const { return write_splice[track][head]; }
@@ -683,7 +683,7 @@ public:
static const char *get_variant_name(UINT32 form_factor, UINT32 variant);
private:
-
+
enum {
MAX_FLOPPY_HEADS = 2,
MAX_FLOPPY_TRACKS = 84
diff --git a/src/lib/lib.mak b/src/lib/lib.mak
index 9eb26d31713..f34ac98fc02 100644
--- a/src/lib/lib.mak
+++ b/src/lib/lib.mak
@@ -274,7 +274,7 @@ $(LIBOBJ)/libjpeg/%.o: $(LIBSRC)/libjpeg/%.c | $(OSPREBUILD)
#-------------------------------------------------
FLACOPTS=-DFLAC__NO_ASM -DHAVE_INTTYPES_H -DHAVE_ICONV -DHAVE_LANGINFO_CODESET -DHAVE_SOCKLEN_T -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-
+
LIBFLACOBJS = \
$(LIBOBJ)/libflac/bitmath.o \
$(LIBOBJ)/libflac/bitreader.o \
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);
diff --git a/src/lib/libjpeg/jcapimin.c b/src/lib/libjpeg/jcapimin.c
index 639ce86f44f..8ae33d837ba 100644
--- a/src/lib/libjpeg/jcapimin.c
+++ b/src/lib/libjpeg/jcapimin.c
@@ -37,7 +37,7 @@ jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)
if (version != JPEG_LIB_VERSION)
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
if (structsize != SIZEOF(struct jpeg_compress_struct))
- ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
+ ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
(int) SIZEOF(struct jpeg_compress_struct), (int) structsize);
/* For debugging purposes, we zero the whole master structure.
@@ -244,14 +244,14 @@ jpeg_write_m_byte (j_compress_ptr cinfo, int val)
* To produce a pair of files containing abbreviated tables and abbreviated
* image data, one would proceed as follows:
*
- * initialize JPEG object
- * set JPEG parameters
- * set destination to table file
- * jpeg_write_tables(cinfo);
- * set destination to image file
- * jpeg_start_compress(cinfo, FALSE);
- * write data...
- * jpeg_finish_compress(cinfo);
+ * initialize JPEG object
+ * set JPEG parameters
+ * set destination to table file
+ * jpeg_write_tables(cinfo);
+ * set destination to image file
+ * jpeg_start_compress(cinfo, FALSE);
+ * write data...
+ * jpeg_finish_compress(cinfo);
*
* jpeg_write_tables has the side effect of marking all tables written
* (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress
diff --git a/src/lib/libjpeg/jcarith.c b/src/lib/libjpeg/jcarith.c
index 0b7ea55d404..e26905af240 100644
--- a/src/lib/libjpeg/jcarith.c
+++ b/src/lib/libjpeg/jcarith.c
@@ -216,7 +216,7 @@ finish_pass (j_compress_ptr cinfo)
*/
LOCAL(void)
-arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
+arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
{
register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;
register unsigned char nl, nm;
@@ -278,8 +278,8 @@ arith_encode (j_compress_ptr cinfo, unsigned char *st, int val)
e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
e->sc = 0;
/* Note: The 3 spacer bits in the C register guarantee
- * that the new buffer byte can't be 0xFF here
- * (see page 160 in the P&M JPEG book). */
+ * that the new buffer byte can't be 0xFF here
+ * (see page 160 in the P&M JPEG book). */
e->buffer = temp & 0xFF; /* new output byte, might overflow later */
} else if (temp == 0xFF) {
++e->sc; /* stack 0xFF byte (which might overflow later) */
diff --git a/src/lib/libjpeg/jccolor.c b/src/lib/libjpeg/jccolor.c
index 0a8a4b5d13c..787454e2c25 100644
--- a/src/lib/libjpeg/jccolor.c
+++ b/src/lib/libjpeg/jccolor.c
@@ -31,9 +31,9 @@ typedef my_color_converter * my_cconvert_ptr;
* YCbCr is defined per CCIR 601-1, except that Cb and Cr are
* normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
* The conversion equations to be implemented are therefore
- * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
- * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
- * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
+ * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
+ * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
+ * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
* (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
* Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
* rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and
diff --git a/src/lib/libjpeg/jcdctmgr.c b/src/lib/libjpeg/jcdctmgr.c
index 0bbdbb685d1..83bea7f5f2d 100644
--- a/src/lib/libjpeg/jcdctmgr.c
+++ b/src/lib/libjpeg/jcdctmgr.c
@@ -90,17 +90,17 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
qval = divisors[i];
temp = workspace[i];
/* Divide the coefficient value by qval, ensuring proper rounding.
- * Since C does not specify the direction of rounding for negative
- * quotients, we have to force the dividend positive for portability.
- *
- * In most files, at least half of the output values will be zero
- * (at default quantization settings, more like three-quarters...)
- * so we should ensure that this case is fast. On many machines,
- * a comparison is enough cheaper than a divide to make a special test
- * a win. Since both inputs will be nonnegative, we need only test
- * for a < b to discover whether a/b is 0.
- * If your machine's division is fast enough, define FAST_DIVIDE.
- */
+ * Since C does not specify the direction of rounding for negative
+ * quotients, we have to force the dividend positive for portability.
+ *
+ * In most files, at least half of the output values will be zero
+ * (at default quantization settings, more like three-quarters...)
+ * so we should ensure that this case is fast. On many machines,
+ * a comparison is enough cheaper than a divide to make a special test
+ * a win. Since both inputs will be nonnegative, we need only test
+ * for a < b to discover whether a/b is 0.
+ * If your machine's division is fast enough, define FAST_DIVIDE.
+ */
#ifdef FAST_DIVIDE
#define DIVIDE_BY(a,b) a /= b
#else
@@ -153,11 +153,11 @@ forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
/* Apply the quantization and scaling factor */
temp = workspace[i] * divisors[i];
/* Round to nearest integer.
- * Since C does not specify the direction of rounding for negative
- * quotients, we have to force the dividend positive for portability.
- * The maximum coefficient size is +-16K (for 12-bit data), so this
- * code should work for either 16-bit or 32-bit ints.
- */
+ * Since C does not specify the direction of rounding for negative
+ * quotients, we have to force the dividend positive for portability.
+ * The maximum coefficient size is +-16K (for 12-bit data), so this
+ * code should work for either 16-bit or 32-bit ints.
+ */
output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);
}
}
@@ -376,11 +376,11 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
case JDCT_IFAST:
{
/* For AA&N IDCT method, divisors are equal to quantization
- * coefficients scaled by scalefactor[row]*scalefactor[col], where
- * scalefactor[0] = 1
- * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
- * We apply a further scale factor of 8.
- */
+ * coefficients scaled by scalefactor[row]*scalefactor[col], where
+ * scalefactor[0] = 1
+ * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
+ * We apply a further scale factor of 8.
+ */
#define CONST_BITS 14
static const INT16 aanscales[DCTSIZE2] = {
/* precomputed values scaled up by 14 bits */
@@ -415,13 +415,13 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
case JDCT_FLOAT:
{
/* For float AA&N IDCT method, divisors are equal to quantization
- * coefficients scaled by scalefactor[row]*scalefactor[col], where
- * scalefactor[0] = 1
- * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
- * We apply a further scale factor of 8.
- * What's actually stored is 1/divisor so that the inner loop can
- * use a multiplication rather than a division.
- */
+ * coefficients scaled by scalefactor[row]*scalefactor[col], where
+ * scalefactor[0] = 1
+ * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
+ * We apply a further scale factor of 8.
+ * What's actually stored is 1/divisor so that the inner loop can
+ * use a multiplication rather than a division.
+ */
FAST_FLOAT * fdtbl;
int row, col;
static const double aanscalefactor[DCTSIZE] = {
diff --git a/src/lib/libjpeg/jchuff.c b/src/lib/libjpeg/jchuff.c
index abf27d05e8a..d226a5093cf 100644
--- a/src/lib/libjpeg/jchuff.c
+++ b/src/lib/libjpeg/jchuff.c
@@ -186,7 +186,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
SIZEOF(c_derived_tbl));
dtbl = *pdtbl;
-
+
/* Figure C.1: make table of Huffman code length for each symbol */
p = 0;
@@ -199,7 +199,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
}
huffsize[p] = 0;
lastp = p;
-
+
/* Figure C.2: generate the codes themselves */
/* We also validate that the counts represent a legal Huffman code tree. */
@@ -219,7 +219,7 @@ jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
code <<= 1;
si++;
}
-
+
/* Figure C.3: generate encoding tables */
/* These are code and size indexed by symbol value */
@@ -316,16 +316,16 @@ emit_bits_s (working_state * state, unsigned int code, int size)
ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);
put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
-
+
put_bits += size; /* new number of bits in buffer */
-
+
put_buffer <<= 24 - put_bits; /* align incoming bits */
put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */
-
+
while (put_bits >= 8) {
int c = (int) ((put_buffer >> 16) & 0xFF);
-
+
emit_byte_s(state, c, return FALSE);
if (c == 0xFF) { /* need to stuff a zero byte? */
emit_byte_s(state, 0, return FALSE);
@@ -358,7 +358,7 @@ emit_bits_e (huff_entropy_ptr entropy, unsigned int code, int size)
return; /* do nothing if we're only getting stats */
put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
-
+
put_bits += size; /* new number of bits in buffer */
put_buffer <<= 24 - put_bits; /* align incoming bits */
@@ -580,7 +580,7 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
/* This code assumes we are on a two's complement machine */
temp2--;
}
-
+
/* Find the number of bits needed for the magnitude of the coefficient */
nbits = 0;
while (temp) {
@@ -592,10 +592,10 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
*/
if (nbits > MAX_COEF_BITS+1)
ERREXIT(cinfo, JERR_BAD_DCT_COEF);
-
+
/* Count/emit the Huffman-coded symbol for the number of bits */
emit_dc_symbol(entropy, compptr->dc_tbl_no, nbits);
-
+
/* Emit that number of bits of the value, if positive, */
/* or the complement of its magnitude, if negative. */
if (nbits) /* emit_bits rejects calls with size 0 */
@@ -651,9 +651,9 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
block = MCU_data[0];
/* Encode the AC coefficients per section G.1.2.2, fig. G.3 */
-
+
r = 0; /* r = run length of zeros */
-
+
for (k = cinfo->Ss; k <= Se; k++) {
if ((temp = (*block)[natural_order[k]]) == 0) {
r++;
@@ -830,7 +830,7 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
}
/* Encode the AC coefficients per section G.1.2.3, fig. G.7 */
-
+
r = 0; /* r = run length of zeros */
BR = 0; /* BR = count of buffered bits added now */
BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */
@@ -1127,13 +1127,13 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
register int k, r;
int Se = cinfo->lim_Se;
const int * natural_order = cinfo->natural_order;
-
+
/* Encode the DC coefficient difference per section F.1.2.1 */
-
+
temp = block[0] - last_dc_val;
if (temp < 0)
temp = -temp;
-
+
/* Find the number of bits needed for the magnitude of the coefficient */
nbits = 0;
while (temp) {
@@ -1148,11 +1148,11 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
/* Count the Huffman symbol for the number of bits */
dc_counts[nbits]++;
-
+
/* Encode the AC coefficients per section F.1.2.2 */
-
+
r = 0; /* r = run length of zeros */
-
+
for (k = 1; k <= Se; k++) {
if ((temp = block[natural_order[k]]) == 0) {
r++;
@@ -1162,11 +1162,11 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
ac_counts[0xF0]++;
r -= 16;
}
-
+
/* Find the number of bits needed for the magnitude of the coefficient */
if (temp < 0)
temp = -temp;
-
+
/* Find the number of bits needed for the magnitude of the coefficient */
nbits = 1; /* there must be at least one 1 bit */
while ((temp >>= 1))
@@ -1174,10 +1174,10 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
/* Check for out-of-range coefficient values */
if (nbits > MAX_COEF_BITS)
ERREXIT(cinfo, JERR_BAD_DCT_COEF);
-
+
/* Count Huffman symbol for run length / number of bits */
ac_counts[(r << 4) + nbits]++;
-
+
r = 0;
}
}
@@ -1269,7 +1269,7 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
MEMZERO(codesize, SIZEOF(codesize));
for (i = 0; i < 257; i++)
others[i] = -1; /* init links to empty */
-
+
freq[256] = 1; /* make sure 256 has a nonzero count */
/* Including the pseudo-symbol 256 in the Huffman procedure guarantees
* that no real symbol is given code-value of all ones, because 256
@@ -1304,7 +1304,7 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
/* Done if we've merged everything into one frequency */
if (c2 < 0)
break;
-
+
/* Else merge the two counts/trees */
freq[c1] += freq[c2];
freq[c2] = 0;
@@ -1315,9 +1315,9 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
c1 = others[c1];
codesize[c1]++;
}
-
+
others[c1] = c2; /* chain c2 onto c1's tree branch */
-
+
/* Increment the codesize of everything in c2's tree branch */
codesize[c2]++;
while (others[c2] >= 0) {
@@ -1348,13 +1348,13 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
* shortest nonzero BITS entry is converted into a prefix for two code words
* one bit longer.
*/
-
+
for (i = MAX_CLEN; i > 16; i--) {
while (bits[i] > 0) {
j = i - 2; /* find length of new prefix to be used */
while (bits[j] == 0)
j--;
-
+
bits[i] -= 2; /* remove two symbols */
bits[i-1]++; /* one goes in this length */
bits[j+1] += 2; /* two new symbols in this length */
@@ -1366,10 +1366,10 @@ jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
while (bits[i] == 0) /* find largest codelength still in use */
i--;
bits[i]--;
-
+
/* Return final symbol counts (only for lengths 0..16) */
MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
-
+
/* Return a list of the symbols sorted by code length */
/* It's not real clear to me why we don't need to consider the codelength
* changes made above, but the JPEG spec seems to think this works.
diff --git a/src/lib/libjpeg/jcmainct.c b/src/lib/libjpeg/jcmainct.c
index 6c8ffdf11fe..b0368223700 100644
--- a/src/lib/libjpeg/jcmainct.c
+++ b/src/lib/libjpeg/jcmainct.c
@@ -208,11 +208,11 @@ process_data_buffer_main (j_compress_ptr cinfo,
if (main->pass_mode != JBUF_SAVE_SOURCE) {
if (! (*cinfo->coef->compress_data) (cinfo, main->buffer)) {
/* If compressor did not consume the whole row, then we must need to
- * suspend processing and return to the application. In this situation
- * we pretend we didn't yet consume the last input row; otherwise, if
- * it happened to be the last row of the image, the application would
- * think we were done.
- */
+ * suspend processing and return to the application. In this situation
+ * we pretend we didn't yet consume the last input row; otherwise, if
+ * it happened to be the last row of the image, the application would
+ * think we were done.
+ */
if (! main->suspended) {
(*in_row_ctr)--;
main->suspended = TRUE;
diff --git a/src/lib/libjpeg/jcmarker.c b/src/lib/libjpeg/jcmarker.c
index 606c19af397..af5442abf63 100644
--- a/src/lib/libjpeg/jcmarker.c
+++ b/src/lib/libjpeg/jcmarker.c
@@ -19,24 +19,24 @@ typedef enum { /* JPEG marker codes */
M_SOF1 = 0xc1,
M_SOF2 = 0xc2,
M_SOF3 = 0xc3,
-
+
M_SOF5 = 0xc5,
M_SOF6 = 0xc6,
M_SOF7 = 0xc7,
-
+
M_JPG = 0xc8,
M_SOF9 = 0xc9,
M_SOF10 = 0xca,
M_SOF11 = 0xcb,
-
+
M_SOF13 = 0xcd,
M_SOF14 = 0xce,
M_SOF15 = 0xcf,
-
+
M_DHT = 0xc4,
-
+
M_DAC = 0xcc,
-
+
M_RST0 = 0xd0,
M_RST1 = 0xd1,
M_RST2 = 0xd2,
@@ -45,7 +45,7 @@ typedef enum { /* JPEG marker codes */
M_RST5 = 0xd5,
M_RST6 = 0xd6,
M_RST7 = 0xd7,
-
+
M_SOI = 0xd8,
M_EOI = 0xd9,
M_SOS = 0xda,
@@ -54,7 +54,7 @@ typedef enum { /* JPEG marker codes */
M_DRI = 0xdd,
M_DHP = 0xde,
M_EXP = 0xdf,
-
+
M_APP0 = 0xe0,
M_APP1 = 0xe1,
M_APP2 = 0xe2,
@@ -71,13 +71,13 @@ typedef enum { /* JPEG marker codes */
M_APP13 = 0xed,
M_APP14 = 0xee,
M_APP15 = 0xef,
-
+
M_JPG0 = 0xf0,
M_JPG13 = 0xfd,
M_COM = 0xfe,
-
+
M_TEM = 0x01,
-
+
M_ERROR = 0x100
} JPEG_MARKER;
@@ -188,7 +188,7 @@ emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
{
JHUFF_TBL * htbl;
int length, i;
-
+
if (is_ac) {
htbl = cinfo->ac_huff_tbl_ptrs[index];
index += 0x10; /* output index has AC bit set */
@@ -198,23 +198,23 @@ emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
if (htbl == NULL)
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);
-
+
if (! htbl->sent_table) {
emit_marker(cinfo, M_DHT);
-
+
length = 0;
for (i = 1; i <= 16; i++)
length += htbl->bits[i];
-
+
emit_2bytes(cinfo, length + 2 + 1 + 16);
emit_byte(cinfo, index);
-
+
for (i = 1; i <= 16; i++)
emit_byte(cinfo, htbl->bits[i]);
-
+
for (i = 0; i < length; i++)
emit_byte(cinfo, htbl->huffval[i]);
-
+
htbl->sent_table = TRUE;
}
}
@@ -274,7 +274,7 @@ emit_dri (j_compress_ptr cinfo)
/* Emit a DRI marker */
{
emit_marker(cinfo, M_DRI);
-
+
emit_2bytes(cinfo, 4); /* fixed length */
emit_2bytes(cinfo, (int) cinfo->restart_interval);
@@ -287,9 +287,9 @@ emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
{
int ci;
jpeg_component_info *compptr;
-
+
emit_marker(cinfo, code);
-
+
emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */
/* Make sure image isn't bigger than SOF field can handle */
@@ -318,13 +318,13 @@ emit_sos (j_compress_ptr cinfo)
{
int i, td, ta;
jpeg_component_info *compptr;
-
+
emit_marker(cinfo, M_SOS);
-
+
emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */
-
+
emit_byte(cinfo, cinfo->comps_in_scan);
-
+
for (i = 0; i < cinfo->comps_in_scan; i++) {
compptr = cinfo->cur_comp_info[i];
emit_byte(cinfo, compptr->component_id);
@@ -352,9 +352,9 @@ emit_pseudo_sos (j_compress_ptr cinfo)
/* Emit a pseudo SOS marker */
{
emit_marker(cinfo, M_SOS);
-
+
emit_2bytes(cinfo, 2 + 1 + 3); /* length */
-
+
emit_byte(cinfo, 0); /* Ns */
emit_byte(cinfo, 0); /* Ss */
@@ -368,19 +368,19 @@ emit_jfif_app0 (j_compress_ptr cinfo)
/* Emit a JFIF-compliant APP0 marker */
{
/*
- * Length of APP0 block (2 bytes)
- * Block ID (4 bytes - ASCII "JFIF")
- * Zero byte (1 byte to terminate the ID string)
- * Version Major, Minor (2 bytes - major first)
- * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
- * Xdpu (2 bytes - dots per unit horizontal)
- * Ydpu (2 bytes - dots per unit vertical)
- * Thumbnail X size (1 byte)
- * Thumbnail Y size (1 byte)
+ * Length of APP0 block (2 bytes)
+ * Block ID (4 bytes - ASCII "JFIF")
+ * Zero byte (1 byte to terminate the ID string)
+ * Version Major, Minor (2 bytes - major first)
+ * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
+ * Xdpu (2 bytes - dots per unit horizontal)
+ * Ydpu (2 bytes - dots per unit vertical)
+ * Thumbnail X size (1 byte)
+ * Thumbnail Y size (1 byte)
*/
-
+
emit_marker(cinfo, M_APP0);
-
+
emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */
emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */
@@ -403,12 +403,12 @@ emit_adobe_app14 (j_compress_ptr cinfo)
/* Emit an Adobe APP14 marker */
{
/*
- * Length of APP14 block (2 bytes)
- * Block ID (5 bytes - ASCII "Adobe")
- * Version Number (2 bytes - currently 100)
- * Flags0 (2 bytes - currently 0)
- * Flags1 (2 bytes - currently 0)
- * Color transform (1 byte)
+ * Length of APP14 block (2 bytes)
+ * Block ID (5 bytes - ASCII "Adobe")
+ * Version Number (2 bytes - currently 100)
+ * Flags0 (2 bytes - currently 0)
+ * Flags1 (2 bytes - currently 0)
+ * Color transform (1 byte)
*
* Although Adobe TN 5116 mentions Version = 101, all the Adobe files
* now in circulation seem to use Version = 100, so that's what we write.
@@ -417,9 +417,9 @@ emit_adobe_app14 (j_compress_ptr cinfo)
* YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with
* whether the encoder performed a transformation, which is pretty useless.
*/
-
+
emit_marker(cinfo, M_APP14);
-
+
emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */
emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */
@@ -514,7 +514,7 @@ write_frame_header (j_compress_ptr cinfo)
int ci, prec;
boolean is_baseline;
jpeg_component_info *compptr;
-
+
/* Emit DQT for each quantization table.
* Note that emit_dqt() suppresses any duplicate tables.
*/
diff --git a/src/lib/libjpeg/jcmaster.c b/src/lib/libjpeg/jcmaster.c
index caf80a53b38..2929f6b5d44 100644
--- a/src/lib/libjpeg/jcmaster.c
+++ b/src/lib/libjpeg/jcmaster.c
@@ -8,7 +8,7 @@
*
* This file contains master control logic for the JPEG compressor.
* These routines are concerned with parameter validation, initial setup,
- * and inter-pass control (determining the number of passes and the work
+ * and inter-pass control (determining the number of passes and the work
* to be done in each pass).
*/
@@ -381,7 +381,7 @@ validate_script (j_compress_ptr cinfo)
#ifdef C_PROGRESSIVE_SUPPORTED
cinfo->progressive_mode = TRUE;
last_bitpos_ptr = & last_bitpos[0][0];
- for (ci = 0; ci < cinfo->num_components; ci++)
+ for (ci = 0; ci < cinfo->num_components; ci++)
for (coefi = 0; coefi < DCTSIZE2; coefi++)
*last_bitpos_ptr++ = -1;
#else
@@ -389,7 +389,7 @@ validate_script (j_compress_ptr cinfo)
#endif
} else {
cinfo->progressive_mode = FALSE;
- for (ci = 0; ci < cinfo->num_components; ci++)
+ for (ci = 0; ci < cinfo->num_components; ci++)
component_sent[ci] = FALSE;
}
@@ -575,16 +575,16 @@ per_scan_setup (j_compress_ptr cinfo)
{
int ci, mcublks, tmp;
jpeg_component_info *compptr;
-
+
if (cinfo->comps_in_scan == 1) {
-
+
/* Noninterleaved (single-component) scan */
compptr = cinfo->cur_comp_info[0];
-
+
/* Overall image size in MCUs */
cinfo->MCUs_per_row = compptr->width_in_blocks;
cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
-
+
/* For noninterleaved scan, always one block per MCU */
compptr->MCU_width = 1;
compptr->MCU_height = 1;
@@ -597,18 +597,18 @@ per_scan_setup (j_compress_ptr cinfo)
tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
if (tmp == 0) tmp = compptr->v_samp_factor;
compptr->last_row_height = tmp;
-
+
/* Prepare array describing MCU composition */
cinfo->blocks_in_MCU = 1;
cinfo->MCU_membership[0] = 0;
-
+
} else {
-
+
/* Interleaved (multi-component) scan */
if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
MAX_COMPS_IN_SCAN);
-
+
/* Overall image size in MCUs */
cinfo->MCUs_per_row = (JDIMENSION)
jdiv_round_up((long) cinfo->jpeg_width,
@@ -616,9 +616,9 @@ per_scan_setup (j_compress_ptr cinfo)
cinfo->MCU_rows_in_scan = (JDIMENSION)
jdiv_round_up((long) cinfo->jpeg_height,
(long) (cinfo->max_v_samp_factor * cinfo->block_size));
-
+
cinfo->blocks_in_MCU = 0;
-
+
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* Sampling factors give # of blocks of component in each MCU */
@@ -641,7 +641,7 @@ per_scan_setup (j_compress_ptr cinfo)
cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
}
}
-
+
}
/* Convert restart specified in rows to actual MCU count. */
diff --git a/src/lib/libjpeg/jcparam.c b/src/lib/libjpeg/jcparam.c
index c5e85dda550..e974fec994f 100644
--- a/src/lib/libjpeg/jcparam.c
+++ b/src/lib/libjpeg/jcparam.c
@@ -204,12 +204,12 @@ std_huff_tables (j_compress_ptr cinfo)
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_luminance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
-
+
static const UINT8 bits_dc_chrominance[17] =
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
static const UINT8 val_dc_chrominance[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
-
+
static const UINT8 bits_ac_luminance[17] =
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
static const UINT8 val_ac_luminance[] =
@@ -234,7 +234,7 @@ std_huff_tables (j_compress_ptr cinfo)
0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
-
+
static const UINT8 bits_ac_chrominance[17] =
{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };
static const UINT8 val_ac_chrominance[] =
@@ -259,7 +259,7 @@ std_huff_tables (j_compress_ptr cinfo)
0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa };
-
+
add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],
bits_dc_luminance, val_dc_luminance);
add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],
diff --git a/src/lib/libjpeg/jctrans.c b/src/lib/libjpeg/jctrans.c
index cee6b0f343f..dea0c3699a1 100644
--- a/src/lib/libjpeg/jctrans.c
+++ b/src/lib/libjpeg/jctrans.c
@@ -315,11 +315,11 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
xindex = 0;
}
/* Fill in any dummy blocks needed in this row.
- * Dummy blocks are filled in the same way as in jccoefct.c:
- * all zeroes in the AC entries, DC entries equal to previous
- * block's DC value. The init routine has already zeroed the
- * AC entries, so we need only set the DC entries correctly.
- */
+ * Dummy blocks are filled in the same way as in jccoefct.c:
+ * all zeroes in the AC entries, DC entries equal to previous
+ * block's DC value. The init routine has already zeroed the
+ * AC entries, so we need only set the DC entries correctly.
+ */
for (; xindex < compptr->MCU_width; xindex++) {
MCU_buffer[blkn] = coef->dummy_buffer[blkn];
MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];
diff --git a/src/lib/libjpeg/jdapimin.c b/src/lib/libjpeg/jdapimin.c
index 7f1ce4c05b2..8b4032b7f07 100644
--- a/src/lib/libjpeg/jdapimin.c
+++ b/src/lib/libjpeg/jdapimin.c
@@ -37,7 +37,7 @@ jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)
if (version != JPEG_LIB_VERSION)
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
if (structsize != SIZEOF(struct jpeg_decompress_struct))
- ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
+ ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
(int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);
/* For debugging purposes, we zero the whole master structure.
@@ -122,7 +122,7 @@ default_decompress_parms (j_decompress_ptr cinfo)
cinfo->jpeg_color_space = JCS_GRAYSCALE;
cinfo->out_color_space = JCS_GRAYSCALE;
break;
-
+
case 3:
if (cinfo->saw_JFIF_marker) {
cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */
@@ -157,7 +157,7 @@ default_decompress_parms (j_decompress_ptr cinfo)
/* Always guess RGB is proper output colorspace. */
cinfo->out_color_space = JCS_RGB;
break;
-
+
case 4:
if (cinfo->saw_Adobe_marker) {
switch (cinfo->Adobe_transform) {
@@ -178,7 +178,7 @@ default_decompress_parms (j_decompress_ptr cinfo)
}
cinfo->out_color_space = JCS_CMYK;
break;
-
+
default:
cinfo->jpeg_color_space = JCS_UNKNOWN;
cinfo->out_color_space = JCS_UNKNOWN;
diff --git a/src/lib/libjpeg/jdarith.c b/src/lib/libjpeg/jdarith.c
index c858b248b6b..d5c04953195 100644
--- a/src/lib/libjpeg/jdarith.c
+++ b/src/lib/libjpeg/jdarith.c
@@ -125,11 +125,11 @@ arith_decode (j_decompress_ptr cinfo, unsigned char *st)
data = 0xFF; /* discard stuffed zero byte */
else {
/* Note: Different from the Huffman decoder, hitting
- * a marker while processing the compressed data
- * segment is legal in arithmetic coding.
- * The convention is to supply zero data
- * then until decoding is complete.
- */
+ * a marker while processing the compressed data
+ * segment is legal in arithmetic coding.
+ * The convention is to supply zero data
+ * then until decoding is complete.
+ */
cinfo->unread_marker = data;
data = 0;
}
@@ -765,7 +765,7 @@ jinit_arith_decoder (j_decompress_ptr cinfo)
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components*DCTSIZE2*SIZEOF(int));
coef_bit_ptr = & cinfo->coef_bits[0][0];
- for (ci = 0; ci < cinfo->num_components; ci++)
+ for (ci = 0; ci < cinfo->num_components; ci++)
for (i = 0; i < DCTSIZE2; i++)
*coef_bit_ptr++ = -1;
}
diff --git a/src/lib/libjpeg/jdcoefct.c b/src/lib/libjpeg/jdcoefct.c
index 462e92c6125..1f0f442ab47 100644
--- a/src/lib/libjpeg/jdcoefct.c
+++ b/src/lib/libjpeg/jdcoefct.c
@@ -568,9 +568,9 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
DC9 = (int) next_block_row[1][0];
}
/* Compute coefficient estimates per K.8.
- * An estimate is applied only if coefficient is still zero,
- * and is not known to be fully accurate.
- */
+ * An estimate is applied only if coefficient is still zero,
+ * and is not known to be fully accurate.
+ */
/* AC01 */
if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {
num = 36 * Q00 * (DC4 - DC6);
diff --git a/src/lib/libjpeg/jdcolor.c b/src/lib/libjpeg/jdcolor.c
index 6c04dfe8aa1..66c219529e3 100644
--- a/src/lib/libjpeg/jdcolor.c
+++ b/src/lib/libjpeg/jdcolor.c
@@ -34,9 +34,9 @@ typedef my_color_deconverter * my_cconvert_ptr;
* YCbCr is defined per CCIR 601-1, except that Cb and Cr are
* normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
* The conversion equations to be implemented are therefore
- * R = Y + 1.40200 * Cr
- * G = Y - 0.34414 * Cb - 0.71414 * Cr
- * B = Y + 1.77200 * Cb
+ * R = Y + 1.40200 * Cr
+ * G = Y - 0.34414 * Cb - 0.71414 * Cr
+ * B = Y + 1.77200 * Cb
* where Cb and Cr represent the incoming values less CENTERJSAMPLE.
* (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
*
diff --git a/src/lib/libjpeg/jdct.h b/src/lib/libjpeg/jdct.h
index 360dec80c94..832c2cfee38 100644
--- a/src/lib/libjpeg/jdct.h
+++ b/src/lib/libjpeg/jdct.h
@@ -8,7 +8,7 @@
* This include file contains common declarations for the forward and
* inverse DCT modules. These declarations are private to the DCT managers
* (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.
- * The individual DCT algorithms are kept in separate files to ease
+ * The individual DCT algorithms are kept in separate files to ease
* machine-dependent tuning (e.g., assembly coding).
*/
diff --git a/src/lib/libjpeg/jddctmgr.c b/src/lib/libjpeg/jddctmgr.c
index 0ded9d57413..ecc21beb863 100644
--- a/src/lib/libjpeg/jddctmgr.c
+++ b/src/lib/libjpeg/jddctmgr.c
@@ -275,8 +275,8 @@ start_pass (j_decompress_ptr cinfo)
case JDCT_ISLOW:
{
/* For LL&M IDCT method, multipliers are equal to raw quantization
- * coefficients, but are stored as ints to ensure access efficiency.
- */
+ * coefficients, but are stored as ints to ensure access efficiency.
+ */
ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;
for (i = 0; i < DCTSIZE2; i++) {
ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i];
@@ -288,12 +288,12 @@ start_pass (j_decompress_ptr cinfo)
case JDCT_IFAST:
{
/* For AA&N IDCT method, multipliers are equal to quantization
- * coefficients scaled by scalefactor[row]*scalefactor[col], where
- * scalefactor[0] = 1
- * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
- * For integer operation, the multiplier table is to be scaled by
- * IFAST_SCALE_BITS.
- */
+ * coefficients scaled by scalefactor[row]*scalefactor[col], where
+ * scalefactor[0] = 1
+ * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
+ * For integer operation, the multiplier table is to be scaled by
+ * IFAST_SCALE_BITS.
+ */
IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;
#define CONST_BITS 14
static const INT16 aanscales[DCTSIZE2] = {
@@ -322,11 +322,11 @@ start_pass (j_decompress_ptr cinfo)
case JDCT_FLOAT:
{
/* For float AA&N IDCT method, multipliers are equal to quantization
- * coefficients scaled by scalefactor[row]*scalefactor[col], where
- * scalefactor[0] = 1
- * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
- * We apply a further scale factor of 1/8.
- */
+ * coefficients scaled by scalefactor[row]*scalefactor[col], where
+ * scalefactor[0] = 1
+ * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
+ * We apply a further scale factor of 1/8.
+ */
FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;
int row, col;
static const double aanscalefactor[DCTSIZE] = {
diff --git a/src/lib/libjpeg/jdhuff.c b/src/lib/libjpeg/jdhuff.c
index 06f92fe47f6..8f0581fa172 100644
--- a/src/lib/libjpeg/jdhuff.c
+++ b/src/lib/libjpeg/jdhuff.c
@@ -120,14 +120,14 @@ typedef struct { /* Bitreading working state within an MCU */
* before using GET_BITS, PEEK_BITS, or DROP_BITS.
* The variables get_buffer and bits_left are assumed to be locals,
* but the state struct might not be (jpeg_huff_decode needs this).
- * CHECK_BIT_BUFFER(state,n,action);
- * Ensure there are N bits in get_buffer; if suspend, take action.
+ * CHECK_BIT_BUFFER(state,n,action);
+ * Ensure there are N bits in get_buffer; if suspend, take action.
* val = GET_BITS(n);
- * Fetch next N bits.
+ * Fetch next N bits.
* val = PEEK_BITS(n);
- * Fetch next N bits without removing them from the buffer.
- * DROP_BITS(n);
- * Discard next N bits.
+ * Fetch next N bits without removing them from the buffer.
+ * DROP_BITS(n);
+ * Discard next N bits.
* The value N should be a simple variable, not an expression, because it
* is evaluated multiple times.
*/
@@ -350,7 +350,7 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
SIZEOF(d_derived_tbl));
dtbl = *pdtbl;
dtbl->pub = htbl; /* fill in back link */
-
+
/* Figure C.1: make table of Huffman code length for each symbol */
p = 0;
@@ -363,10 +363,10 @@ jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,
}
huffsize[p] = 0;
numsymbols = p;
-
+
/* Figure C.2: generate the codes themselves */
/* We also validate that the counts represent a legal Huffman code tree. */
-
+
code = 0;
si = huffsize[0];
p = 0;
@@ -493,10 +493,10 @@ jpeg_fill_bit_buffer (bitread_working_state * state,
/* If it's 0xFF, check and discard stuffed zero byte */
if (c == 0xFF) {
/* Loop here to discard any padding FF's on terminating marker,
- * so that we can save a valid unread_marker value. NOTE: we will
- * accept multiple FF's followed by a 0 as meaning a single FF data
- * byte. This data pattern is not valid according to the standard.
- */
+ * so that we can save a valid unread_marker value. NOTE: we will
+ * accept multiple FF's followed by a 0 as meaning a single FF data
+ * byte. This data pattern is not valid according to the standard.
+ */
do {
if (bytes_in_buffer == 0) {
if (! (*cinfo->src->fill_input_buffer) (cinfo))
@@ -513,13 +513,13 @@ jpeg_fill_bit_buffer (bitread_working_state * state,
c = 0xFF;
} else {
/* Oops, it's actually a marker indicating end of compressed data.
- * Save the marker code for later use.
- * Fine point: it might appear that we should save the marker into
- * bitread working state, not straight into permanent state. But
- * once we have hit a marker, we cannot need to suspend within the
- * current MCU, because we will read no more bytes from the data
- * source. So it is OK to update permanent state right away.
- */
+ * Save the marker code for later use.
+ * Fine point: it might appear that we should save the marker into
+ * bitread working state, not straight into permanent state. But
+ * once we have hit a marker, we cannot need to suspend within the
+ * current MCU, because we will read no more bytes from the data
+ * source. So it is OK to update permanent state right away.
+ */
cinfo->unread_marker = c;
/* See if we need to insert some fake zero bits. */
goto no_more_bytes;
@@ -671,7 +671,7 @@ process_restart (j_decompress_ptr cinfo)
/*
* Huffman MCU decoding.
* Each of these routines decodes and returns one MCU's worth of
- * Huffman-compressed coefficients.
+ * Huffman-compressed coefficients.
* The coefficients are reordered from zigzag order into natural array order,
* but are not dequantized.
*
@@ -693,7 +693,7 @@ process_restart (j_decompress_ptr cinfo)
METHODDEF(boolean)
decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
-{
+{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
int Al = cinfo->Al;
register int s, r;
@@ -764,7 +764,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
METHODDEF(boolean)
decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
-{
+{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
register int s, k, r;
unsigned int EOBRUN;
@@ -853,7 +853,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
METHODDEF(boolean)
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
-{
+{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
int blkn;
@@ -902,7 +902,7 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
METHODDEF(boolean)
decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
-{
+{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
register int s, k, r;
unsigned int EOBRUN;
@@ -976,9 +976,9 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
/* note s = 0 for processing ZRL */
}
/* Advance over already-nonzero coefs and r still-zero coefs,
- * appending correction bits to the nonzeroes. A correction bit is 1
- * if the absolute value of the coefficient must be increased.
- */
+ * appending correction bits to the nonzeroes. A correction bit is 1
+ * if the absolute value of the coefficient must be increased.
+ */
do {
thiscoef = *block + natural_order[k];
if (*thiscoef != 0) {
@@ -1127,9 +1127,9 @@ decode_mcu_sub (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
r = GET_BITS(s);
s = HUFF_EXTEND(r, s);
/* Output coefficient in natural (dezigzagged) order.
- * Note: the extra entries in natural_order[] will save us
- * if k > Se, which could happen if the data is corrupted.
- */
+ * Note: the extra entries in natural_order[] will save us
+ * if k > Se, which could happen if the data is corrupted.
+ */
(*block)[natural_order[k]] = (JCOEF) s;
} else {
if (r != 15)
@@ -1251,9 +1251,9 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
r = GET_BITS(s);
s = HUFF_EXTEND(r, s);
/* Output coefficient in natural (dezigzagged) order.
- * Note: the extra entries in jpeg_natural_order[] will save us
- * if k >= DCTSIZE2, which could happen if the data is corrupted.
- */
+ * Note: the extra entries in jpeg_natural_order[] will save us
+ * if k >= DCTSIZE2, which could happen if the data is corrupted.
+ */
(*block)[jpeg_natural_order[k]] = (JCOEF) s;
} else {
if (r != 15)
diff --git a/src/lib/libjpeg/jdinput.c b/src/lib/libjpeg/jdinput.c
index 2c5c717b9c3..2fcf04fdfc2 100644
--- a/src/lib/libjpeg/jdinput.c
+++ b/src/lib/libjpeg/jdinput.c
@@ -391,16 +391,16 @@ per_scan_setup (j_decompress_ptr cinfo)
{
int ci, mcublks, tmp;
jpeg_component_info *compptr;
-
+
if (cinfo->comps_in_scan == 1) {
-
+
/* Noninterleaved (single-component) scan */
compptr = cinfo->cur_comp_info[0];
-
+
/* Overall image size in MCUs */
cinfo->MCUs_per_row = compptr->width_in_blocks;
cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
-
+
/* For noninterleaved scan, always one block per MCU */
compptr->MCU_width = 1;
compptr->MCU_height = 1;
@@ -413,18 +413,18 @@ per_scan_setup (j_decompress_ptr cinfo)
tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
if (tmp == 0) tmp = compptr->v_samp_factor;
compptr->last_row_height = tmp;
-
+
/* Prepare array describing MCU composition */
cinfo->blocks_in_MCU = 1;
cinfo->MCU_membership[0] = 0;
-
+
} else {
-
+
/* Interleaved (multi-component) scan */
if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
MAX_COMPS_IN_SCAN);
-
+
/* Overall image size in MCUs */
cinfo->MCUs_per_row = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width,
@@ -432,9 +432,9 @@ per_scan_setup (j_decompress_ptr cinfo)
cinfo->MCU_rows_in_scan = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height,
(long) (cinfo->max_v_samp_factor * cinfo->block_size));
-
+
cinfo->blocks_in_MCU = 0;
-
+
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* Sampling factors give # of blocks of component in each MCU */
@@ -457,7 +457,7 @@ per_scan_setup (j_decompress_ptr cinfo)
cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
}
}
-
+
}
}
@@ -578,9 +578,9 @@ consume_markers (j_decompress_ptr cinfo)
}
inputctl->inheaders = 0;
/* Note: start_input_pass must be called by jdmaster.c
- * before any more input can be consumed. jdapimin.c is
- * responsible for enforcing this sequencing.
- */
+ * before any more input can be consumed. jdapimin.c is
+ * responsible for enforcing this sequencing.
+ */
} else { /* 2nd or later SOS marker */
if (! inputctl->pub.has_multiple_scans)
ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */
@@ -596,8 +596,8 @@ consume_markers (j_decompress_ptr cinfo)
ERREXIT(cinfo, JERR_SOF_NO_SOS);
} else {
/* Prevent infinite loop in coef ctlr's decompress_data routine
- * if user set output_scan_number larger than number of scans.
- */
+ * if user set output_scan_number larger than number of scans.
+ */
if (cinfo->output_scan_number > cinfo->input_scan_number)
cinfo->output_scan_number = cinfo->input_scan_number;
}
diff --git a/src/lib/libjpeg/jdmarker.c b/src/lib/libjpeg/jdmarker.c
index f2a9cc42951..a9268370fe3 100644
--- a/src/lib/libjpeg/jdmarker.c
+++ b/src/lib/libjpeg/jdmarker.c
@@ -23,24 +23,24 @@ typedef enum { /* JPEG marker codes */
M_SOF1 = 0xc1,
M_SOF2 = 0xc2,
M_SOF3 = 0xc3,
-
+
M_SOF5 = 0xc5,
M_SOF6 = 0xc6,
M_SOF7 = 0xc7,
-
+
M_JPG = 0xc8,
M_SOF9 = 0xc9,
M_SOF10 = 0xca,
M_SOF11 = 0xcb,
-
+
M_SOF13 = 0xcd,
M_SOF14 = 0xce,
M_SOF15 = 0xcf,
-
+
M_DHT = 0xc4,
-
+
M_DAC = 0xcc,
-
+
M_RST0 = 0xd0,
M_RST1 = 0xd1,
M_RST2 = 0xd2,
@@ -49,7 +49,7 @@ typedef enum { /* JPEG marker codes */
M_RST5 = 0xd5,
M_RST6 = 0xd6,
M_RST7 = 0xd7,
-
+
M_SOI = 0xd8,
M_EOI = 0xd9,
M_SOS = 0xda,
@@ -58,7 +58,7 @@ typedef enum { /* JPEG marker codes */
M_DRI = 0xdd,
M_DHP = 0xde,
M_EXP = 0xdf,
-
+
M_APP0 = 0xe0,
M_APP1 = 0xe1,
M_APP2 = 0xe2,
@@ -75,13 +75,13 @@ typedef enum { /* JPEG marker codes */
M_APP13 = 0xed,
M_APP14 = 0xee,
M_APP15 = 0xef,
-
+
M_JPG0 = 0xf0,
M_JPG13 = 0xfd,
M_COM = 0xfe,
-
+
M_TEM = 0x01,
-
+
M_ERROR = 0x100
} JPEG_MARKER;
@@ -199,7 +199,7 @@ get_soi (j_decompress_ptr cinfo)
/* Process an SOI marker */
{
int i;
-
+
TRACEMS(cinfo, 1, JTRC_SOI);
if (cinfo->marker->saw_SOI)
@@ -278,7 +278,7 @@ get_sof (j_decompress_ptr cinfo, boolean is_baseline, boolean is_prog,
cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components * SIZEOF(jpeg_component_info));
-
+
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
compptr->component_index = ci;
@@ -330,7 +330,7 @@ get_sos (j_decompress_ptr cinfo)
for (i = 0; i < n; i++) {
INPUT_BYTE(cinfo, cc, return FALSE);
INPUT_BYTE(cinfo, c, return FALSE);
-
+
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
if (cc == compptr->component_id)
@@ -344,7 +344,7 @@ get_sos (j_decompress_ptr cinfo)
cinfo->cur_comp_info[i] = compptr;
compptr->dc_tbl_no = (c >> 4) & 15;
compptr->ac_tbl_no = (c ) & 15;
-
+
TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
compptr->dc_tbl_no, compptr->ac_tbl_no);
}
@@ -384,7 +384,7 @@ get_dac (j_decompress_ptr cinfo)
INPUT_2BYTES(cinfo, length, return FALSE);
length -= 2;
-
+
while (length > 0) {
INPUT_BYTE(cinfo, index, return FALSE);
INPUT_BYTE(cinfo, val, return FALSE);
@@ -433,12 +433,12 @@ get_dht (j_decompress_ptr cinfo)
INPUT_2BYTES(cinfo, length, return FALSE);
length -= 2;
-
+
while (length > 16) {
INPUT_BYTE(cinfo, index, return FALSE);
TRACEMS1(cinfo, 1, JTRC_DHT, index);
-
+
bits[0] = 0;
count = 0;
for (i = 1; i <= 16; i++) {
@@ -478,7 +478,7 @@ get_dht (j_decompress_ptr cinfo)
if (*htblptr == NULL)
*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
-
+
MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));
MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval));
}
@@ -515,7 +515,7 @@ get_dqt (j_decompress_ptr cinfo)
if (n >= NUM_QUANT_TBLS)
ERREXIT1(cinfo, JERR_DQT_INDEX, n);
-
+
if (cinfo->quant_tbl_ptrs[n] == NULL)
cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo);
quant_ptr = cinfo->quant_tbl_ptrs[n];
@@ -590,7 +590,7 @@ get_dri (j_decompress_ptr cinfo)
INPUT_VARS(cinfo);
INPUT_2BYTES(cinfo, length, return FALSE);
-
+
if (length != 4)
ERREXIT(cinfo, JERR_BAD_LENGTH);
@@ -887,7 +887,7 @@ skip_variable (j_decompress_ptr cinfo)
INPUT_2BYTES(cinfo, length, return FALSE);
length -= 2;
-
+
TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length);
INPUT_SYNC(cinfo); /* do before skip_input_data */
@@ -1059,32 +1059,32 @@ read_markers (j_decompress_ptr cinfo)
return JPEG_SUSPENDED;
cinfo->unread_marker = 0; /* processed the marker */
return JPEG_REACHED_SOS;
-
+
case M_EOI:
TRACEMS(cinfo, 1, JTRC_EOI);
cinfo->unread_marker = 0; /* processed the marker */
return JPEG_REACHED_EOI;
-
+
case M_DAC:
if (! get_dac(cinfo))
return JPEG_SUSPENDED;
break;
-
+
case M_DHT:
if (! get_dht(cinfo))
return JPEG_SUSPENDED;
break;
-
+
case M_DQT:
if (! get_dqt(cinfo))
return JPEG_SUSPENDED;
break;
-
+
case M_DRI:
if (! get_dri(cinfo))
return JPEG_SUSPENDED;
break;
-
+
case M_APP0:
case M_APP1:
case M_APP2:
@@ -1105,7 +1105,7 @@ read_markers (j_decompress_ptr cinfo)
cinfo->unread_marker - (int) M_APP0]) (cinfo))
return JPEG_SUSPENDED;
break;
-
+
case M_COM:
if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo))
return JPEG_SUSPENDED;
@@ -1239,10 +1239,10 @@ jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)
{
int marker = cinfo->unread_marker;
int action = 1;
-
+
/* Always put up a warning. */
WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);
-
+
/* Outer loop handles repeated decision after scanning forward. */
for (;;) {
if (marker < (int) M_SOF0)
diff --git a/src/lib/libjpeg/jdmaster.c b/src/lib/libjpeg/jdmaster.c
index 8c1146e4fe1..ba667eb65c1 100644
--- a/src/lib/libjpeg/jdmaster.c
+++ b/src/lib/libjpeg/jdmaster.c
@@ -191,20 +191,20 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
* processes are inner loops and need to be as fast as possible. On most
* machines, particularly CPUs with pipelines or instruction prefetch,
* a (subscript-check-less) C table lookup
- * x = sample_range_limit[x];
+ * x = sample_range_limit[x];
* is faster than explicit tests
- * if (x < 0) x = 0;
- * else if (x > MAXJSAMPLE) x = MAXJSAMPLE;
+ * if (x < 0) x = 0;
+ * else if (x > MAXJSAMPLE) x = MAXJSAMPLE;
* These processes all use a common table prepared by the routine below.
*
* For most steps we can mathematically guarantee that the initial value
* of x is within MAXJSAMPLE+1 of the legal range, so a table running from
* -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial
- * limiting step (just after the IDCT), a wildly out-of-range value is
+ * limiting step (just after the IDCT), a wildly out-of-range value is
* possible if the input data is corrupt. To avoid any chance of indexing
* off the end of memory and getting a bad-pointer trap, we perform the
* post-IDCT limiting thus:
- * x = range_limit[x & MASK];
+ * x = range_limit[x & MASK];
* where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
* samples. Under normal circumstances this is more than enough range and
* a correct output will be generated; with bogus input data the mask will
diff --git a/src/lib/libjpeg/jdmerge.c b/src/lib/libjpeg/jdmerge.c
index 37444468c23..c421f45e972 100644
--- a/src/lib/libjpeg/jdmerge.c
+++ b/src/lib/libjpeg/jdmerge.c
@@ -14,19 +14,19 @@
* (ie, box filtering), we can save some work in color conversion by
* calculating all the output pixels corresponding to a pair of chroma
* samples at one time. In the conversion equations
- * R = Y + K1 * Cr
- * G = Y + K2 * Cb + K3 * Cr
- * B = Y + K4 * Cb
+ * R = Y + K1 * Cr
+ * G = Y + K2 * Cb + K3 * Cr
+ * B = Y + K4 * Cb
* only the Y term varies among the group of pixels corresponding to a pair
* of chroma samples, so the rest of the terms can be calculated just once.
* At typical sampling ratios, this eliminates half or three-quarters of the
* multiplications needed for color conversion.
*
* This file currently provides implementations for the following cases:
- * YCbCr => RGB color conversion only.
- * Sampling ratios of 2h1v or 2h2v.
- * No scaling needed at upsample time.
- * Corner-aligned (non-CCIR601) sampling alignment.
+ * YCbCr => RGB color conversion only.
+ * Sampling ratios of 2h1v or 2h2v.
+ * No scaling needed at upsample time.
+ * Corner-aligned (non-CCIR601) sampling alignment.
* Other special cases could be added, but in most applications these are
* the only common cases. (For uncommon cases we fall back on the more
* general code in jdsample.c and jdcolor.c.)
diff --git a/src/lib/libjpeg/jdsample.c b/src/lib/libjpeg/jdsample.c
index 7bc8885b02e..1be3f725582 100644
--- a/src/lib/libjpeg/jdsample.c
+++ b/src/lib/libjpeg/jdsample.c
@@ -119,7 +119,7 @@ sep_upsample (j_decompress_ptr cinfo,
/* Not more than the distance to the end of the image. Need this test
* in case the image height is not a multiple of max_v_samp_factor:
*/
- if (num_rows > upsample->rows_to_go)
+ if (num_rows > upsample->rows_to_go)
num_rows = upsample->rows_to_go;
/* And not more than what the client can accept: */
out_rows_avail -= *out_row_ctr;
diff --git a/src/lib/libjpeg/jerror.c b/src/lib/libjpeg/jerror.c
index 3da7be86a00..d63d8b10e6a 100644
--- a/src/lib/libjpeg/jerror.c
+++ b/src/lib/libjpeg/jerror.c
@@ -220,10 +220,10 @@ reset_error_mgr (j_common_ptr cinfo)
/*
* Fill in the standard error-handling methods in a jpeg_error_mgr object.
* Typical call is:
- * struct jpeg_compress_struct cinfo;
- * struct jpeg_error_mgr err;
+ * struct jpeg_compress_struct cinfo;
+ * struct jpeg_error_mgr err;
*
- * cinfo.err = jpeg_std_error(&err);
+ * cinfo.err = jpeg_std_error(&err);
* after which the application may override some of the methods.
*/
diff --git a/src/lib/libjpeg/jidctflt.c b/src/lib/libjpeg/jidctflt.c
index 23ae9d333b7..ae040eab77e 100644
--- a/src/lib/libjpeg/jidctflt.c
+++ b/src/lib/libjpeg/jidctflt.c
@@ -95,14 +95,14 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* With typical images and quantization tables, half or more of the
* column DCT calculations can be simplified this way.
*/
-
+
if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
inptr[DCTSIZE*7] == 0) {
/* AC terms all zero */
FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
-
+
wsptr[DCTSIZE*0] = dcval;
wsptr[DCTSIZE*1] = dcval;
wsptr[DCTSIZE*2] = dcval;
@@ -111,13 +111,13 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
wsptr[DCTSIZE*5] = dcval;
wsptr[DCTSIZE*6] = dcval;
wsptr[DCTSIZE*7] = dcval;
-
+
inptr++; /* advance pointers to next column */
quantptr++;
wsptr++;
continue;
}
-
+
/* Even part */
tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
@@ -135,7 +135,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp3 = tmp10 - tmp13;
tmp1 = tmp11 + tmp12;
tmp2 = tmp11 - tmp12;
-
+
/* Odd part */
tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
@@ -172,7 +172,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
quantptr++;
wsptr++;
}
-
+
/* Pass 2: process rows from work array, store into output array. */
wsptr = workspace;
@@ -183,7 +183,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* the simplification applies less often (typically 5% to 10% of the time).
* And testing floats for zero is relatively expensive, so we don't bother.
*/
-
+
/* Even part */
/* Apply signed->unsigned and prepare float->int conversion */
@@ -227,7 +227,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
outptr[5] = range_limit[((int) (tmp2 - tmp5)) & RANGE_MASK];
outptr[3] = range_limit[((int) (tmp3 + tmp4)) & RANGE_MASK];
outptr[4] = range_limit[((int) (tmp3 - tmp4)) & RANGE_MASK];
-
+
wsptr += DCTSIZE; /* advance pointer to next row */
}
}
diff --git a/src/lib/libjpeg/jidctfst.c b/src/lib/libjpeg/jidctfst.c
index dba4216fb95..af3f7733d03 100644
--- a/src/lib/libjpeg/jidctfst.c
+++ b/src/lib/libjpeg/jidctfst.c
@@ -196,7 +196,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* With typical images and quantization tables, half or more of the
* column DCT calculations can be simplified this way.
*/
-
+
if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
@@ -212,13 +212,13 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
wsptr[DCTSIZE*5] = dcval;
wsptr[DCTSIZE*6] = dcval;
wsptr[DCTSIZE*7] = dcval;
-
+
inptr++; /* advance pointers to next column */
quantptr++;
wsptr++;
continue;
}
-
+
/* Even part */
tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
@@ -236,7 +236,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp3 = tmp10 - tmp13;
tmp1 = tmp11 + tmp12;
tmp2 = tmp11 - tmp12;
-
+
/* Odd part */
tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
@@ -273,7 +273,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
quantptr++;
wsptr++;
}
-
+
/* Pass 2: process rows from work array, store into output array. */
/* Note that we must descale the results by a factor of 8 == 2**3, */
/* and also undo the PASS1_BITS scaling. */
@@ -288,14 +288,14 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* test takes more time than it's worth. In that case this section
* may be commented out.
*/
-
+
#ifndef NO_ZERO_ROW_TEST
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
/* AC terms all zero */
JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)
& RANGE_MASK];
-
+
outptr[0] = dcval;
outptr[1] = dcval;
outptr[2] = dcval;
@@ -309,7 +309,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
continue;
}
#endif
-
+
/* Even part */
tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);
diff --git a/src/lib/libjpeg/jidctint.c b/src/lib/libjpeg/jidctint.c
index dcdf7ce4547..07096b1081f 100644
--- a/src/lib/libjpeg/jidctint.c
+++ b/src/lib/libjpeg/jidctint.c
@@ -225,7 +225,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part: reverse the even part of the forward DCT. */
/* The rotator is sqrt(2)*c(-6). */
-
+
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
@@ -256,7 +256,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
-
+
z2 = tmp0 + tmp2;
z3 = tmp1 + tmp3;
@@ -288,7 +288,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
-
+
inptr++; /* advance pointers to next column */
quantptr++;
wsptr++;
@@ -332,7 +332,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Even part: reverse the even part of the forward DCT. */
/* The rotator is sqrt(2)*c(-6). */
-
+
z2 = (INT32) wsptr[2];
z3 = (INT32) wsptr[6];
@@ -346,7 +346,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = (z2 + z3) << CONST_BITS;
tmp1 = (z2 - z3) << CONST_BITS;
-
+
tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3;
@@ -835,7 +835,7 @@ jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
-
+
tmp10 = (tmp0 + tmp2) << PASS1_BITS;
tmp12 = (tmp0 - tmp2) << PASS1_BITS;
@@ -2851,14 +2851,14 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
* With typical images and quantization tables, half or more of the
* column DCT calculations can be simplified this way.
*/
-
+
if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&
inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&
inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&
inptr[DCTSIZE*7] == 0) {
/* AC terms all zero */
int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;
-
+
wsptr[DCTSIZE*0] = dcval;
wsptr[DCTSIZE*1] = dcval;
wsptr[DCTSIZE*2] = dcval;
@@ -2867,23 +2867,23 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
wsptr[DCTSIZE*5] = dcval;
wsptr[DCTSIZE*6] = dcval;
wsptr[DCTSIZE*7] = dcval;
-
+
inptr++; /* advance pointers to next column */
quantptr++;
wsptr++;
continue;
}
-
+
/* Even part: reverse the even part of the forward DCT. */
/* The rotator is sqrt(2)*c(-6). */
-
+
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
-
+
z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
-
+
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
z2 <<= CONST_BITS;
@@ -2893,21 +2893,21 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = z2 + z3;
tmp1 = z2 - z3;
-
+
tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3;
tmp12 = tmp1 - tmp3;
-
+
/* Odd part per figure 8; the matrix is unitary and hence its
* transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
*/
-
+
tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);
tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);
tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);
tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);
-
+
z2 = tmp0 + tmp2;
z3 = tmp1 + tmp3;
@@ -2928,9 +2928,9 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
tmp1 += z1 + z3;
tmp2 += z1 + z2;
-
+
/* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
+
wsptr[DCTSIZE*0] = (int) RIGHT_SHIFT(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
wsptr[DCTSIZE*7] = (int) RIGHT_SHIFT(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
wsptr[DCTSIZE*1] = (int) RIGHT_SHIFT(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
@@ -2939,7 +2939,7 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
wsptr[DCTSIZE*5] = (int) RIGHT_SHIFT(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
wsptr[DCTSIZE*3] = (int) RIGHT_SHIFT(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
wsptr[DCTSIZE*4] = (int) RIGHT_SHIFT(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
-
+
inptr++; /* advance pointers to next column */
quantptr++;
wsptr++;
@@ -3688,18 +3688,18 @@ jpeg_idct_8x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
z2 = (INT32) wsptr[2];
z3 = (INT32) wsptr[6];
-
+
z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
-
+
/* Add fudge factor here for final descale. */
z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
z3 = (INT32) wsptr[4];
-
+
tmp0 = (z2 + z3) << CONST_BITS;
tmp1 = (z2 - z3) << CONST_BITS;
-
+
tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3;
@@ -3819,7 +3819,7 @@ jpeg_idct_6x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
wsptr[6*2] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);
wsptr[6*1] = (int) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS);
}
-
+
/* Pass 2: process 3 rows from work array, store into output array.
* 6-point IDCT kernel, cK represents sqrt(2) * cos(K*pi/12).
*/
@@ -4134,7 +4134,7 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
wsptr[8*7] = (int) RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS);
wsptr[8*8] = (int) RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS);
}
-
+
/* Pass 2: process rows from work array, store into output array. */
/* Note that we must descale the results by a factor of 8 == 2**3, */
/* and also undo the PASS1_BITS scaling. */
@@ -4142,38 +4142,38 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
wsptr = workspace;
for (ctr = 0; ctr < 16; ctr++) {
outptr = output_buf[ctr] + output_col;
-
+
/* Even part: reverse the even part of the forward DCT. */
/* The rotator is sqrt(2)*c(-6). */
-
+
z2 = (INT32) wsptr[2];
z3 = (INT32) wsptr[6];
-
+
z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
-
+
/* Add fudge factor here for final descale. */
z2 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));
z3 = (INT32) wsptr[4];
-
+
tmp0 = (z2 + z3) << CONST_BITS;
tmp1 = (z2 - z3) << CONST_BITS;
-
+
tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3;
tmp12 = tmp1 - tmp3;
-
+
/* Odd part per figure 8; the matrix is unitary and hence its
* transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively.
*/
-
+
tmp0 = (INT32) wsptr[7];
tmp1 = (INT32) wsptr[5];
tmp2 = (INT32) wsptr[3];
tmp3 = (INT32) wsptr[1];
-
+
z2 = tmp0 + tmp2;
z3 = tmp1 + tmp3;
@@ -4194,9 +4194,9 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */
tmp1 += z1 + z3;
tmp2 += z1 + z2;
-
+
/* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
-
+
outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp3,
CONST_BITS+PASS1_BITS+3)
& RANGE_MASK];
@@ -4221,7 +4221,7 @@ jpeg_idct_8x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp0,
CONST_BITS+PASS1_BITS+3)
& RANGE_MASK];
-
+
wsptr += DCTSIZE; /* advance pointer to next row */
}
}
@@ -4794,11 +4794,11 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
-
+
z1 = MULTIPLY(z2 + z3, FIX_0_541196100);
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865);
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065);
-
+
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
z2 <<= CONST_BITS;
@@ -4808,7 +4808,7 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = z2 + z3;
tmp1 = z2 - z3;
-
+
tmp10 = tmp0 + tmp2;
tmp13 = tmp0 - tmp2;
tmp11 = tmp1 + tmp3;
@@ -4900,7 +4900,7 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,
CONST_BITS+PASS1_BITS+3)
& RANGE_MASK];
-
+
wsptr += 4; /* advance pointer to next row */
}
}
@@ -5116,7 +5116,7 @@ jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
/* Even part */
-
+
tmp10 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]);
/* Add fudge factor here for final descale. */
tmp10 += ONE << 2;
diff --git a/src/lib/libjpeg/jmemmgr.c b/src/lib/libjpeg/jmemmgr.c
index d801b322da0..06a4ad24c19 100644
--- a/src/lib/libjpeg/jmemmgr.c
+++ b/src/lib/libjpeg/jmemmgr.c
@@ -238,13 +238,13 @@ out_of_memory (j_common_ptr cinfo, int which)
* machines, but may be too small if longs are 64 bits or more.
*/
-static const size_t first_pool_slop[JPOOL_NUMPOOLS] =
+static const size_t first_pool_slop[JPOOL_NUMPOOLS] =
{
1600, /* first PERMANENT pool */
16000 /* first IMAGE pool */
};
-static const size_t extra_pool_slop[JPOOL_NUMPOOLS] =
+static const size_t extra_pool_slop[JPOOL_NUMPOOLS] =
{
0, /* additional PERMANENT pools */
5000 /* additional IMAGE pools */
diff --git a/src/lib/libjpeg/jpeglib.h b/src/lib/libjpeg/jpeglib.h
index 1eb1fac033f..9f57e8d596c 100644
--- a/src/lib/libjpeg/jpeglib.h
+++ b/src/lib/libjpeg/jpeglib.h
@@ -137,9 +137,9 @@ typedef struct {
/* The decompressor output side may not use these variables. */
int dc_tbl_no; /* DC entropy table selector (0..3) */
int ac_tbl_no; /* AC entropy table selector (0..3) */
-
+
/* Remaining fields should be treated as private by applications. */
-
+
/* These values are computed during compression or decompression startup: */
/* Component's size in DCT blocks.
* Any dummy blocks added to complete an MCU are not counted; therefore
@@ -369,7 +369,7 @@ struct jpeg_compress_struct {
UINT16 X_density; /* Horizontal pixel density */
UINT16 Y_density; /* Vertical pixel density */
boolean write_Adobe_marker; /* should an Adobe marker be written? */
-
+
/* State variable: index of next scanline to be written to
* jpeg_write_scanlines(). Application may use this to control its
* processing loop, e.g., "while (next_scanline < image_height)".
@@ -397,7 +397,7 @@ struct jpeg_compress_struct {
* There are v_samp_factor * DCTSIZE sample rows of each component in an
* "iMCU" (interleaved MCU) row.
*/
-
+
/*
* These fields are valid during any one scan.
* They describe the components and MCUs actually appearing in the scan.
@@ -405,10 +405,10 @@ struct jpeg_compress_struct {
int comps_in_scan; /* # of JPEG components in this scan */
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
/* *cur_comp_info[i] describes component that appears i'th in SOS */
-
+
JDIMENSION MCUs_per_row; /* # of MCUs across the image */
JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
-
+
int blocks_in_MCU; /* # of DCT blocks per MCU */
int MCU_membership[C_MAX_BLOCKS_IN_MCU];
/* MCU_membership[i] is index in cur_comp_info of component owning */
@@ -691,7 +691,7 @@ struct jpeg_error_mgr {
#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
/* Reset error state variables at start of a new image */
JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
-
+
/* The message ID code and any parameters are saved here.
* A message can have one string parameter or up to 8 int parameters.
*/
@@ -701,11 +701,11 @@ struct jpeg_error_mgr {
int i[8];
char s[JMSG_STR_PARM_MAX];
} msg_parm;
-
+
/* Standard state variables for error facility */
-
+
int trace_level; /* max msg_level that will be displayed */
-
+
/* For recoverable corrupt-data errors, we emit a warning message,
* but keep going unless emit_message chooses to abort. emit_message
* should count warnings in num_warnings. The surrounding application
@@ -863,7 +863,7 @@ typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
/* Short forms of external names for systems with brain-damaged linkers.
* We shorten external names to be unique in the first six letters, which
* is good enough for all known systems.
- * (If your compiler itself needs names to be unique in less than 15
+ * (If your compiler itself needs names to be unique in less than 15
* characters, you are out of luck. Get a better compiler.)
*/
@@ -1049,7 +1049,7 @@ EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
/* Return value is one of: */
-/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */
+/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */
#define JPEG_REACHED_SOS 1 /* Reached start of new scan */
#define JPEG_REACHED_EOI 2 /* Reached end of image */
#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */
diff --git a/src/lib/libjpeg/jpegtran.c b/src/lib/libjpeg/jpegtran.c
index 8cb3d807fbb..fb24a43e346 100644
--- a/src/lib/libjpeg/jpegtran.c
+++ b/src/lib/libjpeg/jpegtran.c
@@ -378,7 +378,7 @@ main (int argc, char **argv)
jvirt_barray_ptr * dst_coef_arrays;
int file_index;
/* We assume all-in-memory processing and can therefore use only a
- * single file pointer for sequential input and output operation.
+ * single file pointer for sequential input and output operation.
*/
FILE * fp;
diff --git a/src/lib/libjpeg/jquant1.c b/src/lib/libjpeg/jquant1.c
index b2f96aa15d2..40c4cf45f31 100644
--- a/src/lib/libjpeg/jquant1.c
+++ b/src/lib/libjpeg/jquant1.c
@@ -105,8 +105,8 @@ static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = {
* Errors are accumulated into the array fserrors[], at a resolution of
* 1/16th of a pixel count. The error at a given pixel is propagated
* to its not-yet-processed neighbors using the standard F-S fractions,
- * ... (here) 7/16
- * 3/16 5/16 1/16
+ * ... (here) 7/16
+ * 3/16 5/16 1/16
* We work left-to-right on even rows, right-to-left on odd rows.
*
* We can get away with a single array (holding one row's worth of errors)
@@ -424,7 +424,7 @@ make_odither_array (j_decompress_ptr cinfo, int ncolors)
/*
* Create the ordered-dither tables.
- * Components having the same number of representative colors may
+ * Components having the same number of representative colors may
* share a dither table.
*/
@@ -542,12 +542,12 @@ quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
for (col = width; col > 0; col--) {
/* Form pixel value + dither, range-limit to 0..MAXJSAMPLE,
- * select output value, accumulate into output code for this pixel.
- * Range-limiting need not be done explicitly, as we have extended
- * the colorindex table to produce the right answers for out-of-range
- * inputs. The maximum dither is +- MAXJSAMPLE; this sets the
- * required amount of padding.
- */
+ * select output value, accumulate into output code for this pixel.
+ * Range-limiting need not be done explicitly, as we have extended
+ * the colorindex table to produce the right answers for out-of-range
+ * inputs. The maximum dither is +- MAXJSAMPLE; this sets the
+ * required amount of padding.
+ */
*output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];
input_ptr += nc;
output_ptr++;
@@ -662,18 +662,18 @@ quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
for (col = width; col > 0; col--) {
/* cur holds the error propagated from the previous pixel on the
- * current line. Add the error propagated from the previous line
- * to form the complete error correction term for this pixel, and
- * round the error term (which is expressed * 16) to an integer.
- * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct
- * for either sign of the error value.
- * Note: errorptr points to *previous* column's array entry.
- */
+ * current line. Add the error propagated from the previous line
+ * to form the complete error correction term for this pixel, and
+ * round the error term (which is expressed * 16) to an integer.
+ * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct
+ * for either sign of the error value.
+ * Note: errorptr points to *previous* column's array entry.
+ */
cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4);
/* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.
- * The maximum error is +- MAXJSAMPLE; this sets the required size
- * of the range_limit array.
- */
+ * The maximum error is +- MAXJSAMPLE; this sets the required size
+ * of the range_limit array.
+ */
cur += GETJSAMPLE(*input_ptr);
cur = GETJSAMPLE(range_limit[cur]);
/* Select output value, accumulate into output code for this pixel */
@@ -684,9 +684,9 @@ quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
/* pixel code, because the colormap is orthogonal. */
cur -= GETJSAMPLE(colormap_ci[pixcode]);
/* Compute error fractions to be propagated to adjacent pixels.
- * Add these into the running sums, and simultaneously shift the
- * next-line error sums left by 1 column.
- */
+ * Add these into the running sums, and simultaneously shift the
+ * next-line error sums left by 1 column.
+ */
bnexterr = cur;
delta = cur * 2;
cur += delta; /* form error * 3 */
@@ -696,9 +696,9 @@ quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
belowerr = bnexterr;
cur += delta; /* form error * 7 */
/* At this point cur contains the 7/16 error value to be propagated
- * to the next pixel on the current line, and all the errors for the
- * next line have been shifted over. We are therefore ready to move on.
- */
+ * to the next pixel on the current line, and all the errors for the
+ * next line have been shifted over. We are therefore ready to move on.
+ */
input_ptr += dirnc; /* advance input ptr to next column */
output_ptr += dir; /* advance output ptr to next column */
errorptr += dir; /* advance errorptr to current column */
diff --git a/src/lib/libjpeg/jquant2.c b/src/lib/libjpeg/jquant2.c
index af601e334b2..abd0a3db9bd 100644
--- a/src/lib/libjpeg/jquant2.c
+++ b/src/lib/libjpeg/jquant2.c
@@ -41,7 +41,7 @@
* color space, and repeatedly splits the "largest" remaining box until we
* have as many boxes as desired colors. Then the mean color in each
* remaining box becomes one of the possible output colors.
- *
+ *
* The second pass over the image maps each input pixel to the closest output
* color (optionally after applying a Floyd-Steinberg dithering correction).
* This mapping is logically trivial, but making it go fast enough requires
@@ -158,8 +158,8 @@ typedef hist2d * hist3d; /* type for top-level pointer */
* Errors are accumulated into the array fserrors[], at a resolution of
* 1/16th of a pixel count. The error at a given pixel is propagated
* to its not-yet-processed neighbors using the standard F-S fractions,
- * ... (here) 7/16
- * 3/16 5/16 1/16
+ * ... (here) 7/16
+ * 3/16 5/16 1/16
* We work left-to-right on even rows, right-to-left on odd rows.
*
* We can get away with a single array (holding one row's worth of errors)
@@ -278,7 +278,7 @@ find_biggest_color_pop (boxptr boxlist, int numboxes)
register int i;
register long maxc = 0;
boxptr which = NULL;
-
+
for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
if (boxp->colorcount > maxc && boxp->volume > 0) {
which = boxp;
@@ -298,7 +298,7 @@ find_biggest_volume (boxptr boxlist, int numboxes)
register int i;
register INT32 maxv = 0;
boxptr which = NULL;
-
+
for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
if (boxp->volume > maxv) {
which = boxp;
@@ -321,11 +321,11 @@ update_box (j_decompress_ptr cinfo, boxptr boxp)
int c0min,c0max,c1min,c1max,c2min,c2max;
INT32 dist0,dist1,dist2;
long ccount;
-
+
c0min = boxp->c0min; c0max = boxp->c0max;
c1min = boxp->c1min; c1max = boxp->c1max;
c2min = boxp->c2min; c2max = boxp->c2max;
-
+
if (c0max > c0min)
for (c0 = c0min; c0 <= c0max; c0++)
for (c1 = c1min; c1 <= c1max; c1++) {
@@ -405,7 +405,7 @@ update_box (j_decompress_ptr cinfo, boxptr boxp)
dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE;
dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE;
boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2;
-
+
/* Now scan remaining volume of box and compute population */
ccount = 0;
for (c0 = c0min; c0 <= c0max; c0++)
@@ -511,11 +511,11 @@ compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)
long c0total = 0;
long c1total = 0;
long c2total = 0;
-
+
c0min = boxp->c0min; c0max = boxp->c0max;
c1min = boxp->c1min; c1max = boxp->c1max;
c2min = boxp->c2min; c2max = boxp->c2max;
-
+
for (c0 = c0min; c0 <= c0max; c0++)
for (c1 = c1min; c1 <= c1max; c1++) {
histp = & histogram[c0][c1][c2min];
@@ -528,7 +528,7 @@ compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)
}
}
}
-
+
cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);
cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);
cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);
@@ -797,17 +797,17 @@ find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
bptr = bestdist;
for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--)
*bptr++ = 0x7FFFFFFFL;
-
+
/* For each color selected by find_nearby_colors,
* compute its distance to the center of each cell in the box.
* If that's less than best-so-far, update best distance and color number.
*/
-
+
/* Nominal steps between cell centers ("x" in Thomas article) */
#define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE)
#define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE)
#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE)
-
+
for (i = 0; i < numcolors; i++) {
icolor = GETJSAMPLE(colorlist[i]);
/* Compute (square of) distance from minc0/c1/c2 to this color */
@@ -881,7 +881,7 @@ fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)
minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1);
minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1);
minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1);
-
+
/* Determine which colormap entries are close enough to be candidates
* for the nearest entry to some cell in the update box.
*/
diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c
index ccc5c058d3c..070d097ac9e 100644
--- a/src/lib/util/chd.c
+++ b/src/lib/util/chd.c
@@ -2142,7 +2142,7 @@ static chd_error hunk_write_from_memory(chd_file *chd, UINT32 hunknum, const UIN
offset++;
}
for (secoff=0;secoff<CD_MAX_SUBCODE_DATA;secoff++)
- {
+ {
if (src[offset]!=0x00)
is_likely_cd = false;
@@ -2171,13 +2171,13 @@ static chd_error hunk_write_from_memory(chd_file *chd, UINT32 hunknum, const UIN
tempbytes = bytes;
temperror = err;
tempstrategy = 0;
- }
+ }
/* try strategy 1 - flac */
if (chd->codecintf->secondary_compress != NULL)
{
strategy = 1;
-
+
err = (*chd->codecintf->secondary_compress)(chd, src, &bytes);
/* check against previous compression attempt if that was successful */
@@ -2217,7 +2217,7 @@ static chd_error hunk_write_from_memory(chd_file *chd, UINT32 hunknum, const UIN
{
data = chd->compressed;
newentry.length = bytes;
-
+
if (strategy == 0)
{
newentry.flags = MAP_ENTRY_TYPE_COMPRESSED;
@@ -3085,7 +3085,7 @@ static chd_error flac_codec_compress(chd_file *chd, const void *src, UINT32 *len
printf("ERROR: allocating encoder\n");
return CHDERR_COMPRESSION_ERROR;
}
-
+
ok &= FLAC__stream_encoder_set_verify(encoder, false); // we trust libFLAC ;-)
ok &= FLAC__stream_encoder_set_compression_level(encoder, 8);
ok &= FLAC__stream_encoder_set_channels(encoder, 2);
@@ -3094,7 +3094,7 @@ static chd_error flac_codec_compress(chd_file *chd, const void *src, UINT32 *len
ok &= FLAC__stream_encoder_set_total_samples_estimate(encoder, 0);
ok &= FLAC__stream_encoder_set_streamable_subset(encoder, false);
ok &= FLAC__stream_encoder_set_blocksize(encoder, ((CD_MAX_SECTOR_DATA)*CD_FRAMES_PER_HUNK) );
-
+
if (!ok)
{
printf("error setting up stream encoder\n");
@@ -3121,7 +3121,7 @@ static chd_error flac_codec_compress(chd_file *chd, const void *src, UINT32 *len
if (!swap) flac_encoder_client_ptr->pcm[i] = (FLAC__int32)(((FLAC__int16)(FLAC__int8)flac_encoder_client_ptr->tempbuffer[2*i] << 8) | (FLAC__int16)flac_encoder_client_ptr->tempbuffer[2*i+1]);
else flac_encoder_client_ptr->pcm[i] = (FLAC__int32)(((FLAC__int16)(FLAC__int8)flac_encoder_client_ptr->tempbuffer[2*i+1] << 8) | (FLAC__int16)flac_encoder_client_ptr->tempbuffer[2*i]);
}
-
+
ok = FLAC__stream_encoder_process_interleaved(encoder, flac_encoder_client_ptr->pcm, FLAC_ENCODER_READSIZE);
}
@@ -3142,10 +3142,10 @@ static chd_error flac_codec_compress(chd_file *chd, const void *src, UINT32 *len
printf("error finishing!\n");
return CHDERR_COMPRESSION_ERROR;
}
-
+
int totalout = flac_encoder_client_ptr->flac_output_buffer_total-FLAC_HEADER_SIZE;
-
+
FLAC__stream_encoder_delete(encoder);
@@ -3197,9 +3197,9 @@ struct flac_decoder_data
UINT64 amount_to_decode;
};
-FLAC__StreamDecoderWriteStatus flac_decoder_write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data)
+FLAC__StreamDecoderWriteStatus flac_decoder_write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data)
{
-
+
int blocksize = frame->header.blocksize;
int i = 0;
while (blocksize && ((flac_decoder_data*)client_data)->amount_to_decode)
@@ -3212,7 +3212,7 @@ FLAC__StreamDecoderWriteStatus flac_decoder_write_callback(const FLAC__StreamDec
((flac_decoder_data*)client_data)->amount_to_decode-=4;
((flac_decoder_data*)client_data)->writeoffset++;
}
-
+
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
@@ -3237,12 +3237,12 @@ FLAC__StreamDecoderReadStatus flac_decoder_read_callback(const FLAC__StreamDecod
-void flac_decoder_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
+void flac_decoder_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
{
}
-void flac_decoder_error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
+void flac_decoder_error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
{
}
@@ -3259,7 +3259,7 @@ static chd_error flac_codec_decompress(chd_file *chd, UINT32 srclength, void *de
flac_decoder_client_ptr->readbuffer = (UINT8*)malloc(flac_decoder_client_ptr->readbuffersize);
flac_decoder_client_ptr->amount_to_decode = (CD_MAX_SECTOR_DATA*CD_FRAMES_PER_HUNK);
int frames_to_decode = flac_decoder_client_ptr->amount_to_decode / CD_MAX_SECTOR_DATA;
-
+
flac_decoder_client_ptr->writeoffset = 0;
memcpy(flac_decoder_client_ptr->readbuffer, flacHeader, FLAC_HEADER_SIZE);
@@ -3274,7 +3274,7 @@ static chd_error flac_codec_decompress(chd_file *chd, UINT32 srclength, void *de
if(FLAC__stream_decoder_init_stream(
decoder,
flac_decoder_read_callback,
- NULL,
+ NULL,
NULL,
NULL,
NULL,
@@ -3300,13 +3300,13 @@ static chd_error flac_codec_decompress(chd_file *chd, UINT32 srclength, void *de
return CHDERR_READ_ERROR;
}
-
+
int srcoffset = 0;
UINT8* dest2 = (UINT8*)dest;
for (int frame = 0; frame<frames_to_decode;frame++)
{
int destoffset = frame * (CD_FRAME_SIZE);
-
+
int index;
@@ -3314,11 +3314,11 @@ static chd_error flac_codec_decompress(chd_file *chd, UINT32 srclength, void *de
{
dest2[ destoffset + index +1 ] = flac_decoder_client_ptr->tempbuffer[srcoffset] & 0xff;
dest2[ destoffset + index ] = flac_decoder_client_ptr->tempbuffer[srcoffset] >> 8;
-
+
srcoffset++;
}
}
-
+
if (FLAC__stream_decoder_finish (decoder) != true)
{
diff --git a/src/lib/util/tagmap.h b/src/lib/util/tagmap.h
index a3ba8bf85b0..4bbe458f92b 100644
--- a/src/lib/util/tagmap.h
+++ b/src/lib/util/tagmap.h
@@ -78,7 +78,7 @@ public:
class entry_t
{
friend class tagmap_t<_ElementType, _HashSize>;
-
+
public:
// construction/destruction
entry_t(const char *tag, UINT32 fullhash, _ElementType object)
@@ -86,11 +86,11 @@ public:
m_fullhash(fullhash),
m_tag(tag),
m_object(object) { }
-
+
// accessors
const astring &tag() const { return m_tag; }
_ElementType object() const { return m_object; }
-
+
// setters
void set_object(_ElementType object) { m_object = object; }
@@ -151,7 +151,7 @@ public:
// find by tag
_ElementType find(const char *tag) const { return find(tag, hash(tag)); }
-
+
// find by tag with precomputed hash
_ElementType find(const char *tag, UINT32 fullhash) const
{
@@ -170,10 +170,10 @@ public:
return entry->object();
return NULL;
}
-
+
// return first object in the table
entry_t *first() const { return next(NULL); }
-
+
// return next object in the table
entry_t *next(entry_t *after) const
{
@@ -186,7 +186,7 @@ public:
for (UINT32 hashindex = firstindex; hashindex < ARRAY_LENGTH(m_table); hashindex++)
if (m_table[hashindex] != NULL)
return m_table[hashindex];
-
+
// all out
return NULL;
}
@@ -194,7 +194,7 @@ public:
private:
// internal helpers
tagmap_error add_common(const char *tag, _ElementType object, bool replace_if_duplicate, bool unique_hash);
-
+
// remove an entry given a pointer to its pointer
void remove_common(entry_t **entryptr)
{
@@ -214,7 +214,7 @@ private:
//**************************************************************************
//-------------------------------------------------
-// add_common - core implementation of a tagmap
+// add_common - core implementation of a tagmap
// addition
//-------------------------------------------------