The optimization is bit exact with C function.
Change-Id: Ib3bdc26a5a4ebe02e7f24be85104e8e9a2a9a738
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
Coverity warns about the possibly-overlappying memcpy in this
block, presumedly because it can't prove predictLPCOrder <= MAX_LPC_ORDER
here. Add an assert to make the intent clear in code as well
as in the comment.
This is achieved by running the encoding process in a loop and
padding when we don't reach the exact rate. It also implements
VBR-with-cap, which means we no longer need to artificially decrease
the SILK bandwidth when it's close to the cap.
There were assert failures for test cases with mode switching and LBRR enabled.
(some similar problems remain)
Tim identified that the assert was falsely firing while encoding LBRR frames but
the flag doesn't matter while encoding the bitstream it only actually matters in
silk/process_NLSFs.c.