TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Macros | Functions | Variables
rsecc.c File Reference
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include "rsecc.h"

Go to the source code of this file.

Macros

#define SYMBOL_SIZE   (8)
 
#define symbols   ((1U << SYMBOL_SIZE) - 1)
 
#define min_length   (2)
 
#define max_length   (30)
 
#define max_generatorSize   (max_length)
 

Functions

static void RSECC_initLookupTable (void)
 
static void RSECC_init (void)
 
static void generator_init (size_t length)
 
int RSECC_encode (size_t data_length, size_t ecc_length, const unsigned char *data, unsigned char *ecc)
 

Variables

static pthread_mutex_t RSECC_mutex = PTHREAD_MUTEX_INITIALIZER
 
static int initialized = 0
 
static const unsigned int proot = 0x11d
 
static unsigned char alpha [symbols+1]
 
static unsigned char aindex [symbols+1]
 
static unsigned char generator [max_length-min_length+1][max_generatorSize+1]
 
static unsigned char generatorInitialized [max_length-min_length+1]
 

Macro Definition Documentation

#define max_generatorSize   (max_length)

Definition at line 48 of file rsecc.c.

Referenced by generator_init().

#define max_length   (30)

Definition at line 47 of file rsecc.c.

Referenced by gen_bitlen(), RSECC_encode(), and RSECC_init().

#define min_length   (2)

Definition at line 46 of file rsecc.c.

Referenced by generator_init(), RSECC_encode(), and RSECC_init().

#define SYMBOL_SIZE   (8)

Definition at line 41 of file rsecc.c.

#define symbols   ((1U << SYMBOL_SIZE) - 1)

Definition at line 42 of file rsecc.c.

Referenced by generator_init(), RSECC_encode(), and RSECC_initLookupTable().

Function Documentation

static void generator_init ( size_t  length)
static

Definition at line 81 of file rsecc.c.

References aindex, alpha, generator, generatorInitialized, max_generatorSize, min_length, and symbols.

Referenced by RSECC_encode().

int RSECC_encode ( size_t  data_length,
size_t  ecc_length,
const unsigned char *  data,
unsigned char *  ecc 
)
static void RSECC_init ( void  )
static

Definition at line 74 of file rsecc.c.

References generatorInitialized, initialized, max_length, min_length, and RSECC_initLookupTable().

Referenced by RSECC_encode().

static void RSECC_initLookupTable ( void  )
static

Definition at line 55 of file rsecc.c.

References aindex, alpha, proot, and symbols.

Referenced by RSECC_init().

Variable Documentation

unsigned char aindex[symbols+1]
static

Definition at line 51 of file rsecc.c.

Referenced by generator_init(), RSECC_encode(), and RSECC_initLookupTable().

unsigned char alpha[symbols+1]
static
unsigned char generator[max_length-min_length+1][max_generatorSize+1]
static

Definition at line 52 of file rsecc.c.

Referenced by generator_init(), and RSECC_encode().

unsigned char generatorInitialized[max_length-min_length+1]
static

Definition at line 53 of file rsecc.c.

Referenced by generator_init(), RSECC_encode(), and RSECC_init().

int initialized = 0
static

Definition at line 39 of file rsecc.c.

Referenced by RSECC_encode(), and RSECC_init().

const unsigned int proot = 0x11d
static

Definition at line 43 of file rsecc.c.

Referenced by RSECC_initLookupTable().

pthread_mutex_t RSECC_mutex = PTHREAD_MUTEX_INITIALIZER
static

Definition at line 36 of file rsecc.c.

Referenced by RSECC_encode().