Commit f64725a0 authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Paul Wilkins

Improved coding using 8x8 transform

In summary, this commit encompasses a series of changes in attempt to
improve the 8x8 transform based coding to help overall compression
quality, please refer to the detailed commit history below for what
are the rationale underly the series of changes:

a. A frame level flag to indicate if 8x8 transform is used at all.
b. 8x8 transform is not used for key frames and small image size.
c. On inter coded frame, macroblocks using modes B_PRED, SPLIT_MV
and I8X8_PRED are forced to using 4x4 transform based coding, the
rest uses 8x8 transform based coding.
d. Encoder and decoder has the same assumption on the relationship
between prediction modes and transform size, therefore no signaling
is encoded in bitstream.
e. Mode decision process now calculate the rate and distortion scores
using their respective transforms.

Overall test results:
1. HD set
http://www.corp.google.com/~yaowu/no_crawl/t8x8/HD_t8x8_20120206.html
(avg psnr: 3.09% glb psnr: 3.22%, ssim: 3.90%)
2. Cif set:
http://www.corp.google.com/~yaowu/no_crawl/t8x8/cif_t8x8_20120206.html
(avg psnr: -0.03%, glb psnr: -0.02%, ssim: -0.04%)
It should be noted here, as 8x8 transform coding itself is disabled
for cif size clips, the 0.03% loss is purely from the 1 bit/frame
flag overhead on if 8x8 transform is used or not for the frame.

---patch history for future reference---
Patch 1:
this commit tries to select transform size based on macroblock
prediction mode. If the size of a prediction mode is 16x16, then
the macroblock is forced to use 8x8 transform. If the prediction
mode is B_PRED, SPLITMV or I8X8_PRED, then the macroblock is forced
to use 4x4 transform. Tests on the following HD clips showed mixed
results: (all hd clips only used first 100 frames in the test)

http://www.corp.google.com/~yaowu/no_crawl/t8x8/hdmodebased8x8.html
http://www.corp.google.com/~yaowu/no_crawl/t8x8/hdmodebased8x8_log.html

while the results are mixed and overall negative, it is interesting to
see 8x8 helped a few of the clips.

Patch 2:
this patch tries to hard-wire selection of transform size based on
prediction modes without using segmentation to signal the transform size.
encoder and decoder both takes the same assumption that all macroblocks
use 8x8 transform except when prediciton mode is B_PRED, I8X8_PRED or
SPLITMV. Test results are as follows:

http://www.corp.google.com/~yaowu/no_crawl/t8x8/cifmodebase8x8_0125.html
http://www.corp.google.com/~yaowu/no_crawl/t8x8/hdmodebased8x8_0125log.html

Interestingly, by removing the overhead or coding the segmentation, the
results on this limited HD set have turn positive on average.

Patch 3:
this patch disabled the usage of 8x8 transform on key frames, and kept the
logic from patch 2 for inter frames only. test results on HD set turned
decidedly positive with 8x8 transform enabled on inter frame with 16x16
prediction modes: (avg psnr: .81% glb psnr: .82 ssim: .55%)

http://www.corp.google.com/~yaowu/no_crawl/t8x8/hdintermode8x8_0125.html
results on cif set still negative overall

Patch 4:
continued from last patch, but now in mode decision process, the rate and
distortion estimates are computed based on 8x8 transform results for MBs
with modes associated with 8x8 transform. This patch also fixed a problem
related to segment based eob coding when 8x8 transform is used. The patch
significantly improved the results on HD clips:

http://www.corp.google.com/~yaowu/no_crawl/t8x8/hd8x8RDintermode.html
(avg psnr: 2.70% glb psnr: 2.76% ssim: 3.34%)
results on cif also improved, though they are still negative compared to
baseline that uses 4x4 transform only:
http://www.corp.google.com/~yaowu/no_crawl/t8x8/cif8x8RDintermode.html
(avg psnr: -.78% glb psnr: -.86% ssim: -.19%)

