| OLD | NEW |
| 1 // Copyright 2014 Google Inc. All Rights Reserved. | 1 // Copyright 2014 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Use of this source code is governed by a BSD-style license | 3 // Use of this source code is governed by a BSD-style license |
| 4 // that can be found in the COPYING file in the root of the source | 4 // that can be found in the COPYING file in the root of the source |
| 5 // tree. An additional intellectual property rights grant can be found | 5 // tree. An additional intellectual property rights grant can be found |
| 6 // in the file PATENTS. All contributing project authors may | 6 // in the file PATENTS. All contributing project authors may |
| 7 // be found in the AUTHORS file in the root of the source tree. | 7 // be found in the AUTHORS file in the root of the source tree. |
| 8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
| 9 // | 9 // |
| 10 // Author: Djordje Pesut (djordje.pesut@imgtec.com) | 10 // Author: Djordje Pesut (djordje.pesut@imgtec.com) |
| 11 | 11 |
| 12 #include "./dsp.h" | 12 #include "./dsp.h" |
| 13 | 13 |
| 14 #if defined(WEBP_USE_MIPS_DSP_R2) | 14 #if defined(WEBP_USE_MIPS_DSP_R2) |
| 15 | 15 |
| 16 #include "../enc/cost.h" | 16 #include "../enc/cost_enc.h" |
| 17 | 17 |
| 18 static int GetResidualCost(int ctx0, const VP8Residual* const res) { | 18 static int GetResidualCost(int ctx0, const VP8Residual* const res) { |
| 19 int temp0, temp1; | 19 int temp0, temp1; |
| 20 int v_reg, ctx_reg; | 20 int v_reg, ctx_reg; |
| 21 int n = res->first; | 21 int n = res->first; |
| 22 // should be prob[VP8EncBands[n]], but it's equivalent for n=0 or 1 | 22 // should be prob[VP8EncBands[n]], but it's equivalent for n=0 or 1 |
| 23 int p0 = res->prob[n][ctx0][0]; | 23 int p0 = res->prob[n][ctx0][0]; |
| 24 CostArrayPtr const costs = res->costs; | 24 CostArrayPtr const costs = res->costs; |
| 25 const uint16_t* t = costs[n][ctx0]; | 25 const uint16_t* t = costs[n][ctx0]; |
| 26 // bit_cost(1, p0) is already incorporated in t[] tables, but only if ctx != 0 | 26 // bit_cost(1, p0) is already incorporated in t[] tables, but only if ctx != 0 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitMIPSdspR2(void) { | 99 WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitMIPSdspR2(void) { |
| 100 VP8GetResidualCost = GetResidualCost; | 100 VP8GetResidualCost = GetResidualCost; |
| 101 } | 101 } |
| 102 | 102 |
| 103 #else // !WEBP_USE_MIPS_DSP_R2 | 103 #else // !WEBP_USE_MIPS_DSP_R2 |
| 104 | 104 |
| 105 WEBP_DSP_INIT_STUB(VP8EncDspCostInitMIPSdspR2) | 105 WEBP_DSP_INIT_STUB(VP8EncDspCostInitMIPSdspR2) |
| 106 | 106 |
| 107 #endif // WEBP_USE_MIPS_DSP_R2 | 107 #endif // WEBP_USE_MIPS_DSP_R2 |
| OLD | NEW |