Commit c983c966 authored by Dmitry Kovalev's avatar Dmitry Kovalev

Removing inv_txm4x4_1_add and inv_txm4x4_add function pointers.

We already have itxm_add member in MACROBLOCKD structure. Both
inv_txm4x4_1_add and inv_txm4x4_add are just its special cases for
different eob values. But eob logic is already implemented in
vp9_iwht4x4_add and vp9_idct4x4_add (that's why also removing
inverse_transform_b_4x4_add).

Change-Id: I80bec9b6f7d40c5e5033c613faca5c819c3e6326
parent 8d3ef287
......@@ -221,8 +221,6 @@ typedef struct macroblockd {
int lossless;
/* Inverse transform function pointers. */
void (*inv_txm4x4_1_add)(int16_t *input, uint8_t *dest, int stride);
void (*inv_txm4x4_add)(int16_t *input, uint8_t *dest, int stride);
void (*itxm_add)(int16_t *input, uint8_t *dest, int stride, int eob);
struct subpix_fn_table subpix;
......
......@@ -22,6 +22,7 @@
#include "vp9/common/vp9_entropymode.h"
#include "vp9/common/vp9_extend.h"
#include "vp9/common/vp9_findnearmv.h"
#include "vp9/common/vp9_idct.h"
#include "vp9/common/vp9_mvref_common.h"
#include "vp9/common/vp9_pred_common.h"
#include "vp9/common/vp9_quant_common.h"
......@@ -1866,8 +1867,7 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) {
// printf("Switching to lossless\n");
cpi->mb.fwd_txm8x4 = vp9_short_walsh8x4;
cpi->mb.fwd_txm4x4 = vp9_short_walsh4x4;
cpi->mb.e_mbd.inv_txm4x4_1_add = vp9_iwht4x4_1_add;
cpi->mb.e_mbd.inv_txm4x4_add = vp9_iwht4x4_16_add;
cpi->mb.e_mbd.itxm_add = vp9_iwht4x4_add;
cpi->mb.optimize = 0;
cpi->common.lf.filter_level = 0;
cpi->zbin_mode_boost_enabled = 0;
......@@ -1876,8 +1876,7 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) {
// printf("Not lossless\n");
cpi->mb.fwd_txm8x4 = vp9_short_fdct8x4;
cpi->mb.fwd_txm4x4 = vp9_short_fdct4x4;
cpi->mb.e_mbd.inv_txm4x4_1_add = vp9_idct4x4_1_add;
cpi->mb.e_mbd.inv_txm4x4_add = vp9_idct4x4_16_add;
cpi->mb.e_mbd.itxm_add = vp9_idct4x4_add;
}
}
......
......@@ -40,15 +40,6 @@ void vp9_subtract_block_c(int rows, int cols,
}
}
static void inverse_transform_b_4x4_add(MACROBLOCKD *xd, int eob,
int16_t *dqcoeff, uint8_t *dest,
int stride) {
if (eob <= 1)
xd->inv_txm4x4_1_add(dqcoeff, dest, stride);
else
xd->inv_txm4x4_add(dqcoeff, dest, stride);
}
static void subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
struct macroblock_plane *const p = &x->plane[plane];
const MACROBLOCKD *const xd = &x->e_mbd;
......@@ -463,8 +454,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
// this is like vp9_short_idct4x4 but has a special case around eob<=1
// which is significant (not just an optimization) for the lossless
// case.
inverse_transform_b_4x4_add(xd, pd->eobs[block], dqcoeff,
dst, pd->dst.stride);
xd->itxm_add(dqcoeff, dst, pd->dst.stride, pd->eobs[block]);
break;
default:
assert(!"Invalid transform size");
......@@ -631,7 +621,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
// this is like vp9_short_idct4x4 but has a special case around eob<=1
// which is significant (not just an optimization) for the lossless
// case.
inverse_transform_b_4x4_add(xd, *eob, dqcoeff, dst, pd->dst.stride);
xd->itxm_add(dqcoeff, dst, pd->dst.stride, *eob);
else
vp9_short_iht4x4_add(dqcoeff, dst, pd->dst.stride, tx_type);
}
......
......@@ -17,6 +17,7 @@
#include "vp9/common/vp9_alloccommon.h"
#include "vp9/common/vp9_filter.h"
#include "vp9/common/vp9_idct.h"
#if CONFIG_VP9_POSTPROC
#include "vp9/common/vp9_postproc.h"
#endif
......@@ -1245,14 +1246,8 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
cpi->oxcf.cq_level = q_trans[cpi->oxcf.cq_level];
cpi->oxcf.lossless = oxcf->lossless;
if (cpi->oxcf.lossless) {
cpi->mb.e_mbd.inv_txm4x4_1_add = vp9_iwht4x4_1_add;
cpi->mb.e_mbd.inv_txm4x4_add = vp9_iwht4x4_16_add;
} else {
cpi->mb.e_mbd.inv_txm4x4_1_add = vp9_idct4x4_1_add;
cpi->mb.e_mbd.inv_txm4x4_add = vp9_idct4x4_16_add;
}
cpi->mb.e_mbd.itxm_add = cpi->oxcf.lossless ? vp9_iwht4x4_add
: vp9_idct4x4_add;
cpi->baseline_gf_interval = DEFAULT_GF_INTERVAL;
cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG;
......
......@@ -1100,8 +1100,8 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
vp9_short_iht4x4_add(BLOCK_OFFSET(pd->dqcoeff, block),
dst, pd->dst.stride, tx_type);
else
xd->inv_txm4x4_add(BLOCK_OFFSET(pd->dqcoeff, block),
dst, pd->dst.stride);
xd->itxm_add(BLOCK_OFFSET(pd->dqcoeff, block), dst, pd->dst.stride,
16);
}
}
......
Markdown is supported
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