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

Side by Side Diff: third_party/libwebp/utils/quant_levels_dec.c

Issue 653803003: libwebp: update to 0.4.2-rc2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « third_party/libwebp/utils/endian_inl.h ('k') | third_party/libwebp/utils/utils.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 Google Inc. All Rights Reserved. 1 // Copyright 2013 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 // Implement gradient smoothing: we replace a current alpha value by its 10 // Implement gradient smoothing: we replace a current alpha value by its
(...skipping 14 matching lines...) Expand all
25 #define FIX 16 // fix-point precision for averaging 25 #define FIX 16 // fix-point precision for averaging
26 #define LFIX 2 // extra precision for look-up table 26 #define LFIX 2 // extra precision for look-up table
27 #define LUT_SIZE ((1 << (8 + LFIX)) - 1) // look-up table size 27 #define LUT_SIZE ((1 << (8 + LFIX)) - 1) // look-up table size
28 28
29 #if defined(USE_DITHERING) 29 #if defined(USE_DITHERING)
30 30
31 #define DFIX 4 // extra precision for ordered dithering 31 #define DFIX 4 // extra precision for ordered dithering
32 #define DSIZE 4 // dithering size (must be a power of two) 32 #define DSIZE 4 // dithering size (must be a power of two)
33 // cf. http://en.wikipedia.org/wiki/Ordered_dithering 33 // cf. http://en.wikipedia.org/wiki/Ordered_dithering
34 static const uint8_t kOrderedDither[DSIZE][DSIZE] = { 34 static const uint8_t kOrderedDither[DSIZE][DSIZE] = {
35 { 0, 8, 2, 10 }, // coefficients are in DFIX fixed-point precision 35 { 0, 8, 2, 10 }, // coefficients are in DFIX fixed-point precision
36 { 12, 4, 14, 6 }, 36 { 12, 4, 14, 6 },
37 { 3, 11, 1, 9 }, 37 { 3, 11, 1, 9 },
38 { 15, 7, 13, 5 } 38 { 15, 7, 13, 5 }
39 }; 39 };
40 40
41 #else 41 #else
42 #define DFIX 0 42 #define DFIX 0
43 #endif 43 #endif
44 44
45 typedef struct { 45 typedef struct {
46 int width_, height_; // dimension 46 int width_, height_; // dimension
47 int row_; // current input row being processed 47 int row_; // current input row being processed
48 uint8_t* src_; // input pointer 48 uint8_t* src_; // input pointer
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 if (p.row_ >= p.radius_) { 270 if (p.row_ >= p.radius_) {
271 HFilter(&p); 271 HFilter(&p);
272 ApplyFilter(&p); 272 ApplyFilter(&p);
273 } 273 }
274 } 274 }
275 } 275 }
276 CleanupParams(&p); 276 CleanupParams(&p);
277 } 277 }
278 return 1; 278 return 1;
279 } 279 }
OLDNEW
« no previous file with comments | « third_party/libwebp/utils/endian_inl.h ('k') | third_party/libwebp/utils/utils.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698