API: Change celt_encode and celt_encode_float so that they take an optional synthesis parameter after the PCM input. If optional_synthesis is null the encoder will be able to save some computation. If optional_synthesis is non-null if will be used to write the encoder's expectation of the decoder's output. Synthesis may alias the input pcm, so calling the encoder with the same buffer twice will achieve the old behavior. Remove 'restrict' from the CTL prototype.
This commit is contained in:
parent
c18fb1d031
commit
8259531160
5 changed files with 36 additions and 31 deletions
|
@ -116,7 +116,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
/* Setup audio device */
|
||||
audio_dev = alsa_device_open(argv[1], SAMPLING_RATE, 1, FRAME_SIZE);
|
||||
audio_dev = alsa_device_open(argv[1], SAMPLING_RATE, 2, FRAME_SIZE);
|
||||
|
||||
/* Setup the encoder and decoder in wideband */
|
||||
CELTEncoder *enc_state;
|
||||
|
@ -210,7 +210,7 @@ int main(int argc, char *argv[])
|
|||
pcm[i] = pcm2[i];
|
||||
|
||||
/* Encode */
|
||||
celt_encode(enc_state, pcm, outpacket+4, packetSize);
|
||||
celt_encode(enc_state, pcm, NULL, outpacket+4, packetSize);
|
||||
|
||||
/* Pseudo header: four null bytes and a 32-bit timestamp */
|
||||
((int*)outpacket)[0] = send_timestamp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue