Skip to content

Commit 19360c8

Browse files
committed
Fix AVX512 image filtering being broken.
1 parent 46a996b commit 19360c8

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

SerialPrograms/Source/Kernels/ImageFilters/Kernels_ImageFilter_Basic_x64_AVX512.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct PartialWordMask{
2020
__mmask16 m;
2121

2222
PA_FORCE_INLINE PartialWordMask(size_t left)
23-
: m((__mmask16)1 << left)
23+
: m(((__mmask16)1 << left) - 1)
2424
{}
2525
};
2626

SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,13 @@ void TestProgram::program(MultiSwitchProgramEnvironment& env, CancellableScope&
342342
#endif
343343

344344
#if 1
345-
VideoSnapshot image = feed.snapshot();
346-
// ImageRGB32 image("screenshot-20241124-135028529403.png");
345+
// VideoSnapshot image = feed.snapshot();
346+
ImageRGB32 image("20250108-151305644248.png");
347347

348348
DateReader date_reader;
349349
date_reader.make_overlays(overlays);
350-
auto date = date_reader.read_date(logger, image);
351-
// auto date = date_reader.read_date(logger, std::make_shared<ImageRGB32>(std::move(image)));
350+
// auto date = date_reader.read_date(logger, image);
351+
auto date = date_reader.read_date(logger, std::make_shared<ImageRGB32>(std::move(image)));
352352
cout << "year = " << (int)date.second.year << endl;
353353
cout << "month = " << (int)date.second.month << endl;
354354
cout << "day = " << (int)date.second.day << endl;

SerialPrograms/Source/NintendoSwitch/Inference/NintendoSwitch_DateReader.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,20 @@ DateTime DateReader::read_date_us(Logger& logger, std::shared_ptr<const ImageRGB
351351
white_theme
352352
);
353353

354-
std::string ampm = to_utf8(OCR::normalize_utf32(OCR::ocr_read(Language::English, us_ampm_filtered)));
354+
std::string ampm_ocr = OCR::ocr_read(Language::English, us_ampm_filtered);
355+
if (ampm_ocr.back() == '\n'){
356+
ampm_ocr.pop_back();
357+
}
358+
std::string ampm = to_utf8(OCR::normalize_utf32(ampm_ocr));
359+
355360
if (ampm == "am"){
356361
// Do nothing.
362+
logger.log("OCR Text: \"" + ampm_ocr + "\" -> \"" + ampm + "\" -> AM");
357363
}else if (ampm == "pm"){
364+
logger.log("OCR Text: \"" + ampm_ocr + "\" -> \"" + ampm + "\" -> PM");
358365
hour += 12;
359366
}else{
367+
logger.log("OCR Text: \"" + ampm_ocr + "\" -> \"" + ampm + "\" -> ??", COLOR_RED);
360368
hour = -1;
361369
}
362370

0 commit comments

Comments
 (0)