test_fps.sh 文件内容:
#!/bin/sh
n=0
t1=`date +%s`
count=1000
while [ true ]; do
let n++
if [ $(($n % 10)) -eq 0 ]; then
echo -e ".\c"
fi
if [ $n -gt $count ]; then
break;
fi
cat /dev/zero > /dev/fb0 2>&1
done;
t2=`date +%s`
fps=$(($count/($t2 - $t1)))
echo -e "\ntest result: $fps fps"
widora tiny200s 800x480 测试结果:
# sh test.sh
....................................................................................................
test result: 37 fps
离线
测试方法, 记住开始和结束的时间戳,然后测试1000次写0到fb0,
用 1000除以时间差, 得到粗略的帧率。
离线
这么慢?我记得裸机跑过,有50多fps
这个脚本肯定不怎么准,粗略测试,用来练习一下脚本技术。
离线
#!/bin/sh
n=0
t1=`date +%s`
count=1000
while [ true ]; do
let n++
if [ $(($n % 10)) -eq 0 ]; then
echo -e ".\c"
fi
if [ $n -gt $count ]; then
break;
fi
djpeg -outfile /dev/null /usr/images/hehua.jpg
done;
t2=`date +%s`
fps=$(($count/($t2 - $t1)))
echo -e "\ntest result: $fps fps"
V3s neno指令加速的1280x720 jpeg文件解码粗略测试15fps:
# ./test.sh
....................................................................................................
test result: 15 fps
连续测试同一个文件jpeg解码,解码完成的结果直接扔/dev/null
如果把全志的编解码器搞起来, 至少应该 50fps吧?
离线
貌似发现了更精确的测试方法, 直接解码成 yuv420
libjpeg自带的tjbench:
# tjbench /usr/images/hehua.jpg -yuv -subsamp 420
Testing YUV planar encoding/decoding
>>>>> JPEG 4:2:0 --> BGR (Top-down) <<<<<
Image size: 1280 x 720
Decomp to YUV --> Frame rate: 34.059825 fps
Throughput: 31.389535 Megapixels/sec
YUV Decode --> Frame rate: 71.475664 fps
Throughput: 65.871972 Megapixels/sec
离线