905 |
* test non-zero AC counting |
* test non-zero AC counting |
906 |
*********************************************************************/ |
*********************************************************************/ |
907 |
|
|
908 |
#define TEST_CBP(FUNC, SRC) \ |
#define TEST_CBP(FUNC, SRC, NB) \ |
909 |
t = gettime_usec(); \ |
t = gettime_usec(); \ |
910 |
emms(); \ |
emms(); \ |
911 |
for(tst=0; tst<nb_tests; ++tst) { \ |
for(tst=0; tst<NB; ++tst) { \ |
912 |
cbp = (FUNC)((SRC)); \ |
cbp = (FUNC)((SRC)); \ |
913 |
} \ |
} \ |
914 |
emms(); \ |
emms(); \ |
917 |
void test_cbp() |
void test_cbp() |
918 |
{ |
{ |
919 |
const int nb_tests = 10000*speed_ref; |
const int nb_tests = 10000*speed_ref; |
920 |
int i; |
int i, n, m; |
921 |
CPU *cpu; |
CPU *cpu; |
922 |
DECLARE_ALIGNED_MATRIX(Src1, 6, 64, int16_t, 16); |
DECLARE_ALIGNED_MATRIX(Src1, 6, 64, int16_t, 16); |
923 |
DECLARE_ALIGNED_MATRIX(Src2, 6, 64, int16_t, 16); |
DECLARE_ALIGNED_MATRIX(Src2, 6, 64, int16_t, 16); |
941 |
if (!init_cpu(cpu)) |
if (!init_cpu(cpu)) |
942 |
continue; |
continue; |
943 |
|
|
944 |
TEST_CBP(calc_cbp, Src1); |
TEST_CBP(calc_cbp, Src1, nb_tests); |
945 |
printf("%s - calc_cbp#1 %.3f usec cbp=0x%02x %s\n", |
printf("%s - calc_cbp#1 %.3f usec cbp=0x%02x %s\n", |
946 |
cpu->name, t, cbp, (cbp!=0x15)?"| ERROR": ""); |
cpu->name, t, cbp, (cbp!=0x15)?"| ERROR": ""); |
947 |
TEST_CBP(calc_cbp, Src2); |
TEST_CBP(calc_cbp, Src2, nb_tests); |
948 |
printf("%s - calc_cbp#2 %.3f usec cbp=0x%02x %s\n", |
printf("%s - calc_cbp#2 %.3f usec cbp=0x%02x %s\n", |
949 |
cpu->name, t, cbp, (cbp!=0x38)?"| ERROR": ""); |
cpu->name, t, cbp, (cbp!=0x38)?"| ERROR": ""); |
950 |
TEST_CBP(calc_cbp, Src3); |
TEST_CBP(calc_cbp, Src3, nb_tests); |
951 |
printf("%s - calc_cbp#3 %.3f usec cbp=0x%02x %s\n", |
printf("%s - calc_cbp#3 %.3f usec cbp=0x%02x %s\n", |
952 |
cpu->name, t, cbp, (cbp!=0x0f)?"| ERROR": "" ); |
cpu->name, t, cbp, (cbp!=0x0f)?"| ERROR": "" ); |
953 |
TEST_CBP(calc_cbp, Src4); |
TEST_CBP(calc_cbp, Src4, nb_tests); |
954 |
printf("%s - calc_cbp#4 %.3f usec cbp=0x%02x %s\n", |
printf("%s - calc_cbp#4 %.3f usec cbp=0x%02x %s\n", |
955 |
cpu->name, t, cbp, (cbp!=0x05)?"| ERROR": "" ); |
cpu->name, t, cbp, (cbp!=0x05)?"| ERROR": "" ); |
956 |
printf( " --- \n" ); |
printf( " --- \n" ); |
957 |
} |
} |
958 |
|
|
959 |
|
for(cpu = cpu_list; cpu->name!=0; ++cpu) /* bench suggested by Carlo (carlo dot bramix at libero dot it) */ |
960 |
|
{ |
961 |
|
double t; |
962 |
|
int tst, cbp, err; |
963 |
|
|
964 |
|
if (!init_cpu(cpu)) |
965 |
|
continue; |
966 |
|
|
967 |
|
err = 0; |
968 |
|
for(n=0; n<6; ++n) |
969 |
|
{ |
970 |
|
for(m=0; m<64; ++m) |
971 |
|
{ |
972 |
|
for(i=0; i<6*64; ++i) |
973 |
|
Src1[i] = (i== (m + n*64)); |
974 |
|
|
975 |
|
TEST_CBP(calc_cbp, Src1, 1); |
976 |
|
if (cbp!= (((m!=0)<<(5-n)))) |
977 |
|
{ |
978 |
|
printf( "%s - calc_cbp#5: ERROR at pos %d / %d!\n", cpu->name, n, m); |
979 |
|
err = 1; |
980 |
|
break; |
981 |
|
} |
982 |
|
} |
983 |
|
} |
984 |
|
if (!err) |
985 |
|
printf( " %s - calc_cbp#5 : OK\n", cpu->name ); |
986 |
|
|
987 |
|
} |
988 |
} |
} |
989 |
|
|
990 |
/********************************************************************* |
/********************************************************************* |
1447 |
xframe.bitstream = buf + pos; |
xframe.bitstream = buf + pos; |
1448 |
xframe.length = buf_size - pos; |
xframe.length = buf_size - pos; |
1449 |
xframe.output.plane[0] = (uint8_t*)(((size_t)yuv_out + 15) & ~15); |
xframe.output.plane[0] = (uint8_t*)(((size_t)yuv_out + 15) & ~15); |
1450 |
xframe.output.plane[1] = xframe.output.plane[0] + bps*height; |
xframe.output.plane[1] = (uint8_t*)xframe.output.plane[0] + bps*height; |
1451 |
xframe.output.plane[2] = xframe.output.plane[1] + bps/2; |
xframe.output.plane[2] = (uint8_t*)xframe.output.plane[1] + bps/2; |
1452 |
xframe.output.stride[0] = bps; |
xframe.output.stride[0] = bps; |
1453 |
xframe.output.stride[1] = bps; |
xframe.output.stride[1] = bps; |
1454 |
xframe.output.stride[2] = bps; |
xframe.output.stride[2] = bps; |
1466 |
nb++; |
nb++; |
1467 |
|
|
1468 |
for(y=0; y<height/2; ++y) { |
for(y=0; y<height/2; ++y) { |
1469 |
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); |
1470 |
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); |
1471 |
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); |
1472 |
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); |
1473 |
} |
} |
1474 |
if (pos==buf_size) |
if (pos==buf_size) |
1475 |
break; |
break; |