| 233 | struct gain_op |
| 234 | { |
| 235 | static inline float |
| 236 | apply(float x, float g) |
| 237 | { |
| 238 | if (x < 0.5f) |
| 239 | return 0.5f*bias_op::apply(2.0f*x, 1.0f - g); |
| 240 | else |
| 241 | return 1.0f - 0.5f*bias_op::apply(2.0f - 2.0f*x, 1.0f - g); |
| 242 | } |
| 243 | }; |
| 244 | |
| 245 | template <class T> |