Mercurial > libavcodec.hg
comparison vorbis_enc.c @ 3814:464eca766731 libavcodec
Original Commit: r8 | ods15 | 2006-09-17 09:43:38 +0300 (Sun, 17 Sep 2006) | 2 lines
floor header syntax
author | ods15 |
---|---|
date | Mon, 02 Oct 2006 05:55:24 +0000 |
parents | 95b70f8bc29e |
children | 3fa081422f78 |
comparison
equal
deleted
inserted
replaced
3813:95b70f8bc29e | 3814:464eca766731 |
---|---|
50 //float * dimentions; | 50 //float * dimentions; |
51 int * quantlist; | 51 int * quantlist; |
52 } codebook_t; | 52 } codebook_t; |
53 | 53 |
54 typedef struct { | 54 typedef struct { |
55 int dim; | |
56 int subclass; | |
57 int masterbook; | |
58 int * books; | |
59 } floor_class_t; | |
60 | |
61 typedef struct { | |
62 int partitions; | |
63 int * partition_to_class; | |
64 int nclasses; | |
65 floor_class_t * classes; | |
66 int multiplier; | |
67 int rangebits; | |
68 int values; | |
69 struct { int x; } * list; | |
55 } floor_t; | 70 } floor_t; |
56 | 71 |
57 typedef struct { | 72 typedef struct { |
58 } residue_t; | 73 } residue_t; |
59 | 74 |
152 | 167 |
153 for (i = 0; i < tmp; i++) put_bits(pb, bits, cb->quantlist[i]); | 168 for (i = 0; i < tmp; i++) put_bits(pb, bits, cb->quantlist[i]); |
154 } | 169 } |
155 } | 170 } |
156 | 171 |
157 static void put_floor_header(PutBitContext * pb, floor_t * fl) { | 172 static void put_floor_header(PutBitContext * pb, floor_t * fc) { |
158 } | 173 int i; |
159 | 174 |
160 static void put_residue_header(PutBitContext * pb, residue_t * r) { | 175 put_bits(pb, 16, 1); // type, only floor1 is supported |
176 | |
177 put_bits(pb, 5, fc->partitions); | |
178 | |
179 for (i = 0; i < fc->partitions; i++) put_bits(pb, 4, fc->partition_to_class[i]); | |
180 | |
181 for (i = 0; i < fc->nclasses; i++) { | |
182 int j, books; | |
183 | |
184 put_bits(pb, 3, fc->classes[i].dim - 1); | |
185 put_bits(pb, 2, fc->classes[i].subclass); | |
186 | |
187 if (fc->classes[i].subclass) put_bits(pb, 8, fc->classes[i].masterbook); | |
188 | |
189 books = (1 << fc->classes[i].subclass); | |
190 | |
191 for (j = 0; j < books; j++) put_bits(pb, 8, fc->classes[i].books[j] + 1); | |
192 } | |
193 | |
194 put_bits(pb, 2, fc->multiplier - 1); | |
195 put_bits(pb, 4, fc->rangebits); | |
196 | |
197 for (i = 2; i < fc->values; i++) put_bits(pb, fc->rangebits, fc->list[i].x); | |
198 } | |
199 | |
200 static void put_residue_header(PutBitContext * pb, residue_t * rc) { | |
161 } | 201 } |
162 | 202 |
163 static int put_main_header(venc_context_t * venc, uint8_t ** out) { | 203 static int put_main_header(venc_context_t * venc, uint8_t ** out) { |
164 int i; | 204 int i; |
165 PutBitContext pb; | 205 PutBitContext pb; |