*/
#include "libavutil/internal.h"
+#include "libavutil/mem_internal.h"
#include "libavutil/samplefmt.h"
#define BITSTREAM_READER_LE
} else {
shift = 0;
}
- s->uval = FFALIGN(avctx->sample_rate + 511 >> 9, 4) << shift;
- s->subframe_scale = FFALIGN(avctx->sample_rate + 511 >> 9, 4) << 1;
+ s->uval = FFALIGN(avctx->sample_rate + 511LL >> 9, 4) << shift;
+ s->subframe_scale = FFALIGN(avctx->sample_rate + 511LL >> 9, 4) << 1;
}
static av_cold int tak_decode_init(AVCodecContext *avctx)
s->residues[i ] * s->filter[0];
}
- v = av_clip_intp2(v >> 10, 13) * (1 << dshift) - *p1;
+ v = av_clip_intp2(v >> 10, 13) * (1U << dshift) - *p1;
*p1++ = v;
}
}
#if HAVE_THREADS
-static int init_thread_copy(AVCodecContext *avctx)
-{
- TAKDecContext *s = avctx->priv_data;
- s->avctx = avctx;
- return 0;
-}
-
static int update_thread_context(AVCodecContext *dst,
const AVCodecContext *src)
{
.init = tak_decode_init,
.close = tak_decode_close,
.decode = tak_decode_frame,
- .init_thread_copy = ONLY_IF_THREADS_ENABLED(init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context),
- .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P,
AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_S32P,