| OLD | NEW |
| 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 // Quantizer initialization | 10 // Quantizer initialization |
| 11 // | 11 // |
| 12 // Author: Skal (pascal.massimino@gmail.com) | 12 // Author: Skal (pascal.massimino@gmail.com) |
| 13 | 13 |
| 14 #include "./vp8i.h" | 14 #include "./vp8i_dec.h" |
| 15 | 15 |
| 16 static WEBP_INLINE int clip(int v, int M) { | 16 static WEBP_INLINE int clip(int v, int M) { |
| 17 return v < 0 ? 0 : v > M ? M : v; | 17 return v < 0 ? 0 : v > M ? M : v; |
| 18 } | 18 } |
| 19 | 19 |
| 20 // Paragraph 14.1 | 20 // Paragraph 14.1 |
| 21 static const uint8_t kDcTable[128] = { | 21 static const uint8_t kDcTable[128] = { |
| 22 4, 5, 6, 7, 8, 9, 10, 10, | 22 4, 5, 6, 7, 8, 9, 10, 10, |
| 23 11, 12, 13, 14, 15, 16, 17, 17, | 23 11, 12, 13, 14, 15, 16, 17, 17, |
| 24 18, 19, 20, 20, 21, 21, 22, 22, | 24 18, 19, 20, 20, 21, 21, 22, 22, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 m->uv_mat_[0] = kDcTable[clip(q + dquv_dc, 117)]; | 101 m->uv_mat_[0] = kDcTable[clip(q + dquv_dc, 117)]; |
| 102 m->uv_mat_[1] = kAcTable[clip(q + dquv_ac, 127)]; | 102 m->uv_mat_[1] = kAcTable[clip(q + dquv_ac, 127)]; |
| 103 | 103 |
| 104 m->uv_quant_ = q + dquv_ac; // for dithering strength evaluation | 104 m->uv_quant_ = q + dquv_ac; // for dithering strength evaluation |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 //------------------------------------------------------------------------------ | 109 //------------------------------------------------------------------------------ |
| 110 | 110 |
| OLD | NEW |