From 68569dee1416593955c1570d638b3d9250b33012 Mon Sep 17 00:00:00 2001 From: trav90 Date: Mon, 15 Oct 2018 21:45:30 -0500 Subject: Import aom library This is the reference implementation for the Alliance for Open Media's av1 video code. The commit used was 4d668d7feb1f8abd809d1bca0418570a7f142a36. --- third_party/aom/av1/common/tile_common.h | 59 ++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 third_party/aom/av1/common/tile_common.h (limited to 'third_party/aom/av1/common/tile_common.h') diff --git a/third_party/aom/av1/common/tile_common.h b/third_party/aom/av1/common/tile_common.h new file mode 100644 index 000000000..617dda202 --- /dev/null +++ b/third_party/aom/av1/common/tile_common.h @@ -0,0 +1,59 @@ +/* + * 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. + */ + +#ifndef AV1_COMMON_TILE_COMMON_H_ +#define AV1_COMMON_TILE_COMMON_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "./aom_config.h" + +struct AV1Common; + +#if CONFIG_TILE_GROUPS +#define DEFAULT_MAX_NUM_TG 1 +#endif + +typedef struct TileInfo { + int mi_row_start, mi_row_end; + int mi_col_start, mi_col_end; + int tg_horz_boundary; +} TileInfo; + +// initializes 'tile->mi_(row|col)_(start|end)' for (row, col) based on +// 'cm->log2_tile_(rows|cols)' & 'cm->mi_(rows|cols)' +void av1_tile_init(TileInfo *tile, const struct AV1Common *cm, int row, + int col); + +void av1_tile_set_row(TileInfo *tile, const struct AV1Common *cm, int row); +void av1_tile_set_col(TileInfo *tile, const struct AV1Common *cm, int col); +#if CONFIG_DEPENDENT_HORZTILES && CONFIG_TILE_GROUPS +void av1_tile_set_tg_boundary(TileInfo *tile, const struct AV1Common *cm, + int row, int col); +#endif +void av1_get_tile_n_bits(int mi_cols, int *min_log2_tile_cols, + int *max_log2_tile_cols); + +void av1_update_boundary_info(const struct AV1Common *cm, + const TileInfo *const tile_info, int mi_row, + int mi_col); + +#if CONFIG_LOOPFILTERING_ACROSS_TILES +int av1_disable_loopfilter_on_tile_boundary(const struct AV1Common *cm); +#endif // CONFIG_LOOPFILTERING_ACROSS_TILES + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // AV1_COMMON_TILE_COMMON_H_ -- cgit v1.2.3 From df9477dfa60ebb5d31bc142e58ce46535c17abce Mon Sep 17 00:00:00 2001 From: trav90 Date: Wed, 17 Oct 2018 05:59:08 -0500 Subject: Update aom to slightly newer commit ID --- third_party/aom/av1/common/tile_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'third_party/aom/av1/common/tile_common.h') diff --git a/third_party/aom/av1/common/tile_common.h b/third_party/aom/av1/common/tile_common.h index 617dda202..e34ee7ce8 100644 --- a/third_party/aom/av1/common/tile_common.h +++ b/third_party/aom/av1/common/tile_common.h @@ -38,7 +38,7 @@ void av1_tile_init(TileInfo *tile, const struct AV1Common *cm, int row, void av1_tile_set_row(TileInfo *tile, const struct AV1Common *cm, int row); void av1_tile_set_col(TileInfo *tile, const struct AV1Common *cm, int col); #if CONFIG_DEPENDENT_HORZTILES && CONFIG_TILE_GROUPS -void av1_tile_set_tg_boundary(TileInfo *tile, const struct AV1Common *cm, +void av1_tile_set_tg_boundary(TileInfo *tile, const struct AV1Common *const cm, int row, int col); #endif void av1_get_tile_n_bits(int mi_cols, int *min_log2_tile_cols, -- cgit v1.2.3 From 7369c7d7a5eed32963d8af37658286617919f91c Mon Sep 17 00:00:00 2001 From: trav90 Date: Thu, 18 Oct 2018 06:04:57 -0500 Subject: Update aom to commit id f5bdeac22930ff4c6b219be49c843db35970b918 --- third_party/aom/av1/common/tile_common.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'third_party/aom/av1/common/tile_common.h') diff --git a/third_party/aom/av1/common/tile_common.h b/third_party/aom/av1/common/tile_common.h index e34ee7ce8..e5b8a0b82 100644 --- a/third_party/aom/av1/common/tile_common.h +++ b/third_party/aom/av1/common/tile_common.h @@ -20,9 +20,7 @@ extern "C" { struct AV1Common; -#if CONFIG_TILE_GROUPS #define DEFAULT_MAX_NUM_TG 1 -#endif typedef struct TileInfo { int mi_row_start, mi_row_end; @@ -37,16 +35,16 @@ void av1_tile_init(TileInfo *tile, const struct AV1Common *cm, int row, void av1_tile_set_row(TileInfo *tile, const struct AV1Common *cm, int row); void av1_tile_set_col(TileInfo *tile, const struct AV1Common *cm, int col); -#if CONFIG_DEPENDENT_HORZTILES && CONFIG_TILE_GROUPS +#if CONFIG_DEPENDENT_HORZTILES void av1_tile_set_tg_boundary(TileInfo *tile, const struct AV1Common *const cm, int row, int col); #endif void av1_get_tile_n_bits(int mi_cols, int *min_log2_tile_cols, int *max_log2_tile_cols); -void av1_update_boundary_info(const struct AV1Common *cm, - const TileInfo *const tile_info, int mi_row, - int mi_col); +void av1_setup_frame_boundary_info(const struct AV1Common *const cm); +void av1_setup_across_tile_boundary_info(const struct AV1Common *const cm, + const TileInfo *const tile_info); #if CONFIG_LOOPFILTERING_ACROSS_TILES int av1_disable_loopfilter_on_tile_boundary(const struct AV1Common *cm); -- cgit v1.2.3 From ec910d81405c736a4490383a250299a7837c2e64 Mon Sep 17 00:00:00 2001 From: trav90 Date: Thu, 18 Oct 2018 21:53:44 -0500 Subject: Update aom to commit id e87fb2378f01103d5d6e477a4ef6892dc714e614 --- third_party/aom/av1/common/tile_common.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'third_party/aom/av1/common/tile_common.h') diff --git a/third_party/aom/av1/common/tile_common.h b/third_party/aom/av1/common/tile_common.h index e5b8a0b82..be21e1482 100644 --- a/third_party/aom/av1/common/tile_common.h +++ b/third_party/aom/av1/common/tile_common.h @@ -43,13 +43,32 @@ void av1_get_tile_n_bits(int mi_cols, int *min_log2_tile_cols, int *max_log2_tile_cols); void av1_setup_frame_boundary_info(const struct AV1Common *const cm); -void av1_setup_across_tile_boundary_info(const struct AV1Common *const cm, - const TileInfo *const tile_info); + +// Calculate the correct tile size (width or height) for (1 << log2_tile_num) +// tiles horizontally or vertically in the frame. +int get_tile_size(int mi_frame_size, int log2_tile_num, int *ntiles); #if CONFIG_LOOPFILTERING_ACROSS_TILES +void av1_setup_across_tile_boundary_info(const struct AV1Common *const cm, + const TileInfo *const tile_info); int av1_disable_loopfilter_on_tile_boundary(const struct AV1Common *cm); #endif // CONFIG_LOOPFILTERING_ACROSS_TILES +#if CONFIG_MAX_TILE + +// Define tile maximum width and area +// There is no maximum height since height is limited by area and width limits +// The minimum tile width or height is fixed at one superblock +#define MAX_TILE_WIDTH (4096) // Max Tile width in pixels +#define MAX_TILE_WIDTH_SB (MAX_TILE_WIDTH >> MAX_SB_SIZE_LOG2) +#define MAX_TILE_AREA (4096 * 2304) // Maximum tile area in pixels +#define MAX_TILE_AREA_SB (MAX_TILE_AREA >> (2 * MAX_SB_SIZE_LOG2)) + +void av1_get_tile_limits(struct AV1Common *const cm); +void av1_calculate_tile_cols(struct AV1Common *const cm); +void av1_calculate_tile_rows(struct AV1Common *const cm); +#endif + #ifdef __cplusplus } // extern "C" #endif -- cgit v1.2.3 From bbcc64772580c8a979288791afa02d30bc476d2e Mon Sep 17 00:00:00 2001 From: trav90 Date: Fri, 19 Oct 2018 21:52:15 -0500 Subject: Update aom to v1.0.0 Update aom to commit id d14c5bb4f336ef1842046089849dee4a301fbbf0. --- third_party/aom/av1/common/tile_common.h | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'third_party/aom/av1/common/tile_common.h') diff --git a/third_party/aom/av1/common/tile_common.h b/third_party/aom/av1/common/tile_common.h index be21e1482..be037fb17 100644 --- a/third_party/aom/av1/common/tile_common.h +++ b/third_party/aom/av1/common/tile_common.h @@ -16,7 +16,7 @@ extern "C" { #endif -#include "./aom_config.h" +#include "config/aom_config.h" struct AV1Common; @@ -26,6 +26,8 @@ typedef struct TileInfo { int mi_row_start, mi_row_end; int mi_col_start, mi_col_end; int tg_horz_boundary; + int tile_row; + int tile_col; } TileInfo; // initializes 'tile->mi_(row|col)_(start|end)' for (row, col) based on @@ -35,39 +37,30 @@ void av1_tile_init(TileInfo *tile, const struct AV1Common *cm, int row, void av1_tile_set_row(TileInfo *tile, const struct AV1Common *cm, int row); void av1_tile_set_col(TileInfo *tile, const struct AV1Common *cm, int col); -#if CONFIG_DEPENDENT_HORZTILES -void av1_tile_set_tg_boundary(TileInfo *tile, const struct AV1Common *const cm, - int row, int col); -#endif void av1_get_tile_n_bits(int mi_cols, int *min_log2_tile_cols, int *max_log2_tile_cols); -void av1_setup_frame_boundary_info(const struct AV1Common *const cm); - // Calculate the correct tile size (width or height) for (1 << log2_tile_num) // tiles horizontally or vertically in the frame. int get_tile_size(int mi_frame_size, int log2_tile_num, int *ntiles); -#if CONFIG_LOOPFILTERING_ACROSS_TILES -void av1_setup_across_tile_boundary_info(const struct AV1Common *const cm, - const TileInfo *const tile_info); -int av1_disable_loopfilter_on_tile_boundary(const struct AV1Common *cm); -#endif // CONFIG_LOOPFILTERING_ACROSS_TILES +typedef struct { + int left, top, right, bottom; +} AV1PixelRect; -#if CONFIG_MAX_TILE +// Return the pixel extents of the given tile +AV1PixelRect av1_get_tile_rect(const TileInfo *tile_info, + const struct AV1Common *cm, int is_uv); // Define tile maximum width and area // There is no maximum height since height is limited by area and width limits // The minimum tile width or height is fixed at one superblock -#define MAX_TILE_WIDTH (4096) // Max Tile width in pixels -#define MAX_TILE_WIDTH_SB (MAX_TILE_WIDTH >> MAX_SB_SIZE_LOG2) +#define MAX_TILE_WIDTH (4096) // Max Tile width in pixels #define MAX_TILE_AREA (4096 * 2304) // Maximum tile area in pixels -#define MAX_TILE_AREA_SB (MAX_TILE_AREA >> (2 * MAX_SB_SIZE_LOG2)) void av1_get_tile_limits(struct AV1Common *const cm); void av1_calculate_tile_cols(struct AV1Common *const cm); void av1_calculate_tile_rows(struct AV1Common *const cm); -#endif #ifdef __cplusplus } // extern "C" -- cgit v1.2.3 From d2499ead93dc4298c0882fe98902acb1b5209f99 Mon Sep 17 00:00:00 2001 From: trav90 Date: Fri, 19 Oct 2018 23:05:00 -0500 Subject: Update libaom to commit ID 1e227d41f0616de9548a673a83a21ef990b62591 --- third_party/aom/av1/common/tile_common.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'third_party/aom/av1/common/tile_common.h') diff --git a/third_party/aom/av1/common/tile_common.h b/third_party/aom/av1/common/tile_common.h index be037fb17..c03553dc6 100644 --- a/third_party/aom/av1/common/tile_common.h +++ b/third_party/aom/av1/common/tile_common.h @@ -9,8 +9,8 @@ * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ -#ifndef AV1_COMMON_TILE_COMMON_H_ -#define AV1_COMMON_TILE_COMMON_H_ +#ifndef AOM_AV1_COMMON_TILE_COMMON_H_ +#define AOM_AV1_COMMON_TILE_COMMON_H_ #ifdef __cplusplus extern "C" { @@ -44,6 +44,9 @@ void av1_get_tile_n_bits(int mi_cols, int *min_log2_tile_cols, // tiles horizontally or vertically in the frame. int get_tile_size(int mi_frame_size, int log2_tile_num, int *ntiles); +int av1_get_sb_rows_in_tile(struct AV1Common *cm, TileInfo tile); +int av1_get_sb_cols_in_tile(struct AV1Common *cm, TileInfo tile); + typedef struct { int left, top, right, bottom; } AV1PixelRect; @@ -66,4 +69,4 @@ void av1_calculate_tile_rows(struct AV1Common *const cm); } // extern "C" #endif -#endif // AV1_COMMON_TILE_COMMON_H_ +#endif // AOM_AV1_COMMON_TILE_COMMON_H_ -- cgit v1.2.3