On Wed, Jun 06, 2012 at 11:32:36AM -0400, Justin Ruggles wrote:
> Based partially on implementation by Michael Niedermayer <[email protected]> in
> libswresample in FFmpeg. See commits:
> 7f1ae79d38c4edba9dbd31d7bf797e525298ac55
> 24ab1abfb6d55bf330022df4b10d7aec80b3f116
> ---
> Do you like this version any better?

The RENAME macros are quite ugly IMO...

> --- /dev/null
> +++ b/libavresample/resample_template.c
> @@ -0,0 +1,102 @@
> +
> +#if defined(CONFIG_RESAMPLE_DBL)
> +#define RENAME(func)  func ## _ ## dbl
> +#elif defined(CONFIG_RESAMPLE_FLT)
> +#define RENAME(func)  func ## _ ## flt
> +#elif defined(CONFIG_RESAMPLE_S32)
> +#define RENAME(func)  func ## _ ## s32
> +#else
> +#define RENAME(func)  func ## _ ## s16
> +#endif

  #define RENAME(func) func ## _foo

would simplify this for starters.

> +static void RENAME(resample_one)(ResampleContext *c, int no_filter, void 
> *dst0,
> +                                 int dst_index, const void *src0, int 
> src_size,
> +                                 int index, int frac)
> +
> +static void RENAME(set_filter)(void *filter0, double *tab, int phase,
> +                               int tap_count)

Maybe something like TYPE or SET_TYPE would be a better name for the
macro.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to