| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 | 11 |
| 12 #ifndef __INC_VP8D_INT_H | 12 #ifndef __INC_VP8D_INT_H |
| 13 #define __INC_VP8D_INT_H | 13 #define __INC_VP8D_INT_H |
| 14 #include "vpx_ports/config.h" | 14 #include "vpx_ports/config.h" |
| 15 #include "vp8/common/onyxd.h" | 15 #include "vp8/common/onyxd.h" |
| 16 #include "treereader.h" | 16 #include "treereader.h" |
| 17 #include "vp8/common/onyxc_int.h" | 17 #include "vp8/common/onyxc_int.h" |
| 18 #include "vp8/common/threading.h" | 18 #include "vp8/common/threading.h" |
| 19 #include "dequantize.h" | 19 #include "dequantize.h" |
| 20 #if CONFIG_ERROR_CONCEALMENT |
| 21 #include "ec_types.h" |
| 22 #endif |
| 20 | 23 |
| 21 typedef struct | 24 typedef struct |
| 22 { | 25 { |
| 23 int ithread; | 26 int ithread; |
| 24 void *ptr1; | 27 void *ptr1; |
| 25 void *ptr2; | 28 void *ptr2; |
| 26 } DECODETHREAD_DATA; | 29 } DECODETHREAD_DATA; |
| 27 | 30 |
| 28 typedef struct | 31 typedef struct |
| 29 { | 32 { |
| 30 MACROBLOCKD mbd; | 33 MACROBLOCKD mbd; |
| 31 int mb_row; | 34 int mb_row; |
| 32 int current_mb_col; | 35 int current_mb_col; |
| 33 short *coef_ptr; | 36 short *coef_ptr; |
| 34 } MB_ROW_DEC; | 37 } MB_ROW_DEC; |
| 35 | 38 |
| 36 typedef struct | 39 typedef struct |
| 37 { | 40 { |
| 38 INT64 time_stamp; | 41 int64_t time_stamp; |
| 39 int size; | 42 int size; |
| 40 } DATARATE; | 43 } DATARATE; |
| 41 | 44 |
| 42 typedef struct | 45 typedef struct |
| 43 { | 46 { |
| 44 INT16 min_val; | |
| 45 INT16 Length; | |
| 46 UINT8 Probs[12]; | |
| 47 } TOKENEXTRABITS; | |
| 48 | |
| 49 typedef struct | |
| 50 { | |
| 51 int const *scan; | 47 int const *scan; |
| 52 UINT8 const *ptr_block2leftabove; | 48 UINT8 const *ptr_block2leftabove; |
| 53 vp8_tree_index const *vp8_coef_tree_ptr; | 49 vp8_tree_index const *vp8_coef_tree_ptr; |
| 54 TOKENEXTRABITS const *teb_base_ptr; | |
| 55 unsigned char *norm_ptr; | 50 unsigned char *norm_ptr; |
| 56 UINT8 *ptr_coef_bands_x; | 51 UINT8 *ptr_coef_bands_x; |
| 57 | 52 |
| 58 ENTROPY_CONTEXT_PLANES *A; | 53 ENTROPY_CONTEXT_PLANES *A; |
| 59 ENTROPY_CONTEXT_PLANES *L; | 54 ENTROPY_CONTEXT_PLANES *L; |
| 60 | 55 |
| 61 INT16 *qcoeff_start_ptr; | 56 INT16 *qcoeff_start_ptr; |
| 62 BOOL_DECODER *current_bc; | 57 BOOL_DECODER *current_bc; |
| 63 | 58 |
| 64 vp8_prob const *coef_probs[4]; | 59 vp8_prob const *coef_probs[4]; |
| 65 | 60 |
| 66 UINT8 eob[25]; | 61 UINT8 eob[25]; |
| 67 | 62 |
| 68 } DETOK; | 63 } DETOK; |
| 69 | 64 |
| 70 typedef struct VP8Decompressor | 65 typedef struct VP8Decompressor |
| 71 { | 66 { |
| 72 DECLARE_ALIGNED(16, MACROBLOCKD, mb); | 67 DECLARE_ALIGNED(16, MACROBLOCKD, mb); |
| 73 | 68 |
| 74 DECLARE_ALIGNED(16, VP8_COMMON, common); | 69 DECLARE_ALIGNED(16, VP8_COMMON, common); |
| 75 | 70 |
| 76 vp8_reader bc, bc2; | 71 vp8_reader bc, bc2; |
| 77 | 72 |
| 78 VP8D_CONFIG oxcf; | 73 VP8D_CONFIG oxcf; |
| 79 | 74 |
| 80 | 75 |
| 81 const unsigned char *Source; | 76 const unsigned char *Source; |
| 82 unsigned int source_sz; | 77 unsigned int source_sz; |
| 83 | 78 const unsigned char *partitions[MAX_PARTITIONS]; |
| 84 | 79 unsigned int partition_sizes[MAX_PARTITIONS]; |
| 85 unsigned int CPUFreq; | 80 unsigned int num_partitions; |
| 86 unsigned int decode_microseconds; | |
| 87 unsigned int time_decoding; | |
| 88 unsigned int time_loop_filtering; | |
| 89 | 81 |
| 90 #if CONFIG_MULTITHREAD | 82 #if CONFIG_MULTITHREAD |
| 91 /* variable for threading */ | 83 /* variable for threading */ |
| 92 | 84 |
| 93 volatile int b_multithreaded_rd; | 85 volatile int b_multithreaded_rd; |
| 94 int max_threads; | 86 int max_threads; |
| 95 int current_mb_col_main; | 87 int current_mb_col_main; |
| 96 int decoding_thread_count; | 88 int decoding_thread_count; |
| 97 int allocated_decoding_thread_count; | 89 int allocated_decoding_thread_count; |
| 98 | 90 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 110 MB_ROW_DEC *mb_row_di; | 102 MB_ROW_DEC *mb_row_di; |
| 111 DECODETHREAD_DATA *de_thread_data; | 103 DECODETHREAD_DATA *de_thread_data; |
| 112 | 104 |
| 113 pthread_t *h_decoding_thread; | 105 pthread_t *h_decoding_thread; |
| 114 sem_t *h_event_start_decoding; | 106 sem_t *h_event_start_decoding; |
| 115 sem_t h_event_end_decoding; | 107 sem_t h_event_end_decoding; |
| 116 /* end of threading data */ | 108 /* end of threading data */ |
| 117 #endif | 109 #endif |
| 118 | 110 |
| 119 vp8_reader *mbc; | 111 vp8_reader *mbc; |
| 120 INT64 last_time_stamp; | 112 int64_t last_time_stamp; |
| 121 int ready_for_new_data; | 113 int ready_for_new_data; |
| 122 | 114 |
| 123 DATARATE dr[16]; | 115 DATARATE dr[16]; |
| 124 | 116 |
| 125 DETOK detoken; | 117 DETOK detoken; |
| 126 | 118 |
| 127 #if CONFIG_RUNTIME_CPU_DETECT | 119 #if CONFIG_RUNTIME_CPU_DETECT |
| 128 vp8_dequant_rtcd_vtable_t dequant; | 120 vp8_dequant_rtcd_vtable_t dequant; |
| 129 #endif | 121 #endif |
| 130 | 122 |
| 131 | 123 |
| 132 vp8_prob prob_intra; | 124 vp8_prob prob_intra; |
| 133 vp8_prob prob_last; | 125 vp8_prob prob_last; |
| 134 vp8_prob prob_gf; | 126 vp8_prob prob_gf; |
| 135 vp8_prob prob_skip_false; | 127 vp8_prob prob_skip_false; |
| 136 | 128 |
| 129 #if CONFIG_ERROR_CONCEALMENT |
| 130 MB_OVERLAP *overlaps; |
| 131 /* the mb num from which modes and mvs (first partition) are corrupt */ |
| 132 unsigned int mvs_corrupt_from_mb; |
| 133 #endif |
| 134 int ec_enabled; |
| 135 int ec_active; |
| 136 int input_partition; |
| 137 int decoded_key_frame; |
| 138 int independent_partitions; |
| 139 int frame_corrupt_residual; |
| 140 |
| 137 } VP8D_COMP; | 141 } VP8D_COMP; |
| 138 | 142 |
| 139 int vp8_decode_frame(VP8D_COMP *cpi); | 143 int vp8_decode_frame(VP8D_COMP *cpi); |
| 140 void vp8_dmachine_specific_config(VP8D_COMP *pbi); | 144 void vp8_dmachine_specific_config(VP8D_COMP *pbi); |
| 141 | 145 |
| 142 | 146 |
| 143 #if CONFIG_DEBUG | 147 #if CONFIG_DEBUG |
| 144 #define CHECK_MEM_ERROR(lval,expr) do {\ | 148 #define CHECK_MEM_ERROR(lval,expr) do {\ |
| 145 lval = (expr); \ | 149 lval = (expr); \ |
| 146 if(!lval) \ | 150 if(!lval) \ |
| 147 vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\ | 151 vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\ |
| 148 "Failed to allocate "#lval" at %s:%d", \ | 152 "Failed to allocate "#lval" at %s:%d", \ |
| 149 __FILE__,__LINE__);\ | 153 __FILE__,__LINE__);\ |
| 150 } while(0) | 154 } while(0) |
| 151 #else | 155 #else |
| 152 #define CHECK_MEM_ERROR(lval,expr) do {\ | 156 #define CHECK_MEM_ERROR(lval,expr) do {\ |
| 153 lval = (expr); \ | 157 lval = (expr); \ |
| 154 if(!lval) \ | 158 if(!lval) \ |
| 155 vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\ | 159 vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,\ |
| 156 "Failed to allocate "#lval);\ | 160 "Failed to allocate "#lval);\ |
| 157 } while(0) | 161 } while(0) |
| 158 #endif | 162 #endif |
| 159 | 163 |
| 160 #endif | 164 #endif |
| OLD | NEW |