Mercurial > libavcodec.hg
comparison vorbis.c @ 4001:34fdffe98bd0 libavcodec
Rename ABS macro to FFABS.
author | diego |
---|---|
date | Wed, 11 Oct 2006 23:17:58 +0000 |
parents | c8c591fe26f8 |
children | 8535fcac43c1 |
comparison
equal
deleted
inserted
replaced
4000:eeab02251056 | 4001:34fdffe98bd0 |
---|---|
1234 } | 1234 } |
1235 | 1235 |
1236 static void render_line(int x0, int y0, int x1, int y1, float * buf, int n) { | 1236 static void render_line(int x0, int y0, int x1, int y1, float * buf, int n) { |
1237 int dy = y1 - y0; | 1237 int dy = y1 - y0; |
1238 int adx = x1 - x0; | 1238 int adx = x1 - x0; |
1239 int ady = ABS(dy); | 1239 int ady = FFABS(dy); |
1240 int base = dy / adx; | 1240 int base = dy / adx; |
1241 int x = x0; | 1241 int x = x0; |
1242 int y = y0; | 1242 int y = y0; |
1243 int err = 0; | 1243 int err = 0; |
1244 int sy; | 1244 int sy; |
1245 if (dy < 0) sy = base - 1; | 1245 if (dy < 0) sy = base - 1; |
1246 else sy = base + 1; | 1246 else sy = base + 1; |
1247 ady = ady - ABS(base) * adx; | 1247 ady = ady - FFABS(base) * adx; |
1248 if (x >= n) return; | 1248 if (x >= n) return; |
1249 buf[x] = ff_vorbis_floor1_inverse_db_table[y]; | 1249 buf[x] = ff_vorbis_floor1_inverse_db_table[y]; |
1250 for (x = x0 + 1; x < x1; x++) { | 1250 for (x = x0 + 1; x < x1; x++) { |
1251 if (x >= n) return; | 1251 if (x >= n) return; |
1252 err += ady; | 1252 err += ady; |
1352 | 1352 |
1353 low_neigh_offs=vf->list[i].low; | 1353 low_neigh_offs=vf->list[i].low; |
1354 high_neigh_offs=vf->list[i].high; | 1354 high_neigh_offs=vf->list[i].high; |
1355 dy=floor1_Y_final[high_neigh_offs]-floor1_Y_final[low_neigh_offs]; // render_point begin | 1355 dy=floor1_Y_final[high_neigh_offs]-floor1_Y_final[low_neigh_offs]; // render_point begin |
1356 adx=vf->list[high_neigh_offs].x-vf->list[low_neigh_offs].x; | 1356 adx=vf->list[high_neigh_offs].x-vf->list[low_neigh_offs].x; |
1357 ady= ABS(dy); | 1357 ady= FFABS(dy); |
1358 err=ady*(vf->list[i].x-vf->list[low_neigh_offs].x); | 1358 err=ady*(vf->list[i].x-vf->list[low_neigh_offs].x); |
1359 off=(int16_t)err/(int16_t)adx; | 1359 off=(int16_t)err/(int16_t)adx; |
1360 if (dy<0) { | 1360 if (dy<0) { |
1361 predicted=floor1_Y_final[low_neigh_offs]-off; | 1361 predicted=floor1_Y_final[low_neigh_offs]-off; |
1362 } else { | 1362 } else { |