• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libav-0.8.8/libavcodec/

Lines Matching refs:avctx

142 static void put_audio_specific_config(AVCodecContext *avctx)
145 AACEncContext *s = avctx->priv_data;
147 init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
150 put_bits(&pb, 4, avctx->channels);
163 static av_cold int aac_encode_init(AVCodecContext *avctx)
165 AACEncContext *s = avctx->priv_data;
171 avctx->frame_size = 1024;
174 if (avctx->sample_rate == avpriv_mpeg4audio_sample_rates[i])
177 av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d\n", avctx->sample_rate);
180 if (avctx->channels > AAC_MAX_CHANNELS) {
181 av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %d\n", avctx->channels);
184 if (avctx->profile != FF_PROFILE_UNKNOWN && avctx->profile != FF_PROFILE_AAC_LOW) {
185 av_log(avctx, AV_LOG_ERROR, "Unsupported profile %d\n", avctx->profile);
188 if (1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * avctx->channels) {
189 av_log(avctx, AV_LOG_ERROR, "Too many bits per frame requested\n");
194 dsputil_init(&s->dsp, avctx);
203 s->chan_map = aac_chan_configs[avctx->channels-1];
204 s->samples = av_malloc(2 * 1024 * avctx->channels * sizeof(s->samples[0]));
206 avctx->extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
207 avctx->extradata_size = 5;
208 put_audio_specific_config(avctx);
216 ff_psy_init(&s->psy, avctx, 2, sizes, lengths, s->chan_map[0], grouping);
217 s->psypp = ff_psy_preprocess_init(avctx);
220 s->lambda = avctx->global_quality ? avctx->global_quality : 120;
227 static void apply_window_and_mdct(AVCodecContext *avctx, AACEncContext *s,
231 const int chans = avctx->channels;
388 static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s,
399 av_log(avctx, AV_LOG_ERROR, "Scalefactor difference is too big to be coded\n");
454 static int encode_individual_channel(AVCodecContext *avctx, AACEncContext *s,
462 encode_scale_factors(avctx, s, sce);
473 static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s,
491 static int aac_encode_frame(AVCodecContext *avctx,
494 AACEncContext *s = avctx->priv_data;
505 memcpy(s->samples + 1024 * avctx->channels, data,
506 1024 * avctx->channels * sizeof(s->samples[0]));
509 samples2 = s->samples + 1024 * avctx->channels;
519 if (!avctx->frame_number) {
520 memcpy(s->samples, s->samples + 1024 * avctx->channels,
521 1024 * avctx->channels * sizeof(s->samples[0]));
535 la = samples2 + (448+64) * avctx->channels;
563 apply_window_and_mdct(avctx, s, &cpe->ch[ch], samples2);
570 if ((avctx->frame_number & 0xFF)==1 && !(avctx->flags & CODEC_FLAG_BITEXACT))
571 put_bitstream_info(avctx, s, LIBAVCODEC_IDENT);
587 s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
623 encode_individual_channel(avctx, s, &cpe->ch[ch], cpe->common_window);
629 if (frame_bits <= 6144 * avctx->channels - 3) {
630 s->psy.bitres.bits = frame_bits / avctx->channels;
634 s->lambda *= avctx->bit_rate * 1024.0f / avctx->sample_rate / frame_bits;
640 avctx->frame_bits = put_bits_count(&s->pb);
643 if (!(avctx->flags & CODEC_FLAG_QSCALE)) {
644 float ratio = avctx->bit_rate * 1024.0f / avctx->sample_rate / avctx->frame_bits;
651 memcpy(s->samples, s->samples + 1024 * avctx->channels,
652 1024 * avctx->channels * sizeof(s->samples[0]));
656 static av_cold int aac_encode_end(AVCodecContext *avctx)
658 AACEncContext *s = avctx->priv_data;