mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
MIPS: dspr2: added optimization for TransformDC
Change-Id: Iee69758f6442ea9c80ddaa32cea8d00dda4c6252
This commit is contained in:
parent
c0e84df8e8
commit
24e1072aac
@ -39,6 +39,7 @@ LOCAL_SRC_FILES := \
|
||||
src/dsp/dec.c \
|
||||
src/dsp/dec_clip_tables.c \
|
||||
src/dsp/dec_mips32.c \
|
||||
src/dsp/dec_mips_dsp_r2.c \
|
||||
src/dsp/dec_neon.$(NEON) \
|
||||
src/dsp/dec_sse2.c \
|
||||
src/dsp/enc.c \
|
||||
|
@ -178,6 +178,7 @@ DSP_DEC_OBJS = \
|
||||
$(DIROBJ)\dsp\dec.obj \
|
||||
$(DIROBJ)\dsp\dec_clip_tables.obj \
|
||||
$(DIROBJ)\dsp\dec_mips32.obj \
|
||||
$(DIROBJ)\dsp\dec_mips_dsp_r2.obj \
|
||||
$(DIROBJ)\dsp\dec_neon.obj \
|
||||
$(DIROBJ)\dsp\dec_sse2.obj \
|
||||
$(DIROBJ)\dsp\filters_mips_dsp_r2.obj \
|
||||
|
@ -114,6 +114,7 @@ DSP_DEC_OBJS = \
|
||||
src/dsp/dec.o \
|
||||
src/dsp/dec_clip_tables.o \
|
||||
src/dsp/dec_mips32.o \
|
||||
src/dsp/dec_mips_dsp_r2.o \
|
||||
src/dsp/dec_neon.o \
|
||||
src/dsp/dec_sse2.o \
|
||||
src/dsp/filters_mips_dsp_r2.o \
|
||||
|
@ -15,6 +15,7 @@ COMMON_SOURCES += cpu.c
|
||||
COMMON_SOURCES += dec.c
|
||||
COMMON_SOURCES += dec_clip_tables.c
|
||||
COMMON_SOURCES += dec_mips32.c
|
||||
COMMON_SOURCES += dec_mips_dsp_r2.c
|
||||
COMMON_SOURCES += dec_neon.c
|
||||
COMMON_SOURCES += dsp.h
|
||||
COMMON_SOURCES += filters_mips_dsp_r2.c
|
||||
|
@ -687,6 +687,7 @@ VP8SimpleFilterFunc VP8SimpleHFilter16i;
|
||||
extern void VP8DspInitSSE2(void);
|
||||
extern void VP8DspInitNEON(void);
|
||||
extern void VP8DspInitMIPS32(void);
|
||||
extern void VP8DspInitMIPSdspR2(void);
|
||||
|
||||
void VP8DspInit(void) {
|
||||
VP8InitClipTables();
|
||||
@ -717,14 +718,21 @@ void VP8DspInit(void) {
|
||||
if (VP8GetCPUInfo(kSSE2)) {
|
||||
VP8DspInitSSE2();
|
||||
}
|
||||
#elif defined(WEBP_USE_NEON)
|
||||
#endif
|
||||
#if defined(WEBP_USE_NEON)
|
||||
if (VP8GetCPUInfo(kNEON)) {
|
||||
VP8DspInitNEON();
|
||||
}
|
||||
#elif defined(WEBP_USE_MIPS32)
|
||||
#endif
|
||||
#if defined(WEBP_USE_MIPS32)
|
||||
if (VP8GetCPUInfo(kMIPS32)) {
|
||||
VP8DspInitMIPS32();
|
||||
}
|
||||
#endif
|
||||
#if defined(WEBP_USE_MIPS_DSP_R2)
|
||||
if (VP8GetCPUInfo(kMIPSdspR2)) {
|
||||
VP8DspInitMIPSdspR2();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
83
src/dsp/dec_mips_dsp_r2.c
Normal file
83
src/dsp/dec_mips_dsp_r2.c
Normal file
@ -0,0 +1,83 @@
|
||||
// Copyright 2014 Google Inc. All Rights Reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style license
|
||||
// that can be found in the COPYING file in the root of the source
|
||||
// tree. An additional intellectual property rights grant can be found
|
||||
// in the file PATENTS. All contributing project authors may
|
||||
// be found in the AUTHORS file in the root of the source tree.
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
// MIPS version of dsp functions
|
||||
//
|
||||
// Author(s): Djordje Pesut (djordje.pesut@imgtec.com)
|
||||
// Jovan Zelincevic (jovan.zelincevic@imgtec.com)
|
||||
|
||||
#include "./dsp.h"
|
||||
|
||||
#if defined(WEBP_USE_MIPS_DSP_R2)
|
||||
|
||||
static void TransformDC(const int16_t* in, uint8_t* dst) {
|
||||
int temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9, temp10;
|
||||
|
||||
__asm__ volatile (
|
||||
"ulw %[temp1], 0(%[dst]) \n\t"
|
||||
"ulw %[temp2], 32(%[dst]) \n\t"
|
||||
"ulw %[temp3], 64(%[dst]) \n\t"
|
||||
"ulw %[temp4], 96(%[dst]) \n\t"
|
||||
"lh %[temp5], 0(%[in]) \n\t"
|
||||
"addiu %[temp5], %[temp5], 4 \n\t"
|
||||
"ins %[temp5], %[temp5], 16, 16 \n\t"
|
||||
"shra.ph %[temp5], %[temp5], 3 \n\t"
|
||||
"preceu.ph.qbr %[temp6], %[temp1] \n\t"
|
||||
"preceu.ph.qbl %[temp7], %[temp1] \n\t"
|
||||
"preceu.ph.qbr %[temp8], %[temp2] \n\t"
|
||||
"preceu.ph.qbl %[temp9], %[temp2] \n\t"
|
||||
"preceu.ph.qbr %[temp10], %[temp3] \n\t"
|
||||
"preceu.ph.qbl %[temp1], %[temp3] \n\t"
|
||||
"preceu.ph.qbr %[temp2], %[temp4] \n\t"
|
||||
"preceu.ph.qbl %[temp3], %[temp4] \n\t"
|
||||
"addq.ph %[temp6], %[temp6], %[temp5] \n\t"
|
||||
"addq.ph %[temp7], %[temp7], %[temp5] \n\t"
|
||||
"addq.ph %[temp8], %[temp8], %[temp5] \n\t"
|
||||
"addq.ph %[temp9], %[temp9], %[temp5] \n\t"
|
||||
"addq.ph %[temp10], %[temp10], %[temp5] \n\t"
|
||||
"addq.ph %[temp1], %[temp1], %[temp5] \n\t"
|
||||
"addq.ph %[temp2], %[temp2], %[temp5] \n\t"
|
||||
"addq.ph %[temp3], %[temp3], %[temp5] \n\t"
|
||||
"shll_s.ph %[temp6], %[temp6], 7 \n\t"
|
||||
"shll_s.ph %[temp7], %[temp7], 7 \n\t"
|
||||
"shll_s.ph %[temp8], %[temp8], 7 \n\t"
|
||||
"shll_s.ph %[temp9], %[temp9], 7 \n\t"
|
||||
"shll_s.ph %[temp10], %[temp10], 7 \n\t"
|
||||
"shll_s.ph %[temp1], %[temp1], 7 \n\t"
|
||||
"shll_s.ph %[temp2], %[temp2], 7 \n\t"
|
||||
"shll_s.ph %[temp3], %[temp3], 7 \n\t"
|
||||
"precrqu_s.qb.ph %[temp6], %[temp7], %[temp6] \n\t"
|
||||
"precrqu_s.qb.ph %[temp8], %[temp9], %[temp8] \n\t"
|
||||
"precrqu_s.qb.ph %[temp10], %[temp1], %[temp10] \n\t"
|
||||
"precrqu_s.qb.ph %[temp2], %[temp3], %[temp2] \n\t"
|
||||
"usw %[temp6], 0(%[dst]) \n\t"
|
||||
"usw %[temp8], 32(%[dst]) \n\t"
|
||||
"usw %[temp10], 64(%[dst]) \n\t"
|
||||
"usw %[temp2], 96(%[dst]) \n\t"
|
||||
: [temp1]"=&r"(temp1), [temp2]"=&r"(temp2), [temp3]"=&r"(temp3),
|
||||
[temp4]"=&r"(temp4), [temp5]"=&r"(temp5), [temp6]"=&r"(temp6),
|
||||
[temp7]"=&r"(temp7), [temp8]"=&r"(temp8), [temp9]"=&r"(temp9),
|
||||
[temp10]"=&r"(temp10)
|
||||
: [in]"r"(in), [dst]"r"(dst)
|
||||
: "memory"
|
||||
);
|
||||
}
|
||||
|
||||
#endif // WEBP_USE_MIPS_DSP_R2
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Entry point
|
||||
|
||||
extern void VP8DspInitMIPSdspR2(void);
|
||||
|
||||
void VP8DspInitMIPSdspR2(void) {
|
||||
#if defined(WEBP_USE_MIPS_DSP_R2)
|
||||
VP8TransformDC = TransformDC;
|
||||
#endif
|
||||
}
|
Loading…
Reference in New Issue
Block a user