#define VP9_FRAME_MARKER 0x2
+#define BITDEPTH_10 10
#ifdef __cplusplus
} // extern "C"
switch (tx_type) {
case DCT_DCT:
- if (bd == 10)
+ if (bd == BITDEPTH_10)
vp10_inv_txfm2d_add_4x4(input, CONVERT_TO_SHORTPTR(dest), stride,
&inv_txfm_2d_cfg_dct_dct_4, bd);
else
TX_TYPE tx_type) {
switch (tx_type) {
case DCT_DCT:
- if (bd == 10)
+ if (bd == BITDEPTH_10)
vp10_inv_txfm2d_add_8x8(input, CONVERT_TO_SHORTPTR(dest), stride,
&inv_txfm_2d_cfg_dct_dct_8, bd);
else
TX_TYPE tx_type) {
switch (tx_type) {
case DCT_DCT:
- if (bd == 10)
+ if (bd == BITDEPTH_10)
vp10_inv_txfm2d_add_16x16(input, CONVERT_TO_SHORTPTR(dest), stride,
&inv_txfm_2d_cfg_dct_dct_16, bd);
else
TX_TYPE tx_type) {
switch (tx_type) {
case DCT_DCT:
- vp10_highbd_idct32x32_add(input, dest, stride, eob, bd);
+ if (bd == BITDEPTH_10)
+ vp10_inv_txfm2d_add_32x32(input, CONVERT_TO_SHORTPTR(dest), stride,
+ &inv_txfm_2d_cfg_dct_dct_32, bd);
+ else
+ vp10_highbd_idct32x32_add(input, dest, stride, eob, bd);
break;
#if CONFIG_EXT_TX
case ADST_DCT:
unsigned int (*eob_branch_count)[COEFF_CONTEXTS];
uint8_t token_cache[32 * 32];
const uint8_t *band_translate = get_band_translate(tx_size);
- const int dq_shift = (tx_size == TX_32X32);
+ int dq_shift;
int v, token;
int16_t dqv = dq[0];
const uint8_t *cat1_prob;
cat6_prob = vp10_cat6_prob;
#endif
+#if CONFIG_VP9_HIGHBITDEPTH
+ if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH && xd->bd == BITDEPTH_10) {
+ dq_shift = 0;
+ } else {
+ dq_shift = (tx_size == TX_32X32);
+ }
+#else
+ dq_shift = (tx_size == TX_32X32);
+#endif
+
while (c < max_eob) {
int val = -1;
band = *band_translate++;
unsigned int (*eob_branch_count)[COEFF_CONTEXTS];
uint8_t token_cache[32 * 32];
const uint8_t *band_translate = get_band_translate(tx_size);
- const int dq_shift = (tx_size == TX_32X32);
+ int dq_shift;
int v, token;
int16_t dqv = dq[0];
const uint8_t *cat1_prob;
const uint8_t *cat5_prob;
const uint8_t *cat6_prob;
+#if CONFIG_VP9_HIGHBITDEPTH
+ if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH && xd->bd == BITDEPTH_10) {
+ dq_shift = 0;
+ } else {
+ dq_shift = (tx_size == TX_32X32);
+ }
+#else
+ dq_shift = (tx_size == TX_32X32);
+#endif
+
if (counts) {
coef_counts = counts->coef[tx_size][type][ref];
eob_branch_count = counts->eob_branch[tx_size][type][ref];
const int eob = p->eobs[block];
const PLANE_TYPE type = pd->plane_type;
const int default_eob = 16 << (tx_size << 1);
- const int mul = 1 + (tx_size == TX_32X32);
+ int mul;
const int16_t *dequant_ptr = pd->dequant;
const uint8_t *const band_translate = get_band_translate(tx_size);
TX_TYPE tx_type = get_tx_type(type, xd, block, tx_size);
assert((!type && !plane) || (type && plane));
assert(eob <= default_eob);
+#if CONFIG_VP9_HIGHBITDEPTH
+ if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH && xd->bd == BITDEPTH_10) {
+ mul = 1;
+ } else {
+ mul = 1 + (tx_size == TX_32X32);
+ }
+#else
+ mul = 1 + (tx_size == TX_32X32);
+#endif
+
/* Now set up a Viterbi trellis to evaluate alternative roundings. */
if (!ref)
rdmult = (rdmult * 9) >> 4;
if (x->skip_block) {
vp10_quantize_skip(tx2d_size, qcoeff, dqcoeff, eob);
} else {
- if (tx_size == TX_32X32)
+ if (tx_size == TX_32X32 && xd->bd != 10)
quant_func_list[xform_quant_idx][QUANT_FUNC_HIGHBD_32](
coeff, tx2d_size, p, qcoeff, pd, dqcoeff, eob, scan_order);
else
switch (tx_type) {
case DCT_DCT:
- if (bd == 10) {
+ if (bd == BITDEPTH_10) {
vp10_fwd_txfm2d_4x4(src_diff, coeff, diff_stride,
&fwd_txfm_2d_cfg_dct_dct_4, bd);
} else {
(void)fwd_txfm_opt;
switch (tx_type) {
case DCT_DCT:
- if (bd == 10) {
+ if (bd == BITDEPTH_10) {
vp10_fwd_txfm2d_8x8(src_diff, coeff, diff_stride,
&fwd_txfm_2d_cfg_dct_dct_8, bd);
break;
(void)fwd_txfm_opt;
switch (tx_type) {
case DCT_DCT:
- if (bd == 10) {
+ if (bd == BITDEPTH_10) {
vp10_fwd_txfm2d_16x16(src_diff, coeff, diff_stride,
&fwd_txfm_2d_cfg_dct_dct_16, bd);
break;
(void)bd;
switch (tx_type) {
case DCT_DCT:
- if (fwd_txfm_opt == FWD_TXFM_OPT_NORMAL)
- highbd_fdct32x32(rd_transform, src_diff, coeff, diff_stride);
- else // FWD_TXFM_OPT_DC
- vpx_highbd_fdct32x32_1(src_diff, coeff, diff_stride);
+ if (bd == BITDEPTH_10) {
+ vp10_fwd_txfm2d_32x32(src_diff, coeff, diff_stride,
+ &fwd_txfm_2d_cfg_dct_dct_32, bd);
+ } else {
+ if (fwd_txfm_opt == FWD_TXFM_OPT_NORMAL)
+ highbd_fdct32x32(rd_transform, src_diff, coeff, diff_stride);
+ else // FWD_TXFM_OPT_DC
+ vpx_highbd_fdct32x32_1(src_diff, coeff, diff_stride);
+ }
break;
#if CONFIG_EXT_TX
case ADST_DCT:
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
#if CONFIG_VP9_HIGHBITDEPTH
const int bd = (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? xd->bd : 8;
+ if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH && xd->bd == BITDEPTH_10) {
+ shift = 2;
+ }
*out_dist = vp10_highbd_block_error(coeff, dqcoeff, 16 << ss_txfrm_size,
&this_sse, bd) >> shift;
#else
int64_t dc_correct = orig_sse - resd_sse * resd_sse;
#if CONFIG_VP9_HIGHBITDEPTH
dc_correct >>= ((xd->bd - 8) * 2);
-#endif
+ if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH &&
+ xd->bd == BITDEPTH_10) {
+ dc_correct >>= 2;
+ } else {
+ if (tx_size != TX_32X32)
+ dc_correct >>= 2;
+ }
+#else
if (tx_size != TX_32X32)
dc_correct >>= 2;
+#endif
dist = VPXMAX(0, sse - dc_correct);
}