#include <stdint.h>
+#include "mathops.h"
#include "opus.h"
+#include "opus_rc.h"
+#include "opus_silk.h"
#include "opustab.h"
+#define ROUND_MULL(a,b,s) (((MUL64(a, b) >> ((s) - 1)) + 1) >> 1)
+
typedef struct SilkFrame {
int coded;
int log_gain;
} SilkFrame;
struct SilkContext {
- AVCodecContext *avctx;
+ void *logctx;
int output_channels;
int midonly;
if (bandwidth > OPUS_BANDWIDTH_WIDEBAND ||
coded_channels > 2 || duration_ms > 60) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid parameters passed "
+ av_log(s->logctx, AV_LOG_ERROR, "Invalid parameters passed "
"to the SILK decoder.\n");
return AVERROR(EINVAL);
}
int active1 = (j == 0 && !(redundancy[1] & (1 << i))) ? 0 : 1;
silk_decode_frame(s, rc, i, j, coded_channels, 1, active1, 1);
}
+
+ s->midonly = 0;
}
for (i = 0; i < nb_frames; i++) {
memset(s->prev_stereo_weights, 0, sizeof(s->prev_stereo_weights));
}
-int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels)
+int ff_silk_init(void *logctx, SilkContext **ps, int output_channels)
{
SilkContext *s;
if (output_channels != 1 && output_channels != 2) {
- av_log(avctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n",
+ av_log(logctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n",
output_channels);
return AVERROR(EINVAL);
}
if (!s)
return AVERROR(ENOMEM);
- s->avctx = avctx;
+ s->logctx = logctx;
s->output_channels = output_channels;
ff_silk_flush(s);