// Copyright 2012 Google Inc. All Rights Reserved. // // This code is licensed under the same terms as WebM: // Software License Agreement: http://www.webmproject.org/license/software/ // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ // ----------------------------------------------------------------------------- // // Image transforms and color space conversion methods for lossless decoder. // // Author: Vikas Arora (vikaas.arora@gmail.com) // jyrki@google.com (Jyrki Alakuijala) #ifndef WEBP_DSP_LOSSLESS_H_ #define WEBP_DSP_LOSSLESS_H_ #include "../webp/types.h" #include "../webp/decode.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif //------------------------------------------------------------------------------ // Inverse image transforms. struct VP8LTransform; // Defined in dec/vp8li.h. // Performs inverse transform of data given transform information, start and end // rows. Transform will be applied to rows [row_start, row_end[. // The data_in & data_out are source and destination data pointers respectively // corresponding to the intermediate row (row_start). void VP8LInverseTransform(const struct VP8LTransform* const transform, int row_start, int row_end, uint32_t* const data_in, uint32_t* const data_out); //------------------------------------------------------------------------------ // Color space conversion. // Converts from BGRA to other color spaces. void VP8LConvertFromBGRA(const uint32_t* const in_data, int num_pixels, WEBP_CSP_MODE out_colorspace, uint8_t* const rgba); //------------------------------------------------------------------------------ // Misc methods. // Computes sampled size of 'size' when sampling using 'sampling bits'. static WEBP_INLINE uint32_t VP8LSubSampleSize(uint32_t size, uint32_t sampling_bits) { return (size + (1 << sampling_bits) - 1) >> sampling_bits; } //------------------------------------------------------------------------------ #if defined(__cplusplus) || defined(c_plusplus) } // extern "C" #endif #endif // WEBP_DSP_LOSSLESS_H_