NCEPLIBS-g2c  1.8.0
decenc_aec.c File Reference

Decode and encode functions for AEC compression. More...

#include <stdio.h>
#include <stdint.h>
#include <libaec.h>
#include "grib2_int.h"

Go to the source code of this file.

Functions

int dec_aec (unsigned char *cpack, g2int len, g2int nbits, g2int flags, g2int block_size, g2int rsi, unsigned char *cfld, g2int cfldlen)
 This Function decodes an AEC code stream specified in the CCSDS 121.0-B-3 Blue Book. More...
 
int enc_aec (unsigned char *data, g2int ctemplen, g2int nbits, g2int flags, g2int block_size, g2int rsi, unsigned char *aecbuf, g2int *aecbuflen)
 This Function encodes data into an AEC code stream specified in the CCSDS 121.0-B-3 Blue Book. More...
 

Detailed Description

Decode and encode functions for AEC compression.

stream

Author
Eric Engle
Date
2023-10-16

Program History Log

Date Programmer Comments
2023-10-16 Engle Initial

Definition in file decenc_aec.c.

Function Documentation

◆ dec_aec()

int dec_aec ( unsigned char *  cpack,
g2int  len,
g2int  nbits,
g2int  flags,
g2int  block_size,
g2int  rsi,
unsigned char *  cfld,
g2int  cfldlen 
)

This Function decodes an AEC code stream specified in the CCSDS 121.0-B-3 Blue Book.

Parameters
cpackPointer to buffer that holds the input AEC code stream.
lenLength (in bytes) of the buffer that holds the input AEC code stream.
nbitsCCSDS bits per sample.
flagsCCSDS compression options mask.
block_sizeCCSDS block size.
rsiCCSDS reference sample interval.
cfldPointer to output buffer from the AEC decoder.
cfldlenlength of output buffer.
Returns
  • >0 Length of data from AEC decoder
  • 0 Successful decode (AEC_OK)
  • -1 AEC_CONF_ERROR
  • -2 AEC_STREAM_ERROR
  • -3 AEC_DATA_ERROR
  • -4 AEC_MEM_ERROR
  • -5 AEC_RSI_OFFSETS_ERROR
Author
Eric Engle
Date
2023-10-16

Definition at line 43 of file decenc_aec.c.

References LOG.

Referenced by aecunpack_int().

◆ enc_aec()

int enc_aec ( unsigned char *  data,
g2int  ctemplen,
g2int  nbits,
g2int  flags,
g2int  block_size,
g2int  rsi,
unsigned char *  aecbuf,
g2int aecbuflen 
)

This Function encodes data into an AEC code stream specified in the CCSDS 121.0-B-3 Blue Book.

Parameters
dataPointer to buffer that holds the input data.
ctemplenLength (in bytes) of the buffer that holds the input data..
nbitsCCSDS bits per sample.
flagsCCSDS compression options mask.
block_sizeCCSDS block size.
rsiCCSDS reference sample interval.
aecbufPointer to buffer holding the AEC encoded stream.
aecbuflenLength of AEC code stream.
Returns
  • >0 Exact length of AEC encoded data.
  • 0 Successful decode (AEC_OK)
  • -1 AEC_CONF_ERROR
  • -2 AEC_STREAM_ERROR
  • -3 AEC_DATA_ERROR
  • -4 AEC_MEM_ERROR
  • -5 AEC_RSI_OFFSETS_ERROR
Author
Eric Engle
Date
2023-10-16

Definition at line 111 of file decenc_aec.c.

References LOG.

Referenced by aecpack_int().