Mercurial > libavcodec.hg
comparison alacenc.c @ 7823:4525dcd81357 libavcodec
Bump Major version, this commit is almost just renaming bits_per_sample to
bits_per_coded_sample but that cannot be done seperately.
Patch by Luca Abeni
Also reset the minor version and fix the forgotton change to libfaad.
Note: The API/ABI should not be considered stable yet, there still may
be a change done here or there if some developer has some cleanup ideas and
patches!
author | michael |
---|---|
date | Mon, 08 Sep 2008 14:24:59 +0000 |
parents | b87a9296e854 |
children | 5f48c58bfd51 |
comparison
equal
deleted
inserted
replaced
7822:67cfe4983e6d | 7823:4525dcd81357 |
---|---|
362 { | 362 { |
363 AlacEncodeContext *s = avctx->priv_data; | 363 AlacEncodeContext *s = avctx->priv_data; |
364 uint8_t *alac_extradata = av_mallocz(ALAC_EXTRADATA_SIZE+1); | 364 uint8_t *alac_extradata = av_mallocz(ALAC_EXTRADATA_SIZE+1); |
365 | 365 |
366 avctx->frame_size = DEFAULT_FRAME_SIZE; | 366 avctx->frame_size = DEFAULT_FRAME_SIZE; |
367 avctx->bits_per_sample = DEFAULT_SAMPLE_SIZE; | 367 avctx->bits_per_coded_sample = DEFAULT_SAMPLE_SIZE; |
368 | 368 |
369 if(avctx->sample_fmt != SAMPLE_FMT_S16) { | 369 if(avctx->sample_fmt != SAMPLE_FMT_S16) { |
370 av_log(avctx, AV_LOG_ERROR, "only pcm_s16 input samples are supported\n"); | 370 av_log(avctx, AV_LOG_ERROR, "only pcm_s16 input samples are supported\n"); |
371 return -1; | 371 return -1; |
372 } | 372 } |
382 s->rc.initial_history = 10; | 382 s->rc.initial_history = 10; |
383 s->rc.k_modifier = 14; | 383 s->rc.k_modifier = 14; |
384 s->rc.rice_modifier = 4; | 384 s->rc.rice_modifier = 4; |
385 | 385 |
386 s->max_coded_frame_size = (ALAC_FRAME_HEADER_SIZE + ALAC_FRAME_FOOTER_SIZE + | 386 s->max_coded_frame_size = (ALAC_FRAME_HEADER_SIZE + ALAC_FRAME_FOOTER_SIZE + |
387 avctx->frame_size*avctx->channels*avctx->bits_per_sample)>>3; | 387 avctx->frame_size*avctx->channels*avctx->bits_per_coded_sample)>>3; |
388 | 388 |
389 s->write_sample_size = avctx->bits_per_sample + avctx->channels - 1; // FIXME: consider wasted_bytes | 389 s->write_sample_size = avctx->bits_per_coded_sample + avctx->channels - 1; // FIXME: consider wasted_bytes |
390 | 390 |
391 AV_WB32(alac_extradata, ALAC_EXTRADATA_SIZE); | 391 AV_WB32(alac_extradata, ALAC_EXTRADATA_SIZE); |
392 AV_WB32(alac_extradata+4, MKBETAG('a','l','a','c')); | 392 AV_WB32(alac_extradata+4, MKBETAG('a','l','a','c')); |
393 AV_WB32(alac_extradata+12, avctx->frame_size); | 393 AV_WB32(alac_extradata+12, avctx->frame_size); |
394 AV_WB8 (alac_extradata+17, avctx->bits_per_sample); | 394 AV_WB8 (alac_extradata+17, avctx->bits_per_coded_sample); |
395 AV_WB8 (alac_extradata+21, avctx->channels); | 395 AV_WB8 (alac_extradata+21, avctx->channels); |
396 AV_WB32(alac_extradata+24, s->max_coded_frame_size); | 396 AV_WB32(alac_extradata+24, s->max_coded_frame_size); |
397 AV_WB32(alac_extradata+28, avctx->sample_rate*avctx->channels*avctx->bits_per_sample); // average bitrate | 397 AV_WB32(alac_extradata+28, avctx->sample_rate*avctx->channels*avctx->bits_per_coded_sample); // average bitrate |
398 AV_WB32(alac_extradata+32, avctx->sample_rate); | 398 AV_WB32(alac_extradata+32, avctx->sample_rate); |
399 | 399 |
400 // Set relevant extradata fields | 400 // Set relevant extradata fields |
401 if(s->compression_level > 0) { | 401 if(s->compression_level > 0) { |
402 AV_WB8(alac_extradata+18, s->rc.history_mult); | 402 AV_WB8(alac_extradata+18, s->rc.history_mult); |