| rev |
line source |
|
nengel@2
|
1 /*
|
|
nengel@2
|
2 * Copyright (c) 2002 Brian Foley
|
|
nengel@2
|
3 * Copyright (c) 2002 Dieter Shirley
|
|
nengel@2
|
4 * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
|
|
nengel@2
|
5 *
|
|
nengel@2
|
6 * This file is part of FFmpeg.
|
|
nengel@2
|
7 *
|
|
nengel@2
|
8 * FFmpeg is free software; you can redistribute it and/or
|
|
nengel@2
|
9 * modify it under the terms of the GNU Lesser General Public
|
|
nengel@2
|
10 * License as published by the Free Software Foundation; either
|
|
nengel@2
|
11 * version 2.1 of the License, or (at your option) any later version.
|
|
nengel@2
|
12 *
|
|
nengel@2
|
13 * FFmpeg is distributed in the hope that it will be useful,
|
|
nengel@2
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
nengel@2
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
nengel@2
|
16 * Lesser General Public License for more details.
|
|
nengel@2
|
17 *
|
|
nengel@2
|
18 * You should have received a copy of the GNU Lesser General Public
|
|
nengel@2
|
19 * License along with FFmpeg; if not, write to the Free Software
|
|
nengel@2
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
nengel@2
|
21 */
|
|
nengel@2
|
22
|
|
nengel@2
|
23 #include "libavcodec/dsputil.h"
|
|
nengel@2
|
24 #include "dsputil_ppc.h"
|
|
nengel@2
|
25 #include "dsputil_altivec.h"
|
|
nengel@2
|
26
|
|
nengel@2
|
27 static void prefetch_ppc(void *mem, int stride, int h)
|
|
nengel@2
|
28 {
|
|
nengel@2
|
29 register const uint8_t *p = mem;
|
|
nengel@2
|
30 do {
|
|
nengel@2
|
31 __asm__ volatile ("dcbt 0,%0" : : "r" (p));
|
|
nengel@2
|
32 p+= stride;
|
|
nengel@2
|
33 } while(--h);
|
|
nengel@2
|
34 }
|
|
nengel@2
|
35
|
|
nengel@2
|
36 void dsputil_init_ppc(DSPContext* c)
|
|
nengel@2
|
37 {
|
|
nengel@2
|
38 c->prefetch = prefetch_ppc;
|
|
nengel@2
|
39
|
|
nengel@2
|
40 #if HAVE_ALTIVEC
|
|
nengel@2
|
41 dsputil_h264_init_ppc(c);
|
|
nengel@2
|
42 dsputil_init_altivec(c);
|
|
nengel@2
|
43
|
|
nengel@2
|
44 c->idct_put = idct_put_altivec;
|
|
nengel@2
|
45 c->idct_add = idct_add_altivec;
|
|
nengel@2
|
46
|
|
nengel@2
|
47 #endif /* HAVE_ALTIVEC */
|
|
nengel@2
|
48 }
|