/* * 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 MAX_PALETTE_SQUARE (64 * 64) // Maximum number of colors in a palette. #define PALETTE_MAX_SIZE 8 // Minimum number of colors in a palette. #define PALETTE_MIN_SIZE 2
#define PROFILE_BITS 3 // The following three profiles are currently defined. // Profile 0. 8-bit and 10-bit 4:2:0 and 4:0:0 only. // Profile 1. 8-bit and 10-bit 4:4:4 // Profile 2. 8-bit and 10-bit 4:2:2 // 12-bit 4:0:0, 4:2:2 and 4:4:4 // Since we have three bits for the profiles, it can be extended later. enum {
PROFILE_0,
PROFILE_1,
PROFILE_2,
MAX_PROFILES,
} SENUM1BYTE(BITSTREAM_PROFILE);
// Note: Some enums use the attribute 'packed' to use smallest possible integer // type, so that we can save memory when they are used in structs/arrays.
// Partition types. R: Recursive // // NONE HORZ VERT SPLIT // +-------+ +-------+ +---+---+ +---+---+ // | | | | | | | | R | R | // | | +-------+ | | | +---+---+ // | | | | | | | | R | R | // +-------+ +-------+ +---+---+ +---+---+ // // HORZ_A HORZ_B VERT_A VERT_B // +---+---+ +-------+ +---+---+ +---+---+ // | | | | | | | | | | | // +---+---+ +---+---+ +---+ | | +---+ // | | | | | | | | | | | // +-------+ +---+---+ +---+---+ +---+---+ // // HORZ_4 VERT_4 // +-----+ +-+-+-+ // +-----+ | | | | // +-----+ | | | | // +-----+ +-+-+-+ enum {
PARTITION_NONE,
PARTITION_HORZ,
PARTITION_VERT,
PARTITION_SPLIT,
PARTITION_HORZ_A, // HORZ split and the top partition is split again
PARTITION_HORZ_B, // HORZ split and the bottom partition is split again
PARTITION_VERT_A, // VERT split and the left partition is split again
PARTITION_VERT_B, // VERT split and the right partition is split again
PARTITION_HORZ_4, // 4:1 horizontal partition
PARTITION_VERT_4, // 4:1 vertical partition
EXT_PARTITION_TYPES,
PARTITION_TYPES = PARTITION_SPLIT + 1,
PARTITION_INVALID = 255
} UENUM1BYTE(PARTITION_TYPE);
typedefchar PARTITION_CONTEXT; #define PARTITION_PLOFFSET 4 // number of probability models per block size #define PARTITION_BLOCK_SIZES 5 #define PARTITION_CONTEXTS (PARTITION_BLOCK_SIZES * PARTITION_PLOFFSET)
#define TX_SIZE_LUMA_MIN (TX_4X4) /* We don't need to code a transform size unless the allowed size is at least
one more than the minimum. */ #define TX_SIZE_CTX_MIN (TX_SIZE_LUMA_MIN + 1)
// Pad 4 extra columns to remove horizontal availability check. #define TX_PAD_HOR_LOG2 2 #define TX_PAD_HOR 4 // Pad 6 extra rows (2 on top and 4 on bottom) to remove vertical availability // check. #define TX_PAD_TOP 0 #define TX_PAD_BOTTOM 4 #define TX_PAD_VER (TX_PAD_TOP + TX_PAD_BOTTOM) // Pad 16 extra bytes to avoid reading overflow in SIMD optimization. #define TX_PAD_END 16 #define TX_PAD_2D ((32 + TX_PAD_HOR) * (32 + TX_PAD_VER) + TX_PAD_END)
// Number of maximum size transform blocks in the maximum size superblock #define MAX_TX_BLOCKS_IN_MAX_SB_LOG2 ((MAX_SB_SIZE_LOG2 - MAX_TX_SIZE_LOG2) * 2) #define MAX_TX_BLOCKS_IN_MAX_SB (1 << MAX_TX_BLOCKS_IN_MAX_SB_LOG2)
// frame transform mode enum {
ONLY_4X4, // use only 4x4 transform
TX_MODE_LARGEST, // transform size is the largest possible for pu size
TX_MODE_SELECT, // transform specified for each block
TX_MODES,
} UENUM1BYTE(TX_MODE);
#define EXT_TX_SIZES 4 // number of sizes that use extended transforms #define EXT_TX_SETS_INTER 4 // Sets of transform selections for INTER #define EXT_TX_SETS_INTRA 3 // Sets of transform selections for INTRA
// CFL_SIGN_ZERO,CFL_SIGN_ZERO is invalid #define CFL_JOINT_SIGNS (CFL_SIGNS * CFL_SIGNS - 1) // CFL_SIGN_U is equivalent to (js + 1) / 3 for js in 0 to 8 #define CFL_SIGN_U(js) (((js + 1) * 11) >> 5) // CFL_SIGN_V is equivalent to (js + 1) % 3 for js in 0 to 8 #define CFL_SIGN_V(js) ((js + 1) - CFL_SIGNS * CFL_SIGN_U(js))
// There is no context when the alpha for a given plane is zero. // So there are 2 fewer contexts than joint signs. #define CFL_ALPHA_CONTEXTS (CFL_JOINT_SIGNS + 1 - CFL_SIGNS) #define CFL_CONTEXT_U(js) (js + 1 - CFL_SIGNS) // Also, the contexts are symmetric under swapping the planes. #define CFL_CONTEXT_V(js) \
(CFL_SIGN_V(js) * CFL_SIGNS + CFL_SIGN_U(js) - CFL_SIGNS)
// Note: All directional predictors must be between V_PRED and D67_PRED (both // inclusive). enum {
DC_PRED, // Average of above and left pixels
V_PRED, // Vertical
H_PRED, // Horizontal
D45_PRED, // Directional 45 degree
D135_PRED, // Directional 135 degree
D113_PRED, // Directional 113 degree
D157_PRED, // Directional 157 degree
D203_PRED, // Directional 203 degree
D67_PRED, // Directional 67 degree
SMOOTH_PRED, // Combination of horizontal and vertical interpolation
SMOOTH_V_PRED, // Vertical interpolation
SMOOTH_H_PRED, // Horizontal interpolation
PAETH_PRED, // Predict from the direction of smallest gradient
NEARESTMV,
NEARMV,
GLOBALMV,
NEWMV, // Compound ref compound modes
NEAREST_NEARESTMV,
NEAR_NEARMV,
NEAREST_NEWMV,
NEW_NEARESTMV,
NEAR_NEWMV,
NEW_NEARMV,
GLOBAL_GLOBALMV,
NEW_NEWMV,
MB_MODE_COUNT,
PRED_MODE_INVALID = MB_MODE_COUNT,
INTRA_MODE_START = DC_PRED,
INTRA_MODE_END = NEARESTMV,
DIR_MODE_START = V_PRED,
DIR_MODE_END = D67_PRED + 1,
INTRA_MODE_NUM = INTRA_MODE_END - INTRA_MODE_START,
SINGLE_INTER_MODE_START = NEARESTMV,
SINGLE_INTER_MODE_END = NEAREST_NEARESTMV,
SINGLE_INTER_MODE_NUM = SINGLE_INTER_MODE_END - SINGLE_INTER_MODE_START,
COMP_INTER_MODE_START = NEAREST_NEARESTMV,
COMP_INTER_MODE_END = MB_MODE_COUNT,
COMP_INTER_MODE_NUM = COMP_INTER_MODE_END - COMP_INTER_MODE_START,
INTER_MODE_START = NEARESTMV,
INTER_MODE_END = MB_MODE_COUNT,
INTRA_MODES = PAETH_PRED + 1, // PAETH_PRED has to be the last intra mode.
INTRA_INVALID = MB_MODE_COUNT // For uv_mode in inter blocks
} UENUM1BYTE(PREDICTION_MODE);
// TODO(ltrudeau) Do we really want to pack this? // TODO(ltrudeau) Do we match with PREDICTION_MODE? enum {
UV_DC_PRED, // Average of above and left pixels
UV_V_PRED, // Vertical
UV_H_PRED, // Horizontal
UV_D45_PRED, // Directional 45 degree
UV_D135_PRED, // Directional 135 degree
UV_D113_PRED, // Directional 113 degree
UV_D157_PRED, // Directional 157 degree
UV_D203_PRED, // Directional 203 degree
UV_D67_PRED, // Directional 67 degree
UV_SMOOTH_PRED, // Combination of horizontal and vertical interpolation
UV_SMOOTH_V_PRED, // Vertical interpolation
UV_SMOOTH_H_PRED, // Horizontal interpolation
UV_PAETH_PRED, // Predict from the direction of smallest gradient
UV_CFL_PRED, // Chroma-from-Luma
UV_INTRA_MODES,
UV_MODE_INVALID, // For uv_mode in inter blocks
} UENUM1BYTE(UV_PREDICTION_MODE);
// Number of top model rd to store for pruning y modes in intra mode decision #define TOP_INTRA_MODEL_COUNT 4 // Total number of luma intra prediction modes (include both directional and // non-directional modes) // Because there are 8 directional modes, each has additional 6 delta angles. #define LUMA_MODE_COUNT (PAETH_PRED - DC_PRED + 1 + 6 * 8)
// An enum for single reference types (and some derived values). enum {
NONE_FRAME = -1,
INTRA_FRAME,
LAST_FRAME,
LAST2_FRAME,
LAST3_FRAME,
GOLDEN_FRAME,
BWDREF_FRAME,
ALTREF2_FRAME,
ALTREF_FRAME,
REF_FRAMES,
// Extra/scratch reference frame. It may be: // - used to update the ALTREF2_FRAME ref (see lshift_bwd_ref_frames()), or // - updated from ALTREF2_FRAME ref (see rshift_bwd_ref_frames()).
EXTREF_FRAME = REF_FRAMES,
// Number of inter (non-intra) reference types.
INTER_REFS_PER_FRAME = ALTREF_FRAME - LAST_FRAME + 1,
// Number of forward (aka past) reference types.
FWD_REFS = GOLDEN_FRAME - LAST_FRAME + 1,
// Number of backward (aka future) reference types.
BWD_REFS = ALTREF_FRAME - BWDREF_FRAME + 1,
SINGLE_REFS = FWD_REFS + BWD_REFS,
};
#define REF_FRAMES_LOG2 3
// REF_FRAMES for the cm->ref_frame_map array, 1 scratch frame for the new // frame in cm->cur_frame, INTER_REFS_PER_FRAME for scaled references on the // encoder in the cpi->scaled_ref_buf array. // The encoder uses FRAME_BUFFERS only in GOOD and REALTIME encoding modes. // The decoder also uses FRAME_BUFFERS. #define FRAME_BUFFERS (REF_FRAMES + 1 + INTER_REFS_PER_FRAME)
// During allintra encoding, one reference frame buffer is free to be used again // only after another frame buffer is stored as the reference frame. Hence, it // is necessary and sufficient to maintain only two reference frame buffers in // this case. #define FRAME_BUFFERS_ALLINTRA 2
// NOTE: A limited number of unidirectional reference pairs can be signalled for // compound prediction. The use of skip mode, on the other hand, makes it // possible to have a reference pair not listed for explicit signaling. #define MODE_CTX_REF_FRAMES (REF_FRAMES + TOTAL_COMP_REFS)
// Note: It includes single and compound references. So, it can take values from // NONE_FRAME to (MODE_CTX_REF_FRAMES - 1). Hence, it is not defined as an enum. typedef int8_t MV_REFERENCE_FRAME;
/*!\endcond */
/*!\enum RestorationType * \brief This enumeration defines various restoration types supported
*/ typedefenum {
RESTORE_NONE, /**< No restoration */
RESTORE_WIENER, /**< Separable Wiener restoration */
RESTORE_SGRPROJ, /**< Selfguided restoration */
RESTORE_SWITCHABLE, /**< Switchable restoration */
RESTORE_SWITCHABLE_TYPES = RESTORE_SWITCHABLE, /**< Num Switchable types */
RESTORE_TYPES = 4, /**< Num Restore types */
} RestorationType;
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.