MCPS & MIPS


MIPS:Million Instructions Per Second

MCPS:Million Cycles Per Second

MIPS = Total Instructions*Sampling frequency/(No of frames * Samples per frame*1000000)

MCPS = Total Cycles*Sampling frequency/(No of frames * Samples per frame*1000000)
MHz is same as MCPS

And as we know , some instructions may take more than 1 cycle ,so sometimes MIPS >= MCPS.

But as the Parallel Processing technique developing, one cycle can excute more than one  instruction, so sometime MCPS>=MIPS

Also some time the frame length is not uniform, so the they will be

MIPS = Total Instructions/(Total playout time *1000000)

MHz=MCPS = Total Cycles/(Total playout time*1000000)

For example:

struct timespec start, end;

unsinged long diff_ns;

clock_gettime(CLOCK_THREAD_CPUTIME_ID, &start);

process()// process fixed in CPU core, process N samples;

clock_gettime(CLOCK_THREAD_CPUTIME_ID, &end);

diff_ns = (end.tv_sec - start.tv_sec) * 1000000000 + (end.tv_nsec - start.tv_nsec) ;

cpu_freq: 1GHz. 1秒钟经过的时钟周期

Cycles是处理N个samples所需要的时钟周期

Cyles:diff_ns * cpu_freq = (diff_ns / 1000000000) * 1 GHz =  (diff_ns / 1000000000) * 1000000000Hz;

处理N个samples所需要的时间为:N samples / sampling frequency

MCPS = (Cycles / (N Samples / Sample Frequency)) / 1000000;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM