Improving visual weighting code and implementation.#311
Conversation
… the new/delete. A small change for bit-depth-based quantization; now it is limited to 2^-16, if not explicitly chosen.
| // visual array type | ||
| using visual_weighting_array = std::array<float, max_weight_size>; | ||
| // structure for our visual weights | ||
| class visual_weights { |
There was a problem hiding this comment.
FWIW I am not a big fan of this kind of shim that is used only for initialization purposes. I would instead use std::array[] directly.
There was a problem hiding this comment.
Thank you for your comment.
You need to to keep a count of how many entries were used; if not they you rely on the producer and consumer using the same number of entries -- that is the only reason.
There was a problem hiding this comment.
Ok. Since it is not a generic array, I would
- use more semantically accurate terms, e.g.,
countinstead ofsize - remove
clear()since it is never used and I cannot imagine a situation where you would want to c;lear visual weights. - replace
set_weights()with a constructor - remove
push_back()
There was a problem hiding this comment.
... actually, why not make the visual weight generation function static members of the visual_weights class so that we do not need to expose any accessor methods.
…ion for it. Also break setting SPcod into three functions.
|
@palemieux I followed you suggestion. Have a look and let me know if you have any concerns, improvements. Thank you. |
This changes visual weighting in a few ways:
@palemieux Please have a look and let me know if you have any concerns.