summaryrefslogtreecommitdiff
path: root/libavcodec/vorbis_enc.c
diff options
context:
space:
mode:
authorOded Shimon <ods15@ods15.dyndns.org>2006-10-02 05:55:28 +0000
committerOded Shimon <ods15@ods15.dyndns.org>2006-10-02 05:55:28 +0000
commitbeaec74a944446345bfc59c8711c586c059ed0fb (patch)
tree0fdad29fadfe0d2212218f64b76113cf0b2dd5cc /libavcodec/vorbis_enc.c
parent6f133df1ea7a0d5362e1a779335b45a6a92015fc (diff)
Original Commit: r10 | ods15 | 2006-09-17 19:37:17 +0300 (Sun, 17 Sep 2006) | 2 lines
mappings header syntax Originally committed as revision 6421 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vorbis_enc.c')
-rw-r--r--libavcodec/vorbis_enc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c
index 7f441b3be2..50c3c2b6d4 100644
--- a/libavcodec/vorbis_enc.c
+++ b/libavcodec/vorbis_enc.c
@@ -80,6 +80,10 @@ typedef struct {
} residue_t;
typedef struct {
+ int submaps;
+ int * mux;
+ int * floor;
+ int * residue;
} mapping_t;
typedef struct {
@@ -296,6 +300,24 @@ static int put_main_header(venc_context_t * venc, uint8_t ** out) {
// mappings
put_bits(&pb, 6, venc->nmappings - 1);
for (i = 0; i < venc->nmappings; i++) {
+ mapping_t * mc = &venc->mappings[i];
+ int j;
+ put_bits(&pb, 16, 0); // mapping type
+
+ put_bits(&pb, 1, mc->submaps > 1);
+ if (mc->submaps > 1) put_bits(&pb, 4, mc->submaps - 1);
+
+ put_bits(&pb, 1, 0); // channel coupling
+
+ put_bits(&pb, 2, 0); // reserved
+
+ if (mc->submaps > 1) for (j = 0; j < venc->channels; j++) put_bits(&pb, 4, mc->mux[j]);
+
+ for (j = 0; j < mc->submaps; j++) {
+ put_bits(&pb, 8, 0); // reserved time configuration
+ put_bits(&pb, 8, mc->floor[j]);
+ put_bits(&pb, 8, mc->residue[j]);
+ }
}
flush_put_bits(&pb);