Replaces log2() with celt_log2() and fixes a potential divide-by-zero