libobs: Cleanup local names in obs-audio-controls#13335
libobs: Cleanup local names in obs-audio-controls#13335ansh1406 wants to merge 11 commits intoobsproject:masterfrom
Conversation
…nctions to keep style consistent
…e attachment functions
|
Can you please explain why you felt these changes were necessary, what did you use to determine that, and why you haven't tested them? You are changing variables around, and this should always be tested regardless of how "simple" a change might seem. Additionally, you have not completed the PR checklist. Why have you skipped some steps on submission? |
|
I won't say they are totally necessary. I read CODESTYLE.MD file and found some inconsistencies so I fixed them while ensuring their influence will be contained within the file itself. I did not change variables, I just renamed local variables whose scope was limited to few lines. Or initialized them if they were not as mentioned. For the PR checklist , there was no documentation needed , I was not quite sure how finely my commits should be divided. |
|
Clang format check is done ✅ |
|
Should I squash them all in single commit ? |
|
These commits are suspiciously similar to what an AI would write. Can you confirm if any AI tooling was used to discover/write this PR? |
|
I did used AI help to write the pr description, but not in the code |
dce2145 to
9b9422d
Compare
| hmax_ps(r, peak); | ||
| return r; | ||
| float peak_value = 0.0f; | ||
| hmax_ps(peak_value, peak); |
There was a problem hiding this comment.
My immediate reaction here would be to ask "what is the difference between peak and peak_value?" which suggests that the name of the former is too ambiguous here.
There was a problem hiding this comment.
Yes previously I did not look into it deeply , I've improved it now. I also improved it in get_true_peak.
Now they should have better readability.
There was a problem hiding this comment.
Also I found a bug ,
static float get_sample_peak(__m128 previous_samples, const float *samples, size_t nr_samples)
{
__m128 max_abs_per_lane = previous_samples;and
static float get_true_peak(__m128 previous_samples, const float *samples, size_t nr_samples)
{
/* These are normalized-sinc parameters for interpolating over sample
* points which are located at x-coords: -1.5, -0.5, +0.5, +1.5.
* And oversample points at x-coords: -0.3, -0.1, 0.1, 0.3. */
const __m128 sinc_minus_03 = _mm_set_ps(-0.155915f, 0.935489f, 0.233872f, -0.103943f);
const __m128 sinc_minus_01 = _mm_set_ps(-0.216236f, 0.756827f, 0.504551f, -0.189207f);
const __m128 sinc_plus_01 = _mm_set_ps(-0.189207f, 0.504551f, 0.756827f, -0.216236f);
const __m128 sinc_plus_03 = _mm_set_ps(-0.103943f, 0.233872f, 0.935489f, -0.155915f);
__m128 sample_window = previous_samples;
__m128 max_abs_per_lane = previous_samples;
in these both instances max_abs_per_lane should initialize with absolute value of previous_samples
Should I fix it in this PR with updated title or in different PR, since it's named as cleanup?
There was a problem hiding this comment.
Given the different "blast" radius that should probably be a separate PR.
I'd suggest opening a new PR with just the suggested fix (but the old names) and then re-base this PR on top of that fix with all the name changes.
If we merge the bugfix PR, then rebasing this PR will automatically remove it from the change set and the "type of changes" are neatly separated.
Description
Updated libobs audio control internals in obs-audio-controls.c with non-functional cleanup changes:
No public API signatures or observable behavior were changed.
Motivation and Context
This change improves readability and consistency in a hot-path file that handles fader and volmeter internals. Clearer local names reduce review and maintenance overhead, and explicit float style and initialization make intent more obvious.
This PR does not target a specific open issue.
How Has This Been Tested?
Testing environment:
Note: No runtime/audio pipeline execution tests were run for this cleanup-only change.
Types of changes
Checklist: