// Copyright (c) the JPEG XL Project Authors. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.
// Looking at each corner between groups, we can guarantee that the four // involved groups will agree between each other regarding the order in which // each of the four groups terminated. Thus, the last of the four groups // gets the responsibility of handling the corner. For borders, every border // is assigned to its top corner (for vertical borders) or to its left corner // (for horizontal borders): the order as seen on those corners will decide who // handles that border.
auto fetch_status = [this](size_t idx, uint8_t bit) { // Note that the acq-rel semantics of this fetch are actually needed to // ensure that the pixel data of the group is already written to memory.
size_t status = counters_[idx].fetch_or(bit);
JXL_DASSERT((bit & status) == 0); return bit | status;
};
// Because of how group borders are assigned, it is impossible that we need to // process the left and right side of some area but not the center area. Thus, // we compute the first/last part to process in every horizontal strip and // merge them together. We first collect a mask of what parts should be // processed. // We do this horizontally rather than vertically because horizontal borders // are larger. bool available_parts_mask[3][3] = {}; // [x][y] // Center
available_parts_mask[1][1] = true; // Corners if (top_left_status == 0xF) available_parts_mask[0][0] = true; if (top_right_status == 0xF) available_parts_mask[2][0] = true; if (bottom_right_status == 0xF) available_parts_mask[2][2] = true; if (bottom_left_status == 0xF) available_parts_mask[0][2] = true; // Other borders if (top_left_status & kTopRight) available_parts_mask[1][0] = true; if (top_left_status & kBottomLeft) available_parts_mask[0][1] = true; if (top_right_status & kBottomRight) available_parts_mask[2][1] = true; if (bottom_left_status & kBottomRight) available_parts_mask[1][2] = true;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.