Mercurial > libavcodec.hg
comparison vorbis_enc.c @ 3828:f9c449155a0e libavcodec
Original Commit: r22 | ods15 | 2006-09-22 13:49:56 +0300 (Fri, 22 Sep 2006) | 2 lines
add residue generation
author | ods15 |
---|---|
date | Mon, 02 Oct 2006 05:55:55 +0000 |
parents | 91f130d6c3f4 |
children | e8e340cbc7f2 |
comparison
equal
deleted
inserted
replaced
3827:91f130d6c3f4 | 3828:f9c449155a0e |
---|---|
163 } | 163 } |
164 | 164 |
165 static void create_vorbis_context(venc_context_t * venc, AVCodecContext * avccontext) { | 165 static void create_vorbis_context(venc_context_t * venc, AVCodecContext * avccontext) { |
166 codebook_t * cb; | 166 codebook_t * cb; |
167 floor_t * fc; | 167 floor_t * fc; |
168 residue_t * rc; | |
168 int i, book; | 169 int i, book; |
169 | 170 |
170 venc->channels = avccontext->channels; | 171 venc->channels = avccontext->channels; |
171 venc->sample_rate = avccontext->sample_rate; | 172 venc->sample_rate = avccontext->sample_rate; |
172 venc->blocksize[0] = venc->blocksize[1] = 8; | 173 venc->blocksize[0] = venc->blocksize[1] = 8; |
248 fc->list[1].x = 1 << fc->rangebits; | 249 fc->list[1].x = 1 << fc->rangebits; |
249 for (i = 2; i < fc->values; i++) fc->list[i].x = i * 5; | 250 for (i = 2; i < fc->values; i++) fc->list[i].x = i * 5; |
250 | 251 |
251 venc->nresidues = 1; | 252 venc->nresidues = 1; |
252 venc->residues = av_malloc(sizeof(residue_t) * venc->nresidues); | 253 venc->residues = av_malloc(sizeof(residue_t) * venc->nresidues); |
254 | |
255 // single residue | |
256 rc = &venc->residues[0]; | |
257 rc->type = 0; | |
258 rc->begin = 0; | |
259 rc->end = 1 << venc->blocksize[0]; | |
260 rc->partition_size = 64; | |
261 rc->classifications = 1; | |
262 rc->classbook = 1; | |
263 rc->books = av_malloc(sizeof(int[8]) * rc->classifications); | |
264 for (i = 0; i < 8; i++) rc->books[0][i] = 2 + i; | |
253 | 265 |
254 venc->nmappings = 1; | 266 venc->nmappings = 1; |
255 venc->mappings = av_malloc(sizeof(mapping_t) * venc->nmappings); | 267 venc->mappings = av_malloc(sizeof(mapping_t) * venc->nmappings); |
256 | 268 |
257 venc->nmodes = 1; | 269 venc->nmodes = 1; |