From 8641f42d98cd5fad913540260526e727fb257b1f Mon Sep 17 00:00:00 2001 From: Martin Mathieson Date: Sun, 23 Apr 2023 13:50:53 +0000 Subject: [PATCH] ORAN FH CUS: don't scale U-Plane samples twice --- epan/dissectors/packet-oran.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/epan/dissectors/packet-oran.c b/epan/dissectors/packet-oran.c index b1c97e760f..2fb63e695c 100644 --- a/epan/dissectors/packet-oran.c +++ b/epan/dissectors/packet-oran.c @@ -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);