ORAN FH CUS: don't scale U-Plane samples twice

This commit is contained in:
Martin Mathieson 2023-04-23 13:50:53 +00:00
parent 57a2313e71
commit 8641f42d98
1 changed files with 1 additions and 8 deletions

View File

@ -871,11 +871,6 @@ static float uncompressed_to_float(guint32 h)
return ((float)i16) / 0x7fff;
}
static gfloat digital_power_scaling(gfloat f)
{
return f / (1 << 15);
}
/* 7.7.1.2 bfwCompHdr (beamforming weight compression header) */
static int dissect_bfwCompHdr(tvbuff_t *tvb, proto_tree *tree, gint offset,
guint32 *iq_width, guint32 *comp_meth, proto_item **comp_meth_ti)
@ -1002,7 +997,7 @@ static gfloat decompress_value(guint32 bits, guint32 comp_method, guint8 iq_widt
case BFP_AND_SELECTIVE_RE:
case MOD_COMPR_AND_SELECTIVE_RE:
default:
/* Not supported! */
/* TODO: Not supported! */
return 0.0;
}
}
@ -2612,7 +2607,6 @@ dissect_oran_u(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
/* I */
guint i_bits = tvb_get_bits(tvb, samples_offset, sample_bit_width, ENC_BIG_ENDIAN);
gfloat i_value = decompress_value(i_bits, COMP_BLOCK_FP, sample_bit_width, exponent);
i_value = digital_power_scaling(i_value);
guint sample_len_in_bytes = ((samples_offset%8)+sample_bit_width+7)/8;
proto_item *i_ti = proto_tree_add_float(rb_tree, hf_oran_iSample, tvb, samples_offset/8, sample_len_in_bytes, i_value);
proto_item_set_text(i_ti, "iSample: %0.12f 0x%04x (iSample-%u in the PRB)", i_value, i_bits, sample_number);
@ -2620,7 +2614,6 @@ dissect_oran_u(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
/* Q */
guint q_bits = tvb_get_bits(tvb, samples_offset, sample_bit_width, ENC_BIG_ENDIAN);
gfloat q_value = decompress_value(q_bits, COMP_BLOCK_FP, sample_bit_width, exponent);
q_value = digital_power_scaling(q_value);
sample_len_in_bytes = ((samples_offset%8)+sample_bit_width+7)/8;
proto_item *q_ti = proto_tree_add_float(rb_tree, hf_oran_qSample, tvb, samples_offset/8, sample_len_in_bytes, q_value);
proto_item_set_text(q_ti, "qSample: %0.12f 0x%04x (qSample-%u in the PRB)", q_value, q_bits, sample_number);