Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Weil <[email protected]>
  • Loading branch information
heshpdx and stweil authored Sep 3, 2024
1 parent 41faf69 commit 7ab67f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/lstm/networkio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void NetworkIO::Copy2DImage(int batch, Image pix, float black, float contrast, T
int target_width = stride_map_.Size(FD_WIDTH);
int num_features = NumFeatures();
bool color = num_features == 3;
float inv_contrast = 1.0/contrast;
float inv_contrast = 1 / contrast;
if (width > target_width) {
width = target_width;
}
Expand Down Expand Up @@ -265,7 +265,7 @@ void NetworkIO::Copy1DGreyImage(int batch, Image pix, float black, float contras
index.AddOffset(batch, FD_BATCH);
int t = index.t();
int target_width = stride_map_.Size(FD_WIDTH);
float inv_contrast = 1.0/contrast;
float inv_contrast = 1 / contrast;
if (width > target_width) {
width = target_width;
}
Expand Down
8 changes: 4 additions & 4 deletions src/textord/pithsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void FPCUTPT::assign( // constructor
// half of pitch
int16_t half_pitch = pitch / 2 - 1;
uint32_t lead_flag; // new flag
float inv_projection_scale = 1.0/projection_scale;
float inv_projection_scale = 1 / projection_scale;

if (half_pitch > 31) {
half_pitch = 31;
Expand Down Expand Up @@ -222,7 +222,7 @@ void FPCUTPT::assign_cheap( // constructor
// half of pitch
int16_t half_pitch = pitch / 2 - 1;
uint32_t lead_flag; // new flag
float inv_projection_scale = 1.0/projection_scale;
float inv_projection_scale = 1 / projection_scale;

if (half_pitch > 31) {
half_pitch = 31;
Expand Down Expand Up @@ -262,7 +262,7 @@ void FPCUTPT::assign_cheap( // constructor
lead_flag &= lead_flag - 1;
}
balance_count =
static_cast<int16_t>(balance_count * textord_balance_factor * projection_scale);
static_cast<int16_t>(balance_count * textord_balance_factor * inv_projection_scale);
}
r_index = segpt->region_index + 1;
total = segpt->mean_sum + dist;
Expand Down Expand Up @@ -513,7 +513,7 @@ double check_pitch_sync3( // find segmentation
int16_t best_fake; // best fake level
int16_t best_count; // no of cuts
FPSEGPT_IT seg_it = seg_list; // output iterator
float inv_projection_scale = 1.0/projection_scale;
float inv_projection_scale = 1 / projection_scale;

end = (end - start) % pitch;
if (pitch < 3) {
Expand Down

0 comments on commit 7ab67f9

Please sign in to comment.