Commit 1741cc7a authored by Paul Wilkins's avatar Paul Wilkins
Browse files

Reverse coding order for segment features:

Code all the features for one segment (grouped together)
then all for the next etc. etc. rather than grouping the
data by feature.

Change-Id: I2a65193b3a70aca78f92e855e35d8969d857b6dd
parent 1c24442a
......@@ -939,11 +939,22 @@ int vp8_decode_frame(VP8D_COMP *pbi)
vpx_memset(xd->segment_feature_data, 0, sizeof(xd->segment_feature_data));
/* For each segmentation feature (Quant and loop filter level) */
#if CONFIG_SEGFEATURES
// For each segmentation...
for (j = 0; j < MAX_MB_SEGMENTS; j++)
{
// For each of the segments features...
for (i = 0; i < SEG_LVL_MAX; i++)
{
#else
// For each segmentation feature...
for (i = 0; i < SEG_LVL_MAX; i++)
{
// For each segmentation...
for (j = 0; j < MAX_MB_SEGMENTS; j++)
{
#endif
/* Frame level data */
if (vp8_read_bit(bc))
{
......
......@@ -1846,11 +1846,19 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
vp8_write_bit(bc, (xd->mb_segement_abs_delta) ? 1 : 0);
// For each segmentation codable feature
#if CONFIG_SEGFEATURES
// For each segments id...
for (j = 0; j < MAX_MB_SEGMENTS; j++)
{
// For each segmentation codable feature...
for (i = 0; i < SEG_LVL_MAX; i++)
#else
// For each segmentation codable feature...
for (i = 0; i < SEG_LVL_MAX; i++)
{
// For each of the segments
// For each of the segments id...
for (j = 0; j < MAX_MB_SEGMENTS; j++)
#endif
{
Data = xd->segment_feature_data[j][i];
......@@ -1862,12 +1870,14 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned long *size)
if (Data < 0)
{
Data = - Data;
vp8_write_literal(bc, Data, mb_feature_data_bits[i]);
vp8_write_literal(bc, Data,
mb_feature_data_bits[i]);
vp8_write_bit(bc, 1);
}
else
{
vp8_write_literal(bc, Data, mb_feature_data_bits[i]);
vp8_write_literal(bc, Data,
mb_feature_data_bits[i]);
vp8_write_bit(bc, 0);
}
}
......
......@@ -261,7 +261,7 @@ void vp8cx_set_alt_lf_level(VP8_COMP *cpi, int filt_val)
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[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];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment