[FFmpeg-devel] [PATCH 1/2] swr/resample: move templating parameters to template itself.
Clément Bœsch
ubitux at gmail.com
Thu Nov 15 21:27:56 CET 2012
On Thu, Nov 15, 2012 at 04:00:38AM +0100, Michael Niedermayer wrote:
> On Wed, Nov 14, 2012 at 11:22:44PM +0100, Clément Bœsch wrote:
> > It has various benefits such as allowing some refactoring, clarifying
> > the code in the inclusion part, and making the template understandable
> > in standalone.
> >
> > This commit is based on the templating method used by Justin Ruggles for
> > libavresample.
> > ---
> > libswresample/resample.c | 127 +++++---------------------------------
> > libswresample/resample_template.c | 67 ++++++++++++++++++++
> > 2 files changed, 82 insertions(+), 112 deletions(-)
> >
> > diff --git a/libswresample/resample.c b/libswresample/resample.c
> > index bf412dd..2a0d06e 100644
> > --- a/libswresample/resample.c
> > +++ b/libswresample/resample.c
> > @@ -289,132 +289,35 @@ int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensatio
> > return 0;
> > }
> >
> > -#define RENAME(N) N ## _int16
> > -#define FILTER_SHIFT 15
> > -#define DELEM int16_t
> > -#define FELEM int16_t
> > -#define FELEM2 int32_t
> > -#define FELEML int64_t
> > -#define FELEM_MAX INT16_MAX
> > -#define FELEM_MIN INT16_MIN
> > -#define OUT(d, v) v = (v + (1<<(FILTER_SHIFT-1)))>>FILTER_SHIFT;\
> > - d = (unsigned)(v + 32768) > 65535 ? (v>>31) ^ 32767 : v
>
> > +#define CONFIG_RESAMPLE_S16
>
> maybe something else than CONFIG_* should be used here, so theres a
> clear seperation from configure/config.h setup #defines
> rest LGTM
Indeed, renamed to TEMPLATE_*, added some indent as noted in the other
patch, and applied.
[...]
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121115/90addfc7/attachment.asc>
More information about the ffmpeg-devel
mailing list