Merge "T8x8 experiment merge." into experimental
This commit is contained in:
Коммит
151b7f25db
|
@ -674,25 +674,19 @@ void encode_mb_row(VP8_COMP *cpi,
|
|||
vp8_activity_masking(cpi, x);
|
||||
|
||||
// Is segmentation enabled
|
||||
// MB level adjutment to quantizer
|
||||
if (xd->segmentation_enabled)
|
||||
{
|
||||
// Code to set segment id in xd->mbmi.segment_id for current MB (with range checking)
|
||||
#if CONFIG_T8X8
|
||||
// Reset segment_id to 0 or 1 so that the default transform mode is 4x4
|
||||
if (cpi->segmentation_map[map_index+mb_col] <= 3)
|
||||
xd->mode_info_context->mbmi.segment_id = cpi->segmentation_map[map_index+mb_col]&1;
|
||||
#else
|
||||
// Code to set segment id in xd->mbmi.segment_id
|
||||
if (cpi->segmentation_map[map_index+mb_col] <= 3)
|
||||
xd->mode_info_context->mbmi.segment_id = cpi->segmentation_map[map_index+mb_col];
|
||||
#endif
|
||||
else
|
||||
xd->mode_info_context->mbmi.segment_id = 0;
|
||||
|
||||
vp8cx_mb_init_quantizer(cpi, x);
|
||||
}
|
||||
else
|
||||
xd->mode_info_context->mbmi.segment_id = 0; // Set to Segment 0 by default
|
||||
// Set to Segment 0 by default
|
||||
xd->mode_info_context->mbmi.segment_id = 0;
|
||||
|
||||
x->active_ptr = cpi->active_map + map_index + mb_col;
|
||||
|
||||
|
@ -1522,10 +1516,6 @@ int vp8cx_encode_intra_macro_block(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t)
|
|||
{
|
||||
int rate;
|
||||
|
||||
#if CONFIG_T8X8
|
||||
if (x->e_mbd.segmentation_enabled)
|
||||
x->e_mbd.update_mb_segmentation_map = 1;
|
||||
#endif
|
||||
if (cpi->sf.RD && cpi->compressor_speed != 2)
|
||||
vp8_rd_pick_intra_mode(cpi, x, &rate);
|
||||
else
|
||||
|
@ -1549,10 +1539,6 @@ int vp8cx_encode_intra_macro_block(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t)
|
|||
vp8_encode_intra4x4mby(IF_RTCD(&cpi->rtcd), x);
|
||||
else
|
||||
{
|
||||
#if CONFIG_T8X8
|
||||
if (x->e_mbd.segmentation_enabled)
|
||||
x->e_mbd.mode_info_context->mbmi.segment_id |= (vp8_8x8_selection_intra(x) << 1);
|
||||
#endif
|
||||
vp8_encode_intra16x16mby(IF_RTCD(&cpi->rtcd), x);
|
||||
}
|
||||
#if CONFIG_I8X8
|
||||
|
@ -1729,11 +1715,6 @@ int vp8cx_encode_inter_macroblock
|
|||
cpi->count_mb_ref_frame_usage[xd->mode_info_context->mbmi.ref_frame]++;
|
||||
}
|
||||
|
||||
#if CONFIG_T8X8
|
||||
if (xd->segmentation_enabled)
|
||||
x->e_mbd.update_mb_segmentation_map = 1;
|
||||
#endif
|
||||
|
||||
if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME)
|
||||
{
|
||||
if (xd->mode_info_context->mbmi.mode == B_PRED)
|
||||
|
@ -1743,10 +1724,6 @@ int vp8cx_encode_inter_macroblock
|
|||
}
|
||||
else
|
||||
{
|
||||
#if CONFIG_T8X8
|
||||
if (xd->segmentation_enabled)
|
||||
*segment_id |= (vp8_8x8_selection_intra(x) << 1);
|
||||
#endif
|
||||
vp8_encode_intra16x16mbuv(IF_RTCD(&cpi->rtcd), x);
|
||||
vp8_encode_intra16x16mby(IF_RTCD(&cpi->rtcd), x);
|
||||
}
|
||||
|
@ -1756,10 +1733,6 @@ int vp8cx_encode_inter_macroblock
|
|||
else
|
||||
{
|
||||
int ref_fb_idx;
|
||||
#if CONFIG_T8X8
|
||||
if (xd->segmentation_enabled)
|
||||
*segment_id |= (vp8_8x8_selection_inter(x) << 1);
|
||||
#endif
|
||||
|
||||
if (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME)
|
||||
ref_fb_idx = cpi->common.lst_fb_idx;
|
||||
|
|
|
@ -488,19 +488,6 @@ static void init_seg_features(VP8_COMP *cpi)
|
|||
return;
|
||||
}
|
||||
|
||||
#if CONFIG_T8X8
|
||||
// TODO
|
||||
// For now 8x8TX mode just set segments up for 8x8 and 4x4 modes and exit.
|
||||
enable_segfeature(xd, 0, SEG_LVL_TRANSFORM);
|
||||
set_segdata( xd, 0, SEG_LVL_TRANSFORM, TX_4X4 );
|
||||
enable_segfeature(xd, 2, SEG_LVL_TRANSFORM);
|
||||
set_segdata( xd, 2, SEG_LVL_TRANSFORM, TX_8X8 );
|
||||
|
||||
// Turn on segmentation
|
||||
vp8_enable_segmentation((VP8_PTR)cpi);
|
||||
return;
|
||||
#endif
|
||||
|
||||
// Disable and clear down for KF
|
||||
if ( cm->frame_type == KEY_FRAME )
|
||||
{
|
||||
|
@ -547,6 +534,16 @@ static void init_seg_features(VP8_COMP *cpi)
|
|||
|
||||
// Where relevant assume segment data is delta data
|
||||
xd->mb_segement_abs_delta = SEGMENT_DELTADATA;
|
||||
|
||||
#if CONFIG_T8X8
|
||||
// 8x8TX test code.
|
||||
// This assignment does not necessarily make sense but is
|
||||
// just to test the mechanism for now.
|
||||
enable_segfeature(xd, 0, SEG_LVL_TRANSFORM);
|
||||
set_segdata( xd, 0, SEG_LVL_TRANSFORM, TX_4X4 );
|
||||
enable_segfeature(xd, 1, SEG_LVL_TRANSFORM);
|
||||
set_segdata( xd, 1, SEG_LVL_TRANSFORM, TX_8X8 );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -577,10 +574,15 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Disable segmentation and clear down features if alt ref
|
||||
// is not active for this group
|
||||
|
@ -616,12 +618,23 @@ 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 ) ||
|
||||
get_seg_tx_type( xd, 0 ) == TX_4X4 )
|
||||
{
|
||||
enable_segfeature(xd, 0, SEG_LVL_EOB);
|
||||
enable_segfeature(xd, 1, SEG_LVL_EOB);
|
||||
set_segdata( xd, 0, SEG_LVL_EOB, 0 );
|
||||
}
|
||||
|
||||
// EOB segment coding not fixed for 8x8 yet
|
||||
if ( !segfeature_active( xd, 1, SEG_LVL_TRANSFORM ) ||
|
||||
get_seg_tx_type( xd, 1 ) == TX_4X4 )
|
||||
{
|
||||
enable_segfeature(xd, 1, SEG_LVL_EOB);
|
||||
set_segdata( xd, 1, SEG_LVL_EOB, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
// Enable data udpate
|
||||
xd->update_mb_segmentation_data = 1;
|
||||
|
|
|
@ -539,6 +539,12 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
|
|||
{
|
||||
continue;
|
||||
}
|
||||
// No 4x4 modes if segment flagged as 8x8
|
||||
else if ( ( get_seg_tx_type( xd, segment_id ) == TX_8X8 ) &&
|
||||
( (this_mode == B_PRED) || (this_mode == SPLITMV) ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//#if !CONFIG_SEGFEATURES
|
||||
// Disable this drop out case if either the mode or ref frame
|
||||
// segment level feature is enabled for this segment. This is to
|
||||
|
|
|
@ -2146,6 +2146,12 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
|
|||
{
|
||||
continue;
|
||||
}
|
||||
// No 4x4 modes if segment flagged as 8x8
|
||||
else if ( ( get_seg_tx_type( xd, segment_id ) == TX_8X8 ) &&
|
||||
( (this_mode == B_PRED) || (this_mode == SPLITMV) ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//#if !CONFIG_SEGFEATURES
|
||||
// Disable this drop out case if either the mode or ref frame
|
||||
// segment level feature is enabled for this segment. This is to
|
||||
|
|
Загрузка…
Ссылка в новой задаче