comparison vorbis_enc.c @ 3829:e8e340cbc7f2 libavcodec

Original Commit: r23 | ods15 | 2006-09-22 13:55:48 +0300 (Fri, 22 Sep 2006) | 2 lines mapping generation
author ods15
date Mon, 02 Oct 2006 05:55:57 +0000
parents f9c449155a0e
children 477ee30c6fc6
comparison
equal deleted inserted replaced
3828:f9c449155a0e 3829:e8e340cbc7f2
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 residue_t * rc;
169 mapping_t * mc;
169 int i, book; 170 int i, book;
170 171
171 venc->channels = avccontext->channels; 172 venc->channels = avccontext->channels;
172 venc->sample_rate = avccontext->sample_rate; 173 venc->sample_rate = avccontext->sample_rate;
173 venc->blocksize[0] = venc->blocksize[1] = 8; 174 venc->blocksize[0] = venc->blocksize[1] = 8;
263 rc->books = av_malloc(sizeof(int[8]) * rc->classifications); 264 rc->books = av_malloc(sizeof(int[8]) * rc->classifications);
264 for (i = 0; i < 8; i++) rc->books[0][i] = 2 + i; 265 for (i = 0; i < 8; i++) rc->books[0][i] = 2 + i;
265 266
266 venc->nmappings = 1; 267 venc->nmappings = 1;
267 venc->mappings = av_malloc(sizeof(mapping_t) * venc->nmappings); 268 venc->mappings = av_malloc(sizeof(mapping_t) * venc->nmappings);
269
270 // single mapping
271 mc = &venc->mappings[0];
272 mc->submaps = 1;
273 mc->mux = av_malloc(sizeof(int) * venc->channels);
274 for (i = 0; i < venc->channels; i++) mc->mux[i] = 0;
275 mc->floor = av_malloc(sizeof(int) * mc->submaps);
276 mc->residue = av_malloc(sizeof(int) * mc->submaps);
277 for (i = 0; i < mc->submaps; i++) {
278 mc->floor[i] = 0;
279 mc->residue[i] = 0;
280 }
268 281
269 venc->nmodes = 1; 282 venc->nmodes = 1;
270 venc->modes = av_malloc(sizeof(vorbis_mode_t) * venc->nmodes); 283 venc->modes = av_malloc(sizeof(vorbis_mode_t) * venc->nmodes);
271 } 284 }
272 285