Revision 3a088514

View differences:

libavcodec/dsputil.c
4428 4428
        c->vp3_v_loop_filter= ff_vp3_v_loop_filter_c;
4429 4429
        c->vp3_idct_dc_add= ff_vp3_idct_dc_add_c;
4430 4430
    }
4431
    if (CONFIG_VP6_DECODER) {
4432
        c->vp6_filter_diag4= ff_vp6_filter_diag4_c;
4433
    }
4434 4431

  
4435 4432
    c->h261_loop_filter= h261_loop_filter_c;
4436 4433

  
libavcodec/dsputil.h
91 91
void ff_vp3_v_loop_filter_c(uint8_t *src, int stride, int *bounding_values);
92 92
void ff_vp3_h_loop_filter_c(uint8_t *src, int stride, int *bounding_values);
93 93

  
94
/* VP6 DSP functions */
95
void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride,
96
                           const int16_t *h_weights, const int16_t *v_weights);
97

  
98 94
/* Bink functions */
99 95
void ff_bink_idct_c    (DCTELEM *block);
100 96
void ff_bink_idct_add_c(uint8_t *dest, int linesize, DCTELEM *block);
......
369 365
    void (*vp3_v_loop_filter)(uint8_t *src, int stride, int *bounding_values);
370 366
    void (*vp3_h_loop_filter)(uint8_t *src, int stride, int *bounding_values);
371 367

  
372
    void (*vp6_filter_diag4)(uint8_t *dst, uint8_t *src, int stride,
373
                             const int16_t *h_weights,const int16_t *v_weights);
374

  
375 368
    /* assume len is a multiple of 4, and arrays are 16-byte aligned */
376 369
    void (*vorbis_inverse_coupling)(float *mag, float *ang, int blocksize);
377 370
    void (*ac3_downmix)(float (*samples)[256], float (*matrix)[2], int out_ch, int in_ch, int len);
libavcodec/vp56dsp.c
82 82
    } else {
83 83
        s->edge_filter_hor = vp6_edge_filter_hor;
84 84
        s->edge_filter_ver = vp6_edge_filter_ver;
85

  
86
        if (CONFIG_VP6_DECODER) {
87
            s->vp6_filter_diag4= ff_vp6_filter_diag4_c;
88
        }
85 89
    }
86 90

  
87 91
    if (ARCH_ARM) ff_vp56dsp_init_arm(s, codec);
92
    if (HAVE_MMX) ff_vp56dsp_init_x86(s, codec);
88 93
}
libavcodec/vp56dsp.h
22 22
#define AVCODEC_VP56DSP_H
23 23

  
24 24
#include <stdint.h>
25
#include "avcodec.h"
25 26

  
26 27
typedef struct VP56DSPContext {
27 28
    void (*edge_filter_hor)(uint8_t *yuv, int stride, int t);
28 29
    void (*edge_filter_ver)(uint8_t *yuv, int stride, int t);
30

  
31
    void (*vp6_filter_diag4)(uint8_t *dst, uint8_t *src, int stride,
32
                             const int16_t *h_weights,const int16_t *v_weights);
29 33
} VP56DSPContext;
30 34

  
35
void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride,
36
                           const int16_t *h_weights, const int16_t *v_weights);
37

  
31 38
void ff_vp56dsp_init(VP56DSPContext *s, enum CodecID codec);
32 39
void ff_vp56dsp_init_arm(VP56DSPContext *s, enum CodecID codec);
40
void ff_vp56dsp_init_x86(VP56DSPContext* c, enum CodecID codec);
33 41

  
34 42
#endif /* AVCODEC_VP56DSP_H */
libavcodec/vp6.c
559 559
            vp6_filter_hv4(dst, src+offset1, stride, stride,
560 560
                           vp6_block_copy_filter[select][y8]);
