#include "avcodec.h"
#include "internal.h"
#include "get_bits.h"
-#include "dsputil.h"
#include "fft.h"
#include "fmtconvert.h"
#include "lpc.h"
}
/* get output buffer */
- ac->frame.nb_samples = 2048;
- if ((ret = ff_get_buffer(avctx, &ac->frame)) < 0) {
+ av_frame_unref(ac->frame);
+ ac->frame->nb_samples = 2048;
+ if ((ret = ff_get_buffer(avctx, ac->frame, 0)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
/* map output channel pointers to AVFrame data */
for (ch = 0; ch < avctx->channels; ch++) {
if (ac->output_element[ch])
- ac->output_element[ch]->ret = (float *)ac->frame.extended_data[ch];
+ ac->output_element[ch]->ret = (float *)ac->frame->extended_data[ch];
}
return 0;
int tags = 0;
if (get_bits1(gb)) { // frameLengthFlag
- av_log_missing_feature(avctx, "960/120 MDCT window", 1);
+ avpriv_request_sample(avctx, "960/120 MDCT window");
return AVERROR_PATCHWELCOME;
}
ff_aac_sbr_init();
- ff_dsputil_init(&ac->dsp, avctx);
ff_fmt_convert_init(&ac->fmt_conv, avctx);
avpriv_float_dsp_init(&ac->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
cbrt_tableinit();
- avcodec_get_frame_defaults(&ac->frame);
- avctx->coded_frame = &ac->frame;
-
return 0;
}
offset[2] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
clipped_offset = av_clip(offset[2], -155, 100);
if (offset[2] != clipped_offset) {
- av_log_ask_for_sample(ac->avctx, "Intensity stereo "
- "position clipped (%d -> %d).\nIf you heard an "
- "audible artifact, there may be a bug in the "
- "decoder. ", offset[2], clipped_offset);
+ avpriv_request_sample(ac->avctx,
+ "If you heard an audible artifact, there may be a bug in the decoder. "
+ "Clipped intensity stereo position (%d -> %d)",
+ offset[2], clipped_offset);
}
sf[idx] = ff_aac_pow2sf_tab[-clipped_offset + POW_SF2_ZERO];
}
offset[1] += get_vlc2(gb, vlc_scalefactors.table, 7, 3) - 60;
clipped_offset = av_clip(offset[1], -100, 155);
if (offset[1] != clipped_offset) {
- av_log_ask_for_sample(ac->avctx, "Noise gain clipped "
- "(%d -> %d).\nIf you heard an audible "
- "artifact, there may be a bug in the decoder. ",
- offset[1], clipped_offset);
+ avpriv_request_sample(ac->avctx,
+ "If you heard an audible artifact, there may be a bug in the decoder. "
+ "Clipped noise gain (%d -> %d)",
+ offset[1], clipped_offset);
}
sf[idx] = -ff_aac_pow2sf_tab[clipped_offset + POW_SF2_ZERO];
}
cfo[k] = ac->random_state;
}
- band_energy = ac->dsp.scalarproduct_float(cfo, cfo, off_len);
+ band_energy = ac->fdsp.scalarproduct_float(cfo, cfo, off_len);
scale = sf[idx] / sqrtf(band_energy);
ac->fdsp.vector_fmul_scalar(cfo, cfo, scale, off_len);
}
if ((tns->present = get_bits1(gb)) && decode_tns(ac, tns, gb, ics))
return -1;
if (get_bits1(gb)) {
- av_log_missing_feature(ac->avctx, "SSR", 1);
+ avpriv_request_sample(ac->avctx, "SSR");
return AVERROR_PATCHWELCOME;
}
}
size = avpriv_aac_parse_header(gb, &hdr_info);
if (size > 0) {
if (hdr_info.num_aac_frames != 1) {
- av_log_missing_feature(ac->avctx, "More than one AAC RDB per ADTS frame", 0);
+ avpriv_report_missing_feature(ac->avctx,
+ "More than one AAC RDB per ADTS frame");
return AVERROR_PATCHWELCOME;
}
push_output_configuration(ac);
int err, elem_id;
int samples = 0, multiplier, audio_found = 0, pce_found = 0;
+ ac->frame = data;
+
if (show_bits(gb, 12) == 0xfff) {
if (parse_adts_frame_header(ac, gb) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
multiplier = (ac->oc[1].m4ac.sbr == 1) ? ac->oc[1].m4ac.ext_sample_rate > ac->oc[1].m4ac.sample_rate : 0;
samples <<= multiplier;
- if (samples) {
- ac->frame.nb_samples = samples;
- *(AVFrame *)data = ac->frame;
- }
+ if (samples)
+ ac->frame->nb_samples = samples;
*got_frame_ptr = !!samples;
if (ac->oc[1].status && audio_found) {
asclen = get_bits_left(gb);
if (config_start_bit % 8) {
- av_log_missing_feature(latmctx->aac_ctx.avctx,
- "Non-byte-aligned audio-specific config", 1);
+ avpriv_request_sample(latmctx->aac_ctx.avctx,
+ "Non-byte-aligned audio-specific config");
return AVERROR_PATCHWELCOME;
}
if (asclen <= 0)
skip_bits(gb, 6); // numSubFrames
// numPrograms
if (get_bits(gb, 4)) { // numPrograms
- av_log_missing_feature(latmctx->aac_ctx.avctx,
- "Multiple programs", 1);
+ avpriv_request_sample(latmctx->aac_ctx.avctx, "Multiple programs");
return AVERROR_PATCHWELCOME;
}
// for each layer (which there is only on in DVB)
if (get_bits(gb, 3)) { // numLayer
- av_log_missing_feature(latmctx->aac_ctx.avctx,
- "Multiple layers", 1);
+ avpriv_request_sample(latmctx->aac_ctx.avctx, "Multiple layers");
return AVERROR_PATCHWELCOME;
}