Mercurial > libavcodec.hg
changeset 856:3c6df37177dd libavcodec
* using DSPContext - so each codec could use its local (sub)set of CPU extension
* these are untested - users/developers please check
author | kabi |
---|---|
date | Mon, 11 Nov 2002 10:04:45 +0000 |
parents | df26acd21c84 |
children | b510a7b6decd |
files | alpha/dsputil_alpha.c mlib/dsputil_mlib.c ppc/dsputil_ppc.c ps2/dsputil_mmi.c |
diffstat | 4 files changed, 81 insertions(+), 81 deletions(-) [+] |
line wrap: on
line diff
--- a/alpha/dsputil_alpha.c Mon Nov 11 09:44:59 2002 +0000 +++ b/alpha/dsputil_alpha.c Mon Nov 11 10:04:45 2002 +0000 @@ -281,61 +281,61 @@ put_pixels_axp_asm(block + 8, pixels + 8, line_size, h); } -void dsputil_init_alpha(void) +void dsputil_init_alpha(DSPContext* c, unsigned mask) { - put_pixels_tab[0][0] = put_pixels16_axp_asm; - put_pixels_tab[0][1] = put_pixels16_x2_axp; - put_pixels_tab[0][2] = put_pixels16_y2_axp; - put_pixels_tab[0][3] = put_pixels16_xy2_axp; + c->put_pixels_tab[0][0] = put_pixels16_axp_asm; + c->put_pixels_tab[0][1] = put_pixels16_x2_axp; + c->put_pixels_tab[0][2] = put_pixels16_y2_axp; + c->put_pixels_tab[0][3] = put_pixels16_xy2_axp; - put_no_rnd_pixels_tab[0][0] = put_pixels16_axp_asm; - put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_axp; - put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_axp; - put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_axp; + c->put_no_rnd_pixels_tab[0][0] = put_pixels16_axp_asm; + c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_axp; + c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_axp; + c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_axp; - avg_pixels_tab[0][0] = avg_pixels16_axp; - avg_pixels_tab[0][1] = avg_pixels16_x2_axp; - avg_pixels_tab[0][2] = avg_pixels16_y2_axp; - avg_pixels_tab[0][3] = avg_pixels16_xy2_axp; + c->avg_pixels_tab[0][0] = avg_pixels16_axp; + c->avg_pixels_tab[0][1] = avg_pixels16_x2_axp; + c->avg_pixels_tab[0][2] = avg_pixels16_y2_axp; + c->avg_pixels_tab[0][3] = avg_pixels16_xy2_axp; - avg_no_rnd_pixels_tab[0][0] = avg_no_rnd_pixels16_axp; - avg_no_rnd_pixels_tab[0][1] = avg_no_rnd_pixels16_x2_axp; - avg_no_rnd_pixels_tab[0][2] = avg_no_rnd_pixels16_y2_axp; - avg_no_rnd_pixels_tab[0][3] = avg_no_rnd_pixels16_xy2_axp; + c->avg_no_rnd_pixels_tab[0][0] = avg_no_rnd_pixels16_axp; + c->avg_no_rnd_pixels_tab[0][1] = avg_no_rnd_pixels16_x2_axp; + c->avg_no_rnd_pixels_tab[0][2] = avg_no_rnd_pixels16_y2_axp; + c->avg_no_rnd_pixels_tab[0][3] = avg_no_rnd_pixels16_xy2_axp; - put_pixels_tab[1][0] = put_pixels_axp_asm; - put_pixels_tab[1][1] = put_pixels_x2_axp; - put_pixels_tab[1][2] = put_pixels_y2_axp; - put_pixels_tab[1][3] = put_pixels_xy2_axp; + c->put_pixels_tab[1][0] = put_pixels_axp_asm; + c->put_pixels_tab[1][1] = put_pixels_x2_axp; + c->put_pixels_tab[1][2] = put_pixels_y2_axp; + c->put_pixels_tab[1][3] = put_pixels_xy2_axp; - put_no_rnd_pixels_tab[1][0] = put_pixels_axp_asm; - put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels_x2_axp; - put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels_y2_axp; - put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels_xy2_axp; + c->put_no_rnd_pixels_tab[1][0] = put_pixels_axp_asm; + c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels_x2_axp; + c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels_y2_axp; + c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels_xy2_axp; - avg_pixels_tab[1][0] = avg_pixels_axp; - avg_pixels_tab[1][1] = avg_pixels_x2_axp; - avg_pixels_tab[1][2] = avg_pixels_y2_axp; - avg_pixels_tab[1][3] = avg_pixels_xy2_axp; + c->avg_pixels_tab[1][0] = avg_pixels_axp; + c->avg_pixels_tab[1][1] = avg_pixels_x2_axp; + c->avg_pixels_tab[1][2] = avg_pixels_y2_axp; + c->avg_pixels_tab[1][3] = avg_pixels_xy2_axp; - avg_no_rnd_pixels_tab[1][0] = avg_no_rnd_pixels_axp; - avg_no_rnd_pixels_tab[1][1] = avg_no_rnd_pixels_x2_axp; - avg_no_rnd_pixels_tab[1][2] = avg_no_rnd_pixels_y2_axp; - avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels_xy2_axp; + c->avg_no_rnd_pixels_tab[1][0] = avg_no_rnd_pixels_axp; + c->avg_no_rnd_pixels_tab[1][1] = avg_no_rnd_pixels_x2_axp; + c->avg_no_rnd_pixels_tab[1][2] = avg_no_rnd_pixels_y2_axp; + c->avg_no_rnd_pixels_tab[1][3] = avg_no_rnd_pixels_xy2_axp; - clear_blocks = clear_blocks_axp; + c->clear_blocks = clear_blocks_axp; /* amask clears all bits that correspond to present features. */ if (amask(AMASK_MVI) == 0) { - put_pixels_clamped = put_pixels_clamped_mvi_asm; - add_pixels_clamped = add_pixels_clamped_mvi_asm; + c->put_pixels_clamped = put_pixels_clamped_mvi_asm; + c->add_pixels_clamped = add_pixels_clamped_mvi_asm; - get_pixels = get_pixels_mvi; - diff_pixels = diff_pixels_mvi; - pix_abs8x8 = pix_abs8x8_mvi; - pix_abs16x16 = pix_abs16x16_mvi_asm; - pix_abs16x16_x2 = pix_abs16x16_x2_mvi; - pix_abs16x16_y2 = pix_abs16x16_y2_mvi; - pix_abs16x16_xy2 = pix_abs16x16_xy2_mvi; + c->get_pixels = get_pixels_mvi; + c->diff_pixels = diff_pixels_mvi; + c->pix_abs8x8 = pix_abs8x8_mvi; + c->pix_abs16x16 = pix_abs16x16_mvi_asm; + c->pix_abs16x16_x2 = pix_abs16x16_x2_mvi; + c->pix_abs16x16_y2 = pix_abs16x16_y2_mvi; + c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mvi; } }
--- a/mlib/dsputil_mlib.c Mon Nov 11 09:44:59 2002 +0000 +++ b/mlib/dsputil_mlib.c Mon Nov 11 10:04:45 2002 +0000 @@ -223,30 +223,30 @@ mlib_VideoDCT8x8_S16_S16 (data, data); } -void dsputil_init_mlib(void) +void dsputil_init_mlib(DSPContext* c, unsigned mask) { - put_pixels_tab[0][0] = put_pixels16_mlib; - put_pixels_tab[0][1] = put_pixels16_x2_mlib; - put_pixels_tab[0][2] = put_pixels16_y2_mlib; - put_pixels_tab[0][3] = put_pixels16_xy2_mlib; - put_pixels_tab[1][0] = put_pixels8_mlib; - put_pixels_tab[1][1] = put_pixels8_x2_mlib; - put_pixels_tab[1][2] = put_pixels8_y2_mlib; - put_pixels_tab[1][3] = put_pixels8_xy2_mlib; + c->put_pixels_tab[0][0] = put_pixels16_mlib; + c->put_pixels_tab[0][1] = put_pixels16_x2_mlib; + c->put_pixels_tab[0][2] = put_pixels16_y2_mlib; + c->put_pixels_tab[0][3] = put_pixels16_xy2_mlib; + c->put_pixels_tab[1][0] = put_pixels8_mlib; + c->put_pixels_tab[1][1] = put_pixels8_x2_mlib; + c->put_pixels_tab[1][2] = put_pixels8_y2_mlib; + c->put_pixels_tab[1][3] = put_pixels8_xy2_mlib; - avg_pixels_tab[0][0] = avg_pixels16_mlib; - avg_pixels_tab[0][1] = avg_pixels16_x2_mlib; - avg_pixels_tab[0][2] = avg_pixels16_y2_mlib; - avg_pixels_tab[0][3] = avg_pixels16_xy2_mlib; - avg_pixels_tab[1][0] = avg_pixels8_mlib; - avg_pixels_tab[1][1] = avg_pixels8_x2_mlib; - avg_pixels_tab[1][2] = avg_pixels8_y2_mlib; - avg_pixels_tab[1][3] = avg_pixels8_xy2_mlib; - - put_no_rnd_pixels_tab[0][0] = put_pixels16_mlib; - put_no_rnd_pixels_tab[1][0] = put_pixels8_mlib; - - add_pixels_clamped = add_pixels_clamped_mlib; + c->avg_pixels_tab[0][0] = avg_pixels16_mlib; + c->avg_pixels_tab[0][1] = avg_pixels16_x2_mlib; + c->avg_pixels_tab[0][2] = avg_pixels16_y2_mlib; + c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mlib; + c->avg_pixels_tab[1][0] = avg_pixels8_mlib; + c->avg_pixels_tab[1][1] = avg_pixels8_x2_mlib; + c->avg_pixels_tab[1][2] = avg_pixels8_y2_mlib; + c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mlib; + + c->put_no_rnd_pixels_tab[0][0] = put_pixels16_mlib; + c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mlib; + + c->add_pixels_clamped = add_pixels_clamped_mlib; } void MPV_common_init_mlib(MpegEncContext *s)
--- a/ppc/dsputil_ppc.c Mon Nov 11 09:44:59 2002 +0000 +++ b/ppc/dsputil_ppc.c Mon Nov 11 10:04:45 2002 +0000 @@ -23,7 +23,7 @@ #include "dsputil_altivec.h" #endif -void dsputil_init_ppc(void) +void dsputil_init_ppc(DSPContext* c, unsigned mask) { // Common optimisations whether Altivec or not @@ -32,11 +32,11 @@ #if HAVE_ALTIVEC if (has_altivec()) { // Altivec specific optimisations - pix_abs16x16 = pix_abs16x16_altivec; - pix_abs8x8 = pix_abs8x8_altivec; - pix_sum = pix_sum_altivec; - diff_pixels = diff_pixels_altivec; - get_pixels = get_pixels_altivec; + c->pix_abs16x16 = pix_abs16x16_altivec; + c->pix_abs8x8 = pix_abs8x8_altivec; + c->pix_sum = pix_sum_altivec; + c->diff_pixels = diff_pixels_altivec; + c->get_pixels = get_pixels_altivec; } else #endif {
--- a/ps2/dsputil_mmi.c Mon Nov 11 09:44:59 2002 +0000 +++ b/ps2/dsputil_mmi.c Mon Nov 11 10:04:45 2002 +0000 @@ -103,16 +103,16 @@ } -void dsputil_init_mmi(void) +void dsputil_init_mmi(DSPContext* c, unsigned mask) { - clear_blocks = clear_blocks_mmi; - - put_pixels_tab[1][0] = put_pixels8_mmi; - put_no_rnd_pixels_tab[1][0] = put_pixels8_mmi; - - put_pixels_tab[0][0] = put_pixels16_mmi; - put_no_rnd_pixels_tab[0][0] = put_pixels16_mmi; - - get_pixels = get_pixels_mmi; + c->clear_blocks = clear_blocks_mmi; + + c->put_pixels_tab[1][0] = put_pixels8_mmi; + c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mmi; + + c->put_pixels_tab[0][0] = put_pixels16_mmi; + c->put_no_rnd_pixels_tab[0][0] = put_pixels16_mmi; + + c->get_pixels = get_pixels_mmi; }