Patch 5:
This patch does 3 things:
a. a bunch of decoder bug fixes, encodings and decodings were verified
to have matched recon buffer on a number of encodes on cif size mobile and
hd version of _pedestrian.
b. the patch further improved the rate distortion calculation of MBS that
use 8x8 transform. This provided some further gain on compression.
c. the patch also got the experimental work SEG_LVL_EOB to work with 8x8
transformed macroblock, test results indicates it improves the cif set
but hurt the HD set slightly.

Tests results on HD clips:
http://www.corp.google.com/~yaowu/no_crawl/t8x8/HD_t8x8_20120201.html
(avg psnr: 3.19% glb psnr: 3.30% ssim: 3.93%)

Test results on cif clips:
http://www.corp.google.com/~yaowu/no_crawl/t8x8/cif_t8x8_20120201.html
(avg psnr: -.47% glb psnr: -.51% ssim: +.28%)

Patch 6:
Added a frame level flag to indicate if 8x8 transform is allowed at all.
temporarily the decision is based on frame size, can be optimized later
one. This get the cif results to basically unchanged, with one bit per
frame overhead on both cif and hd clips.

Patch 8:
Rebase and Merge to head by PGW.
Fixed some suspect 4s that look like hey should be 64s in regard
to segmented EOB. Perhaps #defines would be bette.
Bulit and tested without T8x8 enabled and produces unchanged
output.

Patch 9:
Corrected misalligned code/decode of "txfm_mode" bit.
Limited testing for correct encode and decode with
T8x8 configured on derf clips.

