Audio: Component: HiFi5 implementation of functions.#8695
Audio: Component: HiFi5 implementation of functions.#8695kv2019i merged 3 commits intothesofproject:mainfrom
Conversation
eaf11ff to
fe0336e
Compare
src/audio/component.c
Outdated
| ae_int16x4 *src = (ae_int16x4 *)((int8_t *)audio_stream_get_rptr(source) + ioffset * ssize); | ||
| ae_int16x4 *dst = (ae_int16x4 *)((int8_t *)audio_stream_get_wptr(sink) + ooffset * ssize); | ||
| int shorts = samples * ssize >> 1; | ||
| size_t shorts = samples * ssize >> 1; |
There was a problem hiding this comment.
sorry, I don't understand this. Firstly, I think size_t is supposed to be used as a number of bytes, whereas here it's a number of shorts. Secondly, "reducing the risk of a forever loop" - shouldn't such a risk actually be made to be equal to 0? Besides, I don't see how this change affects that risk at all - the loop is over while (shorts) so it doesn't seem to be affected by this type change. Thirdly, IIUC AE_MIN_32_signed(shorts, shorts_copied) is a signed comparison, so I don't understand why shorts now has to be unsigned.
There was a problem hiding this comment.
so better to keep the signed type and use while(short > 0) to avoid the risk, though it shouldn't happen.
|
Good improvement! Approve - with fix suggested by Guennadi. |
Add HiFi5 implementation if function audio_stream_copy, compared with HiFi3 version, the HiFi5 method can save about 29% cycles. Signed-off-by: Andrula Song <andrula.song@intel.com>
Use while (shorts > 0) instead of while (short) to reduce the forever loop risk. Use general instruction AE_MIN32 replace AE_MIN_32_signed which is an internal proto intended for Xtensa compiler. Signed-off-by: Andrula Song <andrula.song@intel.com>
Add HiFi3 & HiFi5 implementation of function cir_buf_copy. Compared with generic C version, the HiFi3 version can save about 3% cycles and HiFi5 version can save about 40% cycles. Signed-off-by: Andrula Song <andrula.song@intel.com>
fe0336e to
124eb29
Compare

Uh oh!
There was an error while loading. Please reload this page.