#endif
// Segment features
- signed char segment_feature_data[SEG_LVL_MAX][MAX_MB_SEGMENTS];
+ signed char segment_feature_data[MAX_MB_SEGMENTS][SEG_LVL_MAX];
/* mode_based Loop filter adjustment */
unsigned char mode_ref_lf_delta_enabled;
/* Abs value */
if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA)
{
- lvl_seg = mbd->segment_feature_data[SEG_LVL_ALT_LF][seg];
+ lvl_seg = mbd->segment_feature_data[seg][SEG_LVL_ALT_LF];
}
else /* Delta Value */
{
- lvl_seg += mbd->segment_feature_data[SEG_LVL_ALT_LF][seg];
+ lvl_seg += mbd->segment_feature_data[seg][SEG_LVL_ALT_LF];
lvl_seg = (lvl_seg > 0) ? ((lvl_seg > 63) ? 63: lvl_seg) : 0;
}
}
{ /* Abs value */
if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA)
{
- lvl_seg[i] = mbd->segment_feature_data[SEG_LVL_ALT_LF][i];
+ lvl_seg[i] = mbd->segment_feature_data[i][SEG_LVL_ALT_LF];
}
/* Delta Value */
else
{
lvl_seg[i] = default_filt_lvl
- + mbd->segment_feature_data[SEG_LVL_ALT_LF][i];
+ + mbd->segment_feature_data[i][SEG_LVL_ALT_LF];
lvl_seg[i] = (lvl_seg[i] > 0) ?
((lvl_seg[i] > 63) ? 63: lvl_seg[i]) : 0;
}
{
/* Abs Value */
if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA)
- QIndex = xd->segment_feature_data[SEG_LVL_ALT_Q][mbmi->segment_id];
+ QIndex = xd->segment_feature_data[mbmi->segment_id][SEG_LVL_ALT_Q];
/* Delta Value */
else
{
- QIndex = pc->base_qindex + xd->segment_feature_data[SEG_LVL_ALT_Q][mbmi->segment_id];
+ QIndex = pc->base_qindex +
+ xd->segment_feature_data[mbmi->segment_id][SEG_LVL_ALT_Q];
QIndex = (QIndex >= 0) ? ((QIndex <= MAXQ) ? QIndex : MAXQ) : 0; /* Clamp to valid range */
}
}
/* Frame level data */
if (vp8_read_bit(bc))
{
- xd->segment_feature_data[i][j] = (signed char)vp8_read_literal(bc, mb_feature_data_bits[i]);
+ xd->segment_feature_data[j][i] = (signed char)vp8_read_literal(bc, mb_feature_data_bits[i]);
if (vp8_read_bit(bc))
- xd->segment_feature_data[i][j] = -xd->segment_feature_data[i][j];
+ xd->segment_feature_data[j][i] = -xd->segment_feature_data[j][i];
}
else
- xd->segment_feature_data[i][j] = 0;
+ xd->segment_feature_data[j][i] = 0;
}
}
}
// For each of the segments
for (j = 0; j < MAX_MB_SEGMENTS; j++)
{
- Data = xd->segment_feature_data[i][j];
+ Data = xd->segment_feature_data[j][i];
// Frame level data
if (Data)
unsigned char *segmentation_map;
// Segment data (can be deltas or absolute values)
- signed char segment_feature_data[SEG_LVL_MAX][MAX_MB_SEGMENTS];
+ signed char segment_feature_data[MAX_MB_SEGMENTS][SEG_LVL_MAX];
// segment threashold for encode breakout
int segment_encode_breakout[MAX_MB_SEGMENTS];
MACROBLOCKD *mbd = &cpi->mb.e_mbd;
(void) filt_val;
- mbd->segment_feature_data[SEG_LVL_ALT_LF][0] = cpi->segment_feature_data[SEG_LVL_ALT_LF][0];
- mbd->segment_feature_data[SEG_LVL_ALT_LF][1] = cpi->segment_feature_data[SEG_LVL_ALT_LF][1];
- mbd->segment_feature_data[SEG_LVL_ALT_LF][2] = cpi->segment_feature_data[SEG_LVL_ALT_LF][2];
- mbd->segment_feature_data[SEG_LVL_ALT_LF][3] = cpi->segment_feature_data[SEG_LVL_ALT_LF][3];
+ mbd->segment_feature_data[0][SEG_LVL_ALT_LF] = cpi->segment_feature_data[0][SEG_LVL_ALT_LF];
+ mbd->segment_feature_data[1][SEG_LVL_ALT_LF] = cpi->segment_feature_data[1][SEG_LVL_ALT_LF];
+ mbd->segment_feature_data[2][SEG_LVL_ALT_LF] = cpi->segment_feature_data[2[SEG_LVL_ALT_LF]];
+ mbd->segment_feature_data[3][SEG_LVL_ALT_LF] = cpi->segment_feature_data[3][SEG_LVL_ALT_LF];
}
void vp8cx_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi)
// Abs Value
if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA)
- QIndex = xd->segment_feature_data[SEG_LVL_ALT_Q][xd->mode_info_context->mbmi.segment_id];
+ QIndex = xd->segment_feature_data[xd->mode_info_context->mbmi.segment_id][SEG_LVL_ALT_Q];
// Delta Value
else
{
- QIndex = cpi->common.base_qindex + xd->segment_feature_data[SEG_LVL_ALT_Q][xd->mode_info_context->mbmi.segment_id];
+ QIndex = cpi->common.base_qindex + xd->segment_feature_data[xd->mode_info_context->mbmi.segment_id][SEG_LVL_ALT_Q];
QIndex = (QIndex >= 0) ? ((QIndex <= MAXQ) ? QIndex : MAXQ) : 0; // Clamp to valid range
}
}
// Set Segment specific quatizers
- mbd->segment_feature_data[SEG_LVL_ALT_Q][0] = cpi->segment_feature_data[SEG_LVL_ALT_Q][0];
- mbd->segment_feature_data[SEG_LVL_ALT_Q][1] = cpi->segment_feature_data[SEG_LVL_ALT_Q][1];
- mbd->segment_feature_data[SEG_LVL_ALT_Q][2] = cpi->segment_feature_data[SEG_LVL_ALT_Q][2];
- mbd->segment_feature_data[SEG_LVL_ALT_Q][3] = cpi->segment_feature_data[SEG_LVL_ALT_Q][3];
+ mbd->segment_feature_data[0][SEG_LVL_ALT_Q] = cpi->segment_feature_data[0][SEG_LVL_ALT_Q];
+ mbd->segment_feature_data[1][SEG_LVL_ALT_Q] = cpi->segment_feature_data[1][SEG_LVL_ALT_Q];
+ mbd->segment_feature_data[2][SEG_LVL_ALT_Q] = cpi->segment_feature_data[2][SEG_LVL_ALT_Q];
+ mbd->segment_feature_data[3][SEG_LVL_ALT_Q] = cpi->segment_feature_data[3][SEG_LVL_ALT_Q];
/* quantizer has to be reinitialized for any delta_q changes */
if(update)