Commit 102cdf94 authored by Yaowu Xu's avatar Yaowu Xu
Browse files

Move count buffers from stack to heap

This fixes the stack overflow issue on MSVC build.

Change-Id: Icb0a78e5992a097d2192979ec2432546eaa452dd
parent bf692e85
......@@ -2291,10 +2291,6 @@ static void update_coef_probs(VP10_COMP *cpi, vp10_writer* w) {
unsigned int eob_counts_copy[TX_SIZES][PLANE_TYPES][REF_TYPES]
[COEF_BANDS][COEFF_CONTEXTS];
int i;
vp10_coeff_count coef_counts[COEF_PROBS_BUFS][TX_SIZES][PLANE_TYPES];
unsigned int eob_counts[COEF_PROBS_BUFS][TX_SIZES][PLANE_TYPES]
[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS];
vp10_coeff_stats branch_ct[COEF_PROBS_BUFS][TX_SIZES][PLANE_TYPES];
vp10_coeff_probs_model dummy_frame_coef_probs[PLANE_TYPES];
if (cm->do_subframe_update &&
......@@ -2302,7 +2298,9 @@ static void update_coef_probs(VP10_COMP *cpi, vp10_writer* w) {
vp10_copy(cpi->common.fc->coef_probs,
subframe_stats->enc_starting_coef_probs);
for (i = 0; i <= cpi->common.coef_probs_update_idx; ++i) {
get_coef_counts_diff(cpi, i, coef_counts[i], eob_counts[i]);
get_coef_counts_diff(cpi, i,
cpi->wholeframe_stats.coef_counts_buf[i],
cpi->wholeframe_stats.eob_counts_buf[i]);
}
}
#endif // CONFIG_ENTROPY
......@@ -2326,16 +2324,17 @@ static void update_coef_probs(VP10_COMP *cpi, vp10_writer* w) {
frame_coef_probs);
for (i = 0; i <= cpi->common.coef_probs_update_idx; ++i) {
vp10_copy(cpi->common.counts.eob_branch[tx_size],
eob_counts[i][tx_size]);
cpi->wholeframe_stats.eob_counts_buf[i][tx_size]);
vp10_copy(cpi->td.rd_counts.coef_counts[tx_size],
coef_counts[i][tx_size]);
build_tree_distribution(cpi, tx_size, branch_ct[i][tx_size],
cpi->wholeframe_stats.coef_counts_buf[i][tx_size]);
build_tree_distribution(cpi, tx_size,
cpi->branch_ct_buf[i][tx_size],
dummy_frame_coef_probs);
}
vp10_copy(cpi->common.counts.eob_branch[tx_size], eob_counts_copy);
vp10_copy(cpi->td.rd_counts.coef_counts[tx_size], coef_counts_copy);
update_coef_probs_subframe(w, cpi, tx_size, branch_ct,
update_coef_probs_subframe(w, cpi, tx_size, cpi->branch_ct_buf,
frame_coef_probs);
#if CONFIG_ANS
update = 1;
......
......@@ -580,6 +580,9 @@ typedef struct VP10_COMP {
VP9LfSync lf_row_sync;
#if CONFIG_ENTROPY
SUBFRAME_STATS subframe_stats;
// TODO(yaowu): minimize the size of count buffers
SUBFRAME_STATS wholeframe_stats;
vp10_coeff_stats branch_ct_buf[COEF_PROBS_BUFS][TX_SIZES][PLANE_TYPES];
#endif // CONFIG_ENTROPY
#if CONFIG_ANS
struct BufAnsCoder buf_ans;
......
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