<div dir="ltr"><div><div><div>Hi<br><br></div>I'm trying to calculate the root mean square of 16 bit signed audio samples using Orc. For that I need to do a sum of all samples squared. So something like<br><br><div style="margin-left:40px">sum = 1/n * (x1^2 + x2^2 ... xn^2)<br></div><br></div>For that I need to accumulate an 8 byte sum. However Orc seems only to accept 'accx' commands (x=b,w,l but not q) for the accumulator as destination. The documentation is a little vague on this point. However, there doesn't exist an 'accq' command for accumulating an 8 byte value. The idea was to have something like this<br><br></div><div style="margin-left:40px"># The src is 16 bit signed values in 32 bit signed integer<br>.function audio_rms_orc_one_channel<br>.source 4 src int32_t<br>.accumulator 8 result<br>.temp 8 squared<br># Multiply signed 4 byte to 8 byte<br>mulslq squared src src<br>addq result result squared<br></div><div><br></div><div>However Orc does not like to have an accumulator as destination for addq or copyq for that matter. Instead of the last line, I tried this adding to a temp and then copy to accumulator.<br><br><div style="margin-left:40px"># The src is 16 bit signed values in 32 bit signed integer<br>.function audio_rms_orc_one_channel2<br>.source 4 src int32_t<br>.accumulator 8 result<br>.temp 8 squared<br># Multiply signed 4 byte to 8 byte<br>mulslq squared src src<br>addq squared result squared<br>copyq result squared<br></div><br></div><div>But to no avail. So I can declare an 8 byte accumulator, I just can't accumulate in it? Is that the case?<br><br></div><div>Best regards<br></div><div>Peter MM<br></div><div><div><br></div><br></div></div>