Mercurial > libavcodec.hg
comparison vorbis_enc.c @ 3816:6eba53afa0b0 libavcodec
Original Commit: r10 | ods15 | 2006-09-17 19:37:17 +0300 (Sun, 17 Sep 2006) | 2 lines
mappings header syntax
author | ods15 |
---|---|
date | Mon, 02 Oct 2006 05:55:28 +0000 |
parents | 3fa081422f78 |
children | 3ca15f0d4882 |
comparison
equal
deleted
inserted
replaced
3815:3fa081422f78 | 3816:6eba53afa0b0 |
---|---|
78 int classbook; | 78 int classbook; |
79 int (*books)[8]; | 79 int (*books)[8]; |
80 } residue_t; | 80 } residue_t; |
81 | 81 |
82 typedef struct { | 82 typedef struct { |
83 int submaps; | |
84 int * mux; | |
85 int * floor; | |
86 int * residue; | |
83 } mapping_t; | 87 } mapping_t; |
84 | 88 |
85 typedef struct { | 89 typedef struct { |
86 int channels; | 90 int channels; |
87 int sample_rate; | 91 int sample_rate; |
294 for (i = 0; i < venc->nresidues; i++) put_residue_header(&pb, &venc->residues[0]); | 298 for (i = 0; i < venc->nresidues; i++) put_residue_header(&pb, &venc->residues[0]); |
295 | 299 |
296 // mappings | 300 // mappings |
297 put_bits(&pb, 6, venc->nmappings - 1); | 301 put_bits(&pb, 6, venc->nmappings - 1); |
298 for (i = 0; i < venc->nmappings; i++) { | 302 for (i = 0; i < venc->nmappings; i++) { |
303 mapping_t * mc = &venc->mappings[i]; | |
304 int j; | |
305 put_bits(&pb, 16, 0); // mapping type | |
306 | |
307 put_bits(&pb, 1, mc->submaps > 1); | |
308 if (mc->submaps > 1) put_bits(&pb, 4, mc->submaps - 1); | |
309 | |
310 put_bits(&pb, 1, 0); // channel coupling | |
311 | |
312 put_bits(&pb, 2, 0); // reserved | |
313 | |
314 if (mc->submaps > 1) for (j = 0; j < venc->channels; j++) put_bits(&pb, 4, mc->mux[j]); | |
315 | |
316 for (j = 0; j < mc->submaps; j++) { | |
317 put_bits(&pb, 8, 0); // reserved time configuration | |
318 put_bits(&pb, 8, mc->floor[j]); | |
319 put_bits(&pb, 8, mc->residue[j]); | |
320 } | |
299 } | 321 } |
300 | 322 |
301 flush_put_bits(&pb); | 323 flush_put_bits(&pb); |
302 hlens[2] = (put_bits_count(&pb) + 7) / 8; | 324 hlens[2] = (put_bits_count(&pb) + 7) / 8; |
303 | 325 |