
Pulled from the current HEAD (218c32e). The history of this and related files is a bit entangled so rather trying to split the changes and introduce some noise in master's history we'll start with a fresh snapshot. The file progression is still available in the experimental branch. Change-Id: I40538799dbf999abb9408ac83f55b897d8e22498
60 lines
2.2 KiB
C
60 lines
2.2 KiB
C
// 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,
|
|
size_t row_start, size_t 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_
|