diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-18 22:27:46 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-18 22:34:48 +0200 |
commit | 204c4e953d895e15ab0908d715fd46181bf32add (patch) | |
tree | aebdffe23aa1133eeb1db55b810135ecdfe1c188 /libavcodec/vp3dsp.c | |
parent | c66978e29ad9cae2c71da83857c6a3cec11bb9cb (diff) | |
parent | ffdd93a25e64db82c053577f415ea82c54fd5235 (diff) | |
download | ffmpeg-204c4e953d895e15ab0908d715fd46181bf32add.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
ppc: fix build with altivec disabled
vp3: move idct and loop filter pointers to new vp3dsp context
build: add CONFIG_VP3DSP, reduce repetition in OBJS lists
tscc2: do not add/subtract 128 bias during DCT
tscc2: fix typo in DCT
configure: clarify external library section of help output
configure: mark libfdk-aac as nonfree
configure: cosmetics: drop some unnecessary backslashes
os_support: K&R formatting cosmetics
Conflicts:
configure
libavcodec/vp3.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 9fded0f53e..4c5ff6a448 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); +} |