Skip to content

Commit 633d7cd

Browse files
committed
fixed performance bug + getting ready for master merge
1 parent 491ccfe commit 633d7cd

3 files changed

Lines changed: 24 additions & 22 deletions

File tree

cpp_rework/dandere2x_utilities.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Created by Tyler on 5/10/2021.
33
//
44
#include "dandere2x_utilities.h"
5+
#include "easyloggingpp/easylogging++.h"
56
#include "math.h"
67

78
char dandere2x_utilities::separator() {
@@ -40,5 +41,5 @@ void dandere2x_utilities::wait_for_file(const std::string &name) {
4041
}
4142

4243
bool dandere2x_utilities::debug_enabled() {
43-
return true;
44+
return false;
4445
}

cpp_rework/frame/Frame.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ class Frame {
105105
void apply_noise(int range);
106106

107107
Frame::Color &get_color(const int x, const int y) const {
108-
sanity_check("Frame::Color &Frame::get_color", x, y);
108+
// sanity_check("Frame::Color &Frame::get_color", x, y);
109109
return const_cast<Frame::Color &>(image_colors[x][y]);
110110
}
111111

112112
void set_color(const int x, const int y, const Frame::Color &color) {
113-
sanity_check("void Frame::set_color", x, y);
113+
// sanity_check("void Frame::set_color", x, y);
114114
image_colors[x][y] = color;
115115
}
116116

cpp_rework/plugins/predictive_frame/PredictiveFrame.cpp

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,26 @@ void PredictiveFrame::parallel_function_call(int x, int y) {
5050
return;
5151
}
5252

53-
// // Find (x,y) in frame_2 in frame_1. Note we have to go in the reverse. We can't go frame_1 -> frame_2 since
54-
// // the matched blocks may not be on perfect intervals of block_size.
55-
// // Since we're going frame_2 -> frame_1, the matched block is "being matched in reverse", so flip the block
56-
// // so we can go frame_1 -> frame_2.
57-
// Block matched_block = this->block_matcher->match_block(x, y, block_size);
58-
// matched_block.reverse_block();
59-
//
60-
// // Check to see if the current matched block produces a valid match
61-
// if (eval->evaluate(this->current_frame,
62-
// this->next_frame, this->next_frame_compressed,
63-
// matched_block,
64-
// block_size)) {
65-
//
66-
// matched_moving_blocks += 1;
67-
// this->matched_blocks[x][y] = make_shared<Block>(matched_block.x_start, matched_block.y_start,
68-
// matched_block.x_end, matched_block.y_end,
69-
// 1);
70-
// return;
71-
// }
53+
// Find (x,y) in frame_2 in frame_1. Note we have to go in the reverse. We can't go frame_1 -> frame_2 since
54+
// the matched blocks may not be on perfect intervals of block_size.
55+
// Since we're going frame_2 -> frame_1, the matched block is "being matched in reverse", so flip the block
56+
// so we can go frame_1 -> frame_2.
57+
Block matched_block = this->block_matcher->match_block(x, y, block_size);
58+
matched_block.reverse_block();
59+
60+
// Check to see if the current matched block produces a valid match
61+
if (eval->evaluate(*this->current_frame,
62+
*this->next_frame,
63+
*this->next_frame_compressed,
64+
matched_block,
65+
block_size)) {
66+
67+
matched_moving_blocks += 1;
68+
this->matched_blocks[x][y] = make_shared<Block>(matched_block.x_start, matched_block.y_start,
69+
matched_block.x_end, matched_block.y_end,
70+
1);
71+
return;
72+
}
7273

7374
// -1 denotes an invalid block.
7475
this->matched_blocks[x][y] = make_shared<Block>(x, y,

0 commit comments

Comments
 (0)