212 |
if(maximportance <= 0) return; |
if(maximportance <= 0) return; |
213 |
// Else, find a good exponent |
// Else, find a good exponent |
214 |
for(int round = 0; ; round++) { |
for(int round = 0; ; round++) { |
215 |
|
float mulf = (round > 5 ? .999f : 1); |
216 |
// Sum of maxbytes multiplied with priority^round |
// Sum of maxbytes multiplied with priority^round |
217 |
int sumReduced = 0; |
int sumReduced = 0; |
218 |
if(dbg) pa("Rerate round "+round); |
if(dbg) pa("Rerate round "+round); |
221 |
ConsumerRecord rec = (ConsumerRecord)consumer2record.get(cons); |
ConsumerRecord rec = (ConsumerRecord)consumer2record.get(cons); |
222 |
float imp = 0; |
float imp = 0; |
223 |
if(rec.curImportance > 0) |
if(rec.curImportance > 0) |
224 |
imp = (float)Math.pow(.99 * rec.curImportance/maximportance, round); |
imp = (float)Math.pow(mulf * rec.curImportance/maximportance, round); |
225 |
else if(round == 0) |
else if(round == 0) |
226 |
imp = 1; |
imp = 1; |
227 |
int byt = cons.getMaxBytes(rec.curQuality); |
int byt = cons.getMaxBytes(rec.curQuality); |
236 |
ConsumerRecord rec = (ConsumerRecord)consumer2record.get(cons); |
ConsumerRecord rec = (ConsumerRecord)consumer2record.get(cons); |
237 |
float imp = 0; |
float imp = 0; |
238 |
if(rec.curImportance > 0) |
if(rec.curImportance > 0) |
239 |
imp = (float)Math.pow(.99 * rec.curImportance/maximportance, round); |
imp = (float)Math.pow(mulf * rec.curImportance/maximportance, round); |
240 |
else if(round == 0) |
else if(round == 0) |
241 |
imp = 1; |
imp = 1; |
242 |
int byt = cons.getMaxBytes(rec.curQuality); |
int byt = cons.getMaxBytes(rec.curQuality); |