summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Rabaud <vrabaud@google.com>2022-03-01 13:38:29 +0100
committerJames Zern <jzern@google.com>2022-03-02 02:55:26 +0000
commitb79a8421b81bf94a2a5cc4b0c054ad58ad2c96ae (patch)
tree1a6fe751ecfc4c9628ec02eab6a0ea4558e252f0
parent69c7f16111ec582bf1e7cb4d0d4f8d127e28a715 (diff)
downloadlibwebp-b79a8421b81bf94a2a5cc4b0c054ad58ad2c96ae.tar.gz
Fix lossless encoding for MIPS.
Bug: webp:558 Change-Id: I3d3ddb64ed26a8d8ff5664664c5f20f6eadfeb4f (cherry picked from commit e4cbcdd2b5ff33a64f97fe49d67fb56f915657e8)
-rw-r--r--src/dsp/lossless_enc_mips32.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dsp/lossless_enc_mips32.c b/src/dsp/lossless_enc_mips32.c
index 0412a093..99630517 100644
--- a/src/dsp/lossless_enc_mips32.c
+++ b/src/dsp/lossless_enc_mips32.c
@@ -347,24 +347,24 @@ static void GetCombinedEntropyUnrefined_MIPS32(const uint32_t X[],
static void AddVector_MIPS32(const uint32_t* pa, const uint32_t* pb,
uint32_t* pout, int size) {
uint32_t temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
- const uint32_t end = ((size) / 4) * 4;
+ const int end = ((size) / 4) * 4;
const uint32_t* const LoopEnd = pa + end;
int i;
ASM_START
ADD_TO_OUT(0, 4, 8, 12, 1, pa, pb, pout)
ASM_END_0
- for (i = end; i < size; ++i) pout[i] = pa[i] + pb[i];
+ for (i = 0; i < size - end; ++i) pout[i] = pa[i] + pb[i];
}
static void AddVectorEq_MIPS32(const uint32_t* pa, uint32_t* pout, int size) {
uint32_t temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
- const uint32_t end = ((size) / 4) * 4;
+ const int end = ((size) / 4) * 4;
const uint32_t* const LoopEnd = pa + end;
int i;
ASM_START
ADD_TO_OUT(0, 4, 8, 12, 0, pa, pout, pout)
ASM_END_1
- for (i = end; i < size; ++i) pout[i] += pa[i];
+ for (i = 0; i < size - end; ++i) pout[i] += pa[i];
}
#undef ASM_END_1