xref: /aosp_15_r20/external/webp/src/dec/alphai_dec.h (revision b2055c353e87c8814eb2b6b1b11112a1562253bd)
1*b2055c35SXin Li // Copyright 2013 Google Inc. All Rights Reserved.
2*b2055c35SXin Li //
3*b2055c35SXin Li // Use of this source code is governed by a BSD-style license
4*b2055c35SXin Li // that can be found in the COPYING file in the root of the source
5*b2055c35SXin Li // tree. An additional intellectual property rights grant can be found
6*b2055c35SXin Li // in the file PATENTS. All contributing project authors may
7*b2055c35SXin Li // be found in the AUTHORS file in the root of the source tree.
8*b2055c35SXin Li // -----------------------------------------------------------------------------
9*b2055c35SXin Li //
10*b2055c35SXin Li // Alpha decoder: internal header.
11*b2055c35SXin Li //
12*b2055c35SXin Li // Author: Urvang ([email protected])
13*b2055c35SXin Li 
14*b2055c35SXin Li #ifndef WEBP_DEC_ALPHAI_DEC_H_
15*b2055c35SXin Li #define WEBP_DEC_ALPHAI_DEC_H_
16*b2055c35SXin Li 
17*b2055c35SXin Li #include "src/dec/webpi_dec.h"
18*b2055c35SXin Li #include "src/utils/filters_utils.h"
19*b2055c35SXin Li 
20*b2055c35SXin Li #ifdef __cplusplus
21*b2055c35SXin Li extern "C" {
22*b2055c35SXin Li #endif
23*b2055c35SXin Li 
24*b2055c35SXin Li struct VP8LDecoder;  // Defined in dec/vp8li.h.
25*b2055c35SXin Li 
26*b2055c35SXin Li typedef struct ALPHDecoder ALPHDecoder;
27*b2055c35SXin Li struct ALPHDecoder {
28*b2055c35SXin Li   int width_;
29*b2055c35SXin Li   int height_;
30*b2055c35SXin Li   int method_;
31*b2055c35SXin Li   WEBP_FILTER_TYPE filter_;
32*b2055c35SXin Li   int pre_processing_;
33*b2055c35SXin Li   struct VP8LDecoder* vp8l_dec_;
34*b2055c35SXin Li   VP8Io io_;
35*b2055c35SXin Li   int use_8b_decode_;  // Although alpha channel requires only 1 byte per
36*b2055c35SXin Li                        // pixel, sometimes VP8LDecoder may need to allocate
37*b2055c35SXin Li                        // 4 bytes per pixel internally during decode.
38*b2055c35SXin Li   uint8_t* output_;
39*b2055c35SXin Li   const uint8_t* prev_line_;   // last output row (or NULL)
40*b2055c35SXin Li };
41*b2055c35SXin Li 
42*b2055c35SXin Li //------------------------------------------------------------------------------
43*b2055c35SXin Li // internal functions. Not public.
44*b2055c35SXin Li 
45*b2055c35SXin Li // Deallocate memory associated to dec->alpha_plane_ decoding
46*b2055c35SXin Li void WebPDeallocateAlphaMemory(VP8Decoder* const dec);
47*b2055c35SXin Li 
48*b2055c35SXin Li //------------------------------------------------------------------------------
49*b2055c35SXin Li 
50*b2055c35SXin Li #ifdef __cplusplus
51*b2055c35SXin Li }    // extern "C"
52*b2055c35SXin Li #endif
53*b2055c35SXin Li 
54*b2055c35SXin Li #endif  // WEBP_DEC_ALPHAI_DEC_H_
55