| 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 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 /* For keyframes, intra block modes are predicted by the (already decoded) | 43 /* For keyframes, intra block modes are predicted by the (already decoded) |
| 44 modes for the Y blocks to the left and above us; for interframes, there | 44 modes for the Y blocks to the left and above us; for interframes, there |
| 45 is a single probability table. */ | 45 is a single probability table. */ |
| 46 | 46 |
| 47 typedef struct { | 47 typedef struct { |
| 48 PREDICTION_MODE as_mode; | 48 PREDICTION_MODE as_mode; |
| 49 int_mv as_mv[2]; // first, second inter predictor motion vectors | 49 int_mv as_mv[2]; // first, second inter predictor motion vectors |
| 50 } b_mode_info; | 50 } b_mode_info; |
| 51 | 51 |
| 52 // Note that the rate-distortion optimization loop, bit-stream writer, and | 52 // Note that the rate-distortion optimization loop, bit-stream writer, and |
| 53 // decoder implementation modules critically rely on the enum entry values | 53 // decoder implementation modules critically rely on the defined entry values |
| 54 // specified herein. They should be refactored concurrently. | 54 // specified herein. They should be refactored concurrently. |
| 55 typedef enum { | 55 |
| 56 NONE = -1, | 56 #define NONE -1 |
| 57 INTRA_FRAME = 0, | 57 #define INTRA_FRAME 0 |
| 58 LAST_FRAME = 1, | 58 #define LAST_FRAME 1 |
| 59 GOLDEN_FRAME = 2, | 59 #define GOLDEN_FRAME 2 |
| 60 ALTREF_FRAME = 3, | 60 #define ALTREF_FRAME 3 |
| 61 MAX_REF_FRAMES = 4 | 61 #define MAX_REF_FRAMES 4 |
| 62 } MV_REFERENCE_FRAME; | 62 typedef int8_t MV_REFERENCE_FRAME; |
| 63 | 63 |
| 64 // This structure now relates to 8x8 block regions. | 64 // This structure now relates to 8x8 block regions. |
| 65 typedef struct { | 65 typedef struct { |
| 66 // Common for both INTER and INTRA blocks | 66 // Common for both INTER and INTRA blocks |
| 67 BLOCK_SIZE sb_type; | 67 BLOCK_SIZE sb_type; |
| 68 PREDICTION_MODE mode; | 68 PREDICTION_MODE mode; |
| 69 TX_SIZE tx_size; | 69 TX_SIZE tx_size; |
| 70 int8_t skip; | 70 int8_t skip; |
| 71 int8_t segment_id; | 71 int8_t segment_id; |
| 72 int8_t seg_id_predicted; // valid only when temporal_update is enabled | 72 int8_t seg_id_predicted; // valid only when temporal_update is enabled |
| 73 | 73 |
| 74 // Only for INTRA blocks | 74 // Only for INTRA blocks |
| 75 PREDICTION_MODE uv_mode; | 75 PREDICTION_MODE uv_mode; |
| 76 | 76 |
| 77 // Only for INTER blocks | 77 // Only for INTER blocks |
| 78 INTERP_FILTER interp_filter; |
| 78 MV_REFERENCE_FRAME ref_frame[2]; | 79 MV_REFERENCE_FRAME ref_frame[2]; |
| 80 |
| 81 // TODO(slavarnway): Delete and use bmi[3].as_mv[] instead. |
| 79 int_mv mv[2]; | 82 int_mv mv[2]; |
| 83 |
| 84 #if CONFIG_VP9_ENCODER |
| 85 // TODO(slavarnway): Move to encoder |
| 80 int_mv ref_mvs[MAX_REF_FRAMES][MAX_MV_REF_CANDIDATES]; | 86 int_mv ref_mvs[MAX_REF_FRAMES][MAX_MV_REF_CANDIDATES]; |
| 81 uint8_t mode_context[MAX_REF_FRAMES]; | 87 uint8_t mode_context[MAX_REF_FRAMES]; |
| 82 INTERP_FILTER interp_filter; | 88 #endif |
| 83 | |
| 84 } MB_MODE_INFO; | 89 } MB_MODE_INFO; |
| 85 | 90 |
| 86 typedef struct MODE_INFO { | 91 typedef struct MODE_INFO { |
| 87 MB_MODE_INFO mbmi; | 92 MB_MODE_INFO mbmi; |
| 88 b_mode_info bmi[4]; | 93 b_mode_info bmi[4]; |
| 89 } MODE_INFO; | 94 } MODE_INFO; |
| 90 | 95 |
| 91 static INLINE PREDICTION_MODE get_y_mode(const MODE_INFO *mi, int block) { | 96 static INLINE PREDICTION_MODE get_y_mode(const MODE_INFO *mi, int block) { |
| 92 return mi->mbmi.sb_type < BLOCK_8X8 ? mi->bmi[block].as_mode | 97 return mi->mbmi.sb_type < BLOCK_8X8 ? mi->bmi[block].as_mode |
| 93 : mi->mbmi.mode; | 98 : mi->mbmi.mode; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 154 |
| 150 MODE_INFO **mi; | 155 MODE_INFO **mi; |
| 151 MODE_INFO *left_mi; | 156 MODE_INFO *left_mi; |
| 152 MODE_INFO *above_mi; | 157 MODE_INFO *above_mi; |
| 153 MB_MODE_INFO *left_mbmi; | 158 MB_MODE_INFO *left_mbmi; |
| 154 MB_MODE_INFO *above_mbmi; | 159 MB_MODE_INFO *above_mbmi; |
| 155 | 160 |
| 156 int up_available; | 161 int up_available; |
| 157 int left_available; | 162 int left_available; |
| 158 | 163 |
| 164 const vp9_prob (*partition_probs)[PARTITION_TYPES - 1]; |
| 165 |
| 159 /* Distance of MB away from frame edges */ | 166 /* Distance of MB away from frame edges */ |
| 160 int mb_to_left_edge; | 167 int mb_to_left_edge; |
| 161 int mb_to_right_edge; | 168 int mb_to_right_edge; |
| 162 int mb_to_top_edge; | 169 int mb_to_top_edge; |
| 163 int mb_to_bottom_edge; | 170 int mb_to_bottom_edge; |
| 164 | 171 |
| 165 FRAME_CONTEXT *fc; | 172 FRAME_CONTEXT *fc; |
| 166 int frame_parallel_decoding_mode; | 173 int frame_parallel_decoding_mode; |
| 167 | 174 |
| 168 /* pointers to reference frames */ | 175 /* pointers to reference frames */ |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 296 |
| 290 void vp9_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, | 297 void vp9_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, |
| 291 BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob, | 298 BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob, |
| 292 int aoff, int loff); | 299 int aoff, int loff); |
| 293 | 300 |
| 294 #ifdef __cplusplus | 301 #ifdef __cplusplus |
| 295 } // extern "C" | 302 } // extern "C" |
| 296 #endif | 303 #endif |
| 297 | 304 |
| 298 #endif // VP9_COMMON_VP9_BLOCKD_H_ | 305 #endif // VP9_COMMON_VP9_BLOCKD_H_ |
| OLD | NEW |