| 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 #ifndef VP9_ENCODER_VP9_BLOCK_H_ | 11 #ifndef VP9_ENCODER_VP9_BLOCK_H_ |
| 12 #define VP9_ENCODER_VP9_BLOCK_H_ | 12 #define VP9_ENCODER_VP9_BLOCK_H_ |
| 13 | 13 |
| 14 #include "vp9/common/vp9_onyx.h" | |
| 15 #include "vp9/common/vp9_entropymv.h" | 14 #include "vp9/common/vp9_entropymv.h" |
| 16 #include "vp9/common/vp9_entropy.h" | 15 #include "vp9/common/vp9_entropy.h" |
| 17 #include "vpx_ports/mem.h" | 16 #include "vpx_ports/mem.h" |
| 18 #include "vp9/common/vp9_onyxc_int.h" | 17 #include "vp9/common/vp9_onyxc_int.h" |
| 19 | 18 |
| 20 #ifdef __cplusplus | 19 #ifdef __cplusplus |
| 21 extern "C" { | 20 extern "C" { |
| 22 #endif | 21 #endif |
| 23 | 22 |
| 24 // motion search site | 23 // motion search site |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 unsigned int mb_energy; | 108 unsigned int mb_energy; |
| 110 unsigned int *mb_activity_ptr; | 109 unsigned int *mb_activity_ptr; |
| 111 int *mb_norm_activity_ptr; | 110 int *mb_norm_activity_ptr; |
| 112 signed int act_zbin_adj; | 111 signed int act_zbin_adj; |
| 113 | 112 |
| 114 int mv_best_ref_index[MAX_REF_FRAMES]; | 113 int mv_best_ref_index[MAX_REF_FRAMES]; |
| 115 unsigned int max_mv_context[MAX_REF_FRAMES]; | 114 unsigned int max_mv_context[MAX_REF_FRAMES]; |
| 116 unsigned int source_variance; | 115 unsigned int source_variance; |
| 117 unsigned int pred_sse[MAX_REF_FRAMES]; | 116 unsigned int pred_sse[MAX_REF_FRAMES]; |
| 118 int pred_mv_sad[MAX_REF_FRAMES]; | 117 int pred_mv_sad[MAX_REF_FRAMES]; |
| 119 int mode_sad[MAX_REF_FRAMES][INTER_MODES + 1]; | |
| 120 | 118 |
| 121 int nmvjointcost[MV_JOINTS]; | 119 int nmvjointcost[MV_JOINTS]; |
| 122 int nmvcosts[2][MV_VALS]; | 120 int nmvcosts[2][MV_VALS]; |
| 123 int *nmvcost[2]; | 121 int *nmvcost[2]; |
| 124 int nmvcosts_hp[2][MV_VALS]; | 122 int nmvcosts_hp[2][MV_VALS]; |
| 125 int *nmvcost_hp[2]; | 123 int *nmvcost_hp[2]; |
| 126 int **mvcost; | 124 int **mvcost; |
| 127 | 125 |
| 128 int nmvjointsadcost[MV_JOINTS]; | 126 int nmvjointsadcost[MV_JOINTS]; |
| 129 int nmvsadcosts[2][MV_VALS]; | 127 int nmvsadcosts[2][MV_VALS]; |
| 130 int *nmvsadcost[2]; | 128 int *nmvsadcost[2]; |
| 131 int nmvsadcosts_hp[2][MV_VALS]; | 129 int nmvsadcosts_hp[2][MV_VALS]; |
| 132 int *nmvsadcost_hp[2]; | 130 int *nmvsadcost_hp[2]; |
| 133 int **mvsadcost; | 131 int **mvsadcost; |
| 134 | 132 |
| 135 int mbmode_cost[MB_MODE_COUNT]; | 133 int mbmode_cost[INTRA_MODES]; |
| 136 unsigned inter_mode_cost[INTER_MODE_CONTEXTS][INTER_MODES]; | 134 unsigned inter_mode_cost[INTER_MODE_CONTEXTS][INTER_MODES]; |
| 137 int intra_uv_mode_cost[2][MB_MODE_COUNT]; | 135 int intra_uv_mode_cost[FRAME_TYPES][INTRA_MODES]; |
| 138 int y_mode_costs[INTRA_MODES][INTRA_MODES][INTRA_MODES]; | 136 int y_mode_costs[INTRA_MODES][INTRA_MODES][INTRA_MODES]; |
| 139 int switchable_interp_costs[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS]; | 137 int switchable_interp_costs[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS]; |
| 140 | 138 |
| 141 unsigned char sb_index; // index of 32x32 block inside the 64x64 block | 139 unsigned char sb_index; // index of 32x32 block inside the 64x64 block |
| 142 unsigned char mb_index; // index of 16x16 block inside the 32x32 block | 140 unsigned char mb_index; // index of 16x16 block inside the 32x32 block |
| 143 unsigned char b_index; // index of 8x8 block inside the 16x16 block | 141 unsigned char b_index; // index of 8x8 block inside the 16x16 block |
| 144 unsigned char ab_index; // index of 4x4 block inside the 8x8 block | 142 unsigned char ab_index; // index of 4x4 block inside the 8x8 block |
| 145 | 143 |
| 146 // These define limits to motion vector components to prevent them | 144 // These define limits to motion vector components to prevent them |
| 147 // from extending outside the UMV borders | 145 // from extending outside the UMV borders |
| 148 int mv_col_min; | 146 int mv_col_min; |
| 149 int mv_col_max; | 147 int mv_col_max; |
| 150 int mv_row_min; | 148 int mv_row_min; |
| 151 int mv_row_max; | 149 int mv_row_max; |
| 152 | 150 |
| 153 uint8_t zcoeff_blk[TX_SIZES][256]; | 151 uint8_t zcoeff_blk[TX_SIZES][256]; |
| 154 int skip; | 152 int skip; |
| 155 | 153 |
| 156 int encode_breakout; | 154 int encode_breakout; |
| 157 | 155 |
| 158 unsigned char *active_ptr; | 156 int in_active_map; |
| 159 | 157 |
| 160 // note that token_costs is the cost when eob node is skipped | 158 // note that token_costs is the cost when eob node is skipped |
| 161 vp9_coeff_cost token_costs[TX_SIZES]; | 159 vp9_coeff_cost token_costs[TX_SIZES]; |
| 162 DECLARE_ALIGNED(16, uint8_t, token_cache[1024]); | |
| 163 | 160 |
| 164 int optimize; | 161 int optimize; |
| 165 | 162 |
| 166 // indicate if it is in the rd search loop or encoding process | 163 // indicate if it is in the rd search loop or encoding process |
| 167 int use_lp32x32fdct; | 164 int use_lp32x32fdct; |
| 168 int skip_encode; | 165 int skip_encode; |
| 169 | 166 |
| 170 // Used to store sub partition's choices. | 167 // Used to store sub partition's choices. |
| 171 int_mv pred_mv[MAX_REF_FRAMES]; | 168 int_mv pred_mv[MAX_REF_FRAMES]; |
| 172 | 169 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 192 BLOCK_SIZE mb_partitioning[4][4]; | 189 BLOCK_SIZE mb_partitioning[4][4]; |
| 193 BLOCK_SIZE sb_partitioning[4]; | 190 BLOCK_SIZE sb_partitioning[4]; |
| 194 BLOCK_SIZE sb64_partitioning; | 191 BLOCK_SIZE sb64_partitioning; |
| 195 | 192 |
| 196 void (*fwd_txm4x4)(const int16_t *input, int16_t *output, int stride); | 193 void (*fwd_txm4x4)(const int16_t *input, int16_t *output, int stride); |
| 197 }; | 194 }; |
| 198 | 195 |
| 199 // TODO(jingning): the variables used here are little complicated. need further | 196 // TODO(jingning): the variables used here are little complicated. need further |
| 200 // refactoring on organizing the temporary buffers, when recursive | 197 // refactoring on organizing the temporary buffers, when recursive |
| 201 // partition down to 4x4 block size is enabled. | 198 // partition down to 4x4 block size is enabled. |
| 202 static PICK_MODE_CONTEXT *get_block_context(MACROBLOCK *x, BLOCK_SIZE bsize) { | 199 static INLINE PICK_MODE_CONTEXT *get_block_context(MACROBLOCK *x, |
| 200 BLOCK_SIZE bsize) { |
| 203 switch (bsize) { | 201 switch (bsize) { |
| 204 case BLOCK_64X64: | 202 case BLOCK_64X64: |
| 205 return &x->sb64_context; | 203 return &x->sb64_context; |
| 206 case BLOCK_64X32: | 204 case BLOCK_64X32: |
| 207 return &x->sb64x32_context[x->sb_index]; | 205 return &x->sb64x32_context[x->sb_index]; |
| 208 case BLOCK_32X64: | 206 case BLOCK_32X64: |
| 209 return &x->sb32x64_context[x->sb_index]; | 207 return &x->sb32x64_context[x->sb_index]; |
| 210 case BLOCK_32X32: | 208 case BLOCK_32X32: |
| 211 return &x->sb32_context[x->sb_index]; | 209 return &x->sb32_context[x->sb_index]; |
| 212 case BLOCK_32X16: | 210 case BLOCK_32X16: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 231 assert(0); | 229 assert(0); |
| 232 return NULL; | 230 return NULL; |
| 233 } | 231 } |
| 234 } | 232 } |
| 235 | 233 |
| 236 #ifdef __cplusplus | 234 #ifdef __cplusplus |
| 237 } // extern "C" | 235 } // extern "C" |
| 238 #endif | 236 #endif |
| 239 | 237 |
| 240 #endif // VP9_ENCODER_VP9_BLOCK_H_ | 238 #endif // VP9_ENCODER_VP9_BLOCK_H_ |
| OLD | NEW |