summaryrefslogtreecommitdiff
path: root/libavcodec/snow.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-04-14 20:30:08 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-04-14 20:30:08 +0000
commit99cd59e58f57789b54a0fb56f1e84195f03c3059 (patch)
tree0dcff9f7467cfe5f7b1432a8ad86d8c3595a78f7 /libavcodec/snow.c
parent3c096ac7911fd51ea4bc602277f82ea222bfec6b (diff)
minor optimization
Originally committed as revision 4128 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r--libavcodec/snow.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index c8d4d5c4ea..dcfdc02bf7 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -1833,17 +1833,16 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
b->x_coeff[index].x=x;
b->x_coeff[index++].coeff= v;
}else{
+ int max_run;
run--;
v=0;
- if(y && parent){
- int max_run;
-
- max_run= FFMIN(run, b->x_coeff[prev_index].x - x - 2);
+ if(y) max_run= FFMIN(run, b->x_coeff[prev_index].x - x - 2);
+ else max_run= FFMIN(run, w-x-1);
+ if(parent)
max_run= FFMIN(max_run, 2*parent->x_coeff[parent_index].x - x - 1);
- x+= max_run;
- run-= max_run;
- }
+ x+= max_run;
+ run-= max_run;
}
}
}