| OLD | NEW |
| 1 // Copyright 2012 Google Inc. All Rights Reserved. | 1 // Copyright 2012 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // This code is licensed under the same terms as WebM: | 3 // Use of this source code is governed by a BSD-style license |
| 4 // Software License Agreement: http://www.webmproject.org/license/software/ | 4 // that can be found in the COPYING file in the root of the source |
| 5 // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ | 5 // tree. An additional intellectual property rights grant can be found |
| 6 // in the file PATENTS. All contributing project authors may |
| 7 // be found in the AUTHORS file in the root of the source tree. |
| 6 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
| 7 // | 9 // |
| 8 // Image transforms and color space conversion methods for lossless decoder. | 10 // Image transforms and color space conversion methods for lossless decoder. |
| 9 // | 11 // |
| 10 // Authors: Vikas Arora (vikaas.arora@gmail.com) | 12 // Authors: Vikas Arora (vikaas.arora@gmail.com) |
| 11 // Jyrki Alakuijala (jyrki@google.com) | 13 // Jyrki Alakuijala (jyrki@google.com) |
| 12 | 14 |
| 13 #ifndef WEBP_DSP_LOSSLESS_H_ | 15 #ifndef WEBP_DSP_LOSSLESS_H_ |
| 14 #define WEBP_DSP_LOSSLESS_H_ | 16 #define WEBP_DSP_LOSSLESS_H_ |
| 15 | 17 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 26 struct VP8LTransform; // Defined in dec/vp8li.h. | 28 struct VP8LTransform; // Defined in dec/vp8li.h. |
| 27 | 29 |
| 28 // Performs inverse transform of data given transform information, start and end | 30 // Performs inverse transform of data given transform information, start and end |
| 29 // rows. Transform will be applied to rows [row_start, row_end[. | 31 // rows. Transform will be applied to rows [row_start, row_end[. |
| 30 // The *in and *out pointers refer to source and destination data respectively | 32 // The *in and *out pointers refer to source and destination data respectively |
| 31 // corresponding to the intermediate row (row_start). | 33 // corresponding to the intermediate row (row_start). |
| 32 void VP8LInverseTransform(const struct VP8LTransform* const transform, | 34 void VP8LInverseTransform(const struct VP8LTransform* const transform, |
| 33 int row_start, int row_end, | 35 int row_start, int row_end, |
| 34 const uint32_t* const in, uint32_t* const out); | 36 const uint32_t* const in, uint32_t* const out); |
| 35 | 37 |
| 38 // Similar to the static method ColorIndexInverseTransform() that is part of |
| 39 // lossless.c, but used only for alpha decoding. It takes uint8_t (rather than |
| 40 // uint32_t) arguments for 'src' and 'dst'. |
| 41 void VP8LColorIndexInverseTransformAlpha( |
| 42 const struct VP8LTransform* const transform, int y_start, int y_end, |
| 43 const uint8_t* src, uint8_t* dst); |
| 44 |
| 36 // Subtracts green from blue and red channels. | 45 // Subtracts green from blue and red channels. |
| 37 void VP8LSubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixs); | 46 void VP8LSubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixs); |
| 38 | 47 |
| 39 void VP8LResidualImage(int width, int height, int bits, | 48 void VP8LResidualImage(int width, int height, int bits, |
| 40 uint32_t* const argb, uint32_t* const argb_scratch, | 49 uint32_t* const argb, uint32_t* const argb_scratch, |
| 41 uint32_t* const image); | 50 uint32_t* const image); |
| 42 | 51 |
| 43 void VP8LColorSpaceTransform(int width, int height, int bits, int step, | 52 void VP8LColorSpaceTransform(int width, int height, int bits, int step, |
| 44 uint32_t* const argb, uint32_t* image); | 53 uint32_t* const argb, uint32_t* image); |
| 45 | 54 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 76 | 85 |
| 77 // In-place difference of each component with mod 256. | 86 // In-place difference of each component with mod 256. |
| 78 static WEBP_INLINE uint32_t VP8LSubPixels(uint32_t a, uint32_t b) { | 87 static WEBP_INLINE uint32_t VP8LSubPixels(uint32_t a, uint32_t b) { |
| 79 const uint32_t alpha_and_green = | 88 const uint32_t alpha_and_green = |
| 80 0x00ff00ffu + (a & 0xff00ff00u) - (b & 0xff00ff00u); | 89 0x00ff00ffu + (a & 0xff00ff00u) - (b & 0xff00ff00u); |
| 81 const uint32_t red_and_blue = | 90 const uint32_t red_and_blue = |
| 82 0xff00ff00u + (a & 0x00ff00ffu) - (b & 0x00ff00ffu); | 91 0xff00ff00u + (a & 0x00ff00ffu) - (b & 0x00ff00ffu); |
| 83 return (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu); | 92 return (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu); |
| 84 } | 93 } |
| 85 | 94 |
| 95 void VP8LBundleColorMap(const uint8_t* const row, int width, |
| 96 int xbits, uint32_t* const dst); |
| 97 |
| 86 //------------------------------------------------------------------------------ | 98 //------------------------------------------------------------------------------ |
| 87 | 99 |
| 88 #if defined(__cplusplus) || defined(c_plusplus) | 100 #if defined(__cplusplus) || defined(c_plusplus) |
| 89 } // extern "C" | 101 } // extern "C" |
| 90 #endif | 102 #endif |
| 91 | 103 |
| 92 #endif // WEBP_DSP_LOSSLESS_H_ | 104 #endif // WEBP_DSP_LOSSLESS_H_ |
| OLD | NEW |