comparison ppc/dsputil_ppc.c @ 1949:66215baae7b9 libavcodec

hadamard8_diff8x8 in AltiVec, the 16bits edition by (Romain Dolbeau <dolbeau at irisa dot fr>)
author michael
date Tue, 20 Apr 2004 17:05:12 +0000
parents dd63cb7e5080
children 2599b8444831
comparison
equal deleted inserted replaced
1948:d10578f7fd40 1949:66215baae7b9
1 /* 1 /*
2 * Copyright (c) 2002 Brian Foley 2 * Copyright (c) 2002 Brian Foley
3 * Copyright (c) 2002 Dieter Shirley 3 * Copyright (c) 2002 Dieter Shirley
4 * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
4 * 5 *
5 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public 7 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
57 "avg_pixels8_altivec", 58 "avg_pixels8_altivec",
58 "put_pixels8_xy2_altivec", 59 "put_pixels8_xy2_altivec",
59 "put_no_rnd_pixels8_xy2_altivec", 60 "put_no_rnd_pixels8_xy2_altivec",
60 "put_pixels16_xy2_altivec", 61 "put_pixels16_xy2_altivec",
61 "put_no_rnd_pixels16_xy2_altivec", 62 "put_no_rnd_pixels16_xy2_altivec",
63 "hadamard8_diff8x8_altivec",
62 "clear_blocks_dcbz32_ppc", 64 "clear_blocks_dcbz32_ppc",
63 "clear_blocks_dcbz128_ppc" 65 "clear_blocks_dcbz128_ppc"
64 }; 66 };
65 #include <stdio.h> 67 #include <stdio.h>
66 #endif 68 #endif
220 #else 222 #else
221 long check_dcbzl_effect(void) 223 long check_dcbzl_effect(void)
222 { 224 {
223 return 0; 225 return 0;
224 } 226 }
227 #endif
228
229 #ifdef HAVE_ALTIVEC
230 // can't put that in dsputil_altivec.c,
231 // has WARPER8_16_SQ declare the function "static" ...
232 WARPER8_16_SQ(hadamard8_diff8x8_altivec, hadamard8_diff16_altivec)
225 #endif 233 #endif
226 234
227 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) 235 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
228 { 236 {
229 // Common optimizations whether Altivec is available or not 237 // Common optimizations whether Altivec is available or not
260 // next one disabled as it's untested. 268 // next one disabled as it's untested.
261 #if 0 269 #if 0
262 c->add_bytes= add_bytes_altivec; 270 c->add_bytes= add_bytes_altivec;
263 #endif /* 0 */ 271 #endif /* 0 */
264 c->put_pixels_tab[0][0] = put_pixels16_altivec; 272 c->put_pixels_tab[0][0] = put_pixels16_altivec;
265 /* the tow functions do the same thing, so use the same code */ 273 /* the two functions do the same thing, so use the same code */
266 c->put_no_rnd_pixels_tab[0][0] = put_pixels16_altivec; 274 c->put_no_rnd_pixels_tab[0][0] = put_pixels16_altivec;
267 c->avg_pixels_tab[0][0] = avg_pixels16_altivec; 275 c->avg_pixels_tab[0][0] = avg_pixels16_altivec;
268 // next one disabled as it's untested. 276 // next one disabled as it's untested.
269 #if 0 277 #if 0
270 c->avg_pixels_tab[1][0] = avg_pixels8_altivec; 278 c->avg_pixels_tab[1][0] = avg_pixels8_altivec;
273 c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_altivec; 281 c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_altivec;
274 c->put_pixels_tab[0][3] = put_pixels16_xy2_altivec; 282 c->put_pixels_tab[0][3] = put_pixels16_xy2_altivec;
275 c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec; 283 c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec;
276 284
277 c->gmc1 = gmc1_altivec; 285 c->gmc1 = gmc1_altivec;
286
287 c->hadamard8_diff[0] = hadamard8_diff16_altivec;
288 c->hadamard8_diff[1] = hadamard8_diff8x8_altivec;
278 289
279 #ifdef CONFIG_ENCODERS 290 #ifdef CONFIG_ENCODERS
280 if (avctx->dct_algo == FF_DCT_AUTO || 291 if (avctx->dct_algo == FF_DCT_AUTO ||
281 avctx->dct_algo == FF_DCT_ALTIVEC) 292 avctx->dct_algo == FF_DCT_ALTIVEC)
282 { 293 {