comparison elbg.h @ 5095:ed41cfae128d libavcodec

Codebook generator using the ELBG algorithm patch by Vitor: printf(vitor%d gmail com, 1001) original thread: Re: [FFmpeg-devel] [PATCH] Add a codebook generator (was: [PATCH] RoQ video encoder, take 2) date: 05/28/2007 01:21 PM
author benoit
date Mon, 04 Jun 2007 07:28:34 +0000
parents
children 9ecbfc0c82bf
comparison
equal deleted inserted replaced
5094:ce57e3f2b2a7 5095:ed41cfae128d
1 /*
2 * Copyright (C) 2007 Vitor <vitor1001@gmail.com>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "random.h"
22
23 /**
24 * Implementation of the Enhanced LBG Algorithm
25 * Based on the paper "Neural Networks 14:1219-1237" that can be found in
26 * http://citeseer.ist.psu.edu/patan01enhanced.html .
27 *
28 * @param points Input points.
29 * @param dim Dimension of the points.
30 * @param numpoints Num of points in **points.
31 * @param codebook Pointer to the output codebook. Must be allocated.
32 * @param numCB Number of points in the codebook.
33 * @param num_steps The maximum number of steps. One step is already a good compromise between time and quality.
34 * @param closest_cb Return the closest codebook to each point. Must be allocated.
35 * @param rand_state A random number generator state. Should be already initialised by av_init_random.
36 */
37 void ff_do_elbg(int *points, int dim, int numpoints, int *codebook,
38 int numCB, int num_steps, int *closest_cb,
39 AVRandomState *rand_state);
40
41 /**
42 * Initialize the **codebook vector for the elbg algorithm. If you have already
43 * a codebook and you want to refine it, you shouldn't call this function.
44 * If numpoints < 8*numCB this function fills **codebook with random numbers.
45 * If not, it calls ff_do_elbg for a (smaller) random sample of the points in
46 * **points. Get the same parameters as ff_do_elbg.
47 */
48 void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
49 int numCB, int num_steps, int *closest_cb,
50 AVRandomState *rand_state);