# HG changeset patch # User takis # Date 1169718862 0 # Node ID c3be13eac2d6b0f15636c690a88f8591979023d4 # Parent 15688bdfe1b51cc555569e2233d92ee068aa8c1b Bring down the number of snow.c warnings from 27 to 17 by using the const keyword. diff -r 15688bdfe1b5 -r c3be13eac2d6 snow.c --- a/snow.c Thu Jan 25 09:43:52 2007 +0000 +++ b/snow.c Thu Jan 25 09:54:22 2007 +0000 @@ -1959,7 +1959,7 @@ } static inline void pred_mv(SnowContext *s, int *mx, int *my, int ref, - BlockNode *left, BlockNode *top, BlockNode *tr){ + const BlockNode *left, const BlockNode *top, const BlockNode *tr){ if(s->ref_frames == 1){ *mx = mid_pred(left->mx, top->mx, tr->mx); *my = mid_pred(left->my, top->my, tr->my); @@ -1998,12 +1998,12 @@ const int block_w= 1<<(LOG2_MB_SIZE - level); int trx= (x+1)<block[index-1] : &null_block; - BlockNode *top = y ? &s->block[index-w] : &null_block; - BlockNode *right = trxblock[index+1] : &null_block; - BlockNode *bottom= tryblock[index+w] : &null_block; - BlockNode *tl = y && x ? &s->block[index-w-1] : left; - BlockNode *tr = y && trxblock[index-w+(1<block[index-1] : &null_block; + const BlockNode *top = y ? &s->block[index-w] : &null_block; + const BlockNode *right = trxblock[index+1] : &null_block; + const BlockNode *bottom= tryblock[index+w] : &null_block; + const BlockNode *tl = y && x ? &s->block[index-w-1] : left; + const BlockNode *tr = y && trxblock[index-w+(1<color[0]; int pcb= left->color[1]; int pcr= left->color[2]; @@ -2225,10 +2225,10 @@ const int index= (x + y*w) << rem_depth; int trx= (x+1)<block[index]; - BlockNode *left = x ? &s->block[index-1] : &null_block; - BlockNode *top = y ? &s->block[index-w] : &null_block; - BlockNode *tl = y && x ? &s->block[index-w-1] : left; - BlockNode *tr = y && trxblock[index-w+(1<block[index-1] : &null_block; + const BlockNode *top = y ? &s->block[index-w] : &null_block; + const BlockNode *tl = y && x ? &s->block[index-w-1] : left; + const BlockNode *tr = y && trxblock[index-w+(1<color[0]; int pcb= left->color[1]; int pcr= left->color[2]; @@ -2278,10 +2278,10 @@ const int rem_depth= s->block_max_depth - level; const int index= (x + y*w) << rem_depth; int trx= (x+1)<block[index-1] : &null_block; - BlockNode *top = y ? &s->block[index-w] : &null_block; - BlockNode *tl = y && x ? &s->block[index-w-1] : left; - BlockNode *tr = y && trxblock[index-w+(1<block[index-1] : &null_block; + const BlockNode *top = y ? &s->block[index-w] : &null_block; + const BlockNode *tl = y && x ? &s->block[index-w-1] : left; + const BlockNode *tr = y && trxblock[index-w+(1<level + 2*top->level + tl->level + tr->level; if(s->keyframe){ @@ -2905,11 +2905,11 @@ const int b_stride = s->b_width << s->block_max_depth; const int b_height = s->b_height<< s->block_max_depth; int index= x + y*b_stride; - BlockNode *b = &s->block[index]; - BlockNode *left = x ? &s->block[index-1] : &null_block; - BlockNode *top = y ? &s->block[index-b_stride] : &null_block; - BlockNode *tl = y && x ? &s->block[index-b_stride-1] : left; - BlockNode *tr = y && x+wblock[index-b_stride+w] : tl; + const BlockNode *b = &s->block[index]; + const BlockNode *left = x ? &s->block[index-1] : &null_block; + const BlockNode *top = y ? &s->block[index-b_stride] : &null_block; + const BlockNode *tl = y && x ? &s->block[index-b_stride-1] : left; + const BlockNode *tr = y && x+wblock[index-b_stride+w] : tl; int dmx, dmy; // int mx_context= av_log2(2*FFABS(left->mx - top->mx)); // int my_context= av_log2(2*FFABS(left->my - top->my));