liberasurecode 1.6.3
Erasure Code API library
Loading...
Searching...
No Matches
Functions
xor_hd_code.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "xor_code.h"
#include "xor_hd_code_defs.h"

Go to the source code of this file.

Functions

static int fragments_needed_one_data (xor_code_t *code_desc, int *missing_data, int *missing_parity, unsigned int *data_bm, unsigned int *parity_bm)
 
static int fragments_needed_two_data (xor_code_t *code_desc, int *missing_data, int *missing_parity, unsigned int *data_bm, unsigned int *parity_bm)
 
static int fragments_needed_three_data (xor_code_t *code_desc, int *missing_data, int *missing_parity, unsigned int *data_bm, unsigned int *parity_bm)
 
static int fragments_needed_one_data_local (xor_code_t *code_desc, int fragment_to_reconstruct, int *fragments_to_exclude, unsigned int *data_bm, unsigned int *parity_bm)
 
int xor_hd_fragments_needed (xor_code_t *code_desc, int *fragments_to_reconstruct, int *fragments_to_exclude, int *fragments_needed)
 
static void decode_one_data (xor_code_t *code_desc, char **data, char **parity, int *missing_data, int *missing_parity, int blocksize)
 
static int decode_two_data (xor_code_t *code_desc, char **data, char **parity, int *missing_data, int *missing_parity, int blocksize)
 
static int decode_three_data (xor_code_t *code_desc, char **data, char **parity, int *missing_data, int *missing_parity, int blocksize)
 
int xor_hd_decode (xor_code_t *code_desc, char **data, char **parity, int *missing_idxs, int blocksize, int decode_parity)
 
xor_code_t * init_xor_hd_code (int k, int m, int hd)
 

Function Documentation

◆ decode_one_data()

static void decode_one_data ( xor_code_t *  code_desc,
char **  data,
char **  parity,
int *  missing_data,
int *  missing_parity,
int  blocksize 
)
static

◆ decode_three_data()

static int decode_three_data ( xor_code_t *  code_desc,
char **  data,
char **  parity,
int *  missing_data,
int *  missing_parity,
int  blocksize 
)
static

◆ decode_two_data()

static int decode_two_data ( xor_code_t *  code_desc,
char **  data,
char **  parity,
int *  missing_data,
int *  missing_parity,
int  blocksize 
)
static

◆ fragments_needed_one_data()

static int fragments_needed_one_data ( xor_code_t *  code_desc,
int *  missing_data,
int *  missing_parity,
unsigned int *  data_bm,
unsigned int *  parity_bm 
)
static

Definition at line 34 of file xor_hd_code.c.

References index_of_connected_parity().

Referenced by fragments_needed_two_data(), and xor_hd_fragments_needed().

◆ fragments_needed_one_data_local()

static int fragments_needed_one_data_local ( xor_code_t *  code_desc,
int  fragment_to_reconstruct,
int *  fragments_to_exclude,
unsigned int *  data_bm,
unsigned int *  parity_bm 
)
static

◆ fragments_needed_three_data()

static int fragments_needed_three_data ( xor_code_t *  code_desc,
int *  missing_data,
int *  missing_parity,
unsigned int *  data_bm,
unsigned int *  parity_bm 
)
static

◆ fragments_needed_two_data()

static int fragments_needed_two_data ( xor_code_t *  code_desc,
int *  missing_data,
int *  missing_parity,
unsigned int *  data_bm,
unsigned int *  parity_bm 
)
static

◆ init_xor_hd_code()

xor_code_t * init_xor_hd_code ( int  k,
int  m,
int  hd 
)

Definition at line 655 of file xor_hd_code.c.

References xor_code_encode(), xor_hd_decode(), and xor_hd_fragments_needed().

Referenced by flat_xor_hd_init().

◆ xor_hd_decode()

int xor_hd_decode ( xor_code_t *  code_desc,
char **  data,
char **  parity,
int *  missing_idxs,
int  blocksize,
int  decode_parity 
)

◆ xor_hd_fragments_needed()

int xor_hd_fragments_needed ( xor_code_t *  code_desc,
int *  fragments_to_reconstruct,
int *  fragments_to_exclude,
int *  fragments_needed 
)

Re-visit this decision (KMG): This is non-optimal, but good enough in most cases. If there is a single data item to reconstruct, then try to find a connected parity with no items in fragments_to_exclude. If there is a single parity item to reconsturct or more than 1 data/parity element missing, then just work fragments_to_exclude into missing_idxs.

There is either more than one failed element, a failed parity element or we were unable to return the fragments needed for a simple reconstruction.

Add everything to missing_idxs (basically, give up on optimizing).

Definition at line 204 of file xor_hd_code.c.

References data_bit_lookup(), fragments_needed_one_data(), fragments_needed_one_data_local(), fragments_needed_three_data(), fragments_needed_two_data(), get_failure_pattern(), get_missing_data(), get_missing_parity(), and missing_elements_bm().

Referenced by init_xor_hd_code().