Lines Matching defs:avctx

143                 av_log(ac->avctx, AV_LOG_ERROR, "Too many channels\n");
160 static int frame_configure_elements(AVCodecContext *avctx)
162 AACContext *ac = avctx->priv_data;
178 if (!avctx->ch_layout.nb_channels)
182 if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0)
186 for (ch = 0; ch < avctx->ch_layout.nb_channels; ch++) {
521 ac->avctx->ch_layout = ac->oc[1].ch_layout;
537 AVCodecContext *avctx = ac->avctx;
552 avpriv_request_sample(ac->avctx, "Too large remapped id");
560 if (avctx->request_channel_layout == AV_CH_LAYOUT_NATIVE)
595 av_channel_layout_copy(&avctx->ch_layout, &ac->oc[1].ch_layout);
599 if ((ret = frame_configure_elements(ac->avctx)) < 0)
606 static void flush(AVCodecContext *avctx)
608 AACContext *ac= avctx->priv_data;
629 static int set_default_channel_config(AACContext *ac, AVCodecContext *avctx,
636 av_log(avctx, AV_LOG_ERROR,
656 if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT) {
660 av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
683 av_log(ac->avctx, AV_LOG_DEBUG, "mono with CPE\n");
685 if (set_default_channel_config(ac, ac->avctx, layout_map,
702 av_log(ac->avctx, AV_LOG_DEBUG, "stereo with SCE\n");
746 av_log(ac->avctx, AV_LOG_WARNING,
768 av_log(ac->avctx, AV_LOG_WARNING,
851 static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
864 av_log(avctx, AV_LOG_WARNING,
884 av_log(avctx, AV_LOG_ERROR, "decode_pce: " overread_err);
906 av_log(avctx, AV_LOG_ERROR, "decode_pce: " overread_err);
917 * @param avctx pointer to AVCCodecContext, used for logging
921 static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
933 avpriv_report_missing_feature(avctx, "Fixed point 960/120 MDCT window");
940 avpriv_report_missing_feature(avctx, "SBR with 960 frame length");
957 tags = decode_pce(avctx, m4ac, layout_map, gb, get_bit_alignment);
961 if ((ret = set_default_channel_config(ac, avctx, layout_map,
986 avpriv_report_missing_feature(avctx,
1002 avpriv_report_missing_feature(avctx,
1010 static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx,
1024 avpriv_request_sample(avctx, "960/120 MDCT window");
1032 avpriv_report_missing_feature(avctx,
1039 avpriv_report_missing_feature(avctx,
1051 av_log(avctx, AV_LOG_ERROR, overread_err);
1057 if ((ret = set_default_channel_config(ac, avctx, layout_map,
1066 avpriv_report_missing_feature(avctx,
1077 * @param avctx pointer to AVCCodecContext, used for logging
1086 AVCodecContext *avctx,
1096 if ((i = ff_mpeg4audio_get_config_gb(m4ac, &gbc, sync_extension, avctx)) < 0) {
1102 av_log(avctx, AV_LOG_ERROR,
1110 av_log(avctx, AV_LOG_ERROR,
1126 if ((ret = decode_ga_specific_config(ac, avctx, gb, get_bit_alignment,
1131 if ((ret = decode_eld_specific_config(ac, avctx, gb,
1136 avpriv_report_missing_feature(avctx,
1143 ff_dlog(avctx,
1153 AVCodecContext *avctx,
1162 av_log(avctx, AV_LOG_ERROR, "Audio specific config size is invalid\n");
1166 ff_dlog(avctx, "audio specific config size %d\n", (int)bit_size >> 3);
1168 ff_dlog(avctx, "%02x ", data[i]);
1169 ff_dlog(avctx, "\n");
1174 return decode_audio_specific_config_gb(ac, avctx, m4ac, &gb, 0,
1274 static av_cold int aac_decode_init(AVCodecContext *avctx)
1276 AACContext *ac = avctx->priv_data;
1279 if (avctx->sample_rate > 96000)
1286 ac->avctx = avctx;
1287 ac->oc[1].m4ac.sample_rate = avctx->sample_rate;
1291 avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
1293 avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
1296 if (avctx->extradata_size > 0) {
1297 if ((ret = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
1298 avctx->extradata,
1299 avctx->extradata_size * 8LL,
1307 sr = sample_rate_idx(avctx->sample_rate);
1309 ac->oc[1].m4ac.channels = avctx->ch_layout.nb_channels;
1314 if (ff_mpeg4audio_channels[i] == avctx->ch_layout.nb_channels)
1322 int ret = set_default_channel_config(ac, avctx, layout_map,
1327 else if (avctx->err_recognition & AV_EF_EXPLODE)
1332 if (avctx->ch_layout.nb_channels > MAX_CHANNELS) {
1333 av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
1338 ac->fdsp = avpriv_alloc_fixed_dsp(avctx->flags & AV_CODEC_FLAG_BITEXACT);
1340 ac->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
1380 av_log(ac->avctx, AV_LOG_ERROR, "skip_data_stream_element: "overread_err);
1395 av_log(ac->avctx, AV_LOG_ERROR,
1433 av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
1434 if (ac->avctx->err_recognition & AV_EF_BITSTREAM)
1441 av_log(ac->avctx, AV_LOG_ERROR,
1511 av_log(ac->avctx, AV_LOG_ERROR,
1516 av_log(ac->avctx, AV_LOG_ERROR,
1528 av_log(ac->avctx, AV_LOG_ERROR,
1562 av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");
1569 av_log(ac->avctx, AV_LOG_ERROR, "decode_band_types: "overread_err);
1573 av_log(ac->avctx, AV_LOG_ERROR,
1620 avpriv_request_sample(ac->avctx,
1639 avpriv_request_sample(ac->avctx,
1654 av_log(ac->avctx, AV_LOG_ERROR,
1715 av_log(ac->avctx, AV_LOG_ERROR,
1968 av_log(ac->avctx, AV_LOG_ERROR, "error in spectral data, ESC overflow\n");
2050 ac->subband_scale(cfo, cfo, sf[idx], 34, off_len, ac->avctx);
2166 av_log(ac->avctx, AV_LOG_ERROR,
2172 av_log(ac->avctx, AV_LOG_ERROR,
2187 avpriv_report_missing_feature(ac->avctx, "Gain control");
2281 offsets[i + 1] - offsets[i] ,ac->avctx);
2323 av_log(ac->avctx, AV_LOG_ERROR, "ms_present = 3 is reserved.\n");
2521 if (ac->avctx->debug & FF_DEBUG_PICT_INFO)
2522 av_log(ac->avctx, AV_LOG_DEBUG, "FILL:%s\n", buf);
2525 ac->avctx->internal->skip_samples = 1024;
2548 if (ac->avctx->debug & FF_DEBUG_STARTCODE)
2549 av_log(ac->avctx, AV_LOG_DEBUG, "extension type: %d len:%d\n", type, cnt);
2556 av_log(ac->avctx, AV_LOG_ERROR, "SBR was found before the first channel element.\n");
2560 avpriv_report_missing_feature(ac->avctx,
2566 av_log(ac->avctx, AV_LOG_ERROR, "SBR signaled to be not-present but was found in the bitstream.\n");
2570 av_log(ac->avctx, AV_LOG_ERROR, "Implicit SBR was found with a first occurrence after the first frame.\n");
2574 ac->avctx->ch_layout.nb_channels == 1) {
2577 ac->avctx->profile = FF_PROFILE_AAC_HE_V2;
2582 ac->avctx->profile = FF_PROFILE_AAC_HE;
3099 av_log(ac->avctx, AV_LOG_VERBOSE, "ChannelElement %d.%d missing \n", type, i);
3117 avpriv_report_missing_feature(ac->avctx,
3124 if ((ret = set_default_channel_config(ac, ac->avctx,
3167 static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
3170 AACContext *ac = avctx->priv_data;
3183 if ((err = frame_configure_elements(avctx)) < 0)
3188 ac->avctx->profile = aot - 1;
3193 avpriv_request_sample(avctx, "Unknown ER channel configuration %d",
3201 av_log(ac->avctx, AV_LOG_ERROR,
3227 av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
3232 ac->frame->sample_rate = avctx->sample_rate;
3239 static int aac_decode_frame_int(AVCodecContext *avctx, AVFrame *frame,
3243 AACContext *ac = avctx->priv_data;
3256 av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
3260 av_log(ac->avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->oc[1].m4ac.sampling_index);
3266 if ((err = frame_configure_elements(avctx)) < 0)
3271 ac->avctx->profile = ac->oc[1].m4ac.object_type - 1;
3279 if (avctx->debug & FF_DEBUG_STARTCODE)
3280 av_log(avctx, AV_LOG_DEBUG, "Elem type:%x id:%x\n", elem_type, elem_id);
3282 if (!avctx->ch_layout.nb_channels && elem_type != TYPE_PCE) {
3290 av_log(ac->avctx, error ? AV_LOG_ERROR : AV_LOG_DEBUG, "channel element %d.%d duplicate\n",
3300 av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
3345 tags = decode_pce(avctx, &ac->oc[1].m4ac, layout_map, gb,
3352 av_log(avctx, AV_LOG_ERROR,
3368 av_log(avctx, AV_LOG_ERROR, "TYPE_FIL: "overread_err);
3397 av_log(avctx, AV_LOG_ERROR, overread_err);
3403 if (!avctx->ch_layout.nb_channels) {
3414 avctx->sample_rate = ac->oc[1].m4ac.sample_rate << multiplier;
3415 avctx->frame_size = samples;
3420 avctx->internal->skip_samples_multiplier = 2;
3423 av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
3430 ac->frame->sample_rate = avctx->sample_rate;
3452 static int aac_decode_frame(AVCodecContext *avctx, AVFrame *frame,
3455 AACContext *ac = avctx->priv_data;
3474 err = decode_audio_specific_config(ac, ac->avctx, &ac->oc[1].m4ac,
3499 err = aac_decode_er_frame(avctx, frame, got_frame_ptr, &gb);
3502 err = aac_decode_frame_int(avctx, frame, got_frame_ptr, &gb, avpkt);
3515 static av_cold int aac_decode_close(AVCodecContext *avctx)
3517 AACContext *ac = avctx->priv_data;