1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

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

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit d4582889ee)
This commit is contained in:
Justin Ruggles 2011-02-10 21:15:01 +00:00 committed by Michael Niedermayer
parent 4ca29c6534
commit 95234e051b

View File

@ -286,19 +286,15 @@ static int log2_tab(int16_t *tab, int n)
* Left-shift each value in an array by a specified amount.
* @param tab input 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;
if (lshift > 0) {
for (i = 0; i < n; i++)
tab[i] <<= lshift;
} else if (lshift < 0) {
lshift = -lshift;
for (i = 0; i < n; i++)
tab[i] >>= lshift;
}
}