Skip to content

Commit

Permalink
Fix 158e706: Correct shifting for celt_log2()
Browse files Browse the repository at this point in the history
  • Loading branch information
jmvalin committed Jan 17, 2025
1 parent fe07cb4 commit 75b65fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions celt/celt_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,8 @@ static int alloc_trim_analysis(const CELTMode *m, const celt_norm *X,
logXC2 = MAX16(HALF16(logXC), celt_log2(QCONST32(1.001f, 20)-MULT16_16(minXC, minXC)));
#ifdef FIXED_POINT
/* Compensate for Q20 vs Q14 input and convert output to Q8 */
logXC = PSHR32(logXC-GCONST(6.f),DB_SHIFT-8);
logXC2 = PSHR32(logXC2-GCONST(6.f),DB_SHIFT-8);
logXC = PSHR32(logXC-QCONST16(6.f, 10),10-8);
logXC2 = PSHR32(logXC2-QCONST16(6.f, 10),10-8);
#endif

trim += MAX16(-QCONST16(4.f, 8), MULT16_16_Q15(QCONST16(.75f,15),logXC));
Expand Down

0 comments on commit 75b65fd

Please sign in to comment.