Moving common code into vp9_get_entropy_contexts().
Change-Id: I197670a405f7c2e7796424faa187a61081db8567
This commit is contained in:
Родитель
6232917608
Коммит
9349b82bd2
|
@ -315,15 +315,11 @@ static void optimize_init_b(int plane, BLOCK_SIZE bsize,
|
|||
struct encode_b_args *args) {
|
||||
const MACROBLOCKD *xd = &args->x->e_mbd;
|
||||
const struct macroblockd_plane* const pd = &xd->plane[plane];
|
||||
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
|
||||
const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
|
||||
const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
|
||||
const MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
||||
const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi) : mbmi->tx_size;
|
||||
|
||||
vp9_get_entropy_contexts(tx_size, args->ctx->ta[plane], args->ctx->tl[plane],
|
||||
pd->above_context, pd->left_context,
|
||||
num_4x4_w, num_4x4_h);
|
||||
vp9_get_entropy_contexts(bsize, tx_size, pd,
|
||||
args->ctx->ta[plane], args->ctx->tl[plane]);
|
||||
}
|
||||
|
||||
static INLINE void fdct32x32(int rd_transform,
|
||||
|
|
|
@ -693,10 +693,16 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
|
|||
}
|
||||
}
|
||||
|
||||
void vp9_get_entropy_contexts(TX_SIZE tx_size,
|
||||
ENTROPY_CONTEXT t_above[16], ENTROPY_CONTEXT t_left[16],
|
||||
const ENTROPY_CONTEXT *above, const ENTROPY_CONTEXT *left,
|
||||
int num_4x4_w, int num_4x4_h) {
|
||||
void vp9_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size,
|
||||
const struct macroblockd_plane *pd,
|
||||
ENTROPY_CONTEXT t_above[16],
|
||||
ENTROPY_CONTEXT t_left[16]) {
|
||||
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
|
||||
const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
|
||||
const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
|
||||
const ENTROPY_CONTEXT *const above = pd->above_context;
|
||||
const ENTROPY_CONTEXT *const left = pd->left_context;
|
||||
|
||||
int i;
|
||||
switch (tx_size) {
|
||||
case TX_4X4:
|
||||
|
@ -733,9 +739,6 @@ static void txfm_rd_in_plane(MACROBLOCK *x,
|
|||
BLOCK_SIZE bsize, TX_SIZE tx_size) {
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
struct macroblockd_plane *const pd = &xd->plane[plane];
|
||||
const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
|
||||
const int num_4x4_w = num_4x4_blocks_wide_lookup[bs];
|
||||
const int num_4x4_h = num_4x4_blocks_high_lookup[bs];
|
||||
struct rdcost_block_args args = { 0 };
|
||||
args.x = x;
|
||||
args.best_rd = ref_best_rd;
|
||||
|
@ -743,9 +746,7 @@ static void txfm_rd_in_plane(MACROBLOCK *x,
|
|||
if (plane == 0)
|
||||
xd->mi_8x8[0]->mbmi.tx_size = tx_size;
|
||||
|
||||
vp9_get_entropy_contexts(tx_size, args.t_above, args.t_left,
|
||||
pd->above_context, pd->left_context,
|
||||
num_4x4_w, num_4x4_h);
|
||||
vp9_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left);
|
||||
|
||||
args.so = get_scan(xd, tx_size, pd->plane_type, 0);
|
||||
|
||||
|
|
|
@ -80,10 +80,10 @@ void vp9_init_me_luts();
|
|||
void vp9_set_mbmode_and_mvs(MACROBLOCKD *xd, MB_PREDICTION_MODE mode,
|
||||
const MV *mv);
|
||||
|
||||
void vp9_get_entropy_contexts(TX_SIZE tx_size,
|
||||
ENTROPY_CONTEXT t_above[16], ENTROPY_CONTEXT t_left[16],
|
||||
const ENTROPY_CONTEXT *above, const ENTROPY_CONTEXT *left,
|
||||
int num_4x4_w, int num_4x4_h);
|
||||
void vp9_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size,
|
||||
const struct macroblockd_plane *pd,
|
||||
ENTROPY_CONTEXT t_above[16],
|
||||
ENTROPY_CONTEXT t_left[16]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
|
Загрузка…
Ссылка в новой задаче