Commit e8d610dd authored by Yunqing Wang's avatar Yunqing Wang
Browse files

Fix a warning

Fixed the warning: the size of array ‘intermediate_buffer’ can’t
be evaluated [-Wvla].

Change-Id: Ibcffd6969bd71cee0c10f7cf18960e58cd0bd915
Showing with 8 additions and 10 deletions
...@@ -470,9 +470,6 @@ static const unsigned int filter_size_to_wh[][2] = { ...@@ -470,9 +470,6 @@ static const unsigned int filter_size_to_wh[][2] = {
{16,16}, {16,16},
}; };
static const unsigned int filter_max_height = 16;
static const unsigned int filter_max_width = 16;
static void filter_block2d_8_c(const unsigned char *src_ptr, static void filter_block2d_8_c(const unsigned char *src_ptr,
const unsigned int src_stride, const unsigned int src_stride,
const short *HFilter, const short *HFilter,
...@@ -490,14 +487,15 @@ static void filter_block2d_8_c(const unsigned char *src_ptr, ...@@ -490,14 +487,15 @@ static void filter_block2d_8_c(const unsigned char *src_ptr,
const int kInterp_Extend = 4; const int kInterp_Extend = 4;
const unsigned int intermediate_height = const unsigned int intermediate_height =
(kInterp_Extend - 1) + output_height + kInterp_Extend; (kInterp_Extend - 1) + output_height + kInterp_Extend;
const unsigned int max_intermediate_height =
(kInterp_Extend - 1) + filter_max_height + kInterp_Extend; /* Size of intermediate_buffer is max_intermediate_height * filter_max_width,
#ifdef _MSC_VER * where max_intermediate_height = (kInterp_Extend - 1) + filter_max_height
// MSVC does not support C99 style declaration * + kInterp_Extend
* = 3 + 16 + 4
* = 23
* and filter_max_width = 16
*/
unsigned char intermediate_buffer[23 * 16]; unsigned char intermediate_buffer[23 * 16];
#else
unsigned char intermediate_buffer[max_intermediate_height * filter_max_width];
#endif
const int intermediate_next_stride = 1 - intermediate_height * output_width; const int intermediate_next_stride = 1 - intermediate_height * output_width;
// Horizontal pass (src -> transposed intermediate). // Horizontal pass (src -> transposed intermediate).
......
Supports Markdown
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