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.
11 #ifndef VP9_ENCODER_VP9_BLOCK_H_
12 #define VP9_ENCODER_VP9_BLOCK_H_
14 #include "vp9/common/vp9_entropymv.h"
15 #include "vp9/common/vp9_entropy.h"
27 struct macroblock_plane
{
28 DECLARE_ALIGNED(16, int16_t, src_diff
[64 * 64]);
42 int64_t quant_thred
[2];
45 /* The [2] dimension is for whether we skip the EOB node (i.e. if previous
46 * coefficient in this block was zero) or not. */
47 typedef unsigned int vp9_coeff_cost
[PLANE_TYPES
][REF_TYPES
][COEF_BANDS
][2]
48 [COEFF_CONTEXTS
][ENTROPY_TOKENS
];
51 int_mv ref_mvs
[MAX_REF_FRAMES
][MAX_MV_REF_CANDIDATES
];
52 uint8_t mode_context
[MAX_REF_FRAMES
];
55 typedef struct macroblock MACROBLOCK
;
57 struct macroblock_plane plane
[MAX_MB_PLANE
];
60 MB_MODE_INFO_EXT
*mbmi_ext
;
61 MB_MODE_INFO_EXT
*mbmi_ext_base
;
75 // These are set to their default values at the beginning, and then adjusted
76 // further in the encoding process.
77 BLOCK_SIZE min_partition_size
;
78 BLOCK_SIZE max_partition_size
;
80 int mv_best_ref_index
[MAX_REF_FRAMES
];
81 unsigned int max_mv_context
[MAX_REF_FRAMES
];
82 unsigned int source_variance
;
83 unsigned int pred_sse
[MAX_REF_FRAMES
];
84 int pred_mv_sad
[MAX_REF_FRAMES
];
86 int nmvjointcost
[MV_JOINTS
];
91 int nmvjointsadcost
[MV_JOINTS
];
93 int *nmvsadcost_hp
[2];
96 // These define limits to motion vector components to prevent them
97 // from extending outside the UMV borders
103 uint8_t zcoeff_blk
[TX_SIZES
][256];
108 // note that token_costs is the cost when eob node is skipped
109 vp9_coeff_cost token_costs
[TX_SIZES
];
113 // indicate if it is in the rd search loop or encoding process
117 // use fast quantization process
120 // skip forward transform and quantization
121 uint8_t skip_txfm
[MAX_MB_PLANE
<< 2];
123 int64_t bsse
[MAX_MB_PLANE
<< 2];
125 // Used to store sub partition's choices.
126 MV pred_mv
[MAX_REF_FRAMES
];
128 // Strong color activity detection. Used in RTC coding mode to enhance
129 // the visual quality at the boundary of moving color objects.
130 uint8_t color_sensitivity
[2];
132 void (*fwd_txm4x4
)(const int16_t *input
, tran_low_t
*output
, int stride
);
133 void (*itxm_add
)(const tran_low_t
*input
, uint8_t *dest
, int stride
, int eob
);
134 #if CONFIG_VP9_HIGHBITDEPTH
135 void (*highbd_itxm_add
)(const tran_low_t
*input
, uint8_t *dest
, int stride
,
144 #endif // VP9_ENCODER_VP9_BLOCK_H_