No need to memset() the byte buffer
This commit is contained in:
parent
bb4f63f4a0
commit
30d5125bff
2 changed files with 5 additions and 6 deletions
|
@ -734,9 +734,6 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, c
|
||||||
if (LM>=MAX_CONFIG_SIZES)
|
if (LM>=MAX_CONFIG_SIZES)
|
||||||
return CELT_BAD_ARG;
|
return CELT_BAD_ARG;
|
||||||
M=1<<LM;
|
M=1<<LM;
|
||||||
/* The memset is important for now in case the encoder doesn't
|
|
||||||
fill up all the bytes */
|
|
||||||
CELT_MEMSET(compressed, 0, nbCompressedBytes);
|
|
||||||
|
|
||||||
if (enc==NULL)
|
if (enc==NULL)
|
||||||
{
|
{
|
||||||
|
@ -1056,6 +1053,10 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If there's any room left (can only happen for very high rates),
|
||||||
|
fill it with zeros */
|
||||||
|
while (nbCompressedBytes*8 - ec_enc_tell(enc,0) >= 8)
|
||||||
|
ec_enc_bits(enc, 0, 8);
|
||||||
ec_enc_done(enc);
|
ec_enc_done(enc);
|
||||||
|
|
||||||
RESTORE_STACK;
|
RESTORE_STACK;
|
||||||
|
|
|
@ -38,8 +38,6 @@
|
||||||
#include "arch.h"
|
#include "arch.h"
|
||||||
|
|
||||||
|
|
||||||
#define EC_BUFFER_INCREMENT (256)
|
|
||||||
|
|
||||||
void ec_byte_writeinit_buffer(ec_byte_buffer *_b, unsigned char *_buf, long _size){
|
void ec_byte_writeinit_buffer(ec_byte_buffer *_b, unsigned char *_buf, long _size){
|
||||||
_b->ptr=_b->buf=_buf;
|
_b->ptr=_b->buf=_buf;
|
||||||
_b->end_ptr=_b->buf+_size-1;
|
_b->end_ptr=_b->buf+_size-1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue