-
Notifications
You must be signed in to change notification settings - Fork 722
Fixing Cmake error for OPUS_FIXED_POINT=ON,OPUS_ENABLE_FLOAT_API=OFF #349
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
Only include floating point inner product when the OPUS_ENABLE_FLOAT_API has been enabled.
|
lgtm fyi @jmvalin |
|
@xnorpx |
|
It looks like I need to do a similar thing to add |
|
It looks like float and fixed point are currently mutually exclusive. I'll wait for someone else to weigh in on what the design intent is before pushing an update. if(OPUS_FIXED_POINT)
add_sources_group(opus silk ${silk_sources_fixed})
target_include_directories(opus PRIVATE silk/fixed)
target_compile_definitions(opus PRIVATE FIXED_POINT=1)
else()
add_sources_group(opus silk ${silk_sources_float})
target_include_directories(opus PRIVATE silk/float)
endif() |
|
If I remember correctly for CMake if one choose fixed point it means fixed point only build with no floating point. (might be that the flags don't catch all combinations here) While if one run floating point api there will be fixed point code running in some components. The fixed point is there mainly for hardware that doesn't have FPU. Only other reason to run fixed point only would be binary size maybe? |
|
Okay, that's great news. This pull-request should be good to go, then. For my clarification, when building with OPUS_ENABLE_FLOAT_API=ON, I can encode 16-bit signed PCM data to encoded 16-bit opus and decode back to 16-bit PCM? If that's the case, that is the simplest solution for me. That 2x memory footprint saving of the encoded data is what I was hoping for by using OPUS_FIXED_POINT=ON. Or was it a flawed assumption from the beginning that have the encoded data in fixed point would shrink the memory footprint. |
|
Why are you basing this on FLOAT_API, shouldn't it just be about float vs fixed-point? In other words, IIRC silk_inner_product_FLP never gets used for fixed-point, even if FLOAT_API is enabled |
|
I'm happy to change this to Currently this is the help prompt in CMakeLists.txt Does OPUS_ENABLE_FLOAT_API equal NOT OPUS_FIXED_POINT? OPUS_FIXED_POINT seems like a way to enable fixed point if you want the performance savings. OPUS_ENABLE_FLOAT_API seems to give an additional API that supports floats. What combination of these flags are intended to work together? Or do both flags mean opposite of the other?
|
|
Basically, the Opus API includes both integer and floating-point calls for encoding and decoding. No matter how you build the library, the API should remain the same otherwise you might break things. When you compile as float, the integer encoder call just converts the data to float and then calls the float internal functions. When you compile as fixed-point, then the float calls just convert everything to/from integer. That's the recommended way of building Opus -- it'll just work all the time and use whatever is the most efficient on the arch being used. |
Only include floating point inner product when the
OPUS_FIXED_POINT has been disabled.
* Switching from OPUS_ENABLE_FLOAT_API
|
Thanks for the clarification. That clears up my confusion. I've updated the pull request to use the flag, NOT OPUS_FIXED_POINT. |
|
Merged. Next make make sure you make it a single patch rather than a buggy one followed by a fix. |
Only include floating point inner product when the OPUS_ENABLE_FLOAT_API has been enabled.
See issue 348