Commit a21afd42 authored by Sarah Parker's avatar Sarah Parker

Move new quant experiment from nextgen

This experiment implements non-uniform quantization where
the width of the bins increases gradually to more closely
match a laplacian distribution of the coeficcients.

Performance Gain:
derflr: 0.15%
hevcmr: 0.675%

Change-Id: I25234244e3bcd94b87c1f77cf682190b61c8ef94
parent 667db87a
......@@ -19,6 +19,7 @@
#include "vpx_scale/yv12config.h"
#include "vp10/common/common_data.h"
#include "vp10/common/quant_common.h"
#include "vp10/common/entropy.h"
#include "vp10/common/entropymode.h"
#include "vp10/common/mv.h"
......@@ -215,6 +216,10 @@ typedef struct {
#if CONFIG_EXT_PARTITION_TYPES
PARTITION_TYPE partition;
#endif
#if CONFIG_NEW_QUANT
int dq_off_index;
int send_dq_bit;
#endif // CONFIG_NEW_QUANT
} MB_MODE_INFO;
typedef struct MODE_INFO {
......@@ -261,6 +266,9 @@ typedef struct macroblockd_plane {
ENTROPY_CONTEXT *above_context;
ENTROPY_CONTEXT *left_context;
int16_t seg_dequant[MAX_SEGMENTS][2];
#if CONFIG_NEW_QUANT
dequant_val_type_nuq seg_dequant_nuq[MAX_SEGMENTS][COEF_BANDS];
#endif
uint8_t *color_index_map;
// number of 4x4s in current block
......@@ -270,6 +278,9 @@ typedef struct macroblockd_plane {
// encoder
const int16_t *dequant;
#if CONFIG_NEW_QUANT
const dequant_val_type_nuq* dequant_val_nuq;
#endif // CONFIG_NEW_QUANT
} MACROBLOCKD_PLANE;
#define BLOCK_OFFSET(x, i) ((x) + (i) * 16)
......
......@@ -218,6 +218,10 @@ typedef struct VP10Common {
int uv_ac_delta_q;
int16_t y_dequant[MAX_SEGMENTS][2];
int16_t uv_dequant[MAX_SEGMENTS][2];
#if CONFIG_NEW_QUANT
dequant_val_type_nuq y_dequant_nuq[MAX_SEGMENTS][COEF_BANDS];
dequant_val_type_nuq uv_dequant_nuq[MAX_SEGMENTS][COEF_BANDS];
#endif
/* We allocate a MODE_INFO struct for each macroblock, together with
an extra row on top and column on the left to simplify prediction. */
......@@ -429,14 +433,21 @@ static INLINE int frame_is_intra_only(const VP10_COMMON *const cm) {
static INLINE void vp10_init_macroblockd(VP10_COMMON *cm, MACROBLOCKD *xd,
tran_low_t *dqcoeff) {
int i;
for (i = 0; i < MAX_MB_PLANE; ++i) {
xd->plane[i].dqcoeff = dqcoeff;
xd->above_context[i] = cm->above_context[i];
if (xd->plane[i].plane_type == PLANE_TYPE_Y) {
memcpy(xd->plane[i].seg_dequant, cm->y_dequant, sizeof(cm->y_dequant));
#if CONFIG_NEW_QUANT
memcpy(xd->plane[i].seg_dequant_nuq, cm->y_dequant_nuq,
sizeof(cm->y_dequant_nuq));
#endif
} else {
memcpy(xd->plane[i].seg_dequant, cm->uv_dequant, sizeof(cm->uv_dequant));
#if CONFIG_NEW_QUANT
memcpy(xd->plane[i].seg_dequant_nuq, cm->uv_dequant_nuq,
sizeof(cm->uv_dequant_nuq));
#endif
}
xd->fc = cm->fc;
}
......
......@@ -34,18 +34,18 @@ static const uint8_t nuq_knots_lossless[COEF_BANDS][NUQ_KNOTS] = {
// TODO(sarahparker) add multiple quantization profiles
static const uint8_t nuq_knots[COEF_BANDS][NUQ_KNOTS] = {
{86, 122, 134}, // dc, band 0
{91, 133, 139}, // dc, band 0
{78, 122, 134}, // band 1
{78, 122, 134}, // band 2
{84, 122, 133}, // band 3
{88, 122, 134}, // band 4
{88, 122, 134}, // band 5
{83, 127, 139}, // band 2
{84, 117, 128}, // band 3
{88, 117, 129}, // band 4
{93, 122, 134}, // band 5
};
// dequantization offsets
static const uint8_t nuq_doff_lossless[COEF_BANDS] = {0, 0, 0, 0, 0, 0};
static const uint8_t nuq_doff[COEF_BANDS] = {8, 15, 16, 22, 23, 24};
static const uint8_t nuq_doff[COEF_BANDS] = {11, 12, 22, 18, 20, 21};
static const uint8_t *get_nuq_knots(int lossless, int band) {
if (lossless)
......
......@@ -31,6 +31,8 @@ int vp10_get_qindex(const struct segmentation *seg, int segment_id,
#if CONFIG_NEW_QUANT
#define NUQ_KNOTS 3
typedef tran_low_t dequant_val_type_nuq[NUQ_KNOTS + 1];
typedef tran_low_t cuml_bins_type_nuq[NUQ_KNOTS];
void get_dequant_val_nuq(int q, int lossless, int band,
tran_low_t *dq, tran_low_t *cumbins);
tran_low_t dequant_abscoeff_nuq(int v, int q, const tran_low_t *dq);
......
......@@ -7,6 +7,7 @@ print <<EOF
#include "vpx/vpx_integer.h"
#include "vp10/common/common.h"
#include "vp10/common/enums.h"
#include "vp10/common/quant_common.h"
#include "vp10/common/vp10_txfm.h"
struct macroblockd;
......@@ -286,6 +287,20 @@ if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
}
}
if (vpx_config("CONFIG_NEW_QUANT") eq "yes") {
add_proto qw/void quantize_nuq/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, const int16_t *dequant_ptr, const cuml_bins_type_nuq *cuml_bins_ptr, const dequant_val_type_nuq *dequant_val, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const int16_t *scan, const uint8_t *band";
specialize qw/quantize_nuq/;
add_proto qw/void quantize_fp_nuq/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *quant_ptr, const int16_t *dequant_ptr, const cuml_bins_type_nuq *cuml_bins_ptr, const dequant_val_type_nuq *dequant_val, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const int16_t *scan, const uint8_t *band";
specialize qw/quantize_fp_nuq/;
add_proto qw/void quantize_32x32_nuq/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, const int16_t *dequant_ptr, const cuml_bins_type_nuq *cuml_bins_ptr, const dequant_val_type_nuq *dequant_val, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const int16_t *scan, const uint8_t *band";
specialize qw/quantize_32x32_nuq/;
add_proto qw/void quantize_32x32_fp_nuq/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *quant_ptr, const int16_t *dequant_ptr, const cuml_bins_type_nuq *cuml_bins_ptr, const dequant_val_type_nuq *dequant_val, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const int16_t *scan, const uint8_t *band";
specialize qw/quantize_32x32_fp_nuq/;
}
# High bitdepth functions
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
#
......@@ -658,6 +673,19 @@ specialize qw/vp10_temporal_filter_apply sse2 msa/;
if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
# ENCODEMB INVOKE
if (vpx_config("CONFIG_NEW_QUANT") eq "yes") {
add_proto qw/void highbd_quantize_nuq/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, const int16_t *dequant_ptr, const cuml_bins_type_nuq *cuml_bins_ptr, const dequant_val_type_nuq *dequant_val, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const int16_t *scan, const uint8_t *band";
specialize qw/highbd_quantize_nuq/;
add_proto qw/void highbd_quantize_fp_nuq/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *quant_ptr, const int16_t *dequant_ptr, const cuml_bins_type_nuq *cuml_bins_ptr, const dequant_val_type_nuq *dequant_val, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const int16_t *scan, const uint8_t *band";
specialize qw/highbd_quantize_fp_nuq/;
add_proto qw/void highbd_quantize_32x32_nuq/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, const int16_t *dequant_ptr, const cuml_bins_type_nuq *cuml_bins_ptr, const dequant_val_type_nuq *dequant_val, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const int16_t *scan, const uint8_t *band";
specialize qw/highbd_quantize_32x32_nuq/;
add_proto qw/void highbd_quantize_32x32_fp_nuq/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *quant_ptr, const int16_t *dequant_ptr, const cuml_bins_type_nuq *cuml_bins_ptr, const dequant_val_type_nuq *dequant_val, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr, const int16_t *scan, const uint8_t *band";
specialize qw/highbd_quantize_32x32_fp_nuq/;
}
add_proto qw/int64_t vp10_highbd_block_error/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd";
specialize qw/vp10_highbd_block_error sse2/;
......
......@@ -2046,6 +2046,9 @@ static void setup_quantization(VP10_COMMON *const cm,
static void setup_segmentation_dequant(VP10_COMMON *const cm) {
// Build y/uv dequant values based on segmentation.
#if CONFIG_NEW_QUANT
int b;
#endif
if (cm->seg.enabled) {
int i;
for (i = 0; i < MAX_SEGMENTS; ++i) {
......@@ -2057,6 +2060,16 @@ static void setup_segmentation_dequant(VP10_COMMON *const cm) {
cm->bit_depth);
cm->uv_dequant[i][1] = vp10_ac_quant(qindex, cm->uv_ac_delta_q,
cm->bit_depth);
#if CONFIG_NEW_QUANT
for (b = 0; b < COEF_BANDS; ++b) {
get_dequant_val_nuq(
cm->y_dequant[i][b != 0], qindex == 0, b,
cm->y_dequant_nuq[i][b], NULL);
get_dequant_val_nuq(
cm->uv_dequant[i][b != 0], qindex == 0, b,
cm->uv_dequant_nuq[i][b], NULL);
}
#endif
}
} else {
const int qindex = cm->base_qindex;
......@@ -2068,6 +2081,16 @@ static void setup_segmentation_dequant(VP10_COMMON *const cm) {
cm->bit_depth);
cm->uv_dequant[0][1] = vp10_ac_quant(qindex, cm->uv_ac_delta_q,
cm->bit_depth);
#if CONFIG_NEW_QUANT
for (b = 0; b < COEF_BANDS; ++b) {
get_dequant_val_nuq(
cm->y_dequant[0][b != 0], qindex == 0, b,
cm->y_dequant_nuq[0][b], NULL);
get_dequant_val_nuq(
cm->uv_dequant[0][b != 0], qindex == 0, b,
cm->uv_dequant_nuq[0][b], NULL);
}
#endif
}
}
......@@ -3057,7 +3080,6 @@ static size_t read_uncompressed_header(VP10Decoder *pbi,
RefCntBuffer *const frame_bufs = pool->frame_bufs;
int i, mask, ref_index = 0;
size_t sz;
#if CONFIG_EXT_REFS
cm->last3_frame_type = cm->last2_frame_type;
cm->last2_frame_type = cm->last_frame_type;
......
......@@ -49,6 +49,9 @@ static int decode_coefs(const MACROBLOCKD *xd,
PLANE_TYPE type,
tran_low_t *dqcoeff, TX_SIZE tx_size, TX_TYPE tx_type,
const int16_t *dq,
#if CONFIG_NEW_QUANT
dequant_val_type_nuq *dq_val,
#endif // CONFIG_NEW_QUANT
int ctx, const int16_t *scan, const int16_t *nb,
vp10_reader *r) {
FRAME_COUNTS *counts = xd->counts;
......@@ -66,6 +69,9 @@ static int decode_coefs(const MACROBLOCKD *xd,
int dq_shift;
int v, token;
int16_t dqv = dq[0];
#if CONFIG_NEW_QUANT
const tran_low_t *dqv_val = &dq_val[0][0];
#endif // CONFIG_NEW_QUANT
const uint8_t *cat1_prob;
const uint8_t *cat2_prob;
const uint8_t *cat3_prob;
......@@ -125,6 +131,10 @@ static int decode_coefs(const MACROBLOCKD *xd,
break;
}
#if CONFIG_NEW_QUANT
dqv_val = &dq_val[band][0];
#endif // CONFIG_NEW_QUANT
while (!vp10_read(r, prob[ZERO_CONTEXT_NODE])) {
INCREMENT_COUNT(ZERO_TOKEN);
dqv = dq[1];
......@@ -135,6 +145,9 @@ static int decode_coefs(const MACROBLOCKD *xd,
ctx = get_coef_context(nb, token_cache, c);
band = *band_translate++;
prob = coef_probs[band][ctx];
#if CONFIG_NEW_QUANT
dqv_val = &dq_val[band][0];
#endif // CONFIG_NEW_QUANT
}
if (!vp10_read(r, prob[ONE_CONTEXT_NODE])) {
......@@ -191,7 +204,13 @@ static int decode_coefs(const MACROBLOCKD *xd,
}
}
}
#if CONFIG_NEW_QUANT
v = dequant_abscoeff_nuq(val, dqv, dqv_val);
v = dq_shift ? ROUND_POWER_OF_TWO(v, dq_shift) : v;
#else
v = (val * dqv) >> dq_shift;
#endif // CONFIG_NEW_QUANT
#if CONFIG_COEFFICIENT_RANGE_CHECKING
#if CONFIG_VP9_HIGHBITDEPTH
dqcoeff[scan[c]] = highbd_check_range((vp10_read_bit(r) ? -v : v),
......@@ -224,6 +243,9 @@ static int decode_coefs_ans(const MACROBLOCKD *const xd,
tran_low_t *dqcoeff, TX_SIZE tx_size,
TX_TYPE tx_type,
const int16_t *dq,
#if CONFIG_NEW_QUANT
dequant_val_type_nuq *dq_val,
#endif // CONFIG_NEW_QUANT
int ctx, const int16_t *scan, const int16_t *nb,
struct AnsDecoder *const ans) {
FRAME_COUNTS *counts = xd->counts;
......@@ -245,6 +267,9 @@ static int decode_coefs_ans(const MACROBLOCKD *const xd,
int dq_shift;
int v, token;
int16_t dqv = dq[0];
#if CONFIG_NEW_QUANT
const tran_low_t *dqv_val = &dq_val[0][0];
#endif // CONFIG_NEW_QUANT
const uint8_t *cat1_prob;
const uint8_t *cat2_prob;
const uint8_t *cat3_prob;
......@@ -306,6 +331,10 @@ static int decode_coefs_ans(const MACROBLOCKD *const xd,
}
}
#if CONFIG_NEW_QUANT
dqv_val = &dq_val[band][0];
#endif // CONFIG_NEW_QUANT
cdf = &coef_cdfs[band][ctx];
token = ZERO_TOKEN + rans_read(ans, *cdf);
if (token == ZERO_TOKEN) {
......@@ -359,7 +388,13 @@ static int decode_coefs_ans(const MACROBLOCKD *const xd,
#endif
} break;
}
v = (val * dqv) >> dq_shift;
#if CONFIG_NEW_QUANT
v = dequant_abscoeff_nuq(val, dqv, dqv_val);
v = dq_shift ? ROUND_POWER_OF_TWO(v, dq_shift) : v;
#else
v = (val * dqv) >> dq_shift;
#endif // CONFIG_NEW_QUANT
#if CONFIG_COEFFICIENT_RANGE_CHECKING
#if CONFIG_VP9_HIGHBITDEPTH
dqcoeff[scan[c]] =
......@@ -474,11 +509,19 @@ int vp10_decode_block_tokens(MACROBLOCKD *const xd,
#if !CONFIG_ANS
const int eob = decode_coefs(xd, pd->plane_type,
pd->dqcoeff, tx_size, tx_type,
dequant, ctx, sc->scan, sc->neighbors, r);
dequant,
#if CONFIG_NEW_QUANT
pd->seg_dequant_nuq[0],
#endif // CONFIG_NEW_QUANT
ctx, sc->scan, sc->neighbors, r);
#else
const int eob = decode_coefs_ans(xd, pd->plane_type,
pd->dqcoeff, tx_size, tx_type,
dequant, ctx, sc->scan, sc->neighbors, r);
dequant,
#if CONFIG_NEW_QUANT
pd->seg_dequant_nuq[0],
#endif // CONFIG_NEW_QUANT
ctx, sc->scan, sc->neighbors, r);
#endif // !CONFIG_ANS
dec_set_contexts(xd, pd, tx_size, eob > 0, x, y);
return eob;
......
......@@ -41,6 +41,9 @@ typedef struct macroblock_plane {
int16_t *quant_shift;
int16_t *zbin;
int16_t *round;
#if CONFIG_NEW_QUANT
cuml_bins_type_nuq *cuml_bins_nuq;
#endif // CONFIG_NEW_QUANT
int64_t quant_thred[2];
} MACROBLOCK_PLANE;
......
This diff is collapsed.
......@@ -41,6 +41,20 @@ void vp10_xform_quant(MACROBLOCK *x, int plane, int block,
int blk_row, int blk_col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
VP10_XFORM_QUANT xform_quant_idx);
#if CONFIG_NEW_QUANT
void vp10_xform_quant_nuq(MACROBLOCK *x, int plane, int block, int blk_row,
int blk_col, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size);
void vp10_xform_quant_dc_nuq(MACROBLOCK *x, int plane, int block, int blk_row,
int blk_col, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size);
void vp10_xform_quant_fp_nuq(MACROBLOCK *x, int plane, int block, int blk_row,
int blk_col, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size);
void vp10_xform_quant_dc_fp_nuq(MACROBLOCK *x, int plane, int block,
int blk_row, int blk_col,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size);
#endif
void vp10_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
......
......@@ -336,6 +336,12 @@ typedef struct VP10_COMP {
MB_MODE_INFO_EXT *mbmi_ext_base;
DECLARE_ALIGNED(16, int16_t, y_dequant[QINDEX_RANGE][8]); // 8: SIMD width
DECLARE_ALIGNED(16, int16_t, uv_dequant[QINDEX_RANGE][8]); // 8: SIMD width
#if CONFIG_NEW_QUANT
DECLARE_ALIGNED(16, dequant_val_type_nuq,
y_dequant_val_nuq[QINDEX_RANGE][COEF_BANDS]);
DECLARE_ALIGNED(16, dequant_val_type_nuq,
uv_dequant_val_nuq[QINDEX_RANGE][COEF_BANDS]);
#endif // CONFIG_NEW_QUANT
VP10_COMMON common;
VP10EncoderConfig oxcf;
struct lookahead_ctx *lookahead;
......
This diff is collapsed.
......@@ -32,6 +32,14 @@ typedef void (*VP10_QUANT_FACADE)(const tran_low_t *coeff_ptr,
const QUANT_PARAM *qparam);
typedef struct {
#if CONFIG_NEW_QUANT
DECLARE_ALIGNED(16, tran_low_t,
y_cuml_bins_nuq[QINDEX_RANGE][COEF_BANDS]
[NUQ_KNOTS]);
DECLARE_ALIGNED(16, tran_low_t,
uv_cuml_bins_nuq[QINDEX_RANGE][COEF_BANDS]
[NUQ_KNOTS]);
#endif // CONFIG_NEW_QUANT
// 0: dc 1: ac 2-8: ac repeated to SIMD width
DECLARE_ALIGNED(16, int16_t, y_quant[QINDEX_RANGE][8]);
DECLARE_ALIGNED(16, int16_t, y_quant_shift[QINDEX_RANGE][8]);
......@@ -88,6 +96,52 @@ void vp10_quantize_dc_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const QUANT_PARAM *qparam);
#if CONFIG_NEW_QUANT
void quantize_dc_nuq(const tran_low_t *coeff_ptr,
intptr_t n_coeffs,
int skip_block,
const int16_t quant,
const int16_t quant_shift,
const int16_t dequant,
const tran_low_t *cuml_bins_ptr,
const tran_low_t *dequant_val,
tran_low_t *qcoeff_ptr,
tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr);
void quantize_dc_32x32_nuq(const tran_low_t *coeff_ptr,
intptr_t n_coeffs,
int skip_block,
const int16_t quant,
const int16_t quant_shift,
const int16_t dequant,
const tran_low_t *cuml_bins_ptr,
const tran_low_t *dequant_val,
tran_low_t *qcoeff_ptr,
tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr);
void quantize_dc_fp_nuq(const tran_low_t *coeff_ptr,
intptr_t n_coeffs,
int skip_block,
const int16_t quant,
const int16_t dequant,
const tran_low_t *cuml_bins_ptr,
const tran_low_t *dequant_val,
tran_low_t *qcoeff_ptr,
tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr);
void quantize_dc_32x32_fp_nuq(const tran_low_t *coeff_ptr,
intptr_t n_coeffs,
int skip_block,
const int16_t quant,
const int16_t dequant,
const tran_low_t *cuml_bins_ptr,
const tran_low_t *dequant_val,
tran_low_t *qcoeff_ptr,
tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr);
#endif // CONFIG_NEW_QUANT
#if CONFIG_VP9_HIGHBITDEPTH
void vp10_highbd_quantize_fp_facade(
const tran_low_t *coeff_ptr, intptr_t n_coeffs, const MACROBLOCK_PLANE *p,
......@@ -115,6 +169,51 @@ void vp10_highbd_quantize_dc(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
const int16_t dequant_ptr, uint16_t *eob_ptr,
const int log_scale);
#if CONFIG_NEW_QUANT
void highbd_quantize_dc_nuq(const tran_low_t *coeff_ptr,
intptr_t n_coeffs,
int skip_block,
const int16_t quant,
const int16_t quant_shift,
const int16_t dequant,
const tran_low_t *cuml_bins_ptr,
const tran_low_t *dequant_val,
tran_low_t *qcoeff_ptr,
tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr);
void highbd_quantize_dc_32x32_nuq(const tran_low_t *coeff_ptr,
intptr_t n_coeffs,
int skip_block,
const int16_t quant,
const int16_t quant_shift,
const int16_t dequant,
const tran_low_t *cuml_bins_ptr,
const tran_low_t *dequant_val,
tran_low_t *qcoeff_ptr,
tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr);
void highbd_quantize_dc_fp_nuq(const tran_low_t *coeff_ptr,
intptr_t n_coeffs,
int skip_block,
const int16_t quant,
const int16_t dequant,
const tran_low_t *cuml_bins_ptr,
const tran_low_t *dequant_val,
tran_low_t *qcoeff_ptr,
tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr);
void highbd_quantize_dc_32x32_fp_nuq(const tran_low_t *coeff_ptr,
intptr_t n_coeffs,
int skip_block,
const int16_t quant,
const int16_t dequant,
const tran_low_t *cuml_bins_ptr,
const tran_low_t *dequant_val,
tran_low_t *qcoeff_ptr,
tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr);
#endif // CONFIG_NEW_QUANT
#endif // CONFIG_VP9_HIGHBITDEPTH
#ifdef __cplusplus
......
......@@ -1259,8 +1259,13 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
if (x->skip_txfm[plane][block >> (tx_size << 1)] ==
SKIP_TXFM_NONE) {
// full forward transform and quantization
#if CONFIG_NEW_QUANT
vp10_xform_quant_nuq(x, plane, block, blk_row, blk_col,
plane_bsize, tx_size);
#else
vp10_xform_quant(x, plane, block, blk_row, blk_col,
plane_bsize, tx_size, VP10_XFORM_QUANT_B);
#endif // CONFIG_NEW_QUANT
dist_block(args->cpi, x, plane, block, blk_row, blk_col,
tx_size, &dist, &sse);
} else if (x->skip_txfm[plane][block >> (tx_size << 1)] ==
......@@ -1268,8 +1273,17 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
// compute DC coefficient
tran_low_t *const coeff = BLOCK_OFFSET(x->plane[plane].coeff, block);
tran_low_t *const dqcoeff = BLOCK_OFFSET(xd->plane[plane].dqcoeff, block);
#if CONFIG_NEW_QUANT
if (x->quant_fp)
vp10_xform_quant_dc_fp_nuq(x, plane, block, blk_row, blk_col,
plane_bsize, tx_size);
else
vp10_xform_quant_dc_nuq(x, plane, block, blk_row, blk_col,
plane_bsize, tx_size);
#else
vp10_xform_quant(x, plane, block, blk_row, blk_col,
plane_bsize, tx_size, VP10_XFORM_QUANT_DC);
#endif // CONFIG_NEW_QUANT
sse = x->bsse[plane][block >> (tx_size << 1)] << 4;
dist = sse;
if (x->plane[plane].eobs[block]) {
......@@ -1295,8 +1309,17 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
}
} else {
// full forward transform and quantization
#if CONFIG_NEW_QUANT
if (x->quant_fp)
vp10_xform_quant_fp_nuq(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size);
else
vp10_xform_quant_nuq(x, plane, block, blk_row, blk_col, plane_bsize,
tx_size);
#else
vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
VP10_XFORM_QUANT_B);
#endif // CONFIG_NEW_QUANT
dist_block(args->cpi, x, plane, block, blk_row, blk_col,
tx_size, &dist, &sse);
}
......
......@@ -239,7 +239,6 @@ static void set_good_speed_feature(VP10_COMP *cpi, VP10_COMMON *cm,
static void set_rt_speed_feature_framesize_dependent(VP10_COMP *cpi,
SPEED_FEATURES *sf, int speed) {
VP10_COMMON *const cm = &cpi->common;
if (speed >= 1) {
if (VPXMIN(cm->width, cm->height) >= 720) {
sf->disable_split_mask = cm->show_frame ? DISABLE_ALL_SPLIT
......@@ -309,6 +308,7 @@ static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf,
sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V;
}
if (speed >= 2) {
sf->mode_search_skip_flags = (cm->frame_type == KEY_FRAME) ? 0 :
FLAG_SKIP_INTRA_DIRMISMATCH |
......
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