OLD | NEW |
1 // Copyright 2011 Google Inc. All Rights Reserved. | 1 // Copyright 2011 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 // Internal header: WebP decoding parameters and custom IO on buffer | 10 // Internal header: WebP decoding parameters and custom IO on buffer |
11 // | 11 // |
12 // Author: somnath@google.com (Somnath Banerjee) | 12 // Author: somnath@google.com (Somnath Banerjee) |
13 | 13 |
14 #ifndef WEBP_DEC_WEBPI_H_ | 14 #ifndef WEBP_DEC_WEBPI_H_ |
15 #define WEBP_DEC_WEBPI_H_ | 15 #define WEBP_DEC_WEBPI_H_ |
16 | 16 |
17 #ifdef __cplusplus | 17 #ifdef __cplusplus |
18 extern "C" { | 18 extern "C" { |
19 #endif | 19 #endif |
20 | 20 |
21 #include "../utils/rescaler.h" | 21 #include "../utils/rescaler.h" |
22 #include "./decode_vp8.h" | 22 #include "./decode_vp8.h" |
23 | 23 |
24 //------------------------------------------------------------------------------ | 24 //------------------------------------------------------------------------------ |
25 // WebPDecParams: Decoding output parameters. Transient internal object. | 25 // WebPDecParams: Decoding output parameters. Transient internal object. |
26 | 26 |
27 typedef struct WebPDecParams WebPDecParams; | 27 typedef struct WebPDecParams WebPDecParams; |
28 typedef int (*OutputFunc)(const VP8Io* const io, WebPDecParams* const p); | 28 typedef int (*OutputFunc)(const VP8Io* const io, WebPDecParams* const p); |
29 typedef int (*OutputRowFunc)(WebPDecParams* const p, int y_pos); | 29 typedef int (*OutputAlphaFunc)(const VP8Io* const io, WebPDecParams* const p, |
| 30 int expected_num_out_lines); |
| 31 typedef int (*OutputRowFunc)(WebPDecParams* const p, int y_pos, |
| 32 int max_out_lines); |
30 | 33 |
31 struct WebPDecParams { | 34 struct WebPDecParams { |
32 WebPDecBuffer* output; // output buffer. | 35 WebPDecBuffer* output; // output buffer. |
33 uint8_t* tmp_y, *tmp_u, *tmp_v; // cache for the fancy upsampler | 36 uint8_t* tmp_y, *tmp_u, *tmp_v; // cache for the fancy upsampler |
34 // or used for tmp rescaling | 37 // or used for tmp rescaling |
35 | 38 |
36 int last_y; // coordinate of the line that was last output | 39 int last_y; // coordinate of the line that was last output |
37 const WebPDecoderOptions* options; // if not NULL, use alt decoding features | 40 const WebPDecoderOptions* options; // if not NULL, use alt decoding features |
38 // rescalers | 41 // rescalers |
39 WebPRescaler scaler_y, scaler_u, scaler_v, scaler_a; | 42 WebPRescaler scaler_y, scaler_u, scaler_v, scaler_a; |
40 void* memory; // overall scratch memory for the output work. | 43 void* memory; // overall scratch memory for the output work. |
41 | 44 |
42 OutputFunc emit; // output RGB or YUV samples | 45 OutputFunc emit; // output RGB or YUV samples |
43 OutputFunc emit_alpha; // output alpha channel | 46 OutputAlphaFunc emit_alpha; // output alpha channel |
44 OutputRowFunc emit_alpha_row; // output one line of rescaled alpha values | 47 OutputRowFunc emit_alpha_row; // output one line of rescaled alpha values |
45 }; | 48 }; |
46 | 49 |
47 // Should be called first, before any use of the WebPDecParams object. | 50 // Should be called first, before any use of the WebPDecParams object. |
48 void WebPResetDecParams(WebPDecParams* const params); | 51 void WebPResetDecParams(WebPDecParams* const params); |
49 | 52 |
50 //------------------------------------------------------------------------------ | 53 //------------------------------------------------------------------------------ |
51 // Header parsing helpers | 54 // Header parsing helpers |
52 | 55 |
53 // Structure storing a description of the RIFF headers. | 56 // Structure storing a description of the RIFF headers. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // Copy and transfer ownership from src to dst (beware of parameter order!) | 114 // Copy and transfer ownership from src to dst (beware of parameter order!) |
112 void WebPGrabDecBuffer(WebPDecBuffer* const src, WebPDecBuffer* const dst); | 115 void WebPGrabDecBuffer(WebPDecBuffer* const src, WebPDecBuffer* const dst); |
113 | 116 |
114 //------------------------------------------------------------------------------ | 117 //------------------------------------------------------------------------------ |
115 | 118 |
116 #ifdef __cplusplus | 119 #ifdef __cplusplus |
117 } // extern "C" | 120 } // extern "C" |
118 #endif | 121 #endif |
119 | 122 |
120 #endif /* WEBP_DEC_WEBPI_H_ */ | 123 #endif /* WEBP_DEC_WEBPI_H_ */ |
OLD | NEW |