libg722_1 0.0.1
g192_bit_stream.c File Reference
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include <audiofile.h>
#include "g192_bit_stream.h"

Macros

#define FALSE   0
 
#define TRUE   (!FALSE)
 

Enumerations

enum  {
  G192_FRAME_ERASURE = 0x6B20 , G192_FRAME_SYNC_1 = 0x6B21 , G192_FRAME_SYNC_2 = 0x6B22 , G192_FRAME_SYNC_3 = 0x6B23 ,
  G192_FRAME_SYNC_4 = 0x6B24 , G192_FRAME_SYNC_5 = 0x6B25 , G192_FRAME_SYNC_6 = 0x6B26 , G192_FRAME_SYNC_7 = 0x6B27 ,
  G192_FRAME_SYNC_8 = 0x6B28 , G192_FRAME_SYNC_9 = 0x6B29 , G192_FRAME_SYNC_10 = 0x6B2A , G192_FRAME_SYNC_11 = 0x6B2B ,
  G192_FRAME_SYNC_12 = 0x6B2C , G192_FRAME_SYNC_13 = 0x6B2D , G192_FRAME_SYNC_14 = 0x6B2E , G192_FRAME_SYNC_15 = 0x6B2F ,
  G192_HARD_ZERO = 0x7F , G192_INDETERMINATE = 0x00 , G192_HARD_ONE = 0x81
}
 

Functions

int itu_codec_bitstream_write (const uint8_t out_data[], int number_of_bits, int mode, FILE *fp_bitstream)
 Write a frame of data to an output file.
 
int itu_codec_bitstream_read (uint8_t in_data[], int16_t *erasure, int number_of_bits, int mode, FILE *fp_bitstream)
 Read a frame of data from an input file.
 

Function Documentation

◆ itu_codec_bitstream_read()

int itu_codec_bitstream_read ( uint8_t in_data[],
int16_t * p_erasure,
int number_of_bits,
int mode,
FILE * fp_bitstream )

Read a frame of data from an input file.

Parameters
in_dataThe buffer for the data to be read.
p_erasureSet to TRUE if there is a frame erasure, else set to FALSE.
number_of_bitsThe number of bits to be read.
mode0 = continuous, 1 = ITU G.192 codec bitstream format.
fp_bitstreamThe file context to be read from.
Returns
The number of words read.

◆ itu_codec_bitstream_write()

int itu_codec_bitstream_write ( const uint8_t out_data[],
int number_of_bits,
int mode,
FILE * fp_bitstream )

Write a frame of data to an output file.

Parameters
out_dataThe buffer for the data to be written.
number_of_bitsThe number of bits to be written.
mode0 = continuous, 1 = ITU G.192 codec bitstream format.
fp_bitstreamThe file context to be written to.
Returns
The number of words written.