Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: third_party/libwebp/dsp/dec.c

Issue 2584033003: libwebp-0.5.2-rc2 (Closed)
Patch Set: layout tests Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2010 Google Inc. All Rights Reserved. 1 // Copyright 2010 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 decoding functions, default plain-C implementations. 10 // Speed-critical decoding functions, default plain-C implementations.
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 static void DC16NoTopLeft(uint8_t* dst) { // DC with no top and left samples 233 static void DC16NoTopLeft(uint8_t* dst) { // DC with no top and left samples
234 Put16(0x80, dst); 234 Put16(0x80, dst);
235 } 235 }
236 236
237 VP8PredFunc VP8PredLuma16[NUM_B_DC_MODES]; 237 VP8PredFunc VP8PredLuma16[NUM_B_DC_MODES];
238 238
239 //------------------------------------------------------------------------------ 239 //------------------------------------------------------------------------------
240 // 4x4 240 // 4x4
241 241
242 #define AVG3(a, b, c) (((a) + 2 * (b) + (c) + 2) >> 2) 242 #define AVG3(a, b, c) ((uint8_t)(((a) + 2 * (b) + (c) + 2) >> 2))
243 #define AVG2(a, b) (((a) + (b) + 1) >> 1) 243 #define AVG2(a, b) (((a) + (b) + 1) >> 1)
244 244
245 static void VE4(uint8_t* dst) { // vertical 245 static void VE4(uint8_t* dst) { // vertical
246 const uint8_t* top = dst - BPS; 246 const uint8_t* top = dst - BPS;
247 const uint8_t vals[4] = { 247 const uint8_t vals[4] = {
248 AVG3(top[-1], top[0], top[1]), 248 AVG3(top[-1], top[0], top[1]),
249 AVG3(top[ 0], top[1], top[2]), 249 AVG3(top[ 0], top[1], top[2]),
250 AVG3(top[ 1], top[2], top[3]), 250 AVG3(top[ 1], top[2], top[3]),
251 AVG3(top[ 2], top[3], top[4]) 251 AVG3(top[ 2], top[3], top[4])
252 }; 252 };
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 } 786 }
787 #endif 787 #endif
788 #if defined(WEBP_USE_MSA) 788 #if defined(WEBP_USE_MSA)
789 if (VP8GetCPUInfo(kMSA)) { 789 if (VP8GetCPUInfo(kMSA)) {
790 VP8DspInitMSA(); 790 VP8DspInitMSA();
791 } 791 }
792 #endif 792 #endif
793 } 793 }
794 dec_last_cpuinfo_used = VP8GetCPUInfo; 794 dec_last_cpuinfo_used = VP8GetCPUInfo;
795 } 795 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698