[FFmpeg-devel] [PATCH 1/2] ac3enc: remove right shifting from lshift_tab() and make lshift unsigned.
Måns Rullgård
mans
Thu Feb 10 23:36:58 CET 2011
Justin Ruggles <justin.ruggles at gmail.com> writes:
> ---
> libavcodec/ac3enc_fixed.c | 8 ++------
> 1 files changed, 2 insertions(+), 6 deletions(-)
>
>
> diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c
> index 90e148b..ff400b8 100644
> --- a/libavcodec/ac3enc_fixed.c
> +++ b/libavcodec/ac3enc_fixed.c
> @@ -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;
> }
> }
I take your word for it that it's never negative. Queued.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list