Commit 9774962a authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Cleaning up vp9_encodemb.c file.

Usage of encode_b_args is unnecessary because encode_block_pass1() doesn't
use them. That's why optimize_init_b() call is also not required.

Change-Id: Ib6cfe4916c2ca85749c90bb0adcba6fea592f9ac
parent 4632a96d
......@@ -453,8 +453,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct encode_b_args *const args = arg;
MACROBLOCK *const x = args->x;
MACROBLOCK *const x = (MACROBLOCK *)arg;
MACROBLOCKD *const xd = &x->e_mbd;
struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
......@@ -466,24 +465,14 @@ static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize,
vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
if (p->eobs[block] == 0)
xd->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
if (p->eobs[block] > 0)
xd->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
void vp9_encode_sby(MACROBLOCK *x, BLOCK_SIZE bsize) {
MACROBLOCKD *const xd = &x->e_mbd;
struct optimize_ctx ctx;
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
struct encode_b_args arg = {x, &ctx, &mbmi->skip};
void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize) {
vp9_subtract_plane(x, bsize, 0);
if (x->optimize)
optimize_init_b(0, bsize, &arg);
vp9_foreach_transformed_block_in_plane(xd, bsize, 0, encode_block_pass1,
vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, 0,
encode_block_pass1, x);
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
......@@ -21,7 +21,7 @@ extern "C" {
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize);
void vp9_encode_sby(MACROBLOCK *x, BLOCK_SIZE bsize);
void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize);
void vp9_xform_quant(MACROBLOCK *x, int plane, int block,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size);
......@@ -675,7 +675,7 @@ void vp9_first_pass(VP9_COMP *cpi) {
xd->mi_8x8[0]->mbmi.ref_frame[0] = LAST_FRAME;
xd->mi_8x8[0]->mbmi.ref_frame[1] = NONE;
vp9_build_inter_predictors_sby(xd, mb_row << 1, mb_col << 1, bsize);
vp9_encode_sby(x, bsize);
vp9_encode_sby_pass1(x, bsize);
sum_mvr += mv.as_mv.row;
sum_mvr_abs += abs(mv.as_mv.row);
sum_mvc += mv.as_mv.col;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment