rename Point data structure as suggested in pull request

pull/415/merge
Sean Barrett 2017-03-03 06:54:11 -08:00
parent c88489549d
commit 46046238b8
1 changed files with 7 additions and 7 deletions

View File

@ -1270,13 +1270,13 @@ static void neighbors(uint16 *x, int n, int *plow, int *phigh)
// this has been repurposed so y is now the original index instead of y // this has been repurposed so y is now the original index instead of y
typedef struct typedef struct
{ {
uint16 x,y; uint16 x,id;
} stbv__point; } stbv__floor_ordering;
static int STBV_CDECL point_compare(const void *p, const void *q) static int STBV_CDECL point_compare(const void *p, const void *q)
{ {
stbv__point *a = (stbv__point *) p; stbv__floor_ordering *a = (stbv__floor_ordering *) p;
stbv__point *b = (stbv__point *) q; stbv__floor_ordering *b = (stbv__floor_ordering *) q;
return a->x < b->x ? -1 : a->x > b->x; return a->x < b->x ? -1 : a->x > b->x;
} }
@ -3874,7 +3874,7 @@ static int start_decoder(vorb *f)
g->book_list[j] = get_bits(f,8); g->book_list[j] = get_bits(f,8);
return error(f, VORBIS_feature_not_supported); return error(f, VORBIS_feature_not_supported);
} else { } else {
stbv__point p[31*8+2]; stbv__floor_ordering p[31*8+2];
Floor1 *g = &f->floor_config[i].floor1; Floor1 *g = &f->floor_config[i].floor1;
int max_class = -1; int max_class = -1;
g->partitions = get_bits(f, 5); g->partitions = get_bits(f, 5);
@ -3910,11 +3910,11 @@ static int start_decoder(vorb *f)
// precompute the sorting // precompute the sorting
for (j=0; j < g->values; ++j) { for (j=0; j < g->values; ++j) {
p[j].x = g->Xlist[j]; p[j].x = g->Xlist[j];
p[j].y = j; p[j].id = j;
} }
qsort(p, g->values, sizeof(p[0]), point_compare); qsort(p, g->values, sizeof(p[0]), point_compare);
for (j=0; j < g->values; ++j) for (j=0; j < g->values; ++j)
g->sorted_order[j] = (uint8) p[j].y; g->sorted_order[j] = (uint8) p[j].id;
// precompute the neighbors // precompute the neighbors
for (j=2; j < g->values; ++j) { for (j=2; j < g->values; ++j) {
int low,hi; int low,hi;