00001 /* 00002 * VP6 MMX/SSE2 optimizations 00003 * Copyright (C) 2009 Sebastien Lucas <sebastien.lucas@gmail.com> 00004 * Copyright (C) 2009 Zuxy Meng <zuxy.meng@gmail.com> 00005 * 00006 * This file is part of FFmpeg. 00007 * 00008 * FFmpeg is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * FFmpeg is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with FFmpeg; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 #include "libavutil/cpu.h" 00024 #include "libavutil/x86/asm.h" 00025 #include "libavutil/x86/cpu.h" 00026 #include "libavcodec/dsputil.h" 00027 #include "libavcodec/vp56dsp.h" 00028 00029 void ff_vp6_filter_diag4_mmx(uint8_t *dst, uint8_t *src, int stride, 00030 const int16_t *h_weights,const int16_t *v_weights); 00031 void ff_vp6_filter_diag4_sse2(uint8_t *dst, uint8_t *src, int stride, 00032 const int16_t *h_weights,const int16_t *v_weights); 00033 00034 av_cold void ff_vp56dsp_init_x86(VP56DSPContext* c, enum AVCodecID codec) 00035 { 00036 int mm_flags = av_get_cpu_flags(); 00037 00038 if (CONFIG_VP6_DECODER && codec == AV_CODEC_ID_VP6) { 00039 #if ARCH_X86_32 00040 if (EXTERNAL_MMX(mm_flags)) { 00041 c->vp6_filter_diag4 = ff_vp6_filter_diag4_mmx; 00042 } 00043 #endif 00044 00045 if (EXTERNAL_SSE2(mm_flags)) { 00046 c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2; 00047 } 00048 } 00049 }