Audio: Volume: Optimize read frag usage from zero crossing search - #5328
Merged
lgirdwood merged 1 commit intoFeb 23, 2022
Merged
Conversation
Collaborator
Author
Collaborator
Author
|
Something wrong -- I'm getting different zero crossings locations (debugged with testbench printtf()) with optimized 32 bit, finding out why ... |
singalsu
commented
Feb 8, 2022
This patch optimizes the buffer seek for zero crossing. The audio_stream_read_frag_s16/24/32() is replaced with block based search. The search block is defined by new stream function audio_stream_rewind_bytes_without_wrap(). The other added stream function audio_stream_rewind_wrap() handles the pointer wrap when reading backwards. The saving during volume ramping is from 12.4 MCPS to 10.8 MCPS (1.6 MCPS) for 16 bit play, and 16.4 MCPS to 14.4 MCPS (2 MCPS) for 24 bit and 32 bit playback. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
singalsu
force-pushed
the
volume_zc_read_frag_optimize
branch
from
February 8, 2022 17:07
9a35400 to
4ea90b7
Compare
singalsu
marked this pull request as ready for review
February 8, 2022 17:08
singalsu
requested review from
dbaluta,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
February 8, 2022 17:08
Collaborator
Author
|
I think there's a mistake in zero-crossing search in the original code. This patch is not changing the functionality, just speeds it. The prev_sum is not updated when crossing is found so I think it misses every other. Also I think in start the prev_sum should be set to sum of last frame, then seek backwards and update sum and compare. If issue is confirmed I would do other PR. |
Member
|
@singalsu any update - ready to merge now ? |
Collaborator
Author
This is OK for me. I didn't change zero crossing search algorithm, this performs identically to current version but is faster. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This patch optimizes the buffer seek for zero crossing. The
audio_stream_read_frag_s16/24/32() is replaced with block
based search. The search block is defined by new stream function
audio_stream_rewind_bytes_without_wrap(). The other added stream
function audio_stream_rewind_wrap() handles the pointer wrap
when reading backwards.
The saving during volume ramping is from 12.4 MCPS to 10.8 MCPS
(1.6 MCPS) for 16 bit play, and 16.4 MCPS to 14.4 MCPS (2 MCPS)
for 24 bit and 32 bit playback.
Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com