typedef void (*foreach_transformed_block_visitor)(int plane, int block,
BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size,
+ TX_SIZE tx_size,
void *arg);
static INLINE void foreach_transformed_block_in_plane(
for (r = 0; r < (1 << bh); r += (1 << tx_size)) {
for (c = 0; c < (1 << bw); c += (1 << tx_size)) {
if (r < max_blocks_high && c < max_blocks_wide)
- visit(plane, i, bsize, txfrm_size_b, arg);
+ visit(plane, i, bsize, tx_size, arg);
i += step;
}
}
const int ss_block_size = bw + bh;
assert(txfrm_size_b <= ss_block_size);
for (i = 0; i < (1 << ss_block_size); i += step)
- visit(plane, i, bsize, txfrm_size_b, arg);
+ visit(plane, i, bsize, tx_size, arg);
}
}
int plane, int block,
TX_SIZE tx_size) {
const int bwl = b_width_log2(bsize) - xd->plane[plane].subsampling_x;
- const int ss_txfrm_size = tx_size << 1;
const int tx_cols_log2 = bwl - tx_size;
const int tx_cols = 1 << tx_cols_log2;
- const int raster_mb = block >> ss_txfrm_size;
+ const int raster_mb = block >> (tx_size << 1);
const int x = (raster_mb & (tx_cols - 1)) << tx_size;
const int y = raster_mb >> tx_cols_log2 << tx_size;
return x + (y << bwl);
TX_SIZE tx_size,
int *x, int *y) {
const int bwl = b_width_log2(bsize) - xd->plane[plane].subsampling_x;
- const int ss_txfrm_size = tx_size << 1;
const int tx_cols_log2 = bwl - tx_size;
const int tx_cols = 1 << tx_cols_log2;
- const int raster_mb = block >> ss_txfrm_size;
+ const int raster_mb = block >> (tx_size << 1);
*x = (raster_mb & (tx_cols - 1)) << tx_size;
*y = raster_mb >> tx_cols_log2 << tx_size;
}
}
static void decode_block(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg) {
+ TX_SIZE tx_size, void *arg) {
MACROBLOCKD* const xd = arg;
struct macroblockd_plane *const pd = &xd->plane[plane];
int16_t* const qcoeff = BLOCK_OFFSET(pd->qcoeff, block);
const int stride = pd->dst.stride;
const int eob = pd->eobs[block];
- const TX_SIZE tx_size = (TX_SIZE)(ss_txfrm_size >> 1);
const int raster_block = txfrm_block_to_raster_block(xd, bsize, plane,
block, tx_size);
uint8_t* const dst = raster_block_offset_uint8(xd, bsize, plane,
}
static void decode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg) {
+ TX_SIZE tx_size, void *arg) {
MACROBLOCKD* const xd = arg;
struct macroblockd_plane *const pd = &xd->plane[plane];
MODE_INFO *const mi = xd->mode_info_context;
- const TX_SIZE tx_size = (TX_SIZE)(ss_txfrm_size >> 1);
const int raster_block = txfrm_block_to_raster_block(xd, bsize, plane,
block, tx_size);
uint8_t* const dst = raster_block_offset_uint8(xd, bsize, plane,
if (mi->mbmi.skip_coeff)
return;
- decode_block(plane, block, bsize, ss_txfrm_size, arg);
+ decode_block(plane, block, bsize, tx_size, arg);
}
static int decode_tokens(VP9D_COMP *pbi, BLOCK_SIZE_TYPE bsize, vp9_reader *r) {
int *eobtotal;
};
-static void decode_block(int plane, int block,
- BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size,
- void *argv) {
+static void decode_block(int plane, int block, BLOCK_SIZE_TYPE bsize,
+ TX_SIZE tx_size, void *argv) {
const struct decode_block_args* const arg = argv;
const int bw = b_width_log2(bsize);
struct segmentation *seg = &arg->pbi->common.seg;
struct macroblockd_plane* pd = &xd->plane[plane];
const int segment_id = xd->mode_info_context->mbmi.segment_id;
- const TX_SIZE tx_size = ss_txfrm_size >> 1;
+ const int ss_txfrm_size = tx_size << 1;
const int seg_eob = get_eob(seg, segment_id, 16 << ss_txfrm_size);
const int off = block >> ss_txfrm_size;
const int mod = bw - tx_size - pd->subsampling_x;
#include "vp9/encoder/vp9_onyx_int.h"
int vp9_encode_intra(VP9_COMP *cpi, MACROBLOCK *x, int use_16x16_pred);
-void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg);
+void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
+ TX_SIZE tx_size, void *arg);
void vp9_encode_intra_block_y(VP9_COMMON *const cm, MACROBLOCK *mb,
BLOCK_SIZE_TYPE bs);
void vp9_encode_intra_block_uv(VP9_COMMON *const cm, MACROBLOCK *mb,
}
static void optimize_block(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg) {
+ TX_SIZE tx_size, void *arg) {
const struct encode_b_args* const args = arg;
- vp9_optimize_b(plane, block, bsize, ss_txfrm_size >> 1, args->x, args->ctx);
+ vp9_optimize_b(plane, block, bsize, tx_size, args->x, args->ctx);
}
void optimize_init_b(int plane, BLOCK_SIZE_TYPE bsize, void *arg) {
foreach_transformed_block_uv(&x->e_mbd, bsize, optimize_block, &arg);
}
-void xform_quant(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg) {
+void vp9_xform_quant(int plane, int block, BLOCK_SIZE_TYPE bsize,
+ TX_SIZE tx_size, void *arg) {
struct encode_b_args* const args = arg;
MACROBLOCK* const x = args->x;
MACROBLOCKD* const xd = &x->e_mbd;
int16_t *dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
const int16_t *scan, *iscan;
uint16_t *eob = &pd->eobs[block];
- const TX_SIZE tx_size = (TX_SIZE)(ss_txfrm_size >> 1);
const int bwl = b_width_log2(bsize) - pd->subsampling_x, bw = 1 << bwl;
const int twl = bwl - tx_size, twmask = (1 << twl) - 1;
int xoff, yoff;
}
static void encode_block(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg) {
+ TX_SIZE tx_size, void *arg) {
struct encode_b_args *const args = arg;
MACROBLOCK *const x = args->x;
MACROBLOCKD *const xd = &x->e_mbd;
- const TX_SIZE tx_size = (TX_SIZE)(ss_txfrm_size >> 1);
const int raster_block = txfrm_block_to_raster_block(xd, bsize, plane,
block, tx_size);
struct macroblockd_plane *const pd = &xd->plane[plane];
uint8_t *const dst = raster_block_offset_uint8(xd, bsize, plane,
raster_block,
pd->dst.buf, pd->dst.stride);
- xform_quant(plane, block, bsize, ss_txfrm_size, arg);
+ vp9_xform_quant(plane, block, bsize, tx_size, arg);
if (x->optimize)
vp9_optimize_b(plane, block, bsize, tx_size, x, args->ctx);
MACROBLOCKD* const xd = &x->e_mbd;
struct encode_b_args arg = {cm, x, NULL};
- foreach_transformed_block_in_plane(xd, bsize, 0, xform_quant, &arg);
+ foreach_transformed_block_in_plane(xd, bsize, 0, vp9_xform_quant, &arg);
}
void vp9_xform_quant_sbuv(VP9_COMMON *cm, MACROBLOCK *x,
MACROBLOCKD* const xd = &x->e_mbd;
struct encode_b_args arg = {cm, x, NULL};
- foreach_transformed_block_uv(xd, bsize, xform_quant, &arg);
+ foreach_transformed_block_uv(xd, bsize, vp9_xform_quant, &arg);
}
void vp9_encode_sby(VP9_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
foreach_transformed_block(xd, bsize, encode_block, &arg);
}
-void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg) {
+void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
+ TX_SIZE tx_size, void *arg) {
struct encode_b_args* const args = arg;
MACROBLOCK *const x = args->x;
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
- const TX_SIZE tx_size = (TX_SIZE)(ss_txfrm_size >> 1);
struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
int16_t *coeff = BLOCK_OFFSET(p->coeff, block);
struct optimize_ctx ctx;
struct encode_b_args arg = {cm, x, &ctx};
- foreach_transformed_block_in_plane(xd, bsize, 0,
- encode_block_intra, &arg);
+ foreach_transformed_block_in_plane(xd, bsize, 0, vp9_encode_block_intra,
+ &arg);
}
void vp9_encode_intra_block_uv(VP9_COMMON *cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE bsize) {
MACROBLOCKD* const xd = &x->e_mbd;
struct optimize_ctx ctx;
struct encode_b_args arg = {cm, x, &ctx};
- foreach_transformed_block_uv(xd, bsize, encode_block_intra, &arg);
+ foreach_transformed_block_uv(xd, bsize, vp9_encode_block_intra, &arg);
}
void vp9_encode_sby(VP9_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE_TYPE bsize);
void vp9_encode_sbuv(VP9_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE_TYPE bsize);
-void xform_quant(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg);
+void vp9_xform_quant(int plane, int block, BLOCK_SIZE_TYPE bsize,
+ TX_SIZE tx_size, void *arg);
void vp9_xform_quant_sby(VP9_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE_TYPE bsize);
void vp9_xform_quant_sbuv(VP9_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE_TYPE bsize);
};
static void dist_block(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg) {
+ TX_SIZE tx_size, void *arg) {
+ const int ss_txfrm_size = tx_size << 1;
struct rdcost_block_args* args = arg;
MACROBLOCK* const x = args->x;
MACROBLOCKD* const xd = &x->e_mbd;
}
static void rate_block(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg) {
+ TX_SIZE tx_size, void *arg) {
struct rdcost_block_args* args = arg;
MACROBLOCKD *const xd = &args->x->e_mbd;
int x_idx, y_idx;
}
static void block_yrd_txfm(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg) {
+ TX_SIZE tx_size, void *arg) {
struct rdcost_block_args *args = arg;
MACROBLOCK *const x = args->x;
MACROBLOCKD *const xd = &x->e_mbd;
}
if (!is_inter_block(&xd->mode_info_context->mbmi))
- encode_block_intra(plane, block, bsize, ss_txfrm_size, &encode_args);
+ vp9_encode_block_intra(plane, block, bsize, tx_size, &encode_args);
else
- xform_quant(plane, block, bsize, ss_txfrm_size, &encode_args);
+ vp9_xform_quant(plane, block, bsize, tx_size, &encode_args);
- dist_block(plane, block, bsize, ss_txfrm_size, args);
- rate_block(plane, block, bsize, ss_txfrm_size, args);
+ dist_block(plane, block, bsize, tx_size, args);
+ rate_block(plane, block, bsize, tx_size, args);
}
static void txfm_rd_in_plane(VP9_COMMON *const cm, MACROBLOCK *x,
};
static void set_entropy_context_b(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg) {
+ TX_SIZE tx_size, void *arg) {
struct tokenize_b_args* const args = arg;
- const TX_SIZE tx_size = (TX_SIZE)(ss_txfrm_size >> 1);
MACROBLOCKD *const xd = args->xd;
const int bwl = b_width_log2(bsize);
const int off = block >> (2 * tx_size);
}
static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize,
- int ss_txfrm_size, void *arg) {
+ TX_SIZE tx_size, void *arg) {
struct tokenize_b_args* const args = arg;
VP9_COMP *cpi = args->cpi;
MACROBLOCKD *xd = args->xd;
TOKENEXTRA **tp = args->tp;
- const TX_SIZE tx_size = (TX_SIZE)(ss_txfrm_size >> 1);
const int tx_size_in_blocks = 1 << tx_size;
MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
int pt; /* near block/prev token context index */
};
static void is_skippable(int plane, int block,
- BLOCK_SIZE_TYPE bsize, int ss_txfrm_size, void *argv) {
+ BLOCK_SIZE_TYPE bsize, TX_SIZE tx_size, void *argv) {
struct is_skippable_args *args = argv;
args->skippable[0] &= (!args->xd->plane[plane].eobs[block]);
}