summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-09-14 09:13:36 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2018-09-14 16:24:10 +0200
commit2fd4fe6aa109c8df50baac465f0393a303a64dd2 (patch)
treebe28676b87da9447921c15b56f23597584ef389f
parent4b081b1d8862114f59af433b943dea86ce47ac71 (diff)
gsm0808: add function to convert amr gsm0408 setings to gsm0808
Add a function to convert struct gsm48_multi_rate_conf, which holds the codec settings for AMR, to S0-S15 bit representation as defined in 3GPP TS 48.008 3.2.2.49 Change-Id: I4e656731b16621736c7a2f4e64d9ce63b1064e98 Related: OS#3548
-rw-r--r--include/osmocom/gsm/gsm0808_utils.h1
-rw-r--r--include/osmocom/gsm/protocol/gsm_08_08.h14
-rw-r--r--src/gsm/gsm0808_utils.c43
-rw-r--r--src/gsm/libosmogsm.map1
-rw-r--r--tests/gsm0808/gsm0808_test.c196
-rw-r--r--tests/gsm0808/gsm0808_test.ok225
6 files changed, 480 insertions, 0 deletions
diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h
index 242bce94..0a7429e9 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -104,6 +104,7 @@ int gsm0808_dec_cell_id(struct gsm0808_cell_id *ci, const uint8_t *elem, uint8_t
int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch);
int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc,
uint8_t perm_spch);
+uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(struct gsm48_multi_rate_conf *cfg, bool fr);
/*! Return 3GPP TS 48.008 3.2.2.49 Current Channel Type 1 from enum gsm_chan_t. */
static inline uint8_t gsm0808_current_channel_type_1(enum gsm_chan_t type)
diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h
index 94338178..8431ace5 100644
--- a/include/osmocom/gsm/protocol/gsm_08_08.h
+++ b/include/osmocom/gsm/protocol/gsm_08_08.h
@@ -503,6 +503,20 @@ enum gsm0808_speech_codec_defaults {
GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB = 0x01,
};
+/*! Default speech codec configurations broken down by reate.
+ * See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred Configurations for
+ * the Adaptive Multi-Rate Codec Types. */
+enum gsm0808_speech_codec_rate_defaults {
+ GSM0808_SC_CFG_DEFAULT_AMR_4_75 = 0xff03,
+ GSM0808_SC_CFG_DEFAULT_AMR_5_15 = 0x0000,
+ GSM0808_SC_CFG_DEFAULT_AMR_5_90 = 0xff06,
+ GSM0808_SC_CFG_DEFAULT_AMR_6_70 = 0x3e08,
+ GSM0808_SC_CFG_DEFAULT_AMR_7_40 = 0x0c12,
+ GSM0808_SC_CFG_DEFAULT_AMR_7_95 = 0xc020,
+ GSM0808_SC_CFG_DEFAULT_AMR_10_2 = 0x3040,
+ GSM0808_SC_CFG_DEFAULT_AMR_12_2 = 0xc082
+};
+
/* 3GPP TS 48.008 3.2.2.103 Speech Codec List */
#define SPEECH_CODEC_MAXLEN 255
struct gsm0808_speech_codec_list {
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index 73f02341..4b2a5f56 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -1161,6 +1161,49 @@ int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc,
return 0;
}
+/*! Determine a set of AMR speech codec configuration bits (S0-S15) from a
+ * given GSM 04.08 AMR configuration struct.
+ * \param[in] cfg AMR configuration in GSM 04.08 format.
+ * \param[in] hint if the resulting configuration shall be used with a FR or HR TCH.
+ * \returns configuration bits (S0-S15) */
+uint16_t gsm0808_sc_cfg_from_gsm48_mr_cfg(struct gsm48_multi_rate_conf *cfg,
+ bool fr)
+{
+ uint16_t s15_s0 = 0;
+
+ /* Check each rate bit in the AMR multirate configuration and pick the
+ * matching default configuration as specified in 3GPP TS 28.062,
+ * Table 7.11.3.1.3-2. */
+ if (cfg->m4_75)
+ s15_s0 |= GSM0808_SC_CFG_DEFAULT_AMR_4_75;
+ if (cfg->m5_15)
+ s15_s0 |= GSM0808_SC_CFG_DEFAULT_AMR_5_15;
+ if (cfg->m5_90)
+ s15_s0 |= GSM0808_SC_CFG_DEFAULT_AMR_5_90;
+ if (cfg->m6_70)
+ s15_s0 |= GSM0808_SC_CFG_DEFAULT_AMR_6_70;
+ if (cfg->m7_40)
+ s15_s0 |= GSM0808_SC_CFG_DEFAULT_AMR_7_40;
+ if (cfg->m7_95)
+ s15_s0 |= GSM0808_SC_CFG_DEFAULT_AMR_7_95;
+ if (cfg->m10_2)
+ s15_s0 |= GSM0808_SC_CFG_DEFAULT_AMR_10_2;
+ if (cfg->m12_2)
+ s15_s0 |= GSM0808_SC_CFG_DEFAULT_AMR_12_2;
+
+ /* Note: 3GPP TS 48.008, chapter 3GPP TS 48.008 states that for AMR
+ * some of the configuration bits must be coded as zeros. The applied
+ * bitmask matches the default codec settings. See also the definition
+ * of enum gsm0808_speech_codec_defaults in gsm_08_08.h and
+ * 3GPP TS 28.062, Table 7.11.3.1.3-2. */
+ if (fr)
+ s15_s0 &= GSM0808_SC_CFG_DEFAULT_FR_AMR;
+ else
+ s15_s0 &= GSM0808_SC_CFG_DEFAULT_HR_AMR;
+
+ return s15_s0;
+}
+
/*! Print a human readable name of the cell identifier to the char buffer.
* This is useful both for struct gsm0808_cell_id and struct gsm0808_cell_id_list2.
* See also gsm0808_cell_id_name() and gsm0808_cell_id_list_name().
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 0c40c88c..3d08232c 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -205,6 +205,7 @@ gsm0808_cell_id_discr_names;
gsm0808_cell_id_u_name;
gsm0808_chan_type_to_speech_codec;
gsm0808_speech_codec_from_chan_type;
+gsm0808_sc_cfg_from_gsm48_mr_cfg;
gsm0808_speech_codec_type_names;
gsm0808_permitted_speech_names;
gsm0808_chosen_enc_alg_names;
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index ae138be8..29cecb2e 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -1444,6 +1444,200 @@ static void test_gsm0808_enc_dec_cell_id_global()
msgb_free(msg);
}
+static void test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(struct gsm48_multi_rate_conf *cfg)
+{
+ uint16_t s15_s0;
+
+ printf("Input:\n");
+ printf(" m4_75= %u smod= %u\n", cfg->m4_75, cfg->smod);
+ printf(" m5_15= %u spare= %u\n", cfg->m5_15, cfg->spare);
+ printf(" m5_90= %u icmi= %u\n", cfg->m5_90, cfg->icmi);
+ printf(" m6_70= %u nscb= %u\n", cfg->m6_70, cfg->nscb);
+ printf(" m7_40= %u ver= %u\n", cfg->m7_40, cfg->ver);
+ printf(" m7_95= %u\n", cfg->m7_95);
+ printf(" m10_2= %u\n", cfg->m10_2);
+ printf(" m12_2= %u\n", cfg->m12_2);
+
+ s15_s0 = gsm0808_sc_cfg_from_gsm48_mr_cfg(cfg, true);
+ printf("Result (fr):\n");
+ printf(" S15-S0 = %04x = 0b" OSMO_BIN_SPEC OSMO_BIN_SPEC "\n", s15_s0,
+ OSMO_BIN_PRINT(s15_s0 >> 8), OSMO_BIN_PRINT(s15_s0));
+
+ s15_s0 = gsm0808_sc_cfg_from_gsm48_mr_cfg(cfg, false);
+ printf("Result (hr):\n");
+ printf(" S15-S0 = %04x = 0b" OSMO_BIN_SPEC OSMO_BIN_SPEC "\n", s15_s0,
+ OSMO_BIN_PRINT(s15_s0 >> 8), OSMO_BIN_PRINT(s15_s0));
+
+ printf("\n");
+}
+
+static void test_gsm0808_sc_cfg_from_gsm48_mr_cfg(void)
+{
+ struct gsm48_multi_rate_conf cfg;
+
+ printf("Testing gsm0808_sc_cfg_from_gsm48_mr_cfg():\n");
+
+ cfg.m4_75 = 0;
+ cfg.m5_15 = 0;
+ cfg.m5_90 = 0;
+ cfg.m6_70 = 0;
+ cfg.m7_40 = 0;
+ cfg.m7_95 = 0;
+ cfg.m10_2 = 0;
+ cfg.m12_2 = 0;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 1;
+ cfg.m5_15 = 0;
+ cfg.m5_90 = 0;
+ cfg.m6_70 = 0;
+ cfg.m7_40 = 0;
+ cfg.m7_95 = 0;
+ cfg.m10_2 = 0;
+ cfg.m12_2 = 0;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 0;
+ cfg.m5_15 = 1;
+ cfg.m5_90 = 0;
+ cfg.m6_70 = 0;
+ cfg.m7_40 = 0;
+ cfg.m7_95 = 0;
+ cfg.m10_2 = 0;
+ cfg.m12_2 = 0;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 0;
+ cfg.m5_15 = 0;
+ cfg.m5_90 = 1;
+ cfg.m6_70 = 0;
+ cfg.m7_40 = 0;
+ cfg.m7_95 = 0;
+ cfg.m10_2 = 0;
+ cfg.m12_2 = 0;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 0;
+ cfg.m5_15 = 0;
+ cfg.m5_90 = 0;
+ cfg.m6_70 = 1;
+ cfg.m7_40 = 0;
+ cfg.m7_95 = 0;
+ cfg.m10_2 = 0;
+ cfg.m12_2 = 0;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 0;
+ cfg.m5_15 = 0;
+ cfg.m5_90 = 0;
+ cfg.m6_70 = 0;
+ cfg.m7_40 = 1;
+ cfg.m7_95 = 0;
+ cfg.m10_2 = 0;
+ cfg.m12_2 = 0;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 0;
+ cfg.m5_15 = 0;
+ cfg.m5_90 = 0;
+ cfg.m6_70 = 0;
+ cfg.m7_40 = 0;
+ cfg.m7_95 = 1;
+ cfg.m10_2 = 0;
+ cfg.m12_2 = 0;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 0;
+ cfg.m5_15 = 0;
+ cfg.m5_90 = 0;
+ cfg.m6_70 = 0;
+ cfg.m7_40 = 0;
+ cfg.m7_95 = 0;
+ cfg.m10_2 = 1;
+ cfg.m12_2 = 0;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 0;
+ cfg.m5_15 = 0;
+ cfg.m5_90 = 0;
+ cfg.m6_70 = 0;
+ cfg.m7_40 = 0;
+ cfg.m7_95 = 0;
+ cfg.m10_2 = 0;
+ cfg.m12_2 = 1;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 1;
+ cfg.m5_15 = 1;
+ cfg.m5_90 = 1;
+ cfg.m6_70 = 1;
+ cfg.m7_40 = 0;
+ cfg.m7_95 = 0;
+ cfg.m10_2 = 0;
+ cfg.m12_2 = 0;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 0;
+ cfg.m5_15 = 0;
+ cfg.m5_90 = 0;
+ cfg.m6_70 = 0;
+ cfg.m7_40 = 1;
+ cfg.m7_95 = 1;
+ cfg.m10_2 = 1;
+ cfg.m12_2 = 1;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 0;
+ cfg.m5_15 = 0;
+ cfg.m5_90 = 1;
+ cfg.m6_70 = 1;
+ cfg.m7_40 = 0;
+ cfg.m7_95 = 0;
+ cfg.m10_2 = 1;
+ cfg.m12_2 = 1;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 1;
+ cfg.m5_15 = 1;
+ cfg.m5_90 = 0;
+ cfg.m6_70 = 0;
+ cfg.m7_40 = 1;
+ cfg.m7_95 = 1;
+ cfg.m10_2 = 0;
+ cfg.m12_2 = 0;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 0;
+ cfg.m5_15 = 1;
+ cfg.m5_90 = 0;
+ cfg.m6_70 = 1;
+ cfg.m7_40 = 0;
+ cfg.m7_95 = 1;
+ cfg.m10_2 = 0;
+ cfg.m12_2 = 1;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 1;
+ cfg.m5_15 = 0;
+ cfg.m5_90 = 1;
+ cfg.m6_70 = 0;
+ cfg.m7_40 = 1;
+ cfg.m7_95 = 0;
+ cfg.m10_2 = 1;
+ cfg.m12_2 = 0;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+
+ cfg.m4_75 = 1;
+ cfg.m5_15 = 1;
+ cfg.m5_90 = 1;
+ cfg.m6_70 = 1;
+ cfg.m7_40 = 1;
+ cfg.m7_95 = 1;
+ cfg.m10_2 = 1;
+ cfg.m12_2 = 1;
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(&cfg);
+}
+
int main(int argc, char **argv)
{
printf("Testing generation of GSM0808 messages\n");
@@ -1495,6 +1689,8 @@ int main(int argc, char **argv)
test_gsm0808_enc_dec_cell_id_lac_and_ci();
test_gsm0808_enc_dec_cell_id_global();
+ test_gsm0808_sc_cfg_from_gsm48_mr_cfg();
+
printf("Done\n");
return EXIT_SUCCESS;
}
diff --git a/tests/gsm0808/gsm0808_test.ok b/tests/gsm0808/gsm0808_test.ok
index 6cd7982b..dc1debac 100644
--- a/tests/gsm0808/gsm0808_test.ok
+++ b/tests/gsm0808/gsm0808_test.ok
@@ -74,4 +74,229 @@ test_gsm0808_enc_dec_cell_id_lai_and_lac: encoded: 05 06 04 21 63 54 23 42 (rc =
test_gsm0808_enc_dec_cell_id_ci: encoded: 05 03 02 04 23 (rc = 5)
test_gsm0808_enc_dec_cell_id_lac_and_ci: encoded: 05 05 01 04 23 02 35 (rc = 7)
test_gsm0808_enc_dec_cell_id_global: encoded: 05 08 00 21 63 54 23 42 04 23 (rc = 10)
+Testing gsm0808_sc_cfg_from_gsm48_mr_cfg():
+Input:
+ m4_75= 0 smod= 0
+ m5_15= 0 spare= 0
+ m5_90= 0 icmi= 0
+ m6_70= 0 nscb= 0
+ m7_40= 0 ver= 0
+ m7_95= 0
+ m10_2= 0
+ m12_2= 0
+Result (fr):
+ S15-S0 = 0000 = 0b0000000000000000
+Result (hr):
+ S15-S0 = 0000 = 0b0000000000000000
+
+Input:
+ m4_75= 1 smod= 0
+ m5_15= 0 spare= 0
+ m5_90= 0 icmi= 0
+ m6_70= 0 nscb= 0
+ m7_40= 0 ver= 0
+ m7_95= 0
+ m10_2= 0
+ m12_2= 0
+Result (fr):
+ S15-S0 = 5703 = 0b0101011100000011
+Result (hr):
+ S15-S0 = 0703 = 0b0000011100000011
+
+Input:
+ m4_75= 0 smod= 0
+ m5_15= 1 spare= 0
+ m5_90= 0 icmi= 0
+ m6_70= 0 nscb= 0
+ m7_40= 0 ver= 0
+ m7_95= 0
+ m10_2= 0
+ m12_2= 0
+Result (fr):
+ S15-S0 = 0000 = 0b0000000000000000
+Result (hr):
+ S15-S0 = 0000 = 0b0000000000000000
+
+Input:
+ m4_75= 0 smod= 0
+ m5_15= 0 spare= 0
+ m5_90= 1 icmi= 0
+ m6_70= 0 nscb= 0
+ m7_40= 0 ver= 0
+ m7_95= 0
+ m10_2= 0
+ m12_2= 0
+Result (fr):
+ S15-S0 = 5706 = 0b0101011100000110
+Result (hr):
+ S15-S0 = 0706 = 0b0000011100000110
+
+Input:
+ m4_75= 0 smod= 0
+ m5_15= 0 spare= 0
+ m5_90= 0 icmi= 0
+ m6_70= 1 nscb= 0
+ m7_40= 0 ver= 0
+ m7_95= 0
+ m10_2= 0
+ m12_2= 0
+Result (fr):
+ S15-S0 = 1608 = 0b0001011000001000
+Result (hr):
+ S15-S0 = 0608 = 0b0000011000001000
+
+Input:
+ m4_75= 0 smod= 0
+ m5_15= 0 spare= 0
+ m5_90= 0 icmi= 0
+ m6_70= 0 nscb= 0
+ m7_40= 1 ver= 0
+ m7_95= 0
+ m10_2= 0
+ m12_2= 0
+Result (fr):
+ S15-S0 = 0412 = 0b0000010000010010
+Result (hr):
+ S15-S0 = 0412 = 0b0000010000010010
+
+Input:
+ m4_75= 0 smod= 0
+ m5_15= 0 spare= 0
+ m5_90= 0 icmi= 0
+ m6_70= 0 nscb= 0
+ m7_40= 0 ver= 0
+ m7_95= 1
+ m10_2= 0
+ m12_2= 0
+Result (fr):
+ S15-S0 = 4020 = 0b0100000000100000
+Result (hr):
+ S15-S0 = 0020 = 0b0000000000100000
+
+Input:
+ m4_75= 0 smod= 0
+ m5_15= 0 spare= 0
+ m5_90= 0 icmi= 0
+ m6_70= 0 nscb= 0
+ m7_40= 0 ver= 0
+ m7_95= 0
+ m10_2= 1
+ m12_2= 0
+Result (fr):
+ S15-S0 = 1040 = 0b0001000001000000
+Result (hr):
+ S15-S0 = 0000 = 0b0000000000000000
+
+Input:
+ m4_75= 0 smod= 0
+ m5_15= 0 spare= 0
+ m5_90= 0 icmi= 0
+ m6_70= 0 nscb= 0
+ m7_40= 0 ver= 0
+ m7_95= 0
+ m10_2= 0
+ m12_2= 1
+Result (fr):
+ S15-S0 = 4082 = 0b0100000010000010
+Result (hr):
+ S15-S0 = 0002 = 0b0000000000000010
+
+Input:
+ m4_75= 1 smod= 0
+ m5_15= 1 spare= 0
+ m5_90= 1 icmi= 0
+ m6_70= 1 nscb= 0
+ m7_40= 0 ver= 0
+ m7_95= 0
+ m10_2= 0
+ m12_2= 0
+Result (fr):
+ S15-S0 = 570f = 0b0101011100001111
+Result (hr):
+ S15-S0 = 070f = 0b0000011100001111
+
+Input:
+ m4_75= 0 smod= 0
+ m5_15= 0 spare= 0
+ m5_90= 0 icmi= 0
+ m6_70= 0 nscb= 0
+ m7_40= 1 ver= 0
+ m7_95= 1
+ m10_2= 1
+ m12_2= 1
+Result (fr):
+ S15-S0 = 54f2 = 0b0101010011110010
+Result (hr):
+ S15-S0 = 0432 = 0b0000010000110010
+
+Input:
+ m4_75= 0 smod= 0
+ m5_15= 0 spare= 0
+ m5_90= 1 icmi= 0
+ m6_70= 1 nscb= 0
+ m7_40= 0 ver= 0
+ m7_95= 0
+ m10_2= 1
+ m12_2= 1
+Result (fr):
+ S15-S0 = 57ce = 0b0101011111001110
+Result (hr):
+ S15-S0 = 070e = 0b0000011100001110
+
+Input:
+ m4_75= 1 smod= 0
+ m5_15= 1 spare= 0
+ m5_90= 0 icmi= 0
+ m6_70= 0 nscb= 0
+ m7_40= 1 ver= 0
+ m7_95= 1
+ m10_2= 0
+ m12_2= 0
+Result (fr):
+ S15-S0 = 5733 = 0b0101011100110011
+Result (hr):
+ S15-S0 = 0733 = 0b0000011100110011
+
+Input:
+ m4_75= 0 smod= 0
+ m5_15= 1 spare= 0
+ m5_90= 0 icmi= 0
+ m6_70= 1 nscb= 0
+ m7_40= 0 ver= 0
+ m7_95= 1
+ m10_2= 0
+ m12_2= 1
+Result (fr):
+ S15-S0 = 56aa = 0b0101011010101010
+Result (hr):
+ S15-S0 = 062a = 0b0000011000101010
+
+Input:
+ m4_75= 1 smod= 0
+ m5_15= 0 spare= 0
+ m5_90= 1 icmi= 0
+ m6_70= 0 nscb= 0
+ m7_40= 1 ver= 0
+ m7_95= 0
+ m10_2= 1
+ m12_2= 0
+Result (fr):
+ S15-S0 = 5757 = 0b0101011101010111
+Result (hr):
+ S15-S0 = 0717 = 0b0000011100010111
+
+Input:
+ m4_75= 1 smod= 0
+ m5_15= 1 spare= 0
+ m5_90= 1 icmi= 0
+ m6_70= 1 nscb= 0
+ m7_40= 1 ver= 0
+ m7_95= 1
+ m10_2= 1
+ m12_2= 1
+Result (fr):
+ S15-S0 = 57ff = 0b0101011111111111
+Result (hr):
+ S15-S0 = 073f = 0b0000011100111111
+
Done