comparison vorbis.c @ 3535:a14c98a0ca3d libavcodec

int16_t is faster than int_fast16_t for division. 2% faster vorbis (on a K8).
author lorenm
date Thu, 03 Aug 2006 02:18:07 +0000
parents 89af006ac42d
children 545a15c19c91
comparison
equal deleted inserted replaced
3534:f76861f4d5ca 3535:a14c98a0ca3d
1190 high_neigh_offs=vf->high_neighbour[i]; 1190 high_neigh_offs=vf->high_neighbour[i];
1191 dy=floor1_Y_final[high_neigh_offs]-floor1_Y_final[low_neigh_offs]; // render_point begin 1191 dy=floor1_Y_final[high_neigh_offs]-floor1_Y_final[low_neigh_offs]; // render_point begin
1192 adx=vf->x_list[high_neigh_offs]-vf->x_list[low_neigh_offs]; 1192 adx=vf->x_list[high_neigh_offs]-vf->x_list[low_neigh_offs];
1193 ady= ABS(dy); 1193 ady= ABS(dy);
1194 err=ady*(vf->x_list[i]-vf->x_list[low_neigh_offs]); 1194 err=ady*(vf->x_list[i]-vf->x_list[low_neigh_offs]);
1195 off=err/adx; 1195 off=(int16_t)err/(int16_t)adx;
1196 if (dy<0) { 1196 if (dy<0) {
1197 predicted=floor1_Y_final[low_neigh_offs]-off; 1197 predicted=floor1_Y_final[low_neigh_offs]-off;
1198 } else { 1198 } else {
1199 predicted=floor1_Y_final[low_neigh_offs]+off; 1199 predicted=floor1_Y_final[low_neigh_offs]+off;
1200 } // render_point end 1200 } // render_point end
1250 hx=vf->x_list[floor_x_sort[i]]; 1250 hx=vf->x_list[floor_x_sort[i]];
1251 1251
1252 dy=hy-ly; 1252 dy=hy-ly;
1253 adx=hx-lx; 1253 adx=hx-lx;
1254 ady= (dy<0) ? -dy:dy;//ABS(dy); 1254 ady= (dy<0) ? -dy:dy;//ABS(dy);
1255 base=dy/adx; 1255 base=(int16_t)dy/(int16_t)adx;
1256 1256
1257 AV_DEBUG(" dy %d adx %d base %d = %d \n", dy, adx, base, dy/adx); 1257 AV_DEBUG(" dy %d adx %d base %d = %d \n", dy, adx, base, dy/adx);
1258 1258
1259 x=lx; 1259 x=lx;
1260 y=ly; 1260 y=ly;