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_cpu.h" 00025 #include "libavcodec/dsputil.h" 00026 #include "libavcodec/vp56dsp.h" 00027 00028 void ff_vp6_filter_diag4_mmx(uint8_t *dst, uint8_t *src, int stride, 00029 const int16_t *h_weights,const int16_t *v_weights); 00030 void ff_vp6_filter_diag4_sse2(uint8_t *dst, uint8_t *src, int stride, 00031 const int16_t *h_weights,const int16_t *v_weights); 00032 00033 av_cold void ff_vp56dsp_init_x86(VP56DSPContext* c, enum CodecID codec) 00034 { 00035 #if HAVE_YASM 00036 int mm_flags = av_get_cpu_flags(); 00037 00038 if (CONFIG_VP6_DECODER && codec == CODEC_ID_VP6) { 00039 if (mm_flags & AV_CPU_FLAG_MMX) { 00040 c->vp6_filter_diag4 = ff_vp6_filter_diag4_mmx; 00041 } 00042 00043 if (mm_flags & AV_CPU_FLAG_SSE2) { 00044 c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2; 00045 } 00046 } 00047 #endif 00048 }