Update Opus range coder due to CELT refactoring.
The byte buffer is now part of the range coder struct itself, and rangeenc.c and rangedec.c have gone away.
This commit is contained in:
parent
50b20d78a3
commit
a1dd0fcf93
5 changed files with 7 additions and 13 deletions
2
celt
2
celt
|
@ -1 +1 @@
|
||||||
Subproject commit ef986e44211bc0fd3820700b61e552828a0d8c65
|
Subproject commit 7d2200be41538645b5e5765b4aa2ea5bab990030
|
|
@ -12,7 +12,5 @@ celt/libcelt/modes.c \
|
||||||
celt/libcelt/pitch.c \
|
celt/libcelt/pitch.c \
|
||||||
celt/libcelt/plc.c \
|
celt/libcelt/plc.c \
|
||||||
celt/libcelt/quant_bands.c \
|
celt/libcelt/quant_bands.c \
|
||||||
celt/libcelt/rangedec.c \
|
|
||||||
celt/libcelt/rangeenc.c \
|
|
||||||
celt/libcelt/rate.c \
|
celt/libcelt/rate.c \
|
||||||
celt/libcelt/vq.c
|
celt/libcelt/vq.c
|
||||||
|
|
2
silk
2
silk
|
@ -1 +1 @@
|
||||||
Subproject commit 111b23f648a45d3a034050e579a531d0592dc720
|
Subproject commit fc06bda89e40f8adfa1af9cebf869e63ef693bb5
|
|
@ -79,7 +79,6 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
|
||||||
{
|
{
|
||||||
int i, silk_ret=0, celt_ret=0;
|
int i, silk_ret=0, celt_ret=0;
|
||||||
ec_dec dec;
|
ec_dec dec;
|
||||||
ec_byte_buffer buf;
|
|
||||||
SKP_SILK_SDK_DecControlStruct DecControl;
|
SKP_SILK_SDK_DecControlStruct DecControl;
|
||||||
SKP_int32 silk_frame_size;
|
SKP_int32 silk_frame_size;
|
||||||
short pcm_celt[960*2];
|
short pcm_celt[960*2];
|
||||||
|
@ -116,8 +115,7 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
|
||||||
|
|
||||||
len -= 1;
|
len -= 1;
|
||||||
data += 1;
|
data += 1;
|
||||||
ec_byte_readinit(&buf,(unsigned char*)data,len);
|
ec_dec_init(&dec,(unsigned char*)data,len);
|
||||||
ec_dec_init(&dec,&buf);
|
|
||||||
} else {
|
} else {
|
||||||
audiosize = frame_size;
|
audiosize = frame_size;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,6 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
|
||||||
int ret=0;
|
int ret=0;
|
||||||
SKP_int32 nBytes;
|
SKP_int32 nBytes;
|
||||||
ec_enc enc;
|
ec_enc enc;
|
||||||
ec_byte_buffer buf;
|
|
||||||
int framerate, period;
|
int framerate, period;
|
||||||
int silk_internal_bandwidth;
|
int silk_internal_bandwidth;
|
||||||
int bytes_target;
|
int bytes_target;
|
||||||
|
@ -103,8 +102,7 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
|
||||||
bytes_target = st->bitrate_bps * frame_size / (st->Fs * 8) - 1;
|
bytes_target = st->bitrate_bps * frame_size / (st->Fs * 8) - 1;
|
||||||
|
|
||||||
data += 1;
|
data += 1;
|
||||||
ec_byte_writeinit_buffer(&buf, data, max_data_bytes-1);
|
ec_enc_init(&enc, data, max_data_bytes-1);
|
||||||
ec_enc_init(&enc,&buf);
|
|
||||||
|
|
||||||
/* SILK processing */
|
/* SILK processing */
|
||||||
if (st->mode != MODE_CELT_ONLY) {
|
if (st->mode != MODE_CELT_ONLY) {
|
||||||
|
@ -194,7 +192,7 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
|
||||||
int len;
|
int len;
|
||||||
celt_encoder_ctl(st->celt_enc, CELT_SET_START_BAND(17));
|
celt_encoder_ctl(st->celt_enc, CELT_SET_START_BAND(17));
|
||||||
|
|
||||||
len = (ec_enc_tell(&enc, 0)+7)>>3;
|
len = (ec_tell(&enc)+7)>>3;
|
||||||
if( st->use_vbr ) {
|
if( st->use_vbr ) {
|
||||||
nb_compr_bytes = len + (st->bitrate_bps - 12000) * frame_size / (2 * 8 * st->Fs);
|
nb_compr_bytes = len + (st->bitrate_bps - 12000) * frame_size / (2 * 8 * st->Fs);
|
||||||
} else {
|
} else {
|
||||||
|
@ -218,14 +216,14 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
|
||||||
for (;i<frame_size*st->channels;i++)
|
for (;i<frame_size*st->channels;i++)
|
||||||
pcm_buf[i] = pcm[i-ENCODER_DELAY_COMPENSATION*st->channels];
|
pcm_buf[i] = pcm[i-ENCODER_DELAY_COMPENSATION*st->channels];
|
||||||
|
|
||||||
ec_byte_shrink(&buf, nb_compr_bytes);
|
ec_enc_shrink(&enc, nb_compr_bytes);
|
||||||
|
|
||||||
/* Encode high band with CELT */
|
/* Encode high band with CELT */
|
||||||
ret = celt_encode_with_ec(st->celt_enc, pcm_buf, frame_size, NULL, nb_compr_bytes, &enc);
|
ret = celt_encode_with_ec(st->celt_enc, pcm_buf, frame_size, NULL, nb_compr_bytes, &enc);
|
||||||
for (i=0;i<ENCODER_DELAY_COMPENSATION*st->channels;i++)
|
for (i=0;i<ENCODER_DELAY_COMPENSATION*st->channels;i++)
|
||||||
st->delay_buffer[i] = pcm[frame_size*st->channels-ENCODER_DELAY_COMPENSATION*st->channels+i];
|
st->delay_buffer[i] = pcm[frame_size*st->channels-ENCODER_DELAY_COMPENSATION*st->channels+i];
|
||||||
} else {
|
} else {
|
||||||
ret = (ec_enc_tell(&enc, 0)+7)>>3;
|
ret = (ec_tell(&enc)+7)>>3;
|
||||||
ec_enc_done(&enc);
|
ec_enc_done(&enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue