OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2013 The LibYuv Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 } | 349 } |
350 delete[] file_rec; | 350 delete[] file_rec; |
351 exit(1); | 351 exit(1); |
352 } | 352 } |
353 } | 353 } |
354 | 354 |
355 const int y_size = image_width * image_height; | 355 const int y_size = image_width * image_height; |
356 const int uv_size = ((image_width + 1) / 2) * ((image_height + 1) / 2); | 356 const int uv_size = ((image_width + 1) / 2) * ((image_height + 1) / 2); |
357 const size_t total_size = y_size + 2 * uv_size; // NOLINT | 357 const size_t total_size = y_size + 2 * uv_size; // NOLINT |
358 #if defined(_MSC_VER) | 358 #if defined(_MSC_VER) |
359 _fseeki64(file_org, static_cast<__int64>(num_skip_org) * | 359 _fseeki64( |
360 static_cast<__int64>(total_size), | 360 file_org, |
361 SEEK_SET); | 361 static_cast<__int64>(num_skip_org) * static_cast<__int64>(total_size), |
| 362 SEEK_SET); |
362 #else | 363 #else |
363 fseek(file_org, num_skip_org * total_size, SEEK_SET); | 364 fseek(file_org, num_skip_org * total_size, SEEK_SET); |
364 #endif | 365 #endif |
365 for (int cur_rec = 0; cur_rec < num_rec; ++cur_rec) { | 366 for (int cur_rec = 0; cur_rec < num_rec; ++cur_rec) { |
366 #if defined(_MSC_VER) | 367 #if defined(_MSC_VER) |
367 _fseeki64(file_rec[cur_rec], static_cast<__int64>(num_skip_rec) * | 368 _fseeki64( |
368 static_cast<__int64>(total_size), | 369 file_rec[cur_rec], |
369 SEEK_SET); | 370 static_cast<__int64>(num_skip_rec) * static_cast<__int64>(total_size), |
| 371 SEEK_SET); |
370 #else | 372 #else |
371 fseek(file_rec[cur_rec], num_skip_rec * total_size, SEEK_SET); | 373 fseek(file_rec[cur_rec], num_skip_rec * total_size, SEEK_SET); |
372 #endif | 374 #endif |
373 } | 375 } |
374 | 376 |
375 uint8* const ch_org = new uint8[total_size]; | 377 uint8* const ch_org = new uint8[total_size]; |
376 uint8* const ch_rec = new uint8[total_size]; | 378 uint8* const ch_rec = new uint8[total_size]; |
377 if (ch_org == NULL || ch_rec == NULL) { | 379 if (ch_org == NULL || ch_rec == NULL) { |
378 fprintf(stderr, "No memory available\n"); | 380 fprintf(stderr, "No memory available\n"); |
379 fclose(file_org); | 381 fclose(file_org); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 for (int cur_rec = 0; cur_rec < num_rec; ++cur_rec) { | 617 for (int cur_rec = 0; cur_rec < num_rec; ++cur_rec) { |
616 fclose(file_rec[cur_rec]); | 618 fclose(file_rec[cur_rec]); |
617 } | 619 } |
618 delete[] distortion_psnr; | 620 delete[] distortion_psnr; |
619 delete[] distortion_ssim; | 621 delete[] distortion_ssim; |
620 delete[] ch_org; | 622 delete[] ch_org; |
621 delete[] ch_rec; | 623 delete[] ch_rec; |
622 delete[] file_rec; | 624 delete[] file_rec; |
623 return 0; | 625 return 0; |
624 } | 626 } |
OLD | NEW |