OLD | NEW |
1 // Copyright 2010 Google Inc. All Rights Reserved. | 1 // Copyright 2010 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 // VP8 decoder: internal header. | 10 // VP8 decoder: internal header. |
(...skipping 14 matching lines...) Expand all Loading... |
25 #ifdef __cplusplus | 25 #ifdef __cplusplus |
26 extern "C" { | 26 extern "C" { |
27 #endif | 27 #endif |
28 | 28 |
29 //------------------------------------------------------------------------------ | 29 //------------------------------------------------------------------------------ |
30 // Various defines and enums | 30 // Various defines and enums |
31 | 31 |
32 // version numbers | 32 // version numbers |
33 #define DEC_MAJ_VERSION 0 | 33 #define DEC_MAJ_VERSION 0 |
34 #define DEC_MIN_VERSION 5 | 34 #define DEC_MIN_VERSION 5 |
35 #define DEC_REV_VERSION 0 | 35 #define DEC_REV_VERSION 1 |
36 | 36 |
37 // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline). | 37 // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline). |
38 // Constraints are: We need to store one 16x16 block of luma samples (y), | 38 // Constraints are: We need to store one 16x16 block of luma samples (y), |
39 // and two 8x8 chroma blocks (u/v). These are better be 16-bytes aligned, | 39 // and two 8x8 chroma blocks (u/v). These are better be 16-bytes aligned, |
40 // in order to be SIMD-friendly. We also need to store the top, left and | 40 // in order to be SIMD-friendly. We also need to store the top, left and |
41 // top-left samples (from previously decoded blocks), along with four | 41 // top-left samples (from previously decoded blocks), along with four |
42 // extra top-right samples for luma (intra4x4 prediction only). | 42 // extra top-right samples for luma (intra4x4 prediction only). |
43 // One possible layout is, using 32 * (17 + 9) bytes: | 43 // One possible layout is, using 32 * (17 + 9) bytes: |
44 // | 44 // |
45 // .+------ <- only 1 pixel high | 45 // .+------ <- only 1 pixel high |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 int num_caches_; // number of cached rows of 16 pixels (1, 2 or 3) | 202 int num_caches_; // number of cached rows of 16 pixels (1, 2 or 3) |
203 VP8ThreadContext thread_ctx_; // Thread context | 203 VP8ThreadContext thread_ctx_; // Thread context |
204 | 204 |
205 // dimension, in macroblock units. | 205 // dimension, in macroblock units. |
206 int mb_w_, mb_h_; | 206 int mb_w_, mb_h_; |
207 | 207 |
208 // Macroblock to process/filter, depending on cropping and filter_type. | 208 // Macroblock to process/filter, depending on cropping and filter_type. |
209 int tl_mb_x_, tl_mb_y_; // top-left MB that must be in-loop filtered | 209 int tl_mb_x_, tl_mb_y_; // top-left MB that must be in-loop filtered |
210 int br_mb_x_, br_mb_y_; // last bottom-right MB that must be decoded | 210 int br_mb_x_, br_mb_y_; // last bottom-right MB that must be decoded |
211 | 211 |
212 // number of partitions. | 212 // number of partitions minus one. |
213 int num_parts_; | 213 uint32_t num_parts_minus_one_; |
214 // per-partition boolean decoders. | 214 // per-partition boolean decoders. |
215 VP8BitReader parts_[MAX_NUM_PARTITIONS]; | 215 VP8BitReader parts_[MAX_NUM_PARTITIONS]; |
216 | 216 |
217 // Dithering strength, deduced from decoding options | 217 // Dithering strength, deduced from decoding options |
218 int dither_; // whether to use dithering or not | 218 int dither_; // whether to use dithering or not |
219 VP8Random dithering_rg_; // random generator for dithering | 219 VP8Random dithering_rg_; // random generator for dithering |
220 | 220 |
221 // dequantization (one set of DC/AC dequant factor per segment) | 221 // dequantization (one set of DC/AC dequant factor per segment) |
222 VP8QuantMatrix dqm_[NUM_MB_SEGMENTS]; | 222 VP8QuantMatrix dqm_[NUM_MB_SEGMENTS]; |
223 | 223 |
(...skipping 27 matching lines...) Expand all Loading... |
251 VP8MBData* mb_data_; // parsed reconstruction data | 251 VP8MBData* mb_data_; // parsed reconstruction data |
252 | 252 |
253 // Filtering side-info | 253 // Filtering side-info |
254 int filter_type_; // 0=off, 1=simple, 2=complex | 254 int filter_type_; // 0=off, 1=simple, 2=complex |
255 VP8FInfo fstrengths_[NUM_MB_SEGMENTS][2]; // precalculated per-segment/type | 255 VP8FInfo fstrengths_[NUM_MB_SEGMENTS][2]; // precalculated per-segment/type |
256 | 256 |
257 // Alpha | 257 // Alpha |
258 struct ALPHDecoder* alph_dec_; // alpha-plane decoder object | 258 struct ALPHDecoder* alph_dec_; // alpha-plane decoder object |
259 const uint8_t* alpha_data_; // compressed alpha data (if present) | 259 const uint8_t* alpha_data_; // compressed alpha data (if present) |
260 size_t alpha_data_size_; | 260 size_t alpha_data_size_; |
261 int is_alpha_decoded_; // true if alpha_data_ is decoded in alpha_plane_ | 261 int is_alpha_decoded_; // true if alpha_data_ is decoded in alpha_plane_ |
262 uint8_t* alpha_plane_; // output. Persistent, contains the whole data. | 262 uint8_t* alpha_plane_mem_; // memory allocated for alpha_plane_ |
263 int alpha_dithering_; // derived from decoding options (0=off, 100=full). | 263 uint8_t* alpha_plane_; // output. Persistent, contains the whole data. |
| 264 const uint8_t* alpha_prev_line_; // last decoded alpha row (or NULL) |
| 265 int alpha_dithering_; // derived from decoding options (0=off, 100=full) |
264 }; | 266 }; |
265 | 267 |
266 //------------------------------------------------------------------------------ | 268 //------------------------------------------------------------------------------ |
267 // internal functions. Not public. | 269 // internal functions. Not public. |
268 | 270 |
269 // in vp8.c | 271 // in vp8.c |
270 int VP8SetError(VP8Decoder* const dec, | 272 int VP8SetError(VP8Decoder* const dec, |
271 VP8StatusCode error, const char* const msg); | 273 VP8StatusCode error, const char* const msg); |
272 | 274 |
273 // in tree.c | 275 // in tree.c |
(...skipping 25 matching lines...) Expand all Loading... |
299 VP8Decoder* const dec); | 301 VP8Decoder* const dec); |
300 // Process the last decoded row (filtering + output). | 302 // Process the last decoded row (filtering + output). |
301 int VP8ProcessRow(VP8Decoder* const dec, VP8Io* const io); | 303 int VP8ProcessRow(VP8Decoder* const dec, VP8Io* const io); |
302 // To be called at the start of a new scanline, to initialize predictors. | 304 // To be called at the start of a new scanline, to initialize predictors. |
303 void VP8InitScanline(VP8Decoder* const dec); | 305 void VP8InitScanline(VP8Decoder* const dec); |
304 // Decode one macroblock. Returns false if there is not enough data. | 306 // Decode one macroblock. Returns false if there is not enough data. |
305 int VP8DecodeMB(VP8Decoder* const dec, VP8BitReader* const token_br); | 307 int VP8DecodeMB(VP8Decoder* const dec, VP8BitReader* const token_br); |
306 | 308 |
307 // in alpha.c | 309 // in alpha.c |
308 const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec, | 310 const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec, |
| 311 const VP8Io* const io, |
309 int row, int num_rows); | 312 int row, int num_rows); |
310 | 313 |
311 //------------------------------------------------------------------------------ | 314 //------------------------------------------------------------------------------ |
312 | 315 |
313 #ifdef __cplusplus | 316 #ifdef __cplusplus |
314 } // extern "C" | 317 } // extern "C" |
315 #endif | 318 #endif |
316 | 319 |
317 #endif /* WEBP_DEC_VP8I_H_ */ | 320 #endif /* WEBP_DEC_VP8I_H_ */ |
OLD | NEW |