summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2012-11-28 17:34:02 -0800
committerYaowu Xu <yaowu@google.com>2012-11-29 09:10:15 -0800
commit7ab1d3e49f107e62793405914ca375745ae1f871 (patch)
tree40ff2f6ec9e0d7ed792b6a782a0dbddfd41a40c3
parentb2f27d909a8ecd3cf4591e3f2642864fa00651da (diff)
downloadlibvpx-7ab1d3e49f107e62793405914ca375745ae1f871.tar
libvpx-7ab1d3e49f107e62793405914ca375745ae1f871.tar.gz
libvpx-7ab1d3e49f107e62793405914ca375745ae1f871.tar.bz2
libvpx-7ab1d3e49f107e62793405914ca375745ae1f871.zip
minor fix to eob check for setting CONTEXT
Previously, the "!=" check is logically incorrect when eob is at 0 and effective coefficient starting position is 1. This commit should have no effect on bitstream. Change-Id: I6ce3a847c7e72bfbe4f7c74f88e3310c6b9b6d30
-rw-r--r--vp9/decoder/vp9_detokenize.c9
-rw-r--r--vp9/encoder/vp9_encodemb.c4
-rw-r--r--vp9/encoder/vp9_rdopt.c7
-rw-r--r--vp9/encoder/vp9_tokenize.c6
4 files changed, 12 insertions, 14 deletions
diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c
index 1a7a08fa4..0f729283b 100644
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -243,7 +243,7 @@ SKIP_START:
if (c < seg_eob)
coef_counts[coef_bands[c]][pt][DCT_EOB_TOKEN]++;
- a[0] = l[0] = (c != !type);
+ a[0] = l[0] = (c > !type);
return c;
}
@@ -291,11 +291,8 @@ static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
l[1] = l[0];
eobtotal += c;
}
-
- // no Y2 block
- vpx_memset(&A[8], 0, sizeof(A[8]));
- vpx_memset(&L[8], 0, sizeof(L[8]));
-
+ A[8] = 0;
+ L[8] = 0;
return eobtotal;
}
diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c
index 1a7a38261..bcec0923a 100644
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -491,7 +491,7 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type,
final_eob++;
d->eob = final_eob;
- *a = *l = (d->eob != !type);
+ *a = *l = (d->eob > !type);
}
/**************************************************************************
@@ -854,7 +854,7 @@ static void optimize_b_16x16(MACROBLOCK *mb, int i, PLANE_TYPE type,
final_eob++;
d->eob = final_eob;
- *a = *l = (d->eob != !type);
+ *a = *l = (d->eob > !type);
}
void vp9_optimize_mby_16x16(MACROBLOCK *x) {
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 760593acb..9450ff4fd 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -539,8 +539,8 @@ static int cost_coeffs_2x2(MACROBLOCK *mb,
if (c < 4)
cost += mb->token_costs[TX_8X8][type][vp9_coef_bands[c]]
[pt] [DCT_EOB_TOKEN];
-
- pt = (c != !type); // is eob first coefficient;
+ // is eob first coefficient;
+ pt = (c > !type);
*a = *l = pt;
return cost;
}
@@ -640,7 +640,8 @@ static int cost_coeffs(MACROBLOCK *mb, BLOCKD *b, PLANE_TYPE type,
[pt][DCT_EOB_TOKEN];
}
- pt = (c != !type); // is eob first coefficient;
+ // is eob first coefficient;
+ pt = (c > !type);
*a = *l = pt;
return cost;
}
diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c
index 41b7f0edf..f36c2cdae 100644
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -212,7 +212,7 @@ static void tokenize_b(VP9_COMP *cpi,
} while (c < eob && ++c < seg_eob);
*tp = t;
- *a = *l = (c != !type); /* 0 <-> all coeff data is zero */
+ *a = *l = (c > !type); /* 0 <-> all coeff data is zero */
}
int vp9_mby_is_skippable_4x4(MACROBLOCKD *xd, int has_y2_block) {
@@ -377,8 +377,8 @@ void vp9_tokenize_mb(VP9_COMP *cpi,
A[vp9_block2above_8x8[b] + 1] = A[vp9_block2above_8x8[b]];
L[vp9_block2left_8x8[b] + 1] = L[vp9_block2left_8x8[b]];
}
- vpx_memset(&A[8], 0, sizeof(A[8]));
- vpx_memset(&L[8], 0, sizeof(L[8]));
+ A[8] = 0;
+ L[8] = 0;
} else if (tx_size == TX_8X8) {
for (b = 0; b < 16; b += 4) {
tokenize_b(cpi, xd, xd->block + b, t, plane_type,