VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l);
- for (c = 0; c < b->eob; c++)
+ if(!b->eob)
+ {
+ /* c = band for this case */
+ t->Token = DCT_EOB_TOKEN;
+ t->context_tree = cpi->common.fc.coef_probs [1] [0] [pt];
+ t->skip_eob_node = 0;
+
+ ++cpi->coef_counts [1] [0] [pt] [DCT_EOB_TOKEN];
+ t++;
+ *tp = t;
+ *a = *l = 0;
+ return;
+ }
+
+ v = qcoeff_ptr[0];
+ t->Extra = vp8_dct_value_tokens_ptr[v].Extra;
+ token = vp8_dct_value_tokens_ptr[v].Token;
+ t->Token = token;
+
+ t->context_tree = cpi->common.fc.coef_probs [1] [0] [pt];
+ t->skip_eob_node = 0;
+ ++cpi->coef_counts [1] [0] [pt] [token];
+ pt = vp8_prev_token_class[token];
+ t++;
+ c = 1;
+
+ for (; c < b->eob; c++)
{
rc = vp8_default_zig_zag1d[c];
band = vp8_coef_bands[c];
t->Token = token;
t->context_tree = cpi->common.fc.coef_probs [1] [band] [pt];
- t->skip_eob_node = ((pt == 0) && (band > 0));
+ t->skip_eob_node = ((pt == 0));
++cpi->coef_counts [1] [band] [pt] [token];
t->Token = DCT_EOB_TOKEN;
t->context_tree = cpi->common.fc.coef_probs [1] [band] [pt];
- t->skip_eob_node = ((pt == 0) && (band > 0));
+ t->skip_eob_node = 0;
++cpi->coef_counts [1] [band] [pt] [DCT_EOB_TOKEN];
}
*tp = t;
- pt = (c != 0); /* 0 <-> all coeff data is zero */
- *a = *l = pt;
+ *a = *l = 1;
}
c = type ? 0 : 1;
+ if(c >= b->eob)
+ {
+ /* c = band for this case */
+ t->Token = DCT_EOB_TOKEN;
+ t->context_tree = cpi->common.fc.coef_probs [type] [c] [pt];
+ t->skip_eob_node = 0;
+
+ ++cpi->coef_counts [type] [c] [pt] [DCT_EOB_TOKEN];
+ t++;
+ *tp = t;
+ *a = *l = 0;
+ continue;
+ }
+
+ v = qcoeff_ptr[c];
+
+ t->Extra = vp8_dct_value_tokens_ptr[v].Extra;
+ token = vp8_dct_value_tokens_ptr[v].Token;
+ t->Token = token;
+
+ t->context_tree = cpi->common.fc.coef_probs [type] [c] [pt];
+ t->skip_eob_node = 0;
+ ++cpi->coef_counts [type] [c] [pt] [token];
+ pt = vp8_prev_token_class[token];
+ t++;
+ c++;
+
for (; c < b->eob; c++)
{
rc = vp8_default_zig_zag1d[c];
t->Token = token;
t->context_tree = cpi->common.fc.coef_probs [type] [band] [pt];
- t->skip_eob_node = pt == 0 &&
- ((band > 0 && type > 0) || (band > 1 && type == 0));
-
+ t->skip_eob_node = (pt == 0);
++cpi->coef_counts [type] [band] [pt] [token];
pt = vp8_prev_token_class[token];
t->Token = DCT_EOB_TOKEN;
t->context_tree = cpi->common.fc.coef_probs [type] [band] [pt];
- t->skip_eob_node = pt == 0 &&
- ((band > 0 && type > 0) || (band > 1 && type == 0));
-
+ t->skip_eob_node = 0;
++cpi->coef_counts [type] [band] [pt] [DCT_EOB_TOKEN];
t++;
}
*tp = t;
- pt = (c != !type); /* 0 <-> all coeff data is zero */
- *a = *l = pt;
-
+ *a = *l = 1;
}
+
/* Chroma */
for (block = 16; block < 24; block++, b++)
{
VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l);
- for (c = 0; c < b->eob; c++)
+ if(!b->eob)
+ {
+ /* c = band for this case */
+ t->Token = DCT_EOB_TOKEN;
+ t->context_tree = cpi->common.fc.coef_probs [2] [0] [pt];
+ t->skip_eob_node = 0;
+
+ ++cpi->coef_counts [2] [0] [pt] [DCT_EOB_TOKEN];
+ t++;
+ *tp = t;
+ *a = *l = 0;
+ continue;
+ }
+
+ v = qcoeff_ptr[0];
+
+ t->Extra = vp8_dct_value_tokens_ptr[v].Extra;
+ token = vp8_dct_value_tokens_ptr[v].Token;
+ t->Token = token;
+
+ t->context_tree = cpi->common.fc.coef_probs [2] [0] [pt];
+ t->skip_eob_node = 0;
+ ++cpi->coef_counts [2] [0] [pt] [token];
+ pt = vp8_prev_token_class[token];
+ t++;
+ c = 1;
+
+ for (; c < b->eob; c++)
{
rc = vp8_default_zig_zag1d[c];
band = vp8_coef_bands[c];
t->Token = token;
t->context_tree = cpi->common.fc.coef_probs [2] [band] [pt];
- t->skip_eob_node = ((pt == 0) && (band > 0));
+ t->skip_eob_node = (pt == 0);
++cpi->coef_counts [2] [band] [pt] [token];
t->Token = DCT_EOB_TOKEN;
t->context_tree = cpi->common.fc.coef_probs [2] [band] [pt];
- t->skip_eob_node = ((pt == 0) && (band > 0));
+ t->skip_eob_node = 0;
++cpi->coef_counts [2] [band] [pt] [DCT_EOB_TOKEN];
t++;
}
*tp = t;
- pt = (c != 0); /* 0 <-> all coeff data is zero */
- *a = *l = pt;
+ *a = *l = 1;
}
-
}