8c6ebab747
* qatar/master: (26 commits) eac3dec: replace undefined 1<<31 with INT32_MIN in noise generation yadif: specify array size outside DECLARE_ALIGNED prores: specify array size outside DECLARE_ALIGNED brackets. WavPack demuxer: set packet duration tta: use skip_bits_long() mxfdec: Ignore the last entry in Avid's index table segments mxfdec: Sanity-check SampleRate mxfdec: Handle small EditUnitByteCount mxfdec: Consider OPAtom files that do not have exactly one EC to be OP1a mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows mxfdec: Zero nb_ptses in mxf_compute_ptses_fake_index() mxfdec: Sanity check PreviousPartition mxfdec: Never seek back in local sets and KLVs mxfdec: Move the current_partition check inside mxf_read_header() mxfdec: Fix infinite loop in mxf_packet_timestamps() mxfdec: Check eof_reached in mxf_read_local_tags() mxfdec: Check for NULL component mxfdec: Make sure mxf->nb_index_tables > 0 in mxf_packet_timestamps() mxfdec: Make sure x < index_table->nb_ptses build: Add missing directories to DIRS declarations. ... Conflicts: doc/build_system.txt doc/fate.texi libavfilter/x86/yadif_template.c libavformat/mxfdec.c libavutil/Makefile tests/fate/audio.mak tests/fate/prores.mak tests/fate/screen.mak tests/fate/video.mak tests/ref/fate/bethsoft-vid tests/ref/fate/cscd tests/ref/fate/dfa4 tests/ref/fate/nuv tests/ref/fate/vp8-sign-bias tests/ref/fate/wmv8-drm tests/ref/lavf/gxf Merged-by: Michael Niedermayer <michaelni@gmx.at>
70 lines
2.5 KiB
C
70 lines
2.5 KiB
C
/*
|
|
* This file is part of FFmpeg.
|
|
*
|
|
* 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.
|
|
*
|
|
* 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 FFmpeg; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#include "libavutil/cpu.h"
|
|
#include "libavcodec/dsputil.h"
|
|
#include "libavcodec/dct.h"
|
|
#include "fft.h"
|
|
|
|
av_cold void ff_fft_init_mmx(FFTContext *s)
|
|
{
|
|
#if HAVE_YASM
|
|
int has_vectors = av_get_cpu_flags();
|
|
if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX && s->nbits >= 5) {
|
|
/* AVX for SB */
|
|
s->imdct_calc = ff_imdct_calc_sse;
|
|
s->imdct_half = ff_imdct_half_avx;
|
|
s->fft_permute = ff_fft_permute_sse;
|
|
s->fft_calc = ff_fft_calc_avx;
|
|
s->fft_permutation = FF_FFT_PERM_AVX;
|
|
} else if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) {
|
|
/* SSE for P3/P4/K8 */
|
|
s->imdct_calc = ff_imdct_calc_sse;
|
|
s->imdct_half = ff_imdct_half_sse;
|
|
s->fft_permute = ff_fft_permute_sse;
|
|
s->fft_calc = ff_fft_calc_sse;
|
|
s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
|
|
} else if (has_vectors & AV_CPU_FLAG_3DNOWEXT && HAVE_AMD3DNOWEXT) {
|
|
/* 3DNowEx for K7 */
|
|
s->imdct_calc = ff_imdct_calc_3dn2;
|
|
s->imdct_half = ff_imdct_half_3dn2;
|
|
s->fft_calc = ff_fft_calc_3dn2;
|
|
} else if (has_vectors & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW) {
|
|
/* 3DNow! for K6-2/3 */
|
|
s->imdct_calc = ff_imdct_calc_3dn;
|
|
s->imdct_half = ff_imdct_half_3dn;
|
|
s->fft_calc = ff_fft_calc_3dn;
|
|
}
|
|
#endif
|
|
}
|
|
|
|
#if CONFIG_DCT
|
|
av_cold void ff_dct_init_mmx(DCTContext *s)
|
|
{
|
|
#if HAVE_YASM
|
|
int has_vectors = av_get_cpu_flags();
|
|
if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX)
|
|
s->dct32 = ff_dct32_float_avx;
|
|
else if (has_vectors & AV_CPU_FLAG_SSE2 && HAVE_SSE)
|
|
s->dct32 = ff_dct32_float_sse2;
|
|
else if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE)
|
|
s->dct32 = ff_dct32_float_sse;
|
|
#endif
|
|
}
|
|
#endif
|