mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-24 17:37:30 +09:00
Issue #2101 - Part 3: Update libyuv
Updated to version 1861, git revision 88b050f337cc0ca2a51800fe7bf4737222c87344 from https://chromium.googlesource.com/libyuv/libyuv/
This commit is contained in:
parent
42f3296899
commit
a4d1f57b9e
222 changed files with 111006 additions and 37106 deletions
|
|
@ -29,20 +29,24 @@ int main(int argc, char** argv) {
|
|||
FILE* fin2 = name2 ? fopen(name2, "rb") : NULL;
|
||||
|
||||
const int kBlockSize = 32768;
|
||||
uint8 buf1[kBlockSize];
|
||||
uint8 buf2[kBlockSize];
|
||||
uint32 hash1 = 5381;
|
||||
uint32 hash2 = 5381;
|
||||
uint64 sum_square_err = 0;
|
||||
uint64 size_min = 0;
|
||||
uint8_t buf1[kBlockSize];
|
||||
uint8_t buf2[kBlockSize];
|
||||
uint32_t hash1 = 5381;
|
||||
uint32_t hash2 = 5381;
|
||||
uint64_t sum_square_err = 0;
|
||||
uint64_t size_min = 0;
|
||||
int amt1 = 0;
|
||||
int amt2 = 0;
|
||||
do {
|
||||
amt1 = static_cast<int>(fread(buf1, 1, kBlockSize, fin1));
|
||||
if (amt1 > 0) hash1 = libyuv::HashDjb2(buf1, amt1, hash1);
|
||||
if (amt1 > 0) {
|
||||
hash1 = libyuv::HashDjb2(buf1, amt1, hash1);
|
||||
}
|
||||
if (fin2) {
|
||||
amt2 = static_cast<int>(fread(buf2, 1, kBlockSize, fin2));
|
||||
if (amt2 > 0) hash2 = libyuv::HashDjb2(buf2, amt2, hash2);
|
||||
if (amt2 > 0) {
|
||||
hash2 = libyuv::HashDjb2(buf2, amt2, hash2);
|
||||
}
|
||||
int amt_min = (amt1 < amt2) ? amt1 : amt2;
|
||||
size_min += amt_min;
|
||||
sum_square_err += libyuv::ComputeSumSquareError(buf1, buf2, amt_min);
|
||||
|
|
@ -52,8 +56,8 @@ int main(int argc, char** argv) {
|
|||
printf("hash1 %x", hash1);
|
||||
if (fin2) {
|
||||
printf(", hash2 %x", hash2);
|
||||
double mse = static_cast<double>(sum_square_err) /
|
||||
static_cast<double>(size_min);
|
||||
double mse =
|
||||
static_cast<double>(sum_square_err) / static_cast<double>(size_min);
|
||||
printf(", mse %.2f", mse);
|
||||
double psnr = libyuv::SumSquareErrorToPsnr(sum_square_err, size_min);
|
||||
printf(", psnr %.2f\n", psnr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue