[FFmpeg-soc] [soc]: r2713 - nellyenc/nellymoserenc.c

Benoit Fouet benoit.fouet at purplelabs.com
Tue Jul 8 14:45:35 CEST 2008


bwolowiec wrote:
> Author: bwolowiec
> Date: Mon Jul  7 15:20:48 2008
> New Revision: 2713
>
> Log:
> use binary search instead of linear search
>
>
> Modified:
>    nellyenc/nellymoserenc.c
>
> Modified: nellyenc/nellymoserenc.c
> ==============================================================================
> --- nellyenc/nellymoserenc.c	(original)
> +++ nellyenc/nellymoserenc.c	Mon Jul  7 15:20:48 2008
> @@ -146,6 +146,28 @@ static av_cold int encode_end(AVCodecCon
>      return 0;
>  }
>  
> +/*
> + * Searching index in table with size table_size, where
> + * |val-table[best_idx]| is minimal.
> + * It assumes that table elements increasing order and uses binary search.
> + */
> +#define find_best_value(val, table, table_size, best_idx) \
>   

couldn't that be a function instead of a macro ?

-- 
Benoit Fouet
Purple Labs S.A.
www.purplelabs.com



More information about the FFmpeg-soc mailing list