Originally committed as revision 24921 to svn://svn.ffmpeg.org/ffmpeg/trunktags/n0.8
@@ -4428,9 +4428,6 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) | |||||
c->vp3_v_loop_filter= ff_vp3_v_loop_filter_c; | c->vp3_v_loop_filter= ff_vp3_v_loop_filter_c; | ||||
c->vp3_idct_dc_add= ff_vp3_idct_dc_add_c; | c->vp3_idct_dc_add= ff_vp3_idct_dc_add_c; | ||||
} | } | ||||
if (CONFIG_VP6_DECODER) { | |||||
c->vp6_filter_diag4= ff_vp6_filter_diag4_c; | |||||
} | |||||
c->h261_loop_filter= h261_loop_filter_c; | c->h261_loop_filter= h261_loop_filter_c; | ||||
@@ -91,10 +91,6 @@ void ff_vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size, const DCTELEM | |||||
void ff_vp3_v_loop_filter_c(uint8_t *src, int stride, int *bounding_values); | void ff_vp3_v_loop_filter_c(uint8_t *src, int stride, int *bounding_values); | ||||
void ff_vp3_h_loop_filter_c(uint8_t *src, int stride, int *bounding_values); | void ff_vp3_h_loop_filter_c(uint8_t *src, int stride, int *bounding_values); | ||||
/* VP6 DSP functions */ | |||||
void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride, | |||||
const int16_t *h_weights, const int16_t *v_weights); | |||||
/* Bink functions */ | /* Bink functions */ | ||||
void ff_bink_idct_c (DCTELEM *block); | void ff_bink_idct_c (DCTELEM *block); | ||||
void ff_bink_idct_add_c(uint8_t *dest, int linesize, DCTELEM *block); | void ff_bink_idct_add_c(uint8_t *dest, int linesize, DCTELEM *block); | ||||
@@ -369,9 +365,6 @@ typedef struct DSPContext { | |||||
void (*vp3_v_loop_filter)(uint8_t *src, int stride, int *bounding_values); | void (*vp3_v_loop_filter)(uint8_t *src, int stride, int *bounding_values); | ||||
void (*vp3_h_loop_filter)(uint8_t *src, int stride, int *bounding_values); | void (*vp3_h_loop_filter)(uint8_t *src, int stride, int *bounding_values); | ||||
void (*vp6_filter_diag4)(uint8_t *dst, uint8_t *src, int stride, | |||||
const int16_t *h_weights,const int16_t *v_weights); | |||||
/* assume len is a multiple of 4, and arrays are 16-byte aligned */ | /* assume len is a multiple of 4, and arrays are 16-byte aligned */ | ||||
void (*vorbis_inverse_coupling)(float *mag, float *ang, int blocksize); | void (*vorbis_inverse_coupling)(float *mag, float *ang, int blocksize); | ||||
void (*ac3_downmix)(float (*samples)[256], float (*matrix)[2], int out_ch, int in_ch, int len); | void (*ac3_downmix)(float (*samples)[256], float (*matrix)[2], int out_ch, int in_ch, int len); | ||||
@@ -82,7 +82,12 @@ void ff_vp56dsp_init(VP56DSPContext *s, enum CodecID codec) | |||||
} else { | } else { | ||||
s->edge_filter_hor = vp6_edge_filter_hor; | s->edge_filter_hor = vp6_edge_filter_hor; | ||||
s->edge_filter_ver = vp6_edge_filter_ver; | s->edge_filter_ver = vp6_edge_filter_ver; | ||||
if (CONFIG_VP6_DECODER) { | |||||
s->vp6_filter_diag4= ff_vp6_filter_diag4_c; | |||||
} | |||||
} | } | ||||
if (ARCH_ARM) ff_vp56dsp_init_arm(s, codec); | if (ARCH_ARM) ff_vp56dsp_init_arm(s, codec); | ||||
if (HAVE_MMX) ff_vp56dsp_init_x86(s, codec); | |||||
} | } |
@@ -22,13 +22,21 @@ | |||||
#define AVCODEC_VP56DSP_H | #define AVCODEC_VP56DSP_H | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#include "avcodec.h" | |||||
typedef struct VP56DSPContext { | typedef struct VP56DSPContext { | ||||
void (*edge_filter_hor)(uint8_t *yuv, int stride, int t); | void (*edge_filter_hor)(uint8_t *yuv, int stride, int t); | ||||
void (*edge_filter_ver)(uint8_t *yuv, int stride, int t); | void (*edge_filter_ver)(uint8_t *yuv, int stride, int t); | ||||
void (*vp6_filter_diag4)(uint8_t *dst, uint8_t *src, int stride, | |||||
const int16_t *h_weights,const int16_t *v_weights); | |||||
} VP56DSPContext; | } VP56DSPContext; | ||||
void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride, | |||||
const int16_t *h_weights, const int16_t *v_weights); | |||||
void ff_vp56dsp_init(VP56DSPContext *s, enum CodecID codec); | void ff_vp56dsp_init(VP56DSPContext *s, enum CodecID codec); | ||||
void ff_vp56dsp_init_arm(VP56DSPContext *s, enum CodecID codec); | void ff_vp56dsp_init_arm(VP56DSPContext *s, enum CodecID codec); | ||||
void ff_vp56dsp_init_x86(VP56DSPContext* c, enum CodecID codec); | |||||
#endif /* AVCODEC_VP56DSP_H */ | #endif /* AVCODEC_VP56DSP_H */ |
@@ -559,7 +559,7 @@ static void vp6_filter(VP56Context *s, uint8_t *dst, uint8_t *src, | |||||
vp6_filter_hv4(dst, src+offset1, stride, stride, | vp6_filter_hv4(dst, src+offset1, stride, stride, | ||||
vp6_block_copy_filter[select][y8]); | vp6_block_copy_filter[select][y8]); | ||||
} else { | } else { | ||||
s->dsp.vp6_filter_diag4(dst, src+offset1+((mv.x^mv.y)>>31), stride, | |||||
s->vp56dsp.vp6_filter_diag4(dst, src+offset1+((mv.x^mv.y)>>31), stride, | |||||
vp6_block_copy_filter[select][x8], | vp6_block_copy_filter[select][x8], | ||||
vp6_block_copy_filter[select][y8]); | vp6_block_copy_filter[select][y8]); | ||||
} | } | ||||
@@ -22,7 +22,7 @@ | |||||
*/ | */ | ||||
#include "libavutil/common.h" | #include "libavutil/common.h" | ||||
#include "dsputil.h" | |||||
#include "vp56dsp.h" | |||||
void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride, | void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride, | ||||
@@ -29,11 +29,13 @@ MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o | |||||
MMX-OBJS-$(CONFIG_VP3_DECODER) += x86/vp3dsp_mmx.o \ | MMX-OBJS-$(CONFIG_VP3_DECODER) += x86/vp3dsp_mmx.o \ | ||||
x86/vp3dsp_sse2.o | x86/vp3dsp_sse2.o | ||||
MMX-OBJS-$(CONFIG_VP5_DECODER) += x86/vp3dsp_mmx.o \ | MMX-OBJS-$(CONFIG_VP5_DECODER) += x86/vp3dsp_mmx.o \ | ||||
x86/vp3dsp_sse2.o | |||||
x86/vp3dsp_sse2.o \ | |||||
x86/vp56dsp_init.o | |||||
MMX-OBJS-$(CONFIG_VP6_DECODER) += x86/vp3dsp_mmx.o \ | MMX-OBJS-$(CONFIG_VP6_DECODER) += x86/vp3dsp_mmx.o \ | ||||
x86/vp3dsp_sse2.o \ | x86/vp3dsp_sse2.o \ | ||||
x86/vp6dsp_mmx.o \ | x86/vp6dsp_mmx.o \ | ||||
x86/vp6dsp_sse2.o | |||||
x86/vp6dsp_sse2.o \ | |||||
x86/vp56dsp_init.o | |||||
YASM-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp.o | YASM-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp.o | ||||
MMX-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp-init.o | MMX-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp-init.o | ||||
MMX-OBJS-$(HAVE_YASM) += x86/dsputil_yasm.o \ | MMX-OBJS-$(HAVE_YASM) += x86/dsputil_yasm.o \ | ||||
@@ -30,8 +30,6 @@ | |||||
#include "dsputil_mmx.h" | #include "dsputil_mmx.h" | ||||
#include "vp3dsp_mmx.h" | #include "vp3dsp_mmx.h" | ||||
#include "vp3dsp_sse2.h" | #include "vp3dsp_sse2.h" | ||||
#include "vp6dsp_mmx.h" | |||||
#include "vp6dsp_sse2.h" | |||||
#include "idct_xvid.h" | #include "idct_xvid.h" | ||||
//#undef NDEBUG | //#undef NDEBUG | ||||
@@ -2626,10 +2624,6 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) | |||||
c->put_rv40_chroma_pixels_tab[0]= put_rv40_chroma_mc8_mmx; | c->put_rv40_chroma_pixels_tab[0]= put_rv40_chroma_mc8_mmx; | ||||
c->put_rv40_chroma_pixels_tab[1]= put_rv40_chroma_mc4_mmx; | c->put_rv40_chroma_pixels_tab[1]= put_rv40_chroma_mc4_mmx; | ||||
if (CONFIG_VP6_DECODER) { | |||||
c->vp6_filter_diag4 = ff_vp6_filter_diag4_mmx; | |||||
} | |||||
if (mm_flags & FF_MM_MMX2) { | if (mm_flags & FF_MM_MMX2) { | ||||
c->prefetch = prefetch_mmx2; | c->prefetch = prefetch_mmx2; | ||||
@@ -2812,10 +2806,6 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) | |||||
H264_QPEL_FUNCS(3, 1, sse2); | H264_QPEL_FUNCS(3, 1, sse2); | ||||
H264_QPEL_FUNCS(3, 2, sse2); | H264_QPEL_FUNCS(3, 2, sse2); | ||||
H264_QPEL_FUNCS(3, 3, sse2); | H264_QPEL_FUNCS(3, 3, sse2); | ||||
if (CONFIG_VP6_DECODER) { | |||||
c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2; | |||||
} | |||||
} | } | ||||
#if HAVE_SSSE3 | #if HAVE_SSSE3 | ||||
if(mm_flags & FF_MM_SSSE3){ | if(mm_flags & FF_MM_SSSE3){ | ||||
@@ -0,0 +1,42 @@ | |||||
/* | |||||
* VP6 MMX/SSE2 optimizations | |||||
* Copyright (C) 2009 Sebastien Lucas <sebastien.lucas@gmail.com> | |||||
* Copyright (C) 2009 Zuxy Meng <zuxy.meng@gmail.com> | |||||
* | |||||
* 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/x86_cpu.h" | |||||
#include "libavcodec/dsputil.h" | |||||
#include "libavcodec/vp56dsp.h" | |||||
#include "vp6dsp_mmx.h" | |||||
#include "vp6dsp_sse2.h" | |||||
av_cold void ff_vp56dsp_init_x86(VP56DSPContext* c, enum CodecID codec) | |||||
{ | |||||
int mm_flags = mm_support(); | |||||
if (CONFIG_VP6_DECODER && codec == CODEC_ID_VP6) { | |||||
if (mm_flags & FF_MM_MMX) { | |||||
c->vp6_filter_diag4 = ff_vp6_filter_diag4_mmx; | |||||
} | |||||
if (mm_flags & FF_MM_SSE2) { | |||||
c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2; | |||||
} | |||||
} | |||||
} |