diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-12-19 04:10:17 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-19 04:10:17 +0100 |
commit | 16f0618200a31e4c017ae88bf09c1e5af6c583e6 (patch) | |
tree | 5ba9d48d72ae5e91910e34fd9e12c99943eb7765 /libavcodec/elbg.h | |
parent | bce06eb059a22fa1cd76a13112c36a4353894cca (diff) | |
parent | ae2d41ec875965ce4ab9fdd88a5e8ba57cada67a (diff) | |
download | ffmpeg-streaming-16f0618200a31e4c017ae88bf09c1e5af6c583e6.zip ffmpeg-streaming-16f0618200a31e4c017ae88bf09c1e5af6c583e6.tar.gz |
Merge commit 'ae2d41ec875965ce4ab9fdd88a5e8ba57cada67a'
* commit 'ae2d41ec875965ce4ab9fdd88a5e8ba57cada67a':
elbg: check memory allocations and propagate errors
Conflicts:
libavcodec/elbg.c
libavcodec/elbg.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/elbg.h')
-rw-r--r-- | libavcodec/elbg.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/elbg.h b/libavcodec/elbg.h index 22fb53f..f48aa3b 100644 --- a/libavcodec/elbg.h +++ b/libavcodec/elbg.h @@ -36,10 +36,11 @@ * @param num_steps The maximum number of steps. One step is already a good compromise between time and quality. * @param closest_cb Return the closest codebook to each point. Must be allocated. * @param rand_state A random number generator state. Should be already initialized by av_lfg_init(). + * @return < 0 in case of error, 0 otherwise */ -void avpriv_do_elbg(int *points, int dim, int numpoints, int *codebook, - int numCB, int num_steps, int *closest_cb, - AVLFG *rand_state); +int avpriv_do_elbg(int *points, int dim, int numpoints, int *codebook, + int numCB, int num_steps, int *closest_cb, + AVLFG *rand_state); /** * Initialize the **codebook vector for the elbg algorithm. If you have already @@ -47,9 +48,10 @@ void avpriv_do_elbg(int *points, int dim, int numpoints, int *codebook, * If numpoints < 8*numCB this function fills **codebook with random numbers. * If not, it calls avpriv_do_elbg for a (smaller) random sample of the points in * **points. Get the same parameters as avpriv_do_elbg. + * @return < 0 in case of error, 0 otherwise */ -void avpriv_init_elbg(int *points, int dim, int numpoints, int *codebook, - int numCB, int num_steps, int *closest_cb, - AVLFG *rand_state); +int avpriv_init_elbg(int *points, int dim, int numpoints, int *codebook, + int numCB, int num_steps, int *closest_cb, + AVLFG *rand_state); #endif /* AVCODEC_ELBG_H */ |