/* * Copyright (c) 2016, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#if CONFIG_CWG_C013 bool use_level_7_above = false; for (int i = 0; i < seq_params->operating_points_cnt_minus_1 + 1; i++) { if (seq_params->seq_level_idx[i] >= SEQ_LEVEL_7_0 &&
seq_params->seq_level_idx[i] <= SEQ_LEVEL_8_3) { // Currently it is assumed that levels 7.x and 8.x are either used for all // operating points, or none of them. if (i != 0 && !use_level_7_above) {
aom_internal_error(cm->error, AOM_CODEC_UNSUP_BITSTREAM, "Either all the operating points are levels 7.x or " "8.x, or none of them are.");
}
use_level_7_above = true;
}
} constint max_tile_area_sb =
(use_level_7_above ? MAX_TILE_AREA_LEVEL_7_AND_ABOVE : MAX_TILE_AREA) >>
(2 * sb_size_log2); #else constint max_tile_area_sb = MAX_TILE_AREA >> (2 * sb_size_log2); #endif
void av1_calculate_tile_cols(const SequenceHeader *const seq_params, int cm_mi_rows, int cm_mi_cols,
CommonTileParams *const tiles) { int sb_cols = CEIL_POWER_OF_TWO(cm_mi_cols, seq_params->mib_size_log2); int sb_rows = CEIL_POWER_OF_TWO(cm_mi_rows, seq_params->mib_size_log2); int i;
// This will be overridden if there is at least two columns of tiles // (otherwise there is no inner tile width)
tiles->min_inner_width = -1;
if (tiles->uniform_spacing) { int start_sb; int size_sb = CEIL_POWER_OF_TWO(sb_cols, tiles->log2_cols);
assert(size_sb > 0); for (i = 0, start_sb = 0; start_sb < sb_cols; i++) {
tiles->col_start_sb[i] = start_sb;
start_sb += size_sb;
}
tiles->cols = i;
tiles->col_start_sb[i] = sb_cols;
tiles->min_log2_rows = AOMMAX(tiles->min_log2 - tiles->log2_cols, 0);
tiles->max_height_sb = sb_rows >> tiles->min_log2_rows;
tiles->width = size_sb << seq_params->mib_size_log2;
tiles->width = AOMMIN(tiles->width, cm_mi_cols); if (tiles->cols > 1) {
tiles->min_inner_width = tiles->width;
}
} else { int max_tile_area_sb = (sb_rows * sb_cols); int widest_tile_sb = 1; int narrowest_inner_tile_sb = 65536;
tiles->log2_cols = tile_log2(1, tiles->cols); for (i = 0; i < tiles->cols; i++) { int size_sb = tiles->col_start_sb[i + 1] - tiles->col_start_sb[i];
widest_tile_sb = AOMMAX(widest_tile_sb, size_sb); // ignore the rightmost tile in frame for determining the narrowest if (i < tiles->cols - 1)
narrowest_inner_tile_sb = AOMMIN(narrowest_inner_tile_sb, size_sb);
} if (tiles->min_log2) {
max_tile_area_sb >>= (tiles->min_log2 + 1);
}
tiles->max_height_sb = AOMMAX(max_tile_area_sb / widest_tile_sb, 1); if (tiles->cols > 1) {
tiles->min_inner_width = narrowest_inner_tile_sb
<< seq_params->mib_size_log2;
}
}
}
void av1_calculate_tile_rows(const SequenceHeader *const seq_params, int cm_mi_rows, CommonTileParams *const tiles) { int sb_rows = CEIL_POWER_OF_TWO(cm_mi_rows, seq_params->mib_size_log2); int start_sb, size_sb, i;
// Section 7.3.1 of the AV1 spec says, on pages 200-201: // It is a requirement of bitstream conformance that the following conditions // are met: // ... // * TileHeight is equal to (use_128x128_superblock ? 128 : 64) for all // tiles (i.e. the tile is exactly one superblock high) // * TileWidth is identical for all tiles and is an integer multiple of // TileHeight (i.e. the tile is an integer number of superblocks wide) // ... bool av1_get_uniform_tile_size(const AV1_COMMON *cm, int *w, int *h) { const CommonTileParams *const tiles = &cm->tiles; if (tiles->uniform_spacing) {
*w = tiles->width;
*h = tiles->height;
} else { for (int i = 0; i < tiles->cols; ++i) { constint tile_width_sb =
tiles->col_start_sb[i + 1] - tiles->col_start_sb[i]; constint tile_w = tile_width_sb * cm->seq_params->mib_size; // ensure all tiles have same dimension if (i != 0 && tile_w != *w) { returnfalse;
}
*w = tile_w;
}
for (int i = 0; i < tiles->rows; ++i) { constint tile_height_sb =
tiles->row_start_sb[i + 1] - tiles->row_start_sb[i]; constint tile_h = tile_height_sb * cm->seq_params->mib_size; // ensure all tiles have same dimension if (i != 0 && tile_h != *h) { returnfalse;
}
*h = tile_h;
}
} returntrue;
}
int av1_is_min_tile_width_satisfied(const AV1_COMMON *cm) { // Disable check if there is a single tile col in the frame if (cm->tiles.cols == 1) return 1;
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.