Commit d4582889 authored by Justin Ruggles's avatar Justin Ruggles Committed by Mans Rullgard

ac3enc: remove right shifting from lshift_tab() and make lshift unsigned.

Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent 0b1d291a
...@@ -286,19 +286,15 @@ static int log2_tab(int16_t *tab, int n) ...@@ -286,19 +286,15 @@ static int log2_tab(int16_t *tab, int n)
* Left-shift each value in an array by a specified amount. * Left-shift each value in an array by a specified amount.
* @param tab input array * @param tab input array
* @param n number of values in the array * @param n number of values in the array
* @param lshift left shift amount. a negative value means right shift. * @param lshift left shift amount
*/ */
static void lshift_tab(int16_t *tab, int n, int lshift) static void lshift_tab(int16_t *tab, int n, unsigned int lshift)
{ {
int i; int i;
if (lshift > 0) { if (lshift > 0) {
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
tab[i] <<= lshift; tab[i] <<= lshift;
} else if (lshift < 0) {
lshift = -lshift;
for (i = 0; i < n; i++)
tab[i] >>= lshift;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment