00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <stdint.h>
00020
00021 #include "libavutil/attributes.h"
00022 #include "libavutil/cpu.h"
00023 #include "libavutil/x86/cpu.h"
00024 #include "libavcodec/avcodec.h"
00025 #include "libavcodec/vp3dsp.h"
00026 #include "config.h"
00027
00028 void ff_vp3_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block);
00029 void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block);
00030
00031 void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, DCTELEM *block);
00032 void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, DCTELEM *block);
00033
00034 void ff_vp3_idct_dc_add_mmx2(uint8_t *dest, int line_size,
00035 const DCTELEM *block);
00036
00037 void ff_vp3_v_loop_filter_mmx2(uint8_t *src, int stride, int *bounding_values);
00038 void ff_vp3_h_loop_filter_mmx2(uint8_t *src, int stride, int *bounding_values);
00039
00040 av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
00041 {
00042 int cpuflags = av_get_cpu_flags();
00043
00044 #if ARCH_X86_32
00045 if (EXTERNAL_MMX(cpuflags)) {
00046 c->idct_put = ff_vp3_idct_put_mmx;
00047 c->idct_add = ff_vp3_idct_add_mmx;
00048 c->idct_perm = FF_PARTTRANS_IDCT_PERM;
00049 }
00050 #endif
00051
00052 if (EXTERNAL_MMXEXT(cpuflags)) {
00053 c->idct_dc_add = ff_vp3_idct_dc_add_mmx2;
00054
00055 if (!(flags & CODEC_FLAG_BITEXACT)) {
00056 c->v_loop_filter = ff_vp3_v_loop_filter_mmx2;
00057 c->h_loop_filter = ff_vp3_h_loop_filter_mmx2;
00058 }
00059 }
00060
00061 if (EXTERNAL_SSE2(cpuflags)) {
00062 c->idct_put = ff_vp3_idct_put_sse2;
00063 c->idct_add = ff_vp3_idct_add_sse2;
00064 c->idct_perm = FF_TRANSPOSE_IDCT_PERM;
00065 }
00066 }