EGPRS: Add EPDAN CRBB Tree based decoding

Implemented tree based algorithm to decode compressed bitmap in EPDAN
as described in section 9.1.10 of 3GPP 44.060.
This algorithm intends to improve the performance over existing method.
New Regression test is added under bitcomp directory.
Test case is added to validate decompressed result of the bitmap
Present in EPDAN.
Test is done for multiple bitmaps of varying length.
Invalid inputs are also part of the test vector.

Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce
diff --git a/src/decoding.cpp b/src/decoding.cpp
index 3f5c4d2..6ae4b16 100644
--- a/src/decoding.cpp
+++ b/src/decoding.cpp
@@ -20,6 +20,7 @@
 #include <decoding.h>
 #include <rlc.h>
 #include <gprs_debug.h>
+#include <egprs_rlc_compression.h>
 
 extern "C" {
 #include <osmocom/core/utils.h>
@@ -692,21 +693,17 @@
 
 	if (crbb_len > 0) {
 		int old_len = bits->cur_bit;
-		struct bitvec crbb;
 
-		crbb.data = (uint8_t *)desc->CRBB;
-		crbb.data_len = sizeof(desc->CRBB);
-		crbb.cur_bit = desc->CRBB_LENGTH;
-
-		rc = osmo_t4_decode(&crbb, desc->CRBB_STARTING_COLOR_CODE,
-			bits);
-
+		LOGP(DRLCMACDL, LOGL_DEBUG, "Compress bitmap exists, "
+			"CRBB LEN = %d and Starting color code = %d",
+			desc->CRBB_LENGTH, desc->CRBB_STARTING_COLOR_CODE);
+		rc = egprs_compress::decompress_crbb(desc->CRBB_LENGTH,
+			desc->CRBB_STARTING_COLOR_CODE, desc->CRBB, bits);
 		if (rc < 0) {
 			LOGP(DRLCMACUL, LOGL_NOTICE,
-				"Failed to decode CRBB: "
-				"length %d, data '%s'\n",
-				desc->CRBB_LENGTH,
-				osmo_hexdump(crbb.data, crbb.data_len));
+				"Failed to decode CRBB: length %d, data '%s'\n",
+				desc->CRBB_LENGTH, osmo_hexdump(
+					desc->CRBB, (desc->CRBB_LENGTH + 7)/8));
 			/* We don't know the SSN offset for the URBB,
 			 * return what we have so far and assume the
 			 * bitmap has stopped here */