Add the row and column index to the argument list of unit functions called by foreach_transformed_block wrapper. This avoids the repeated internal parsing according to the block index.
Unified · Split
| @@ -66,7 +66,7 @@ void vp10_foreach_transformed_block_in_plane( · 65 unmodified lines | ||
| 66 | 66 | for (r = 0; r < max_blocks_high; r += (1 << tx_size)) { |
| 67 | 67 | // Skip visiting the sub blocks that are wholly within the UMV. |
| 68 | 68 | for (c = 0; c < max_blocks_wide; c += (1 << tx_size)) { |
| 69 | − visit(plane, i, plane_bsize, tx_size, arg); | |
| 69 | + visit(plane, i, r, c, plane_bsize, tx_size, arg); | |
| 70 | 70 | i += step; |
| 71 | 71 | } |
| 72 | 72 | i += extra_step; |
| @@ -283,6 +283,7 @@ static INLINE void reset_skip_context(MACROBLOCKD *xd, BLOCK_SIZE bsize) { · 282 unmodified lines | ||
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | typedef void (*foreach_transformed_block_visitor)(int plane, int block, |
| 286 | + int blk_row, int blk_col, | |
| 286 | 287 | BLOCK_SIZE plane_bsize, |
| 287 | 288 | TX_SIZE tx_size, |
| 288 | 289 | void *arg); |
| @@ -296,17 +297,6 @@ void vp10_foreach_transformed_block( · 7 unmodified lines | ||
| 296 | 297 | const MACROBLOCKD* const xd, BLOCK_SIZE bsize, |
| 297 | 298 | foreach_transformed_block_visitor visit, void *arg); |
| 298 | 299 | |
| 299 | −static INLINE void txfrm_block_to_raster_xy(BLOCK_SIZE plane_bsize, | |
| 300 | − TX_SIZE tx_size, int block, | |
| 301 | − int *x, int *y) { | |
| 302 | − const int bwl = b_width_log2_lookup[plane_bsize]; | |
| 303 | − const int tx_cols_log2 = bwl - tx_size; | |
| 304 | − const int tx_cols = 1 << tx_cols_log2; | |
| 305 | − const int raster_mb = block >> (tx_size << 1); | |
| 306 | − *x = (raster_mb & (tx_cols - 1)) << tx_size; | |
| 307 | − *y = (raster_mb >> tx_cols_log2) << tx_size; | |
| 308 | −} | |
| 309 | − | |
| 310 | 300 | void vp10_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, |
| 311 | 301 | BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob, |
| 312 | 302 | int aoff, int loff); |
| @@ -324,7 +324,8 @@ static INLINE void highbd_fdct32x32(int rd_transform, const int16_t *src, · 323 unmodified lines | ||
| 324 | 324 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 325 | 325 | |
| 326 | 326 | void vp10_xform_quant_fp(MACROBLOCK *x, int plane, int block, |
| 327 | − BLOCK_SIZE plane_bsize, TX_SIZE tx_size) { | |
| 327 | + int blk_row, int blk_col, | |
| 328 | + BLOCK_SIZE plane_bsize, TX_SIZE tx_size) { | |
| 328 | 329 | MACROBLOCKD *const xd = &x->e_mbd; |
| 329 | 330 | const struct macroblock_plane *const p = &x->plane[plane]; |
| 330 | 331 | const struct macroblockd_plane *const pd = &xd->plane[plane]; |
| @@ -336,10 +337,8 @@ void vp10_xform_quant_fp(MACROBLOCK *x, int plane, int block, · 5 unmodified lines | ||
| 336 | 337 | tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); |
| 337 | 338 | uint16_t *const eob = &p->eobs[block]; |
| 338 | 339 | const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; |
| 339 | − int i, j; | |
| 340 | 340 | const int16_t *src_diff; |
| 341 | − txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); | |
| 342 | − src_diff = &p->src_diff[4 * (j * diff_stride + i)]; | |
| 341 | + src_diff = &p->src_diff[4 * (blk_row * diff_stride + blk_col)]; | |
| 343 | 342 | |
| 344 | 343 | #if CONFIG_VP9_HIGHBITDEPTH |
| 345 | 344 | if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { |
| @@ -424,7 +423,8 @@ void vp10_xform_quant_fp(MACROBLOCK *x, int plane, int block, · 78 unmodified lines | ||
| 424 | 423 | } |
| 425 | 424 | |
| 426 | 425 | void vp10_xform_quant_dc(MACROBLOCK *x, int plane, int block, |
| 427 | − BLOCK_SIZE plane_bsize, TX_SIZE tx_size) { | |
| 426 | + int blk_row, int blk_col, | |
| 427 | + BLOCK_SIZE plane_bsize, TX_SIZE tx_size) { | |
| 428 | 428 | MACROBLOCKD *const xd = &x->e_mbd; |
| 429 | 429 | const struct macroblock_plane *const p = &x->plane[plane]; |
| 430 | 430 | const struct macroblockd_plane *const pd = &xd->plane[plane]; |
| @@ -433,11 +433,8 @@ void vp10_xform_quant_dc(MACROBLOCK *x, int plane, int block, · 2 unmodified lines | ||
| 433 | 433 | tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); |
| 434 | 434 | uint16_t *const eob = &p->eobs[block]; |
| 435 | 435 | const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; |
| 436 | − int i, j; | |
| 437 | 436 | const int16_t *src_diff; |
| 438 | − | |
| 439 | − txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); | |
| 440 | − src_diff = &p->src_diff[4 * (j * diff_stride + i)]; | |
| 437 | + src_diff = &p->src_diff[4 * (blk_row * diff_stride + blk_col)]; | |
| 441 | 438 | |
| 442 | 439 | #if CONFIG_VP9_HIGHBITDEPTH |
| 443 | 440 | if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { |
| @@ -658,7 +655,8 @@ static void highbd_fwd_txfm_32x32(int rd_transform, const int16_t *src_diff, · 214 unmodified lines | ||
| 658 | 655 | #endif // CONFIG_VP9_HIGHBITDEPTH |
| 659 | 656 | |
| 660 | 657 | void vp10_xform_quant(MACROBLOCK *x, int plane, int block, |
| 661 | − BLOCK_SIZE plane_bsize, TX_SIZE tx_size) { | |
| 658 | + int blk_row, int blk_col, | |
| 659 | + BLOCK_SIZE plane_bsize, TX_SIZE tx_size) { | |
| 662 | 660 | MACROBLOCKD *const xd = &x->e_mbd; |
| 663 | 661 | const struct macroblock_plane *const p = &x->plane[plane]; |
| 664 | 662 | const struct macroblockd_plane *const pd = &xd->plane[plane]; |
| @@ -670,10 +668,8 @@ void vp10_xform_quant(MACROBLOCK *x, int plane, int block, · 5 unmodified lines | ||
| 670 | 668 | tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); |
| 671 | 669 | uint16_t *const eob = &p->eobs[block]; |
| 672 | 670 | const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize]; |
| 673 | − int i, j; | |
| 674 | 671 | const int16_t *src_diff; |
| 675 | − txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); | |
| 676 | − src_diff = &p->src_diff[4 * (j * diff_stride + i)]; | |
| 672 | + src_diff = &p->src_diff[4 * (blk_row * diff_stride + blk_col)]; | |
| 677 | 673 | |
| 678 | 674 | #if CONFIG_VP9_HIGHBITDEPTH |
| 679 | 675 | if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { |
| @@ -751,7 +747,8 @@ void vp10_xform_quant(MACROBLOCK *x, int plane, int block, · 71 unmodified lines | ||
| 751 | 747 | } |
| 752 | 748 | } |
| 753 | 749 | |
| 754 | −static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, | |
| 750 | +static void encode_block(int plane, int block, int blk_row, int blk_col, | |
| 751 | + BLOCK_SIZE plane_bsize, | |
| 755 | 752 | TX_SIZE tx_size, void *arg) { |
| 756 | 753 | struct encode_b_args *const args = arg; |
| 757 | 754 | MACROBLOCK *const x = args->x; |
| @@ -760,14 +757,12 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, · 2 unmodified lines | ||
| 760 | 757 | struct macroblock_plane *const p = &x->plane[plane]; |
| 761 | 758 | struct macroblockd_plane *const pd = &xd->plane[plane]; |
| 762 | 759 | tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); |
| 763 | − int i, j; | |
| 764 | 760 | uint8_t *dst; |
| 765 | 761 | ENTROPY_CONTEXT *a, *l; |
| 766 | 762 | TX_TYPE tx_type = get_tx_type(pd->plane_type, xd, block); |
| 767 | − txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); | |
| 768 | − dst = &pd->dst.buf[4 * j * pd->dst.stride + 4 * i]; | |
| 769 | − a = &ctx->ta[plane][i]; | |
| 770 | − l = &ctx->tl[plane][j]; | |
| 763 | + dst = &pd->dst.buf[4 * blk_row * pd->dst.stride + 4 * blk_col]; | |
| 764 | + a = &ctx->ta[plane][blk_col]; | |
| 765 | + l = &ctx->tl[plane][blk_row]; | |
| 771 | 766 | |
| 772 | 767 | // TODO(jingning): per transformed block zero forcing only enabled for |
| 773 | 768 | // luma component. will integrate chroma components as well. |
| @@ -786,17 +781,20 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, · 12 unmodified lines | ||
| 786 | 781 | *a = *l = 0; |
| 787 | 782 | return; |
| 788 | 783 | } else { |
| 789 | − vp10_xform_quant_fp(x, plane, block, plane_bsize, tx_size); | |
| 784 | + vp10_xform_quant_fp(x, plane, block, blk_row, blk_col, | |
| 785 | + plane_bsize, tx_size); | |
| 790 | 786 | } |
| 791 | 787 | } else { |
| 792 | 788 | if (max_txsize_lookup[plane_bsize] == tx_size) { |
| 793 | 789 | int txfm_blk_index = (plane << 2) + (block >> (tx_size << 1)); |
| 794 | 790 | if (x->skip_txfm[txfm_blk_index] == SKIP_TXFM_NONE) { |
| 795 | 791 | // full forward transform and quantization |
| 796 | − vp10_xform_quant(x, plane, block, plane_bsize, tx_size); | |
| 792 | + vp10_xform_quant(x, plane, block, blk_row, blk_col, | |
| 793 | + plane_bsize, tx_size); | |
| 797 | 794 | } else if (x->skip_txfm[txfm_blk_index] == SKIP_TXFM_AC_ONLY) { |
| 798 | 795 | // fast path forward transform and quantization |
| 799 | − vp10_xform_quant_dc(x, plane, block, plane_bsize, tx_size); | |
| 796 | + vp10_xform_quant_dc(x, plane, block, blk_row, blk_col, | |
| 797 | + plane_bsize, tx_size); | |
| 800 | 798 | } else { |
| 801 | 799 | // skip forward transform |
| 802 | 800 | p->eobs[block] = 0; |
| @@ -804,7 +802,8 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, · 1 unmodified line | ||
| 804 | 802 | return; |
| 805 | 803 | } |
| 806 | 804 | } else { |
| 807 | − vp10_xform_quant(x, plane, block, plane_bsize, tx_size); | |
| 805 | + vp10_xform_quant(x, plane, block, blk_row, blk_col, | |
| 806 | + plane_bsize, tx_size); | |
| 808 | 807 | } |
| 809 | 808 | } |
| 810 | 809 | } |
| @@ -879,19 +878,18 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize, · 68 unmodified lines | ||
| 879 | 878 | } |
| 880 | 879 | } |
| 881 | 880 | |
| 882 | −static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize, | |
| 881 | +static void encode_block_pass1(int plane, int block, int blk_row, int blk_col, | |
| 882 | + BLOCK_SIZE plane_bsize, | |
| 883 | 883 | TX_SIZE tx_size, void *arg) { |
| 884 | 884 | MACROBLOCK *const x = (MACROBLOCK *)arg; |
| 885 | 885 | MACROBLOCKD *const xd = &x->e_mbd; |
| 886 | 886 | struct macroblock_plane *const p = &x->plane[plane]; |
| 887 | 887 | struct macroblockd_plane *const pd = &xd->plane[plane]; |
| 888 | 888 | tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); |
| 889 | − int i, j; | |
| 890 | 889 | uint8_t *dst; |
| 891 | − txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); | |
| 892 | − dst = &pd->dst.buf[4 * j * pd->dst.stride + 4 * i]; | |
| 890 | + dst = &pd->dst.buf[4 * blk_row * pd->dst.stride + 4 * blk_col]; | |
| 893 | 891 | |
| 894 | − vp10_xform_quant(x, plane, block, plane_bsize, tx_size); | |
| 892 | + vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size); | |
| 895 | 893 | |
| 896 | 894 | if (p->eobs[block] > 0) { |
| 897 | 895 | #if CONFIG_VP9_HIGHBITDEPTH |
| @@ -948,8 +946,9 @@ void vp10_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) { · 50 unmodified lines | ||
| 948 | 946 | } |
| 949 | 947 | } |
| 950 | 948 | |
| 951 | −void vp10_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, | |
| 952 | − TX_SIZE tx_size, void *arg) { | |
| 949 | +void vp10_encode_block_intra(int plane, int block, int blk_row, int blk_col, | |
| 950 | + BLOCK_SIZE plane_bsize, | |
| 951 | + TX_SIZE tx_size, void *arg) { | |
| 953 | 952 | struct encode_b_args* const args = arg; |
| 954 | 953 | MACROBLOCK *const x = args->x; |
| 955 | 954 | MACROBLOCKD *const xd = &x->e_mbd; |
| @@ -971,15 +970,13 @@ void vp10_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, · 15 unmodified lines | ||
| 971 | 970 | uint16_t *eob = &p->eobs[block]; |
| 972 | 971 | const int src_stride = p->src.stride; |
| 973 | 972 | const int dst_stride = pd->dst.stride; |
| 974 | − int i, j; | |
| 975 | − txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j); | |
| 976 | − dst = &pd->dst.buf[4 * (j * dst_stride + i)]; | |
| 977 | − src = &p->src.buf[4 * (j * src_stride + i)]; | |
| 978 | − src_diff = &p->src_diff[4 * (j * diff_stride + i)]; | |
| 973 | + dst = &pd->dst.buf[4 * (blk_row * dst_stride + blk_col)]; | |
| 974 | + src = &p->src.buf[4 * (blk_row * src_stride + blk_col)]; | |
| 975 | + src_diff = &p->src_diff[4 * (blk_row * diff_stride + blk_col)]; | |
| 979 | 976 | |
| 980 | 977 | mode = plane == 0 ? get_y_mode(xd->mi[0], block) : mbmi->uv_mode; |
| 981 | 978 | vp10_predict_intra_block(xd, bwl, bhl, tx_size, mode, dst, dst_stride, |
| 982 | − dst, dst_stride, i, j, plane); | |
| 979 | + dst, dst_stride, blk_col, blk_row, plane); | |
| 983 | 980 | |
| 984 | 981 | #if CONFIG_VP9_HIGHBITDEPTH |
| 985 | 982 | if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { |
| @@ -1130,5 +1127,5 @@ void vp10_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { · 144 unmodified lines | ||
| 1130 | 1127 | struct encode_b_args arg = {x, NULL, &xd->mi[0]->mbmi.skip}; |
| 1131 | 1128 | |
| 1132 | 1129 | vp10_foreach_transformed_block_in_plane(xd, bsize, plane, |
| 1133 | − vp10_encode_block_intra, &arg); | |
| 1130 | + vp10_encode_block_intra, &arg); | |
| 1134 | 1131 | } |
| @@ -26,16 +26,20 @@ struct encode_b_args { · 25 unmodified lines | ||
| 26 | 26 | void vp10_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize); |
| 27 | 27 | void vp10_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize); |
| 28 | 28 | void vp10_xform_quant_fp(MACROBLOCK *x, int plane, int block, |
| 29 | − BLOCK_SIZE plane_bsize, TX_SIZE tx_size); | |
| 29 | + int blk_row, int blk_col, | |
| 30 | + BLOCK_SIZE plane_bsize, TX_SIZE tx_size); | |
| 30 | 31 | void vp10_xform_quant_dc(MACROBLOCK *x, int plane, int block, |
| 31 | − BLOCK_SIZE plane_bsize, TX_SIZE tx_size); | |
| 32 | + int blk_row, int blk_col, | |
| 33 | + BLOCK_SIZE plane_bsize, TX_SIZE tx_size); | |
| 32 | 34 | void vp10_xform_quant(MACROBLOCK *x, int plane, int block, |
| 33 | − BLOCK_SIZE plane_bsize, TX_SIZE tx_size); | |
| 35 | + int blk_row, int blk_col, | |
| 36 | + BLOCK_SIZE plane_bsize, TX_SIZE tx_size); | |
| 34 | 37 | |
| 35 | 38 | void vp10_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane); |
| 36 | 39 | |
| 37 | −void vp10_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, | |
| 38 | − TX_SIZE tx_size, void *arg); | |
| 40 | +void vp10_encode_block_intra(int plane, int block, int blk_row, int blk_col, | |
| 41 | + BLOCK_SIZE plane_bsize, | |
| 42 | + TX_SIZE tx_size, void *arg); | |
| 39 | 43 | |
| 40 | 44 | void vp10_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane); |
| 41 | 45 | |
| @@ -451,18 +451,16 @@ static void dist_block(MACROBLOCK *x, int plane, int block, TX_SIZE tx_size, · 450 unmodified lines | ||
| 451 | 451 | *out_sse = this_sse >> shift; |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | −static int rate_block(int plane, int block, BLOCK_SIZE plane_bsize, | |
| 454 | +static int rate_block(int plane, int block, int blk_row, int blk_col, | |
| 455 | 455 | TX_SIZE tx_size, struct rdcost_block_args* args) { |
| 456 | − int x_idx, y_idx; | |
| 457 | − txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x_idx, &y_idx); | |
| 458 | − | |
| 459 | − return cost_coeffs(args->x, plane, block, args->t_above + x_idx, | |
| 460 | − args->t_left + y_idx, tx_size, | |
| 456 | + return cost_coeffs(args->x, plane, block, args->t_above + blk_col, | |
| 457 | + args->t_left + blk_row, tx_size, | |
| 461 | 458 | args->so->scan, args->so->neighbors, |
| 462 | 459 | args->use_fast_coef_costing); |
| 463 | 460 | } |
| 464 | 461 | |
| 465 | −static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize, | |
| 462 | +static void block_rd_txfm(int plane, int block, int blk_row, int blk_col, | |
| 463 | + BLOCK_SIZE plane_bsize, | |
| 466 | 464 | TX_SIZE tx_size, void *arg) { |
| 467 | 465 | struct rdcost_block_args *args = arg; |
| 468 | 466 | MACROBLOCK *const x = args->x; |
| @@ -478,20 +476,23 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize, · 9 unmodified lines | ||
| 478 | 476 | |
| 479 | 477 | if (!is_inter_block(mbmi)) { |
| 480 | 478 | struct encode_b_args arg = {x, NULL, &mbmi->skip}; |
| 481 | − vp10_encode_block_intra(plane, block, plane_bsize, tx_size, &arg); | |
| 479 | + vp10_encode_block_intra(plane, block, blk_row, blk_col, | |
| 480 | + plane_bsize, tx_size, &arg); | |
| 482 | 481 | dist_block(x, plane, block, tx_size, &dist, &sse); |
| 483 | 482 | } else if (max_txsize_lookup[plane_bsize] == tx_size) { |
| 484 | 483 | if (x->skip_txfm[(plane << 2) + (block >> (tx_size << 1))] == |
| 485 | 484 | SKIP_TXFM_NONE) { |
| 486 | 485 | // full forward transform and quantization |
| 487 | − vp10_xform_quant(x, plane, block, plane_bsize, tx_size); | |
| 486 | + vp10_xform_quant(x, plane, block, blk_row, blk_col, | |
| 487 | + plane_bsize, tx_size); | |
| 488 | 488 | dist_block(x, plane, block, tx_size, &dist, &sse); |
| 489 | 489 | } else if (x->skip_txfm[(plane << 2) + (block >> (tx_size << 1))] == |
| 490 | 490 | SKIP_TXFM_AC_ONLY) { |
| 491 | 491 | // compute DC coefficient |
| 492 | 492 | tran_low_t *const coeff = BLOCK_OFFSET(x->plane[plane].coeff, block); |
| 493 | 493 | tran_low_t *const dqcoeff = BLOCK_OFFSET(xd->plane[plane].dqcoeff, block); |
| 494 | − vp10_xform_quant_dc(x, plane, block, plane_bsize, tx_size); | |
| 494 | + vp10_xform_quant_dc(x, plane, block, blk_row, blk_col, | |
| 495 | + plane_bsize, tx_size); | |
| 495 | 496 | sse = x->bsse[(plane << 2) + (block >> (tx_size << 1))] << 4; |
| 496 | 497 | dist = sse; |
| 497 | 498 | if (x->plane[plane].eobs[block]) { |
| @@ -515,7 +516,7 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize, · 17 unmodified lines | ||
| 515 | 516 | } |
| 516 | 517 | } else { |
| 517 | 518 | // full forward transform and quantization |
| 518 | − vp10_xform_quant(x, plane, block, plane_bsize, tx_size); | |
| 519 | + vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size); | |
| 519 | 520 | dist_block(x, plane, block, tx_size, &dist, &sse); |
| 520 | 521 | } |
| 521 | 522 | |
| @@ -525,7 +526,7 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize, · 3 unmodified lines | ||
| 525 | 526 | return; |
| 526 | 527 | } |
| 527 | 528 | |
| 528 | − rate = rate_block(plane, block, plane_bsize, tx_size, args); | |
| 529 | + rate = rate_block(plane, block, blk_row, blk_col, tx_size, args); | |
| 529 | 530 | rd1 = RDCOST(x->rdmult, x->rddiv, rate, dist); |
| 530 | 531 | rd2 = RDCOST(x->rdmult, x->rddiv, 0, sse); |
| 531 | 532 | |
| @@ -443,7 +443,9 @@ struct tokenize_b_args { · 442 unmodified lines | ||
| 443 | 443 | TOKENEXTRA **tp; |
| 444 | 444 | }; |
| 445 | 445 | |
| 446 | −static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize, | |
| 446 | +static void set_entropy_context_b(int plane, int block, | |
| 447 | + int blk_row, int blk_col, | |
| 448 | + BLOCK_SIZE plane_bsize, | |
| 447 | 449 | TX_SIZE tx_size, void *arg) { |
| 448 | 450 | struct tokenize_b_args* const args = arg; |
| 449 | 451 | ThreadData *const td = args->td; |
| @@ -451,10 +453,8 @@ static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize, · 1 unmodified line | ||
| 451 | 453 | MACROBLOCKD *const xd = &x->e_mbd; |
| 452 | 454 | struct macroblock_plane *p = &x->plane[plane]; |
| 453 | 455 | struct macroblockd_plane *pd = &xd->plane[plane]; |
| 454 | − int aoff, loff; | |
| 455 | − txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff); | |
| 456 | 456 | vp10_set_contexts(xd, pd, plane_bsize, tx_size, p->eobs[block] > 0, |
| 457 | − aoff, loff); | |
| 457 | + blk_col, blk_row); | |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | static INLINE void add_token(TOKENEXTRA **t, const vpx_prob *context_tree, |
| @@ -520,7 +520,8 @@ void vp10_tokenize_palette_sb(struct ThreadData *const td, · 59 unmodified lines | ||
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | −static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize, | |
| 523 | +static void tokenize_b(int plane, int block, int blk_row, int blk_col, | |
| 524 | + BLOCK_SIZE plane_bsize, | |
| 524 | 525 | TX_SIZE tx_size, void *arg) { |
| 525 | 526 | struct tokenize_b_args* const args = arg; |
| 526 | 527 | VP10_COMP *cpi = args->cpi; |
| @@ -553,11 +554,8 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize, · 26 unmodified lines | ||
| 553 | 554 | const int seg_eob = get_tx_eob(&cpi->common.seg, segment_id, tx_size); |
| 554 | 555 | int16_t token; |
| 555 | 556 | EXTRABIT extra; |
| 556 | − int aoff, loff; | |
| 557 | − txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff); | |
| 558 | − | |
| 559 | − pt = get_entropy_context(tx_size, pd->above_context + aoff, | |
| 560 | − pd->left_context + loff); | |
| 557 | + pt = get_entropy_context(tx_size, pd->above_context + blk_col, | |
| 558 | + pd->left_context + blk_row); | |
| 561 | 559 | scan = so->scan; |
| 562 | 560 | nb = so->neighbors; |
| 563 | 561 | c = 0; |
| @@ -597,20 +595,22 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize, · 33 unmodified lines | ||
| 597 | 595 | |
| 598 | 596 | *tp = t; |
| 599 | 597 | |
| 600 | − vp10_set_contexts(xd, pd, plane_bsize, tx_size, c > 0, aoff, loff); | |
| 598 | + vp10_set_contexts(xd, pd, plane_bsize, tx_size, c > 0, blk_col, blk_row); | |
| 601 | 599 | } |
| 602 | 600 | |
| 603 | 601 | struct is_skippable_args { |
| 604 | 602 | uint16_t *eobs; |
| 605 | 603 | int *skippable; |
| 606 | 604 | }; |
| 607 | −static void is_skippable(int plane, int block, | |
| 605 | +static void is_skippable(int plane, int block, int blk_row, int blk_col, | |
| 608 | 606 | BLOCK_SIZE plane_bsize, TX_SIZE tx_size, |
| 609 | 607 | void *argv) { |
| 610 | 608 | struct is_skippable_args *args = argv; |
| 611 | 609 | (void)plane; |
| 612 | 610 | (void)plane_bsize; |
| 613 | 611 | (void)tx_size; |
| 612 | + (void)blk_row; | |
| 613 | + (void)blk_col; | |
| 614 | 614 | args->skippable[0] &= (!args->eobs[block]); |
| 615 | 615 | } |
| 616 | 616 | |
| @@ -624,13 +624,15 @@ int vp10_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { · 7 unmodified lines | ||
| 624 | 624 | return result; |
| 625 | 625 | } |
| 626 | 626 | |
| 627 | −static void has_high_freq_coeff(int plane, int block, | |
| 627 | +static void has_high_freq_coeff(int plane, int block, int blk_row, int blk_col, | |
| 628 | 628 | BLOCK_SIZE plane_bsize, TX_SIZE tx_size, |
| 629 | 629 | void *argv) { |
| 630 | 630 | struct is_skippable_args *args = argv; |
| 631 | 631 | int eobs = (tx_size == TX_4X4) ? 3 : 10; |
| 632 | 632 | (void) plane; |
| 633 | 633 | (void) plane_bsize; |
| 634 | + (void) blk_row; | |
| 635 | + (void) blk_col; | |
| 634 | 636 | |
| 635 | 637 | *(args->skippable) |= (args->eobs[block] > eobs); |
| 636 | 638 | } |