diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-08 21:36:14 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-08 21:46:34 +0200 |
commit | 52dc18d414f4aa2c5a210edfb82cc1a99942ca3b (patch) | |
tree | c2aedd51f56ee49222c76f44b238c16102132db1 /libavcodec/x86 | |
parent | ac627b3d38d370027406c93c2dcaac0b1712a7d4 (diff) | |
parent | 7e522859fc463a14875f78957bb57d2f33607d19 (diff) | |
download | ffmpeg-52dc18d414f4aa2c5a210edfb82cc1a99942ca3b.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
x86: vc1: call ff_vc1dsp_init_x86() under if (ARCH_X86)
x86: cavs: call ff_cavsdsp_init_x86() under if (ARCH_X86)
x86: call most of the x86 dsp init functions under if (ARCH_X86)
doc: support the new website layout
doc: remove a warning from filters.texi
doc: initial nut documentation
segment: drop global headers setting
lavu: fix typo in Makefile
Conflicts:
doc/Makefile
doc/filters.texi
doc/t2h.init
libavcodec/fmtconvert.c
libavcodec/proresdsp.c
libavcodec/x86/Makefile
libavcodec/x86/vc1dsp_mmx.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86')
-rw-r--r-- | libavcodec/x86/Makefile | 41 | ||||
-rw-r--r-- | libavcodec/x86/cavsdsp.c | 34 | ||||
-rw-r--r-- | libavcodec/x86/fft_init.c | 4 | ||||
-rw-r--r-- | libavcodec/x86/mpegaudiodec.c | 2 | ||||
-rw-r--r-- | libavcodec/x86/rv40dsp_init.c | 4 | ||||
-rw-r--r-- | libavcodec/x86/vc1dsp.h | 29 | ||||
-rw-r--r-- | libavcodec/x86/vc1dsp_init.c | 123 | ||||
-rw-r--r-- | libavcodec/x86/vc1dsp_mmx.c | 105 |
8 files changed, 207 insertions, 135 deletions
diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile index 39d27271ec..4ddd06d678 100644 --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -1,42 +1,43 @@ +OBJS += x86/fmtconvert_init.o + +OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o +OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_init.o +OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp.o OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o +OBJS-$(CONFIG_FFT) += x86/fft_init.o +OBJS-$(CONFIG_GPL) += x86/idct_mmx.o +OBJS-$(CONFIG_H264DSP) += x86/h264dsp_init.o +OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o +OBJS-$(CONFIG_LPC) += x86/lpc.o OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o +OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodec.o OBJS-$(CONFIG_MPEGVIDEO) += x86/mpegvideo.o OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoenc.o +OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp_init.o +OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp_init.o +OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp_init.o +OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp_init.o \ + x86/rv40dsp_init.o +OBJS-$(CONFIG_V210_DECODER) += x86/v210-init.o OBJS-$(CONFIG_TRUEHD_DECODER) += x86/mlpdsp.o +OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_init.o OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp_init.o +OBJS-$(CONFIG_VP5_DECODER) += x86/vp56dsp_init.o +OBJS-$(CONFIG_VP6_DECODER) += x86/vp56dsp_init.o +OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp_init.o OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o MMX-OBJS += x86/dsputil_mmx.o \ x86/fdct.o \ - x86/fmtconvert_init.o \ x86/idct_mmx_xvid.o \ x86/idct_sse2_xvid.o \ x86/simple_idct.o \ -MMX-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o -MMX-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_init.o -MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp.o MMX-OBJS-$(CONFIG_DWT) += x86/snowdsp.o \ x86/dwt.o MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o \ x86/motion_est.o -MMX-OBJS-$(CONFIG_FFT) += x86/fft_init.o -MMX-OBJS-$(CONFIG_GPL) += x86/idct_mmx.o -MMX-OBJS-$(CONFIG_H264DSP) += x86/h264dsp_init.o -MMX-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o -MMX-OBJS-$(CONFIG_LPC) += x86/lpc.o -MMX-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodec.o -MMX-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp_init.o -MMX-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp_init.o -MMX-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp_init.o -MMX-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp_init.o -MMX-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp_init.o \ - x86/rv40dsp_init.o -MMX-OBJS-$(CONFIG_V210_DECODER) += x86/v210-init.o MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o -MMX-OBJS-$(CONFIG_VP5_DECODER) += x86/vp56dsp_init.o -MMX-OBJS-$(CONFIG_VP6_DECODER) += x86/vp56dsp_init.o -MMX-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp_init.o YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o YASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c index 03a8b87ec3..9643b81af3 100644 --- a/libavcodec/x86/cavsdsp.c +++ b/libavcodec/x86/cavsdsp.c @@ -25,11 +25,13 @@ #include "libavutil/common.h" #include "libavutil/cpu.h" #include "libavutil/x86/asm.h" +#include "libavutil/x86/cpu.h" #include "libavcodec/dsputil.h" #include "libavcodec/cavsdsp.h" #include "dsputil_mmx.h" +#include "config.h" -#if HAVE_INLINE_ASM +#if (HAVE_MMXEXT_INLINE || HAVE_AMD3DNOW_INLINE) /* in/out: mma=mma+mmb, mmb=mmb-mma */ #define SUMSUB_BA( a, b ) \ @@ -433,15 +435,12 @@ static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, ui "pavgb " #temp ", " #a " \n\t"\ "mov" #size " " #a ", " #b " \n\t" -QPEL_CAVS(put_, PUT_OP, 3dnow) -QPEL_CAVS(avg_, AVG_3DNOW_OP, 3dnow) +#endif /* (HAVE_MMXEXT_INLINE || HAVE_AMD3DNOW_INLINE) */ + +#if HAVE_MMXEXT_INLINE QPEL_CAVS(put_, PUT_OP, mmx2) QPEL_CAVS(avg_, AVG_MMX2_OP, mmx2) -CAVS_MC(put_, 8, 3dnow) -CAVS_MC(put_, 16,3dnow) -CAVS_MC(avg_, 8, 3dnow) -CAVS_MC(avg_, 16,3dnow) CAVS_MC(put_, 8, mmx2) CAVS_MC(put_, 16,mmx2) CAVS_MC(avg_, 8, mmx2) @@ -463,6 +462,16 @@ static void ff_cavsdsp_init_mmx2(CAVSDSPContext* c, AVCodecContext *avctx) { c->cavs_idct8_add = cavs_idct8_add_mmx; c->idct_perm = FF_TRANSPOSE_IDCT_PERM; } +#endif /* HAVE_MMXEXT_INLINE */ + +#if HAVE_AMD3DNOW_INLINE +QPEL_CAVS(put_, PUT_OP, 3dnow) +QPEL_CAVS(avg_, AVG_3DNOW_OP, 3dnow) + +CAVS_MC(put_, 8, 3dnow) +CAVS_MC(put_, 16,3dnow) +CAVS_MC(avg_, 8, 3dnow) +CAVS_MC(avg_, 16,3dnow) static void ff_cavsdsp_init_3dnow(CAVSDSPContext* c, AVCodecContext *avctx) { #define dspfunc(PFX, IDX, NUM) \ @@ -480,15 +489,16 @@ static void ff_cavsdsp_init_3dnow(CAVSDSPContext* c, AVCodecContext *avctx) { c->cavs_idct8_add = cavs_idct8_add_mmx; c->idct_perm = FF_TRANSPOSE_IDCT_PERM; } +#endif /* HAVE_AMD3DNOW_INLINE */ -#endif /* HAVE_INLINE_ASM */ - -void ff_cavsdsp_init_mmx(CAVSDSPContext *c, AVCodecContext *avctx) +av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c, AVCodecContext *avctx) { int mm_flags = av_get_cpu_flags(); -#if HAVE_INLINE_ASM +#if HAVE_MMXEXT_INLINE if (mm_flags & AV_CPU_FLAG_MMXEXT) ff_cavsdsp_init_mmx2(c, avctx); +#endif /* HAVE_MMXEXT_INLINE */ +#if HAVE_AMD3DNOW_INLINE if (mm_flags & AV_CPU_FLAG_3DNOW) ff_cavsdsp_init_3dnow(c, avctx); -#endif /* HAVE_INLINE_ASM */ +#endif /* HAVE_AMD3DNOW_INLINE */ } diff --git a/libavcodec/x86/fft_init.c b/libavcodec/x86/fft_init.c index d7a31d4efa..a9d95799ba 100644 --- a/libavcodec/x86/fft_init.c +++ b/libavcodec/x86/fft_init.c @@ -22,7 +22,7 @@ #include "libavcodec/dct.h" #include "fft.h" -av_cold void ff_fft_init_mmx(FFTContext *s) +av_cold void ff_fft_init_x86(FFTContext *s) { int has_vectors = av_get_cpu_flags(); #if ARCH_X86_32 @@ -56,7 +56,7 @@ av_cold void ff_fft_init_mmx(FFTContext *s) } #if CONFIG_DCT -av_cold void ff_dct_init_mmx(DCTContext *s) +av_cold void ff_dct_init_x86(DCTContext *s) { int has_vectors = av_get_cpu_flags(); if (EXTERNAL_SSE(has_vectors)) diff --git a/libavcodec/x86/mpegaudiodec.c b/libavcodec/x86/mpegaudiodec.c index a8b55aedf0..44cbf9a428 100644 --- a/libavcodec/x86/mpegaudiodec.c +++ b/libavcodec/x86/mpegaudiodec.c @@ -232,7 +232,7 @@ DECL_IMDCT_BLOCKS(avx,avx) #endif #endif /* HAVE_YASM */ -void ff_mpadsp_init_mmx(MPADSPContext *s) +void ff_mpadsp_init_x86(MPADSPContext *s) { int mm_flags = av_get_cpu_flags(); diff --git a/libavcodec/x86/rv40dsp_init.c b/libavcodec/x86/rv40dsp_init.c index 966e3f22f5..902ae19075 100644 --- a/libavcodec/x86/rv40dsp_init.c +++ b/libavcodec/x86/rv40dsp_init.c @@ -195,12 +195,12 @@ void ff_rv40dsp_init_x86(RV34DSPContext *c, DSPContext *dsp) if (EXTERNAL_MMX(mm_flags)) { c->put_chroma_pixels_tab[0] = ff_put_rv40_chroma_mc8_mmx; c->put_chroma_pixels_tab[1] = ff_put_rv40_chroma_mc4_mmx; -#if HAVE_INLINE_ASM +#if HAVE_MMX_INLINE c->put_pixels_tab[0][15] = ff_put_rv40_qpel16_mc33_mmx; c->put_pixels_tab[1][15] = ff_put_rv40_qpel8_mc33_mmx; c->avg_pixels_tab[0][15] = ff_avg_rv40_qpel16_mc33_mmx; c->avg_pixels_tab[1][15] = ff_avg_rv40_qpel8_mc33_mmx; -#endif /* HAVE_INLINE_ASM */ +#endif /* HAVE_MMX_INLINE */ #if ARCH_X86_32 QPEL_MC_SET(put_, _mmx) #endif diff --git a/libavcodec/x86/vc1dsp.h b/libavcodec/x86/vc1dsp.h new file mode 100644 index 0000000000..fdd4de1813 --- /dev/null +++ b/libavcodec/x86/vc1dsp.h @@ -0,0 +1,29 @@ +/* + * VC-1 and WMV3 decoder - X86 DSP init functions + * + * 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 + */ + +#ifndef AVCODEC_X86_VC1DSP_H +#define AVCODEC_X86_VC1DSP_H + +#include "libavcodec/vc1dsp.h" + +void ff_vc1dsp_init_mmx(VC1DSPContext *dsp); +void ff_vc1dsp_init_mmxext(VC1DSPContext *dsp); + +#endif /* AVCODEC_X86_VC1DSP_H */ diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c new file mode 100644 index 0000000000..d2548fc348 --- /dev/null +++ b/libavcodec/x86/vc1dsp_init.c @@ -0,0 +1,123 @@ +/* + * VC-1 and WMV3 - DSP functions MMX-optimized + * Copyright (c) 2007 Christophe GISQUET <christophe.gisquet@free.fr> + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "libavutil/cpu.h" +#include "libavutil/x86/cpu.h" +#include "libavcodec/vc1dsp.h" +#include "vc1dsp.h" +#include "config.h" + +#define LOOP_FILTER(EXT) \ +void ff_vc1_v_loop_filter4_ ## EXT(uint8_t *src, int stride, int pq); \ +void ff_vc1_h_loop_filter4_ ## EXT(uint8_t *src, int stride, int pq); \ +void ff_vc1_v_loop_filter8_ ## EXT(uint8_t *src, int stride, int pq); \ +void ff_vc1_h_loop_filter8_ ## EXT(uint8_t *src, int stride, int pq); \ +\ +static void vc1_v_loop_filter16_ ## EXT(uint8_t *src, int stride, int pq) \ +{ \ + ff_vc1_v_loop_filter8_ ## EXT(src, stride, pq); \ + ff_vc1_v_loop_filter8_ ## EXT(src+8, stride, pq); \ +} \ +\ +static void vc1_h_loop_filter16_ ## EXT(uint8_t *src, int stride, int pq) \ +{ \ + ff_vc1_h_loop_filter8_ ## EXT(src, stride, pq); \ + ff_vc1_h_loop_filter8_ ## EXT(src+8*stride, stride, pq); \ +} + +#if HAVE_YASM +LOOP_FILTER(mmx2) +LOOP_FILTER(sse2) +LOOP_FILTER(ssse3) + +void ff_vc1_h_loop_filter8_sse4(uint8_t *src, int stride, int pq); + +static void vc1_h_loop_filter16_sse4(uint8_t *src, int stride, int pq) +{ + ff_vc1_h_loop_filter8_sse4(src, stride, pq); + ff_vc1_h_loop_filter8_sse4(src+8*stride, stride, pq); +} +#endif /* HAVE_YASM */ + +void ff_put_vc1_chroma_mc8_mmx_nornd (uint8_t *dst, uint8_t *src, + int stride, int h, int x, int y); +void ff_avg_vc1_chroma_mc8_mmx2_nornd (uint8_t *dst, uint8_t *src, + int stride, int h, int x, int y); +void ff_avg_vc1_chroma_mc8_3dnow_nornd(uint8_t *dst, uint8_t *src, + int stride, int h, int x, int y); +void ff_put_vc1_chroma_mc8_ssse3_nornd(uint8_t *dst, uint8_t *src, + int stride, int h, int x, int y); +void ff_avg_vc1_chroma_mc8_ssse3_nornd(uint8_t *dst, uint8_t *src, + int stride, int h, int x, int y); + + +av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp) +{ + int mm_flags = av_get_cpu_flags(); + + if (INLINE_MMX(mm_flags)) + ff_vc1dsp_init_mmx(dsp); + + if (INLINE_MMXEXT(mm_flags)) + ff_vc1dsp_init_mmxext(dsp); + +#define ASSIGN_LF(EXT) \ + dsp->vc1_v_loop_filter4 = ff_vc1_v_loop_filter4_ ## EXT; \ + dsp->vc1_h_loop_filter4 = ff_vc1_h_loop_filter4_ ## EXT; \ + dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_ ## EXT; \ + dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_ ## EXT; \ + dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_ ## EXT; \ + dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_ ## EXT + +#if HAVE_YASM + if (mm_flags & AV_CPU_FLAG_MMX) { + dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_mmx_nornd; + } + + if (mm_flags & AV_CPU_FLAG_MMXEXT) { + ASSIGN_LF(mmx2); + dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_mmx2_nornd; + } else if (mm_flags & AV_CPU_FLAG_3DNOW) { + dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_3dnow_nornd; + } + + if (mm_flags & AV_CPU_FLAG_SSE2) { + dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_sse2; + dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_sse2; + dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_sse2; + dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse2; + } + if (mm_flags & AV_CPU_FLAG_SSSE3) { + ASSIGN_LF(ssse3); + dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_ssse3_nornd; + dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_ssse3_nornd; + } + if (mm_flags & AV_CPU_FLAG_SSE4) { + dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_sse4; + dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse4; + } +#endif /* HAVE_YASM */ +} diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c index 66251d0b15..adf89b2f0c 100644 --- a/libavcodec/x86/vc1dsp_mmx.c +++ b/libavcodec/x86/vc1dsp_mmx.c @@ -27,9 +27,11 @@ #include "libavutil/cpu.h" #include "libavutil/mem.h" #include "libavutil/x86/asm.h" +#include "libavutil/x86/cpu.h" #include "libavcodec/dsputil.h" #include "dsputil_mmx.h" #include "libavcodec/vc1dsp.h" +#include "vc1dsp.h" #if HAVE_INLINE_ASM @@ -685,57 +687,8 @@ static void vc1_inv_trans_8x8_dc_mmx2(uint8_t *dest, int linesize, DCTELEM *bloc ); } -#endif /* HAVE_INLINE_ASM */ - -#define LOOP_FILTER(EXT) \ -void ff_vc1_v_loop_filter4_ ## EXT(uint8_t *src, int stride, int pq); \ -void ff_vc1_h_loop_filter4_ ## EXT(uint8_t *src, int stride, int pq); \ -void ff_vc1_v_loop_filter8_ ## EXT(uint8_t *src, int stride, int pq); \ -void ff_vc1_h_loop_filter8_ ## EXT(uint8_t *src, int stride, int pq); \ -\ -static void vc1_v_loop_filter16_ ## EXT(uint8_t *src, int stride, int pq) \ -{ \ - ff_vc1_v_loop_filter8_ ## EXT(src, stride, pq); \ - ff_vc1_v_loop_filter8_ ## EXT(src+8, stride, pq); \ -} \ -\ -static void vc1_h_loop_filter16_ ## EXT(uint8_t *src, int stride, int pq) \ -{ \ - ff_vc1_h_loop_filter8_ ## EXT(src, stride, pq); \ - ff_vc1_h_loop_filter8_ ## EXT(src+8*stride, stride, pq); \ -} - -#if HAVE_YASM -LOOP_FILTER(mmx2) -LOOP_FILTER(sse2) -LOOP_FILTER(ssse3) - -void ff_vc1_h_loop_filter8_sse4(uint8_t *src, int stride, int pq); - -static void vc1_h_loop_filter16_sse4(uint8_t *src, int stride, int pq) -{ - ff_vc1_h_loop_filter8_sse4(src, stride, pq); - ff_vc1_h_loop_filter8_sse4(src+8*stride, stride, pq); -} -#endif /* HAVE_YASM */ - -void ff_put_vc1_chroma_mc8_mmx_nornd (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc8_mmx2_nornd (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc8_3dnow_nornd(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); -void ff_put_vc1_chroma_mc8_ssse3_nornd(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc8_ssse3_nornd(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); - -void ff_vc1dsp_init_mmx(VC1DSPContext *dsp) +av_cold void ff_vc1dsp_init_mmx(VC1DSPContext *dsp) { - int mm_flags = av_get_cpu_flags(); - -#if HAVE_INLINE_ASM - if (mm_flags & AV_CPU_FLAG_MMX) { dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_mmx; dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_mmx; dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_mmx; @@ -755,12 +708,10 @@ void ff_vc1dsp_init_mmx(VC1DSPContext *dsp) dsp->put_vc1_mspel_pixels_tab[ 7] = put_vc1_mspel_mc31_mmx; dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_mmx; dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_mmx; +} - if (HAVE_YASM) - dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_mmx_nornd; - } - - if (mm_flags & AV_CPU_FLAG_MMXEXT) { +av_cold void ff_vc1dsp_init_mmxext(VC1DSPContext *dsp) +{ dsp->avg_vc1_mspel_pixels_tab[ 0] = ff_avg_vc1_mspel_mc00_mmx2; dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_mmx2; dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_mmx2; @@ -785,47 +736,5 @@ void ff_vc1dsp_init_mmx(VC1DSPContext *dsp) dsp->vc1_inv_trans_4x8_dc = vc1_inv_trans_4x8_dc_mmx2; dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_mmx2; dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_mmx2; - - if (HAVE_YASM) - dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_mmx2_nornd; - } else if (HAVE_YASM && mm_flags & AV_CPU_FLAG_3DNOW) { - dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_3dnow_nornd; - } - - if (HAVE_YASM && mm_flags & AV_CPU_FLAG_SSSE3) { - dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_ssse3_nornd; - dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_ssse3_nornd; - } -#endif /* HAVE_INLINE_ASM */ - -#define ASSIGN_LF(EXT) \ - dsp->vc1_v_loop_filter4 = ff_vc1_v_loop_filter4_ ## EXT; \ - dsp->vc1_h_loop_filter4 = ff_vc1_h_loop_filter4_ ## EXT; \ - dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_ ## EXT; \ - dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_ ## EXT; \ - dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_ ## EXT; \ - dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_ ## EXT - -#if HAVE_YASM - if (mm_flags & AV_CPU_FLAG_MMX) { - } - - if (mm_flags & AV_CPU_FLAG_MMXEXT) { - ASSIGN_LF(mmx2); - } - - if (mm_flags & AV_CPU_FLAG_SSE2) { - dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_sse2; - dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_sse2; - dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_sse2; - dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse2; - } - if (mm_flags & AV_CPU_FLAG_SSSE3) { - ASSIGN_LF(ssse3); - } - if (mm_flags & AV_CPU_FLAG_SSE4) { - dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_sse4; - dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse4; - } -#endif /* HAVE_YASM */ } +#endif /* HAVE_INLINE_ASM */ |