Compute the optimizations to be done. The calculation is based on the number of blocks, optlevel and indexing mode.
(
nblocks: int, optlevel: int, indsize: int
)
| 211 | |
| 212 | |
| 213 | def calcoptlevels( |
| 214 | nblocks: int, optlevel: int, indsize: int |
| 215 | ) -> tuple[bool, bool, bool, bool]: |
| 216 | """Compute the optimizations to be done. |
| 217 | |
| 218 | The calculation is based on the number of blocks, optlevel and |
| 219 | indexing mode. |
| 220 | |
| 221 | """ |
| 222 | if indsize == 2: # light |
| 223 | return col_light(nblocks, optlevel) |
| 224 | elif indsize == 4: # medium |
| 225 | return col_medium(nblocks, optlevel) |
| 226 | elif indsize == 8: # full |
| 227 | return col_full(nblocks, optlevel) |
| 228 | |
| 229 | |
| 230 | def col_light(nblocks: int, optlevel: int) -> tuple[bool, bool, bool, bool]: |
no test coverage detected