av_log(avctx, AV_LOG_ERROR, "Only mono and stereo is supported\n");
return AVERROR(EINVAL);
}
+ avctx->bits_per_raw_sample =
s->bps = avctx->bits_per_coded_sample;
switch (s->bps) {
case 8:
static inline int ape_decode_value_3990(APEContext *ctx, APERice *rice)
{
- unsigned int x, overflow;
- int base, pivot;
+ unsigned int x, overflow, pivot;
+ int base;
- pivot = rice->ksum >> 5;
- if (pivot == 0)
- pivot = 1;
+ pivot = FFMAX(rice->ksum >> 5, 1);
overflow = range_get_symbol(ctx, counts_3980, counts_diff_3980);
/* Version 3.98 and later files */
/* Update the adaption coefficients */
- absres = FFABS(res);
+ absres = FFABSU(res);
if (absres)
*f->adaptcoeffs = APESIGN(res) *
(8 << ((absres > f->avg * 3) + (absres > f->avg * 4 / 3)));
.version = LIBAVUTIL_VERSION_INT,
};
-AVCodec ff_ape_decoder = {
+const AVCodec ff_ape_decoder = {
.name = "ape",
.long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
.type = AVMEDIA_TYPE_AUDIO,