-
Notifications
You must be signed in to change notification settings - Fork 349
Prepare for Cadence decoder support #3884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
With decoders, usually, consumed bytes is not equal with produced bytes. We need to take this into account in order to copy the entire produced bytes by the processing algorithm. - consumed bytes -> number of bytes consumed from the input buffer. - produced bytes -> number of bytes produced into the output buffer. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Initialization of the processing shouldn't be done in the prepare function as the decoder needs some input frames in order to figure out decoding parameters. First step is to just factour out the init process code into a function and move it to the proper place later. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Init process function searches for valid header, does header decoding to get the parameters and initializes state and configuration structures. In order for this to work we need to set the input bytes and also update consumed bytes. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
…g_data We need to save initialization status to a persistent (between calls) variable in order to check it each time we want to do processing. Initialization only takes place once before first frames are decoded. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This function should be called before processing. It searches for a valid header, does header decoding to get the parameters and initializes state and configuration structures. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
During the initialization of a decoder, the initialization task reads the input stream to discover the parameters of the encoding. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
paulstelian97
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit at odds with the first commit (the one with the produced/consumed bytes) but I also don't really see anything specifically wrong.
|
@paulstelian97 thanks Paul for having a look. As described in the commit message the current implementation only works when the processing algorithm deal with PCM frames. At this point the number of bytes consumed equals the number of bytes produced. But for MP3 for example, for specific parameters a frame of 572 bytes gets decompressed to 9216 PCM bytes. |
Yes, I get the intent and of course, this is needed, but the thing is I'm not 100% certain of the implementation (if you missed something or not). Can't figure out if you covered all bases on where this needs to be split. |
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, lets also keep it easy to converge into component API.
|
@mrajwa is this change OK for your tests with Dolby Audio Processing? I just finished a first working draft of mp3 patches and I need this to get in in order to send the next batch. @lgirdwood I need an Approval from Intel on these patches. @mrajwa I can locally test this for DAP if you just send me some sample files and DAP binary. |
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbaluta ok lets make this teh last codec feature update in codec adapter. We can now work on codec adapter alignment and component/module API merging.
|
@lgirdwood This specific patch series doesn't depend on component/module API merging. Anyhow, I still have time until Q2 release so we can first sort out codec adapter alignment and stuff. I will continue tough updating this PR or maybe create another one for mp3 patches. I want to get an early feedback . |
|
@dbaluta ok, but I'm good for this now if you are happy here, I just dont want to add extra ops or APIs on top of codec until we can align. |
|
@lgirdwood I understand your concern. My proposal is:
Also @cujomalainey I can look starting next week on sorting out things discussed at TSC. |
|
Thanks, I have had a few internal projects pop up that have kept me from finishing #3881. Hoping to get back to it sooner rather than later |
|
All Codec test are a PASS so this PR is good to merge. |
This is the first PR in the series of preparing support for compressed streams decoding. Mainly, this takes care of adding the codec initialization phase during copy() function.
Initializaton phase for decoders needs to process input frames in order to get a valid header, parse it and figure out the codec parameters. It then also initalizes codec internal state and data structures.