2 * MMI optimized DSP utils
3 * Copyright (c) 2000, 2001 Fabrice Bellard.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * MMI optimization by Leon van Stuivenberg <leonvs@iae.nl>
22 #include "../dsputil.h"
24 void ff_mmi_idct(DCTELEM
* block
);
29 static void clear_blocks_mmi(DCTELEM
* blocks
)
33 for (i
= 0; i
< 6; i
++) {
42 __asm__
__volatile__("addi $4, $4, 128");
47 static void put_pixels_clamped_mmi(const DCTELEM
* block
, UINT8
* pixels
,
50 /* $4 = block, $5 = pixels, $6 = line_size */
51 __asm__
__volatile__("li $11, 255":::"$11");
53 pcpyld($
11, $
11, $
11);
57 ppacb($0, $##rs, $##rs); \
59 __asm__ __volatile__ ("add $5, $5, $6");
102 static void add_pixels_clamped_mmi(const DCTELEM * block, UINT8 * pixels,
109 void dsputil_init_mmi(void)
111 put_pixels_clamped
= put_pixels_clamped_mmi
;
112 //add_pixels_clamped = add_pixels_clamped_mmi;
113 clear_blocks
= clear_blocks_mmi
;
114 ff_idct
= ff_mmi_idct
;