/* * 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.
*/
#define ENC_MISMATCH_DEBUG 0 #define SETUP_TIME_OH_CONST 5 // Setup time overhead constant per worker #define JOB_DISP_TIME_OH_CONST 1 // Job dispatch time overhead per tile
staticinlinevoid write_uniform(aom_writer *w, int n, int v) { constint l = get_unsigned_bits(n); constint m = (1 << l) - n; if (l == 0) return; if (v < m) {
aom_write_literal(w, v, l - 1);
} else {
aom_write_literal(w, m + ((v - m) >> 1), l - 1);
aom_write_literal(w, (v - m) & 1, 1);
}
}
#if !CONFIG_REALTIME_ONLY staticinlinevoid loop_restoration_write_sb_coeffs( const AV1_COMMON *const cm, MACROBLOCKD *xd, int runit_idx,
aom_writer *const w, int plane, FRAME_COUNTS *counts); #endif
AV1_COMMON *const cm = &cpi->common; int cdf_num; const uint8_t pred = av1_get_spatial_seg_pred(
cm, xd, &cdf_num, cpi->cyclic_refresh->skip_over4x4); constint mi_row = xd->mi_row; constint mi_col = xd->mi_col;
if (skip_txfm) { // Still need to transmit tx size for intra blocks even if skip_txfm is // true. Changing segment_id may make the tx size become invalid, e.g // changing from lossless to lossy.
assert(is_inter_block(mbmi) || !cpi->enc_seg.has_lossless_segment);
set_spatial_segment_id(&cm->mi_params, cm->cur_frame->seg_map, mbmi->bsize,
mi_row, mi_col, pred);
set_spatial_segment_id(&cm->mi_params, cpi->enc_seg.map, mbmi->bsize,
mi_row, mi_col, pred); /* mbmi is read only but we need to update segment_id */
((MB_MODE_INFO *)mbmi)->segment_id = pred; return;
}
// If segment level coding of this signal is disabled... // or the segment allows multiple reference frame options if (segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) {
assert(!is_compound);
assert(mbmi->ref_frame[0] ==
get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME));
} elseif (segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP) ||
segfeature_active(&cm->seg, segment_id, SEG_LVL_GLOBALMV)) {
assert(!is_compound);
assert(mbmi->ref_frame[0] == LAST_FRAME);
} else { // does the feature use compound prediction or not // (if not specified at the frame/segment level) if (cm->current_frame.reference_mode == REFERENCE_MODE_SELECT) { if (is_comp_ref_allowed(mbmi->bsize))
aom_write_symbol(w, is_compound, av1_get_reference_mode_cdf(xd), 2);
} else {
assert((!is_compound) ==
(cm->current_frame.reference_mode == SINGLE_REFERENCE));
}
if (!av1_is_interp_needed(xd)) {
int_interpfilters filters = av1_broadcast_interp_filter(
av1_unswitchable_filter(cm->features.interp_filter));
assert(mbmi->interp_filters.as_int == filters.as_int);
(void)filters; return;
} if (cm->features.interp_filter == SWITCHABLE) { int dir; for (dir = 0; dir < 2; ++dir) { constint ctx = av1_get_pred_context_switchable_interp(xd, dir);
InterpFilter filter =
av1_extract_interp_filter(mbmi->interp_filters, dir);
aom_write_symbol(w, filter, ec_ctx->switchable_interp_cdf[ctx],
SWITCHABLE_FILTERS);
++td->interp_filter_selected[filter]; if (cm->seq_params->enable_dual_filter == 0) return;
}
}
}
// Transmit color values with delta encoding. Write the first value as // literal, and the deltas between each value and the previous one. "min_val" is // the smallest possible value of the deltas. staticinlinevoid delta_encode_palette_colors(constint *colors, int num, int bit_depth, int min_val,
aom_writer *w) { if (num <= 0) return;
assert(colors[0] < (1 << bit_depth));
aom_write_literal(w, colors[0], bit_depth); if (num == 1) return; int max_delta = 0; int deltas[PALETTE_MAX_SIZE];
memset(deltas, 0, sizeof(deltas)); for (int i = 1; i < num; ++i) {
assert(colors[i] < (1 << bit_depth)); constint delta = colors[i] - colors[i - 1];
deltas[i - 1] = delta;
assert(delta >= min_val); if (delta > max_delta) max_delta = delta;
} constint min_bits = bit_depth - 3; int bits = AOMMAX(av1_ceil_log2(max_delta + 1 - min_val), min_bits);
assert(bits <= bit_depth); int range = (1 << bit_depth) - colors[0] - min_val;
aom_write_literal(w, bits - min_bits, 2); for (int i = 0; i < num - 1; ++i) {
aom_write_literal(w, deltas[i] - min_val, bits);
range -= deltas[i];
bits = AOMMIN(bits, av1_ceil_log2(range));
}
}
// Transmit luma palette color values. First signal if each color in the color // cache is used. Those colors that are not in the cache are transmitted with // delta encoding. staticinlinevoid write_palette_colors_y(const MACROBLOCKD *const xd, const PALETTE_MODE_INFO *const pmi, int bit_depth, aom_writer *w) { constint n = pmi->palette_size[0];
uint16_t color_cache[2 * PALETTE_MAX_SIZE]; constint n_cache = av1_get_palette_cache(xd, 0, color_cache); int out_cache_colors[PALETTE_MAX_SIZE];
uint8_t cache_color_found[2 * PALETTE_MAX_SIZE]; constint n_out_cache =
av1_index_color_cache(color_cache, n_cache, pmi->palette_colors, n,
cache_color_found, out_cache_colors); int n_in_cache = 0; for (int i = 0; i < n_cache && n_in_cache < n; ++i) { constint found = cache_color_found[i];
aom_write_bit(w, found);
n_in_cache += found;
}
assert(n_in_cache + n_out_cache == n);
delta_encode_palette_colors(out_cache_colors, n_out_cache, bit_depth, 1, w);
}
// Write chroma palette color values. U channel is handled similarly to the luma // channel. For v channel, either use delta encoding or transmit raw values // directly, whichever costs less. staticinlinevoid write_palette_colors_uv(const MACROBLOCKD *const xd, const PALETTE_MODE_INFO *const pmi, int bit_depth, aom_writer *w) { constint n = pmi->palette_size[1]; const uint16_t *colors_u = pmi->palette_colors + PALETTE_MAX_SIZE; const uint16_t *colors_v = pmi->palette_colors + 2 * PALETTE_MAX_SIZE; // U channel colors.
uint16_t color_cache[2 * PALETTE_MAX_SIZE]; constint n_cache = av1_get_palette_cache(xd, 1, color_cache); int out_cache_colors[PALETTE_MAX_SIZE];
uint8_t cache_color_found[2 * PALETTE_MAX_SIZE]; constint n_out_cache = av1_index_color_cache(
color_cache, n_cache, colors_u, n, cache_color_found, out_cache_colors); int n_in_cache = 0; for (int i = 0; i < n_cache && n_in_cache < n; ++i) { constint found = cache_color_found[i];
aom_write_bit(w, found);
n_in_cache += found;
}
delta_encode_palette_colors(out_cache_colors, n_out_cache, bit_depth, 0, w);
// V channel colors. Don't use color cache as the colors are not sorted. constint max_val = 1 << bit_depth; int zero_count = 0, min_bits_v = 0; int bits_v =
av1_get_palette_delta_bits_v(pmi, bit_depth, &zero_count, &min_bits_v); constint rate_using_delta =
2 + bit_depth + (bits_v + 1) * (n - 1) - zero_count; constint rate_using_raw = bit_depth * n; if (rate_using_delta < rate_using_raw) { // delta encoding
assert(colors_v[0] < (1 << bit_depth));
aom_write_bit(w, 1);
aom_write_literal(w, bits_v - min_bits_v, 2);
aom_write_literal(w, colors_v[0], bit_depth); for (int i = 1; i < n; ++i) {
assert(colors_v[i] < (1 << bit_depth)); if (colors_v[i] == colors_v[i - 1]) { // No need to signal sign bit.
aom_write_literal(w, 0, bits_v); continue;
} constint delta = abs((int)colors_v[i] - colors_v[i - 1]); constint sign_bit = colors_v[i] < colors_v[i - 1]; if (delta <= max_val - delta) {
aom_write_literal(w, delta, bits_v);
aom_write_bit(w, sign_bit);
} else {
aom_write_literal(w, max_val - delta, bits_v);
aom_write_bit(w, !sign_bit);
}
}
} else { // Transmit raw values.
aom_write_bit(w, 0); for (int i = 0; i < n; ++i) {
assert(colors_v[i] < (1 << bit_depth));
aom_write_literal(w, colors_v[i], bit_depth);
}
}
}
staticinlinevoid write_cdef(AV1_COMMON *cm, MACROBLOCKD *const xd,
aom_writer *w, int skip) { if (cm->features.coded_lossless || cm->features.allow_intrabc) return;
// At the start of a superblock, mark that we haven't yet written CDEF // strengths for any of the CDEF units contained in this superblock. constint sb_mask = (cm->seq_params->mib_size - 1); constint mi_row_in_sb = (xd->mi_row & sb_mask); constint mi_col_in_sb = (xd->mi_col & sb_mask); if (mi_row_in_sb == 0 && mi_col_in_sb == 0) {
xd->cdef_transmitted[0] = xd->cdef_transmitted[1] =
xd->cdef_transmitted[2] = xd->cdef_transmitted[3] = false;
}
// CDEF unit size is 64x64 irrespective of the superblock size. constint cdef_size = 1 << (6 - MI_SIZE_LOG2);
// Find index of this CDEF unit in this superblock. constint index_mask = cdef_size; constint cdef_unit_row_in_sb = ((xd->mi_row & index_mask) != 0); constint cdef_unit_col_in_sb = ((xd->mi_col & index_mask) != 0); constint index = (cm->seq_params->sb_size == BLOCK_128X128)
? cdef_unit_col_in_sb + 2 * cdef_unit_row_in_sb
: 0;
// Write CDEF strength to the first non-skip coding block in this CDEF unit. if (!xd->cdef_transmitted[index] && !skip) { // CDEF strength for this CDEF unit needs to be stored in the MB_MODE_INFO // of the 1st block in this CDEF unit. constint first_block_mask = ~(cdef_size - 1); const CommonModeInfoParams *const mi_params = &cm->mi_params; constint grid_idx =
get_mi_grid_idx(mi_params, xd->mi_row & first_block_mask,
xd->mi_col & first_block_mask); const MB_MODE_INFO *const mbmi = mi_params->mi_grid_base[grid_idx];
aom_write_literal(w, mbmi->cdef_strength, cm->cdef_info.cdef_bits);
xd->cdef_transmitted[index] = true;
}
}
// If segment skip is not enabled code the mode. if (!segfeature_active(seg, segment_id, SEG_LVL_SKIP)) { if (is_inter_compound_mode(mode))
write_inter_compound_mode(xd, w, mode, mode_ctx); elseif (is_inter_singleref_mode(mode))
write_inter_mode(w, mode, ec_ctx, mode_ctx);
if (mbmi->ref_frame[1] != INTRA_FRAME) write_motion_mode(cm, xd, mbmi, w);
// First write idx to indicate current compound inter prediction mode group // Group A (0): dist_wtd_comp, compound_average // Group B (1): interintra, compound_diffwtd, wedge if (has_second_ref(mbmi)) { constint masked_compound_used = is_any_masked_compound_used(bsize) &&
cm->seq_params->enable_masked_compound;
if (frame_is_intra_only(cm)) {
write_mb_modes_kf(cpi, xd, td->mb.mbmi_ext_frame, w);
} else { // has_subpel_mv_component needs the ref frame buffers set up to look // up if they are scaled. has_subpel_mv_component is in turn needed by // write_switchable_interp_filter, which is called by pack_inter_mode_mvs.
set_ref_ptrs(cm, xd, m->ref_frame[0], m->ref_frame[1]);
write_modes_b(cpi, td, tile, w, tok, tok_end, this_mi_row, mi_col);
} break; case PARTITION_VERT_4: for (i = 0; i < 4; ++i) { int this_mi_col = mi_col + i * quarter_step; if (i > 0 && this_mi_col >= mi_params->mi_cols) break;
// Only write out the ref delta section if any of the elements // will signal a delta. staticbool is_mode_ref_delta_meaningful(AV1_COMMON *cm) { struct loopfilter *lf = &cm->lf; if (!lf->mode_ref_delta_update) { return 0;
} const RefCntBuffer *buf = get_primary_ref_frame_buf(cm);
int8_t last_ref_deltas[REF_FRAMES];
int8_t last_mode_deltas[MAX_MODE_LF_DELTAS]; if (buf == NULL) {
av1_set_default_ref_deltas(last_ref_deltas);
av1_set_default_mode_deltas(last_mode_deltas);
} else {
memcpy(last_ref_deltas, buf->ref_deltas, REF_FRAMES);
memcpy(last_mode_deltas, buf->mode_deltas, MAX_MODE_LF_DELTAS);
} for (int i = 0; i < REF_FRAMES; i++) { if (lf->ref_deltas[i] != last_ref_deltas[i]) { returntrue;
}
} for (int i = 0; i < MAX_MODE_LF_DELTAS; i++) { if (lf->mode_deltas[i] != last_mode_deltas[i]) { returntrue;
}
} returnfalse;
}
// Encode the loop filter level and type
aom_wb_write_literal(wb, lf->filter_level[0], 6);
aom_wb_write_literal(wb, lf->filter_level[1], 6); if (num_planes > 1) { if (lf->filter_level[0] || lf->filter_level[1]) {
aom_wb_write_literal(wb, lf->filter_level_u, 6);
aom_wb_write_literal(wb, lf->filter_level_v, 6);
}
}
aom_wb_write_literal(wb, lf->sharpness_level, 3);
aom_wb_write_bit(wb, lf->mode_ref_delta_enabled);
// Write out loop filter deltas applied at the MB level based on mode or // ref frame (if they are enabled), only if there is information to write. int meaningful = is_mode_ref_delta_meaningful(cm);
aom_wb_write_bit(wb, meaningful); if (!meaningful) { return;
}
const RefCntBuffer *buf = get_primary_ref_frame_buf(cm);
int8_t last_ref_deltas[REF_FRAMES];
int8_t last_mode_deltas[MAX_MODE_LF_DELTAS]; if (buf == NULL) {
av1_set_default_ref_deltas(last_ref_deltas);
av1_set_default_mode_deltas(last_mode_deltas);
} else {
memcpy(last_ref_deltas, buf->ref_deltas, REF_FRAMES);
memcpy(last_mode_deltas, buf->mode_deltas, MAX_MODE_LF_DELTAS);
} for (int i = 0; i < REF_FRAMES; i++) { constint delta = lf->ref_deltas[i]; constint changed = delta != last_ref_deltas[i];
aom_wb_write_bit(wb, changed); if (changed) aom_wb_write_inv_signed_literal(wb, delta, 6);
} for (int i = 0; i < MAX_MODE_LF_DELTAS; i++) { constint delta = lf->mode_deltas[i]; constint changed = delta != last_mode_deltas[i];
aom_wb_write_bit(wb, changed); if (changed) aom_wb_write_inv_signed_literal(wb, delta, 6);
}
}
staticinlinevoid encode_cdef(const AV1_COMMON *cm, struct aom_write_bit_buffer *wb) {
assert(!cm->features.coded_lossless); if (!cm->seq_params->enable_cdef) return; if (cm->features.allow_intrabc) return; constint num_planes = av1_num_planes(cm); int i;
aom_wb_write_literal(wb, cm->cdef_info.cdef_damping - 3, 2);
aom_wb_write_literal(wb, cm->cdef_info.cdef_bits, 2); for (i = 0; i < cm->cdef_info.nb_cdef_strengths; i++) {
aom_wb_write_literal(wb, cm->cdef_info.cdef_strengths[i],
CDEF_STRENGTH_BITS); if (num_planes > 1)
aom_wb_write_literal(wb, cm->cdef_info.cdef_uv_strengths[i],
CDEF_STRENGTH_BITS);
}
}
staticinlinevoid encode_segmentation(AV1_COMMON *cm, struct aom_write_bit_buffer *wb) { int i, j; struct segmentation *seg = &cm->seg;
aom_wb_write_bit(wb, seg->enabled); if (!seg->enabled) return;
// Write update flags if (cm->features.primary_ref_frame != PRIMARY_REF_NONE) {
aom_wb_write_bit(wb, seg->update_map); if (seg->update_map) aom_wb_write_bit(wb, seg->temporal_update);
aom_wb_write_bit(wb, seg->update_data);
}
// Segmentation data if (seg->update_data) { for (i = 0; i < MAX_SEGMENTS; i++) { for (j = 0; j < SEG_LVL_MAX; j++) { constint active = segfeature_active(seg, i, j);
aom_wb_write_bit(wb, active); if (active) { constint data_max = av1_seg_feature_data_max(j); constint data_min = -data_max; constint ubits = get_unsigned_bits(data_max); constint data = clamp(get_segdata(seg, i, j), data_min, data_max);
// Same function as write_uniform but writing to uncompresses header wb staticinlinevoid wb_write_uniform(struct aom_write_bit_buffer *wb, int n, int v) { constint l = get_unsigned_bits(n); constint m = (1 << l) - n; if (l == 0) return; if (v < m) {
aom_wb_write_literal(wb, v, l - 1);
} else {
aom_wb_write_literal(wb, m + ((v - m) >> 1), l - 1);
aom_wb_write_literal(wb, (v - m) & 1, 1);
}
}
staticinlinevoid write_tile_info_max_tile(const AV1_COMMON *const cm, struct aom_write_bit_buffer *wb) { int width_sb =
CEIL_POWER_OF_TWO(cm->mi_params.mi_cols, cm->seq_params->mib_size_log2); int height_sb =
CEIL_POWER_OF_TWO(cm->mi_params.mi_rows, cm->seq_params->mib_size_log2); int size_sb, i; const CommonTileParams *const tiles = &cm->tiles;
aom_wb_write_bit(wb, tiles->uniform_spacing);
if (tiles->uniform_spacing) { int ones = tiles->log2_cols - tiles->min_log2_cols; while (ones--) {
aom_wb_write_bit(wb, 1);
} if (tiles->log2_cols < tiles->max_log2_cols) {
aom_wb_write_bit(wb, 0);
}
// rows
ones = tiles->log2_rows - tiles->min_log2_rows; while (ones--) {
aom_wb_write_bit(wb, 1);
} if (tiles->log2_rows < tiles->max_log2_rows) {
aom_wb_write_bit(wb, 0);
}
} else { // Explicit tiles with configurable tile widths and heights // columns for (i = 0; i < tiles->cols; i++) {
size_sb = tiles->col_start_sb[i + 1] - tiles->col_start_sb[i];
wb_write_uniform(wb, AOMMIN(width_sb, tiles->max_width_sb), size_sb - 1);
width_sb -= size_sb;
}
assert(width_sb == 0);
*saved_wb = *wb; if (cm->tiles.rows * cm->tiles.cols > 1) { // tile id used for cdf update
aom_wb_write_literal(wb, 0, cm->tiles.log2_cols + cm->tiles.log2_rows); // Number of bytes in tile size - 1
aom_wb_write_literal(wb, 3, 2);
}
}
staticinlinevoid write_ext_tile_info(const AV1_COMMON *const cm, struct aom_write_bit_buffer *saved_wb, struct aom_write_bit_buffer *wb) { // This information is stored as a separate byte. int mod = wb->bit_offset % CHAR_BIT; if (mod > 0) aom_wb_write_literal(wb, 0, CHAR_BIT - mod);
assert(aom_wb_is_byte_aligned(wb));
*saved_wb = *wb; if (cm->tiles.rows * cm->tiles.cols > 1) { // Note that the last item in the uncompressed header is the data // describing tile configuration. // Number of bytes in tile column size - 1
aom_wb_write_literal(wb, 0, 2); // Number of bytes in tile size - 1
aom_wb_write_literal(wb, 0, 2);
}
}
// (TODO: yunqingwang) For now, only above tile is checked and used. // More candidates such as left tile can be added later. for (i = 0; i < 1; i++) { int row_offset = candidate_offset[0].row; int col_offset = candidate_offset[0].col; int row = tile_row - row_offset; int col = tile_col - col_offset; const uint8_t *tile_data;
TileBufferEnc *candidate;
// Read out tile-copy-mode bit: if ((tile_hdr >> 31) == 1) { // The candidate is a copy tile itself: the offset is stored in bits // 30 through 24 inclusive.
row_offset += (tile_hdr >> 24) & 0x7f;
row = tile_row - row_offset;
}
candidate = &tile_buffers[row][col];
if (row_offset >= 128 || candidate->size != cur_tile_size) continue;
tile_data = candidate->data + 4;
if (memcmp(tile_data, cur_tile_data, cur_tile_size) != 0) continue;
// Identical tile found
assert(row_offset > 0); return row_offset;
}
// Scaling functions parameters
aom_wb_write_literal(wb, pars->num_y_points, 4); // max 14 for (int i = 0; i < pars->num_y_points; i++) {
aom_wb_write_literal(wb, pars->scaling_points_y[i][0], 8);
aom_wb_write_literal(wb, pars->scaling_points_y[i][1], 8);
}
if (!cm->seq_params->monochrome) {
aom_wb_write_bit(wb, pars->chroma_scaling_from_luma);
} else {
assert(!pars->chroma_scaling_from_luma);
}
if (cm->seq_params->monochrome || pars->chroma_scaling_from_luma ||
((cm->seq_params->subsampling_x == 1) &&
(cm->seq_params->subsampling_y == 1) && (pars->num_y_points == 0))) {
assert(pars->num_cb_points == 0 && pars->num_cr_points == 0);
} else {
aom_wb_write_literal(wb, pars->num_cb_points, 4); // max 10 for (int i = 0; i < pars->num_cb_points; i++) {
aom_wb_write_literal(wb, pars->scaling_points_cb[i][0], 8);
aom_wb_write_literal(wb, pars->scaling_points_cb[i][1], 8);
}
aom_wb_write_literal(wb, pars->num_cr_points, 4); // max 10 for (int i = 0; i < pars->num_cr_points; i++) {
aom_wb_write_literal(wb, pars->scaling_points_cr[i][0], 8);
aom_wb_write_literal(wb, pars->scaling_points_cr[i][1], 8);
}
}
aom_wb_write_literal(wb, pars->scaling_shift - 8, 2); // 8 + value
// AR coefficients // Only sent if the corresponsing scaling function has // more than 0 points
aom_wb_write_literal(wb, pars->ar_coeff_lag, 2);
int num_pos_luma = 2 * pars->ar_coeff_lag * (pars->ar_coeff_lag + 1); int num_pos_chroma = num_pos_luma; if (pars->num_y_points > 0) ++num_pos_chroma;
if (pars->num_y_points) for (int i = 0; i < num_pos_luma; i++)
aom_wb_write_literal(wb, pars->ar_coeffs_y[i] + 128, 8);
if (pars->num_cb_points || pars->chroma_scaling_from_luma) for (int i = 0; i < num_pos_chroma; i++)
aom_wb_write_literal(wb, pars->ar_coeffs_cb[i] + 128, 8);
if (pars->num_cr_points || pars->chroma_scaling_from_luma) for (int i = 0; i < num_pos_chroma; i++)
aom_wb_write_literal(wb, pars->ar_coeffs_cr[i] + 128, 8);
aom_wb_write_literal(wb, pars->ar_coeff_shift - 6, 2); // 8 + value
if (!seq_params->reduced_still_picture_hdr) {
aom_wb_write_bit(wb, seq_params->frame_id_numbers_present_flag); if (seq_params->frame_id_numbers_present_flag) { // We must always have delta_frame_id_length < frame_id_length, // in order for a frame to be referenced with a unique delta. // Avoid wasting bits by using a coding that enforces this restriction.
aom_wb_write_literal(wb, seq_params->delta_frame_id_length - 2, 4);
aom_wb_write_literal(
wb,
seq_params->frame_id_length - seq_params->delta_frame_id_length - 1,
3);
}
}
staticinlinevoid write_global_motion_params( const WarpedMotionParams *params, const WarpedMotionParams *ref_params, struct aom_write_bit_buffer *wb, int allow_hp) { const TransformationType type = params->wmtype;
// As a workaround for an AV1 spec bug, we avoid choosing TRANSLATION // type models. Check here that we don't accidentally pick one somehow. // See comments in gm_get_motion_vector() for details on the bug we're // working around here
assert(type != TRANSLATION);
aom_wb_write_bit(wb, type != IDENTITY); if (type != IDENTITY) {
aom_wb_write_bit(wb, type == ROTZOOM); if (type != ROTZOOM) aom_wb_write_bit(wb, type == TRANSLATION);
}
staticinlinevoid write_global_motion(AV1_COMP *cpi, struct aom_write_bit_buffer *wb) {
AV1_COMMON *const cm = &cpi->common; int frame; for (frame = LAST_FRAME; frame <= ALTREF_FRAME; ++frame) { const WarpedMotionParams *ref_params =
cm->prev_frame ? &cm->prev_frame->global_motion[frame]
: &default_warp_params;
write_global_motion_params(&cm->global_motion[frame], ref_params, wb,
cm->features.allow_high_precision_mv); // TODO(sarahparker, debargha): The logic in the commented out code below // does not work currently and causes mismatches when resize is on. // Fix it before turning the optimization back on. /* YV12_BUFFER_CONFIG *ref_buf = get_ref_frame_yv12_buf(cpi, frame); if (cpi->source->y_crop_width == ref_buf->y_crop_width && cpi->source->y_crop_height == ref_buf->y_crop_height) { write_global_motion_params(&cm->global_motion[frame], &cm->prev_frame->global_motion[frame], wb, cm->features.allow_high_precision_mv); } else { assert(cm->global_motion[frame].wmtype == IDENTITY && "Invalid warp type for frames of different resolutions"); }
*/ /* printf("Frame %d/%d: Enc Ref %d: %d %d %d %d\n", cm->current_frame.frame_number, cm->show_frame, frame, cm->global_motion[frame].wmmat[0], cm->global_motion[frame].wmmat[1], cm->global_motion[frame].wmmat[2], cm->global_motion[frame].wmmat[3]);
*/
}
}
staticint check_frame_refs_short_signaling(AV1_COMMON *const cm, bool enable_ref_short_signaling) { // In rtc case when res < 360p and speed >= 9, we turn on // frame_refs_short_signaling if it won't break the decoder. if (enable_ref_short_signaling) { constint gld_map_idx = get_ref_frame_map_idx(cm, GOLDEN_FRAME); constint base =
1 << (cm->seq_params->order_hint_info.order_hint_bits_minus_1 + 1);
// If current frame and GOLDEN frame are in the same order_hint group, and // they are not far apart (i.e., > 64 frames), then return 1. if (order_hint_group_cur == order_hint_group_gld && relative_dist >= 0 &&
relative_dist <= 64) { return 1;
} return 0;
}
// Check whether all references are distinct frames. const RefCntBuffer *seen_bufs[INTER_REFS_PER_FRAME] = { NULL }; int num_refs = 0; for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) { const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame); if (buf != NULL) { int seen = 0; for (int i = 0; i < num_refs; i++) { if (seen_bufs[i] == buf) {
seen = 1; break;
}
} if (!seen) seen_bufs[num_refs++] = buf;
}
}
// We only turn on frame_refs_short_signaling when all references are // distinct. if (num_refs < INTER_REFS_PER_FRAME) { // It indicates that there exist more than one reference frame pointing to // the same reference buffer, i.e. two or more references are duplicate. return 0;
}
// Check whether the encoder side ref frame choices are aligned with that to // be derived at the decoder side. int remapped_ref_idx_decoder[REF_FRAMES];
// Set up the frame refs mapping indexes according to the // frame_refs_short_signaling policy.
av1_set_frame_refs(cm, remapped_ref_idx_decoder, lst_map_idx, gld_map_idx);
// We only turn on frame_refs_short_signaling when the encoder side decision // on ref frames is identical to that at the decoder side. int frame_refs_short_signaling = 1; for (int ref_idx = 0; ref_idx < INTER_REFS_PER_FRAME; ++ref_idx) { // Compare the buffer index between two reference frames indexed // respectively by the encoder and the decoder side decisions.
RefCntBuffer *ref_frame_buf_new = NULL; if (remapped_ref_idx_decoder[ref_idx] != INVALID_IDX) {
ref_frame_buf_new = cm->ref_frame_map[remapped_ref_idx_decoder[ref_idx]];
} if (get_ref_frame_buf(cm, LAST_FRAME + ref_idx) != ref_frame_buf_new) {
frame_refs_short_signaling = 0; break;
}
}
if (seq_params->reduced_still_picture_hdr) {
assert(cm->superres_upscaled_width == seq_params->max_frame_width &&
cm->superres_upscaled_height == seq_params->max_frame_height);
} else { if (seq_params->frame_id_numbers_present_flag) { int frame_id_len = seq_params->frame_id_length;
aom_wb_write_literal(wb, cm->current_frame_id, frame_id_len);
}
if (cm->superres_upscaled_width > seq_params->max_frame_width ||
cm->superres_upscaled_height > seq_params->max_frame_height) {
aom_internal_error(cm->error, AOM_CODEC_UNSUP_BITSTREAM, "Frame dimensions are larger than the maximum values");
}
// Shown keyframes and switch-frames automatically refreshes all reference // frames. For all other frame types, we need to write refresh_frame_flags. if ((current_frame->frame_type == KEY_FRAME && !cm->show_frame) ||
current_frame->frame_type == INTER_FRAME ||
current_frame->frame_type == INTRA_ONLY_FRAME)
aom_wb_write_literal(wb, current_frame->refresh_frame_flags, REF_FRAMES);
if (!frame_is_intra_only(cm) || current_frame->refresh_frame_flags != 0xff) { // Write all ref frame order hints if error_resilient_mode == 1 if (features->error_resilient_mode &&
seq_params->order_hint_info.enable_order_hint) { for (int ref_idx = 0; ref_idx < REF_FRAMES; ref_idx++) {
aom_wb_write_literal(
wb, cm->ref_frame_map[ref_idx]->order_hint,
seq_params->order_hint_info.order_hint_bits_minus_1 + 1);
}
}
}
if (current_frame->frame_refs_short_signaling) { // In rtc case when cpi->sf.rt_sf.enable_ref_short_signaling is true, // we turn on frame_refs_short_signaling when the current frame and // golden frame are in the same order_hint group, and their relative // distance is <= 64 (in order to be decodable).
// For other cases, an example solution for encoder-side // implementation on frame_refs_short_signaling is also provided in // this function, where frame_refs_short_signaling is only turned on // when the encoder side decision on ref frames is identical to that // at the decoder side.
current_frame->frame_refs_short_signaling =
check_frame_refs_short_signaling(
cm, cpi->sf.rt_sf.enable_ref_short_signaling);
}
if (seq_params->order_hint_info.enable_order_hint)
aom_wb_write_bit(wb, current_frame->frame_refs_short_signaling);
if (!frame_is_intra_only(cm)) write_global_motion(cpi, wb);
if (seq_params->film_grain_params_present &&
(cm->show_frame || cm->showable_frame))
write_film_grain_params(cpi, wb);
if (cm->tiles.large_scale) write_ext_tile_info(cm, saved_wb, wb);
}
staticint choose_size_bytes(uint32_t size, int spare_msbs) { // Choose the number of bytes required to represent size, without // using the 'spare_msbs' number of most significant bits.
// Make sure we will fit in 4 bytes to start with.. if (spare_msbs > 0 && size >> (32 - spare_msbs) != 0) return -1;
staticint remux_tiles(const CommonTileParams *const tiles, uint8_t *dst, const uint32_t data_size, const uint32_t max_tile_size, const uint32_t max_tile_col_size, int *const tile_size_bytes, int *const tile_col_size_bytes) { // Choose the tile size bytes (tsb) and tile column size bytes (tcsb) int tsb; int tcsb;
if (tiles->large_scale) { // The top bit in the tile size field indicates tile copy mode, so we // have 1 less bit to code the tile size
tsb = choose_size_bytes(max_tile_size, 1);
tcsb = choose_size_bytes(max_tile_col_size, 0);
} else {
tsb = choose_size_bytes(max_tile_size, 0);
tcsb = 4; // This is ignored
(void)max_tile_col_size;
}
if (tiles->large_scale) { int tile_row; int tile_col;
for (tile_col = 0; tile_col < tiles->cols; tile_col++) { // All but the last column has a column header if (tile_col < tiles->cols - 1) {
uint32_t tile_col_size = mem_get_le32(dst + rpos);
rpos += 4;
// Adjust the tile column size by the number of bytes removed // from the tile size fields.
tile_col_size -= (4 - tsb) * tiles->rows;
for (tile_row = 0; tile_row < tiles->rows; tile_row++) { // All, including the last row has a header
uint32_t tile_header = mem_get_le32(dst + rpos);
rpos += 4;
// If this is a copy tile, we need to shift the MSB to the // top bit of the new width, and there is no data to copy. if (tile_header >> 31 != 0) { if (tsb < 4) tile_header >>= 32 - 8 * tsb;
mem_put_varsize(dst + wpos, tsb, tile_header);
wpos += tsb;
} else {
mem_put_varsize(dst + wpos, tsb, tile_header);
wpos += tsb;
// The AV1 spec draft version (as of git commit 5e04f) // has the following requirements on the OBU extension header: // // 6.4.1. General sequence header OBU semantics: // If operating_point_idc[ op ] is not equal to 0 for any value of op from 0 // to operating_points_cnt_minus_1, it is a requirement of bitstream // conformance that obu_extension_flag is equal to 1 for all layer-specific // OBUs in the coded video sequence. // (...) // It is a requirement of bitstream conformance that if OperatingPointIdc // is equal to 0, then obu_extension_flag is equal to 0 for all OBUs that // follow this sequence header until the next sequence header. // // Set obu_extension_flag to satisfy these requirements. constint obu_extension_flag =
has_nonzero_operating_point_idc && is_layer_specific_obu; constint obu_has_size_field = 1;
// Still picture or not
aom_wb_write_bit(&wb, seq_params->still_picture);
assert(IMPLIES(!seq_params->still_picture,
!seq_params->reduced_still_picture_hdr)); // whether to use reduced still picture header
aom_wb_write_bit(&wb, seq_params->reduced_still_picture_hdr);
if (seq_params->reduced_still_picture_hdr) {
assert(seq_params->timing_info_present == 0);
assert(seq_params->decoder_model_info_present_flag == 0);
assert(seq_params->display_model_info_present_flag == 0);
write_bitstream_level(seq_params->seq_level_idx[0], &wb);
} else {
aom_wb_write_bit(
&wb, seq_params->timing_info_present); // timing info present flag
if (seq_params->timing_info_present) { // timing_info
write_timing_info_header(&seq_params->timing_info, &wb);
aom_wb_write_bit(&wb, seq_params->decoder_model_info_present_flag); if (seq_params->decoder_model_info_present_flag) {
write_decoder_model_info(&seq_params->decoder_model_info, &wb);
}
}
aom_wb_write_bit(&wb, seq_params->display_model_info_present_flag);
aom_wb_write_literal(&wb, seq_params->operating_points_cnt_minus_1,
OP_POINTS_CNT_MINUS_1_BITS); int i; for (i = 0; i < seq_params->operating_points_cnt_minus_1 + 1; i++) {
aom_wb_write_literal(&wb, seq_params->operating_point_idc[i],
OP_POINTS_IDC_BITS);
write_bitstream_level(seq_params->seq_level_idx[i], &wb); if (seq_params->seq_level_idx[i] >= SEQ_LEVEL_4_0)
aom_wb_write_bit(&wb, seq_params->tier[i]); if (seq_params->decoder_model_info_present_flag) {
aom_wb_write_bit(
&wb, seq_params->op_params[i].decoder_model_param_present_flag); if (seq_params->op_params[i].decoder_model_param_present_flag) {
write_dec_model_op_parameters(
&seq_params->op_params[i],
seq_params->decoder_model_info
.encoder_decoder_buffer_delay_length,
&wb);
}
} if (seq_params->display_model_info_present_flag) {
aom_wb_write_bit(
&wb, seq_params->op_params[i].display_model_param_present_flag); if (seq_params->op_params[i].display_model_param_present_flag) {
assert(seq_params->op_params[i].initial_display_delay >= 1);
assert(seq_params->op_params[i].initial_display_delay <= 10);
aom_wb_write_literal(
&wb, seq_params->op_params[i].initial_display_delay - 1, 4);
}
}
}
}
write_sequence_header(seq_params, &wb);
// Initialize OBU header for large scale tile case. static uint32_t init_large_scale_tile_obu_header(
AV1_COMP *const cpi, uint8_t **data, struct aom_write_bit_buffer *saved_wb,
uint8_t obu_extension_header, LargeTileFrameOBU *lst_obu) {
AV1LevelParams *const level_params = &cpi->ppi->level_params;
CurrentFrame *const current_frame = &cpi->common.current_frame; // For large_scale_tile case, we always have only one tile group, so it can // be written as an OBU_FRAME. const OBU_TYPE obu_type = OBU_FRAME;
lst_obu->tg_hdr_size = av1_write_obu_header(
level_params, &cpi->frame_header_count, obu_type,
cpi->common.seq_params->has_nonzero_operating_point_idc, /*is_layer_specific_obu=*/true, obu_extension_header, *data);
*data += lst_obu->tg_hdr_size;
// Write total buffer size and related information into the OBU header for large // scale tile case. staticvoid write_large_scale_tile_obu_size( const CommonTileParams *const tiles, uint8_t *const dst, uint8_t *data, struct aom_write_bit_buffer *saved_wb, LargeTileFrameOBU *const lst_obu, int have_tiles, uint32_t *total_size, int max_tile_size, int max_tile_col_size) { int tile_size_bytes = 0; int tile_col_size_bytes = 0; if (have_tiles) {
*total_size = remux_tiles(
tiles, data, *total_size - lst_obu->frame_header_size, max_tile_size,
max_tile_col_size, &tile_size_bytes, &tile_col_size_bytes);
*total_size += lst_obu->frame_header_size;
}
// In EXT_TILE case, only use 1 tile group. Follow the obu syntax, write // current tile group size before tile data(include tile column header). // Tile group size doesn't include the bytes storing tg size.
*total_size += lst_obu->tg_hdr_size; const uint32_t obu_payload_size = *total_size - lst_obu->tg_hdr_size; const size_t length_field_size =
obu_memmove_unsafe(lst_obu->tg_hdr_size, obu_payload_size, dst); if (av1_write_uleb_obu_size_unsafe(
obu_payload_size, dst + lst_obu->tg_hdr_size) != AOM_CODEC_OK)
assert(0);
// Now fill in the gaps in the uncompressed header. if (have_tiles) {
assert(tile_col_size_bytes >= 1 && tile_col_size_bytes <= 4);
aom_wb_overwrite_literal(saved_wb, tile_col_size_bytes - 1, 2);
// Store information on each large scale tile in the OBU header. staticvoid write_large_scale_tile_obu(
AV1_COMP *const cpi, uint8_t *const dst, LargeTileFrameOBU *const lst_obu, int *const largest_tile_id, uint32_t *total_size, constint have_tiles, unsignedint *const max_tile_size, unsignedint *const max_tile_col_size) {
AV1_COMMON *const cm = &cpi->common; const CommonTileParams *const tiles = &cm->tiles;
// Is CONFIG_EXT_TILE = 1, every tile in the row has a header, // even for the last one, unless no tiling is used at all.
*total_size += data_offset;
cpi->td.mb.e_mbd.tile_ctx = &this_tile->tctx;
mode_bc.allow_update_cdf = !tiles->large_scale;
mode_bc.allow_update_cdf =
mode_bc.allow_update_cdf && !cm->features.disable_cdf_update;
aom_start_encode(&mode_bc, buf->data + data_offset);
write_modes(cpi, &cpi->td, &tile_info, &mode_bc, tile_row, tile_col); if (aom_stop_encode(&mode_bc) < 0) {
aom_internal_error(cm->error, AOM_CODEC_ERROR, "Error writing modes");
}
tile_size = mode_bc.pos;
buf->size = tile_size;
// Record the maximum tile size we see, so we can compact headers later. if (tile_size > *max_tile_size) {
*max_tile_size = tile_size;
*largest_tile_id = tile_cols * tile_row + tile_col;
}
if (have_tiles) { // tile header: size of this tile, or copy offset
uint32_t tile_header = tile_size - AV1_MIN_TILE_SIZE_BYTES; constint tile_copy_mode =
((AOMMAX(tiles->width, tiles->height) << MI_SIZE_LOG2) <= 256) ? 1
: 0;
// If tile_copy_mode = 1, check if this tile is a copy tile. // Very low chances to have copy tiles on the key frames, so don't // search on key frames to reduce unnecessary search. if (cm->current_frame.frame_type != KEY_FRAME && tile_copy_mode) { constint identical_tile_offset =
find_identical_tile(tile_row, tile_col, tile_buffers);
// Indicate a copy-tile by setting the most significant bit. // The row-offset to copy from is stored in the highest byte. // remux_tiles will move these around later if (identical_tile_offset > 0) {
tile_size = 0;
tile_header = identical_tile_offset | 0x80;
tile_header <<= 24;
}
}
// Record the maximum tile column size we see.
*max_tile_col_size = AOMMAX(*max_tile_col_size, col_size);
}
}
av1_accumulate_pack_bs_thread_data(cpi, &cpi->td);
}
// Packs information in the obu header for large scale tiles. staticinline uint32_t pack_large_scale_tiles_in_tg_obus(
AV1_COMP *const cpi, uint8_t *const dst, struct aom_write_bit_buffer *saved_wb, uint8_t obu_extension_header, int *const largest_tile_id) {
AV1_COMMON *const cm = &cpi->common; const CommonTileParams *const tiles = &cm->tiles;
uint32_t total_size = 0; unsignedint max_tile_size = 0; unsignedint max_tile_col_size = 0; constint have_tiles = tiles->cols * tiles->rows > 1;
uint8_t *data = dst;
// Write Tile group, frame and OBU header // A new tile group begins at this tile. Write the obu header and // tile group header const OBU_TYPE obu_type = (cpi->num_tg == 1) ? OBU_FRAME : OBU_TILE_GROUP;
*curr_tg_hdr_size = av1_write_obu_header(
&cpi->ppi->level_params, &cpi->frame_header_count, obu_type,
cm->seq_params->has_nonzero_operating_point_idc, /*is_layer_specific_obu=*/true, pack_bs_params->obu_extn_header,
pack_bs_params->tile_data_curr);
pack_bs_params->obu_header_size = *curr_tg_hdr_size;
// Write tile size if (!pack_bs_params->is_last_tile_in_tg) { // size of this tile
mem_put_le32(pack_bs_params->buf.data, tile_size - AV1_MIN_TILE_SIZE_BYTES);
}
}
void av1_write_last_tile_info(
AV1_COMP *const cpi, const FrameHeaderInfo *fh_info, struct aom_write_bit_buffer *saved_wb, size_t *curr_tg_data_size,
uint8_t *curr_tg_start, uint32_t *const total_size,
uint8_t **tile_data_start, int *const largest_tile_id, int *const is_first_tg, uint32_t obu_header_size, uint8_t obu_extn_header) { // write current tile group size const size_t obu_payload_size = *curr_tg_data_size - obu_header_size; const size_t length_field_size =
obu_memmove_unsafe(obu_header_size, obu_payload_size, curr_tg_start); if (av1_write_uleb_obu_size_unsafe(
obu_payload_size, curr_tg_start + obu_header_size) != AOM_CODEC_OK) {
aom_internal_error(cpi->common.error, AOM_CODEC_ERROR, "av1_write_last_tile_info: output buffer full");
}
*curr_tg_data_size += length_field_size;
*total_size += (uint32_t)length_field_size;
*tile_data_start += length_field_size; if (cpi->num_tg == 1) { // if this tg is combined with the frame header then update saved // frame header base offset according to length field size
saved_wb->bit_buffer += length_field_size;
}
if (!(*is_first_tg) && cpi->common.features.error_resilient_mode) { // Make room for a duplicate Frame Header OBU.
memmove(curr_tg_start + fh_info->total_length, curr_tg_start,
*curr_tg_data_size);
// Insert a copy of the Frame Header OBU.
memcpy(curr_tg_start, fh_info->frame_header, fh_info->total_length);
// Force context update tile to be the first tile in error // resilient mode as the duplicate frame headers will have // context_update_tile_id set to 0
*largest_tile_id = 0;
// Rewrite the OBU header to change the OBU type to Redundant Frame // Header.
av1_write_obu_header(
&cpi->ppi->level_params, &cpi->frame_header_count,
OBU_REDUNDANT_FRAME_HEADER,
cpi->common.seq_params->has_nonzero_operating_point_idc, /*is_layer_specific_obu=*/true, obu_extn_header,
&curr_tg_start[fh_info->obu_header_byte_offset]);
// Write total buffer size and related information into the OBU header for // default tile case. staticvoid write_tile_obu_size(AV1_COMP *const cpi, uint8_t *const dst, struct aom_write_bit_buffer *saved_wb, int largest_tile_id, uint32_t *const total_size, unsignedint max_tile_size,
uint32_t obu_header_size,
uint8_t *tile_data_start) { const CommonTileParams *const tiles = &cpi->common.tiles;
// Fill in context_update_tile_id indicating the tile to use for the // cdf update. The encoder currently sets it to the largest tile // (but is up to the encoder)
aom_wb_overwrite_literal(saved_wb, largest_tile_id,
(tiles->log2_cols + tiles->log2_rows)); // If more than one tile group. tile_size_bytes takes the default value 4 // and does not need to be set. For a single tile group it is set in the // section below. if (cpi->num_tg != 1) return; int tile_size_bytes = 4, unused; const uint32_t tile_data_offset = (uint32_t)(tile_data_start - dst); const uint32_t tile_data_size = *total_size - tile_data_offset;
// Update the OBU length if remux_tiles() reduced the size.
uint64_t payload_size;
size_t length_field_size; int res =
aom_uleb_decode(dst + obu_header_size, *total_size - obu_header_size,
&payload_size, &length_field_size);
assert(res == 0);
(void)res;
// As per the experiments, single-thread bitstream packing is better for // frames with a smaller bitstream size. This behavior is due to setup time // overhead of multithread function would be more than that of time required // to pack the smaller bitstream of such frames. This function computes the // number of required number of workers based on setup time overhead and job // dispatch time overhead for given tiles and available workers. staticint calc_pack_bs_mt_workers(const TileDataEnc *tile_data, int num_tiles, int avail_workers, bool pack_bs_mt_enabled) { if (!pack_bs_mt_enabled) return 1;
// If no non-zero delta_q has been used, reset delta_q_present_flag if (cm->delta_q_info.delta_q_present_flag && cpi->deltaq_used == 0) {
cm->delta_q_info.delta_q_present_flag = 0;
}
// write metadata obus before the frame obu that has the show_frame flag set if (cm->show_frame) { const size_t bytes_written = av1_write_metadata_array(cpi, data, data_size);
data += bytes_written;
data_size -= bytes_written;
}
constint write_frame_header =
(cpi->num_tg > 1 || encode_show_existing_frame(cm)); struct aom_write_bit_buffer saved_wb = { NULL, 0 };
size_t length_field = 0; if (write_frame_header) { // Write Frame Header OBU.
fh_info.frame_header = data; // OBU header is either one or two bytes. if (data_size < 2) { return AOM_CODEC_ERROR;
}
obu_header_size = av1_write_obu_header(
level_params, &cpi->frame_header_count, OBU_FRAME_HEADER,
cm->seq_params->has_nonzero_operating_point_idc, /*is_layer_specific_obu=*/true, obu_extension_header, data); // TODO: bug 42302568 - Pass data_size - obu_header_size to // write_frame_header_obu().
obu_payload_size = write_frame_header_obu(cpi, &cpi->td.mb.e_mbd, &saved_wb,
data + obu_header_size, 1);
length_field =
obu_memmove(obu_header_size, obu_payload_size, data, data_size); if (length_field == 0) { return AOM_CODEC_ERROR;
} if (av1_write_uleb_obu_size(obu_payload_size, data + obu_header_size,
length_field) != AOM_CODEC_OK) { return AOM_CODEC_ERROR;
}
fh_info.obu_header_byte_offset = 0;
fh_info.total_length = obu_header_size + length_field + obu_payload_size; // Make sure it is safe to cast fh_info.total_length to uint32_t. if (fh_info.total_length > UINT32_MAX) { return AOM_CODEC_ERROR;
}
data += fh_info.total_length;
data_size -= fh_info.total_length;
}
if (!encode_show_existing_frame(cm)) { // Since length_field is determined adaptively after frame header // encoding, saved_wb must be adjusted accordingly. if (saved_wb.bit_buffer != NULL) {
saved_wb.bit_buffer += length_field;
}
// Each tile group obu will be preceded by 4-byte size of the tile group // obu const size_t bytes_written =
write_tiles_in_tg_obus(cpi, data, data_size, &saved_wb,
obu_extension_header, &fh_info, largest_tile_id);
data += bytes_written;
data_size -= bytes_written;
}
*size = data - dst;
(void)data_size; return AOM_CODEC_OK;
}
Messung V0.5 in Prozent
¤ 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.0.112Bemerkung:
(vorverarbeitet am 2026-04-28)
¤
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.