trying to use Accelerate framework's vDSP_vsmul with int16_t?

28 views
Skip to first unread message

Patrick Collins

unread,
Jul 5, 2016, 6:21:34 PM7/5/16
to perfoptimi...@lists.apple.com
I have a buffer, that I just want to essentially modify with:

  for (int i = 0; i < frames; i++) {
    buffer[i] *= gain;
  }

if I do:

  vDSP_vsmul(buffer, 1, &gain, buffer, 1, frames);

I get "No matching function for call to 'vDSP_vsmu"

and if I do:

  vDSP_vsmul((float *)buffer, 1, &gain, (float *)buffer, 1, frames);

then it compiles, but my audio sounds like trash...

How can I get this to work with 16-bit integer samples?

--

Ian Ollmann

unread,
Jul 5, 2016, 6:27:42 PM7/5/16
to Patrick Collins, perfoptimi...@lists.apple.com
vDSP_vsmul is for floating-point data, not int16_t. 

You can try vDSP_vflt16, vDSP_vsmul, vDSP_vfixr16.

The buffers should be small, <4k entries, to get reasonable performance.

Ian


_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (PerfOptimi...@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/perfoptimization-dev/iano%40apple.com

This email sent to ia...@apple.com

Reply all
Reply to author
Forward
0 new messages