Mercurial > libavcodec.hg
comparison elbg.c @ 9160:678152bdb3a1 libavcodec
Fix bug when elbg->utility_inc[elbg->numCB-1] == 1
author | vitor |
---|---|
date | Tue, 10 Mar 2009 17:38:16 +0000 |
parents | aa459306ee59 |
children | a4842fc20ac8 |
comparison
equal
deleted
inserted
replaced
9159:7a9a124bbc06 | 9160:678152bdb3a1 |
---|---|
103 | 103 |
104 static int get_high_utility_cell(elbg_data *elbg) | 104 static int get_high_utility_cell(elbg_data *elbg) |
105 { | 105 { |
106 int i=0; | 106 int i=0; |
107 /* Using linear search, do binary if it ever turns to be speed critical */ | 107 /* Using linear search, do binary if it ever turns to be speed critical */ |
108 int r = av_lfg_get(elbg->rand_state)%(elbg->utility_inc[elbg->numCB-1]-1) + 1; | 108 int r = av_lfg_get(elbg->rand_state)%elbg->utility_inc[elbg->numCB-1] + 1; |
109 while (elbg->utility_inc[i] < r) | 109 while (elbg->utility_inc[i] < r) |
110 i++; | 110 i++; |
111 | 111 |
112 assert(!elbg->cells[i]); | 112 assert(!elbg->cells[i]); |
113 | 113 |