Line data Source code
1 : /****************************************************************************** 2 : * ETSI TS 103 634 V1.6.1 * 3 : * Low Complexity Communication Codec Plus (LC3plus) * 4 : * * 5 : * Copyright licence is solely granted through ETSI Intellectual Property * 6 : * Rights Policy, 3rd April 2019. No patent licence is granted by implication, * 7 : * estoppel or otherwise. * 8 : ******************************************************************************/ 9 : 10 : #include "options.h" 11 : #include "wmc_auto.h" 12 : #include "functions.h" 13 : 14 1941994 : LC3_INT16 getLastNzBits (LC3_INT16 N) 15 : { 16 : LC3_INT16 minBits; 17 : 18 1941994 : minBits = ceil(LC3_LOGTWO(N >> 1)); 19 : #ifdef CR9_C_ADD_1p25MS 20 : /* minimum of 2 spare bits */ 21 1941994 : if (((1 << minBits) - (N >> 1)) < 2) 22 : { 23 0 : minBits++; 24 : } 25 : #endif 26 : 27 1941994 : return minBits; 28 : } 29 :