19 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: xvid_bench.c,v 1.23 2005-08-05 20:49:23 Skal Exp $ |
* $Id: xvid_bench.c,v 1.25 2005-09-23 12:53:35 suxen_drol Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
923 |
DECLARE_ALIGNED_MATRIX(Src2, 6, 64, int16_t, 16); |
DECLARE_ALIGNED_MATRIX(Src2, 6, 64, int16_t, 16); |
924 |
DECLARE_ALIGNED_MATRIX(Src3, 6, 64, int16_t, 16); |
DECLARE_ALIGNED_MATRIX(Src3, 6, 64, int16_t, 16); |
925 |
DECLARE_ALIGNED_MATRIX(Src4, 6, 64, int16_t, 16); |
DECLARE_ALIGNED_MATRIX(Src4, 6, 64, int16_t, 16); |
926 |
|
DECLARE_ALIGNED_MATRIX(Src5, 6, 64, int16_t, 16); |
927 |
|
|
928 |
printf( "\n ===== test cbp =====\n" ); |
printf( "\n ===== test cbp =====\n" ); |
929 |
|
|
932 |
Src2[i] = (i<3*64); /* half-full */ |
Src2[i] = (i<3*64); /* half-full */ |
933 |
Src3[i] = ((i+32)>3*64); |
Src3[i] = ((i+32)>3*64); |
934 |
Src4[i] = (i==(3*64+2) || i==(5*64+9)); |
Src4[i] = (i==(3*64+2) || i==(5*64+9)); |
935 |
|
Src5[i] = ieee_rand(0,1) ? -1 : 1; /* +/- test */ |
936 |
} |
} |
937 |
|
|
938 |
for(cpu = cpu_list; cpu->name!=0; ++cpu) |
for(cpu = cpu_list; cpu->name!=0; ++cpu) |
955 |
TEST_CBP(calc_cbp, Src4, nb_tests); |
TEST_CBP(calc_cbp, Src4, nb_tests); |
956 |
printf("%s - calc_cbp#4 %.3f usec cbp=0x%02x %s\n", |
printf("%s - calc_cbp#4 %.3f usec cbp=0x%02x %s\n", |
957 |
cpu->name, t, cbp, (cbp!=0x05)?"| ERROR": "" ); |
cpu->name, t, cbp, (cbp!=0x05)?"| ERROR": "" ); |
958 |
|
TEST_CBP(calc_cbp, Src5, nb_tests); |
959 |
|
printf("%s - calc_cbp#4 %.3f usec cbp=0x%02x %s\n", |
960 |
|
cpu->name, t, cbp, (cbp!=0x3f)?"| ERROR": "" ); |
961 |
printf( " --- \n" ); |
printf( " --- \n" ); |
962 |
} |
} |
963 |
|
|
1452 |
xframe.bitstream = buf + pos; |
xframe.bitstream = buf + pos; |
1453 |
xframe.length = buf_size - pos; |
xframe.length = buf_size - pos; |
1454 |
xframe.output.plane[0] = (uint8_t*)(((size_t)yuv_out + 15) & ~15); |
xframe.output.plane[0] = (uint8_t*)(((size_t)yuv_out + 15) & ~15); |
1455 |
xframe.output.plane[1] = xframe.output.plane[0] + bps*height; |
xframe.output.plane[1] = (uint8_t*)xframe.output.plane[0] + bps*height; |
1456 |
xframe.output.plane[2] = xframe.output.plane[1] + bps/2; |
xframe.output.plane[2] = (uint8_t*)xframe.output.plane[1] + bps/2; |
1457 |
xframe.output.stride[0] = bps; |
xframe.output.stride[0] = bps; |
1458 |
xframe.output.stride[1] = bps; |
xframe.output.stride[1] = bps; |
1459 |
xframe.output.stride[2] = bps; |
xframe.output.stride[2] = bps; |
1471 |
nb++; |
nb++; |
1472 |
|
|
1473 |
for(y=0; y<height/2; ++y) { |
for(y=0; y<height/2; ++y) { |
1474 |
chksum = calc_crc(xframe.output.plane[0] + (2*y+0)*bps, width, chksum); |
chksum = calc_crc((uint8_t*)xframe.output.plane[0] + (2*y+0)*bps, width, chksum); |
1475 |
chksum = calc_crc(xframe.output.plane[0] + (2*y+1)*bps, width, chksum); |
chksum = calc_crc((uint8_t*)xframe.output.plane[0] + (2*y+1)*bps, width, chksum); |
1476 |
chksum = calc_crc(xframe.output.plane[1] + y*bps, width/2, chksum); |
chksum = calc_crc((uint8_t*)xframe.output.plane[1] + y*bps, width/2, chksum); |
1477 |
chksum = calc_crc(xframe.output.plane[2] + y*bps, width/2, chksum); |
chksum = calc_crc((uint8_t*)xframe.output.plane[2] + y*bps, width/2, chksum); |
1478 |
} |
} |
1479 |
if (pos==buf_size) |
if (pos==buf_size) |
1480 |
break; |
break; |