multichannel assignments in format and documentation
authorJosh Coalson <jcoalson@users.sourceforce.net>
Fri, 6 Oct 2006 05:51:59 +0000 (05:51 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Fri, 6 Oct 2006 05:51:59 +0000 (05:51 +0000)
doc/html/documentation.html
doc/html/format.html
include/FLAC/stream_decoder.h
include/FLAC/stream_encoder.h

index 8c3a6a1..f31c9bc 100644 (file)
        </div>
        <div class="box_header"></div>
        <div class="box_body">
-               <span class="commandname">flac</span> is the command-line file encoder/decoder.  The encoder currently supports as input RIFF WAVE, AIFF, or FLAC format, or raw interleaved samples.  The decoder currently can output to RIFF WAVE or AIFF format, or raw interleaved samples.  <span class="commandname">flac</span> only supports linear PCM samples (in other words, no A-LAW, uLAW, etc.).  Another restriction (hopefully short-term) is that the input must be 8, 16, or 24 bits per sample.  This is not a limitation of the FLAC format, just the reference encoder/decoder.
+               <span class="commandname">flac</span> is the command-line file encoder/decoder.  The encoder currently supports as input RIFF WAVE, AIFF, or FLAC format, or raw interleaved samples.  The decoder currently can output to RIFF WAVE or AIFF format, or raw interleaved samples.  <span class="commandname">flac</span> only supports linear PCM samples (in other words, no A-LAW, uLAW, etc.), and the input must be between 4 and 24 bits per sample.  This is not a limitation of the FLAC format, just the reference encoder/decoder.
                <br /><br />
                <span class="commandname">flac</span> assumes that files ending in ".wav" or that have the RIFF WAVE header present are WAVE files, files ending in ".aif" or ".aiff" or have the AIFF header present are AIFF files, and files ending in ".flac" or have the FLAC header present are FLAC files.  This assumption may be overridden with a command-line option.  It also assumes that files ending in ".ogg" are Ogg FLAC files.  Other than this, <span class="commandname">flac</span> makes no assumptions about file extensions, though the convention is that FLAC files have the extension ".flac" (or ".fla" on ancient file systems like FAT-16).
                <br /><br />
index dc5cc2c..415d046 100644 (file)
                                Channel assignment
                                <ul>
                                <li>
-                                       <tt>0000-0111</tt> : (number of independent channels)-1.  when == 0001, channel 0 is the left channel and channel 1 is the right
+                                       <tt>0000-0111</tt> : (number of independent channels)-1.  Where defined, the channel order follows SMPTE/ITU-R recommendations.  The assignments are as follows:
+                                       <ul>
+                                               <li>1 channel: mono</li>
+                                               <li>2 channels: left, right</li>
+                                               <li>3 channels: left, right, center</li>
+                                               <li>4 channels: left, right, back left, back right</li>
+                                               <li>5 channels: left, right, center, back/surround left, back/surround right</li>
+                                               <li>6 channels: left, right, center, LFE, back/surround left, back/surround right</li>
+                                               <li>7 channels: not defined</li>
+                                               <li>8 channels: not defined</li>
+                                       </ul>
                                </li>
                                <li>
                                        <tt>1000</tt> : left/side stereo: channel 0 is the left channel, channel 1 is the side(difference) channel
index 6762a69..ce2b927 100644 (file)
@@ -574,9 +574,9 @@ typedef FLAC__bool (*FLAC__StreamDecoderEofCallback)(const FLAC__StreamDecoder *
  * \param  buffer   An array of pointers to decoded channels of data.
  *                  Each pointer will point to an array of signed
  *                  samples of length \a frame->header.blocksize.
- *                  Currently, the channel order has no meaning
- *                  except for stereo streams; in this case channel
- *                  0 is left and 1 is right.
+ *                  Channels will be ordered according to the FLAC
+ *                  specification; see the documentation for the
+ *                  <A HREF="../format.html#frame_header">frame header</A>.
  * \param  client_data  The callee's client data set through
  *                      FLAC__stream_decoder_init_*().
  * \retval FLAC__StreamDecoderWriteStatus
index e57a683..407b6ac 100644 (file)
@@ -1318,6 +1318,10 @@ FLAC_API void FLAC__stream_encoder_finish(FLAC__StreamEncoder *encoder);
  *  representing one channel.  The samples need not be block-aligned,
  *  but each channel should have the same number of samples.
  *
+ *  For applications where channel order is important, channels must
+ *  follow the order as described in the
+ *  <A HREF="../format.html#frame_header">frame header</A>.
+ *
  * \param  encoder  An initialized encoder instance in the OK state.
  * \param  buffer   An array of pointers to each channel's signal.
  * \param  samples  The number of samples in one channel.
@@ -1339,6 +1343,10 @@ FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, c
  *  sample-aligned, i.e. the first value should be channel0_sample0
  *  and the last value channelN_sampleM.
  *
+ *  For applications where channel order is important, channels must
+ *  follow the order as described in the
+ *  <A HREF="../format.html#frame_header">frame header</A>.
+ *
  * \param  encoder  An initialized encoder instance in the OK state.
  * \param  buffer   An array of channel-interleaved data (see above).
  * \param  samples  The number of samples in one channel, the same as for