diff options
| author | Mai <mai.iam2048@gmail.com> | 2023-05-16 14:39:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-16 14:39:59 -0400 |
| commit | fede2ab9a993a1bc0baa2a9f42f6446e10dfee2d (patch) | |
| tree | a3e2746f4a51fc45e5bcacf46f31b3f8c1414ac6 /Source/Core/DiscIO | |
| parent | e0ef474d95f08ad02fb3ef134ca4039d4182eed3 (diff) | |
| parent | 192081d2f1a9c7e139828847f8c882499197b870 (diff) | |
Merge pull request #11828 from JosJuice/wia-convert-comments
DiscIO: Improve comments in WIARVZFileReader::Convert
Diffstat (limited to 'Source/Core/DiscIO')
| -rw-r--r-- | Source/Core/DiscIO/WIABlob.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/WIABlob.cpp b/Source/Core/DiscIO/WIABlob.cpp index b80753120b..65c6aaa484 100644 --- a/Source/Core/DiscIO/WIABlob.cpp +++ b/Source/Core/DiscIO/WIABlob.cpp @@ -1771,16 +1771,17 @@ WIARVZFileReader<RVZ>::Convert(BlobReader* infile, const VolumeDisc* infile_volu // An estimate for how much space will be taken up by headers. // We will reserve this much space at the beginning of the file, and if the headers don't - // fit on that space, we will need to write them at the end of the file instead. + // fit in that space, we will need to write them at the end of the file instead. const u64 headers_size_upper_bound = [&] { // 0x100 is added to account for compression overhead (in particular for Purge). u64 upper_bound = sizeof(WIAHeader1) + sizeof(WIAHeader2) + partition_entries_size + raw_data_entries_size + 0x100; - // RVZ's added data in GroupEntry usually compresses well, so we'll assume the compression ratio - // for RVZ GroupEntries is 9 / 16 or better. This constant is somehwat arbitrarily chosen, but - // no games were found that get a worse compression ratio than that. There are some games that - // get a worse ratio than 1 / 2, such as Metroid: Other M (PAL) with the default settings. + // Compared to WIA, RVZ adds an extra member to the GroupEntry struct. This added data usually + // compresses well, so we'll assume the compression ratio for RVZ GroupEntries is 9 / 16 or + // better. This constant is somehwat arbitrarily chosen, but no games were found that get a + // worse compression ratio than that. There are some games that get a worse ratio than 1 / 2, + // such as Metroid: Other M (PAL) with the default settings. if (RVZ && compression_type > WIARVZCompressionType::Purge) upper_bound += static_cast<u64>(group_entries_size) * 9 / 16; else @@ -1798,7 +1799,7 @@ WIARVZFileReader<RVZ>::Convert(BlobReader* infile, const VolumeDisc* infile_volu if (!infile->Read(0, header_2.disc_header.size(), header_2.disc_header.data())) return ConversionResultCode::ReadFailed; - // We intentially do not increment bytes_read here, since these bytes will be read again + // We intentionally do not increment bytes_read here, since these bytes will be read again std::map<ReuseID, GroupEntry> reusable_groups; std::mutex reusable_groups_mutex; |
