Returns how many bits needed to represent given value (max 8 bit)*/
| 3555 | |
| 3556 | /*Returns how many bits needed to represent given value (max 8 bit)*/ |
| 3557 | static unsigned getValueRequiredBits(unsigned char value) |
| 3558 | { |
| 3559 | if(value == 0 || value == 255) return 1; |
| 3560 | /*The scaling of 2-bit and 4-bit values uses multiples of 85 and 17*/ |
| 3561 | if(value % 17 == 0) return value % 85 == 0 ? 2 : 4; |
| 3562 | return 8; |
| 3563 | } |
| 3564 | |
| 3565 | /*profile must already have been inited with mode. |
| 3566 | It's ok to set some parameters of profile to done already.*/ |
no outgoing calls
no test coverage detected