Mercurial > libavcodec.hg
comparison vorbis_enc.c @ 3815:3fa081422f78 libavcodec
Original Commit: r9 | ods15 | 2006-09-17 18:56:41 +0300 (Sun, 17 Sep 2006) | 2 lines
add residue header syntax
author | ods15 |
---|---|
date | Mon, 02 Oct 2006 05:55:26 +0000 |
parents | 464eca766731 |
children | 6eba53afa0b0 |
comparison
equal
deleted
inserted
replaced
3814:464eca766731 | 3815:3fa081422f78 |
---|---|
68 int values; | 68 int values; |
69 struct { int x; } * list; | 69 struct { int x; } * list; |
70 } floor_t; | 70 } floor_t; |
71 | 71 |
72 typedef struct { | 72 typedef struct { |
73 int type; | |
74 int begin; | |
75 int end; | |
76 int partition_size; | |
77 int classifications; | |
78 int classbook; | |
79 int (*books)[8]; | |
73 } residue_t; | 80 } residue_t; |
74 | 81 |
75 typedef struct { | 82 typedef struct { |
76 } mapping_t; | 83 } mapping_t; |
77 | 84 |
196 | 203 |
197 for (i = 2; i < fc->values; i++) put_bits(pb, fc->rangebits, fc->list[i].x); | 204 for (i = 2; i < fc->values; i++) put_bits(pb, fc->rangebits, fc->list[i].x); |
198 } | 205 } |
199 | 206 |
200 static void put_residue_header(PutBitContext * pb, residue_t * rc) { | 207 static void put_residue_header(PutBitContext * pb, residue_t * rc) { |
208 int i; | |
209 | |
210 put_bits(pb, 16, rc->type); | |
211 | |
212 put_bits(pb, 24, rc->begin); | |
213 put_bits(pb, 24, rc->end); | |
214 put_bits(pb, 24, rc->partition_size - 1); | |
215 put_bits(pb, 6, rc->classifications); | |
216 put_bits(pb, 8, rc->classbook); | |
217 | |
218 for (i = 0; i < rc->classifications; i++) { | |
219 int j, tmp = 0; | |
220 for (j = 0; j < 8; j++) tmp |= (!!rc->books[i][j]) << j; | |
221 | |
222 put_bits(pb, 3, tmp & 7); | |
223 put_bits(pb, 1, tmp > 7); | |
224 | |
225 if (tmp > 7) put_bits(pb, 5, tmp >> 3); | |
226 } | |
227 | |
228 for (i = 0; i < rc->classifications; i++) { | |
229 int j; | |
230 for (j = 0; j < 8; j++) | |
231 if (rc->books[i][j]) | |
232 put_bits(pb, 8, rc->books[i][j]); | |
233 } | |
201 } | 234 } |
202 | 235 |
203 static int put_main_header(venc_context_t * venc, uint8_t ** out) { | 236 static int put_main_header(venc_context_t * venc, uint8_t ** out) { |
204 int i; | 237 int i; |
205 PutBitContext pb; | 238 PutBitContext pb; |