coding: Correctly count bits when decoding EDGE bursts with MCS >= 7.

They consist of two blocks, so we should count both blocks.

Change-Id: I560de192212dae4705054a1665726369b83d213a
This commit is contained in:
Alexander Chemeris 2018-07-14 21:09:54 +02:00 committed by Ivan Kluchnikov
parent 5594430405
commit 9444326158
1 changed files with 8 additions and 1 deletions

View File

@ -979,6 +979,9 @@ int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t
if (rc < 0)
return -EFAULT;
} else {
/* Bit counters for the second block */
int n_errors2, n_bits_total2;
/* MCS-7,8,9 block 1 */
rc = egprs_decode_data(l2_data, c1, cps.mcs, cps.p[0],
0, n_errors, n_bits_total);
@ -987,7 +990,11 @@ int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t
/* MCS-7,8,9 block 2 */
rc = egprs_decode_data(l2_data, c2, cps.mcs, cps.p[1],
1, n_errors, n_bits_total);
1, &n_errors2, &n_bits_total2);
if (n_errors)
*n_errors += n_errors2;
if (n_bits_total)
*n_bits_total += n_bits_total2;
if (rc < 0)
return -EFAULT;
}