13 #define GEN_XYZ_ITERATIONS 20
29 uint16_t bits = ccb_data->
Freq[0];
30 privDataObj->
n_depth = bits & 0x001F;
31 privDataObj->
n_ab = (bits & 0x03E0) >> 5;
32 privDataObj->
n_conf = (bits & 0x3C00) >> 10;
37 int n_cols = ccb_data->
n_cols;
38 int n_rows = ccb_data->
n_rows;
63 #define NUM_BITS(Input, n_pos, n_bits) (((1 << n_bits) - 1) & (Input >> n_pos))
67 uint32_t n_bits_in_conf, uint32_t n_bits_in_ab,
69 uint16_t *p_depth, uint16_t *p_conf, uint16_t *p_ab) {
70 uint8_t *input_buffer = p_frame_data;
72 uint16_t *out_depth = p_depth;
73 uint16_t *out_conf = p_conf;
74 uint16_t *out_ab = p_ab;
76 uint32_t n_pos_conf = (16 - n_bits_in_depth) ? 16 - n_bits_in_depth : 8;
77 uint32_t n_depth_conf = n_bits_in_depth + n_bits_in_conf;
78 uint32_t div = n_depth_conf % 8;
79 uint32_t n_count_conf = n_bits_in_ab ? n_depth_conf / 8 : 0;
80 uint32_t n_pos_ab = div ? 4 : 0;
81 uint32_t is_conf = n_depth_conf == 16 ? 0 : 2;
82 uint32_t n_ab_count = n_bits_in_ab == 8 ? 0 : n_count_conf + 1;
86 for (uint32_t pix_id = 0; pix_id < n_pixels; pix_id++) {
87 input_buffer = p_frame_data + pix_id * n_bytes;
89 uint16_t temp = input_buffer[0] | (uint16_t)(input_buffer[1] << 8);
90 out_depth[pix_id] =
NUM_BITS(temp, 0, n_bits_in_depth);
93 temp = input_buffer[1] | (uint16_t)(input_buffer[is_conf] << 8);
94 out_conf[pix_id] =
NUM_BITS(temp, n_pos_conf, n_bits_in_conf);
98 temp = input_buffer[n_count_conf] |
99 (uint16_t)(input_buffer[n_ab_count] << 8);
100 out_ab[pix_id] =
NUM_BITS(temp, n_pos_ab, n_bits_in_ab);
112 int n_cols = ccb_data->
n_cols;
113 int n_rows = ccb_data->
n_rows;
117 int n_depth =
p->n_depth;
119 int n_conf =
p->n_conf;
120 int n_sum_bits = n_depth + n_conf + n_ab;
121 int n_bytes = n_sum_bits / 8;
124 (uint8_t *)input_frame, n_depth, n_conf, n_ab, n_bytes, n_cols, n_rows,
130 std::cout <<
"Unable to deinterleave frame data !" << std::endl;
137 p_tofi_compute_context->
p_xyz_frame, n_rows, n_cols);
140 std::cout <<
"Unable to compute XYZ !" << std::endl;
151 if (
p->xyz_table.p_x_table) {
152 free((
void *)
p->xyz_table.p_x_table);
154 if (
p->xyz_table.p_y_table) {
155 free((
void *)
p->xyz_table.p_y_table);
157 if (
p->xyz_table.p_z_table) {
158 free((
void *)
p->xyz_table.p_z_table);
161 delete p_tofi_compute_context;