• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/minidlna/ffmpeg-2.3.4/libavcodec/

Lines Matching refs:avctx

92 static int aac_encode_close(AVCodecContext *avctx)
94 AACContext *s = avctx->priv_data;
98 av_freep(&avctx->extradata);
104 static av_cold int aac_encode_init(AVCodecContext *avctx)
106 AACContext *s = avctx->priv_data;
114 if ((err = aacEncOpen(&s->handle, 0, avctx->channels)) != AACENC_OK) {
115 av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
120 if (avctx->profile != FF_PROFILE_UNKNOWN)
121 aot = avctx->profile + 1;
124 av_log(avctx, AV_LOG_ERROR, "Unable to set the AOT %d: %s\n",
132 av_log(avctx, AV_LOG_ERROR, "Unable to enable SBR for ELD: %s\n",
139 avctx->sample_rate)) != AACENC_OK) {
140 av_log(avctx, AV_LOG_ERROR, "Unable to set the sample rate %d: %s\n",
141 avctx->sample_rate, aac_get_error(err));
145 switch (avctx->channels) {
158 if (avctx->channel_layout == AV_CH_LAYOUT_7POINT1) {
167 av_log(avctx, AV_LOG_ERROR,
168 "Unsupported number of channels %d\n", avctx->channels);
174 av_log(avctx, AV_LOG_ERROR,
181 av_log(avctx, AV_LOG_ERROR,
187 if (avctx->flags & CODEC_FLAG_QSCALE || s->vbr) {
188 int mode = s->vbr ? s->vbr : avctx->global_quality;
190 av_log(avctx, AV_LOG_WARNING,
194 av_log(avctx, AV_LOG_WARNING,
199 av_log(avctx, AV_LOG_ERROR, "Unable to set the VBR bitrate mode %d: %s\n",
204 if (avctx->bit_rate <= 0) {
205 if (avctx->profile == FF_PROFILE_AAC_HE_V2) {
209 avctx->bit_rate = (96*sce + 128*cpe) * avctx->sample_rate / 44;
210 if (avctx->profile == FF_PROFILE_AAC_HE ||
211 avctx->profile == FF_PROFILE_AAC_HE_V2 ||
212 avctx->profile == FF_PROFILE_MPEG2_AAC_HE ||
214 avctx->bit_rate /= 2;
217 avctx->bit_rate)) != AACENC_OK) {
218 av_log(avctx, AV_LOG_ERROR, "Unable to set the bitrate %d: %s\n",
219 avctx->bit_rate, aac_get_error(err));
227 avctx->flags & CODEC_FLAG_GLOBAL_HEADER ? 0 : s->latm ? 10 : 2)) != AACENC_OK) {
228 av_log(avctx, AV_LOG_ERROR, "Unable to set the transmux format: %s\n",
236 av_log(avctx, AV_LOG_ERROR, "Unable to set header period: %s\n",
246 s->signaling = avctx->flags & CODEC_FLAG_GLOBAL_HEADER ? 2 : 0;
250 av_log(avctx, AV_LOG_ERROR, "Unable to set signaling mode %d: %s\n",
257 av_log(avctx, AV_LOG_ERROR, "Unable to set afterburner to %d: %s\n",
262 if (avctx->cutoff > 0) {
263 if (avctx->cutoff < (avctx->sample_rate + 255) >> 8 || avctx->cutoff > 20000) {
264 av_log(avctx, AV_LOG_ERROR, "cutoff valid range is %d-20000\n",
265 (avctx->sample_rate + 255) >> 8);
269 avctx->cutoff)) != AACENC_OK) {
270 av_log(avctx, AV_LOG_ERROR, "Unable to set the encoder bandwidth to %d: %s\n",
271 avctx->cutoff, aac_get_error(err));
277 av_log(avctx, AV_LOG_ERROR, "Unable to initialize the encoder: %s\n",
283 av_log(avctx, AV_LOG_ERROR, "Unable to get encoder info: %s\n",
288 avctx->frame_size = info.frameLength;
289 avctx->delay = info.encoderDelay;
290 ff_af_queue_init(avctx, &s->afq);
292 if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
293 avctx->extradata_size = info.confSize;
294 avctx->extradata = av_mallocz(avctx->extradata_size +
296 if (!avctx->extradata) {
301 memcpy(avctx->extradata, info.confBuf, info.confSize);
305 aac_encode_close(avctx);
309 static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
312 AACContext *s = avctx->priv_data;
329 in_buffer_size = 2 * avctx->channels * frame->nb_samples;
332 in_args.numInSamples = avctx->channels * frame->nb_samples;
345 if ((ret = ff_alloc_packet2(avctx, avpkt, FFMAX(8192, 768 * avctx->channels))) < 0)
361 av_log(avctx, AV_LOG_ERROR, "Unable to encode frame: %s\n",
370 ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,