diff options
author | Henrik Gramner <gramner@twoorioles.com> | 2019-10-23 00:44:52 +0300 |
---|---|---|
committer | Henrik Gramner <henrik@gramner.com> | 2019-10-23 00:50:58 +0300 |
commit | 6c81623eab4154e1387681695d51a52a08ec4eec (patch) | |
tree | baebe92fafa0e9e79e07bfb45b49a60b9458df40 /src/ipred_tmpl.c | |
parent | 5595102721d3c298d7cee64e64878486a3b8bdad (diff) |
Shrink some stack buffers in the C versions of ipred_z
Only the upsamling code requires a size of width/height * 2, but
upsampling is never performed when width or height is above 8.
Diffstat (limited to 'src/ipred_tmpl.c')
-rw-r--r-- | src/ipred_tmpl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ipred_tmpl.c b/src/ipred_tmpl.c index 6867506..b21f199 100644 --- a/src/ipred_tmpl.c +++ b/src/ipred_tmpl.c @@ -415,7 +415,7 @@ static void ipred_z1_c(pixel *dst, const ptrdiff_t stride, angle &= 511; assert(angle < 90); int dx = dav1d_dr_intra_derivative[angle >> 1]; - pixel top_out[(64 + 64) * 2]; + pixel top_out[64 + 64]; const pixel *top; int max_base_x; const int upsample_above = enable_intra_edge_filter ? @@ -474,8 +474,8 @@ static void ipred_z2_c(pixel *dst, const ptrdiff_t stride, get_upsample(width + height, 180 - angle, is_sm) : 0; const int upsample_above = enable_intra_edge_filter ? get_upsample(width + height, angle - 90, is_sm) : 0; - pixel edge[64 * 2 + 64 * 2 + 1]; - pixel *const topleft = &edge[height * 2]; + pixel edge[64 + 64 + 1]; + pixel *const topleft = &edge[64]; if (upsample_above) { upsample_edge(topleft, width + 1, topleft_in, 0, width + 1 @@ -494,8 +494,8 @@ static void ipred_z2_c(pixel *dst, const ptrdiff_t stride, } } if (upsample_left) { - upsample_edge(edge, height + 1, &topleft_in[-height], 0, height + 1 - HIGHBD_TAIL_SUFFIX); + upsample_edge(&topleft[-height * 2], height + 1, &topleft_in[-height], + 0, height + 1 HIGHBD_TAIL_SUFFIX); dy <<= 1; } else { const int filter_strength = enable_intra_edge_filter ? @@ -549,7 +549,7 @@ static void ipred_z3_c(pixel *dst, const ptrdiff_t stride, angle &= 511; assert(angle > 180); int dy = dav1d_dr_intra_derivative[(270 - angle) >> 1]; - pixel left_out[(64 + 64) * 2]; + pixel left_out[64 + 64]; const pixel *left; int max_base_y; const int upsample_left = enable_intra_edge_filter ? |