1cabdff1aSopenharmony_ci/* 2cabdff1aSopenharmony_ci * Copyright (C) 2007 Vitor Sessak <vitor1001@gmail.com> 3cabdff1aSopenharmony_ci * 4cabdff1aSopenharmony_ci * This file is part of FFmpeg. 5cabdff1aSopenharmony_ci * 6cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or 7cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public 8cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either 9cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version. 10cabdff1aSopenharmony_ci * 11cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful, 12cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of 13cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14cabdff1aSopenharmony_ci * Lesser General Public License for more details. 15cabdff1aSopenharmony_ci * 16cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public 17cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software 18cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19cabdff1aSopenharmony_ci */ 20cabdff1aSopenharmony_ci 21cabdff1aSopenharmony_ci#ifndef AVCODEC_ELBG_H 22cabdff1aSopenharmony_ci#define AVCODEC_ELBG_H 23cabdff1aSopenharmony_ci 24cabdff1aSopenharmony_ci#include <stdint.h> 25cabdff1aSopenharmony_ci#include "libavutil/lfg.h" 26cabdff1aSopenharmony_ci 27cabdff1aSopenharmony_cistruct ELBGContext; 28cabdff1aSopenharmony_ci 29cabdff1aSopenharmony_ci/** 30cabdff1aSopenharmony_ci * Implementation of the Enhanced LBG Algorithm 31cabdff1aSopenharmony_ci * Based on the paper "Neural Networks 14:1219-1237" that can be found in 32cabdff1aSopenharmony_ci * http://citeseer.ist.psu.edu/patan01enhanced.html . 33cabdff1aSopenharmony_ci * 34cabdff1aSopenharmony_ci * @param ctx A pointer to a pointer to an already allocated ELBGContext 35cabdff1aSopenharmony_ci * or a pointer to NULL. In the latter case, this function 36cabdff1aSopenharmony_ci * will allocate an ELBGContext and put a pointer to it in `*ctx`. 37cabdff1aSopenharmony_ci * @param points Input points. 38cabdff1aSopenharmony_ci * @param dim Dimension of the points. 39cabdff1aSopenharmony_ci * @param numpoints Num of points in **points. 40cabdff1aSopenharmony_ci * @param codebook Pointer to the output codebook. Must be allocated. 41cabdff1aSopenharmony_ci * @param num_cb Number of points in the codebook. 42cabdff1aSopenharmony_ci * @param num_steps The maximum number of steps. One step is already a good compromise between time and quality. 43cabdff1aSopenharmony_ci * @param closest_cb Return the closest codebook to each point. Must be allocated. 44cabdff1aSopenharmony_ci * @param rand_state A random number generator state. Should be already initialized by av_lfg_init(). 45cabdff1aSopenharmony_ci * @param flags Currently unused; must be set to 0. 46cabdff1aSopenharmony_ci * @return < 0 in case of error, 0 otherwise 47cabdff1aSopenharmony_ci */ 48cabdff1aSopenharmony_ciint avpriv_elbg_do(struct ELBGContext **ctx, int *points, int dim, 49cabdff1aSopenharmony_ci int numpoints, int *codebook, int num_cb, int num_steps, 50cabdff1aSopenharmony_ci int *closest_cb, AVLFG *rand_state, uintptr_t flags); 51cabdff1aSopenharmony_ci 52cabdff1aSopenharmony_ci/** 53cabdff1aSopenharmony_ci * Free an ELBGContext and reset the pointer to it. 54cabdff1aSopenharmony_ci */ 55cabdff1aSopenharmony_civoid avpriv_elbg_free(struct ELBGContext **ctx); 56cabdff1aSopenharmony_ci 57cabdff1aSopenharmony_ci#endif /* AVCODEC_ELBG_H */ 58