diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-07-01 20:17:25 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-07-01 20:17:25 +0200 |
| commit | ad27397a050b8ea43dad62b0b85be26166b56b7c (patch) | |
| tree | 7db5271b21c6f07c7ce53ca81648b694bd8e71b3 /src/lib/upmixer_a.cc | |
| parent | 89496a5ce67da007e40502783ddf4139aac052c8 (diff) | |
White space: player_video.{cc,h} reel_writer.{cc,h} maths_util.{cc,h} upmixer_{a,b}.{cc,h} upload_job.{cc,h}
Diffstat (limited to 'src/lib/upmixer_a.cc')
| -rw-r--r-- | src/lib/upmixer_a.cc | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/lib/upmixer_a.cc b/src/lib/upmixer_a.cc index f402b6691..d87546a76 100644 --- a/src/lib/upmixer_a.cc +++ b/src/lib/upmixer_a.cc @@ -33,106 +33,106 @@ using std::string; using std::vector; -UpmixerA::UpmixerA (int sampling_rate) - : _left (0.02, 1900.0 / sampling_rate, 4800.0 / sampling_rate) - , _right (0.02, 1900.0 / sampling_rate, 4800.0 / sampling_rate) - , _centre (0.01, 150.0 / sampling_rate, 1900.0 / sampling_rate) - , _lfe (0.01, 150.0 / sampling_rate) - , _ls (0.02, 4800.0 / sampling_rate, 20000.0 / sampling_rate) - , _rs (0.02, 4800.0 / sampling_rate, 20000.0 / sampling_rate) +UpmixerA::UpmixerA(int sampling_rate) + : _left(0.02, 1900.0 / sampling_rate, 4800.0 / sampling_rate) + , _right(0.02, 1900.0 / sampling_rate, 4800.0 / sampling_rate) + , _centre(0.01, 150.0 / sampling_rate, 1900.0 / sampling_rate) + , _lfe(0.01, 150.0 / sampling_rate) + , _ls(0.02, 4800.0 / sampling_rate, 20000.0 / sampling_rate) + , _rs(0.02, 4800.0 / sampling_rate, 20000.0 / sampling_rate) { } string -UpmixerA::name () const +UpmixerA::name() const { return _("Stereo to 5.1 up-mixer A"); } string -UpmixerA::id () const +UpmixerA::id() const { return N_("stereo-5.1-upmix-a"); } int -UpmixerA::out_channels () const +UpmixerA::out_channels() const { return 6; } shared_ptr<AudioProcessor> -UpmixerA::clone (int sampling_rate) const +UpmixerA::clone(int sampling_rate) const { return make_shared<UpmixerA>(sampling_rate); } shared_ptr<AudioBuffers> -UpmixerA::run (shared_ptr<const AudioBuffers> in, int channels) +UpmixerA::run(shared_ptr<const AudioBuffers> in, int channels) { /* Input L and R */ - auto in_L = in->channel (0); - auto in_R = in->channel (1); + auto in_L = in->channel(0); + auto in_R = in->channel(1); /* Mix of L and R; -6dB down in amplitude (3dB in terms of power) */ - auto in_LR = in_L->clone (); - in_LR->accumulate_frames (in_R.get(), in_R->frames(), 0, 0); - in_LR->apply_gain (-6); + auto in_LR = in_L->clone(); + in_LR->accumulate_frames(in_R.get(), in_R->frames(), 0, 0); + in_LR->apply_gain(-6); /* Run filters */ vector<shared_ptr<AudioBuffers>> all_out; - all_out.push_back (_left.run(in_L)); - all_out.push_back (_right.run(in_R)); - all_out.push_back (_centre.run(in_LR)); - all_out.push_back (_lfe.run(in_LR)); - all_out.push_back (_ls.run(in_L)); - all_out.push_back (_rs.run(in_R)); + all_out.push_back(_left.run(in_L)); + all_out.push_back(_right.run(in_R)); + all_out.push_back(_centre.run(in_LR)); + all_out.push_back(_lfe.run(in_LR)); + all_out.push_back(_ls.run(in_L)); + all_out.push_back(_rs.run(in_R)); auto out = make_shared<AudioBuffers>(channels, in->frames()); - int const N = min (channels, 6); + int const N = min(channels, 6); for (int i = 0; i < N; ++i) { - out->copy_channel_from (all_out[i].get(), 0, i); + out->copy_channel_from(all_out[i].get(), 0, i); } for (int i = N; i < channels; ++i) { - out->make_silent (i); + out->make_silent(i); } return out; } void -UpmixerA::flush () +UpmixerA::flush() { - _left.flush (); - _right.flush (); - _centre.flush (); - _lfe.flush (); - _ls.flush (); - _rs.flush (); + _left.flush(); + _right.flush(); + _centre.flush(); + _lfe.flush(); + _ls.flush(); + _rs.flush(); } void -UpmixerA::make_audio_mapping_default (AudioMapping& mapping) const +UpmixerA::make_audio_mapping_default(AudioMapping& mapping) const { /* Just map the first two input channels to our L/R */ - mapping.make_zero (); - for (int i = 0; i < min (2, mapping.input_channels()); ++i) { - mapping.set (i, i, 1); + mapping.make_zero(); + for (int i = 0; i < min(2, mapping.input_channels()); ++i) { + mapping.set(i, i, 1); } } vector<NamedChannel> -UpmixerA::input_names () const +UpmixerA::input_names() const { return { NamedChannel(_("Upmix L"), 0), |