Change-Id: I156e1405d25f81579d579dff8ab9af53944ec49c
parent e3ca23a3
......@@ -211,6 +211,9 @@ void vp8_create_common(VP8_COMMON *oci)
vp8_default_bmode_probs(oci->fc.bmode_prob);
#if CONFIG_T8X8
oci->txfm_mode = ONLY_4X4;
#endif
oci->mb_no_coeff_skip = 1;
oci->dual_pred_mode = HYBRID_PREDICTION;
oci->no_lpf = 0;
......
......@@ -90,6 +90,15 @@ typedef enum
NB_PREDICTION_TYPES = 3,
} DUALPREDMODE_TYPE;
#if CONFIG_T8X8
/* TODO: allows larger transform */
typedef enum
{
ONLY_4X4 = 0,
ALLOW_8X8 = 1
} TXFM_MODE;
#endif /* CONFIG_T8X8 */
typedef struct VP8_COMMON_RTCD
{
#if CONFIG_RUNTIME_CPU_DETECT
......@@ -147,6 +156,9 @@ typedef struct VP8Common
/* profile settings */
int experimental;
int mb_no_coeff_skip;
#if CONFIG_T8X8
TXFM_MODE txfm_mode;
#endif
DUALPREDMODE_TYPE dual_pred_mode;
int no_lpf;
int use_bilinear_mc_filter;
......
......@@ -405,6 +405,8 @@ static void clamp_uvmv_to_umv_border(MV *mv, const MACROBLOCKD *xd)
(xd->mb_to_bottom_edge + (16 << 3)) >> 1 : mv->row;
}
void vp8_build_inter16x16_predictors_mb(MACROBLOCKD *x,
unsigned char *dst_y,
unsigned char *dst_u,
......@@ -559,6 +561,7 @@ static void build_inter4x4_predictors_mb(MACROBLOCKD *x)
clamp_mv_to_umv_border(&x->block[10].bmi.mv.as_mv, x);
}
build_inter_predictors4b(x, &x->block[ 0], 16);
build_inter_predictors4b(x, &x->block[ 2], 16);
build_inter_predictors4b(x, &x->block[ 8], 16);
......@@ -642,6 +645,9 @@ void build_4x4uvmvs(MACROBLOCKD *x)
x->block[uoffset].bmi.mv.as_mv.col = (temp / 8) & x->fullpixel_mask;
if (x->mode_info_context->mbmi.need_to_clamp_mvs)
clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.mv.as_mv, x);
if (x->mode_info_context->mbmi.need_to_clamp_mvs)
clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.mv.as_mv, x);
......
......@@ -165,9 +165,22 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
int i;
#if CONFIG_T8X8
int tx_type = get_seg_tx_type( xd,
xd->mode_info_context->mbmi.segment_id);
xd->mode_info_context->mbmi.txfm_size = tx_type;
int tx_type;
if( pbi->common.txfm_mode==ONLY_4X4 )
{
xd->mode_info_context->mbmi.txfm_size = TX_4X4;
}
else if( pbi->common.txfm_mode == ALLOW_8X8 )
{
if( xd->mode_info_context->mbmi.mode ==B_PRED
||xd->mode_info_context->mbmi.mode ==I8X8_PRED
||xd->mode_info_context->mbmi.mode ==SPLITMV)
xd->mode_info_context->mbmi.txfm_size = TX_4X4;
else
xd->mode_info_context->mbmi.txfm_size = TX_8X8;
}
tx_type = xd->mode_info_context->mbmi.txfm_size;
#endif
if (xd->mode_info_context->mbmi.mb_skip_coeff)
......@@ -1243,6 +1256,10 @@ int vp8_decode_frame(VP8D_COMP *pbi)
}
/* Read the loop filter level and type */
#if CONFIG_T8X8
pc->txfm_mode = (TXFM_MODE) vp8_read_bit(bc);
#endif
pc->filter_type = (LOOPFILTERTYPE) vp8_read_bit(bc);
pc->filter_level = vp8_read_literal(bc, 6);
pc->sharpness_level = vp8_read_literal(bc, 3);
......@@ -1420,6 +1437,7 @@ int vp8_decode_frame(VP8D_COMP *pbi)
}
}
#if CONFIG_T8X8
if(pbi->common.txfm_mode == ALLOW_8X8)
{
// read coef probability tree
......
......@@ -292,6 +292,9 @@ int vp8_decode_mb_tokens_8x8(VP8D_COMP *dx, MACROBLOCKD *x)
INT16 v;
const vp8_prob *Prob;//
int seg_eob;
int segment_id = x->mode_info_context->mbmi.segment_id;
type = 3;
i = 0;
stop = 16;
......@@ -338,16 +341,32 @@ BLOCK_LOOP_8x8:
if(i==24)
{
VP8_COMBINEENTROPYCONTEXTS(v, *a, *l);
if ( segfeature_active( x, segment_id, SEG_LVL_EOB ) )
{
seg_eob = get_segdata( x, segment_id, SEG_LVL_EOB );
}
else
seg_eob = 64;
}
else
{
VP8_COMBINEENTROPYCONTEXTS_8x8(v, *a, *l, *a1, *l1);
if ( segfeature_active( x, segment_id, SEG_LVL_EOB ) )
{
seg_eob = get_segdata( x, segment_id, SEG_LVL_EOB );
}
else
seg_eob = 64;
}
Prob = coef_probs;
Prob += v * ENTROPY_NODES;
DO_WHILE_8x8:
//#if CONFIG_SEGFEATURES
if ( c == seg_eob )
goto BLOCK_FINISHED_8x8;
if(i==24)
Prob += coef_bands_x[c];
else
......
......@@ -2145,60 +2145,61 @@ int vp8_estimate_entropy_savings(VP8_COMP *cpi)
#if CONFIG_T8X8
do
/* do not do this if not evena allowed */
if(cpi->common.txfm_mode == ALLOW_8X8)
{
int j = 0;
do
{
int k = 0;
int j = 0;
do
{
/* at every context */
/* calc probs and branch cts for this frame only */
//vp8_prob new_p [ENTROPY_NODES];
//unsigned int branch_ct [ENTROPY_NODES] [2];
int t = 0; /* token/prob index */
vp8_tree_probs_from_distribution(
MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree,
cpi->frame_coef_probs_8x8 [i][j][k], cpi->frame_branch_ct_8x8 [i][j][k], cpi->coef_counts_8x8 [i][j][k],
256, 1
);
int k = 0;
do
{
const unsigned int *ct = cpi->frame_branch_ct_8x8 [i][j][k][t];
const vp8_prob newp = cpi->frame_coef_probs_8x8 [i][j][k][t];
/* at every context */
/* calc probs and branch cts for this frame only */
//vp8_prob new_p [ENTROPY_NODES];
//unsigned int branch_ct [ENTROPY_NODES] [2];
int t = 0; /* token/prob index */
vp8_tree_probs_from_distribution(
MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree,
cpi->frame_coef_probs_8x8 [i][j][k],
cpi->frame_branch_ct_8x8 [i][j][k],
cpi->coef_counts_8x8 [i][j][k],
256, 1
);
const vp8_prob old = cpi->common.fc.coef_probs_8x8 [i][j][k][t];
const vp8_prob upd = vp8_coef_update_probs_8x8 [i][j][k][t];
do
{
const unsigned int *ct = cpi->frame_branch_ct_8x8 [i][j][k][t];
const vp8_prob newp = cpi->frame_coef_probs_8x8 [i][j][k][t];
const int old_b = vp8_cost_branch(ct, old);
const int new_b = vp8_cost_branch(ct, newp);
const vp8_prob old = cpi->common.fc.coef_probs_8x8 [i][j][k][t];
const vp8_prob upd = vp8_coef_update_probs_8x8 [i][j][k][t];
const int update_b = 8 +
((vp8_cost_one(upd) - vp8_cost_zero(upd)) >> 8);
const int old_b = vp8_cost_branch(ct, old);
const int new_b = vp8_cost_branch(ct, newp);
const int s = old_b - new_b - update_b;
const int update_b = 8 +
((vp8_cost_one(upd) - vp8_cost_zero(upd)) >> 8);
if (s > 0)
savings += s;
const int s = old_b - new_b - update_b;
if (s > 0)
savings += s;
}
while (++t < MAX_ENTROPY_TOKENS - 1);
}
while (++t < MAX_ENTROPY_TOKENS - 1);
}
while (++k < PREV_COEF_CONTEXTS);
}
while (++k < PREV_COEF_CONTEXTS);
while (++j < COEF_BANDS);
}
while (++j < COEF_BANDS);
while (++i < BLOCK_TYPES);
}
while (++i < BLOCK_TYPES);
#endif
......@@ -2329,91 +2330,94 @@ static void update_coef_probs(VP8_COMP *cpi)
while (++i < BLOCK_TYPES);
#if CONFIG_T8X8
i = 0;
do
/* do not do this if not evena allowed */
if(cpi->common.txfm_mode == ALLOW_8X8)
{
int j = 0;
i = 0;
do
{
int k = 0;
int j = 0;
do
{
//note: use result from vp8_estimate_entropy_savings, so no need to call vp8_tree_probs_from_distribution here.
/* at every context */
int k = 0;
/* calc probs and branch cts for this frame only */
//vp8_prob new_p [ENTROPY_NODES];
//unsigned int branch_ct [ENTROPY_NODES] [2];
do
{
//note: use result from vp8_estimate_entropy_savings, so no need to call vp8_tree_probs_from_distribution here.
/* at every context */
int t = 0; /* token/prob index */
/* calc probs and branch cts for this frame only */
//vp8_prob new_p [ENTROPY_NODES];
//unsigned int branch_ct [ENTROPY_NODES] [2];
//vp8_tree_probs_from_distribution(
// MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree,
// new_p, branch_ct, (unsigned int *)cpi->coef_counts [i][j][k],
// 256, 1
// );
int t = 0; /* token/prob index */
do
{
const unsigned int *ct = cpi->frame_branch_ct_8x8 [i][j][k][t];
const vp8_prob newp = cpi->frame_coef_probs_8x8 [i][j][k][t];
//vp8_tree_probs_from_distribution(
// MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree,
// new_p, branch_ct, (unsigned int *)cpi->coef_counts [i][j][k],
// 256, 1
// );
vp8_prob *Pold = cpi->common.fc.coef_probs_8x8 [i][j][k] + t;
const vp8_prob old = *Pold;
const vp8_prob upd = vp8_coef_update_probs_8x8 [i][j][k][t];
do
{
const unsigned int *ct = cpi->frame_branch_ct_8x8 [i][j][k][t];
const vp8_prob newp = cpi->frame_coef_probs_8x8 [i][j][k][t];
const int old_b = vp8_cost_branch(ct, old);
const int new_b = vp8_cost_branch(ct, newp);
vp8_prob *Pold = cpi->common.fc.coef_probs_8x8 [i][j][k] + t;
const vp8_prob old = *Pold;
const vp8_prob upd = vp8_coef_update_probs_8x8 [i][j][k][t];
const int update_b = 8 +
((vp8_cost_one(upd) - vp8_cost_zero(upd)) >> 8);
const int old_b = vp8_cost_branch(ct, old);
const int new_b = vp8_cost_branch(ct, newp);
const int s = old_b - new_b - update_b;
const int u = s > 0 ? 1 : 0;
const int update_b = 8 +
((vp8_cost_one(upd) - vp8_cost_zero(upd)) >> 8);
vp8_write(w, u, upd);
const int s = old_b - new_b - update_b;
const int u = s > 0 ? 1 : 0;
vp8_write(w, u, upd);
#ifdef ENTROPY_STATS
++ tree_update_hist_8x8 [i][j][k][t] [u];
++ tree_update_hist_8x8 [i][j][k][t] [u];
#endif
if (u)
{
/* send/use new probability */
if (u)
{
/* send/use new probability */
*Pold = newp;
vp8_write_literal(w, newp, 8);
*Pold = newp;
vp8_write_literal(w, newp, 8);
savings += s;
savings += s;
}
}
}
while (++t < MAX_ENTROPY_TOKENS - 1);
}
while (++t < MAX_ENTROPY_TOKENS - 1);
/* Accum token counts for generation of default statistics */
/* Accum token counts for generation of default statistics */
#ifdef ENTROPY_STATS
t = 0;
t = 0;
do
{
context_counters_8x8 [i][j][k][t] += cpi->coef_counts_8x8 [i][j][k][t];
}
while (++t < MAX_ENTROPY_TOKENS);
do
{
context_counters_8x8 [i][j][k][t] += cpi->coef_counts_8x8 [i][j][k][t];
}
while (++t < MAX_ENTROPY_TOKENS);
#endif
}
while (++k < PREV_COEF_CONTEXTS);
}
while (++k < PREV_COEF_CONTEXTS);
while (++j < COEF_BANDS);
}
while (++j < COEF_BANDS);
while (++i < BLOCK_TYPES);
}
while (++i < BLOCK_TYPES);
#endif
#endif
}
#ifdef PACKET_TESTING
FILE *vpxlogc = 0;
......@@ -2664,6 +2668,10 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
}
}
#if CONFIG_T8X8
vp8_write_bit(bc, pc->txfm_mode);
#endif
// Encode the loop filter level and type
vp8_write_bit(bc, pc->filter_type);
vp8_write_literal(bc, pc->filter_level, 6);
......
......@@ -47,6 +47,9 @@ typedef struct
int src_stride;
int eob_max_offset;
#if CONFIG_T8X8
int eob_max_offset_8x8;
#endif
} BLOCK;
......
......@@ -937,6 +937,11 @@ void encode_mb_row(VP8_COMP *cpi,
x->active_ptr = cpi->active_map + map_index + mb_col;
#if CONFIG_T8X8
/* force 4x4 transform for mode selection */
xd->mode_info_context->mbmi.txfm_size = TX_4X4;
#endif
if (cm->frame_type == KEY_FRAME)
{
*totalrate += vp8cx_encode_intra_macro_block(cpi, x, tp);
......@@ -1727,6 +1732,22 @@ int vp8cx_encode_intra_macro_block(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t)
vp8_update_zbin_extra(cpi, x);
}
#if CONFIG_T8X8
/* test code: set transform size based on mode selection */
if(cpi->common.txfm_mode == ALLOW_8X8
&& x->e_mbd.mode_info_context->mbmi.mode != I8X8_PRED
&& x->e_mbd.mode_info_context->mbmi.mode != B_PRED)
{
x->e_mbd.mode_info_context->mbmi.txfm_size = TX_8X8;
cpi->t8x8_count++;
}
else
{
x->e_mbd.mode_info_context->mbmi.txfm_size = TX_4X4;
cpi->t4x4_count ++;
}
#endif
if(x->e_mbd.mode_info_context->mbmi.mode == I8X8_PRED)
{
vp8_encode_intra8x8mby(IF_RTCD(&cpi->rtcd), x);
......@@ -1741,16 +1762,7 @@ int vp8cx_encode_intra_macro_block(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t)
vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x);
sum_intra_stats(cpi, x);
vp8_tokenize_mb(cpi, &x->e_mbd, t);
#if CONFIG_T8X8
if ( get_seg_tx_type(&x->e_mbd,
x->e_mbd.mode_info_context->mbmi.segment_id)
== TX_8X8 )
{
cpi->t8x8_count++;
}
else
cpi->t4x4_count++;
#endif
return rate;
}
#ifdef SPEEDSTATS
......@@ -1817,6 +1829,22 @@ int vp8cx_encode_inter_macroblock
cpi->dual_pred_count[pred_context]++;
}
#if CONFIG_T8X8
/* test code: set transform size based on mode selection */
if( cpi->common.txfm_mode == ALLOW_8X8
&& x->e_mbd.mode_info_context->mbmi.mode != I8X8_PRED
&& x->e_mbd.mode_info_context->mbmi.mode != B_PRED
&& x->e_mbd.mode_info_context->mbmi.mode != SPLITMV)
{
x->e_mbd.mode_info_context->mbmi.txfm_size = TX_8X8;
cpi->t8x8_count ++;
}
else
{
x->e_mbd.mode_info_context->mbmi.txfm_size = TX_4X4;
cpi->t4x4_count++;
}
#endif
/* switch back to the regular quantizer for the encode */
if (cpi->sf.improved_quant)
{
......@@ -1825,7 +1853,6 @@ int vp8cx_encode_inter_macroblock
cpi->mb.quantize_b_pair = QUANTIZE_INVOKE(&cpi->rtcd.quantize,
quantb_pair);
}
/* restore cpi->zbin_mode_boost_enabled */
cpi->zbin_mode_boost_enabled = zbin_mode_boost_enabled;
......@@ -2015,14 +2042,6 @@ int vp8cx_encode_inter_macroblock
xd->dst.y_stride, xd->dst.uv_stride);
}
}
#if CONFIG_T8X8
if ( get_seg_tx_type( xd, *segment_id ) == TX_8X8 )
{
cpi->t8x8_count++;
}
else
cpi->t4x4_count++;
#endif
if (!x->skip)
{
......@@ -2066,6 +2085,5 @@ int vp8cx_encode_inter_macroblock
cpi->skip_false_count ++;
}
}
return rate;
}
......@@ -100,9 +100,7 @@ void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x)
BLOCK *b = &x->block[0];
#if CONFIG_T8X8
int tx_type = get_seg_tx_type(&x->e_mbd,
x->e_mbd.mode_info_context->mbmi.segment_id);
x->e_mbd.mode_info_context->mbmi.txfm_size = tx_type;
int tx_type = x->e_mbd.mode_info_context->mbmi.txfm_size;
#endif
RECON_INVOKE(&rtcd->common->recon, build_intra_predictors_mby)(&x->e_mbd);
......@@ -179,11 +177,8 @@ void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x)
void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x)
{
#if CONFIG_T8X8
int tx_type = get_seg_tx_type(&x->e_mbd,
x->e_mbd.mode_info_context->mbmi.segment_id);
x->e_mbd.mode_info_context->mbmi.txfm_size = tx_type;
int tx_type = x->e_mbd.mode_info_context->mbmi.txfm_size;
#endif
RECON_INVOKE(&rtcd->common->recon, build_intra_predictors_mbuv)(&x->e_mbd);
ENCODEMB_INVOKE(&rtcd->encodemb, submbuv)(x->src_diff, x->src.u_buffer, x->src.v_buffer, x->e_mbd.predictor, x->src.uv_stride);
......
......@@ -1258,9 +1258,7 @@ void vp8_optimize_mbuv_8x8(MACROBLOCK *x, const VP8_ENCODER_RTCD *rtcd)
void vp8_encode_inter16x16(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x)
{
#if CONFIG_T8X8
int tx_type = get_seg_tx_type(&x->e_mbd,
x->e_mbd.mode_info_context->mbmi.segment_id);
x->e_mbd.mode_info_context->mbmi.txfm_size = tx_type;
int tx_type = x->e_mbd.mode_info_context->mbmi.txfm_size;
#endif
vp8_build_inter_predictors_mb(&x->e_mbd);
......@@ -1357,8 +1355,7 @@ void vp8_encode_inter16x16(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x)
void vp8_encode_inter16x16y(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x)
{
#if CONFIG_T8X8
int tx_type = get_seg_tx_type(&x->e_mbd,
x->e_mbd.mode_info_context->mbmi.segment_id);
int tx_type = x->e_mbd.mode_info_context->mbmi.txfm_size;
#endif
BLOCK *b = &x->block[0];
......
......@@ -359,6 +359,9 @@ static void setup_mbby_copy(MACROBLOCK *mbdst, MACROBLOCK *mbsrc)
*/
z->block[i].src_stride = x->block[i].src_stride;
z->block[i].eob_max_offset = x->block[i].eob_max_offset;
#if CONFIG_T8X8
z->block[i].eob_max_offset_8x8 = x->block[i].eob_max_offset_8x8;
#endif
}
{
......
......@@ -579,16 +579,11 @@ static void init_seg_features(VP8_COMP *cpi)
set_segdata( xd, 1, SEG_LVL_MODE, ZEROMV );
enable_segfeature(xd, 1, SEG_LVL_MODE);
if ( !segfeature_active( xd, 1, SEG_LVL_TRANSFORM ) ||
get_seg_tx_type( xd, 1 ) == TX_4X4 )
{
// EOB segment coding not fixed for 8x8 yet
set_segdata( xd, 1, SEG_LVL_EOB, 0 );
enable_segfeature(xd, 1, SEG_LVL_EOB);
}
// EOB segment coding not fixed for 8x8 yet
set_segdata( xd, 1, SEG_LVL_EOB, 0 );
enable_segfeature(xd, 1, SEG_LVL_EOB);
}
}
// Disable segmentation and clear down features if alt ref
// is not active for this group
else
......@@ -627,23 +622,11 @@ static void init_seg_features(VP8_COMP *cpi)
// Skip all MBs if high Q
if ( high_q )
{
// EOB segment coding not fixed for 8x8 yet
if ( !segfeature_active( xd, 0, SEG_LVL_TRANSFORM ) ||