HappenLee commented on code in PR #52829:
URL: https://github.com/apache/doris/pull/52829#discussion_r2196383562
##########
be/src/util/frame_of_reference_coding.cpp:
##########
@@ -87,21 +246,14 @@ void ForEncoder<T>::bit_pack(const T* input, uint8_t
in_num, int bit_width, uint
return;
}
- T in_mask = 0;
- int bit_index = 0;
- *output = 0;
- for (int i = 0; i < in_num; i++) {
- in_mask = ((T)1) << (bit_width - 1);
- for (int k = 0; k < bit_width; k++) {
- if (bit_index > 7) {
- bit_index = 0;
- output++;
- *output = 0;
- }
- *output |= (((input[i] & in_mask) >> (bit_width - k - 1)) << (7 -
bit_index));
- in_mask >>= 1;
- bit_index++;
- }
+ if (bit_width <= 8) {
+ bit_pack_8(input, in_num, bit_width, output);
Review Comment:
`bit_pack_8<int128>` enqual `bit_pack_32<int64_t>` which is better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]