diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-07-07 09:06:50 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-07-14 19:19:34 -0700 |
commit | c44091a9f70d9f9987f022dc9da0109879d2eb82 (patch) | |
tree | a168b3408524aa896882b3e684d836b7db5d3ef0 /libavcodec/snowenc.c | |
parent | a794600c00c795b283e7864a2f55c2a3748d3560 (diff) | |
download | ffmpeg-streaming-c44091a9f70d9f9987f022dc9da0109879d2eb82.zip ffmpeg-streaming-c44091a9f70d9f9987f022dc9da0109879d2eb82.tar.gz |
snow: refactor code to work around a compiler bug in MSVC.
This fixes the compiler error "cannot convert from 'BlockNode' to
'int16_t'".
Diffstat (limited to 'libavcodec/snowenc.c')
-rw-r--r-- | libavcodec/snowenc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index f732820..ebfeff6 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -1005,10 +1005,18 @@ static av_always_inline int check_block_inter(SnowContext *s, int mb_x, int mb_y static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){ const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; - BlockNode backup[4]= {block[0], block[1], block[b_stride], block[b_stride+1]}; + BlockNode backup[4]; unsigned value; int rd, index; + /* We don't initialize backup[] during variable declaration, because + * that fails to compile on MSVC: "cannot convert from 'BlockNode' to + * 'int16_t'". */ + backup[0] = block[0]; + backup[1] = block[1]; + backup[2] = block[b_stride]; + backup[3] = block[b_stride + 1]; + assert(mb_x>=0 && mb_y>=0); assert(mb_x<b_stride); assert(((mb_x|mb_y)&1) == 0); |