diff options
author | Diego Biurrun <diego@biurrun.de> | 2013-11-05 08:11:47 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-11-08 12:40:47 +0100 |
commit | 0338c396987c82b41d322630ea9712fe5f9561d6 (patch) | |
tree | 62c5b48c7705ecfb62fb667683b72436c48490e9 /libavcodec/x86 | |
parent | 86f910806b2c303c43727d357a5b927e662bb3d1 (diff) | |
download | ffmpeg-0338c396987c82b41d322630ea9712fe5f9561d6.tar.gz |
dsputil: Split off H.263 bits into their own H263DSPContext
Diffstat (limited to 'libavcodec/x86')
-rw-r--r-- | libavcodec/x86/Makefile | 4 | ||||
-rw-r--r-- | libavcodec/x86/dsputil_init.c | 8 | ||||
-rw-r--r-- | libavcodec/x86/h263dsp_init.c | 39 |
3 files changed, 41 insertions, 10 deletions
diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile index 84dd49cf3c..0fe1c1af5e 100644 --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -12,6 +12,7 @@ OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o \ x86/fdct.o \ x86/motion_est.o OBJS-$(CONFIG_FFT) += x86/fft_init.o +OBJS-$(CONFIG_H263DSP) += x86/h263dsp_init.o OBJS-$(CONFIG_H264CHROMA) += x86/h264chroma_init.o OBJS-$(CONFIG_H264DSP) += x86/h264dsp_init.o OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o @@ -59,8 +60,7 @@ YASM-OBJS-$(CONFIG_DSPUTIL) += x86/dsputil.o \ x86/qpel.o YASM-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc.o YASM-OBJS-$(CONFIG_FFT) += x86/fft.o -YASM-OBJS-$(CONFIG_H263_DECODER) += x86/h263_loopfilter.o -YASM-OBJS-$(CONFIG_H263_ENCODER) += x86/h263_loopfilter.o +YASM-OBJS-$(CONFIG_H263DSP) += x86/h263_loopfilter.o YASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \ x86/h264_chromamc_10bit.o YASM-OBJS-$(CONFIG_H264DSP) += x86/h264_deblock.o \ diff --git a/libavcodec/x86/dsputil_init.c b/libavcodec/x86/dsputil_init.c index a38cf24d3c..cc35d240a0 100644 --- a/libavcodec/x86/dsputil_init.c +++ b/libavcodec/x86/dsputil_init.c @@ -68,9 +68,6 @@ void ff_put_no_rnd_mpeg4_qpel8_v_lowpass_mmxext(uint8_t *dst, uint8_t *src, #define ff_put_no_rnd_pixels16_mmxext ff_put_pixels16_mmxext #define ff_put_no_rnd_pixels8_mmxext ff_put_pixels8_mmxext -void ff_h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale); -void ff_h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale); - int32_t ff_scalarproduct_int16_mmxext(const int16_t *v1, const int16_t *v2, int order); int32_t ff_scalarproduct_int16_sse2(const int16_t *v1, const int16_t *v2, @@ -566,11 +563,6 @@ static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx, #endif /* HAVE_MMX_INLINE */ #if HAVE_MMX_EXTERNAL - if (CONFIG_H263_DECODER || CONFIG_H263_ENCODER) { - c->h263_v_loop_filter = ff_h263_v_loop_filter_mmx; - c->h263_h_loop_filter = ff_h263_h_loop_filter_mmx; - } - c->vector_clip_int32 = ff_vector_clip_int32_mmx; #endif /* HAVE_MMX_EXTERNAL */ } diff --git a/libavcodec/x86/h263dsp_init.c b/libavcodec/x86/h263dsp_init.c new file mode 100644 index 0000000000..d4fab981bf --- /dev/null +++ b/libavcodec/x86/h263dsp_init.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2013 Diego Biurrun <diego@biurrun.de> + * + * This file is part of Libav. + * + * Libav 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, + * 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 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdint.h> + +#include "libavutil/attributes.h" +#include "libavutil/cpu.h" +#include "libavutil/x86/cpu.h" +#include "libavcodec/h263dsp.h" + +void ff_h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale); +void ff_h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale); + +av_cold void ff_h263dsp_init_x86(H263DSPContext *c) +{ + int cpu_flags = av_get_cpu_flags(); + + if (EXTERNAL_MMX(cpu_flags)) { + c->h263_h_loop_filter = ff_h263_h_loop_filter_mmx; + c->h263_v_loop_filter = ff_h263_v_loop_filter_mmx; + } +} |