Lines Matching refs:tgt_image

863 bool ZipModeImage::CheckAndProcessChunks(ZipModeImage* tgt_image, ZipModeImage* src_image) {  in CheckAndProcessChunks()  argument
864 for (auto& tgt_chunk : *tgt_image) { in CheckAndProcessChunks()
892 if (tgt_image->limit_ == 0) { in CheckAndProcessChunks()
893 tgt_image->MergeAdjacentNormalChunks(); in CheckAndProcessChunks()
894 tgt_image->DumpChunks(); in CheckAndProcessChunks()
903 bool ZipModeImage::SplitZipModeImageWithLimit(const ZipModeImage& tgt_image, in SplitZipModeImageWithLimit() argument
908 CHECK_EQ(tgt_image.limit_, src_image.limit_); in SplitZipModeImageWithLimit()
909 size_t limit = tgt_image.limit_; in SplitZipModeImageWithLimit()
912 LOG(INFO) << "Splitting " << tgt_image.NumOfChunks() << " tgt chunks..."; in SplitZipModeImageWithLimit()
925 for (auto tgt = tgt_image.cbegin(); tgt != tgt_image.cend(); tgt++) { in SplitZipModeImageWithLimit()
928 split_tgt_chunks.emplace_back(CHUNK_NORMAL, tgt->GetStartOffset(), &tgt_image.file_content_, in SplitZipModeImageWithLimit()
942 split_tgt_chunks.emplace_back(CHUNK_NORMAL, tgt->GetStartOffset(), &tgt_image.file_content_, in SplitZipModeImageWithLimit()
953 split_tgt_chunks.emplace_back(CHUNK_NORMAL, tgt->GetStartOffset(), &tgt_image.file_content_, in SplitZipModeImageWithLimit()
958 tgt_image, src_image, src_ranges, split_tgt_chunks, split_src_chunks, split_tgt_images, in SplitZipModeImageWithLimit()
978 bool added_image = ZipModeImage::AddSplitImageFromChunkList(tgt_image, src_image, src_ranges, in SplitZipModeImageWithLimit()
986 tgt_image.file_content_.size()); in SplitZipModeImageWithLimit()
991 bool ZipModeImage::AddSplitImageFromChunkList(const ZipModeImage& tgt_image, in AddSplitImageFromChunkList() argument
1010 aligned_tgt_chunks.emplace_back(CHUNK_NORMAL, tgt_start, &tgt_image.file_content_, in AddSplitImageFromChunkList()
1030 if (end_offset % BLOCK_SIZE != 0 && end_offset < tgt_image.file_content_.size()) { in AddSplitImageFromChunkList()
1031 size_t tail_block_length = std::min<size_t>(tgt_image.file_content_.size() - end_offset, in AddSplitImageFromChunkList()
1033 aligned_tgt_chunks.emplace_back(CHUNK_NORMAL, end_offset, &tgt_image.file_content_, in AddSplitImageFromChunkList()
1072 for (const auto& tgt_image : split_tgt_images) { in ValidateSplitImages() local
1073 CHECK(!tgt_image.chunks_.empty()); in ValidateSplitImages()
1075 CHECK_EQ(last_offset, tgt_image.chunks_.front().GetStartOffset()); in ValidateSplitImages()
1079 for (const auto& chunk : tgt_image.chunks_) { in ValidateSplitImages()
1097 bool ZipModeImage::GeneratePatchesInternal(const ZipModeImage& tgt_image, in GeneratePatchesInternal() argument
1100 LOG(INFO) << "Constructing patches for " << tgt_image.NumOfChunks() << " chunks..."; in GeneratePatchesInternal()
1104 for (size_t i = 0; i < tgt_image.NumOfChunks(); i++) { in GeneratePatchesInternal()
1105 const auto& tgt_chunk = tgt_image[i]; in GeneratePatchesInternal()
1137 CHECK_EQ(patch_chunks->size(), tgt_image.NumOfChunks()); in GeneratePatchesInternal()
1141 bool ZipModeImage::GeneratePatches(const ZipModeImage& tgt_image, const ZipModeImage& src_image, in GeneratePatches() argument
1145 ZipModeImage::GeneratePatchesInternal(tgt_image, src_image, &patch_chunks); in GeneratePatches()
1147 CHECK_EQ(tgt_image.NumOfChunks(), patch_chunks.size()); in GeneratePatches()
1374 bool ImageModeImage::CheckAndProcessChunks(ImageModeImage* tgt_image, ImageModeImage* src_image) { in CheckAndProcessChunks() argument
1376 tgt_image->MergeAdjacentNormalChunks(); in CheckAndProcessChunks()
1379 if (tgt_image->NumOfChunks() != src_image->NumOfChunks()) { in CheckAndProcessChunks()
1381 tgt_image->DumpChunks(); in CheckAndProcessChunks()
1385 for (size_t i = 0; i < tgt_image->NumOfChunks(); ++i) { in CheckAndProcessChunks()
1386 if ((*tgt_image)[i].GetType() != (*src_image)[i].GetType()) { in CheckAndProcessChunks()
1388 tgt_image->DumpChunks(); in CheckAndProcessChunks()
1394 for (size_t i = 0; i < tgt_image->NumOfChunks(); ++i) { in CheckAndProcessChunks()
1395 auto& tgt_chunk = (*tgt_image)[i]; in CheckAndProcessChunks()
1417 tgt_image->MergeAdjacentNormalChunks(); in CheckAndProcessChunks()
1419 if (tgt_image->NumOfChunks() != src_image->NumOfChunks()) { in CheckAndProcessChunks()
1430 bool ImageModeImage::GeneratePatches(const ImageModeImage& tgt_image, in GeneratePatches() argument
1433 LOG(INFO) << "Constructing patches for " << tgt_image.NumOfChunks() << " chunks..."; in GeneratePatches()
1435 patch_chunks.reserve(tgt_image.NumOfChunks()); in GeneratePatches()
1437 for (size_t i = 0; i < tgt_image.NumOfChunks(); i++) { in GeneratePatches()
1438 const auto& tgt_chunk = tgt_image[i]; in GeneratePatches()
1461 CHECK_EQ(tgt_image.NumOfChunks(), patch_chunks.size()); in GeneratePatches()
1554 ZipModeImage tgt_image(false, blocks_limit * BLOCK_SIZE); in imgdiff() local
1559 if (!tgt_image.Initialize(argv[optind + 1])) { in imgdiff()
1563 if (!ZipModeImage::CheckAndProcessChunks(&tgt_image, &src_image)) { in imgdiff()
1578 ZipModeImage::SplitZipModeImageWithLimit(tgt_image, src_image, &split_tgt_images, in imgdiff()
1586 } else if (!ZipModeImage::GeneratePatches(tgt_image, src_image, argv[optind + 2])) { in imgdiff()
1591 ImageModeImage tgt_image(false); in imgdiff() local
1596 if (!tgt_image.Initialize(argv[optind + 1])) { in imgdiff()
1600 if (!ImageModeImage::CheckAndProcessChunks(&tgt_image, &src_image)) { in imgdiff()
1608 if (!ImageModeImage::GeneratePatches(tgt_image, src_image, argv[optind + 2])) { in imgdiff()