mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
When picking a "high utility centroid" do not pick one
that has no corresponding points. Not only it is the worst possible pick, but also the code was written without this case in mind. Originally committed as revision 14341 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
5916af1954
commit
6bf8b04764
@ -105,9 +105,12 @@ static int get_high_utility_cell(elbg_data *elbg)
|
||||
{
|
||||
int i=0;
|
||||
/* Using linear search, do binary if it ever turns to be speed critical */
|
||||
int r = av_random(elbg->rand_state)%elbg->utility_inc[elbg->numCB-1];
|
||||
int r = av_random(elbg->rand_state)%(elbg->utility_inc[elbg->numCB-1]-1) + 1;
|
||||
while (elbg->utility_inc[i] < r)
|
||||
i++;
|
||||
|
||||
assert(!elbg->cells[i]);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user