ORC: no way to accumulate 64 bit (8 bytes)?

Peter Maersk-Moller pmaersk at gmail.com
Tue Jul 5 13:43:59 UTC 2016


Hi

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

sum = 1/n * (x1^2 + x2^2 ... xn^2)

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

# The src is 16 bit signed values in 32 bit signed integer
.function audio_rms_orc_one_channel
.source 4 src int32_t
.accumulator 8 result
.temp 8 squared
# Multiply signed 4 byte to 8 byte
mulslq squared src src
addq result result squared

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.

# The src is 16 bit signed values in 32 bit signed integer
.function audio_rms_orc_one_channel2
.source 4 src int32_t
.accumulator 8 result
.temp 8 squared
# Multiply signed 4 byte to 8 byte
mulslq squared src src
addq squared result squared
copyq result squared

But to no avail. So I can declare an 8 byte accumulator, I just can't
accumulate in it? Is that the case?

Best regards
Peter MM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160705/b4a97c0b/attachment.html>


More information about the gstreamer-devel mailing list