Merge "Merge SB8X8 into the codebase" into experimental
This commit is contained in:
commit
c0504a9b24
1
configure
vendored
1
configure
vendored
@ -249,7 +249,6 @@ EXPERIMENT_LIST="
|
||||
oneshotq
|
||||
multiple_arf
|
||||
code_zerogroup
|
||||
sb8x8
|
||||
non420
|
||||
"
|
||||
CONFIG_LIST="
|
||||
|
@ -83,9 +83,6 @@ typedef enum {
|
||||
D27_PRED, /* Directional 22 deg prediction [anti-clockwise from 0 deg hor] */
|
||||
D63_PRED, /* Directional 67 deg prediction [anti-clockwise from 0 deg hor] */
|
||||
TM_PRED, /* Truemotion prediction */
|
||||
#if !CONFIG_SB8X8
|
||||
I8X8_PRED, /* 8x8 based prediction, each 8x8 has its own mode */
|
||||
#endif
|
||||
I4X4_PRED, /* 4x4 based prediction, each 4x4 has its own mode */
|
||||
NEARESTMV,
|
||||
NEARMV,
|
||||
@ -128,9 +125,6 @@ typedef enum {
|
||||
|
||||
#define VP9_YMODES (I4X4_PRED + 1)
|
||||
#define VP9_UV_MODES (TM_PRED + 1)
|
||||
#if !CONFIG_SB8X8
|
||||
#define VP9_I8X8_MODES (TM_PRED + 1)
|
||||
#endif
|
||||
#define VP9_I32X32_MODES (TM_PRED + 1)
|
||||
|
||||
#define VP9_MVREFS (1 + SPLITMV - NEARESTMV)
|
||||
@ -173,16 +167,6 @@ typedef enum {
|
||||
#define VP9_NKF_BINTRAMODES (VP9_BINTRAMODES) /* 10 */
|
||||
#endif
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
typedef enum {
|
||||
PARTITIONING_16X8 = 0,
|
||||
PARTITIONING_8X16,
|
||||
PARTITIONING_8X8,
|
||||
PARTITIONING_4X4,
|
||||
NB_PARTITIONINGS,
|
||||
} SPLITMV_PARTITIONING_TYPE;
|
||||
#endif
|
||||
|
||||
/* For keyframes, intra block modes are predicted by the (already decoded)
|
||||
modes for the Y blocks to the left and above us; for interframes, there
|
||||
is a single probability table. */
|
||||
@ -209,11 +193,9 @@ typedef enum {
|
||||
static INLINE int b_width_log2(BLOCK_SIZE_TYPE sb_type) {
|
||||
switch (sb_type) {
|
||||
case BLOCK_SIZE_AB4X4: return 0;
|
||||
#if CONFIG_SB8X8
|
||||
case BLOCK_SIZE_SB8X8:
|
||||
case BLOCK_SIZE_SB8X16: return 1;
|
||||
case BLOCK_SIZE_SB16X8:
|
||||
#endif
|
||||
case BLOCK_SIZE_MB16X16:
|
||||
case BLOCK_SIZE_SB16X32: return 2;
|
||||
case BLOCK_SIZE_SB32X16:
|
||||
@ -228,11 +210,9 @@ static INLINE int b_width_log2(BLOCK_SIZE_TYPE sb_type) {
|
||||
static INLINE int b_height_log2(BLOCK_SIZE_TYPE sb_type) {
|
||||
switch (sb_type) {
|
||||
case BLOCK_SIZE_AB4X4: return 0;
|
||||
#if CONFIG_SB8X8
|
||||
case BLOCK_SIZE_SB8X8:
|
||||
case BLOCK_SIZE_SB16X8: return 1;
|
||||
case BLOCK_SIZE_SB8X16:
|
||||
#endif
|
||||
case BLOCK_SIZE_MB16X16:
|
||||
case BLOCK_SIZE_SB32X16: return 2;
|
||||
case BLOCK_SIZE_SB16X32:
|
||||
@ -245,21 +225,13 @@ static INLINE int b_height_log2(BLOCK_SIZE_TYPE sb_type) {
|
||||
}
|
||||
|
||||
static INLINE int mi_width_log2(BLOCK_SIZE_TYPE sb_type) {
|
||||
#if CONFIG_SB8X8
|
||||
int a = b_width_log2(sb_type) - 1;
|
||||
#else
|
||||
int a = b_width_log2(sb_type) - 2;
|
||||
#endif
|
||||
assert(a >= 0);
|
||||
return a;
|
||||
}
|
||||
|
||||
static INLINE int mi_height_log2(BLOCK_SIZE_TYPE sb_type) {
|
||||
#if CONFIG_SB8X8
|
||||
int a = b_height_log2(sb_type) - 1;
|
||||
#else
|
||||
int a = b_height_log2(sb_type) - 2;
|
||||
#endif
|
||||
assert(a >= 0);
|
||||
return a;
|
||||
}
|
||||
@ -277,9 +249,6 @@ typedef struct {
|
||||
|
||||
int mb_mode_context[MAX_REF_FRAMES];
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
SPLITMV_PARTITIONING_TYPE partitioning;
|
||||
#endif
|
||||
unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
|
||||
unsigned char need_to_clamp_mvs;
|
||||
unsigned char need_to_clamp_secondmv;
|
||||
@ -301,7 +270,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
MB_MODE_INFO mbmi;
|
||||
union b_mode_info bmi[16 >> (CONFIG_SB8X8 * 2)];
|
||||
union b_mode_info bmi[4];
|
||||
} MODE_INFO;
|
||||
|
||||
struct scale_factors {
|
||||
@ -443,9 +412,7 @@ typedef struct macroblockd {
|
||||
|
||||
int sb_index; // index of 32x32 block inside the 64x64 block
|
||||
int mb_index; // index of 16x16 block inside the 32x32 block
|
||||
#if CONFIG_SB8X8
|
||||
int b_index; // index of 8x8 block inside the 16x16 block
|
||||
#endif
|
||||
int q_index;
|
||||
|
||||
} MACROBLOCKD;
|
||||
@ -462,11 +429,7 @@ static INLINE void update_partition_context(MACROBLOCKD *xd,
|
||||
if (bsl == 0)
|
||||
return;
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
bs = 1 << (bsl - 1);
|
||||
#else
|
||||
bs = 1 << bsl;
|
||||
#endif
|
||||
|
||||
// update the partition context at the end notes. set partition bits
|
||||
// of block sizes larger than the current one to be one, and partition
|
||||
@ -502,21 +465,13 @@ static INLINE int partition_plane_context(MACROBLOCKD *xd,
|
||||
int above = 0, left = 0, i;
|
||||
int boffset = mi_width_log2(BLOCK_SIZE_SB64X64) - bsl;
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
bs = 1 << (bsl - 1);
|
||||
#else
|
||||
bs = 1 << bsl;
|
||||
#endif
|
||||
|
||||
assert(mi_width_log2(sb_type) == mi_height_log2(sb_type));
|
||||
assert(bsl >= 0);
|
||||
assert(boffset >= 0);
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
bs = 1 << (bsl - 1);
|
||||
#else
|
||||
bs = 1 << bsl;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < bs; i++)
|
||||
above |= (xd->above_seg_context[i] & (1 << boffset));
|
||||
@ -541,10 +496,8 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize,
|
||||
subsize = BLOCK_SIZE_SB64X32;
|
||||
else if (bsize == BLOCK_SIZE_SB32X32)
|
||||
subsize = BLOCK_SIZE_SB32X16;
|
||||
#if CONFIG_SB8X8
|
||||
else if (bsize == BLOCK_SIZE_MB16X16)
|
||||
subsize = BLOCK_SIZE_SB16X8;
|
||||
#endif
|
||||
else
|
||||
assert(0);
|
||||
break;
|
||||
@ -553,10 +506,8 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize,
|
||||
subsize = BLOCK_SIZE_SB32X64;
|
||||
else if (bsize == BLOCK_SIZE_SB32X32)
|
||||
subsize = BLOCK_SIZE_SB16X32;
|
||||
#if CONFIG_SB8X8
|
||||
else if (bsize == BLOCK_SIZE_MB16X16)
|
||||
subsize = BLOCK_SIZE_SB8X16;
|
||||
#endif
|
||||
else
|
||||
assert(0);
|
||||
break;
|
||||
@ -565,10 +516,8 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize,
|
||||
subsize = BLOCK_SIZE_SB32X32;
|
||||
else if (bsize == BLOCK_SIZE_SB32X32)
|
||||
subsize = BLOCK_SIZE_MB16X16;
|
||||
#if CONFIG_SB8X8
|
||||
else if (bsize == BLOCK_SIZE_MB16X16)
|
||||
subsize = BLOCK_SIZE_SB8X8;
|
||||
#endif
|
||||
else
|
||||
assert(0);
|
||||
break;
|
||||
@ -659,42 +608,6 @@ static TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, int ib) {
|
||||
xd->mode_info_context->bmi[ib].as_mode.context :
|
||||
#endif
|
||||
xd->mode_info_context->bmi[ib].as_mode.first);
|
||||
#if !CONFIG_SB8X8
|
||||
} else if (xd->mode_info_context->mbmi.mode == I8X8_PRED &&
|
||||
xd->q_index < ACTIVE_HT) {
|
||||
const int ic = (ib & 10);
|
||||
#if USE_ADST_FOR_I8X8_4X4
|
||||
#if USE_ADST_PERIPHERY_ONLY
|
||||
// Use ADST for periphery blocks only
|
||||
const int inner = ib & 5;
|
||||
tx_type = txfm_map(pred_mode_conv(
|
||||
(MB_PREDICTION_MODE)xd->mode_info_context->bmi[ic].as_mode.first));
|
||||
|
||||
#if USE_ADST_FOR_REMOTE_EDGE
|
||||
if (inner == 5)
|
||||
tx_type = DCT_DCT;
|
||||
#else
|
||||
if (inner == 1) {
|
||||
if (tx_type == ADST_ADST) tx_type = ADST_DCT;
|
||||
else if (tx_type == DCT_ADST) tx_type = DCT_DCT;
|
||||
} else if (inner == 4) {
|
||||
if (tx_type == ADST_ADST) tx_type = DCT_ADST;
|
||||
else if (tx_type == ADST_DCT) tx_type = DCT_DCT;
|
||||
} else if (inner == 5) {
|
||||
tx_type = DCT_DCT;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
// Use ADST
|
||||
b += ic - ib;
|
||||
tx_type = txfm_map(pred_mode_conv(
|
||||
(MB_PREDICTION_MODE)b->bmi.as_mode.first));
|
||||
#endif
|
||||
#else
|
||||
// Use 2D DCT
|
||||
tx_type = DCT_DCT;
|
||||
#endif
|
||||
#endif // !CONFIG_SB8X8
|
||||
} else if (xd->mode_info_context->mbmi.mode <= TM_PRED &&
|
||||
xd->q_index < ACTIVE_HT) {
|
||||
#if USE_ADST_FOR_I16X16_4X4
|
||||
@ -739,15 +652,6 @@ static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd, int ib) {
|
||||
#endif
|
||||
if (ib >= (1 << (wb + hb))) // no chroma adst
|
||||
return tx_type;
|
||||
#if !CONFIG_SB8X8
|
||||
if (xd->mode_info_context->mbmi.mode == I8X8_PRED &&
|
||||
xd->q_index < ACTIVE_HT8) {
|
||||
// TODO(rbultje): MB_PREDICTION_MODE / B_PREDICTION_MODE should be merged
|
||||
// or the relationship otherwise modified to address this type conversion.
|
||||
tx_type = txfm_map(pred_mode_conv(
|
||||
(MB_PREDICTION_MODE)xd->mode_info_context->bmi[ib].as_mode.first));
|
||||
} else
|
||||
#endif // CONFIG_SB8X8
|
||||
if (xd->mode_info_context->mbmi.mode <= TM_PRED &&
|
||||
xd->q_index < ACTIVE_HT8) {
|
||||
#if USE_ADST_FOR_I16X16_8X8
|
||||
@ -821,9 +725,6 @@ void vp9_setup_block_dptrs(MACROBLOCKD *xd);
|
||||
static TX_SIZE get_uv_tx_size(const MACROBLOCKD *xd) {
|
||||
MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
|
||||
const TX_SIZE size = mbmi->txfm_size;
|
||||
#if !CONFIG_SB8X8
|
||||
const MB_PREDICTION_MODE mode = mbmi->mode;
|
||||
#endif // !CONFIG_SB8X8
|
||||
|
||||
switch (mbmi->sb_type) {
|
||||
case BLOCK_SIZE_SB64X64:
|
||||
@ -835,7 +736,6 @@ static TX_SIZE get_uv_tx_size(const MACROBLOCKD *xd) {
|
||||
return TX_16X16;
|
||||
else
|
||||
return size;
|
||||
#if CONFIG_SB8X8
|
||||
case BLOCK_SIZE_SB32X16:
|
||||
case BLOCK_SIZE_SB16X32:
|
||||
case BLOCK_SIZE_MB16X16:
|
||||
@ -845,15 +745,6 @@ static TX_SIZE get_uv_tx_size(const MACROBLOCKD *xd) {
|
||||
return size;
|
||||
default:
|
||||
return TX_4X4;
|
||||
#else // CONFIG_SB8X8
|
||||
default:
|
||||
if (size == TX_16X16)
|
||||
return TX_8X8;
|
||||
else if (size == TX_8X8 && (mode == I8X8_PRED || mode == SPLITMV))
|
||||
return TX_4X4;
|
||||
else
|
||||
return size;
|
||||
#endif // CONFIG_SB8X8
|
||||
}
|
||||
|
||||
return size;
|
||||
@ -891,9 +782,6 @@ typedef void (*foreach_transformed_block_visitor)(int plane, int block,
|
||||
void *arg);
|
||||
static INLINE void foreach_transformed_block_in_plane(
|
||||
const MACROBLOCKD* const xd, BLOCK_SIZE_TYPE bsize, int plane,
|
||||
#if !CONFIG_SB8X8
|
||||
int is_split,
|
||||
#endif // !CONFIG_SB8X8
|
||||
foreach_transformed_block_visitor visit, void *arg) {
|
||||
const int bw = b_width_log2(bsize), bh = b_height_log2(bsize);
|
||||
|
||||
@ -913,9 +801,6 @@ static INLINE void foreach_transformed_block_in_plane(
|
||||
const int ss_max = MAX(xd->plane[plane].subsampling_x,
|
||||
xd->plane[plane].subsampling_y);
|
||||
const int ss_txfrm_size = txfrm_size_b > ss_block_size
|
||||
#if !CONFIG_SB8X8
|
||||
|| is_split
|
||||
#endif // !CONFIG_SB8X8
|
||||
? txfrm_size_b - ss_max * 2
|
||||
: txfrm_size_b;
|
||||
const int step = 1 << ss_txfrm_size;
|
||||
@ -932,24 +817,10 @@ static INLINE void foreach_transformed_block_in_plane(
|
||||
static INLINE void foreach_transformed_block(
|
||||
const MACROBLOCKD* const xd, BLOCK_SIZE_TYPE bsize,
|
||||
foreach_transformed_block_visitor visit, void *arg) {
|
||||
#if !CONFIG_SB8X8
|
||||
const MB_PREDICTION_MODE mode = xd->mode_info_context->mbmi.mode;
|
||||
const int is_split =
|
||||
xd->mode_info_context->mbmi.txfm_size == TX_8X8 &&
|
||||
(mode == I8X8_PRED || mode == SPLITMV);
|
||||
#endif // !CONFIG_SB8X8
|
||||
int plane;
|
||||
|
||||
for (plane = 0; plane < MAX_MB_PLANE; plane++) {
|
||||
#if !CONFIG_SB8X8
|
||||
const int is_split_chroma = is_split &&
|
||||
xd->plane[plane].plane_type == PLANE_TYPE_UV;
|
||||
#endif // !CONFIG_SB8X8
|
||||
|
||||
foreach_transformed_block_in_plane(xd, bsize, plane,
|
||||
#if !CONFIG_SB8X8
|
||||
is_split_chroma,
|
||||
#endif // !CONFIG_SB8X8
|
||||
visit, arg);
|
||||
}
|
||||
}
|
||||
@ -957,19 +828,10 @@ static INLINE void foreach_transformed_block(
|
||||
static INLINE void foreach_transformed_block_uv(
|
||||
const MACROBLOCKD* const xd, BLOCK_SIZE_TYPE bsize,
|
||||
foreach_transformed_block_visitor visit, void *arg) {
|
||||
#if !CONFIG_SB8X8
|
||||
const MB_PREDICTION_MODE mode = xd->mode_info_context->mbmi.mode;
|
||||
const int is_split =
|
||||
xd->mode_info_context->mbmi.txfm_size == TX_8X8 &&
|
||||
(mode == I8X8_PRED || mode == SPLITMV);
|
||||
#endif // !CONFIG_SB8X8
|
||||
int plane;
|
||||
|
||||
for (plane = 1; plane < MAX_MB_PLANE; plane++) {
|
||||
foreach_transformed_block_in_plane(xd, bsize, plane,
|
||||
#if !CONFIG_SB8X8
|
||||
is_split,
|
||||
#endif // !CONFIG_SB8X8
|
||||
visit, arg);
|
||||
}
|
||||
}
|
||||
@ -997,16 +859,8 @@ static INLINE void foreach_predicted_block_in_plane(
|
||||
int pred_w, pred_h;
|
||||
|
||||
if (mode == SPLITMV) {
|
||||
#if CONFIG_SB8X8
|
||||
pred_w = 0;
|
||||
pred_h = 0;
|
||||
#else
|
||||
// 4x4 or 8x8
|
||||
const int is_4x4 =
|
||||
(xd->mode_info_context->mbmi.partitioning == PARTITIONING_4X4);
|
||||
pred_w = is_4x4 ? 0 : 1 >> xd->plane[plane].subsampling_x;
|
||||
pred_h = is_4x4 ? 0 : 1 >> xd->plane[plane].subsampling_y;
|
||||
#endif
|
||||
} else {
|
||||
pred_w = bw;
|
||||
pred_h = bh;
|
||||
@ -1099,13 +953,6 @@ static TX_SIZE tx_size_for_plane(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize,
|
||||
return xd->mode_info_context->mbmi.txfm_size;
|
||||
} else {
|
||||
const int bw = b_width_log2(bsize), bh = b_height_log2(bsize);
|
||||
#if !CONFIG_SB8X8
|
||||
const MB_PREDICTION_MODE mode = xd->mode_info_context->mbmi.mode;
|
||||
const int is_split =
|
||||
xd->mode_info_context->mbmi.txfm_size == TX_8X8 &&
|
||||
(mode == I8X8_PRED || mode == SPLITMV);
|
||||
#endif
|
||||
|
||||
// block and transform sizes, in number of 4x4 blocks log 2 ("*_b")
|
||||
// 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
|
||||
const TX_SIZE tx_size = xd->mode_info_context->mbmi.txfm_size;
|
||||
@ -1122,9 +969,6 @@ static TX_SIZE tx_size_for_plane(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize,
|
||||
const int ss_max = MAX(xd->plane[plane].subsampling_x,
|
||||
xd->plane[plane].subsampling_y);
|
||||
const int ss_txfrm_size = txfrm_size_b > ss_block_size
|
||||
#if !CONFIG_SB8X8
|
||||
|| is_split
|
||||
#endif // !CONFIG_SB8X8
|
||||
? txfrm_size_b - ss_max * 2
|
||||
: txfrm_size_b;
|
||||
return (TX_SIZE)(ss_txfrm_size / 2);
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
|
||||
static const unsigned int kf_y_mode_cts[8][VP9_YMODES] = {
|
||||
#if CONFIG_SB8X8
|
||||
/* DC V H D45 135 117 153 D27 D63 TM i4X4 */
|
||||
{12, 6, 5, 5, 5, 5, 5, 5, 5, 2, 200},
|
||||
{25, 13, 13, 7, 7, 7, 7, 7, 7, 6, 160},
|
||||
@ -26,27 +25,11 @@ static const unsigned int kf_y_mode_cts[8][VP9_YMODES] = {
|
||||
{68, 33, 35, 8, 8, 8, 8, 8, 8, 17, 68},
|
||||
{78, 38, 38, 8, 8, 8, 8, 8, 8, 19, 52},
|
||||
{89, 42, 42, 8, 8, 8, 8, 8, 8, 21, 34},
|
||||
#else
|
||||
/* DC V H D45 135 117 153 D27 D63 TM i8x8 i4X4 */
|
||||
{12, 6, 5, 5, 5, 5, 5, 5, 5, 2, 22, 200},
|
||||
{25, 13, 13, 7, 7, 7, 7, 7, 7, 6, 27, 160},
|
||||
{31, 17, 18, 8, 8, 8, 8, 8, 8, 9, 26, 139},
|
||||
{40, 22, 23, 8, 8, 8, 8, 8, 8, 12, 27, 116},
|
||||
{53, 26, 28, 8, 8, 8, 8, 8, 8, 13, 26, 94},
|
||||
{68, 33, 35, 8, 8, 8, 8, 8, 8, 17, 20, 68},
|
||||
{78, 38, 38, 8, 8, 8, 8, 8, 8, 19, 16, 52},
|
||||
{89, 42, 42, 8, 8, 8, 8, 8, 8, 21, 12, 34},
|
||||
#endif
|
||||
};
|
||||
|
||||
static const unsigned int y_mode_cts [VP9_YMODES] = {
|
||||
#if CONFIG_SB8X8
|
||||
/* DC V H D45 135 117 153 D27 D63 TM i4X4 */
|
||||
98, 19, 15, 14, 14, 14, 14, 12, 12, 13, 70
|
||||
#else
|
||||
/* DC V H D45 135 117 153 D27 D63 TM i8x8 i4X4 */
|
||||
98, 19, 15, 14, 14, 14, 14, 12, 12, 13, 16, 70
|
||||
#endif
|
||||
};
|
||||
|
||||
static const unsigned int uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = {
|
||||
@ -61,19 +44,9 @@ static const unsigned int uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = {
|
||||
{ 150, 15, 10, 10, 10, 10, 10, 75, 10, 6}, /* D27 */
|
||||
{ 150, 15, 10, 10, 10, 10, 10, 10, 75, 6}, /* D63 */
|
||||
{ 160, 30, 30, 10, 10, 10, 10, 10, 10, 16}, /* TM */
|
||||
#if !CONFIG_SB8X8
|
||||
{ 132, 46, 40, 10, 10, 10, 10, 10, 10, 18}, /* i8x8 - never used */
|
||||
#endif
|
||||
{ 150, 35, 41, 10, 10, 10, 10, 10, 10, 10}, /* i4X4 */
|
||||
};
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
static const unsigned int i8x8_mode_cts [VP9_I8X8_MODES] = {
|
||||
/* DC V H D45 135 117 153 D27 D63 TM */
|
||||
73, 49, 61, 30, 30, 30, 30, 30, 30, 13
|
||||
};
|
||||
#endif
|
||||
|
||||
static const unsigned int kf_uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = {
|
||||
// DC V H D45 135 117 153 D27 D63 TM
|
||||
{ 160, 24, 24, 20, 20, 20, 20, 20, 20, 8}, /* DC */
|
||||
@ -86,9 +59,6 @@ static const unsigned int kf_uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = {
|
||||
{ 102, 33, 20, 20, 20, 20, 20, 64, 20, 14}, /* D27 */
|
||||
{ 102, 33, 20, 20, 20, 20, 20, 20, 64, 14}, /* D63 */
|
||||
{ 132, 36, 30, 20, 20, 20, 20, 20, 20, 18}, /* TM */
|
||||
#if !CONFIG_SB8X8
|
||||
{ 122, 41, 35, 20, 20, 20, 20, 20, 20, 18}, /* i8x8 - never used */
|
||||
#endif
|
||||
{ 122, 41, 35, 20, 20, 20, 20, 20, 20, 18}, /* I4X4 */
|
||||
};
|
||||
|
||||
@ -146,45 +116,13 @@ const vp9_prob vp9_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP9_SUBMVREFS - 1] = {
|
||||
{ 208, 1, 1 }
|
||||
};
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_mbsplit vp9_mbsplits [VP9_NUMMBSPLITS] = {
|
||||
{
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
1, 1, 1, 1,
|
||||
1, 1, 1, 1,
|
||||
}, {
|
||||
0, 0, 1, 1,
|
||||
0, 0, 1, 1,
|
||||
0, 0, 1, 1,
|
||||
0, 0, 1, 1,
|
||||
}, {
|
||||
0, 0, 1, 1,
|
||||
0, 0, 1, 1,
|
||||
2, 2, 3, 3,
|
||||
2, 2, 3, 3,
|
||||
}, {
|
||||
0, 1, 2, 3,
|
||||
4, 5, 6, 7,
|
||||
8, 9, 10, 11,
|
||||
12, 13, 14, 15,
|
||||
},
|
||||
};
|
||||
|
||||
const int vp9_mbsplit_count [VP9_NUMMBSPLITS] = { 2, 2, 4, 16};
|
||||
|
||||
const vp9_prob vp9_mbsplit_probs [VP9_NUMMBSPLITS - 1] = { 110, 111, 150};
|
||||
#endif
|
||||
|
||||
const vp9_prob vp9_partition_probs[NUM_PARTITION_CONTEXTS]
|
||||
[PARTITION_TYPES - 1] = {
|
||||
#if CONFIG_SB8X8
|
||||
// FIXME(jingning,rbultje) put real probabilities here
|
||||
{202, 162, 107},
|
||||
{16, 2, 169},
|
||||
{3, 246, 19},
|
||||
{104, 90, 134},
|
||||
#endif
|
||||
{202, 162, 107},
|
||||
{16, 2, 169},
|
||||
{3, 246, 19},
|
||||
@ -260,12 +198,7 @@ const vp9_tree_index vp9_ymode_tree[VP9_YMODES * 2 - 2] = {
|
||||
-D27_PRED, -D63_PRED,
|
||||
16, 18,
|
||||
-V_PRED, -H_PRED,
|
||||
#if CONFIG_SB8X8
|
||||
-TM_PRED, -I4X4_PRED
|
||||
#else
|
||||
-TM_PRED, 20,
|
||||
-I4X4_PRED, -I8X8_PRED
|
||||
#endif
|
||||
};
|
||||
|
||||
const vp9_tree_index vp9_kf_ymode_tree[VP9_YMODES * 2 - 2] = {
|
||||
@ -278,28 +211,9 @@ const vp9_tree_index vp9_kf_ymode_tree[VP9_YMODES * 2 - 2] = {
|
||||
-D27_PRED, -D63_PRED,
|
||||
16, 18,
|
||||
-V_PRED, -H_PRED,
|
||||
#if CONFIG_SB8X8
|
||||
-TM_PRED, -I4X4_PRED
|
||||
#else
|
||||
-TM_PRED, 20,
|
||||
-I4X4_PRED, -I8X8_PRED
|
||||
#endif
|
||||
};
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
const vp9_tree_index vp9_i8x8_mode_tree[VP9_I8X8_MODES * 2 - 2] = {
|
||||
2, 14,
|
||||
-DC_PRED, 4,
|
||||
6, 8,
|
||||
-D45_PRED, -D135_PRED,
|
||||
10, 12,
|
||||
-D117_PRED, -D153_PRED,
|
||||
-D27_PRED, -D63_PRED,
|
||||
-V_PRED, 16,
|
||||
-H_PRED, -TM_PRED
|
||||
};
|
||||
#endif
|
||||
|
||||
const vp9_tree_index vp9_uv_mode_tree[VP9_UV_MODES * 2 - 2] = {
|
||||
2, 14,
|
||||
-DC_PRED, 4,
|
||||
@ -312,14 +226,6 @@ const vp9_tree_index vp9_uv_mode_tree[VP9_UV_MODES * 2 - 2] = {
|
||||
-H_PRED, -TM_PRED
|
||||
};
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
const vp9_tree_index vp9_mbsplit_tree[6] = {
|
||||
-PARTITIONING_4X4, 2,
|
||||
-PARTITIONING_8X8, 4,
|
||||
-PARTITIONING_16X8, -PARTITIONING_8X16,
|
||||
};
|
||||
#endif
|
||||
|
||||
const vp9_tree_index vp9_mv_ref_tree[8] = {
|
||||
-ZEROMV, 2,
|
||||
-NEARESTMV, 4,
|
||||
@ -352,10 +258,6 @@ struct vp9_token vp9_sb_ymode_encodings[VP9_I32X32_MODES];
|
||||
struct vp9_token vp9_sb_kf_ymode_encodings[VP9_I32X32_MODES];
|
||||
struct vp9_token vp9_kf_ymode_encodings[VP9_YMODES];
|
||||
struct vp9_token vp9_uv_mode_encodings[VP9_UV_MODES];
|
||||
#if !CONFIG_SB8X8
|
||||
struct vp9_token vp9_i8x8_mode_encodings[VP9_I8X8_MODES];
|
||||
struct vp9_token vp9_mbsplit_encodings[VP9_NUMMBSPLITS];
|
||||
#endif
|
||||
|
||||
struct vp9_token vp9_mv_ref_encoding_array[VP9_MVREFS];
|
||||
struct vp9_token vp9_sb_mv_ref_encoding_array[VP9_MVREFS];
|
||||
@ -386,16 +288,8 @@ void vp9_init_mbmode_probs(VP9_COMMON *x) {
|
||||
bct, uv_mode_cts[i], 0);
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_tree_probs_from_distribution(vp9_i8x8_mode_tree, x->fc.i8x8_mode_prob,
|
||||
bct, i8x8_mode_cts, 0);
|
||||
#endif
|
||||
|
||||
vpx_memcpy(x->fc.sub_mv_ref_prob, vp9_sub_mv_ref_prob2,
|
||||
sizeof(vp9_sub_mv_ref_prob2));
|
||||
#if !CONFIG_SB8X8
|
||||
vpx_memcpy(x->fc.mbsplit_prob, vp9_mbsplit_probs, sizeof(vp9_mbsplit_probs));
|
||||
#endif
|
||||
vpx_memcpy(x->fc.switchable_interp_prob, vp9_switchable_interp_prob,
|
||||
sizeof(vp9_switchable_interp_prob));
|
||||
|
||||
@ -499,10 +393,6 @@ void vp9_entropy_mode_init() {
|
||||
vp9_tokens_from_tree(vp9_sb_ymode_encodings, vp9_sb_ymode_tree);
|
||||
vp9_tokens_from_tree(vp9_sb_kf_ymode_encodings, vp9_sb_kf_ymode_tree);
|
||||
vp9_tokens_from_tree(vp9_uv_mode_encodings, vp9_uv_mode_tree);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_tokens_from_tree(vp9_i8x8_mode_encodings, vp9_i8x8_mode_tree);
|
||||
vp9_tokens_from_tree(vp9_mbsplit_encodings, vp9_mbsplit_tree);
|
||||
#endif
|
||||
vp9_tokens_from_tree(vp9_switchable_interp_encodings,
|
||||
vp9_switchable_interp_tree);
|
||||
vp9_tokens_from_tree(vp9_partition_encodings, vp9_partition_tree);
|
||||
@ -681,11 +571,6 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
|
||||
update_mode_probs(VP9_NKF_BINTRAMODES, vp9_bmode_tree,
|
||||
fc->bmode_counts, fc->pre_bmode_prob,
|
||||
fc->bmode_prob, 0);
|
||||
#if !CONFIG_SB8X8
|
||||
update_mode_probs(VP9_I8X8_MODES,
|
||||
vp9_i8x8_mode_tree, fc->i8x8_mode_counts,
|
||||
fc->pre_i8x8_mode_prob, fc->i8x8_mode_prob, 0);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < SUBMVREF_COUNT; ++i)
|
||||
update_mode_probs(VP9_SUBMVREFS,
|
||||
@ -693,11 +578,6 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
|
||||
fc->pre_sub_mv_ref_prob[i], fc->sub_mv_ref_prob[i],
|
||||
LEFT4X4);
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
update_mode_probs(VP9_NUMMBSPLITS, vp9_mbsplit_tree,
|
||||
fc->mbsplit_counts, fc->pre_mbsplit_prob,
|
||||
fc->mbsplit_prob, 0);
|
||||
#endif
|
||||
#if CONFIG_COMP_INTERINTRA_PRED
|
||||
if (cm->use_interintra) {
|
||||
int factor, interintra_prob, count;
|
||||
|
@ -15,9 +15,6 @@
|
||||
#include "vp9/common/vp9_treecoder.h"
|
||||
|
||||
#define SUBMVREF_COUNT 5
|
||||
#if !CONFIG_SB8X8
|
||||
#define VP9_NUMMBSPLITS 4
|
||||
#endif
|
||||
|
||||
#if CONFIG_COMP_INTERINTRA_PRED
|
||||
#define VP9_DEF_INTERINTRA_PROB 248
|
||||
@ -26,16 +23,6 @@
|
||||
#define SEPARATE_INTERINTRA_UV 0
|
||||
#endif
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
typedef const int vp9_mbsplit[16];
|
||||
|
||||
extern vp9_mbsplit vp9_mbsplits[VP9_NUMMBSPLITS];
|
||||
|
||||
extern const int vp9_mbsplit_count[VP9_NUMMBSPLITS]; /* # of subsets */
|
||||
|
||||
extern const vp9_prob vp9_mbsplit_probs[VP9_NUMMBSPLITS - 1];
|
||||
#endif
|
||||
|
||||
extern int vp9_mv_cont(const int_mv *l, const int_mv *a);
|
||||
|
||||
extern const vp9_prob vp9_sub_mv_ref_prob2[SUBMVREF_COUNT][VP9_SUBMVREFS - 1];
|
||||
@ -52,10 +39,6 @@ extern const vp9_tree_index vp9_kf_ymode_tree[];
|
||||
extern const vp9_tree_index vp9_uv_mode_tree[];
|
||||
#define vp9_sb_ymode_tree vp9_uv_mode_tree
|
||||
#define vp9_sb_kf_ymode_tree vp9_uv_mode_tree
|
||||
#if !CONFIG_SB8X8
|
||||
extern const vp9_tree_index vp9_i8x8_mode_tree[];
|
||||
extern const vp9_tree_index vp9_mbsplit_tree[];
|
||||
#endif
|
||||
extern const vp9_tree_index vp9_mv_ref_tree[];
|
||||
extern const vp9_tree_index vp9_sb_mv_ref_tree[];
|
||||
extern const vp9_tree_index vp9_sub_mv_ref_tree[];
|
||||
@ -67,10 +50,6 @@ extern struct vp9_token vp9_sb_ymode_encodings[VP9_I32X32_MODES];
|
||||
extern struct vp9_token vp9_sb_kf_ymode_encodings[VP9_I32X32_MODES];
|
||||
extern struct vp9_token vp9_kf_ymode_encodings[VP9_YMODES];
|
||||
extern struct vp9_token vp9_uv_mode_encodings[VP9_UV_MODES];
|
||||
#if !CONFIG_SB8X8
|
||||
extern struct vp9_token vp9_i8x8_mode_encodings[VP9_I8X8_MODES];
|
||||
extern struct vp9_token vp9_mbsplit_encodings[VP9_NUMMBSPLITS];
|
||||
#endif
|
||||
|
||||
/* Inter mode values do not start at zero */
|
||||
|
||||
|
@ -13,22 +13,16 @@
|
||||
|
||||
#include "./vpx_config.h"
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
#define LOG2_MI_SIZE 3
|
||||
#else
|
||||
#define LOG2_MI_SIZE 4
|
||||
#endif
|
||||
|
||||
#define MI_SIZE (1 << LOG2_MI_SIZE)
|
||||
#define MI_UV_SIZE (1 << (LOG2_MI_SIZE - 1))
|
||||
|
||||
typedef enum BLOCK_SIZE_TYPE {
|
||||
BLOCK_SIZE_AB4X4,
|
||||
#if CONFIG_SB8X8
|
||||
BLOCK_SIZE_SB8X8,
|
||||
BLOCK_SIZE_SB8X16,
|
||||
BLOCK_SIZE_SB16X8,
|
||||
#endif
|
||||
BLOCK_SIZE_MB16X16,
|
||||
BLOCK_SIZE_SB16X32,
|
||||
BLOCK_SIZE_SB32X16,
|
||||
@ -47,6 +41,6 @@ typedef enum PARTITION_TYPE {
|
||||
} PARTITION_TYPE;
|
||||
|
||||
#define PARTITION_PLOFFSET 4 // number of probability models per block size
|
||||
#define NUM_PARTITION_CONTEXTS ((2 + CONFIG_SB8X8) * PARTITION_PLOFFSET)
|
||||
#define NUM_PARTITION_CONTEXTS (3 * PARTITION_PLOFFSET)
|
||||
|
||||
#endif // VP9_COMMON_VP9_ENUMS_H_
|
||||
|
@ -74,13 +74,9 @@ vp9_prob *vp9_mv_ref_probs(VP9_COMMON *pc,
|
||||
vp9_prob p[VP9_MVREFS - 1],
|
||||
const int context);
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
extern const uint8_t vp9_mbsplit_offset[4][16];
|
||||
#endif
|
||||
|
||||
static int left_block_mv(const MACROBLOCKD *xd,
|
||||
const MODE_INFO *cur_mb, int b) {
|
||||
if (!(b & (3 >> CONFIG_SB8X8))) {
|
||||
if (!(b & 1)) {
|
||||
if (!xd->left_available)
|
||||
return 0;
|
||||
|
||||
@ -90,7 +86,7 @@ static int left_block_mv(const MACROBLOCKD *xd,
|
||||
if (cur_mb->mbmi.mode != SPLITMV)
|
||||
return cur_mb->mbmi.mv[0].as_int;
|
||||
|
||||
b += 4 >> CONFIG_SB8X8;
|
||||
b += 2;
|
||||
}
|
||||
|
||||
return (cur_mb->bmi + b - 1)->as_mv[0].as_int;
|
||||
@ -98,7 +94,7 @@ static int left_block_mv(const MACROBLOCKD *xd,
|
||||
|
||||
static int left_block_second_mv(const MACROBLOCKD *xd,
|
||||
const MODE_INFO *cur_mb, int b) {
|
||||
if (!(b & (3 >> CONFIG_SB8X8))) {
|
||||
if (!(b & 1)) {
|
||||
if (!xd->left_available)
|
||||
return 0;
|
||||
|
||||
@ -108,7 +104,7 @@ static int left_block_second_mv(const MACROBLOCKD *xd,
|
||||
if (cur_mb->mbmi.mode != SPLITMV)
|
||||
return cur_mb->mbmi.second_ref_frame > 0 ?
|
||||
cur_mb->mbmi.mv[1].as_int : cur_mb->mbmi.mv[0].as_int;
|
||||
b += 4 >> CONFIG_SB8X8;
|
||||
b += 2;
|
||||
}
|
||||
|
||||
return cur_mb->mbmi.second_ref_frame > 0 ?
|
||||
@ -117,85 +113,69 @@ static int left_block_second_mv(const MACROBLOCKD *xd,
|
||||
}
|
||||
|
||||
static int above_block_mv(const MODE_INFO *cur_mb, int b, int mi_stride) {
|
||||
if (!(b >> (2 >> CONFIG_SB8X8))) {
|
||||
if (!(b >> 1)) {
|
||||
/* On top edge, get from MB above us */
|
||||
cur_mb -= mi_stride;
|
||||
|
||||
if (cur_mb->mbmi.mode != SPLITMV)
|
||||
return cur_mb->mbmi.mv[0].as_int;
|
||||
b += 16 >> (2 * CONFIG_SB8X8);
|
||||
b += 4;
|
||||
}
|
||||
|
||||
return (cur_mb->bmi + b - (4 >> CONFIG_SB8X8))->as_mv[0].as_int;
|
||||
return (cur_mb->bmi + b - 2)->as_mv[0].as_int;
|
||||
}
|
||||
|
||||
static int above_block_second_mv(const MODE_INFO *cur_mb, int b, int mi_stride) {
|
||||
if (!(b >> (2 >> CONFIG_SB8X8))) {
|
||||
if (!(b >> 1)) {
|
||||
/* On top edge, get from MB above us */
|
||||
cur_mb -= mi_stride;
|
||||
|
||||
if (cur_mb->mbmi.mode != SPLITMV)
|
||||
return cur_mb->mbmi.second_ref_frame > 0 ?
|
||||
cur_mb->mbmi.mv[1].as_int : cur_mb->mbmi.mv[0].as_int;
|
||||
b += 16 >> (2 * CONFIG_SB8X8);
|
||||
b += 4;
|
||||
}
|
||||
|
||||
return cur_mb->mbmi.second_ref_frame > 0 ?
|
||||
(cur_mb->bmi + b - (4 >> CONFIG_SB8X8))->as_mv[1].as_int :
|
||||
(cur_mb->bmi + b - (4 >> CONFIG_SB8X8))->as_mv[0].as_int;
|
||||
(cur_mb->bmi + b - 2)->as_mv[1].as_int :
|
||||
(cur_mb->bmi + b - 2)->as_mv[0].as_int;
|
||||
}
|
||||
|
||||
static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) {
|
||||
#if CONFIG_SB8X8
|
||||
// FIXME(rbultje, jingning): temporary hack because jenkins doesn't
|
||||
// understand this condition. This will go away soon.
|
||||
if (b == 0 || b == 2) {
|
||||
#else
|
||||
if (!(b & (3 >> CONFIG_SB8X8))) {
|
||||
#endif
|
||||
/* On L edge, get from MB to left of us */
|
||||
--cur_mb;
|
||||
|
||||
if (cur_mb->mbmi.mode <= TM_PRED) {
|
||||
return pred_mode_conv(cur_mb->mbmi.mode);
|
||||
#if !CONFIG_SB8X8
|
||||
} else if (cur_mb->mbmi.mode == I8X8_PRED) {
|
||||
return pred_mode_conv(
|
||||
(MB_PREDICTION_MODE)(cur_mb->bmi + 3 + b)->as_mode.first);
|
||||
#endif // !CONFIG_SB8X8
|
||||
} else if (cur_mb->mbmi.mode == I4X4_PRED) {
|
||||
return ((cur_mb->bmi + (3 >> CONFIG_SB8X8) + b)->as_mode.first);
|
||||
return ((cur_mb->bmi + 1 + b)->as_mode.first);
|
||||
} else {
|
||||
return B_DC_PRED;
|
||||
}
|
||||
}
|
||||
#if CONFIG_SB8X8
|
||||
assert(b == 1 || b == 3);
|
||||
#endif
|
||||
return (cur_mb->bmi + b - 1)->as_mode.first;
|
||||
}
|
||||
|
||||
static B_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb,
|
||||
int b, int mi_stride) {
|
||||
if (!(b >> (2 >> CONFIG_SB8X8))) {
|
||||
if (!(b >> 1)) {
|
||||
/* On top edge, get from MB above us */
|
||||
cur_mb -= mi_stride;
|
||||
|
||||
if (cur_mb->mbmi.mode <= TM_PRED) {
|
||||
return pred_mode_conv(cur_mb->mbmi.mode);
|
||||
#if !CONFIG_SB8X8
|
||||
} else if (cur_mb->mbmi.mode == I8X8_PRED) {
|
||||
return pred_mode_conv(
|
||||
(MB_PREDICTION_MODE)(cur_mb->bmi + 12 + b)->as_mode.first);
|
||||
#endif
|
||||
} else if (cur_mb->mbmi.mode == I4X4_PRED) {
|
||||
return ((cur_mb->bmi + (CONFIG_SB8X8 ? 2 : 12) + b)->as_mode.first);
|
||||
return ((cur_mb->bmi + 2 + b)->as_mode.first);
|
||||
} else {
|
||||
return B_DC_PRED;
|
||||
}
|
||||
}
|
||||
|
||||
return (cur_mb->bmi + b - (4 >> CONFIG_SB8X8))->as_mode.first;
|
||||
return (cur_mb->bmi + b - 2)->as_mode.first;
|
||||
}
|
||||
|
||||
#endif // VP9_COMMON_VP9_FINDNEARMV_H_
|
||||
|
@ -27,9 +27,6 @@ static void lf_init_lut(loop_filter_info_n *lfi) {
|
||||
lfi->mode_lf_lut[H_PRED] = 1;
|
||||
lfi->mode_lf_lut[TM_PRED] = 1;
|
||||
lfi->mode_lf_lut[I4X4_PRED] = 0;
|
||||
#if !CONFIG_SB8X8
|
||||
lfi->mode_lf_lut[I8X8_PRED] = 0;
|
||||
#endif
|
||||
lfi->mode_lf_lut[ZEROMV] = 1;
|
||||
lfi->mode_lf_lut[NEARESTMV] = 2;
|
||||
lfi->mode_lf_lut[NEARMV] = 2;
|
||||
@ -169,12 +166,7 @@ void vp9_loop_filter_frame_init(VP9_COMMON *cm,
|
||||
static int mb_lf_skip(const MB_MODE_INFO *const mbmi) {
|
||||
const int skip_coef = mbmi->mb_skip_coeff;
|
||||
const int tx_size = mbmi->txfm_size;
|
||||
#if CONFIG_SB8X8
|
||||
return mbmi->sb_type >= BLOCK_SIZE_MB16X16 &&
|
||||
#else
|
||||
const MB_PREDICTION_MODE mode = mbmi->mode;
|
||||
return mode != I4X4_PRED && mode != I8X8_PRED && mode != SPLITMV &&
|
||||
#endif
|
||||
(tx_size >= TX_16X16 || skip_coef);
|
||||
}
|
||||
|
||||
@ -227,11 +219,7 @@ static void lpf_mb(VP9_COMMON *cm, const MODE_INFO *mi,
|
||||
if (!skip_lf) {
|
||||
if (tx_size >= TX_8X8) {
|
||||
if (tx_size == TX_8X8 &&
|
||||
#if CONFIG_SB8X8
|
||||
(mi->mbmi.sb_type < BLOCK_SIZE_MB16X16)
|
||||
#else
|
||||
(mode == I8X8_PRED || mode == SPLITMV)
|
||||
#endif
|
||||
)
|
||||
vp9_loop_filter_bh8x8(y_ptr, u_ptr, v_ptr,
|
||||
y_stride, uv_stride, &lfi);
|
||||
@ -257,12 +245,7 @@ static void lpf_mb(VP9_COMMON *cm, const MODE_INFO *mi,
|
||||
if (!skip_lf) {
|
||||
if (tx_size >= TX_8X8) {
|
||||
if (tx_size == TX_8X8 &&
|
||||
#if CONFIG_SB8X8
|
||||
(mi->mbmi.sb_type < BLOCK_SIZE_MB16X16)
|
||||
#else
|
||||
(mode == I8X8_PRED || mode == SPLITMV)
|
||||
#endif
|
||||
)
|
||||
(mi->mbmi.sb_type < BLOCK_SIZE_MB16X16))
|
||||
vp9_loop_filter_bv8x8(y_ptr, u_ptr, v_ptr,
|
||||
y_stride, uv_stride, &lfi);
|
||||
else
|
||||
@ -322,7 +305,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
|
||||
y_only? 0 : v_ptr,
|
||||
y_stride, uv_stride, dering);
|
||||
// process 2nd MB top-right
|
||||
mi = mode_info_context + (1 << CONFIG_SB8X8);
|
||||
mi = mode_info_context + 2;
|
||||
do_left_v = !(wbl >= 3 /* 32x16 or >=32x32 */ && (tx_size >= TX_32X32 ||
|
||||
sb_mb_lf_skip(mode_info_context, mi)));
|
||||
do_above_h = (mb_row > 0);
|
||||
@ -338,7 +321,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
|
||||
y_stride, uv_stride, dering);
|
||||
|
||||
// process 3rd MB bottom-left
|
||||
mi = mode_info_context + (mis << CONFIG_SB8X8);
|
||||
mi = mode_info_context + (mis << 1);
|
||||
do_left_v = (mb_col > 0);
|
||||
do_above_h = !(hbl >= 3 /* 16x32 or >=32x32 */ && (tx_size >= TX_32X32 ||
|
||||
sb_mb_lf_skip(mode_info_context, mi)));
|
||||
@ -354,15 +337,15 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
|
||||
y_stride, uv_stride, dering);
|
||||
|
||||
// process 4th MB bottom right
|
||||
mi = mode_info_context + ((mis + 1) << CONFIG_SB8X8);
|
||||
mi = mode_info_context + ((mis + 1) << 1);
|
||||
do_left_v = !(wbl >= 3 /* 32x16 or >=32x32 */ && (tx_size >= TX_32X32 ||
|
||||
sb_mb_lf_skip(mi - (1 << CONFIG_SB8X8), mi)));
|
||||
sb_mb_lf_skip(mi - 2, mi)));
|
||||
do_above_h = !(hbl >= 3 /* 16x32 or >=32x32 */ && (tx_size >= TX_32X32 ||
|
||||
sb_mb_lf_skip(mode_info_context + (1 << CONFIG_SB8X8), mi)));
|
||||
sb_mb_lf_skip(mode_info_context + 2, mi)));
|
||||
do_left_v_mbuv = (wbl >= 3 /* 32x16 or >=32x32 */ && (tx_size >= TX_16X16 ||
|
||||
sb_mb_lf_skip(mi - (1 << CONFIG_SB8X8), mi)));
|
||||
sb_mb_lf_skip(mi - 2, mi)));
|
||||
do_above_h_mbuv = !(hbl >= 3 /* 16x32 or >=32x32 */ && (tx_size >= TX_16X16 ||
|
||||
sb_mb_lf_skip(mode_info_context + (1 << CONFIG_SB8X8), mi)));
|
||||
sb_mb_lf_skip(mode_info_context + 2, mi)));
|
||||
lpf_mb(cm, mi, do_left_v, do_above_h,
|
||||
do_left_v_mbuv, do_above_h_mbuv,
|
||||
y_ptr + 16 * y_stride + 16,
|
||||
@ -379,17 +362,16 @@ static void lpf_sb64(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
|
||||
lpf_sb32(cm, mode_info_context, mb_row, mb_col,
|
||||
y_ptr, u_ptr, v_ptr,
|
||||
y_stride, uv_stride, y_only, dering);
|
||||
lpf_sb32(cm, mode_info_context + (2 << CONFIG_SB8X8), mb_row, mb_col + 2,
|
||||
lpf_sb32(cm, mode_info_context + 4, mb_row, mb_col + 2,
|
||||
y_ptr + 32, u_ptr + 16, v_ptr + 16,
|
||||
y_stride, uv_stride, y_only, dering);
|
||||
lpf_sb32(cm, mode_info_context + cm->mode_info_stride * (2 << CONFIG_SB8X8),
|
||||
lpf_sb32(cm, mode_info_context + cm->mode_info_stride * 4,
|
||||
mb_row + 2, mb_col,
|
||||
y_ptr + 32 * y_stride,
|
||||
u_ptr + 16 * uv_stride,
|
||||
v_ptr + 16 * uv_stride,
|
||||
y_stride, uv_stride, y_only, dering);
|
||||
lpf_sb32(cm, mode_info_context + cm->mode_info_stride *
|
||||
(2 << CONFIG_SB8X8) + (2 << CONFIG_SB8X8),
|
||||
lpf_sb32(cm, mode_info_context + cm->mode_info_stride * 4 + 4,
|
||||
mb_row + 2, mb_col + 2,
|
||||
y_ptr + 32 * y_stride + 32,
|
||||
u_ptr + 16 * uv_stride + 16,
|
||||
@ -459,14 +441,14 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
|
||||
y_ptr += 64;
|
||||
u_ptr = y_only? 0 : u_ptr + 32;
|
||||
v_ptr = y_only? 0 : v_ptr + 32;
|
||||
mode_info_context += 4 << CONFIG_SB8X8; // step to next SB64
|
||||
mode_info_context += 8; // step to next SB64
|
||||
}
|
||||
if (extra_sb32_col) {
|
||||
// process 2 SB32s in the extra SB32 col
|
||||
lpf_sb32(cm, mode_info_context, mb_row, mb_col,
|
||||
y_ptr, u_ptr, v_ptr,
|
||||
y_stride, uv_stride, y_only, dering);
|
||||
lpf_sb32(cm, mode_info_context + mis * (2 << CONFIG_SB8X8),
|
||||
lpf_sb32(cm, mode_info_context + mis * 4,
|
||||
mb_row + 2, mb_col,
|
||||
y_ptr + 32 * y_stride,
|
||||
u_ptr + 16 * uv_stride,
|
||||
@ -475,7 +457,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
|
||||
y_ptr += 32;
|
||||
u_ptr = y_only? 0 : u_ptr + 16;
|
||||
v_ptr = y_only? 0 : v_ptr + 16;
|
||||
mode_info_context += 2 << CONFIG_SB8X8; // step to next SB32
|
||||
mode_info_context += 4; // step to next SB32
|
||||
mb_col += 2;
|
||||
}
|
||||
if (extra_mb_col) {
|
||||
@ -493,7 +475,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
|
||||
y_only? 0 : v_ptr,
|
||||
y_stride, uv_stride, dering);
|
||||
// process 2nd MB
|
||||
mi = mode_info_context + (mis << CONFIG_SB8X8);
|
||||
mi = mode_info_context + (mis << 1);
|
||||
do_left_v = (mb_col > 0);
|
||||
do_above_h = 1;
|
||||
do_left_v_mbuv = 1;
|
||||
@ -505,7 +487,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
|
||||
y_only ? 0 : (v_ptr + 8 * uv_stride),
|
||||
y_stride, uv_stride, dering);
|
||||
// process 3nd MB
|
||||
mi = mode_info_context + (mis << CONFIG_SB8X8) * 2;
|
||||
mi = mode_info_context + (mis << 1) * 2;
|
||||
do_left_v = (mb_col > 0);
|
||||
do_above_h = 1;
|
||||
do_left_v_mbuv = 1;
|
||||
@ -517,7 +499,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
|
||||
y_only ? 0 : (v_ptr + 16 * uv_stride),
|
||||
y_stride, uv_stride, dering);
|
||||
// process 4th MB
|
||||
mi = mode_info_context + (mis << CONFIG_SB8X8) * 3;
|
||||
mi = mode_info_context + (mis << 1) * 3;
|
||||
do_left_v = (mb_col > 0);
|
||||
do_above_h = 1;
|
||||
do_left_v_mbuv = 1;
|
||||
@ -531,7 +513,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
|
||||
y_ptr += 16;
|
||||
u_ptr = y_only? 0 : u_ptr + 8;
|
||||
v_ptr = y_only? 0 : v_ptr + 8;
|
||||
mode_info_context += 1 << CONFIG_SB8X8; // step to next MB
|
||||
mode_info_context += 2; // step to next MB
|
||||
}
|
||||
// move pointers to the begining of next sb64 row
|
||||
y_ptr += y_stride * 64 - post->y_width;
|
||||
@ -540,7 +522,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
|
||||
v_ptr += uv_stride * 32 - post->uv_width;
|
||||
}
|
||||
/* skip to next SB64 row */
|
||||
mode_info_context += mis * (4 << CONFIG_SB8X8) - cm->mi_cols;
|
||||
mode_info_context += mis * 8 - cm->mi_cols;
|
||||
}
|
||||
if (extra_sb32_row) {
|
||||
const int sb32_cols = sb64_cols * 2 + extra_sb32_col;
|
||||
@ -551,7 +533,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
|
||||
y_ptr += 32;
|
||||
u_ptr = y_only? 0 : u_ptr + 16;
|
||||
v_ptr = y_only? 0 : v_ptr + 16;
|
||||
mode_info_context += 2 << CONFIG_SB8X8; // step to next SB32
|
||||
mode_info_context += 4; // step to next SB32
|
||||
}
|
||||
if (extra_mb_col) {
|
||||
// process 1st MB
|
||||
@ -567,7 +549,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
|
||||
y_only? NULL : v_ptr,
|
||||
y_stride, uv_stride, dering);
|
||||
// process 2nd MB
|
||||
mi = mode_info_context + (mis << CONFIG_SB8X8);
|
||||
mi = mode_info_context + (mis << 1);
|
||||
do_left_v = (mb_col > 0);
|
||||
do_above_h = 1;
|
||||
do_left_v_mbuv = 1;
|
||||
@ -581,14 +563,14 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
|
||||
y_ptr += 16;
|
||||
u_ptr = y_only? 0 : u_ptr + 8;
|
||||
v_ptr = y_only? 0 : v_ptr + 8;
|
||||
mode_info_context += 1 << CONFIG_SB8X8; /* step to next MB */
|
||||
mode_info_context += 2; /* step to next MB */
|
||||
}
|
||||
// move pointers to the beginning of next sb64 row
|
||||
y_ptr += y_stride * 32 - post->y_width;
|
||||
u_ptr += y_only? 0 : uv_stride * 16 - post->uv_width;
|
||||
v_ptr += y_only? 0 : uv_stride * 16 - post->uv_width;
|
||||
// skip to next MB row if exist
|
||||
mode_info_context += mis * (2 << CONFIG_SB8X8) - cm->mi_cols;
|
||||
mode_info_context += mis * 4 - cm->mi_cols;
|
||||
mb_row += 2;
|
||||
}
|
||||
if (extra_mb_row) {
|
||||
@ -607,7 +589,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
|
||||
y_ptr += 16;
|
||||
u_ptr = y_only? 0 : u_ptr + 8;
|
||||
v_ptr = y_only? 0 : v_ptr + 8;
|
||||
mode_info_context += 1 << CONFIG_SB8X8; // step to next MB
|
||||
mode_info_context += 2; // step to next MB
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
#define MVREF_NEIGHBOURS 8
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
static int b_mv_ref_search[MVREF_NEIGHBOURS][2] = {
|
||||
{0, -1}, {-1, 0}, {-1, -1}, {0, -2},
|
||||
{-2, 0}, {-1, -2}, {-2, -1}, {-2, -2}
|
||||
@ -32,22 +31,6 @@ static int sb64_mv_ref_search[MVREF_NEIGHBOURS][2] = {
|
||||
{0, -1}, {-1, 0}, {2, -1}, {-1, 2},
|
||||
{4, -1}, {-1, 4}, {6, -1}, {-1, -1}
|
||||
};
|
||||
#else
|
||||
static int mb_mv_ref_search[MVREF_NEIGHBOURS][2] = {
|
||||
{0, -1}, {-1, 0}, {-1, -1}, {0, -2},
|
||||
{-2, 0}, {-1, -2}, {-2, -1}, {-2, -2}
|
||||
};
|
||||
|
||||
static int sb_mv_ref_search[MVREF_NEIGHBOURS][2] = {
|
||||
{0, -1}, {-1, 0}, {1, -1}, {-1, 1},
|
||||
{-1, -1}, {0, -2}, {-2, 0}, {-1, -2}
|
||||
};
|
||||
|
||||
static int sb64_mv_ref_search[MVREF_NEIGHBOURS][2] = {
|
||||
{0, -1}, {-1, 0}, {1, -1}, {-1, 1},
|
||||
{2, -1}, {-1, 2}, {3, -1}, {-1, -1}
|
||||
};
|
||||
#endif
|
||||
|
||||
// clamp_mv_ref
|
||||
#define MV_BORDER (16 << 3) // Allow 16 pels in 1/8th pel units
|
||||
@ -190,15 +173,10 @@ void vp9_find_mv_refs(VP9_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *here,
|
||||
mv_ref_search = sb64_mv_ref_search;
|
||||
} else if (mbmi->sb_type >= BLOCK_SIZE_SB32X32) {
|
||||
mv_ref_search = sb_mv_ref_search;
|
||||
#if CONFIG_SB8X8
|
||||
} else if (mbmi->sb_type >= BLOCK_SIZE_MB16X16) {
|
||||
mv_ref_search = mb_mv_ref_search;
|
||||
} else {
|
||||
mv_ref_search = b_mv_ref_search;
|
||||
#else
|
||||
} else {
|
||||
mv_ref_search = mb_mv_ref_search;
|
||||
#endif
|
||||
}
|
||||
|
||||
// We first scan for candidate vectors that match the current reference frame
|
||||
@ -208,7 +186,7 @@ void vp9_find_mv_refs(VP9_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *here,
|
||||
|
||||
if ((mi_search_col >= cm->cur_tile_mi_col_start) &&
|
||||
(mi_search_col < cm->cur_tile_mi_col_end) &&
|
||||
((mv_ref_search[i][1] << (7 - CONFIG_SB8X8)) >= xd->mb_to_top_edge)) {
|
||||
((mv_ref_search[i][1] << 6) >= xd->mb_to_top_edge)) {
|
||||
|
||||
candidate_mi = here + mv_ref_search[i][0] +
|
||||
(mv_ref_search[i][1] * xd->mode_info_stride);
|
||||
@ -228,7 +206,7 @@ void vp9_find_mv_refs(VP9_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *here,
|
||||
|
||||
if ((mi_search_col >= cm->cur_tile_mi_col_start) &&
|
||||
(mi_search_col < cm->cur_tile_mi_col_end) &&
|
||||
((mv_ref_search[i][1] << (7 - CONFIG_SB8X8)) >= xd->mb_to_top_edge)) {
|
||||
((mv_ref_search[i][1] << 6) >= xd->mb_to_top_edge)) {
|
||||
candidate_mi = here + mv_ref_search[i][0] +
|
||||
(mv_ref_search[i][1] * xd->mode_info_stride);
|
||||
|
||||
@ -258,7 +236,7 @@ void vp9_find_mv_refs(VP9_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *here,
|
||||
|
||||
if ((mi_search_col >= cm->cur_tile_mi_col_start) &&
|
||||
(mi_search_col < cm->cur_tile_mi_col_end) &&
|
||||
((mv_ref_search[i][1] << (7 - CONFIG_SB8X8)) >= xd->mb_to_top_edge)) {
|
||||
((mv_ref_search[i][1] << 6) >= xd->mb_to_top_edge)) {
|
||||
candidate_mi = here + mv_ref_search[i][0] +
|
||||
(mv_ref_search[i][1] * xd->mode_info_stride);
|
||||
|
||||
|
@ -55,13 +55,7 @@ typedef struct frame_contexts {
|
||||
vp9_prob ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */
|
||||
vp9_prob sb_ymode_prob[VP9_I32X32_MODES - 1];
|
||||
vp9_prob uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1];
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_prob i8x8_mode_prob[VP9_I8X8_MODES - 1];
|
||||
#endif
|
||||
vp9_prob sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1];
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_prob mbsplit_prob[VP9_NUMMBSPLITS - 1];
|
||||
#endif
|
||||
vp9_prob partition_prob[NUM_PARTITION_CONTEXTS][PARTITION_TYPES - 1];
|
||||
|
||||
vp9_coeff_probs coef_probs_4x4[BLOCK_TYPES];
|
||||
@ -81,25 +75,13 @@ typedef struct frame_contexts {
|
||||
vp9_prob pre_ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */
|
||||
vp9_prob pre_sb_ymode_prob[VP9_I32X32_MODES - 1];
|
||||
vp9_prob pre_uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1];
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_prob pre_i8x8_mode_prob[VP9_I8X8_MODES - 1];
|
||||
#endif
|
||||
vp9_prob pre_sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1];
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_prob pre_mbsplit_prob[VP9_NUMMBSPLITS - 1];
|
||||
#endif
|
||||
vp9_prob pre_partition_prob[NUM_PARTITION_CONTEXTS][PARTITION_TYPES - 1];
|
||||
unsigned int bmode_counts[VP9_NKF_BINTRAMODES];
|
||||
unsigned int ymode_counts[VP9_YMODES]; /* interframe intra mode probs */
|
||||
unsigned int sb_ymode_counts[VP9_I32X32_MODES];
|
||||
unsigned int uv_mode_counts[VP9_YMODES][VP9_UV_MODES];
|
||||
#if !CONFIG_SB8X8
|
||||
unsigned int i8x8_mode_counts[VP9_I8X8_MODES]; /* interframe intra probs */
|
||||
#endif
|
||||
unsigned int sub_mv_ref_counts[SUBMVREF_COUNT][VP9_SUBMVREFS];
|
||||
#if !CONFIG_SB8X8
|
||||
unsigned int mbsplit_counts[VP9_NUMMBSPLITS];
|
||||
#endif
|
||||
unsigned int partition_counts[NUM_PARTITION_CONTEXTS][PARTITION_TYPES];
|
||||
|
||||
vp9_coeff_probs pre_coef_probs_4x4[BLOCK_TYPES];
|
||||
@ -204,8 +186,7 @@ typedef struct VP9Common {
|
||||
|
||||
int frame_flags;
|
||||
// MBs, mb_rows/cols is in 16-pixel units; mi_rows/cols is in
|
||||
// MODE_INFO units (depending on CONFIG_SB8X8, that is either
|
||||
// 16-pixel or 8-pixel)
|
||||
// MODE_INFO (8-pixel) units.
|
||||
int MBs;
|
||||
int mb_rows, mi_rows;
|
||||
int mb_cols, mi_cols;
|
||||
|
@ -34,26 +34,6 @@ void vp9_recon_b_c(uint8_t *pred_ptr, int16_t *diff_ptr, int diff_stride,
|
||||
recon(4, 4, diff_ptr, diff_stride, dst_ptr, stride);
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
void vp9_recon_uv_b_c(uint8_t *pred_ptr, int16_t *diff_ptr, uint8_t *dst_ptr,
|
||||
int stride) {
|
||||
assert(pred_ptr == dst_ptr);
|
||||
recon(4, 4, diff_ptr, 8, dst_ptr, stride);
|
||||
}
|
||||
|
||||
void vp9_recon4b_c(uint8_t *pred_ptr, int16_t *diff_ptr, uint8_t *dst_ptr,
|
||||
int stride) {
|
||||
assert(pred_ptr == dst_ptr);
|
||||
recon(4, 16, diff_ptr, 16, dst_ptr, stride);
|
||||
}
|
||||
|
||||
void vp9_recon2b_c(uint8_t *pred_ptr, int16_t *diff_ptr, uint8_t *dst_ptr,
|
||||
int stride) {
|
||||
assert(pred_ptr == dst_ptr);
|
||||
recon(4, 8, diff_ptr, 8, dst_ptr, stride);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void recon_plane(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize, int plane) {
|
||||
const int bw = 4 << (b_width_log2(bsize) - xd->plane[plane].subsampling_x);
|
||||
const int bh = 4 << (b_height_log2(bsize) - xd->plane[plane].subsampling_y);
|
||||
|
@ -265,13 +265,8 @@ static INLINE int round_mv_comp_q4(int value) {
|
||||
return (value < 0 ? value - 2 : value + 2) / 4;
|
||||
}
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
#define IDX1 2
|
||||
#define IDX2 3
|
||||
#else
|
||||
#define IDX1 4
|
||||
#define IDX2 5
|
||||
#endif
|
||||
|
||||
static int mi_mv_pred_row_q4(MACROBLOCKD *mb, int off, int idx) {
|
||||
const int temp = mb->mode_info_context->bmi[off + 0].as_mv[idx].as_mv.row +
|
||||
|
@ -573,22 +573,6 @@ void vp9_build_intra_predictors_sbuv_s(MACROBLOCKD *xd,
|
||||
xd->left_available, 0 /*xd->right_available*/);
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
void vp9_intra8x8_predict(MACROBLOCKD *xd,
|
||||
int block4x4_idx,
|
||||
int mode,
|
||||
uint8_t *predictor, int pre_stride) {
|
||||
const int block_idx = (block4x4_idx >> 2) | !!(block4x4_idx & 2);
|
||||
const int have_top = (block_idx >> 1) || xd->up_available;
|
||||
const int have_left = (block_idx & 1) || xd->left_available;
|
||||
const int have_right = !(block_idx & 1) || xd->right_available;
|
||||
|
||||
vp9_build_intra_predictors(predictor, pre_stride,
|
||||
predictor, pre_stride,
|
||||
mode, 8, 8, have_top, have_left,
|
||||
have_right);
|
||||
}
|
||||
#endif
|
||||
#if !CONFIG_NEWBINTRAMODES
|
||||
void vp9_intra4x4_predict(MACROBLOCKD *xd,
|
||||
int block_idx,
|
||||
@ -609,19 +593,3 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
|
||||
have_right);
|
||||
}
|
||||
#endif
|
||||
#if !CONFIG_SB8X8
|
||||
void vp9_intra_uv4x4_predict(MACROBLOCKD *xd,
|
||||
int block4x4_idx,
|
||||
int mode,
|
||||
uint8_t *predictor, int pre_stride) {
|
||||
const int block_idx = block4x4_idx & 3;
|
||||
const int have_top = (block_idx >> 1) || xd->up_available;
|
||||
const int have_left = (block_idx & 1) || xd->left_available;
|
||||
const int have_right = !(block_idx & 1);
|
||||
|
||||
vp9_build_intra_predictors(predictor, pre_stride,
|
||||
predictor, pre_stride,
|
||||
mode, 4, 4, have_top, have_left,
|
||||
have_right);
|
||||
}
|
||||
#endif
|
||||
|
@ -63,23 +63,6 @@ specialize vp9_copy_mem8x4 mmx
|
||||
prototype void vp9_recon_b "uint8_t *pred_ptr, int16_t *diff_ptr, int diff_stride, uint8_t *dst_ptr, int stride"
|
||||
specialize vp9_recon_b
|
||||
|
||||
if [ "$CONFIG_SB8X8" != "yes" ]; then
|
||||
|
||||
prototype void vp9_recon_uv_b "uint8_t *pred_ptr, int16_t *diff_ptr, uint8_t *dst_ptr, int stride"
|
||||
specialize vp9_recon_uv_b
|
||||
|
||||
# TODO(jingning): The prototype functions in c are modified to enable block-size configurable
|
||||
# operations. Need to change the sse2 accrodingly.
|
||||
prototype void vp9_recon2b "uint8_t *pred_ptr, int16_t *diff_ptr, uint8_t *dst_ptr, int stride"
|
||||
specialize vp9_recon2b
|
||||
# specialize vp9_recon2b sse2
|
||||
|
||||
prototype void vp9_recon4b "uint8_t *pred_ptr, int16_t *diff_ptr, uint8_t *dst_ptr, int stride"
|
||||
specialize vp9_recon4b
|
||||
# specialize vp9_recon4b sse2
|
||||
|
||||
fi
|
||||
|
||||
prototype void vp9_recon_sb "struct macroblockd *x, enum BLOCK_SIZE_TYPE bsize"
|
||||
specialize vp9_recon_sb
|
||||
|
||||
@ -101,16 +84,6 @@ specialize vp9_build_intra_predictors_sbuv_s
|
||||
prototype void vp9_intra4x4_predict "struct macroblockd *xd, int block, enum BLOCK_SIZE_TYPE bsize, int b_mode, uint8_t *predictor, int pre_stride"
|
||||
specialize vp9_intra4x4_predict;
|
||||
|
||||
if [ "$CONFIG_SB8X8" != "yes" ]; then
|
||||
|
||||
prototype void vp9_intra8x8_predict "struct macroblockd *xd, int block, int b_mode, uint8_t *predictor, int pre_stride"
|
||||
specialize vp9_intra8x8_predict;
|
||||
|
||||
prototype void vp9_intra_uv4x4_predict "struct macroblockd *xd, int block, int b_mode, uint8_t *predictor, int pre_stride"
|
||||
specialize vp9_intra_uv4x4_predict;
|
||||
|
||||
fi
|
||||
|
||||
if [ "$CONFIG_VP9_DECODER" = "yes" ]; then
|
||||
prototype void vp9_add_residual_4x4 "const int16_t *diff, uint8_t *dest, int stride"
|
||||
specialize vp9_add_residual_4x4 sse2
|
||||
|
@ -18,16 +18,12 @@
|
||||
static void vp9_get_tile_offsets(VP9_COMMON *cm, int *min_tile_off,
|
||||
int *max_tile_off, int tile_idx,
|
||||
int log2_n_tiles, int n_mis) {
|
||||
#if CONFIG_SB8X8
|
||||
const int n_sbs = (n_mis + 7) >> 3;
|
||||
#else
|
||||
const int n_sbs = (n_mis + 3) >> 2;
|
||||
#endif
|
||||
const int sb_off1 = (tile_idx * n_sbs) >> log2_n_tiles;
|
||||
const int sb_off2 = ((tile_idx + 1) * n_sbs) >> log2_n_tiles;
|
||||
|
||||
*min_tile_off = MIN(sb_off1 << (2 + CONFIG_SB8X8), n_mis);
|
||||
*max_tile_off = MIN(sb_off2 << (2 + CONFIG_SB8X8), n_mis);
|
||||
*min_tile_off = MIN(sb_off1 << 3, n_mis);
|
||||
*max_tile_off = MIN(sb_off2 << 3, n_mis);
|
||||
}
|
||||
|
||||
void vp9_get_tile_col_offsets(VP9_COMMON *cm, int tile_col_idx) {
|
||||
|
@ -65,12 +65,6 @@ static MB_PREDICTION_MODE read_kf_mb_ymode(vp9_reader *r, const vp9_prob *p) {
|
||||
return (MB_PREDICTION_MODE)treed_read(r, vp9_kf_ymode_tree, p);
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
static int read_i8x8_mode(vp9_reader *r, const vp9_prob *p) {
|
||||
return treed_read(r, vp9_i8x8_mode_tree, p);
|
||||
}
|
||||
#endif
|
||||
|
||||
static MB_PREDICTION_MODE read_uv_mode(vp9_reader *r, const vp9_prob *p) {
|
||||
return (MB_PREDICTION_MODE)treed_read(r, vp9_uv_mode_tree, p);
|
||||
}
|
||||
@ -130,11 +124,7 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m,
|
||||
m->mbmi.mb_skip_coeff = vp9_read(r, vp9_get_pred_prob(cm, xd, PRED_MBSKIP));
|
||||
|
||||
// luma mode
|
||||
#if CONFIG_SB8X8
|
||||
m->mbmi.mode = m->mbmi.sb_type > BLOCK_SIZE_SB8X8 ?
|
||||
#else
|
||||
m->mbmi.mode = m->mbmi.sb_type > BLOCK_SIZE_MB16X16 ?
|
||||
#endif
|
||||
read_kf_sb_ymode(r, cm->sb_kf_ymode_prob[cm->kf_ymode_probs_index]):
|
||||
read_kf_mb_ymode(r, cm->kf_ymode_prob[cm->kf_ymode_probs_index]);
|
||||
|
||||
@ -142,58 +132,27 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m,
|
||||
|
||||
if (m->mbmi.mode == I4X4_PRED) {
|
||||
int i;
|
||||
for (i = 0; i < (16 >> (2 * CONFIG_SB8X8)); ++i) {
|
||||
for (i = 0; i < 4; ++i) {
|
||||
const B_PREDICTION_MODE a = above_block_mode(m, i, mis);
|
||||
const B_PREDICTION_MODE l = xd->left_available ||
|
||||
(i & (3 >> CONFIG_SB8X8)) ?
|
||||
(i & 1) ?
|
||||
left_block_mode(m, i) : B_DC_PRED;
|
||||
m->bmi[i].as_mode.first = read_kf_bmode(r, cm->kf_bmode_prob[a][l]);
|
||||
}
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
if (m->mbmi.mode == I8X8_PRED) {
|
||||
int i;
|
||||
for (i = 0; i < 4; ++i) {
|
||||
const int ib = vp9_i8x8_block[i];
|
||||
const int mode8x8 = read_i8x8_mode(r, cm->fc.i8x8_mode_prob);
|
||||
|
||||
m->bmi[ib + 0].as_mode.first = mode8x8;
|
||||
m->bmi[ib + 1].as_mode.first = mode8x8;
|
||||
m->bmi[ib + 4].as_mode.first = mode8x8;
|
||||
m->bmi[ib + 5].as_mode.first = mode8x8;
|
||||
}
|
||||
}
|
||||
|
||||
// chroma mode
|
||||
if (m->mbmi.mode != I8X8_PRED)
|
||||
#endif
|
||||
{
|
||||
m->mbmi.uv_mode = read_uv_mode(r, cm->kf_uv_mode_prob[m->mbmi.mode]);
|
||||
}
|
||||
m->mbmi.uv_mode = read_uv_mode(r, cm->kf_uv_mode_prob[m->mbmi.mode]);
|
||||
|
||||
if (cm->txfm_mode == TX_MODE_SELECT &&
|
||||
!m->mbmi.mb_skip_coeff &&
|
||||
#if CONFIG_SB8X8
|
||||
m->mbmi.mode != I4X4_PRED
|
||||
#else
|
||||
m->mbmi.mode <= I8X8_PRED
|
||||
#endif
|
||||
) {
|
||||
#if CONFIG_SB8X8
|
||||
!m->mbmi.mb_skip_coeff && m->mbmi.mode != I4X4_PRED) {
|
||||
const int allow_16x16 = m->mbmi.sb_type >= BLOCK_SIZE_MB16X16;
|
||||
#else
|
||||
const int allow_16x16 = m->mbmi.mode != I8X8_PRED;
|
||||
#endif
|
||||
const int allow_32x32 = m->mbmi.sb_type >= BLOCK_SIZE_SB32X32;
|
||||
m->mbmi.txfm_size = select_txfm_size(cm, r, allow_16x16, allow_32x32);
|
||||
} else if (cm->txfm_mode >= ALLOW_32X32 &&
|
||||
m->mbmi.sb_type >= BLOCK_SIZE_SB32X32) {
|
||||
m->mbmi.txfm_size = TX_32X32;
|
||||
} else if (cm->txfm_mode >= ALLOW_16X16 &&
|
||||
#if CONFIG_SB8X8
|
||||
m->mbmi.sb_type >= BLOCK_SIZE_MB16X16 &&
|
||||
#endif
|
||||
m->mbmi.mode <= TM_PRED) {
|
||||
m->mbmi.txfm_size = TX_16X16;
|
||||
} else if (cm->txfm_mode >= ALLOW_8X8 && m->mbmi.mode != I4X4_PRED) {
|
||||
@ -677,12 +636,7 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
if (vp9_segfeature_active(xd, mbmi->segment_id, SEG_LVL_SKIP)) {
|
||||
mbmi->mode = ZEROMV;
|
||||
} else {
|
||||
mbmi->mode =
|
||||
#if CONFIG_SB8X8
|
||||
mbmi->sb_type > BLOCK_SIZE_SB8X8 ?
|
||||
#else
|
||||
mbmi->sb_type > BLOCK_SIZE_MB16X16 ?
|
||||
#endif
|
||||
mbmi->mode = mbmi->sb_type > BLOCK_SIZE_SB8X8 ?
|
||||
read_sb_mv_ref(r, mv_ref_p)
|
||||
: read_mv_ref(r, mv_ref_p);
|
||||
vp9_accum_mv_refs(cm, mbmi->mode, mbmi->mb_mode_context[ref_frame]);
|
||||
@ -776,29 +730,16 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
mbmi->uv_mode = DC_PRED;
|
||||
switch (mbmi->mode) {
|
||||
case SPLITMV: {
|
||||
#if CONFIG_SB8X8
|
||||
const int num_p = 4;
|
||||
#else
|
||||
const int s = treed_read(r, vp9_mbsplit_tree, cm->fc.mbsplit_prob);
|
||||
const int num_p = vp9_mbsplit_count[s];
|
||||
#endif
|
||||
int j = 0;
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
cm->fc.mbsplit_counts[s]++;
|
||||
mbmi->partitioning = s;
|
||||
#endif
|
||||
mbmi->need_to_clamp_mvs = 0;
|
||||
do { // for each subset j
|
||||
int_mv leftmv, abovemv, second_leftmv, second_abovemv;
|
||||
int_mv blockmv, secondmv;
|
||||
int mv_contz;
|
||||
int blockmode;
|
||||
#if CONFIG_SB8X8
|
||||
int k = j;
|
||||
#else
|
||||
int k = vp9_mbsplit_offset[s][j]; // first block in subset j
|
||||
#endif
|
||||
|
||||
leftmv.as_int = left_block_mv(xd, mi, k);
|
||||
abovemv.as_int = above_block_mv(mi, k, mis);
|
||||
@ -852,50 +793,14 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Commenting this section out, not sure why this was needed, and
|
||||
* there are mismatches with this section in rare cases since it is
|
||||
* not done in the encoder at all.
|
||||
mbmi->need_to_clamp_mvs |= check_mv_bounds(&blockmv,
|
||||
mb_to_left_edge,
|
||||
mb_to_right_edge,
|
||||
mb_to_top_edge,
|
||||
mb_to_bottom_edge);
|
||||
if (mbmi->second_ref_frame > 0) {
|
||||
mbmi->need_to_clamp_mvs |= check_mv_bounds(&secondmv,
|
||||
mb_to_left_edge,
|
||||
mb_to_right_edge,
|
||||
mb_to_top_edge,
|
||||
mb_to_bottom_edge);
|
||||
}
|
||||
*/
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
mi->bmi[j].as_mv[0].as_int = blockmv.as_int;
|
||||
if (mbmi->second_ref_frame > 0)
|
||||
mi->bmi[j].as_mv[1].as_int = secondmv.as_int;
|
||||
#else
|
||||
{
|
||||
/* Fill (uniform) modes, mvs of jth subset.
|
||||
Must do it here because ensuing subsets can
|
||||
refer back to us via "left" or "above". */
|
||||
unsigned int fill_count = mbsplit_fill_count[s];
|
||||
const uint8_t *fill_offset =
|
||||
&mbsplit_fill_offset[s][j * fill_count];
|
||||
|
||||
do {
|
||||
mi->bmi[*fill_offset].as_mv[0].as_int = blockmv.as_int;
|
||||
if (mbmi->second_ref_frame > 0)
|
||||
mi->bmi[*fill_offset].as_mv[1].as_int = secondmv.as_int;
|
||||
fill_offset++;
|
||||
} while (--fill_count);
|
||||
}
|
||||
#endif
|
||||
} while (++j < num_p);
|
||||
}
|
||||
|
||||
mv0->as_int = mi->bmi[15 >> (2 * CONFIG_SB8X8)].as_mv[0].as_int;
|
||||
mv1->as_int = mi->bmi[15 >> (2 * CONFIG_SB8X8)].as_mv[1].as_int;
|
||||
mv0->as_int = mi->bmi[3].as_mv[0].as_int;
|
||||
mv1->as_int = mi->bmi[3].as_mv[1].as_int;
|
||||
|
||||
break; /* done with SPLITMV */
|
||||
|
||||
@ -960,12 +865,7 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
// required for left and above block mv
|
||||
mv0->as_int = 0;
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
if (mbmi->sb_type > BLOCK_SIZE_SB8X8)
|
||||
#else
|
||||
if (mbmi->sb_type > BLOCK_SIZE_MB16X16)
|
||||
#endif
|
||||
{
|
||||
if (mbmi->sb_type > BLOCK_SIZE_SB8X8) {
|
||||
mbmi->mode = read_sb_ymode(r, cm->fc.sb_ymode_prob);
|
||||
cm->fc.sb_ymode_counts[mbmi->mode]++;
|
||||
} else {
|
||||
@ -983,28 +883,11 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
if (m == B_CONTEXT_PRED) m -= CONTEXT_PRED_REPLACEMENTS;
|
||||
#endif
|
||||
cm->fc.bmode_counts[m]++;
|
||||
} while (++j < (16 >> (2 * CONFIG_SB8X8)));
|
||||
} while (++j < 4);
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
if (mbmi->mode == I8X8_PRED) {
|
||||
int i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
const int ib = vp9_i8x8_block[i];
|
||||
const int mode8x8 = read_i8x8_mode(r, cm->fc.i8x8_mode_prob);
|
||||
|
||||
mi->bmi[ib + 0].as_mode.first = mode8x8;
|
||||
mi->bmi[ib + 1].as_mode.first = mode8x8;
|
||||
mi->bmi[ib + 4].as_mode.first = mode8x8;
|
||||
mi->bmi[ib + 5].as_mode.first = mode8x8;
|
||||
cm->fc.i8x8_mode_counts[mode8x8]++;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
mbmi->uv_mode = read_uv_mode(r, cm->fc.uv_mode_prob[mbmi->mode]);
|
||||
cm->fc.uv_mode_counts[mbmi->mode][mbmi->uv_mode]++;
|
||||
}
|
||||
mbmi->uv_mode = read_uv_mode(r, cm->fc.uv_mode_prob[mbmi->mode]);
|
||||
cm->fc.uv_mode_counts[mbmi->mode][mbmi->uv_mode]++;
|
||||
}
|
||||
/*
|
||||
if (cm->current_video_frame == 1)
|
||||
@ -1012,44 +895,22 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
|
||||
*/
|
||||
|
||||
if (cm->txfm_mode == TX_MODE_SELECT && mbmi->mb_skip_coeff == 0 &&
|
||||
((mbmi->ref_frame == INTRA_FRAME &&
|
||||
#if CONFIG_SB8X8
|
||||
mbmi->mode != I4X4_PRED
|
||||
#else
|
||||
mbmi->mode <= I8X8_PRED
|
||||
#endif
|
||||
) ||
|
||||
(mbmi->ref_frame != INTRA_FRAME &&
|
||||
#if CONFIG_SB8X8
|
||||
mbmi->mode != SPLITMV
|
||||
#else
|
||||
!(mbmi->mode == SPLITMV && mbmi->partitioning == PARTITIONING_4X4)
|
||||
#endif
|
||||
))) {
|
||||
#if CONFIG_SB8X8
|
||||
((mbmi->ref_frame == INTRA_FRAME && mbmi->mode != I4X4_PRED) ||
|
||||
(mbmi->ref_frame != INTRA_FRAME && mbmi->mode != SPLITMV))) {
|
||||
const int allow_16x16 = mbmi->sb_type >= BLOCK_SIZE_MB16X16;
|
||||
#else
|
||||
const int allow_16x16 = mbmi->mode != I8X8_PRED && mbmi->mode != SPLITMV;
|
||||
#endif
|
||||
const int allow_32x32 = mbmi->sb_type >= BLOCK_SIZE_SB32X32;
|
||||
mbmi->txfm_size = select_txfm_size(cm, r, allow_16x16, allow_32x32);
|
||||
} else if (mbmi->sb_type >= BLOCK_SIZE_SB32X32 &&
|
||||
cm->txfm_mode >= ALLOW_32X32) {
|
||||
mbmi->txfm_size = TX_32X32;
|
||||
} else if (cm->txfm_mode >= ALLOW_16X16 &&
|
||||
#if CONFIG_SB8X8
|
||||
mbmi->sb_type >= BLOCK_SIZE_MB16X16 &&
|
||||
#endif
|
||||
((mbmi->ref_frame == INTRA_FRAME && mbmi->mode <= TM_PRED) ||
|
||||
(mbmi->ref_frame != INTRA_FRAME && mbmi->mode != SPLITMV))) {
|
||||
mbmi->txfm_size = TX_16X16;
|
||||
} else if (cm->txfm_mode >= ALLOW_8X8 &&
|
||||
(!(mbmi->ref_frame == INTRA_FRAME && mbmi->mode == I4X4_PRED) &&
|
||||
!(mbmi->ref_frame != INTRA_FRAME && mbmi->mode == SPLITMV
|
||||
#if !CONFIG_SB8X8
|
||||
&& mbmi->partitioning == PARTITIONING_4X4
|
||||
#endif
|
||||
))) {
|
||||
!(mbmi->ref_frame != INTRA_FRAME && mbmi->mode == SPLITMV))) {
|
||||
mbmi->txfm_size = TX_8X8;
|
||||
} else {
|
||||
mbmi->txfm_size = TX_4X4;
|
||||
|
@ -186,58 +186,6 @@ static void mb_init_dequantizer(VP9_COMMON *pc, MACROBLOCKD *xd) {
|
||||
xd->plane[i].dequant = pc->uv_dequant[xd->q_index];
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
static void decode_8x8(MACROBLOCKD *xd) {
|
||||
const MB_PREDICTION_MODE mode = xd->mode_info_context->mbmi.mode;
|
||||
// luma
|
||||
// if the first one is DCT_DCT assume all the rest are as well
|
||||
TX_TYPE tx_type = get_tx_type_8x8(xd, 0);
|
||||
int i;
|
||||
assert(mode == I8X8_PRED);
|
||||
for (i = 0; i < 4; i++) {
|
||||
int ib = vp9_i8x8_block[i];
|
||||
int idx = (ib & 0x02) ? (ib + 2) : ib;
|
||||
int16_t *q = BLOCK_OFFSET(xd->plane[0].qcoeff, idx, 16);
|
||||
uint8_t* const dst =
|
||||
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib,
|
||||
xd->plane[0].dst.buf,
|
||||
xd->plane[0].dst.stride);
|
||||
int stride = xd->plane[0].dst.stride;
|
||||
if (mode == I8X8_PRED) {
|
||||
int i8x8mode = xd->mode_info_context->bmi[ib].as_mode.first;
|
||||
vp9_intra8x8_predict(xd, ib, i8x8mode, dst, stride);
|
||||
}
|
||||
tx_type = get_tx_type_8x8(xd, ib);
|
||||
vp9_iht_add_8x8_c(tx_type, q, dst, stride, xd->plane[0].eobs[idx]);
|
||||
}
|
||||
|
||||
// chroma
|
||||
for (i = 0; i < 4; i++) {
|
||||
int ib = vp9_i8x8_block[i];
|
||||
int i8x8mode = xd->mode_info_context->bmi[ib].as_mode.first;
|
||||
uint8_t* dst;
|
||||
|
||||
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 1, i,
|
||||
xd->plane[1].dst.buf,
|
||||
xd->plane[1].dst.stride);
|
||||
vp9_intra_uv4x4_predict(xd, 16 + i, i8x8mode,
|
||||
dst, xd->plane[1].dst.stride);
|
||||
xd->itxm_add(BLOCK_OFFSET(xd->plane[1].qcoeff, i, 16),
|
||||
dst, xd->plane[1].dst.stride,
|
||||
xd->plane[1].eobs[i]);
|
||||
|
||||
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 2, i,
|
||||
xd->plane[2].dst.buf,
|
||||
xd->plane[1].dst.stride);
|
||||
vp9_intra_uv4x4_predict(xd, 20 + i, i8x8mode,
|
||||
dst, xd->plane[1].dst.stride);
|
||||
xd->itxm_add(BLOCK_OFFSET(xd->plane[2].qcoeff, i, 16),
|
||||
dst, xd->plane[1].dst.stride,
|
||||
xd->plane[2].eobs[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static INLINE void dequant_add_y(MACROBLOCKD *xd, TX_TYPE tx_type, int idx,
|
||||
BLOCK_SIZE_TYPE bsize) {
|
||||
struct macroblockd_plane *const y = &xd->plane[0];
|
||||
@ -253,47 +201,6 @@ static INLINE void dequant_add_y(MACROBLOCKD *xd, TX_TYPE tx_type, int idx,
|
||||
}
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
static void decode_4x4(VP9D_COMP *pbi, MACROBLOCKD *xd, vp9_reader *r) {
|
||||
TX_TYPE tx_type;
|
||||
int i = 0;
|
||||
const MB_PREDICTION_MODE mode = xd->mode_info_context->mbmi.mode;
|
||||
assert(mode == I8X8_PRED);
|
||||
for (i = 0; i < 4; i++) {
|
||||
int ib = vp9_i8x8_block[i];
|
||||
const int iblock[4] = {0, 1, 4, 5};
|
||||
int j;
|
||||
uint8_t* dst;
|
||||
int i8x8mode = xd->mode_info_context->bmi[ib].as_mode.first;
|
||||
|
||||
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib,
|
||||
xd->plane[0].dst.buf,
|
||||
xd->plane[0].dst.stride);
|
||||
vp9_intra8x8_predict(xd, ib, i8x8mode, dst, xd->plane[0].dst.stride);
|
||||
for (j = 0; j < 4; j++) {
|
||||
tx_type = get_tx_type_4x4(xd, ib + iblock[j]);
|
||||
dequant_add_y(xd, tx_type, ib + iblock[j], BLOCK_SIZE_MB16X16);
|
||||
}
|
||||
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 1, i,
|
||||
xd->plane[1].dst.buf,
|
||||
xd->plane[1].dst.stride);
|
||||
vp9_intra_uv4x4_predict(xd, 16 + i, i8x8mode,
|
||||
dst, xd->plane[1].dst.stride);
|
||||
xd->itxm_add(BLOCK_OFFSET(xd->plane[1].qcoeff, i, 16),
|
||||
dst, xd->plane[1].dst.stride,
|
||||
xd->plane[1].eobs[i]);
|
||||
dst = raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 2, i,
|
||||
xd->plane[2].dst.buf,
|
||||
xd->plane[2].dst.stride);
|
||||
vp9_intra_uv4x4_predict(xd, 20 + i, i8x8mode,
|
||||
dst, xd->plane[1].dst.stride);
|
||||
xd->itxm_add(BLOCK_OFFSET(xd->plane[2].qcoeff, i, 16),
|
||||
dst, xd->plane[1].dst.stride,
|
||||
xd->plane[2].eobs[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void decode_block(int plane, int block, BLOCK_SIZE_TYPE bsize,
|
||||
int ss_txfrm_size, void *arg) {
|
||||
MACROBLOCKD* const xd = arg;
|
||||
@ -445,35 +352,6 @@ static void decode_sb(VP9D_COMP *pbi, MACROBLOCKD *xd, int mi_row, int mi_col,
|
||||
}
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
// TODO(jingning): This only performs I8X8_PRED decoding process, which will be
|
||||
// automatically covered by decode_sb, when SB8X8 is on.
|
||||
static void decode_mb(VP9D_COMP *pbi, MACROBLOCKD *xd,
|
||||
int mi_row, int mi_col,
|
||||
vp9_reader *r) {
|
||||
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
|
||||
const int tx_size = mbmi->txfm_size;
|
||||
|
||||
assert(mbmi->sb_type == BLOCK_SIZE_MB16X16);
|
||||
|
||||
if (mbmi->mb_skip_coeff) {
|
||||
vp9_reset_sb_tokens_context(xd, BLOCK_SIZE_MB16X16);
|
||||
} else {
|
||||
// re-initialize macroblock dequantizer before detokenization
|
||||
if (xd->segmentation_enabled)
|
||||
mb_init_dequantizer(&pbi->common, xd);
|
||||
|
||||
if (!vp9_reader_has_error(r))
|
||||
vp9_decode_tokens(pbi, xd, r, BLOCK_SIZE_MB16X16);
|
||||
}
|
||||
|
||||
if (tx_size == TX_8X8)
|
||||
decode_8x8(xd);
|
||||
else
|
||||
decode_4x4(pbi, xd, r);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int get_delta_q(vp9_reader *r, int *dq) {
|
||||
const int old_value = *dq;
|
||||
|
||||
@ -507,12 +385,12 @@ static void set_offsets(VP9D_COMP *pbi, BLOCK_SIZE_TYPE bsize,
|
||||
|
||||
for (i = 0; i < MAX_MB_PLANE; i++) {
|
||||
xd->plane[i].above_context = cm->above_context[i] +
|
||||
(mi_col * 4 >> (xd->plane[i].subsampling_x + CONFIG_SB8X8));
|
||||
(mi_col * 2 >> xd->plane[i].subsampling_x);
|
||||
xd->plane[i].left_context = cm->left_context[i] +
|
||||
(((mi_row * 4 >> CONFIG_SB8X8) & 15) >> xd->plane[i].subsampling_y);
|
||||
(((mi_row * 2) & 15) >> xd->plane[i].subsampling_y);
|
||||
}
|
||||
xd->above_seg_context = cm->above_seg_context + (mi_col >> CONFIG_SB8X8);
|
||||
xd->left_seg_context = cm->left_seg_context + ((mi_row >> CONFIG_SB8X8) & 3);
|
||||
xd->above_seg_context = cm->above_seg_context + (mi_col >> 1);
|
||||
xd->left_seg_context = cm->left_seg_context + ((mi_row >> 1) & 3);
|
||||
|
||||
// Distance of Mb to the various image edges. These are specified to 8th pel
|
||||
// as they are always compared to values that are in 1/8th pel units
|
||||
@ -559,33 +437,12 @@ static void decode_modes_b(VP9D_COMP *pbi, int mi_row, int mi_col,
|
||||
vp9_decode_mb_mode_mv(pbi, xd, mi_row, mi_col, r);
|
||||
set_refs(pbi, mi_row, mi_col);
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
if (bsize == BLOCK_SIZE_SB8X8 &&
|
||||
(xd->mode_info_context->mbmi.mode == SPLITMV ||
|
||||
xd->mode_info_context->mbmi.mode == I4X4_PRED))
|
||||
decode_atom(pbi, xd, mi_row, mi_col, r, bsize);
|
||||
else
|
||||
decode_sb(pbi, xd, mi_row, mi_col, r, bsize);
|
||||
#else
|
||||
// TODO(jingning): merge decode_sb_ and decode_mb_
|
||||
if (bsize > BLOCK_SIZE_MB16X16) {
|
||||
decode_sb(pbi, xd, mi_row, mi_col, r, bsize);
|
||||
} else {
|
||||
// TODO(jingning): In transition of separating functionalities of decode_mb
|
||||
// into decode_sb and decode_atom. Will remove decode_mb and clean this up
|
||||
// when SB8X8 is on.
|
||||
if (xd->mode_info_context->mbmi.mode == I4X4_PRED ||
|
||||
(xd->mode_info_context->mbmi.mode == SPLITMV &&
|
||||
xd->mode_info_context->mbmi.partitioning == PARTITIONING_4X4))
|
||||
decode_atom(pbi, xd, mi_row, mi_col, r, bsize);
|
||||
else if (xd->mode_info_context->mbmi.mode != I8X8_PRED)
|
||||
decode_sb(pbi, xd, mi_row, mi_col, r, bsize);
|
||||
else
|
||||
// TODO(jingning): decode_mb still carries deocding process of I8X8_PRED.
|
||||
// This will be covered by decode_sb when SB8X8 is on.
|
||||
decode_mb(pbi, xd, mi_row, mi_col, r);
|
||||
}
|
||||
#endif
|
||||
|
||||
xd->corrupted |= vp9_reader_has_error(r);
|
||||
}
|
||||
@ -602,16 +459,12 @@ static void decode_modes_sb(VP9D_COMP *pbi, int mi_row, int mi_col,
|
||||
if (mi_row >= pc->mi_rows || mi_col >= pc->mi_cols)
|
||||
return;
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
if (bsize > BLOCK_SIZE_SB8X8) {
|
||||
#else
|
||||
if (bsize > BLOCK_SIZE_MB16X16) {
|
||||
#endif
|
||||
int pl;
|
||||
// read the partition information
|
||||
xd->left_seg_context =
|
||||
pc->left_seg_context + ((mi_row >> CONFIG_SB8X8) & 3);
|
||||
xd->above_seg_context = pc->above_seg_context + (mi_col >> CONFIG_SB8X8);
|
||||
pc->left_seg_context + ((mi_row >> 1) & 3);
|
||||
xd->above_seg_context = pc->above_seg_context + (mi_col >> 1);
|
||||
pl = partition_plane_context(xd, bsize);
|
||||
partition = treed_read(r, vp9_partition_tree,
|
||||
pc->fc.partition_prob[pl]);
|
||||
@ -638,15 +491,10 @@ static void decode_modes_sb(VP9D_COMP *pbi, int mi_row, int mi_col,
|
||||
int j = n >> 1, i = n & 0x01;
|
||||
if (subsize == BLOCK_SIZE_SB32X32)
|
||||
xd->sb_index = n;
|
||||
#if CONFIG_SB8X8
|
||||
else if (subsize == BLOCK_SIZE_MB16X16)
|
||||
xd->mb_index = n;
|
||||
else
|
||||
xd->b_index = n;
|
||||
#else
|
||||
else
|
||||
xd->mb_index = n;
|
||||
#endif
|
||||
decode_modes_sb(pbi, mi_row + j * bs, mi_col + i * bs, r, subsize);
|
||||
}
|
||||
break;
|
||||
@ -654,15 +502,11 @@ static void decode_modes_sb(VP9D_COMP *pbi, int mi_row, int mi_col,
|
||||
assert(0);
|
||||
}
|
||||
// update partition context
|
||||
#if CONFIG_SB8X8
|
||||
if ((partition == PARTITION_SPLIT) && (bsize > BLOCK_SIZE_MB16X16))
|
||||
#else
|
||||
if ((partition == PARTITION_SPLIT) && (bsize > BLOCK_SIZE_SB32X32))
|
||||
#endif
|
||||
return;
|
||||
|
||||
xd->left_seg_context = pc->left_seg_context + ((mi_row >> CONFIG_SB8X8) & 3);
|
||||
xd->above_seg_context = pc->above_seg_context + (mi_col >> CONFIG_SB8X8);
|
||||
xd->left_seg_context = pc->left_seg_context + ((mi_row >> 1) & 3);
|
||||
xd->above_seg_context = pc->above_seg_context + (mi_col >> 1);
|
||||
update_partition_context(xd, subsize, bsize);
|
||||
}
|
||||
|
||||
@ -1013,13 +857,7 @@ static void update_frame_context(FRAME_CONTEXT *fc) {
|
||||
vp9_copy(fc->pre_sb_ymode_prob, fc->sb_ymode_prob);
|
||||
vp9_copy(fc->pre_uv_mode_prob, fc->uv_mode_prob);
|
||||
vp9_copy(fc->pre_bmode_prob, fc->bmode_prob);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_copy(fc->pre_i8x8_mode_prob, fc->i8x8_mode_prob);
|
||||
#endif
|
||||
vp9_copy(fc->pre_sub_mv_ref_prob, fc->sub_mv_ref_prob);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_copy(fc->pre_mbsplit_prob, fc->mbsplit_prob);
|
||||
#endif
|
||||
vp9_copy(fc->pre_partition_prob, fc->partition_prob);
|
||||
fc->pre_nmvc = fc->nmvc;
|
||||
|
||||
@ -1032,13 +870,7 @@ static void update_frame_context(FRAME_CONTEXT *fc) {
|
||||
vp9_zero(fc->sb_ymode_counts);
|
||||
vp9_zero(fc->uv_mode_counts);
|
||||
vp9_zero(fc->bmode_counts);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_zero(fc->i8x8_mode_counts);
|
||||
#endif
|
||||
vp9_zero(fc->sub_mv_ref_counts);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_zero(fc->mbsplit_counts);
|
||||
#endif
|
||||
vp9_zero(fc->NMVcount);
|
||||
vp9_zero(fc->mv_ref_ct);
|
||||
vp9_zero(fc->partition_counts);
|
||||
@ -1066,12 +898,12 @@ static void decode_tile(VP9D_COMP *pbi, vp9_reader *r) {
|
||||
int mi_row, mi_col;
|
||||
|
||||
for (mi_row = pc->cur_tile_mi_row_start;
|
||||
mi_row < pc->cur_tile_mi_row_end; mi_row += (4 << CONFIG_SB8X8)) {
|
||||
mi_row < pc->cur_tile_mi_row_end; mi_row += 8) {
|
||||
// For a SB there are 2 left contexts, each pertaining to a MB row within
|
||||
vpx_memset(&pc->left_context, 0, sizeof(pc->left_context));
|
||||
vpx_memset(pc->left_seg_context, 0, sizeof(pc->left_seg_context));
|
||||
for (mi_col = pc->cur_tile_mi_col_start;
|
||||
mi_col < pc->cur_tile_mi_col_end; mi_col += (4 << CONFIG_SB8X8)) {
|
||||
mi_col < pc->cur_tile_mi_col_end; mi_col += 8) {
|
||||
decode_modes_sb(pbi, mi_row, mi_col, r, BLOCK_SIZE_SB64X64);
|
||||
}
|
||||
}
|
||||
|
@ -281,12 +281,6 @@ static void sb_kfwrite_ymode(vp9_writer *bc, int m, const vp9_prob *p) {
|
||||
write_token(bc, vp9_uv_mode_tree, p, vp9_sb_kf_ymode_encodings + m);
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
static void write_i8x8_mode(vp9_writer *bc, int m, const vp9_prob *p) {
|
||||
write_token(bc, vp9_i8x8_mode_tree, p, vp9_i8x8_mode_encodings + m);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void write_uv_mode(vp9_writer *bc, int m, const vp9_prob *p) {
|
||||
write_token(bc, vp9_uv_mode_tree, p, vp9_uv_mode_encodings + m);
|
||||
}
|
||||
@ -304,12 +298,6 @@ static void write_kf_bmode(vp9_writer *bc, int m, const vp9_prob *p) {
|
||||
write_token(bc, vp9_kf_bmode_tree, p, vp9_kf_bmode_encodings + m);
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
static void write_split(vp9_writer *bc, int x, const vp9_prob *p) {
|
||||
write_token(bc, vp9_mbsplit_tree, p, vp9_mbsplit_encodings + x);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int prob_update_savings(const unsigned int *ct,
|
||||
const vp9_prob oldp, const vp9_prob newp,
|
||||
const vp9_prob upd) {
|
||||
@ -671,11 +659,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
|
||||
active_section = 6;
|
||||
#endif
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
if (m->mbmi.sb_type > BLOCK_SIZE_SB8X8)
|
||||
#else
|
||||
if (m->mbmi.sb_type > BLOCK_SIZE_MB16X16)
|
||||
#endif
|
||||
write_sb_ymode(bc, mode, pc->fc.sb_ymode_prob);
|
||||
else
|
||||
write_ymode(bc, mode, pc->fc.ymode_prob);
|
||||
@ -685,24 +669,10 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
|
||||
do {
|
||||
write_bmode(bc, m->bmi[j].as_mode.first,
|
||||
pc->fc.bmode_prob);
|
||||
} while (++j < (16 >> (CONFIG_SB8X8 * 2)));
|
||||
}
|
||||
#if !CONFIG_SB8X8
|
||||
if (mode == I8X8_PRED) {
|
||||
write_i8x8_mode(bc, m->bmi[0].as_mode.first,
|
||||
pc->fc.i8x8_mode_prob);
|
||||
write_i8x8_mode(bc, m->bmi[2].as_mode.first,
|
||||
pc->fc.i8x8_mode_prob);
|
||||
write_i8x8_mode(bc, m->bmi[8].as_mode.first,
|
||||
pc->fc.i8x8_mode_prob);
|
||||
write_i8x8_mode(bc, m->bmi[10].as_mode.first,
|
||||
pc->fc.i8x8_mode_prob);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
write_uv_mode(bc, mi->uv_mode,
|
||||
pc->fc.uv_mode_prob[mode]);
|
||||
} while (++j < 4);
|
||||
}
|
||||
write_uv_mode(bc, mi->uv_mode,
|
||||
pc->fc.uv_mode_prob[mode]);
|
||||
} else {
|
||||
vp9_prob mv_ref_p[VP9_MVREFS - 1];
|
||||
|
||||
@ -714,11 +684,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
|
||||
|
||||
// If segment skip is not enabled code the mode.
|
||||
if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) {
|
||||
#if CONFIG_SB8X8
|
||||
if (mi->sb_type > BLOCK_SIZE_SB8X8) {
|
||||
#else
|
||||
if (mi->sb_type > BLOCK_SIZE_MB16X16) {
|
||||
#endif
|
||||
write_sb_mv_ref(bc, mode, mv_ref_p);
|
||||
} else {
|
||||
write_mv_ref(bc, mode, mv_ref_p);
|
||||
@ -788,34 +754,16 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
|
||||
++count_mb_seg[mi->partitioning];
|
||||
#endif
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
write_split(bc, mi->partitioning, cpi->common.fc.mbsplit_prob);
|
||||
cpi->mbsplit_count[mi->partitioning]++;
|
||||
#endif
|
||||
|
||||
do {
|
||||
B_PREDICTION_MODE blockmode;
|
||||
int_mv blockmv;
|
||||
#if !CONFIG_SB8X8
|
||||
const int *const L = vp9_mbsplits[mi->partitioning];
|
||||
#endif
|
||||
int k = -1; /* first block in subset j */
|
||||
int mv_contz;
|
||||
int_mv leftmv, abovemv;
|
||||
|
||||
blockmode = cpi->mb.partition_info->bmi[j].mode;
|
||||
blockmv = cpi->mb.partition_info->bmi[j].mv;
|
||||
#if CONFIG_SB8X8
|
||||
k = j;
|
||||
#else
|
||||
#if CONFIG_DEBUG
|
||||
while (j != L[++k])
|
||||
if (k >= 16)
|
||||
assert(0);
|
||||
#else
|
||||
while (j != L[++k]);
|
||||
#endif
|
||||
#endif
|
||||
leftmv.as_int = left_block_mv(xd, m, k);
|
||||
abovemv.as_int = above_block_mv(m, k, mis);
|
||||
mv_contz = vp9_mv_cont(&leftmv, &abovemv);
|
||||
@ -847,7 +795,6 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
if (((rf == INTRA_FRAME && mode != I4X4_PRED) ||
|
||||
(rf != INTRA_FRAME && mode != SPLITMV)) &&
|
||||
pc->txfm_mode == TX_MODE_SELECT &&
|
||||
@ -862,23 +809,6 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
|
||||
vp9_write(bc, sz != TX_16X16, pc->prob_tx[2]);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (((rf == INTRA_FRAME && mode <= I8X8_PRED) ||
|
||||
(rf != INTRA_FRAME && !(mode == SPLITMV &&
|
||||
mi->partitioning == PARTITIONING_4X4))) &&
|
||||
pc->txfm_mode == TX_MODE_SELECT &&
|
||||
!(skip_coeff || vp9_segfeature_active(xd, segment_id,
|
||||
SEG_LVL_SKIP))) {
|
||||
TX_SIZE sz = mi->txfm_size;
|
||||
// FIXME(rbultje) code ternary symbol once all experiments are merged
|
||||
vp9_write(bc, sz != TX_4X4, pc->prob_tx[0]);
|
||||
if (sz != TX_4X4 && mode != I8X8_PRED && mode != SPLITMV) {
|
||||
vp9_write(bc, sz != TX_8X8, pc->prob_tx[1]);
|
||||
if (mi->sb_type >= BLOCK_SIZE_SB32X32 && sz != TX_8X8)
|
||||
vp9_write(bc, sz != TX_16X16, pc->prob_tx[2]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void write_mb_modes_kf(const VP9_COMP *cpi,
|
||||
@ -901,11 +831,7 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
|
||||
vp9_write(bc, skip_coeff, vp9_get_pred_prob(c, xd, PRED_MBSKIP));
|
||||
}
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
if (m->mbmi.sb_type > BLOCK_SIZE_SB8X8)
|
||||
#else
|
||||
if (m->mbmi.sb_type > BLOCK_SIZE_MB16X16)
|
||||
#endif
|
||||
sb_kfwrite_ymode(bc, ym, c->sb_kf_ymode_prob[c->kf_ymode_probs_index]);
|
||||
else
|
||||
kfwrite_ymode(bc, ym, c->kf_ymode_prob[c->kf_ymode_probs_index]);
|
||||
@ -915,7 +841,7 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
|
||||
do {
|
||||
const B_PREDICTION_MODE a = above_block_mode(m, i, mis);
|
||||
const B_PREDICTION_MODE l = (xd->left_available ||
|
||||
(i & (3 >> CONFIG_SB8X8))) ?
|
||||
(i & 1)) ?
|
||||
left_block_mode(m, i) : B_DC_PRED;
|
||||
const int bm = m->bmi[i].as_mode.first;
|
||||
|
||||
@ -923,23 +849,11 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
|
||||
++intra_mode_stats [A] [L] [bm];
|
||||
#endif
|
||||
write_kf_bmode(bc, bm, c->kf_bmode_prob[a][l]);
|
||||
} while (++i < (16 >> (CONFIG_SB8X8 * 2)));
|
||||
} while (++i < 4);
|
||||
}
|
||||
#if !CONFIG_SB8X8
|
||||
if (ym == I8X8_PRED) {
|
||||
write_i8x8_mode(bc, m->bmi[0].as_mode.first, c->fc.i8x8_mode_prob);
|
||||
// printf(" mode: %d\n", m->bmi[0].as_mode.first); fflush(stdout);
|
||||
write_i8x8_mode(bc, m->bmi[2].as_mode.first, c->fc.i8x8_mode_prob);
|
||||
// printf(" mode: %d\n", m->bmi[2].as_mode.first); fflush(stdout);
|
||||
write_i8x8_mode(bc, m->bmi[8].as_mode.first, c->fc.i8x8_mode_prob);
|
||||
// printf(" mode: %d\n", m->bmi[8].as_mode.first); fflush(stdout);
|
||||
write_i8x8_mode(bc, m->bmi[10].as_mode.first, c->fc.i8x8_mode_prob);
|
||||
// printf(" mode: %d\n", m->bmi[10].as_mode.first); fflush(stdout);
|
||||
} else
|
||||
#endif
|
||||
write_uv_mode(bc, m->mbmi.uv_mode, c->kf_uv_mode_prob[ym]);
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
write_uv_mode(bc, m->mbmi.uv_mode, c->kf_uv_mode_prob[ym]);
|
||||
|
||||
if (ym != I4X4_PRED && c->txfm_mode == TX_MODE_SELECT &&
|
||||
!(skip_coeff || vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP))) {
|
||||
TX_SIZE sz = m->mbmi.txfm_size;
|
||||
@ -951,19 +865,6 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
|
||||
vp9_write(bc, sz != TX_16X16, c->prob_tx[2]);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (ym <= I8X8_PRED && c->txfm_mode == TX_MODE_SELECT &&
|
||||
!(skip_coeff || vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP))) {
|
||||
TX_SIZE sz = m->mbmi.txfm_size;
|
||||
// FIXME(rbultje) code ternary symbol once all experiments are merged
|
||||
vp9_write(bc, sz != TX_4X4, c->prob_tx[0]);
|
||||
if (sz != TX_4X4 && ym <= TM_PRED) {
|
||||
vp9_write(bc, sz != TX_8X8, c->prob_tx[1]);
|
||||
if (m->mbmi.sb_type >= BLOCK_SIZE_SB32X32 && sz != TX_8X8)
|
||||
vp9_write(bc, sz != TX_16X16, c->prob_tx[2]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -1171,15 +1072,11 @@ static void write_modes_sb(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc,
|
||||
else
|
||||
assert(0);
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
if (bsize > BLOCK_SIZE_SB8X8) {
|
||||
#else
|
||||
if (bsize > BLOCK_SIZE_MB16X16) {
|
||||
#endif
|
||||
int pl;
|
||||
xd->left_seg_context =
|
||||
cm->left_seg_context + ((mi_row >> CONFIG_SB8X8) & 3);
|
||||
xd->above_seg_context = cm->above_seg_context + (mi_col >> CONFIG_SB8X8);
|
||||
cm->left_seg_context + ((mi_row >> 1) & 3);
|
||||
xd->above_seg_context = cm->above_seg_context + (mi_col >> 1);
|
||||
pl = partition_plane_context(xd, bsize);
|
||||
// encode the partition information
|
||||
write_token(bc, vp9_partition_tree, cm->fc.partition_prob[pl],
|
||||
@ -1214,15 +1111,11 @@ static void write_modes_sb(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc,
|
||||
}
|
||||
|
||||
// update partition context
|
||||
#if CONFIG_SB8X8
|
||||
if ((partition == PARTITION_SPLIT) && (bsize > BLOCK_SIZE_MB16X16))
|
||||
#else
|
||||
if ((partition == PARTITION_SPLIT) && (bsize > BLOCK_SIZE_SB32X32))
|
||||
#endif
|
||||
return;
|
||||
|
||||
xd->left_seg_context = cm->left_seg_context + ((mi_row >> CONFIG_SB8X8) & 3);
|
||||
xd->above_seg_context = cm->above_seg_context + (mi_col >> CONFIG_SB8X8);
|
||||
xd->left_seg_context = cm->left_seg_context + ((mi_row >> 1) & 3);
|
||||
xd->above_seg_context = cm->above_seg_context + (mi_col >> 1);
|
||||
update_partition_context(xd, subsize, bsize);
|
||||
}
|
||||
|
||||
@ -1239,12 +1132,12 @@ static void write_modes(VP9_COMP *cpi, vp9_writer* const bc,
|
||||
|
||||
for (mi_row = c->cur_tile_mi_row_start;
|
||||
mi_row < c->cur_tile_mi_row_end;
|
||||
mi_row += (4 << CONFIG_SB8X8), m_ptr += (4 << CONFIG_SB8X8) * mis) {
|
||||
mi_row += 8, m_ptr += 8 * mis) {
|
||||
m = m_ptr;
|
||||
vpx_memset(c->left_seg_context, 0, sizeof(c->left_seg_context));
|
||||
for (mi_col = c->cur_tile_mi_col_start;
|
||||
mi_col < c->cur_tile_mi_col_end;
|
||||
mi_col += (4 << CONFIG_SB8X8), m += (4 << CONFIG_SB8X8))
|
||||
mi_col += 8, m += 8)
|
||||
write_modes_sb(cpi, m, bc, tok, tok_end, mi_row, mi_col,
|
||||
BLOCK_SIZE_SB64X64);
|
||||
}
|
||||
@ -2152,19 +2045,12 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) {
|
||||
vp9_copy(cpi->common.fc.pre_uv_mode_prob, cpi->common.fc.uv_mode_prob);
|
||||
vp9_copy(cpi->common.fc.pre_bmode_prob, cpi->common.fc.bmode_prob);
|
||||
vp9_copy(cpi->common.fc.pre_sub_mv_ref_prob, cpi->common.fc.sub_mv_ref_prob);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_copy(cpi->common.fc.pre_mbsplit_prob, cpi->common.fc.mbsplit_prob);
|
||||
vp9_copy(cpi->common.fc.pre_i8x8_mode_prob, cpi->common.fc.i8x8_mode_prob);
|
||||
#endif
|
||||
vp9_copy(cpi->common.fc.pre_partition_prob, cpi->common.fc.partition_prob);
|
||||
cpi->common.fc.pre_nmvc = cpi->common.fc.nmvc;
|
||||
#if CONFIG_COMP_INTERINTRA_PRED
|
||||
cpi->common.fc.pre_interintra_prob = cpi->common.fc.interintra_prob;
|
||||
#endif
|
||||
vp9_zero(cpi->sub_mv_ref_count);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_zero(cpi->mbsplit_count);
|
||||
#endif
|
||||
vp9_zero(cpi->common.fc.mv_ref_ct);
|
||||
|
||||
update_coef_probs(cpi, &header_bc);
|
||||
|
@ -29,7 +29,7 @@ typedef struct {
|
||||
B_PREDICTION_MODE mode;
|
||||
int_mv mv;
|
||||
int_mv second_mv;
|
||||
} bmi[16 >> (2 * CONFIG_SB8X8)];
|
||||
} bmi[4];
|
||||
} PARTITION_INFO;
|
||||
|
||||
// Structure to hold snapshot of coding context during the mode picking process
|
||||
@ -117,9 +117,6 @@ struct macroblock {
|
||||
int mbmode_cost[2][MB_MODE_COUNT];
|
||||
int intra_uv_mode_cost[2][MB_MODE_COUNT];
|
||||
int bmode_costs[VP9_KF_BINTRAMODES][VP9_KF_BINTRAMODES][VP9_KF_BINTRAMODES];
|
||||
#if !CONFIG_SB8X8
|
||||
int i8x8_mode_costs[MB_MODE_COUNT];
|
||||
#endif
|
||||
int inter_bmode_costs[B_MODE_COUNT];
|
||||
int switchable_interp_costs[VP9_SWITCHABLE_FILTERS + 1]
|
||||
[VP9_SWITCHABLE_FILTERS];
|
||||
@ -143,11 +140,9 @@ struct macroblock {
|
||||
|
||||
// Structure to hold context for each of the 4 MBs within a SB:
|
||||
// when encoded as 4 independent MBs:
|
||||
#if CONFIG_SB8X8
|
||||
PICK_MODE_CONTEXT sb8_context[4][4][4];
|
||||
PICK_MODE_CONTEXT sb8x16_context[4][4][2];
|
||||
PICK_MODE_CONTEXT sb16x8_context[4][4][2];
|
||||
#endif
|
||||
PICK_MODE_CONTEXT mb_context[4][4];
|
||||
PICK_MODE_CONTEXT sb32x16_context[4][2];
|
||||
PICK_MODE_CONTEXT sb16x32_context[4][2];
|
||||
@ -164,12 +159,6 @@ struct macroblock {
|
||||
void (*fwd_txm16x16)(int16_t *input, int16_t *output, int pitch);
|
||||
void (*quantize_b_4x4)(MACROBLOCK *x, int b_idx, TX_TYPE tx_type,
|
||||
int y_blocks);
|
||||
#if !CONFIG_SB8X8
|
||||
void (*quantize_b_4x4_pair)(MACROBLOCK *x, int b_idx1, int b_idx2,
|
||||
int y_blocks);
|
||||
void (*quantize_b_8x8)(MACROBLOCK *x, int b_idx, TX_TYPE tx_type,
|
||||
int y_blocks);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // VP9_ENCODER_VP9_BLOCK_H_
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -112,151 +112,3 @@ void vp9_encode_intra16x16mbuv(VP9_COMMON *const cm, MACROBLOCK *x) {
|
||||
vp9_build_intra_predictors_sbuv_s(xd, BLOCK_SIZE_MB16X16);
|
||||
vp9_encode_sbuv(cm, x, BLOCK_SIZE_MB16X16);
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
void vp9_encode_intra8x8(MACROBLOCK *x, int ib) {
|
||||
MACROBLOCKD *xd = &x->e_mbd;
|
||||
uint8_t* const src =
|
||||
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib,
|
||||
x->plane[0].src.buf, x->plane[0].src.stride);
|
||||
int16_t* const src_diff =
|
||||
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, 0, ib,
|
||||
x->plane[0].src_diff);
|
||||
int16_t* const diff =
|
||||
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, 0, ib,
|
||||
xd->plane[0].diff);
|
||||
uint8_t* const dst =
|
||||
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib,
|
||||
xd->plane[0].dst.buf, xd->plane[0].dst.stride);
|
||||
const int iblock[4] = {0, 1, 4, 5};
|
||||
int i;
|
||||
TX_TYPE tx_type;
|
||||
|
||||
vp9_intra8x8_predict(xd, ib, xd->mode_info_context->bmi[ib].as_mode.first,
|
||||
dst, xd->plane[0].dst.stride);
|
||||
// generate residual blocks
|
||||
vp9_subtract_block(8, 8, src_diff, 16,
|
||||
src, x->plane[0].src.stride,
|
||||
dst, xd->plane[0].dst.stride);
|
||||
|
||||
if (xd->mode_info_context->mbmi.txfm_size == TX_8X8) {
|
||||
int idx = (ib & 0x02) ? (ib + 2) : ib;
|
||||
int16_t* const dqcoeff = BLOCK_OFFSET(xd->plane[0].dqcoeff, idx, 16);
|
||||
int16_t* const coeff = BLOCK_OFFSET(x->plane[0].coeff, idx, 16);
|
||||
|
||||
assert(idx < 16);
|
||||
tx_type = get_tx_type_8x8(xd, ib);
|
||||
if (tx_type != DCT_DCT) {
|
||||
vp9_short_fht8x8(src_diff, coeff, 16, tx_type);
|
||||
x->quantize_b_8x8(x, idx, tx_type, 16);
|
||||
vp9_short_iht8x8(dqcoeff, diff, 16, tx_type);
|
||||
} else {
|
||||
x->fwd_txm8x8(src_diff, coeff, 32);
|
||||
x->quantize_b_8x8(x, idx, DCT_DCT, 16);
|
||||
vp9_short_idct8x8(dqcoeff, diff, 32);
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 4; i++) {
|
||||
int idx = ib + iblock[i];
|
||||
int16_t* const dqcoeff = BLOCK_OFFSET(xd->plane[0].dqcoeff, idx, 16);
|
||||
int16_t* const coeff = BLOCK_OFFSET(x->plane[0].coeff, idx, 16);
|
||||
int16_t* const src_diff =
|
||||
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, 0, idx,
|
||||
x->plane[0].src_diff);
|
||||
int16_t* const diff =
|
||||
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, 0, idx,
|
||||
xd->plane[0].diff);
|
||||
|
||||
assert(idx < 16);
|
||||
tx_type = get_tx_type_4x4(xd, ib + iblock[i]);
|
||||
if (tx_type != DCT_DCT) {
|
||||
vp9_short_fht4x4(src_diff, coeff, 16, tx_type);
|
||||
x->quantize_b_4x4(x, ib + iblock[i], tx_type, 16);
|
||||
vp9_short_iht4x4(dqcoeff, diff, 16, tx_type);
|
||||
} else if (!(i & 1) &&
|
||||
get_tx_type_4x4(xd, ib + iblock[i] + 1) == DCT_DCT) {
|
||||
x->fwd_txm8x4(src_diff, coeff, 32);
|
||||
x->quantize_b_4x4_pair(x, ib + iblock[i], ib + iblock[i] + 1, 16);
|
||||
vp9_inverse_transform_b_4x4(xd, xd->plane[0].eobs[ib + iblock[i]],
|
||||
dqcoeff, diff, 32);
|
||||
vp9_inverse_transform_b_4x4(xd, xd->plane[0].eobs[ib + iblock[i] + 1],
|
||||
dqcoeff + 16, diff + 4, 32);
|
||||
i++;
|
||||
} else {
|
||||
x->fwd_txm4x4(src_diff, coeff, 32);
|
||||
x->quantize_b_4x4(x, ib + iblock[i], tx_type, 16);
|
||||
vp9_inverse_transform_b_4x4(xd, xd->plane[0].eobs[ib + iblock[i]],
|
||||
dqcoeff, diff, 32);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// reconstruct submacroblock
|
||||
for (i = 0; i < 4; i++) {
|
||||
int16_t* const diff =
|
||||
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, 0, ib + iblock[i],
|
||||
xd->plane[0].diff);
|
||||
uint8_t* const dst =
|
||||
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, 0, ib + iblock[i],
|
||||
xd->plane[0].dst.buf,
|
||||
xd->plane[0].dst.stride);
|
||||
vp9_recon_b_c(dst, diff, 16, dst, xd->plane[0].dst.stride);
|
||||
}
|
||||
}
|
||||
|
||||
void vp9_encode_intra8x8mby(MACROBLOCK *x) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
vp9_encode_intra8x8(x, vp9_i8x8_block[i]);
|
||||
}
|
||||
|
||||
static void encode_intra_uv4x4(MACROBLOCK *x, int ib, int mode) {
|
||||
MACROBLOCKD * const xd = &x->e_mbd;
|
||||
int16_t * const dqcoeff = MB_SUBBLOCK_FIELD(xd, dqcoeff, ib);
|
||||
int16_t* const coeff = MB_SUBBLOCK_FIELD(x, coeff, ib);
|
||||
const int plane = ib < 20 ? 1 : 2;
|
||||
const int block = ib < 20 ? ib - 16 : ib - 20;
|
||||
uint8_t* const src =
|
||||
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, plane, block,
|
||||
x->plane[plane].src.buf,
|
||||
x->plane[plane].src.stride);
|
||||
int16_t* const src_diff =
|
||||
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, plane, block,
|
||||
x->plane[plane].src_diff);
|
||||
int16_t* const diff =
|
||||
raster_block_offset_int16(xd, BLOCK_SIZE_MB16X16, plane, block,
|
||||
xd->plane[plane].diff);
|
||||
uint8_t* const dst =
|
||||
raster_block_offset_uint8(xd, BLOCK_SIZE_MB16X16, plane, block,
|
||||
xd->plane[plane].dst.buf,
|
||||
xd->plane[plane].dst.stride);
|
||||
|
||||
assert(ib >= 16 && ib < 24);
|
||||
vp9_intra_uv4x4_predict(&x->e_mbd, ib, mode,
|
||||
dst, xd->plane[plane].dst.stride);
|
||||
|
||||
assert(xd->plane[1].subsampling_x == 1);
|
||||
vp9_subtract_block(4, 4, src_diff, 8,
|
||||
src, x->plane[plane].src.stride,
|
||||
dst, xd->plane[plane].dst.stride);
|
||||
|
||||
x->fwd_txm4x4(src_diff, coeff, 16);
|
||||
x->quantize_b_4x4(x, ib, DCT_DCT, 16);
|
||||
vp9_inverse_transform_b_4x4(&x->e_mbd, xd->plane[plane].eobs[block],
|
||||
dqcoeff, diff, 16);
|
||||
|
||||
vp9_recon_uv_b_c(dst, diff, dst, xd->plane[plane].dst.stride);
|
||||
}
|
||||
|
||||
void vp9_encode_intra8x8mbuv(MACROBLOCK *x) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
int mode = x->e_mbd.mode_info_context->bmi[vp9_i8x8_block[i]].as_mode.first;
|
||||
|
||||
encode_intra_uv4x4(x, i + 16, mode); // u
|
||||
encode_intra_uv4x4(x, i + 20, mode); // v
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -17,10 +17,4 @@ int vp9_encode_intra(VP9_COMP *cpi, MACROBLOCK *x, int use_16x16_pred);
|
||||
void vp9_encode_intra16x16mby(VP9_COMMON *const cm, MACROBLOCK *x);
|
||||
void vp9_encode_intra16x16mbuv(VP9_COMMON *const cm, MACROBLOCK *x);
|
||||
void vp9_encode_intra4x4mby(MACROBLOCK *mb, BLOCK_SIZE_TYPE bs);
|
||||
#if !CONFIG_SB8X8
|
||||
void vp9_encode_intra8x8mby(MACROBLOCK *x);
|
||||
void vp9_encode_intra8x8mbuv(MACROBLOCK *x);
|
||||
void vp9_encode_intra8x8(MACROBLOCK *x, int ib);
|
||||
#endif
|
||||
|
||||
#endif // VP9_ENCODER_VP9_ENCODEINTRA_H_
|
||||
|
@ -404,9 +404,6 @@ void vp9_optimize_sby(VP9_COMMON *const cm, MACROBLOCK *x,
|
||||
struct optimize_block_args arg = {cm, x, &ctx};
|
||||
vp9_optimize_init(&x->e_mbd, bsize, &ctx);
|
||||
foreach_transformed_block_in_plane(&x->e_mbd, bsize, 0,
|
||||
#if !CONFIG_SB8X8
|
||||
0,
|
||||
#endif
|
||||
optimize_block, &arg);
|
||||
}
|
||||
|
||||
@ -551,9 +548,6 @@ void vp9_xform_quant_sby(VP9_COMMON *const cm, MACROBLOCK *x,
|
||||
struct encode_b_args arg = {cm, x, NULL};
|
||||
|
||||
foreach_transformed_block_in_plane(xd, bsize, 0,
|
||||
#if !CONFIG_SB8X8
|
||||
0,
|
||||
#endif
|
||||
xform_quant, &arg);
|
||||
}
|
||||
|
||||
@ -576,9 +570,6 @@ void vp9_encode_sby(VP9_COMMON *const cm, MACROBLOCK *x,
|
||||
vp9_optimize_init(xd, bsize, &ctx);
|
||||
|
||||
foreach_transformed_block_in_plane(xd, bsize, 0,
|
||||
#if !CONFIG_SB8X8
|
||||
0,
|
||||
#endif
|
||||
encode_block, &arg);
|
||||
|
||||
vp9_recon_sby(xd, bsize);
|
||||
|
@ -518,9 +518,9 @@ void vp9_first_pass(VP9_COMP *cpi) {
|
||||
int use_dc_pred = (mb_col || mb_row) && (!mb_col || !mb_row);
|
||||
|
||||
set_mi_row_col(cm, xd,
|
||||
mb_row << CONFIG_SB8X8,
|
||||
mb_row << 1,
|
||||
1 << mi_height_log2(BLOCK_SIZE_MB16X16),
|
||||
mb_col << CONFIG_SB8X8,
|
||||
mb_col << 1,
|
||||
1 << mi_height_log2(BLOCK_SIZE_MB16X16));
|
||||
|
||||
xd->plane[0].dst.buf = new_yv12->y_buffer + recon_yoffset;
|
||||
@ -623,8 +623,8 @@ void vp9_first_pass(VP9_COMP *cpi) {
|
||||
this_error = motion_error;
|
||||
vp9_set_mbmode_and_mvs(x, NEWMV, &mv);
|
||||
xd->mode_info_context->mbmi.txfm_size = TX_4X4;
|
||||
vp9_build_inter_predictors_sby(xd, mb_row << CONFIG_SB8X8,
|
||||
mb_col << CONFIG_SB8X8,
|
||||
vp9_build_inter_predictors_sby(xd, mb_row << 1,
|
||||
mb_col << 1,
|
||||
BLOCK_SIZE_MB16X16);
|
||||
vp9_encode_sb(cm, x, BLOCK_SIZE_MB16X16);
|
||||
sum_mvr += mv.as_mv.row;
|
||||
|
@ -385,7 +385,6 @@ static void separate_arf_mbs(VP9_COMP *cpi) {
|
||||
// goes in segment 0
|
||||
if (arf_not_zz[offset + mb_col]) {
|
||||
ncnt[0]++;
|
||||
#if CONFIG_SB8X8
|
||||
cpi->segmentation_map[offset * 4 + 2 * mb_col] = 0;
|
||||
cpi->segmentation_map[offset * 4 + 2 * mb_col + 1] = 0;
|
||||
cpi->segmentation_map[offset * 4 + 2 * mb_col + cm->mi_cols] = 0;
|
||||
@ -395,11 +394,6 @@ static void separate_arf_mbs(VP9_COMP *cpi) {
|
||||
cpi->segmentation_map[offset * 4 + 2 * mb_col + 1] = 1;
|
||||
cpi->segmentation_map[offset * 4 + 2 * mb_col + cm->mi_cols] = 1;
|
||||
cpi->segmentation_map[offset * 4 + 2 * mb_col + cm->mi_cols + 1] = 1;
|
||||
#else
|
||||
cpi->segmentation_map[offset + mb_col] = 0;
|
||||
} else {
|
||||
cpi->segmentation_map[offset + mb_col] = 1;
|
||||
#endif
|
||||
ncnt[1]++;
|
||||
}
|
||||
}
|
||||
|
@ -41,10 +41,6 @@ void vp9_init_mode_costs(VP9_COMP *c) {
|
||||
x->fc.uv_mode_prob[VP9_YMODES - 1], vp9_uv_mode_tree);
|
||||
vp9_cost_tokens(c->mb.intra_uv_mode_cost[0],
|
||||
x->kf_uv_mode_prob[VP9_YMODES - 1], vp9_uv_mode_tree);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_cost_tokens(c->mb.i8x8_mode_costs,
|
||||
x->fc.i8x8_mode_prob, vp9_i8x8_mode_tree);
|
||||
#endif
|
||||
|
||||
for (i = 0; i <= VP9_SWITCHABLE_FILTERS; ++i)
|
||||
vp9_cost_tokens((int *)c->mb.switchable_interp_costs[i],
|
||||
|
@ -617,9 +617,6 @@ static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode, int speed) {
|
||||
sf->thresh_mult[THR_D63_PRED ] += speed_multiplier * 1500;
|
||||
|
||||
sf->thresh_mult[THR_B_PRED ] += speed_multiplier * 2500;
|
||||
#if !CONFIG_SB8X8
|
||||
sf->thresh_mult[THR_I8X8_PRED] += speed_multiplier * 2500;
|
||||
#endif
|
||||
|
||||
sf->thresh_mult[THR_NEWMV ] += speed_multiplier * 1000;
|
||||
sf->thresh_mult[THR_NEWG ] += speed_multiplier * 1000;
|
||||
@ -858,10 +855,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
|
||||
}
|
||||
|
||||
cpi->mb.quantize_b_4x4 = vp9_regular_quantize_b_4x4;
|
||||
#if !CONFIG_SB8X8
|
||||
cpi->mb.quantize_b_4x4_pair = vp9_regular_quantize_b_4x4_pair;
|
||||
cpi->mb.quantize_b_8x8 = vp9_regular_quantize_b_8x8;
|
||||
#endif
|
||||
|
||||
vp9_init_quantizer(cpi);
|
||||
|
||||
@ -1622,12 +1615,12 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
|
||||
BFP(BLOCK_8X8, vp9_sad8x8, vp9_variance8x8, vp9_sub_pixel_variance8x8,
|
||||
NULL, NULL, NULL, vp9_sad8x8x3, vp9_sad8x8x8, vp9_sad8x8x4d)
|
||||
|
||||
#if CONFIG_SB8X8
|
||||
BFP(BLOCK_4X8, NULL, vp9_variance4x8, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL)
|
||||
|
||||
BFP(BLOCK_8X4, NULL, vp9_variance8x4, NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL)
|
||||
#endif
|
||||
|
||||
BFP(BLOCK_4X4, vp9_sad4x4, vp9_variance4x4, vp9_sub_pixel_variance4x4,
|
||||
NULL, NULL, NULL, vp9_sad4x4x3, vp9_sad4x4x8, vp9_sad4x4x4d)
|
||||
|
||||
@ -3307,13 +3300,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
|
||||
vp9_copy(cpi->common.fc.ymode_counts, cpi->ymode_count);
|
||||
vp9_copy(cpi->common.fc.uv_mode_counts, cpi->y_uv_mode_count);
|
||||
vp9_copy(cpi->common.fc.bmode_counts, cpi->bmode_count);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_copy(cpi->common.fc.i8x8_mode_counts, cpi->i8x8_mode_count);
|
||||
#endif
|
||||
vp9_copy(cpi->common.fc.sub_mv_ref_counts, cpi->sub_mv_ref_count);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_copy(cpi->common.fc.mbsplit_counts, cpi->mbsplit_count);
|
||||
#endif
|
||||
vp9_copy(cpi->common.fc.partition_counts, cpi->partition_count);
|
||||
#if CONFIG_COMP_INTERINTRA_PRED
|
||||
vp9_copy(cpi->common.fc.interintra_counts, cpi->interintra_count);
|
||||
|
@ -48,9 +48,9 @@
|
||||
#define KEY_FRAME_CONTEXT 5
|
||||
|
||||
#if CONFIG_COMP_INTERINTRA_PRED
|
||||
#define MAX_MODES 54 - CONFIG_SB8X8
|
||||
#define MAX_MODES 53
|
||||
#else
|
||||
#define MAX_MODES 42 - CONFIG_SB8X8
|
||||
#define MAX_MODES 41
|
||||
#endif
|
||||
|
||||
#define MIN_THRESHMULT 32
|
||||
@ -72,9 +72,6 @@ typedef struct {
|
||||
// Stats
|
||||
int y_modes[VP9_YMODES];
|
||||
int uv_modes[VP9_UV_MODES];
|
||||
#if !CONFIG_SB8X8
|
||||
int i8x8_modes[VP9_I8X8_MODES];
|
||||
#endif
|
||||
int b_modes[B_MODE_COUNT];
|
||||
int inter_y_modes[MB_MODE_COUNT];
|
||||
int inter_uv_modes[VP9_UV_MODES];
|
||||
@ -102,13 +99,7 @@ typedef struct {
|
||||
vp9_prob ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */
|
||||
vp9_prob uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1];
|
||||
vp9_prob bmode_prob[VP9_NKF_BINTRAMODES - 1];
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_prob i8x8_mode_prob[VP9_I8X8_MODES - 1];
|
||||
#endif
|
||||
vp9_prob sub_mv_ref_prob[SUBMVREF_COUNT][VP9_SUBMVREFS - 1];
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_prob mbsplit_prob[VP9_NUMMBSPLITS - 1];
|
||||
#endif
|
||||
vp9_prob partition_prob[NUM_PARTITION_CONTEXTS][PARTITION_TYPES - 1];
|
||||
|
||||
vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1]
|
||||
@ -213,9 +204,6 @@ typedef enum {
|
||||
THR_SPLITA,
|
||||
|
||||
THR_B_PRED,
|
||||
#if !CONFIG_SB8X8
|
||||
THR_I8X8_PRED,
|
||||
#endif
|
||||
|
||||
THR_COMP_ZEROLG,
|
||||
THR_COMP_NEARESTLG,
|
||||
@ -281,19 +269,12 @@ typedef struct {
|
||||
} SPEED_FEATURES;
|
||||
|
||||
enum BlockSize {
|
||||
#if CONFIG_SB8X8
|
||||
BLOCK_4X4,
|
||||
BLOCK_4X8,
|
||||
BLOCK_8X4,
|
||||
BLOCK_8X8,
|
||||
BLOCK_8X16,
|
||||
BLOCK_16X8,
|
||||
#else
|
||||
BLOCK_16X8 = PARTITIONING_16X8,
|
||||
BLOCK_8X16 = PARTITIONING_8X16,
|
||||
BLOCK_8X8 = PARTITIONING_8X8,
|
||||
BLOCK_4X4 = PARTITIONING_4X4,
|
||||
#endif
|
||||
BLOCK_16X16,
|
||||
BLOCK_MAX_SEGMENTS,
|
||||
BLOCK_32X32 = BLOCK_MAX_SEGMENTS,
|
||||
@ -468,13 +449,7 @@ typedef struct VP9_COMP {
|
||||
int sb_ymode_count [VP9_I32X32_MODES];
|
||||
int ymode_count[VP9_YMODES]; /* intra MB type cts this frame */
|
||||
int bmode_count[VP9_NKF_BINTRAMODES];
|
||||
#if !CONFIG_SB8X8
|
||||
int i8x8_mode_count[VP9_I8X8_MODES];
|
||||
#endif
|
||||
int sub_mv_ref_count[SUBMVREF_COUNT][VP9_SUBMVREFS];
|
||||
#if !CONFIG_SB8X8
|
||||
int mbsplit_count[VP9_NUMMBSPLITS];
|
||||
#endif
|
||||
int y_uv_mode_count[VP9_YMODES][VP9_UV_MODES];
|
||||
unsigned int partition_count[NUM_PARTITION_CONTEXTS][PARTITION_TYPES];
|
||||
#if CONFIG_COMP_INTERINTRA_PRED
|
||||
|
@ -133,39 +133,6 @@ void vp9_regular_quantize_b_4x4(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type,
|
||||
pt_scan, 1);
|
||||
}
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
void vp9_regular_quantize_b_8x8(MACROBLOCK *mb, int b_idx, TX_TYPE tx_type,
|
||||
int y_blocks) {
|
||||
MACROBLOCKD *const xd = &mb->e_mbd;
|
||||
const struct plane_block_idx pb_idx = plane_block_idx(y_blocks, b_idx);
|
||||
const int *pt_scan = get_scan_8x8(tx_type);
|
||||
|
||||
quantize(mb->plane[pb_idx.plane].zrun_zbin_boost,
|
||||
BLOCK_OFFSET(mb->plane[pb_idx.plane].coeff, pb_idx.block, 16),
|
||||
64, mb->skip_block,
|
||||
mb->plane[pb_idx.plane].zbin,
|
||||
mb->plane[pb_idx.plane].round,
|
||||
mb->plane[pb_idx.plane].quant,
|
||||
mb->plane[pb_idx.plane].quant_shift,
|
||||
BLOCK_OFFSET(xd->plane[pb_idx.plane].qcoeff, pb_idx.block, 16),
|
||||
BLOCK_OFFSET(xd->plane[pb_idx.plane].dqcoeff, pb_idx.block, 16),
|
||||
xd->plane[pb_idx.plane].dequant,
|
||||
mb->plane[pb_idx.plane].zbin_extra,
|
||||
&xd->plane[pb_idx.plane].eobs[pb_idx.block],
|
||||
pt_scan, 1);
|
||||
}
|
||||
|
||||
/* quantize_b_pair function pointer in MACROBLOCK structure is set to one of
|
||||
* these two C functions if corresponding optimized routine is not available.
|
||||
* NEON optimized version implements currently the fast quantization for pair
|
||||
* of blocks. */
|
||||
void vp9_regular_quantize_b_4x4_pair(MACROBLOCK *x, int b_idx1, int b_idx2,
|
||||
int y_blocks) {
|
||||
vp9_regular_quantize_b_4x4(x, b_idx1, DCT_DCT, y_blocks);
|
||||
vp9_regular_quantize_b_4x4(x, b_idx2, DCT_DCT, y_blocks);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void invert_quant(int16_t *quant, uint8_t *shift, int d) {
|
||||
unsigned t;
|
||||
int l;
|
||||
|
@ -138,13 +138,7 @@ void vp9_save_coding_context(VP9_COMP *cpi) {
|
||||
vp9_copy(cc->sb_ymode_prob, cm->fc.sb_ymode_prob);
|
||||
vp9_copy(cc->bmode_prob, cm->fc.bmode_prob);
|
||||
vp9_copy(cc->uv_mode_prob, cm->fc.uv_mode_prob);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_copy(cc->i8x8_mode_prob, cm->fc.i8x8_mode_prob);
|
||||
#endif
|
||||
vp9_copy(cc->sub_mv_ref_prob, cm->fc.sub_mv_ref_prob);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_copy(cc->mbsplit_prob, cm->fc.mbsplit_prob);
|
||||
#endif
|
||||
vp9_copy(cc->partition_prob, cm->fc.partition_prob);
|
||||
|
||||
// Stats
|
||||
@ -202,14 +196,8 @@ void vp9_restore_coding_context(VP9_COMP *cpi) {
|
||||
vp9_copy(cm->fc.ymode_prob, cc->ymode_prob);
|
||||
vp9_copy(cm->fc.sb_ymode_prob, cc->sb_ymode_prob);
|
||||
vp9_copy(cm->fc.bmode_prob, cc->bmode_prob);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_copy(cm->fc.i8x8_mode_prob, cc->i8x8_mode_prob);
|
||||
#endif
|
||||
vp9_copy(cm->fc.uv_mode_prob, cc->uv_mode_prob);
|
||||
vp9_copy(cm->fc.sub_mv_ref_prob, cc->sub_mv_ref_prob);
|
||||
#if !CONFIG_SB8X8
|
||||
vp9_copy(cm->fc.mbsplit_prob, cc->mbsplit_prob);
|
||||
#endif
|
||||
vp9_copy(cm->fc.partition_prob, cc->partition_prob);
|
||||
|
||||
// Stats
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -19,21 +19,10 @@ void vp9_initialize_rd_consts(VP9_COMP *cpi, int qindex);
|
||||
|
||||
void vp9_initialize_me_consts(VP9_COMP *cpi, int qindex);
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
void vp9_rd_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int *r, int *d);
|
||||
#endif
|
||||
|
||||
void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int *r, int *d, BLOCK_SIZE_TYPE bsize,
|
||||
PICK_MODE_CONTEXT *ctx);
|
||||
|
||||
#if !CONFIG_SB8X8
|
||||
void vp9_pick_mode_inter_macroblock(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int mi_row, int mi_col,
|
||||
int *r, int *d);
|
||||
#endif
|
||||
|
||||
int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int mi_row, int mi_col,
|
||||
int *r, int *d, BLOCK_SIZE_TYPE bsize,
|
||||
|
@ -193,17 +193,11 @@ static void count_segs_sb(VP9_COMP *cpi, MODE_INFO *mi,
|
||||
assert(bwl < bsl && bhl < bsl);
|
||||
if (bsize == BLOCK_SIZE_SB64X64) {
|
||||
subsize = BLOCK_SIZE_SB32X32;
|
||||
#if CONFIG_SB8X8
|
||||
} else if (bsize == BLOCK_SIZE_SB32X32) {
|
||||
subsize = BLOCK_SIZE_MB16X16;
|
||||
} else {
|
||||
assert(bsize == BLOCK_SIZE_MB16X16);
|
||||
subsize = BLOCK_SIZE_SB8X8;
|
||||
#else
|
||||
} else {
|
||||
assert(bsize == BLOCK_SIZE_SB32X32);
|
||||
subsize = BLOCK_SIZE_MB16X16;
|
||||
#endif
|
||||
}
|
||||
|
||||
for (n = 0; n < 4; n++) {
|
||||
@ -253,11 +247,11 @@ void vp9_choose_segmap_coding_method(VP9_COMP *cpi) {
|
||||
vp9_get_tile_col_offsets(cm, tile_col);
|
||||
mi_ptr = cm->mi + cm->cur_tile_mi_col_start;
|
||||
for (mi_row = 0; mi_row < cm->mi_rows;
|
||||
mi_row += (4 << CONFIG_SB8X8), mi_ptr += (4 << CONFIG_SB8X8) * mis) {
|
||||
mi_row += 8, mi_ptr += 8 * mis) {
|
||||
mi = mi_ptr;
|
||||
for (mi_col = cm->cur_tile_mi_col_start;
|
||||
mi_col < cm->cur_tile_mi_col_end;
|
||||
mi_col += (4 << CONFIG_SB8X8), mi += (4 << CONFIG_SB8X8)) {
|
||||
mi_col += 8, mi += 8) {
|
||||
count_segs_sb(cpi, mi, no_pred_segcounts, temporal_predictor_count,
|
||||
t_unpred_seg_counts, mi_row, mi_col, BLOCK_SIZE_SB64X64);
|
||||
}
|
||||
|
@ -375,9 +375,6 @@ int vp9_sby_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE_TYPE bsize) {
|
||||
int result = 1;
|
||||
struct is_skippable_args args = {xd, &result};
|
||||
foreach_transformed_block_in_plane(xd, bsize, 0,
|
||||
#if !CONFIG_SB8X8
|
||||
0,
|
||||
#endif
|
||||
is_skippable, &args);
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user