mirror of
https://github.com/xiph/opus.git
synced 2025-06-02 00:27:43 +00:00
Add validation for weights blob
This commit is contained in:
parent
0098fe70ac
commit
c7b6935bf2
4 changed files with 62 additions and 25 deletions
|
@ -174,6 +174,7 @@ LPCNET_EXPORT int lpcnet_get_size()
|
|||
LPCNET_EXPORT int lpcnet_init(LPCNetState *lpcnet)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
const char* rng_string="LPCNet";
|
||||
memset(lpcnet, 0, lpcnet_get_size());
|
||||
lpcnet->last_exc = lin2ulaw(0.f);
|
||||
|
@ -182,8 +183,9 @@ LPCNET_EXPORT int lpcnet_init(LPCNetState *lpcnet)
|
|||
lpcnet->sampling_logit_table[i] = -log((1-prob)/prob);
|
||||
}
|
||||
kiss99_srand(&lpcnet->rng, (const unsigned char *)rng_string, strlen(rng_string));
|
||||
init_lpcnet_model(&lpcnet->model, lpcnet_arrays);
|
||||
return 0;
|
||||
ret = init_lpcnet_model(&lpcnet->model, lpcnet_arrays);
|
||||
celt_assert(ret == 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue