2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
12 #ifndef __INC_VP8D_INT_H
13 #define __INC_VP8D_INT_H
14 #include "vpx_ports/config.h"
15 #include "vp8/common/onyxd.h"
16 #include "treereader.h"
17 #include "vp8/common/onyxc_int.h"
18 #include "vp8/common/threading.h"
19 #include "dequantize.h"
20 #if CONFIG_ERROR_CONCEALMENT
55 UINT8 const *ptr_block2leftabove;
56 vp8_tree_index const *vp8_coef_tree_ptr;
57 TOKENEXTRABITS const *teb_base_ptr;
58 unsigned char *norm_ptr;
59 UINT8 *ptr_coef_bands_x;
61 ENTROPY_CONTEXT_PLANES *A;
62 ENTROPY_CONTEXT_PLANES *L;
64 INT16 *qcoeff_start_ptr;
65 BOOL_DECODER *current_bc;
67 vp8_prob const *coef_probs[4];
73 typedef struct VP8Decompressor
75 DECLARE_ALIGNED(16, MACROBLOCKD, mb);
77 DECLARE_ALIGNED(16, VP8_COMMON, common);
84 const unsigned char *Source;
85 unsigned int source_sz;
86 const unsigned char *partitions[MAX_PARTITIONS];
87 unsigned int partition_sizes[MAX_PARTITIONS];
88 unsigned int num_partitions;
90 #if CONFIG_MULTITHREAD
91 /* variable for threading */
93 volatile int b_multithreaded_rd;
95 int current_mb_col_main;
96 int decoding_thread_count;
97 int allocated_decoding_thread_count;
99 int mt_baseline_filter_level[MAX_MB_SEGMENTS];
101 int *mt_current_mb_col; /* Each row remembers its already decoded column. */
103 unsigned char **mt_yabove_row; /* mb_rows x width */
104 unsigned char **mt_uabove_row;
105 unsigned char **mt_vabove_row;
106 unsigned char **mt_yleft_col; /* mb_rows x 16 */
107 unsigned char **mt_uleft_col; /* mb_rows x 8 */
108 unsigned char **mt_vleft_col; /* mb_rows x 8 */
110 MB_ROW_DEC *mb_row_di;
111 DECODETHREAD_DATA *de_thread_data;
113 pthread_t *h_decoding_thread;
114 sem_t *h_event_start_decoding;
115 sem_t h_event_end_decoding;
116 /* end of threading data */
120 INT64 last_time_stamp;
121 int ready_for_new_data;
127 #if CONFIG_RUNTIME_CPU_DETECT
128 vp8_dequant_rtcd_vtable_t dequant;
135 vp8_prob prob_skip_false;
137 #if CONFIG_ERROR_CONCEALMENT
138 MB_OVERLAP *overlaps;
139 /* the mb num from which modes and mvs (first partition) are corrupt */
140 unsigned int mvs_corrupt_from_mb;
147 int vp8_decode_frame(VP8D_COMP *cpi);
148 void vp8_dmachine_specific_config(VP8D_COMP *pbi);
152 #define CHECK_MEM_ERROR(lval,expr) do {\
155 vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\
156 "Failed to allocate "#lval" at %s:%d", \
160 #define CHECK_MEM_ERROR(lval,expr) do {\
163 vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\
164 "Failed to allocate "#lval);\