mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
snow: refactor code to work around a compiler bug in MSVC.
This fixes the compiler error "cannot convert from 'BlockNode' to 'int16_t'".
This commit is contained in:
parent
a794600c00
commit
c44091a9f7
@ -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){
|
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;
|
const int b_stride= s->b_width << s->block_max_depth;
|
||||||
BlockNode *block= &s->block[mb_x + mb_y * b_stride];
|
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;
|
unsigned value;
|
||||||
int rd, index;
|
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>=0 && mb_y>=0);
|
||||||
assert(mb_x<b_stride);
|
assert(mb_x<b_stride);
|
||||||
assert(((mb_x|mb_y)&1) == 0);
|
assert(((mb_x|mb_y)&1) == 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user