changeset 5122:753230e2dcf0 libavcodec

Cygwin compatibility workaround patch by Eric Lasota: [ riot icculus org ] original thread: [FFmpeg-devel] [PATCH] elbg.c Cygwin compatibility workaround date: 06/09/2007 09:26 AM
author benoit
date Mon, 11 Jun 2007 07:57:15 +0000
parents 71d080656056
children f9a27365ffcb
files elbg.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/elbg.c	Sun Jun 10 13:54:11 2007 +0000
+++ b/elbg.c	Mon Jun 11 07:57:15 2007 +0000
@@ -115,7 +115,7 @@
  * Implementation of the simple LBG algorithm for just two codebooks
  */
 static int simple_lbg(int dim,
-                      int centroid[3][dim],
+                      int *centroid[3],
                       int newutility[3],
                       int *points,
                       cell *cells)
@@ -186,7 +186,7 @@
  * @param newcentroid  A vector with the position of the new centroids
  */
 static void shift_codebook(elbg_data *elbg, int *indexes,
-                           int newcentroid[3][elbg->dim])
+                           int *newcentroid[3])
 {
     cell *tempdata;
     cell **pp = &elbg->cells[indexes[2]];
@@ -246,6 +246,7 @@
     int j, k, olderror=0, newerror, cont=0;
     int newutility[3];
     int newcentroid[3][elbg->dim];
+    int *newcentroid_ptrs[3] = { newcentroid[0], newcentroid[1], newcentroid[2] };
     cell *tempcell;
 
     for (j=0; j<3; j++)
@@ -269,11 +270,11 @@
 
     newerror = newutility[2];
 
-    newerror += simple_lbg(elbg->dim, newcentroid, newutility, elbg->points,
+    newerror += simple_lbg(elbg->dim, newcentroid_ptrs, newutility, elbg->points,
                            elbg->cells[idx[1]]);
 
     if (olderror > newerror) {
-        shift_codebook(elbg, idx, newcentroid);
+        shift_codebook(elbg, idx, newcentroid_ptrs);
 
         elbg->error += newerror - olderror;