for (i = order-2; i >= 0; i--, k_ptr--, state_ptr--)
{
int k_value = *k_ptr, state_value = *state_ptr;
- x -= shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT);
+ x -= (unsigned)shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT);
state_ptr[1] = state_value + shift_down(k_value * (unsigned)x, LATTICE_SHIFT);
}
#else
for (i = order-2; i >= 0; i--)
{
- x -= shift_down(k[i] * state[i], LATTICE_SHIFT);
+ x -= (unsigned)shift_down(k[i] * state[i], LATTICE_SHIFT);
state[i+1] = state[i] + shift_down(k[i] * x, LATTICE_SHIFT);
}
#endif
put_bits(&pb, 1, 0); // XXX FIXME: no custom tap quant table
flush_put_bits(&pb);
- avctx->extradata_size = put_bits_count(&pb)/8;
+ avctx->extradata_size = put_bytes_output(&pb);
av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d.%d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\n",
s->version, s->minor_version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling);
return ret;
}
-// av_log(avctx, AV_LOG_DEBUG, "used bytes: %d\n", (put_bits_count(&pb)+7)/8);
-
avpkt->size = ff_rac_terminate(&c, 0);
*got_packet_ptr = 1;
return 0;
return buf_size;
}
-AVCodec ff_sonic_decoder = {
+const AVCodec ff_sonic_decoder = {
.name = "sonic",
.long_name = NULL_IF_CONFIG_SMALL("Sonic"),
.type = AVMEDIA_TYPE_AUDIO,
.init = sonic_decode_init,
.close = sonic_decode_close,
.decode = sonic_decode_frame,
- .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | AV_CODEC_CAP_CHANNEL_CONF,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
#endif /* CONFIG_SONIC_DECODER */
#if CONFIG_SONIC_ENCODER
-AVCodec ff_sonic_encoder = {
+const AVCodec ff_sonic_encoder = {
.name = "sonic",
.long_name = NULL_IF_CONFIG_SMALL("Sonic"),
.type = AVMEDIA_TYPE_AUDIO,
#endif
#if CONFIG_SONIC_LS_ENCODER
-AVCodec ff_sonic_ls_encoder = {
+const AVCodec ff_sonic_ls_encoder = {
.name = "sonicls",
.long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"),
.type = AVMEDIA_TYPE_AUDIO,