diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavresample | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavresample')
24 files changed, 321 insertions, 307 deletions
diff --git a/ffmpeg/libavresample/Makefile b/ffmpeg/libavresample/Makefile index 6805280..bca23a9 100644 --- a/ffmpeg/libavresample/Makefile +++ b/ffmpeg/libavresample/Makefile @@ -13,4 +13,7 @@ OBJS = audio_convert.o \ resample.o \ utils.o \ +# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += avresampleres.o + TESTPROGS = avresample diff --git a/ffmpeg/libavresample/audio_convert.c b/ffmpeg/libavresample/audio_convert.c index 371617c..e73105d 100644 --- a/ffmpeg/libavresample/audio_convert.c +++ b/ffmpeg/libavresample/audio_convert.c @@ -2,20 +2,20 @@ * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/ffmpeg/libavresample/audio_convert.h b/ffmpeg/libavresample/audio_convert.h index 6a3089d..5cf6b9d 100644 --- a/ffmpeg/libavresample/audio_convert.h +++ b/ffmpeg/libavresample/audio_convert.h @@ -1,20 +1,20 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/ffmpeg/libavresample/audio_data.c b/ffmpeg/libavresample/audio_data.c index c52f518..1521d7e 100644 --- a/ffmpeg/libavresample/audio_data.c +++ b/ffmpeg/libavresample/audio_data.c @@ -1,20 +1,20 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/ffmpeg/libavresample/audio_data.h b/ffmpeg/libavresample/audio_data.h index 97236bb..b2b8bdd 100644 --- a/ffmpeg/libavresample/audio_data.h +++ b/ffmpeg/libavresample/audio_data.h @@ -1,20 +1,20 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/ffmpeg/libavresample/audio_mix.c b/ffmpeg/libavresample/audio_mix.c index b69bfbc..1b48fe5 100644 --- a/ffmpeg/libavresample/audio_mix.c +++ b/ffmpeg/libavresample/audio_mix.c @@ -1,20 +1,20 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -201,23 +201,23 @@ static void mix_1_to_2_fltp_flt_c(float **samples, float **matrix, int len, while (len > 4) { v = *src++; - *dst0++ = v * m1; - *dst1++ = v * m0; + *dst0++ = v * m0; + *dst1++ = v * m1; v = *src++; - *dst0++ = v * m1; - *dst1++ = v * m0; + *dst0++ = v * m0; + *dst1++ = v * m1; v = *src++; - *dst0++ = v * m1; - *dst1++ = v * m0; + *dst0++ = v * m0; + *dst1++ = v * m1; v = *src++; - *dst0++ = v * m1; - *dst1++ = v * m0; + *dst0++ = v * m0; + *dst1++ = v * m1; len -= 4; } while (len > 0) { v = *src++; - *dst0++ = v * m1; - *dst1++ = v * m0; + *dst0++ = v * m0; + *dst1++ = v * m1; len--; } } @@ -282,7 +282,7 @@ static void mix_2_to_6_fltp_flt_c(float **samples, float **matrix, int len, } } -static int mix_function_init(AudioMix *am) +static av_cold int mix_function_init(AudioMix *am) { am->func_descr = am->func_descr_generic = "n/a"; am->mix = am->mix_generic = NULL; diff --git a/ffmpeg/libavresample/audio_mix.h b/ffmpeg/libavresample/audio_mix.h index 5bae5ab..0187d0f 100644 --- a/ffmpeg/libavresample/audio_mix.h +++ b/ffmpeg/libavresample/audio_mix.h @@ -1,20 +1,20 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/ffmpeg/libavresample/audio_mix_matrix.c b/ffmpeg/libavresample/audio_mix_matrix.c index 8da1b48..935ed5a 100644 --- a/ffmpeg/libavresample/audio_mix_matrix.c +++ b/ffmpeg/libavresample/audio_mix_matrix.c @@ -2,20 +2,20 @@ * Copyright (C) 2011 Michael Niedermayer (michaelni@gmx.at) * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/ffmpeg/libavresample/avresample-test.c b/ffmpeg/libavresample/avresample-test.c index 81e9bf0..290ae94 100644 --- a/ffmpeg/libavresample/avresample-test.c +++ b/ffmpeg/libavresample/avresample-test.c @@ -2,20 +2,20 @@ * Copyright (c) 2002 Fabrice Bellard * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -91,7 +91,7 @@ static void audiogen(AVLFG *rnd, void **data, enum AVSampleFormat sample_fmt, k = 0; - /* 1 second of single freq sinus at 1000 Hz */ + /* 1 second of single freq sine at 1000 Hz */ a = 0; for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) { v = sin(a) * 0.30; diff --git a/ffmpeg/libavresample/avresample.h b/ffmpeg/libavresample/avresample.h index d26f2ca..f62e533 100644 --- a/ffmpeg/libavresample/avresample.h +++ b/ffmpeg/libavresample/avresample.h @@ -1,20 +1,20 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -272,7 +272,7 @@ int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix, * * Examples: * - * Reordering 5.1 AAC order (C,L,R,Ls,Rs,LFE) to Libav order (L,R,C,LFE,Ls,Rs): + * Reordering 5.1 AAC order (C,L,R,Ls,Rs,LFE) to FFmpeg order (L,R,C,LFE,Ls,Rs): * { 1, 2, 0, 5, 3, 4 } * * Muting the 3rd channel in 4-channel input: diff --git a/ffmpeg/libavresample/dither.c b/ffmpeg/libavresample/dither.c index f24bf5c..2ae8d33 100644 --- a/ffmpeg/libavresample/dither.c +++ b/ffmpeg/libavresample/dither.c @@ -4,20 +4,20 @@ * Triangular with Noise Shaping is based on opusfile. * Copyright (c) 1994-2012 by the Xiph.Org Foundation and contributors * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -31,6 +31,7 @@ #include <math.h> #include <stdint.h> +#include "libavutil/attributes.h" #include "libavutil/common.h" #include "libavutil/lfg.h" #include "libavutil/mem.h" @@ -325,8 +326,8 @@ void ff_dither_free(DitherContext **cp) av_freep(cp); } -static void dither_init(DitherDSPContext *ddsp, - enum AVResampleDitherMethod method) +static av_cold void dither_init(DitherDSPContext *ddsp, + enum AVResampleDitherMethod method) { ddsp->quantize = quantize_c; ddsp->ptr_align = 1; diff --git a/ffmpeg/libavresample/dither.h b/ffmpeg/libavresample/dither.h index 8db3714..c53e822 100644 --- a/ffmpeg/libavresample/dither.h +++ b/ffmpeg/libavresample/dither.h @@ -1,20 +1,20 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/ffmpeg/libavresample/internal.h b/ffmpeg/libavresample/internal.h index 057f89a..2946126 100644 --- a/ffmpeg/libavresample/internal.h +++ b/ffmpeg/libavresample/internal.h @@ -1,20 +1,20 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/ffmpeg/libavresample/options.c b/ffmpeg/libavresample/options.c index 39c415b..5f08cd7 100644 --- a/ffmpeg/libavresample/options.c +++ b/ffmpeg/libavresample/options.c @@ -1,23 +1,25 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <stdint.h> + #include "libavutil/mathematics.h" #include "libavutil/mem.h" #include "libavutil/opt.h" @@ -33,7 +35,7 @@ #define OFFSET(x) offsetof(AVAudioResampleContext, x) #define PARAM AV_OPT_FLAG_AUDIO_PARAM -static const AVOption options[] = { +static const AVOption avresample_options[] = { { "in_channel_layout", "Input Channel Layout", OFFSET(in_channel_layout), AV_OPT_TYPE_INT64, { .i64 = 0 }, INT64_MIN, INT64_MAX, PARAM }, { "in_sample_fmt", "Input Sample Format", OFFSET(in_sample_fmt), AV_OPT_TYPE_INT, { .i64 = AV_SAMPLE_FMT_S16 }, AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NB-1, PARAM }, { "in_sample_rate", "Input Sample Rate", OFFSET(in_sample_rate), AV_OPT_TYPE_INT, { .i64 = 48000 }, 1, INT_MAX, PARAM }, @@ -87,7 +89,7 @@ static const AVOption options[] = { static const AVClass av_resample_context_class = { .class_name = "AVAudioResampleContext", .item_name = av_default_item_name, - .option = options, + .option = avresample_options, .version = LIBAVUTIL_VERSION_INT, }; diff --git a/ffmpeg/libavresample/resample.c b/ffmpeg/libavresample/resample.c index 69c9bab..525828c 100644 --- a/ffmpeg/libavresample/resample.c +++ b/ffmpeg/libavresample/resample.c @@ -2,20 +2,20 @@ * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at> * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/ffmpeg/libavresample/resample.h b/ffmpeg/libavresample/resample.h index 4544dab..3b56baa 100644 --- a/ffmpeg/libavresample/resample.h +++ b/ffmpeg/libavresample/resample.h @@ -1,20 +1,20 @@ /* * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/ffmpeg/libavresample/utils.c b/ffmpeg/libavresample/utils.c index c159e33..db1e087 100644 --- a/ffmpeg/libavresample/utils.c +++ b/ffmpeg/libavresample/utils.c @@ -1,20 +1,20 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -438,7 +438,8 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr, resample_out = &output_buffer; else resample_out = avr->resample_out_buffer; - av_dlog(avr, "[resample] %s to %s\n", current_buffer->name, + av_dlog(avr, "[resample] %s to %s\n", + current_buffer ? current_buffer->name : "null", resample_out->name); ret = ff_audio_resample(avr->resample, resample_out, current_buffer); diff --git a/ffmpeg/libavresample/version.h b/ffmpeg/libavresample/version.h index 387d097..4495c2f 100644 --- a/ffmpeg/libavresample/version.h +++ b/ffmpeg/libavresample/version.h @@ -1,24 +1,32 @@ /* - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVRESAMPLE_VERSION_H #define AVRESAMPLE_VERSION_H +/** + * @file + * @ingroup lavr + * Libavresample version macros. + */ + +#include "libavutil/version.h" + #define LIBAVRESAMPLE_VERSION_MAJOR 1 #define LIBAVRESAMPLE_VERSION_MINOR 1 #define LIBAVRESAMPLE_VERSION_MICRO 0 diff --git a/ffmpeg/libavresample/x86/audio_convert.asm b/ffmpeg/libavresample/x86/audio_convert.asm index 1d125c2..3e21f26 100644 --- a/ffmpeg/libavresample/x86/audio_convert.asm +++ b/ffmpeg/libavresample/x86/audio_convert.asm @@ -3,20 +3,20 @@ ;* Copyright (c) 2008 Loren Merritt ;* Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> ;* -;* This file is part of Libav. +;* This file is part of FFmpeg. ;* -;* Libav is free software; you can redistribute it and/or +;* FFmpeg is free software; you can redistribute it and/or ;* modify it under the terms of the GNU Lesser General Public ;* License as published by the Free Software Foundation; either ;* version 2.1 of the License, or (at your option) any later version. ;* -;* Libav is distributed in the hope that it will be useful, +;* FFmpeg is distributed in the hope that it will be useful, ;* but WITHOUT ANY WARRANTY; without even the implied warranty of ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;* Lesser General Public License for more details. ;* ;* You should have received a copy of the GNU Lesser General Public -;* License along with Libav; if not, write to the Free Software +;* License along with FFmpeg; if not, write to the Free Software ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;****************************************************************************** diff --git a/ffmpeg/libavresample/x86/audio_convert_init.c b/ffmpeg/libavresample/x86/audio_convert_init.c index 879108d..d88ddac 100644 --- a/ffmpeg/libavresample/x86/audio_convert_init.c +++ b/ffmpeg/libavresample/x86/audio_convert_init.c @@ -1,20 +1,20 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -25,135 +25,135 @@ /* flat conversions */ -extern void ff_conv_s16_to_s32_sse2(int16_t *dst, const int32_t *src, int len); +void ff_conv_s16_to_s32_sse2(int16_t *dst, const int32_t *src, int len); -extern void ff_conv_s16_to_flt_sse2(float *dst, const int16_t *src, int len); -extern void ff_conv_s16_to_flt_sse4(float *dst, const int16_t *src, int len); +void ff_conv_s16_to_flt_sse2(float *dst, const int16_t *src, int len); +void ff_conv_s16_to_flt_sse4(float *dst, const int16_t *src, int len); -extern void ff_conv_s32_to_s16_mmx (int16_t *dst, const int32_t *src, int len); -extern void ff_conv_s32_to_s16_sse2(int16_t *dst, const int32_t *src, int len); +void ff_conv_s32_to_s16_mmx (int16_t *dst, const int32_t *src, int len); +void ff_conv_s32_to_s16_sse2(int16_t *dst, const int32_t *src, int len); -extern void ff_conv_s32_to_flt_sse2(float *dst, const int32_t *src, int len); -extern void ff_conv_s32_to_flt_avx (float *dst, const int32_t *src, int len); +void ff_conv_s32_to_flt_sse2(float *dst, const int32_t *src, int len); +void ff_conv_s32_to_flt_avx (float *dst, const int32_t *src, int len); -extern void ff_conv_flt_to_s16_sse2(int16_t *dst, const float *src, int len); +void ff_conv_flt_to_s16_sse2(int16_t *dst, const float *src, int len); -extern void ff_conv_flt_to_s32_sse2(int32_t *dst, const float *src, int len); -extern void ff_conv_flt_to_s32_avx (int32_t *dst, const float *src, int len); +void ff_conv_flt_to_s32_sse2(int32_t *dst, const float *src, int len); +void ff_conv_flt_to_s32_avx (int32_t *dst, const float *src, int len); /* interleave conversions */ -extern void ff_conv_s16p_to_s16_2ch_sse2(int16_t *dst, int16_t *const *src, - int len, int channels); -extern void ff_conv_s16p_to_s16_2ch_avx (int16_t *dst, int16_t *const *src, - int len, int channels); +void ff_conv_s16p_to_s16_2ch_sse2(int16_t *dst, int16_t *const *src, + int len, int channels); +void ff_conv_s16p_to_s16_2ch_avx (int16_t *dst, int16_t *const *src, + int len, int channels); -extern void ff_conv_s16p_to_s16_6ch_sse2(int16_t *dst, int16_t *const *src, - int len, int channels); -extern void ff_conv_s16p_to_s16_6ch_sse2slow(int16_t *dst, int16_t *const *src, - int len, int channels); -extern void ff_conv_s16p_to_s16_6ch_avx (int16_t *dst, int16_t *const *src, - int len, int channels); +void ff_conv_s16p_to_s16_6ch_sse2(int16_t *dst, int16_t *const *src, + int len, int channels); +void ff_conv_s16p_to_s16_6ch_sse2slow(int16_t *dst, int16_t *const *src, + int len, int channels); +void ff_conv_s16p_to_s16_6ch_avx (int16_t *dst, int16_t *const *src, + int len, int channels); -extern void ff_conv_s16p_to_flt_2ch_sse2(float *dst, int16_t *const *src, - int len, int channels); -extern void ff_conv_s16p_to_flt_2ch_avx (float *dst, int16_t *const *src, - int len, int channels); +void ff_conv_s16p_to_flt_2ch_sse2(float *dst, int16_t *const *src, + int len, int channels); +void ff_conv_s16p_to_flt_2ch_avx (float *dst, int16_t *const *src, + int len, int channels); -extern void ff_conv_s16p_to_flt_6ch_sse2 (float *dst, int16_t *const *src, - int len, int channels); -extern void ff_conv_s16p_to_flt_6ch_ssse3(float *dst, int16_t *const *src, - int len, int channels); -extern void ff_conv_s16p_to_flt_6ch_avx (float *dst, int16_t *const *src, - int len, int channels); +void ff_conv_s16p_to_flt_6ch_sse2 (float *dst, int16_t *const *src, + int len, int channels); +void ff_conv_s16p_to_flt_6ch_ssse3(float *dst, int16_t *const *src, + int len, int channels); +void ff_conv_s16p_to_flt_6ch_avx (float *dst, int16_t *const *src, + int len, int channels); -extern void ff_conv_fltp_to_s16_2ch_sse2 (int16_t *dst, float *const *src, - int len, int channels); -extern void ff_conv_fltp_to_s16_2ch_ssse3(int16_t *dst, float *const *src, - int len, int channels); +void ff_conv_fltp_to_s16_2ch_sse2 (int16_t *dst, float *const *src, + int len, int channels); +void ff_conv_fltp_to_s16_2ch_ssse3(int16_t *dst, float *const *src, + int len, int channels); -extern void ff_conv_fltp_to_s16_6ch_sse (int16_t *dst, float *const *src, - int len, int channels); -extern void ff_conv_fltp_to_s16_6ch_sse2(int16_t *dst, float *const *src, - int len, int channels); -extern void ff_conv_fltp_to_s16_6ch_avx (int16_t *dst, float *const *src, - int len, int channels); +void ff_conv_fltp_to_s16_6ch_sse (int16_t *dst, float *const *src, + int len, int channels); +void ff_conv_fltp_to_s16_6ch_sse2(int16_t *dst, float *const *src, + int len, int channels); +void ff_conv_fltp_to_s16_6ch_avx (int16_t *dst, float *const *src, + int len, int channels); -extern void ff_conv_fltp_to_flt_2ch_sse(float *dst, float *const *src, int len, - int channels); -extern void ff_conv_fltp_to_flt_2ch_avx(float *dst, float *const *src, int len, - int channels); +void ff_conv_fltp_to_flt_2ch_sse(float *dst, float *const *src, int len, + int channels); +void ff_conv_fltp_to_flt_2ch_avx(float *dst, float *const *src, int len, + int channels); -extern void ff_conv_fltp_to_flt_6ch_mmx (float *dst, float *const *src, int len, - int channels); -extern void ff_conv_fltp_to_flt_6ch_sse4(float *dst, float *const *src, int len, - int channels); -extern void ff_conv_fltp_to_flt_6ch_avx (float *dst, float *const *src, int len, - int channels); +void ff_conv_fltp_to_flt_6ch_mmx (float *dst, float *const *src, int len, + int channels); +void ff_conv_fltp_to_flt_6ch_sse4(float *dst, float *const *src, int len, + int channels); +void ff_conv_fltp_to_flt_6ch_avx (float *dst, float *const *src, int len, + int channels); /* deinterleave conversions */ -extern void ff_conv_s16_to_s16p_2ch_sse2(int16_t *const *dst, int16_t *src, - int len, int channels); -extern void ff_conv_s16_to_s16p_2ch_ssse3(int16_t *const *dst, int16_t *src, - int len, int channels); -extern void ff_conv_s16_to_s16p_2ch_avx (int16_t *const *dst, int16_t *src, - int len, int channels); +void ff_conv_s16_to_s16p_2ch_sse2(int16_t *const *dst, int16_t *src, + int len, int channels); +void ff_conv_s16_to_s16p_2ch_ssse3(int16_t *const *dst, int16_t *src, + int len, int channels); +void ff_conv_s16_to_s16p_2ch_avx (int16_t *const *dst, int16_t *src, + int len, int channels); -extern void ff_conv_s16_to_s16p_6ch_sse2 (int16_t *const *dst, int16_t *src, - int len, int channels); -extern void ff_conv_s16_to_s16p_6ch_ssse3(int16_t *const *dst, int16_t *src, - int len, int channels); -extern void ff_conv_s16_to_s16p_6ch_avx (int16_t *const *dst, int16_t *src, - int len, int channels); +void ff_conv_s16_to_s16p_6ch_sse2 (int16_t *const *dst, int16_t *src, + int len, int channels); +void ff_conv_s16_to_s16p_6ch_ssse3(int16_t *const *dst, int16_t *src, + int len, int channels); +void ff_conv_s16_to_s16p_6ch_avx (int16_t *const *dst, int16_t *src, + int len, int channels); -extern void ff_conv_s16_to_fltp_2ch_sse2(float *const *dst, int16_t *src, - int len, int channels); -extern void ff_conv_s16_to_fltp_2ch_avx (float *const *dst, int16_t *src, - int len, int channels); +void ff_conv_s16_to_fltp_2ch_sse2(float *const *dst, int16_t *src, + int len, int channels); +void ff_conv_s16_to_fltp_2ch_avx (float *const *dst, int16_t *src, + int len, int channels); -extern void ff_conv_s16_to_fltp_6ch_sse2 (float *const *dst, int16_t *src, - int len, int channels); -extern void ff_conv_s16_to_fltp_6ch_ssse3(float *const *dst, int16_t *src, - int len, int channels); -extern void ff_conv_s16_to_fltp_6ch_sse4 (float *const *dst, int16_t *src, - int len, int channels); -extern void ff_conv_s16_to_fltp_6ch_avx (float *const *dst, int16_t *src, - int len, int channels); +void ff_conv_s16_to_fltp_6ch_sse2 (float *const *dst, int16_t *src, + int len, int channels); +void ff_conv_s16_to_fltp_6ch_ssse3(float *const *dst, int16_t *src, + int len, int channels); +void ff_conv_s16_to_fltp_6ch_sse4 (float *const *dst, int16_t *src, + int len, int channels); +void ff_conv_s16_to_fltp_6ch_avx (float *const *dst, int16_t *src, + int len, int channels); -extern void ff_conv_flt_to_s16p_2ch_sse2(int16_t *const *dst, float *src, - int len, int channels); -extern void ff_conv_flt_to_s16p_2ch_avx (int16_t *const *dst, float *src, - int len, int channels); +void ff_conv_flt_to_s16p_2ch_sse2(int16_t *const *dst, float *src, + int len, int channels); +void ff_conv_flt_to_s16p_2ch_avx (int16_t *const *dst, float *src, + int len, int channels); -extern void ff_conv_flt_to_s16p_6ch_sse2 (int16_t *const *dst, float *src, - int len, int channels); -extern void ff_conv_flt_to_s16p_6ch_ssse3(int16_t *const *dst, float *src, - int len, int channels); -extern void ff_conv_flt_to_s16p_6ch_avx (int16_t *const *dst, float *src, - int len, int channels); +void ff_conv_flt_to_s16p_6ch_sse2 (int16_t *const *dst, float *src, + int len, int channels); +void ff_conv_flt_to_s16p_6ch_ssse3(int16_t *const *dst, float *src, + int len, int channels); +void ff_conv_flt_to_s16p_6ch_avx (int16_t *const *dst, float *src, + int len, int channels); -extern void ff_conv_flt_to_fltp_2ch_sse(float *const *dst, float *src, int len, - int channels); -extern void ff_conv_flt_to_fltp_2ch_avx(float *const *dst, float *src, int len, - int channels); +void ff_conv_flt_to_fltp_2ch_sse(float *const *dst, float *src, int len, + int channels); +void ff_conv_flt_to_fltp_2ch_avx(float *const *dst, float *src, int len, + int channels); -extern void ff_conv_flt_to_fltp_6ch_sse2(float *const *dst, float *src, int len, - int channels); -extern void ff_conv_flt_to_fltp_6ch_avx (float *const *dst, float *src, int len, - int channels); +void ff_conv_flt_to_fltp_6ch_sse2(float *const *dst, float *src, int len, + int channels); +void ff_conv_flt_to_fltp_6ch_avx (float *const *dst, float *src, int len, + int channels); av_cold void ff_audio_convert_init_x86(AudioConvert *ac) { - int mm_flags = av_get_cpu_flags(); + int cpu_flags = av_get_cpu_flags(); - if (EXTERNAL_MMX(mm_flags)) { + if (EXTERNAL_MMX(cpu_flags)) { ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, 0, 1, 8, "MMX", ff_conv_s32_to_s16_mmx); ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP, 6, 1, 4, "MMX", ff_conv_fltp_to_flt_6ch_mmx); } - if (EXTERNAL_SSE(mm_flags)) { + if (EXTERNAL_SSE(cpu_flags)) { ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP, 6, 1, 2, "SSE", ff_conv_fltp_to_s16_6ch_sse); ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP, @@ -161,8 +161,8 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac) ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, 2, 16, 4, "SSE", ff_conv_flt_to_fltp_2ch_sse); } - if (EXTERNAL_SSE2(mm_flags)) { - if (!(mm_flags & AV_CPU_FLAG_SSE2SLOW)) { + if (EXTERNAL_SSE2(cpu_flags)) { + if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW)) { ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, 0, 16, 16, "SSE2", ff_conv_s32_to_s16_sse2); ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, @@ -206,7 +206,7 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac) ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, 6, 16, 4, "SSE2", ff_conv_flt_to_fltp_6ch_sse2); } - if (EXTERNAL_SSSE3(mm_flags)) { + if (EXTERNAL_SSSE3(cpu_flags)) { ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16P, 6, 16, 4, "SSSE3", ff_conv_s16p_to_flt_6ch_ssse3); ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP, @@ -220,13 +220,13 @@ av_cold void ff_audio_convert_init_x86(AudioConvert *ac) ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_FLT, 6, 16, 4, "SSSE3", ff_conv_flt_to_s16p_6ch_ssse3); } - if (EXTERNAL_SSE4(mm_flags)) { + if (EXTERNAL_SSE4(cpu_flags)) { ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, 0, 16, 8, "SSE4", ff_conv_s16_to_flt_sse4); ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP, 6, 16, 4, "SSE4", ff_conv_fltp_to_flt_6ch_sse4); } - if (EXTERNAL_AVX(mm_flags)) { + if (EXTERNAL_AVX(cpu_flags)) { ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32, 0, 32, 16, "AVX", ff_conv_s32_to_flt_avx); ff_audio_convert_set_func(ac, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT, diff --git a/ffmpeg/libavresample/x86/audio_mix.asm b/ffmpeg/libavresample/x86/audio_mix.asm index 9353593..64ab039 100644 --- a/ffmpeg/libavresample/x86/audio_mix.asm +++ b/ffmpeg/libavresample/x86/audio_mix.asm @@ -2,20 +2,20 @@ ;* x86 optimized channel mixing ;* Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> ;* -;* This file is part of Libav. +;* This file is part of FFmpeg. ;* -;* Libav is free software; you can redistribute it and/or +;* FFmpeg is free software; you can redistribute it and/or ;* modify it under the terms of the GNU Lesser General Public ;* License as published by the Free Software Foundation; either ;* version 2.1 of the License, or (at your option) any later version. ;* -;* Libav is distributed in the hope that it will be useful, +;* FFmpeg is distributed in the hope that it will be useful, ;* but WITHOUT ANY WARRANTY; without even the implied warranty of ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;* Lesser General Public License for more details. ;* ;* You should have received a copy of the GNU Lesser General Public -;* License along with Libav; if not, write to the Free Software +;* License along with FFmpeg; if not, write to the Free Software ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;****************************************************************************** @@ -390,10 +390,10 @@ cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, n S16_TO_S32_SX 4, 5 cvtdq2ps m4, m4 cvtdq2ps m5, m5 - fmaddps m2, m4, mx_1_ %+ %%i, m2, m6 - fmaddps m3, m5, mx_1_ %+ %%i, m3, m6 - fmaddps m0, m4, mx_0_ %+ %%i, m0, m4 - fmaddps m1, m5, mx_0_ %+ %%i, m1, m5 + FMULADD_PS m2, m4, mx_1_ %+ %%i, m2, m6 + FMULADD_PS m3, m5, mx_1_ %+ %%i, m3, m6 + FMULADD_PS m0, m4, mx_0_ %+ %%i, m0, m4 + FMULADD_PS m1, m5, mx_0_ %+ %%i, m1, m5 %else %if copy_src_from_stack mov src_ptr, src %+ %%i %+ m @@ -402,8 +402,8 @@ cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, n S16_TO_S32_SX 2, 3 cvtdq2ps m2, m2 cvtdq2ps m3, m3 - fmaddps m0, m2, mx_0_ %+ %%i, m0, m4 - fmaddps m1, m3, mx_0_ %+ %%i, m1, m4 + FMULADD_PS m0, m2, mx_0_ %+ %%i, m0, m4 + FMULADD_PS m1, m3, mx_0_ %+ %%i, m1, m4 %endif %assign %%i %%i+1 %endrep @@ -428,7 +428,7 @@ cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, n %if stereo || mx_stack_0_0 mulps m0, m0, mx_0_0 %else - mulps m0, [src0q+lenq], mx_0_0 + mulps m0, mx_0_0, [src0q+lenq] %endif %assign %%i 1 %rep (in_channels - 1) @@ -443,12 +443,12 @@ cglobal mix_%1_to_%2_%3_flt, 3,in_channels+2,needed_mmregs+matrix_elements_mm, n mova m2, [src_ptr+lenq] %endif %if stereo - fmaddps m1, m2, mx_1_ %+ %%i, m1, m3 + FMULADD_PS m1, m2, mx_1_ %+ %%i, m1, m3 %endif %if stereo || mx_stack_0_ %+ %%i - fmaddps m0, m2, mx_0_ %+ %%i, m0, m2 + FMULADD_PS m0, m2, mx_0_ %+ %%i, m0, m2 %else - fmaddps m0, mx_0_ %+ %%i, [src_ptr+lenq], m0, m1 + FMULADD_PS m0, mx_0_ %+ %%i, [src_ptr+lenq], m0, m1 %endif %assign %%i %%i+1 %endrep diff --git a/ffmpeg/libavresample/x86/audio_mix_init.c b/ffmpeg/libavresample/x86/audio_mix_init.c index 72b2397..bec88b0 100644 --- a/ffmpeg/libavresample/x86/audio_mix_init.c +++ b/ffmpeg/libavresample/x86/audio_mix_init.c @@ -1,20 +1,20 @@ /* * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -23,80 +23,80 @@ #include "libavutil/x86/cpu.h" #include "libavresample/audio_mix.h" -extern void ff_mix_2_to_1_fltp_flt_sse(float **src, float **matrix, int len, - int out_ch, int in_ch); -extern void ff_mix_2_to_1_fltp_flt_avx(float **src, float **matrix, int len, - int out_ch, int in_ch); +void ff_mix_2_to_1_fltp_flt_sse(float **src, float **matrix, int len, + int out_ch, int in_ch); +void ff_mix_2_to_1_fltp_flt_avx(float **src, float **matrix, int len, + int out_ch, int in_ch); -extern void ff_mix_2_to_1_s16p_flt_sse2(int16_t **src, float **matrix, int len, - int out_ch, int in_ch); -extern void ff_mix_2_to_1_s16p_flt_sse4(int16_t **src, float **matrix, int len, - int out_ch, int in_ch); +void ff_mix_2_to_1_s16p_flt_sse2(int16_t **src, float **matrix, int len, + int out_ch, int in_ch); +void ff_mix_2_to_1_s16p_flt_sse4(int16_t **src, float **matrix, int len, + int out_ch, int in_ch); -extern void ff_mix_2_to_1_s16p_q8_sse2(int16_t **src, int16_t **matrix, - int len, int out_ch, int in_ch); +void ff_mix_2_to_1_s16p_q8_sse2(int16_t **src, int16_t **matrix, + int len, int out_ch, int in_ch); -extern void ff_mix_1_to_2_fltp_flt_sse(float **src, float **matrix, int len, - int out_ch, int in_ch); -extern void ff_mix_1_to_2_fltp_flt_avx(float **src, float **matrix, int len, - int out_ch, int in_ch); +void ff_mix_1_to_2_fltp_flt_sse(float **src, float **matrix, int len, + int out_ch, int in_ch); +void ff_mix_1_to_2_fltp_flt_avx(float **src, float **matrix, int len, + int out_ch, int in_ch); -extern void ff_mix_1_to_2_s16p_flt_sse2(int16_t **src, float **matrix, int len, - int out_ch, int in_ch); -extern void ff_mix_1_to_2_s16p_flt_sse4(int16_t **src, float **matrix, int len, - int out_ch, int in_ch); -extern void ff_mix_1_to_2_s16p_flt_avx (int16_t **src, float **matrix, int len, - int out_ch, int in_ch); +void ff_mix_1_to_2_s16p_flt_sse2(int16_t **src, float **matrix, int len, + int out_ch, int in_ch); +void ff_mix_1_to_2_s16p_flt_sse4(int16_t **src, float **matrix, int len, + int out_ch, int in_ch); +void ff_mix_1_to_2_s16p_flt_avx (int16_t **src, float **matrix, int len, + int out_ch, int in_ch); -#define DEFINE_MIX_3_8_TO_1_2(chan) \ -extern void ff_mix_ ## chan ## _to_1_fltp_flt_sse(float **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ -extern void ff_mix_ ## chan ## _to_2_fltp_flt_sse(float **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ - \ -extern void ff_mix_ ## chan ## _to_1_s16p_flt_sse2(int16_t **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ -extern void ff_mix_ ## chan ## _to_2_s16p_flt_sse2(int16_t **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ - \ -extern void ff_mix_ ## chan ## _to_1_s16p_flt_sse4(int16_t **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ -extern void ff_mix_ ## chan ## _to_2_s16p_flt_sse4(int16_t **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ - \ -extern void ff_mix_ ## chan ## _to_1_fltp_flt_avx(float **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ -extern void ff_mix_ ## chan ## _to_2_fltp_flt_avx(float **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ - \ -extern void ff_mix_ ## chan ## _to_1_s16p_flt_avx(int16_t **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ -extern void ff_mix_ ## chan ## _to_2_s16p_flt_avx(int16_t **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ - \ -extern void ff_mix_ ## chan ## _to_1_fltp_flt_fma4(float **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ -extern void ff_mix_ ## chan ## _to_2_fltp_flt_fma4(float **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ - \ -extern void ff_mix_ ## chan ## _to_1_s16p_flt_fma4(int16_t **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); \ -extern void ff_mix_ ## chan ## _to_2_s16p_flt_fma4(int16_t **src, \ - float **matrix, int len, \ - int out_ch, int in_ch); +#define DEFINE_MIX_3_8_TO_1_2(chan) \ +void ff_mix_ ## chan ## _to_1_fltp_flt_sse(float **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ +void ff_mix_ ## chan ## _to_2_fltp_flt_sse(float **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ + \ +void ff_mix_ ## chan ## _to_1_s16p_flt_sse2(int16_t **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ +void ff_mix_ ## chan ## _to_2_s16p_flt_sse2(int16_t **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ + \ +void ff_mix_ ## chan ## _to_1_s16p_flt_sse4(int16_t **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ +void ff_mix_ ## chan ## _to_2_s16p_flt_sse4(int16_t **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ + \ +void ff_mix_ ## chan ## _to_1_fltp_flt_avx(float **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ +void ff_mix_ ## chan ## _to_2_fltp_flt_avx(float **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ + \ +void ff_mix_ ## chan ## _to_1_s16p_flt_avx(int16_t **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ +void ff_mix_ ## chan ## _to_2_s16p_flt_avx(int16_t **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ + \ +void ff_mix_ ## chan ## _to_1_fltp_flt_fma4(float **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ +void ff_mix_ ## chan ## _to_2_fltp_flt_fma4(float **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ + \ +void ff_mix_ ## chan ## _to_1_s16p_flt_fma4(int16_t **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); \ +void ff_mix_ ## chan ## _to_2_s16p_flt_fma4(int16_t **src, \ + float **matrix, int len, \ + int out_ch, int in_ch); DEFINE_MIX_3_8_TO_1_2(3) DEFINE_MIX_3_8_TO_1_2(4) @@ -106,7 +106,7 @@ DEFINE_MIX_3_8_TO_1_2(7) DEFINE_MIX_3_8_TO_1_2(8) #define SET_MIX_3_8_TO_1_2(chan) \ - if (EXTERNAL_SSE(mm_flags)) { \ + if (EXTERNAL_SSE(cpu_flags)) { \ ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT,\ chan, 1, 16, 4, "SSE", \ ff_mix_ ## chan ## _to_1_fltp_flt_sse); \ @@ -114,7 +114,7 @@ DEFINE_MIX_3_8_TO_1_2(8) chan, 2, 16, 4, "SSE", \ ff_mix_## chan ##_to_2_fltp_flt_sse); \ } \ - if (EXTERNAL_SSE2(mm_flags)) { \ + if (EXTERNAL_SSE2(cpu_flags)) { \ ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,\ chan, 1, 16, 8, "SSE2", \ ff_mix_ ## chan ## _to_1_s16p_flt_sse2); \ @@ -122,7 +122,7 @@ DEFINE_MIX_3_8_TO_1_2(8) chan, 2, 16, 8, "SSE2", \ ff_mix_ ## chan ## _to_2_s16p_flt_sse2); \ } \ - if (EXTERNAL_SSE4(mm_flags)) { \ + if (EXTERNAL_SSE4(cpu_flags)) { \ ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT,\ chan, 1, 16, 8, "SSE4", \ ff_mix_ ## chan ## _to_1_s16p_flt_sse4); \ @@ -130,7 +130,7 @@ DEFINE_MIX_3_8_TO_1_2(8) chan, 2, 16, 8, "SSE4", \ ff_mix_ ## chan ## _to_2_s16p_flt_sse4); \ } \ - if (EXTERNAL_AVX(mm_flags)) { \ + if (EXTERNAL_AVX(cpu_flags)) { \ int ptr_align = 32; \ int smp_align = 8; \ if (ARCH_X86_32 || chan >= 6) { \ @@ -150,7 +150,7 @@ DEFINE_MIX_3_8_TO_1_2(8) chan, 2, 16, 8, "AVX", \ ff_mix_ ## chan ## _to_2_s16p_flt_avx); \ } \ - if (EXTERNAL_FMA4(mm_flags)) { \ + if (EXTERNAL_FMA4(cpu_flags)) { \ int ptr_align = 32; \ int smp_align = 8; \ if (ARCH_X86_32 || chan >= 6) { \ @@ -174,15 +174,15 @@ DEFINE_MIX_3_8_TO_1_2(8) av_cold void ff_audio_mix_init_x86(AudioMix *am) { #if HAVE_YASM - int mm_flags = av_get_cpu_flags(); + int cpu_flags = av_get_cpu_flags(); - if (EXTERNAL_SSE(mm_flags)) { + if (EXTERNAL_SSE(cpu_flags)) { ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT, 2, 1, 16, 8, "SSE", ff_mix_2_to_1_fltp_flt_sse); ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT, 1, 2, 16, 4, "SSE", ff_mix_1_to_2_fltp_flt_sse); } - if (EXTERNAL_SSE2(mm_flags)) { + if (EXTERNAL_SSE2(cpu_flags)) { ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT, 2, 1, 16, 8, "SSE2", ff_mix_2_to_1_s16p_flt_sse2); ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_Q8, @@ -190,13 +190,13 @@ av_cold void ff_audio_mix_init_x86(AudioMix *am) ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT, 1, 2, 16, 8, "SSE2", ff_mix_1_to_2_s16p_flt_sse2); } - if (EXTERNAL_SSE4(mm_flags)) { + if (EXTERNAL_SSE4(cpu_flags)) { ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT, 2, 1, 16, 8, "SSE4", ff_mix_2_to_1_s16p_flt_sse4); ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT, 1, 2, 16, 8, "SSE4", ff_mix_1_to_2_s16p_flt_sse4); } - if (EXTERNAL_AVX(mm_flags)) { + if (EXTERNAL_AVX(cpu_flags)) { ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT, 2, 1, 32, 16, "AVX", ff_mix_2_to_1_fltp_flt_avx); ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT, diff --git a/ffmpeg/libavresample/x86/dither_init.c b/ffmpeg/libavresample/x86/dither_init.c index 6532887..816d4b0 100644 --- a/ffmpeg/libavresample/x86/dither_init.c +++ b/ffmpeg/libavresample/x86/dither_init.c @@ -23,38 +23,37 @@ #include "libavutil/x86/cpu.h" #include "libavresample/dither.h" -extern void ff_quantize_sse2(int16_t *dst, const float *src, float *dither, - int len); +void ff_quantize_sse2(int16_t *dst, const float *src, float *dither, int len); -extern void ff_dither_int_to_float_rectangular_sse2(float *dst, int *src, int len); -extern void ff_dither_int_to_float_rectangular_avx(float *dst, int *src, int len); +void ff_dither_int_to_float_rectangular_sse2(float *dst, int *src, int len); +void ff_dither_int_to_float_rectangular_avx(float *dst, int *src, int len); -extern void ff_dither_int_to_float_triangular_sse2(float *dst, int *src0, int len); -extern void ff_dither_int_to_float_triangular_avx(float *dst, int *src0, int len); +void ff_dither_int_to_float_triangular_sse2(float *dst, int *src0, int len); +void ff_dither_int_to_float_triangular_avx(float *dst, int *src0, int len); av_cold void ff_dither_init_x86(DitherDSPContext *ddsp, enum AVResampleDitherMethod method) { - int mm_flags = av_get_cpu_flags(); + int cpu_flags = av_get_cpu_flags(); - if (EXTERNAL_SSE2(mm_flags)) { + if (EXTERNAL_SSE2(cpu_flags)) { ddsp->quantize = ff_quantize_sse2; ddsp->ptr_align = 16; ddsp->samples_align = 8; } if (method == AV_RESAMPLE_DITHER_RECTANGULAR) { - if (EXTERNAL_SSE2(mm_flags)) { + if (EXTERNAL_SSE2(cpu_flags)) { ddsp->dither_int_to_float = ff_dither_int_to_float_rectangular_sse2; } - if (EXTERNAL_AVX(mm_flags)) { + if (EXTERNAL_AVX(cpu_flags)) { ddsp->dither_int_to_float = ff_dither_int_to_float_rectangular_avx; } } else { - if (EXTERNAL_SSE2(mm_flags)) { + if (EXTERNAL_SSE2(cpu_flags)) { ddsp->dither_int_to_float = ff_dither_int_to_float_triangular_sse2; } - if (EXTERNAL_AVX(mm_flags)) { + if (EXTERNAL_AVX(cpu_flags)) { ddsp->dither_int_to_float = ff_dither_int_to_float_triangular_avx; } } diff --git a/ffmpeg/libavresample/x86/util.asm b/ffmpeg/libavresample/x86/util.asm index 0ce9531..187a4a2 100644 --- a/ffmpeg/libavresample/x86/util.asm +++ b/ffmpeg/libavresample/x86/util.asm @@ -2,20 +2,20 @@ ;* x86 utility macros for libavresample ;* Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> ;* -;* This file is part of Libav. +;* This file is part of FFmpeg. ;* -;* Libav is free software; you can redistribute it and/or +;* FFmpeg is free software; you can redistribute it and/or ;* modify it under the terms of the GNU Lesser General Public ;* License as published by the Free Software Foundation; either ;* version 2.1 of the License, or (at your option) any later version. ;* -;* Libav is distributed in the hope that it will be useful, +;* FFmpeg is distributed in the hope that it will be useful, ;* but WITHOUT ANY WARRANTY; without even the implied warranty of ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;* Lesser General Public License for more details. ;* ;* You should have received a copy of the GNU Lesser General Public -;* License along with Libav; if not, write to the Free Software +;* License along with FFmpeg; if not, write to the Free Software ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;****************************************************************************** |
