int16_t filters[32]; // filters for every subframe
} TSContext;
-static int truespeech_decode_init(AVCodecContext * avctx)
+static av_cold int truespeech_decode_init(AVCodecContext * avctx)
{
// TSContext *c = avctx->priv_data;
return 0;
}
-static void truespeech_read_frame(TSContext *dec, uint8_t *input)
+static void truespeech_read_frame(TSContext *dec, const uint8_t *input)
{
uint32_t t;
static int truespeech_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- uint8_t *buf, int buf_size)
+ const uint8_t *buf, int buf_size)
{
TSContext *c = avctx->priv_data;
- int i;
+ int i, j;
short *samples = data;
int consumed = 0;
int16_t out_buf[240];
+ int iterations;
if (!buf_size)
return 0;
- while (consumed < buf_size) {
+ iterations = FFMIN(buf_size / 32, *data_size / 480);
+ for(j = 0; j < iterations; j++) {
truespeech_read_frame(c, buf + consumed);
consumed += 32;
*data_size = consumed * 15;
- return buf_size;
+ return consumed;
}
AVCodec truespeech_decoder = {
NULL,
NULL,
truespeech_decode_frame,
+ .long_name = "DSP Group TrueSpeech",
};