annotate elbg.h @ 5111:33c14c5956d0 libavcodec

CPU feature definitions should always be available, not just when the CPU feature is enabled. taken from a patch by Ronald S. Bultje, rbultje ronald.bitfreak net Date: Thu, 07 Jun 2007 08:57:46 -0400 Subject: Re: [FFmpeg-devel] [PATCH] Coremake support - ffmpeg_nommx.patch (1/1) - ffmpeg-nommx.patch (1/1) - ff-cputest-noavconfig.patch (1/1)
author diego
date Thu, 07 Jun 2007 16:15:20 +0000
parents ed41cfae128d
children 9ecbfc0c82bf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5095
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
1 /*
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
2 * Copyright (C) 2007 Vitor <vitor1001@gmail.com>
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
3 *
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
4 * This file is part of FFmpeg.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
5 *
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
10 *
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
14 * Lesser General Public License for more details.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
15 *
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
19 */
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
20
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
21 #include "random.h"
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
22
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
23 /**
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
24 * Implementation of the Enhanced LBG Algorithm
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
25 * Based on the paper "Neural Networks 14:1219-1237" that can be found in
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
26 * http://citeseer.ist.psu.edu/patan01enhanced.html .
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
27 *
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
28 * @param points Input points.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
29 * @param dim Dimension of the points.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
30 * @param numpoints Num of points in **points.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
31 * @param codebook Pointer to the output codebook. Must be allocated.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
32 * @param numCB Number of points in the codebook.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
33 * @param num_steps The maximum number of steps. One step is already a good compromise between time and quality.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
34 * @param closest_cb Return the closest codebook to each point. Must be allocated.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
35 * @param rand_state A random number generator state. Should be already initialised by av_init_random.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
36 */
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
37 void ff_do_elbg(int *points, int dim, int numpoints, int *codebook,
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
38 int numCB, int num_steps, int *closest_cb,
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
39 AVRandomState *rand_state);
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
40
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
41 /**
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
42 * Initialize the **codebook vector for the elbg algorithm. If you have already
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
43 * a codebook and you want to refine it, you shouldn't call this function.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
44 * If numpoints < 8*numCB this function fills **codebook with random numbers.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
45 * If not, it calls ff_do_elbg for a (smaller) random sample of the points in
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
46 * **points. Get the same parameters as ff_do_elbg.
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
47 */
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
48 void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
49 int numCB, int num_steps, int *closest_cb,
ed41cfae128d Codebook generator using the ELBG algorithm
benoit
parents:
diff changeset
50 AVRandomState *rand_state);