1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libvpx/vp8/decoder/onyxd_int.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,151 @@ 1.4 +/* 1.5 + * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 1.6 + * 1.7 + * Use of this source code is governed by a BSD-style license 1.8 + * that can be found in the LICENSE file in the root of the source 1.9 + * tree. An additional intellectual property rights grant can be found 1.10 + * in the file PATENTS. All contributing project authors may 1.11 + * be found in the AUTHORS file in the root of the source tree. 1.12 + */ 1.13 + 1.14 + 1.15 +#ifndef ONYXD_INT_H_ 1.16 +#define ONYXD_INT_H_ 1.17 + 1.18 +#include "vpx_config.h" 1.19 +#include "vp8/common/onyxd.h" 1.20 +#include "treereader.h" 1.21 +#include "vp8/common/onyxc_int.h" 1.22 +#include "vp8/common/threading.h" 1.23 + 1.24 +#if CONFIG_ERROR_CONCEALMENT 1.25 +#include "ec_types.h" 1.26 +#endif 1.27 + 1.28 +typedef struct 1.29 +{ 1.30 + int ithread; 1.31 + void *ptr1; 1.32 + void *ptr2; 1.33 +} DECODETHREAD_DATA; 1.34 + 1.35 +typedef struct 1.36 +{ 1.37 + MACROBLOCKD mbd; 1.38 +} MB_ROW_DEC; 1.39 + 1.40 + 1.41 +typedef struct 1.42 +{ 1.43 + int enabled; 1.44 + unsigned int count; 1.45 + const unsigned char *ptrs[MAX_PARTITIONS]; 1.46 + unsigned int sizes[MAX_PARTITIONS]; 1.47 +} FRAGMENT_DATA; 1.48 + 1.49 +#define MAX_FB_MT_DEC 32 1.50 + 1.51 +struct frame_buffers 1.52 +{ 1.53 + /* 1.54 + * this struct will be populated with frame buffer management 1.55 + * info in future commits. */ 1.56 + 1.57 + /* enable/disable frame-based threading */ 1.58 + int use_frame_threads; 1.59 + 1.60 + /* decoder instances */ 1.61 + struct VP8D_COMP *pbi[MAX_FB_MT_DEC]; 1.62 + 1.63 +}; 1.64 + 1.65 +typedef struct VP8D_COMP 1.66 +{ 1.67 + DECLARE_ALIGNED(16, MACROBLOCKD, mb); 1.68 + 1.69 + YV12_BUFFER_CONFIG *dec_fb_ref[NUM_YV12_BUFFERS]; 1.70 + 1.71 + DECLARE_ALIGNED(16, VP8_COMMON, common); 1.72 + 1.73 + /* the last partition will be used for the modes/mvs */ 1.74 + vp8_reader mbc[MAX_PARTITIONS]; 1.75 + 1.76 + VP8D_CONFIG oxcf; 1.77 + 1.78 + FRAGMENT_DATA fragments; 1.79 + 1.80 +#if CONFIG_MULTITHREAD 1.81 + /* variable for threading */ 1.82 + 1.83 + volatile int b_multithreaded_rd; 1.84 + int max_threads; 1.85 + int current_mb_col_main; 1.86 + unsigned int decoding_thread_count; 1.87 + int allocated_decoding_thread_count; 1.88 + 1.89 + int mt_baseline_filter_level[MAX_MB_SEGMENTS]; 1.90 + int sync_range; 1.91 + int *mt_current_mb_col; /* Each row remembers its already decoded column. */ 1.92 + 1.93 + unsigned char **mt_yabove_row; /* mb_rows x width */ 1.94 + unsigned char **mt_uabove_row; 1.95 + unsigned char **mt_vabove_row; 1.96 + unsigned char **mt_yleft_col; /* mb_rows x 16 */ 1.97 + unsigned char **mt_uleft_col; /* mb_rows x 8 */ 1.98 + unsigned char **mt_vleft_col; /* mb_rows x 8 */ 1.99 + 1.100 + MB_ROW_DEC *mb_row_di; 1.101 + DECODETHREAD_DATA *de_thread_data; 1.102 + 1.103 + pthread_t *h_decoding_thread; 1.104 + sem_t *h_event_start_decoding; 1.105 + sem_t h_event_end_decoding; 1.106 + /* end of threading data */ 1.107 +#endif 1.108 + 1.109 + int64_t last_time_stamp; 1.110 + int ready_for_new_data; 1.111 + 1.112 + vp8_prob prob_intra; 1.113 + vp8_prob prob_last; 1.114 + vp8_prob prob_gf; 1.115 + vp8_prob prob_skip_false; 1.116 + 1.117 +#if CONFIG_ERROR_CONCEALMENT 1.118 + MB_OVERLAP *overlaps; 1.119 + /* the mb num from which modes and mvs (first partition) are corrupt */ 1.120 + unsigned int mvs_corrupt_from_mb; 1.121 +#endif 1.122 + int ec_enabled; 1.123 + int ec_active; 1.124 + int decoded_key_frame; 1.125 + int independent_partitions; 1.126 + int frame_corrupt_residual; 1.127 + 1.128 + vp8_decrypt_cb *decrypt_cb; 1.129 + void *decrypt_state; 1.130 +} VP8D_COMP; 1.131 + 1.132 +int vp8_decode_frame(VP8D_COMP *cpi); 1.133 + 1.134 +int vp8_create_decoder_instances(struct frame_buffers *fb, VP8D_CONFIG *oxcf); 1.135 +int vp8_remove_decoder_instances(struct frame_buffers *fb); 1.136 + 1.137 +#if CONFIG_DEBUG 1.138 +#define CHECK_MEM_ERROR(lval,expr) do {\ 1.139 + lval = (expr); \ 1.140 + if(!lval) \ 1.141 + vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\ 1.142 + "Failed to allocate "#lval" at %s:%d", \ 1.143 + __FILE__,__LINE__);\ 1.144 + } while(0) 1.145 +#else 1.146 +#define CHECK_MEM_ERROR(lval,expr) do {\ 1.147 + lval = (expr); \ 1.148 + if(!lval) \ 1.149 + vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\ 1.150 + "Failed to allocate "#lval);\ 1.151 + } while(0) 1.152 +#endif 1.153 + 1.154 +#endif // ONYXD_INT_H_