aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ps2
diff options
context:
space:
mode:
authorLeon van Stuivenberg <leonvs@iae.nl>2003-03-18 20:08:57 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-03-18 20:08:57 +0000
commit5031c5b47bfcd1b1a0684b0993069747f5c9dc4e (patch)
tree1dafe8aabbb2ff1d826c13ea88274b075ff8f2b1 /libavcodec/ps2
parenta05c8d7177857c8a78144cbccc512c282065195a (diff)
downloadffmpeg-5031c5b47bfcd1b1a0684b0993069747f5c9dc4e.tar.gz
clear_blocks_mmi() optimization by BroadQ (and patch by Leon van Stuivenberg <leonvs at iae dot nl>)
Originally committed as revision 1691 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ps2')
-rw-r--r--libavcodec/ps2/dsputil_mmi.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/libavcodec/ps2/dsputil_mmi.c b/libavcodec/ps2/dsputil_mmi.c
index 68a3f3a821..93ae27cdbd 100644
--- a/libavcodec/ps2/dsputil_mmi.c
+++ b/libavcodec/ps2/dsputil_mmi.c
@@ -17,6 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* MMI optimization by Leon van Stuivenberg <leonvs@iae.nl>
+ * clear_blocks_mmi() by BroadQ
*/
#include "../dsputil.h"
@@ -28,19 +29,21 @@ void ff_mmi_idct_add(uint8_t *dest, int line_size, DCTELEM *block);
static void clear_blocks_mmi(DCTELEM * blocks)
{
- int i;
- for (i = 0; i < 6; i++) {
asm volatile(
- "sq $0, 0(%0) \n\t"
- "sq $0, 16(%0) \n\t"
- "sq $0, 32(%0) \n\t"
- "sq $0, 48(%0) \n\t"
- "sq $0, 64(%0) \n\t"
- "sq $0, 80(%0) \n\t"
- "sq $0, 96(%0) \n\t"
- "sq $0, 112(%0) \n\t" :: "r" (blocks) : "memory" );
- blocks += 64;
- }
+ ".set noreorder \n"
+ "addiu $9, %0, 768 \n"
+ "nop \n"
+ "1: \n"
+ "sq $0, 0(%0) \n"
+ "move $8, %0 \n"
+ "addi %0, %0, 64 \n"
+ "sq $0, 16($8) \n"
+ "slt $10, %0, $9 \n"
+ "sq $0, 32($8) \n"
+ "bnez $10, 1b \n"
+ "sq $0, 48($8) \n"
+ ".set reorder \n"
+ : "+r" (blocks) :: "$8", "$9", "memory" );
}