FFmpeg
|
elbg.c
Go to the documentation of this file.
98 diff = distance_limited(elbg->codebook + i*elbg->dim, elbg->codebook + index*elbg->dim, elbg->dim, diff_min);
254 * @param idx {luc (low utility cell, huc (high utility cell), cluc (closest cell to low utility cell)}
342 ff_init_elbg(temp_points, dim, numpoints/8, codebook, numCB, 2*max_steps, closest_cb, rand_state);
343 ff_do_elbg(temp_points, dim, numpoints/8, codebook, numCB, 2*max_steps, closest_cb, rand_state);
393 best_dist = distance_limited(elbg->points + i*elbg->dim, elbg->codebook + best_idx*elbg->dim, dim, INT_MAX);
395 dist = distance_limited(elbg->points + i*elbg->dim, elbg->codebook + k*elbg->dim, dim, best_dist);
if max(w)>1 w=0.9 *w/max(w)
static int simple_lbg(elbg_data *elbg, int dim, int *centroid[3], int newutility[3], int *points, cell *cells)
Implementation of the simple LBG algorithm for just two codebooks.
Definition: elbg.c:123
static int distance_limited(int *a, int *b, int dim, int limit)
Definition: elbg.c:61
static void get_new_centroids(elbg_data *elbg, int huc, int *newcentroid_i, int *newcentroid_p)
Definition: elbg.c:164
struct cell_s cell
In the ELBG jargon, a cell is the set of points that are closest to a codebook entry.
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
Definition: avassert.h:63
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Definition: mem.c:183
simple assert() macros that are a bit more flexible than ISO C assert().
external API header
void ff_do_elbg(int *points, int dim, int numpoints, int *codebook, int numCB, int max_steps, int *closest_cb, AVLFG *rand_state)
Implementation of the Enhanced LBG Algorithm Based on the paper "Neural Networks 14:1219-1237" that c...
Definition: elbg.c:354
static int get_closest_codebook(elbg_data *elbg, int index)
Definition: elbg.c:93
static void update_utility_and_n_cb(elbg_data *elbg, int idx, int newutility)
Definition: elbg.c:240
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
Definition: lfg.h:38
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:73
void ff_init_elbg(int *points, int dim, int numpoints, int *codebook, int numCB, int max_steps, int *closest_cb, AVLFG *rand_state)
Initialize the **codebook vector for the elbg algorithm.
Definition: elbg.c:327
static void shift_codebook(elbg_data *elbg, int *indexes, int *newcentroid[3])
Add the points in the low utility cell to its closest cell.
Definition: elbg.c:200
static int eval_error_cell(elbg_data *elbg, int *centroid, cell *cells)
Definition: elbg.c:84
common internal and external API header
In the ELBG jargon, a cell is the set of points that are closest to a codebook entry.
Definition: elbg.c:39
static void try_shift_candidate(elbg_data *elbg, int idx[3])
Evaluate if a shift lower the error.
Definition: elbg.c:256
Generated on Fri Dec 20 2024 06:56:00 for FFmpeg by 1.8.11