diff options
Diffstat (limited to 'ffmpeg/libavresample/x86')
| -rw-r--r-- | ffmpeg/libavresample/x86/audio_convert.asm | 8 | ||||
| -rw-r--r-- | ffmpeg/libavresample/x86/audio_convert_init.c | 208 | ||||
| -rw-r--r-- | ffmpeg/libavresample/x86/audio_mix.asm | 28 | ||||
| -rw-r--r-- | ffmpeg/libavresample/x86/audio_mix_init.c | 166 | ||||
| -rw-r--r-- | ffmpeg/libavresample/x86/dither_init.c | 23 | ||||
| -rw-r--r-- | ffmpeg/libavresample/x86/util.asm | 8 |
6 files changed, 220 insertions, 221 deletions
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 ;****************************************************************************** |
