diff options
author | Mans Rullgard <mans@mansr.com> | 2012-07-17 16:47:43 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-07-18 10:32:19 +0100 |
commit | 28f9ab7029bd1a02f659995919f899f84ee7361b (patch) | |
tree | cc5544768e088acef9f18e0c8038f72bd1a91b9d /libavcodec/vp3dsp.c | |
parent | ab9f9876615fd856184912cf3863a80cf3a721b6 (diff) | |
download | ffmpeg-28f9ab7029bd1a02f659995919f899f84ee7361b.tar.gz |
vp3: move idct and loop filter pointers to new vp3dsp context
This moves all VP3-specific function pointers from dsputil to a
new vp3dsp context. There is no reason to ever use the VP3 IDCT
where an MPEG2 IDCT is expected or vice versa.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/vp3dsp.c')
-rw-r--r-- | libavcodec/vp3dsp.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/libavcodec/vp3dsp.c b/libavcodec/vp3dsp.c index 438ae76b57..395526e040 100644 --- a/libavcodec/vp3dsp.c +++ b/libavcodec/vp3dsp.c @@ -24,8 +24,10 @@ * source code. */ +#include "libavutil/attributes.h" #include "avcodec.h" #include "dsputil.h" +#include "vp3dsp.h" #define IdctAdjustBeforeShift 8 #define xC1S7 64277 @@ -210,19 +212,16 @@ static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int } } -void ff_vp3_idct_c(DCTELEM *block/* align 16*/){ - idct(NULL, 0, block, 0); -} - -void ff_vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ +static void vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ idct(dest, line_size, block, 1); } -void ff_vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ +static void vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ idct(dest, line_size, block, 2); } -void ff_vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size, const DCTELEM *block/*align 16*/){ +static void vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size, + const DCTELEM *block/*align 16*/){ int i, dc = (block[0] + 15) >> 5; for(i = 0; i < 8; i++){ @@ -238,7 +237,8 @@ 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 *first_pixel, int stride, int *bounding_values) +static void vp3_v_loop_filter_c(uint8_t *first_pixel, int stride, + int *bounding_values) { unsigned char *end; int filter_value; @@ -254,7 +254,8 @@ void ff_vp3_v_loop_filter_c(uint8_t *first_pixel, int stride, int *bounding_valu } } -void ff_vp3_h_loop_filter_c(uint8_t *first_pixel, int stride, int *bounding_values) +static void vp3_h_loop_filter_c(uint8_t *first_pixel, int stride, + int *bounding_values) { unsigned char *end; int filter_value; @@ -268,3 +269,21 @@ void ff_vp3_h_loop_filter_c(uint8_t *first_pixel, int stride, int *bounding_valu first_pixel[ 0] = av_clip_uint8(first_pixel[ 0] - filter_value); } } + +av_cold void ff_vp3dsp_init(VP3DSPContext *c, int flags) +{ + c->idct_put = vp3_idct_put_c; + c->idct_add = vp3_idct_add_c; + c->idct_dc_add = vp3_idct_dc_add_c; + c->v_loop_filter = vp3_v_loop_filter_c; + c->h_loop_filter = vp3_h_loop_filter_c; + + c->idct_perm = FF_NO_IDCT_PERM; + + if (ARCH_ARM) + ff_vp3dsp_init_arm(c, flags); + if (ARCH_PPC) + ff_vp3dsp_init_ppc(c, flags); + if (ARCH_X86) + ff_vp3dsp_init_x86(c, flags); +} |