nengel@2: /* nengel@2: * Copyright (c) 2002 Brian Foley nengel@2: * Copyright (c) 2002 Dieter Shirley nengel@2: * Copyright (c) 2003-2004 Romain Dolbeau nengel@2: * nengel@2: * This file is part of FFmpeg. nengel@2: * nengel@2: * FFmpeg is free software; you can redistribute it and/or nengel@2: * modify it under the terms of the GNU Lesser General Public nengel@2: * License as published by the Free Software Foundation; either nengel@2: * version 2.1 of the License, or (at your option) any later version. nengel@2: * nengel@2: * FFmpeg is distributed in the hope that it will be useful, nengel@2: * but WITHOUT ANY WARRANTY; without even the implied warranty of nengel@2: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU nengel@2: * Lesser General Public License for more details. nengel@2: * nengel@2: * You should have received a copy of the GNU Lesser General Public nengel@2: * License along with FFmpeg; if not, write to the Free Software nengel@2: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA nengel@2: */ nengel@2: nengel@2: #include "libavcodec/dsputil.h" nengel@2: #include "dsputil_ppc.h" nengel@2: #include "dsputil_altivec.h" nengel@2: nengel@2: static void prefetch_ppc(void *mem, int stride, int h) nengel@2: { nengel@2: register const uint8_t *p = mem; nengel@2: do { nengel@2: __asm__ volatile ("dcbt 0,%0" : : "r" (p)); nengel@2: p+= stride; nengel@2: } while(--h); nengel@2: } nengel@2: nengel@2: void dsputil_init_ppc(DSPContext* c) nengel@2: { nengel@2: c->prefetch = prefetch_ppc; nengel@2: nengel@2: #if HAVE_ALTIVEC nengel@2: dsputil_h264_init_ppc(c); nengel@2: dsputil_init_altivec(c); nengel@2: nengel@2: c->idct_put = idct_put_altivec; nengel@2: c->idct_add = idct_add_altivec; nengel@2: nengel@2: #endif /* HAVE_ALTIVEC */ nengel@2: }