OLD | NEW |
1 // Copyright 2011 Google Inc. All Rights Reserved. | 1 // Copyright 2011 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 // Speed-critical encoding functions. | 10 // Speed-critical encoding functions. |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 DCMode(I16DC16 + dst, left, top, 16, 16, 5); | 328 DCMode(I16DC16 + dst, left, top, 16, 16, 5); |
329 VerticalPred(I16VE16 + dst, top, 16); | 329 VerticalPred(I16VE16 + dst, top, 16); |
330 HorizontalPred(I16HE16 + dst, left, 16); | 330 HorizontalPred(I16HE16 + dst, left, 16); |
331 TrueMotion(I16TM16 + dst, left, top, 16); | 331 TrueMotion(I16TM16 + dst, left, top, 16); |
332 } | 332 } |
333 | 333 |
334 //------------------------------------------------------------------------------ | 334 //------------------------------------------------------------------------------ |
335 // luma 4x4 prediction | 335 // luma 4x4 prediction |
336 | 336 |
337 #define DST(x, y) dst[(x) + (y) * BPS] | 337 #define DST(x, y) dst[(x) + (y) * BPS] |
338 #define AVG3(a, b, c) (((a) + 2 * (b) + (c) + 2) >> 2) | 338 #define AVG3(a, b, c) ((uint8_t)(((a) + 2 * (b) + (c) + 2) >> 2)) |
339 #define AVG2(a, b) (((a) + (b) + 1) >> 1) | 339 #define AVG2(a, b) (((a) + (b) + 1) >> 1) |
340 | 340 |
341 static void VE4(uint8_t* dst, const uint8_t* top) { // vertical | 341 static void VE4(uint8_t* dst, const uint8_t* top) { // vertical |
342 const uint8_t vals[4] = { | 342 const uint8_t vals[4] = { |
343 AVG3(top[-1], top[0], top[1]), | 343 AVG3(top[-1], top[0], top[1]), |
344 AVG3(top[ 0], top[1], top[2]), | 344 AVG3(top[ 0], top[1], top[2]), |
345 AVG3(top[ 1], top[2], top[3]), | 345 AVG3(top[ 1], top[2], top[3]), |
346 AVG3(top[ 2], top[3], top[4]) | 346 AVG3(top[ 2], top[3], top[4]) |
347 }; | 347 }; |
348 int i; | 348 int i; |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 } | 854 } |
855 #endif | 855 #endif |
856 #if defined(WEBP_USE_MIPS_DSP_R2) | 856 #if defined(WEBP_USE_MIPS_DSP_R2) |
857 if (VP8GetCPUInfo(kMIPSdspR2)) { | 857 if (VP8GetCPUInfo(kMIPSdspR2)) { |
858 VP8EncDspInitMIPSdspR2(); | 858 VP8EncDspInitMIPSdspR2(); |
859 } | 859 } |
860 #endif | 860 #endif |
861 } | 861 } |
862 enc_last_cpuinfo_used = VP8GetCPUInfo; | 862 enc_last_cpuinfo_used = VP8GetCPUInfo; |
863 } | 863 } |
OLD | NEW |