summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Wilkins <paulwilkins@google.com>2011-09-13 15:24:45 +0100
committerPaul Wilkins <paulwilkins@google.com>2011-09-13 16:57:17 +0100
commit1741cc7ab94ebe1b608c1765da75421f6616c49e (patch)
tree5e10cda93739d2d21b97057f0ae09ac00be6a1dd
parent1c24442a07b83c2ec22e9635fe570b5ea42ce784 (diff)
downloadlibvpx-1741cc7ab94ebe1b608c1765da75421f6616c49e.tar
libvpx-1741cc7ab94ebe1b608c1765da75421f6616c49e.tar.gz
libvpx-1741cc7ab94ebe1b608c1765da75421f6616c49e.tar.bz2
libvpx-1741cc7ab94ebe1b608c1765da75421f6616c49e.zip
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
-rw-r--r--vp8/decoder/decodframe.c13
-rw-r--r--vp8/encoder/bitstream.c18
-rw-r--r--vp8/encoder/picklpf.c2
3 files changed, 27 insertions, 6 deletions
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c
index 4c9880859..33102f274 100644
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -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))
{
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c
index 889f09e49..c4901bf7b 100644
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -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);
}
}
diff --git a/vp8/encoder/picklpf.c b/vp8/encoder/picklpf.c
index df8a2b279..0585d66e2 100644
--- a/vp8/encoder/picklpf.c
+++ b/vp8/encoder/picklpf.c
@@ -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];
}