int vp9_has_high_freq_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { int result = 0; struct is_skippable_args args = {x, &result}; vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, plane, has_high_freq_coeff, &args); return result; }
// TODO(yaowu): rewrite and optimize this function to remove the usage of // vp9_foreach_transform_block() and simplify is_skippable(). int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { int result = 1; struct is_skippable_args args = { x->plane[plane].eobs, &result }; vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, plane, is_skippable, &args); return result; }
void vp9_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { const MACROBLOCKD *const xd = &x->e_mbd; struct encode_b_args arg = {x, NULL, &xd->mi[0]->mbmi.skip}; vp9_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block_intra, &arg); }
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) { MACROBLOCKD *const xd = &x->e_mbd; struct optimize_ctx ctx; MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi; struct encode_b_args arg = {x, &ctx, &mbmi->skip}; int plane; for (plane = 0; plane < MAX_MB_PLANE; ++plane) { if (!x->skip_recode) vp9_subtract_plane(x, bsize, plane); if (x->optimize && (!x->skip_recode || !x->skip_optimize)) { const struct macroblockd_plane* const pd = &xd->plane[plane]; const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi) : mbmi->tx_size; vp9_get_entropy_contexts(bsize, tx_size, pd, ctx.ta[plane], ctx.tl[plane]); } vp9_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block, &arg); } }
void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize) { vp9_subtract_plane(x, bsize, 0); vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, 0, encode_block_pass1, x); }