Skip to content

Commit

Permalink
Use const instead of macro
Browse files Browse the repository at this point in the history
  • Loading branch information
hzhou245 committed Jan 25, 2024
1 parent 10e6713 commit 3e2a77a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runtime/core/frontend/fbank.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ namespace wenet {
// This code is based on kaldi Fbank implementation, please see
// https://github.com/kaldi-asr/kaldi/blob/master/src/feat/feature-fbank.cc

static const int kS16AbsMax = 1 << 15;

enum class WindowType {
kPovey = 0,
kHanning,
Expand Down Expand Up @@ -265,7 +267,7 @@ class Fbank {

if (scale_input_to_unit_) {
for (int j = 0; j < frame_length_; ++j) {
data[j] = data[j] / S16_ABS_MAX;
data[j] = data[j] / kS16AbsMax;
}
}

Expand Down

0 comments on commit 3e2a77a

Please sign in to comment.