Loading...
Searching...
No Matches
gsm0503_amr_dtx.c File Reference
`#include <stdio.h>`
`#include <stdint.h>`
`#include <string.h>`
`#include <stdlib.h>`
`#include <errno.h>`
`#include <osmocom/core/bits.h>`
`#include <osmocom/core/conv.h>`
`#include <osmocom/core/utils.h>`
`#include <osmocom/coding/gsm0503_amr_dtx.h>`
`#include <osmocom/coding/gsm0503_parity.h>`
`#include <osmocom/gsm/gsm0503.h>`

## Macros

#define | S2U(b) ((b) < 0)

## Functions

static bool | detect_afs_id_marker (int *n_errors, int *n_bits_total, const sbit_t *sbits, uint8_t offset, uint8_t count, const ubit_t *id_marker, uint8_t id_marker_len)
static bool | detect_ahs_id_marker (int *n_errors, int *n_bits_total, const sbit_t *sbits, const ubit_t *id_marker)
static bool | detect_interleaved_ahs_id_marker (int *n_errors, int *n_bits_total, const sbit_t *sbits, uint8_t offset, uint8_t n_bits, const ubit_t *id_marker, uint8_t id_marker_len)
static bool | detect_afs_sid_first (int *n_errors, int *n_bits_total, const sbit_t *sbits)
static bool | detect_afs_sid_update (int *n_errors, int *n_bits_total, const sbit_t *sbits)
static int | detect_afs_onset (int *n_errors, int *n_bits_total, const sbit_t *sbits)
static bool | detect_ahs_sid_update (int *n_errors, int *n_bits_total, const sbit_t *sbits)
static bool | detect_ahs_sid_first_p1 (int *n_errors, int *n_bits_total, const sbit_t *sbits)
static int | detect_ahs_sid_first_p2 (int *n_errors, int *n_bits_total, const sbit_t *sbits)
static int | detect_ahs_onset (int *n_errors, int *n_bits_total, const sbit_t *sbits)
static bool | detect_ahs_sid_first_inh (int *n_errors, int *n_bits_total, const sbit_t *sbits)
static bool | detect_ahs_sid_update_inh (int *n_errors, int *n_bits_total, const sbit_t *sbits)
enum gsm0503_amr_dtx_frames | gsm0503_detect_afs_dtx_frame2 (int *n_errors, int *n_bits_total, int *mode_id, const sbit_t *sbits)
| Detect FR AMR DTX frame in unmapped, deinterleaved frame bits.
enum gsm0503_amr_dtx_frames | gsm0503_detect_afs_dtx_frame (int *n_errors, int *n_bits_total, const ubit_t *ubits)
| Detect FR AMR DTX frame in unmapped, deinterleaved frame bits.
enum gsm0503_amr_dtx_frames | gsm0503_detect_ahs_dtx_frame2 (int *n_errors, int *n_bits_total, int *mode_id, const sbit_t *sbits)
| Detect HR AMR DTX frame in unmapped, deinterleaved frame bits.
enum gsm0503_amr_dtx_frames | gsm0503_detect_ahs_dtx_frame (int *n_errors, int *n_bits_total, const ubit_t *ubits)
| Detect HR AMR DTX frame in unmapped, deinterleaved frame bits.

## Variables

static const ubit_t | id_marker_1 [] = { 1, 0, 1, 1, 0, 0, 0, 0, 1 }
static const ubit_t | id_marker_0 [] = { 0, 1, 0, 0, 1, 1, 1, 1, 0 }
static const ubit_t | codec_mode_1_sid [] = { 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0 }
static const ubit_t | codec_mode_2_sid [] = { 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0 }
static const ubit_t | codec_mode_3_sid [] = { 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1 }
static const ubit_t | codec_mode_4_sid [] = { 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1 }
const struct value_string | gsm0503_amr_dtx_frame_names []

## Macro Definition Documentation

## S2U

#define S2U | ( |  | b | ) | ((b) < 0)

## Function Documentation

## detect_afs_id_marker()

static bool detect_afs_id_marker | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits,
|  | uint8_t | offset,
|  | uint8_t | count,
|  | const ubit_t * | id_marker,
|  | uint8_t | id_marker_len
| ) |  |

static

References S2U.

Referenced by detect_afs_onset(), detect_afs_sid_first(), and detect_afs_sid_update().

## detect_afs_onset()

static int detect_afs_onset | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits
| ) |  |

static

