Loading...
Searching...
No Matches
hr_sid_class.c File Reference
`#include <stdint.h>`
`#include <stdbool.h>`
`#include <osmocom/codec/codec.h>`

## Functions

static unsigned | count_ones_under_mask (const uint8_t *data, const uint8_t *mask, unsigned nbytes)
enum osmo_gsm631_sid_class | osmo_hr_sid_classify (const uint8_t *rtp_payload, bool bci_flag, bool *bfi_from_bci)

## Variables

static const uint8_t | ones_in_nibble [16]
static const uint8_t | sid_field_last10_mask [10]
static const uint8_t | sid_field_misordered [14]
static const uint8_t | class2_mask_voiced [4] = {0x7F, 0x80, 0x3F, 0xE0}
static const uint8_t | class2_mask_unvoiced [4] = {0x07, 0x07, 0xFF, 0xE0}

## Function Documentation

## count_ones_under_mask()

static unsigned count_ones_under_mask | ( | const uint8_t * | data,
|  | const uint8_t * | mask,
|  | unsigned | nbytes
| ) |  |

static

References data, n, and ones_in_nibble.

Referenced by osmo_hr_sid_classify().

## osmo_hr_sid_classify()

enum osmo_gsm631_sid_class osmo_hr_sid_classify | ( | const uint8_t * | rtp_payload,
|  | bool | bci_flag,
|  | bool * | bfi_from_bci
| ) |  |

References class2_mask_unvoiced, class2_mask_voiced, count_ones_under_mask(), OSMO_GSM631_SID_CLASS_INVALID, OSMO_GSM631_SID_CLASS_SPEECH, OSMO_GSM631_SID_CLASS_VALID, sid_field_last10_mask, and sid_field_misordered.

## Variable Documentation

## class2_mask_unvoiced

const uint8_t class2_mask_unvoiced[4] = {0x07, 0x07, 0xFF, 0xE0}

static

Referenced by osmo_hr_sid_classify().

## class2_mask_voiced

const uint8_t class2_mask_voiced[4] = {0x7F, 0x80, 0x3F, 0xE0}

static

Referenced by osmo_hr_sid_classify().

## ones_in_nibble

const uint8_t ones_in_nibble[16]

static

Initial value:
= {0, 1, 1, 2, 1, 2, 2, 3,
1, 2, 2, 3, 2, 3, 3, 4}

Referenced by count_ones_under_mask().

## sid_field_last10_mask

const uint8_t sid_field_last10_mask[10]

static

Initial value:
= {
0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
}

Referenced by osmo_hr_sid_classify().

## sid_field_misordered

const uint8_t sid_field_misordered[14]

static

Initial value:
= {
0x08, 0xEF, 0x1F, 0x3F, 0xF3, 0xFC, 0xA4,
0xFF, 0xFA, 0x3F, 0xFF, 0x47, 0xFF, 0xEC
}

Referenced by osmo_hr_sid_classify().