//@{
/** stream data */
int coding_mode;
- int sample_rate;
ChannelUnit *units;
//@}
output[first] = mantissas[j] * scale_factor;
} else {
/* this subband was not coded, so zero the entire subband */
- memset(output + first, 0, subband_size * sizeof(float));
+ memset(output + first, 0, subband_size * sizeof(*output));
}
}
/* clear the subbands that were not coded */
first = subband_tab[i];
- memset(output + first, 0, (SAMPLES_PER_FRAME - first) * sizeof(float));
+ memset(output + first, 0, (SAMPLES_PER_FRAME - first) * sizeof(*output));
return num_subbands;
}
}
/* Delay for the overlapping part. */
- memcpy(prev, &input[256], 256 * sizeof(float));
+ memcpy(prev, &input[256], 256 * sizeof(*prev));
}
/*
if (band <= num_bands)
imlt(q, &snd->spectrum[band * 256], snd->imdct_buf, band & 1);
else
- memset(snd->imdct_buf, 0, 512 * sizeof(float));
+ memset(snd->imdct_buf, 0, 512 * sizeof(*snd->imdct_buf));
/* gain compensation and overlapping */
gain_compensate_and_overlap(snd->imdct_buf,
init_get_bits(&q->gb, ptr1, avctx->block_align * 8);
/* Fill the Weighting coeffs delay buffer */
- memmove(q->weighting_delay, &q->weighting_delay[2], 4 * sizeof(int));
+ memmove(q->weighting_delay, &q->weighting_delay[2],
+ 4 * sizeof(*q->weighting_delay));
q->weighting_delay[4] = get_bits1(&q->gb);
q->weighting_delay[5] = get_bits(&q->gb, 3);
const uint8_t *edata_ptr = avctx->extradata;
ATRAC3Context *q = avctx->priv_data;
- /* Take data from the AVCodecContext (RM container). */
- q->sample_rate = avctx->sample_rate;
-
if (avctx->channels <= 0 || avctx->channels > 2) {
av_log(avctx, AV_LOG_ERROR, "Channel configuration error!\n");
return AVERROR(EINVAL);
} else {
av_log(NULL, AV_LOG_ERROR, "Unknown extradata size %d.\n",
avctx->extradata_size);
+ return AVERROR(EINVAL);
}
/* Check the extradata */
if (avctx->block_align >= UINT_MAX / 2)
return AVERROR(EINVAL);
- q->decoded_bytes_buffer = av_mallocz(avctx->block_align +
- (4 - avctx->block_align % 4) +
+ q->decoded_bytes_buffer = av_mallocz(FFALIGN(avctx->block_align, 4) +
FF_INPUT_BUFFER_PADDING_SIZE);
if (q->decoded_bytes_buffer == NULL)
return AVERROR(ENOMEM);
avpriv_float_dsp_init(&q->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
ff_fmt_convert_init(&q->fmt_conv, avctx);
- q->units = av_mallocz(sizeof(ChannelUnit) * avctx->channels);
+ q->units = av_mallocz(sizeof(*q->units) * avctx->channels);
if (!q->units) {
atrac3_decode_close(avctx);
return AVERROR(ENOMEM);