561 561
        } else {
562
            s->dsp.vp6_filter_diag4(dst, src+offset1+((mv.x^mv.y)>>31), stride,
562
            s->vp56dsp.vp6_filter_diag4(dst, src+offset1+((mv.x^mv.y)>>31), stride,
563 563
                             vp6_block_copy_filter[select][x8],
564 564
                             vp6_block_copy_filter[select][y8]);
565 565
        }
libavcodec/vp6dsp.c
22 22
 */
23 23

  
24 24
#include "libavutil/common.h"
25
#include "dsputil.h"
25
#include "vp56dsp.h"
26 26

  
27 27

  
28 28
void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride,
libavcodec/x86/Makefile
29 29
MMX-OBJS-$(CONFIG_VP3_DECODER)         += x86/vp3dsp_mmx.o              \
30 30
                                          x86/vp3dsp_sse2.o
31 31
MMX-OBJS-$(CONFIG_VP5_DECODER)         += x86/vp3dsp_mmx.o              \
32
                                          x86/vp3dsp_sse2.o
32
                                          x86/vp3dsp_sse2.o             \
33
                                          x86/vp56dsp_init.o
33 34
MMX-OBJS-$(CONFIG_VP6_DECODER)         += x86/vp3dsp_mmx.o              \
34 35
                                          x86/vp3dsp_sse2.o             \
35 36
                                          x86/vp6dsp_mmx.o              \
36
                                          x86/vp6dsp_sse2.o
37
                                          x86/vp6dsp_sse2.o             \
38
                                          x86/vp56dsp_init.o
37 39
YASM-OBJS-$(CONFIG_VP8_DECODER)        += x86/vp8dsp.o
38 40
MMX-OBJS-$(CONFIG_VP8_DECODER)         += x86/vp8dsp-init.o
39 41
MMX-OBJS-$(HAVE_YASM)                  += x86/dsputil_yasm.o            \
libavcodec/x86/dsputil_mmx.c
30 30
#include "dsputil_mmx.h"
31 31
#include "vp3dsp_mmx.h"
32 32
#include "vp3dsp_sse2.h"
33
#include "vp6dsp_mmx.h"
34
#include "vp6dsp_sse2.h"
35 33
#include "idct_xvid.h"
36 34

  
37 35
//#undef NDEBUG
......
2626 2624
        c->put_rv40_chroma_pixels_tab[0]= put_rv40_chroma_mc8_mmx;
2627 2625
        c->put_rv40_chroma_pixels_tab[1]= put_rv40_chroma_mc4_mmx;
2628 2626

  
2629
        if (CONFIG_VP6_DECODER) {
2630
            c->vp6_filter_diag4 = ff_vp6_filter_diag4_mmx;
2631
        }
2632

  
2633 2627
        if (mm_flags & FF_MM_MMX2) {
2634 2628
            c->prefetch = prefetch_mmx2;
2635 2629

  
......
2812 2806
            H264_QPEL_FUNCS(3, 1, sse2);
2813 2807
            H264_QPEL_FUNCS(3, 2, sse2);
2814 2808
            H264_QPEL_FUNCS(3, 3, sse2);
2815

  
2816
            if (CONFIG_VP6_DECODER) {
2817
                c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2;
2818
            }
2819 2809
        }
2820 2810
#if HAVE_SSSE3
2821 2811
        if(mm_flags & FF_MM_SSSE3){
libavcodec/x86/vp56dsp_init.c
1
/*
2
 * VP6 MMX/SSE2 optimizations
3
 * Copyright (C) 2009  Sebastien Lucas <sebastien.lucas@gmail.com>
4
 * Copyright (C) 2009  Zuxy Meng <zuxy.meng@gmail.com>
5
 *
6
 * This file is part of FFmpeg.
7
 *
8
 * FFmpeg is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Lesser General Public
10
 * License as published by the Free Software Foundation; either
11
 * version 2.1 of the License, or (at your option) any later version.
12
 *
13
 * FFmpeg is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public
19
 * License along with FFmpeg; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
 */
22

  
23
#include "libavutil/x86_cpu.h"
24
#include "libavcodec/dsputil.h"
25
#include "libavcodec/vp56dsp.h"
26
#include "vp6dsp_mmx.h"
27
#include "vp6dsp_sse2.h"
28

  
29
av_cold void ff_vp56dsp_init_x86(VP56DSPContext* c, enum CodecID codec)
30
{
31
    int mm_flags = mm_support();
32

  
33
    if (CONFIG_VP6_DECODER && codec == CODEC_ID_VP6) {
34
        if (mm_flags & FF_MM_MMX) {
35
            c->vp6_filter_diag4 = ff_vp6_filter_diag4_mmx;
36
        }
37

  
38
        if (mm_flags & FF_MM_SSE2) {
39
            c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2;
40
        }
41
    }
42
}

Also available in: Unified diff