References codec_mode_1_sid, codec_mode_2_sid, codec_mode_3_sid, codec_mode_4_sid, and detect_afs_id_marker().

Referenced by gsm0503_detect_afs_dtx_frame2().

## detect_afs_sid_first()

static bool detect_afs_sid_first | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits
| ) |  |

static

References detect_afs_id_marker(), and id_marker_0.

Referenced by gsm0503_detect_afs_dtx_frame2().

## detect_afs_sid_update()

static bool detect_afs_sid_update | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits
| ) |  |

static

References detect_afs_id_marker(), and id_marker_0.

Referenced by gsm0503_detect_afs_dtx_frame2().

## detect_ahs_id_marker()

static bool detect_ahs_id_marker | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits,
|  | const ubit_t * | id_marker
| ) |  |

static

References S2U.

Referenced by detect_ahs_sid_first_p1(), and detect_ahs_sid_update().

## detect_ahs_onset()

static int detect_ahs_onset | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits
| ) |  |

static

References codec_mode_1_sid, codec_mode_2_sid, codec_mode_3_sid, codec_mode_4_sid, and detect_interleaved_ahs_id_marker().

Referenced by gsm0503_detect_ahs_dtx_frame2().

## detect_ahs_sid_first_inh()

static bool detect_ahs_sid_first_inh | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits
| ) |  |

static

References detect_interleaved_ahs_id_marker(), and id_marker_1.

Referenced by gsm0503_detect_ahs_dtx_frame2().

## detect_ahs_sid_first_p1()

static bool detect_ahs_sid_first_p1 | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits
| ) |  |

static

References detect_ahs_id_marker(), and id_marker_0.

Referenced by gsm0503_detect_ahs_dtx_frame2().

## detect_ahs_sid_first_p2()

static int detect_ahs_sid_first_p2 | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits
| ) |  |

static

References codec_mode_1_sid, codec_mode_2_sid, codec_mode_3_sid, codec_mode_4_sid, and detect_interleaved_ahs_id_marker().

Referenced by gsm0503_detect_ahs_dtx_frame2().

## detect_ahs_sid_update()

static bool detect_ahs_sid_update | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits
| ) |  |

static

References detect_ahs_id_marker(), and id_marker_1.

Referenced by gsm0503_detect_ahs_dtx_frame2().

## detect_ahs_sid_update_inh()

static bool detect_ahs_sid_update_inh | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits
| ) |  |

static

References detect_interleaved_ahs_id_marker(), and id_marker_0.

Referenced by gsm0503_detect_ahs_dtx_frame2().

## detect_interleaved_ahs_id_marker()

static bool detect_interleaved_ahs_id_marker | ( | int * | n_errors,
|  | int * | n_bits_total,
|  | const sbit_t * | sbits,
|  | uint8_t | offset,
|  | uint8_t | n_bits,
|  | const ubit_t * | id_marker,
|  | uint8_t | id_marker_len
| ) |  |

static

References S2U.

Referenced by detect_ahs_onset(), detect_ahs_sid_first_inh(), detect_ahs_sid_first_p2(), and detect_ahs_sid_update_inh().

## Variable Documentation

## codec_mode_1_sid

const ubit_t codec_mode_1_sid[] = { 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0 }

static

Referenced by detect_afs_onset(), detect_ahs_onset(), and detect_ahs_sid_first_p2().

## codec_mode_2_sid

const ubit_t codec_mode_2_sid[] = { 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0 }

static

Referenced by detect_afs_onset(), detect_ahs_onset(), and detect_ahs_sid_first_p2().

## codec_mode_3_sid

const ubit_t codec_mode_3_sid[] = { 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1 }

static

Referenced by detect_afs_onset(), detect_ahs_onset(), and detect_ahs_sid_first_p2().

## codec_mode_4_sid

const ubit_t codec_mode_4_sid[] = { 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1 }

static

Referenced by detect_afs_onset(), detect_ahs_onset(), and detect_ahs_sid_first_p2().

## id_marker_0

const ubit_t id_marker_0[] = { 0, 1, 0, 0, 1, 1, 1, 1, 0 }

static

Referenced by detect_afs_sid_first(), detect_afs_sid_update(), detect_ahs_sid_first_p1(), and detect_ahs_sid_update_inh().

## id_marker_1

const ubit_t id_marker_1[] = { 1, 0, 1, 1, 0, 0, 0, 0, 1 }

static

Referenced by detect_ahs_sid_first_inh(), and detect_ahs_sid_update().