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 VP8_DECODER_ONYXD_INT_H_
13 #define VP8_DECODER_ONYXD_INT_H_
15 #include "vpx_config.h"
16 #include "vp8/common/onyxd.h"
17 #include "treereader.h"
18 #include "vp8/common/onyxc_int.h"
19 #include "vp8/common/threading.h"
21 #if CONFIG_ERROR_CONCEALMENT
46 const unsigned char *ptrs
[MAX_PARTITIONS
];
47 unsigned int sizes
[MAX_PARTITIONS
];
50 #define MAX_FB_MT_DEC 32
55 * this struct will be populated with frame buffer management
56 * info in future commits. */
58 /* enable/disable frame-based threading */
59 int use_frame_threads
;
61 /* decoder instances */
62 struct VP8D_COMP
*pbi
[MAX_FB_MT_DEC
];
66 typedef struct VP8D_COMP
68 DECLARE_ALIGNED(16, MACROBLOCKD
, mb
);
70 YV12_BUFFER_CONFIG
*dec_fb_ref
[NUM_YV12_BUFFERS
];
72 DECLARE_ALIGNED(16, VP8_COMMON
, common
);
74 /* the last partition will be used for the modes/mvs */
75 vp8_reader mbc
[MAX_PARTITIONS
];
79 FRAGMENT_DATA fragments
;
81 #if CONFIG_MULTITHREAD
82 /* variable for threading */
84 volatile int b_multithreaded_rd
;
86 int current_mb_col_main
;
87 unsigned int decoding_thread_count
;
88 int allocated_decoding_thread_count
;
90 int mt_baseline_filter_level
[MAX_MB_SEGMENTS
];
92 int *mt_current_mb_col
; /* Each row remembers its already decoded column. */
94 unsigned char **mt_yabove_row
; /* mb_rows x width */
95 unsigned char **mt_uabove_row
;
96 unsigned char **mt_vabove_row
;
97 unsigned char **mt_yleft_col
; /* mb_rows x 16 */
98 unsigned char **mt_uleft_col
; /* mb_rows x 8 */
99 unsigned char **mt_vleft_col
; /* mb_rows x 8 */
101 MB_ROW_DEC
*mb_row_di
;
102 DECODETHREAD_DATA
*de_thread_data
;
104 pthread_t
*h_decoding_thread
;
105 sem_t
*h_event_start_decoding
;
106 sem_t h_event_end_decoding
;
107 /* end of threading data */
110 int64_t last_time_stamp
;
111 int ready_for_new_data
;
116 vp8_prob prob_skip_false
;
118 #if CONFIG_ERROR_CONCEALMENT
119 MB_OVERLAP
*overlaps
;
120 /* the mb num from which modes and mvs (first partition) are corrupt */
121 unsigned int mvs_corrupt_from_mb
;
125 int decoded_key_frame
;
126 int independent_partitions
;
127 int frame_corrupt_residual
;
129 vpx_decrypt_cb decrypt_cb
;
133 int vp8_decode_frame(VP8D_COMP
*cpi
);
135 int vp8_create_decoder_instances(struct frame_buffers
*fb
, VP8D_CONFIG
*oxcf
);
136 int vp8_remove_decoder_instances(struct frame_buffers
*fb
);
139 #define CHECK_MEM_ERROR(lval,expr) do {\
142 vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\
143 "Failed to allocate "#lval" at %s:%d", \
147 #define CHECK_MEM_ERROR(lval,expr) do {\
150 vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\
151 "Failed to allocate "#lval);\
159 #endif // VP8_DECODER_ONYXD_INT_H_