Documentation
¶
Overview ¶
Package av1 is an AV1 encoder: 4:2:0 pictures of 8 or 10 bits coded as an AV1 stream (OBUs, the low overhead format), each picture's reconstruction exactly a decoder's.
Index ¶
Constants ¶
const ( REFS_PER_FRAME = 7 TOTAL_REFS_PER_FRAME = 8 BLOCK_SIZE_GROUPS = 4 BLOCK_SIZES = 22 BLOCK_INVALID = 22 MAX_SB_SIZE = 128 MI_SIZE = 4 MI_SIZE_LOG2 = 2 MAX_TILE_WIDTH = 4096 MAX_TILE_AREA = 4096 * 2304 MAX_TILE_ROWS = 64 MAX_TILE_COLS = 64 INTRABC_DELAY_PIXELS = 256 INTRABC_DELAY_SB64 = 4 NUM_REF_FRAMES = 8 IS_INTER_CONTEXTS = 4 REF_CONTEXTS = 3 MAX_SEGMENTS = 8 SEGMENT_ID_CONTEXTS = 3 SEG_LVL_ALT_Q = 0 SEG_LVL_ALT_LF_Y_V = 1 SEG_LVL_REF_FRAME = 5 SEG_LVL_SKIP = 6 SEG_LVL_GLOBALMV = 7 SEG_LVL_MAX = 8 PLANE_TYPES = 2 TX_SIZE_CONTEXTS = 3 INTERP_FILTERS = 3 INTERP_FILTER_CONTEXTS = 16 SKIP_MODE_CONTEXTS = 3 SKIP_CONTEXTS = 3 PARTITION_CONTEXTS = 4 TX_SIZES = 5 TX_SIZES_ALL = 19 TX_MODES = 3 DCT_DCT = 0 ADST_DCT = 1 DCT_ADST = 2 ADST_ADST = 3 FLIPADST_DCT = 4 DCT_FLIPADST = 5 FLIPADST_FLIPADST = 6 ADST_FLIPADST = 7 FLIPADST_ADST = 8 IDTX = 9 V_DCT = 10 H_DCT = 11 V_ADST = 12 H_ADST = 13 V_FLIPADST = 14 H_FLIPADST = 15 TX_TYPES = 16 MB_MODE_COUNT = 17 INTRA_MODES = 13 UV_INTRA_MODES_CFL_NOT_ALLOWED = 13 UV_INTRA_MODES_CFL_ALLOWED = 14 COMPOUND_MODES = 8 COMPOUND_MODE_CONTEXTS = 8 COMP_NEWMV_CTXS = 5 NEW_MV_CONTEXTS = 6 ZERO_MV_CONTEXTS = 2 REF_MV_CONTEXTS = 6 DRL_MODE_CONTEXTS = 3 MV_CONTEXTS = 2 MV_INTRABC_CONTEXT = 1 MV_JOINTS = 4 MV_CLASSES = 11 CLASS0_SIZE = 2 MV_OFFSET_BITS = 10 MAX_LOOP_FILTER = 63 REF_SCALE_SHIFT = 14 SUBPEL_BITS = 4 SUBPEL_MASK = 15 SCALE_SUBPEL_BITS = 10 MV_BORDER = 128 PALETTE_COLOR_CONTEXTS = 5 PALETTE_MAX_COLOR_CONTEXT_HASH = 8 PALETTE_BLOCK_SIZE_CONTEXTS = 7 PALETTE_Y_MODE_CONTEXTS = 3 PALETTE_UV_MODE_CONTEXTS = 2 PALETTE_SIZES = 7 PALETTE_COLORS = 8 PALETTE_NUM_NEIGHBORS = 3 DELTA_Q_SMALL = 3 DELTA_LF_SMALL = 3 QM_TOTAL_SIZE = 3344 MAX_ANGLE_DELTA = 3 DIRECTIONAL_MODES = 8 ANGLE_STEP = 3 TX_SET_TYPES_INTRA = 3 TX_SET_TYPES_INTER = 4 WARPEDMODEL_PREC_BITS = 16 IDENTITY = 0 TRANSLATION = 1 ROTZOOM = 2 AFFINE = 3 GM_ABS_TRANS_BITS = 12 GM_ABS_TRANS_ONLY_BITS = 9 GM_ABS_ALPHA_BITS = 12 DIV_LUT_PREC_BITS = 14 DIV_LUT_BITS = 8 DIV_LUT_NUM = 257 MOTION_MODES = 3 SIMPLE = 0 OBMC = 1 LOCALWARP = 2 LEAST_SQUARES_SAMPLES_MAX = 8 LS_MV_MAX = 256 WARPEDMODEL_TRANS_CLAMP = 1 << 23 WARPEDMODEL_NONDIAGAFFINE_CLAMP = 1 << 13 WARPEDPIXEL_PREC_SHIFTS = 1 << 6 WARPEDDIFF_PREC_BITS = 10 GM_ALPHA_PREC_BITS = 15 GM_TRANS_PREC_BITS = 6 GM_TRANS_ONLY_PREC_BITS = 3 INTERINTRA_MODES = 4 MASK_MASTER_SIZE = 64 SEGMENT_ID_PREDICTED_CONTEXTS = 3 FWD_REFS = 4 BWD_REFS = 3 SINGLE_REFS = 7 UNIDIR_COMP_REFS = 4 COMPOUND_TYPES = 2 CFL_JOINT_SIGNS = 8 CFL_ALPHABET_SIZE = 16 COMP_INTER_CONTEXTS = 5 COMP_REF_TYPE_CONTEXTS = 5 CFL_ALPHA_CONTEXTS = 6 INTRA_MODE_CONTEXTS = 5 COMP_GROUP_IDX_CONTEXTS = 6 COMPOUND_IDX_CONTEXTS = 6 INTRA_EDGE_KERNELS = 3 INTRA_EDGE_TAPS = 5 FRAME_LF_COUNT = 4 MAX_VARTX_DEPTH = 2 TXFM_PARTITION_CONTEXTS = 21 REF_CAT_LEVEL = 640 MAX_REF_MV_STACK_SIZE = 8 MFMV_STACK_SIZE = 3 MAX_TX_DEPTH = 2 WEDGE_TYPES = 16 FILTER_BITS = 7 WIENER_COEFFS = 3 SGRPROJ_PARAMS_BITS = 4 SGRPROJ_PRJ_SUBEXP_K = 4 SGRPROJ_PRJ_BITS = 7 SGRPROJ_RST_BITS = 4 SGRPROJ_MTABLE_BITS = 20 SGRPROJ_RECIP_BITS = 12 SGRPROJ_SGR_BITS = 8 EC_PROB_SHIFT = 6 EC_MIN_PROB = 4 SELECT_SCREEN_CONTENT_TOOLS = 2 SELECT_INTEGER_MV = 2 RESTORATION_TILESIZE_MAX = 256 MAX_FRAME_DISTANCE = 31 MAX_OFFSET_WIDTH = 8 MAX_OFFSET_HEIGHT = 0 WARP_PARAM_REDUCE_BITS = 6 NUM_BASE_LEVELS = 2 COEFF_BASE_RANGE = 12 BR_CDF_SIZE = 4 SIG_COEF_CONTEXTS_EOB = 4 SIG_COEF_CONTEXTS_2D = 26 SIG_COEF_CONTEXTS = 42 SIG_REF_DIFF_OFFSET_NUM = 5 SUPERRES_NUM = 8 SUPERRES_DENOM_MIN = 9 SUPERRES_DENOM_BITS = 3 SUPERRES_FILTER_BITS = 6 SUPERRES_FILTER_SHIFTS = 1 << SUPERRES_FILTER_BITS SUPERRES_FILTER_TAPS = 8 SUPERRES_FILTER_OFFSET = 3 SUPERRES_SCALE_BITS = 14 SUPERRES_SCALE_MASK = (1 << 14) - 1 SUPERRES_EXTRA_BITS = 8 TXB_SKIP_CONTEXTS = 13 EOB_COEF_CONTEXTS = 9 DC_SIGN_CONTEXTS = 3 LEVEL_CONTEXTS = 21 TX_CLASS_2D = 0 TX_CLASS_HORIZ = 1 TX_CLASS_VERT = 2 REFMVS_LIMIT = (1 << 12) - 1 INTRA_FILTER_SCALE_BITS = 4 INTRA_FILTER_MODES = 5 COEFF_CDF_Q_CTXS = 4 PRIMARY_REF_NONE = 7 BUFFER_POOL_MAX_SIZE = 10 )
From 03.symbols.md, table "Symbol name | Value | Description".
const ( OBU_SEQUENCE_HEADER = 1 OBU_TEMPORAL_DELIMITER = 2 OBU_FRAME_HEADER = 3 OBU_TILE_GROUP = 4 OBU_METADATA = 5 OBU_FRAME = 6 OBU_REDUNDANT_FRAME_HEADER = 7 OBU_TILE_LIST = 8 OBU_PADDING = 15 )
From 07.bitstream.semantics.md, table "obu_type | Name of obu_type | Layer-specific".
const ( CP_BT_709 = 1 CP_UNSPECIFIED = 2 CP_BT_470_M = 4 CP_BT_470_B_G = 5 CP_BT_601 = 6 CP_SMPTE_240 = 7 CP_GENERIC_FILM = 8 CP_BT_2020 = 9 CP_XYZ = 10 CP_SMPTE_431 = 11 CP_SMPTE_432 = 12 CP_EBU_3213 = 22 )
From 07.bitstream.semantics.md, table "color_primaries | Name of color primaries | Description".
const ( TC_RESERVED_0 = 0 TC_BT_709 = 1 TC_UNSPECIFIED = 2 TC_RESERVED_3 = 3 TC_BT_470_M = 4 TC_BT_470_B_G = 5 TC_BT_601 = 6 TC_SMPTE_240 = 7 TC_LINEAR = 8 TC_LOG_100 = 9 TC_LOG_100_SQRT10 = 10 TC_IEC_61966 = 11 TC_BT_1361 = 12 TC_SRGB = 13 TC_BT_2020_10_BIT = 14 TC_BT_2020_12_BIT = 15 TC_SMPTE_2084 = 16 TC_SMPTE_428 = 17 TC_HLG = 18 )
From 07.bitstream.semantics.md, table "transfer_characteristics | Name of transfer characteristics | Description".
const ( MC_IDENTITY = 0 MC_BT_709 = 1 MC_UNSPECIFIED = 2 MC_RESERVED_3 = 3 MC_FCC = 4 MC_BT_470_B_G = 5 MC_BT_601 = 6 MC_SMPTE_240 = 7 MC_SMPTE_YCGCO = 8 MC_BT_2020_NCL = 9 MC_BT_2020_CL = 10 MC_SMPTE_2085 = 11 MC_CHROMAT_NCL = 12 MC_CHROMAT_CL = 13 MC_ICTCP = 14 )
From 07.bitstream.semantics.md, table "matrix_coefficients | Name of matrix coefficients | Description".
const ( CSP_UNKNOWN = 0 CSP_VERTICAL = 1 CSP_COLOCATED = 2 CSP_RESERVED = 3 )
From 07.bitstream.semantics.md, table "chroma_sample_position | Name of chroma sample position | Description".
const ( METADATA_TYPE_HDR_CLL = 1 METADATA_TYPE_HDR_MDCV = 2 METADATA_TYPE_SCALABILITY = 3 METADATA_TYPE_ITUT_T35 = 4 METADATA_TYPE_TIMECODE = 5 )
From 07.bitstream.semantics.md, table "metadata_type | Name of metadata_type | Layer-specific".
const ( SCALABILITY_L1T2 = 0 SCALABILITY_L1T3 = 1 SCALABILITY_L2T1 = 2 SCALABILITY_L2T2 = 3 SCALABILITY_L2T3 = 4 SCALABILITY_S2T1 = 5 SCALABILITY_S2T2 = 6 SCALABILITY_S2T3 = 7 SCALABILITY_L2T1h = 8 SCALABILITY_L2T2h = 9 SCALABILITY_L2T3h = 10 SCALABILITY_S2T1h = 11 SCALABILITY_S2T2h = 12 SCALABILITY_S2T3h = 13 SCALABILITY_SS = 14 SCALABILITY_L3T1 = 15 SCALABILITY_L3T2 = 16 SCALABILITY_L3T3 = 17 SCALABILITY_S3T1 = 18 SCALABILITY_S3T2 = 19 SCALABILITY_S3T3 = 20 SCALABILITY_L3T2_KEY = 21 SCALABILITY_L3T3_KEY = 22 SCALABILITY_L4T5_KEY = 23 SCALABILITY_L4T7_KEY = 24 SCALABILITY_L3T2_KEY_SHIFT = 25 SCALABILITY_L3T3_KEY_SHIFT = 26 SCALABILITY_L4T5_KEY_SHIFT = 27 SCALABILITY_L4T7_KEY_SHIFT = 28 )
From 07.bitstream.semantics.md, table "scalability_mode_idc | Name of scalability_mode_idc".
const ( KEY_FRAME = 0 INTER_FRAME = 1 INTRA_ONLY_FRAME = 2 SWITCH_FRAME = 3 )
From 07.bitstream.semantics.md, table "frame_type | Name of frame_type".
const ( EIGHTTAP = 0 EIGHTTAP_SMOOTH = 1 EIGHTTAP_SHARP = 2 BILINEAR = 3 SWITCHABLE = 4 )
From 07.bitstream.semantics.md, table "interpolation_filter | Name of interpolation_filter".
const ( ONLY_4X4 = 0 TX_MODE_LARGEST = 1 TX_MODE_SELECT = 2 )
From 07.bitstream.semantics.md, table "TxMode | Name of TxMode".
const ( PARTITION_NONE = 0 PARTITION_HORZ = 1 PARTITION_VERT = 2 PARTITION_SPLIT = 3 PARTITION_HORZ_A = 4 PARTITION_HORZ_B = 5 PARTITION_VERT_A = 6 PARTITION_VERT_B = 7 PARTITION_HORZ_4 = 8 PARTITION_VERT_4 = 9 )
From 07.bitstream.semantics.md, table "partition | Name of partition".
const ( BLOCK_4X4 = 0 BLOCK_4X8 = 1 BLOCK_8X4 = 2 BLOCK_8X8 = 3 BLOCK_8X16 = 4 BLOCK_16X8 = 5 BLOCK_16X16 = 6 BLOCK_16X32 = 7 BLOCK_32X16 = 8 BLOCK_32X32 = 9 BLOCK_32X64 = 10 BLOCK_64X32 = 11 BLOCK_64X64 = 12 BLOCK_64X128 = 13 BLOCK_128X64 = 14 BLOCK_128X128 = 15 BLOCK_4X16 = 16 BLOCK_16X4 = 17 BLOCK_8X32 = 18 BLOCK_32X8 = 19 BLOCK_16X64 = 20 BLOCK_64X16 = 21 )
From 07.bitstream.semantics.md, table "subSize | Name of subSize".
const ( DC_PRED = 0 V_PRED = 1 H_PRED = 2 D45_PRED = 3 D135_PRED = 4 D113_PRED = 5 D157_PRED = 6 D203_PRED = 7 D67_PRED = 8 SMOOTH_PRED = 9 SMOOTH_V_PRED = 10 SMOOTH_H_PRED = 11 PAETH_PRED = 12 )
From 07.bitstream.semantics.md, table "intra_frame_y_mode | Name of intra_frame_y_mode".
const ( RESTORE_NONE = 0 RESTORE_SWITCHABLE = 3 RESTORE_WIENER = 1 RESTORE_SGRPROJ = 2 )
From 07.bitstream.semantics.md, table "lr_type | FrameRestorationType | Name of FrameRestorationType".
const ( TX_4X4 = 0 TX_8X8 = 1 TX_16X16 = 2 TX_32X32 = 3 TX_64X64 = 4 TX_4X8 = 5 TX_8X4 = 6 TX_8X16 = 7 TX_16X8 = 8 TX_16X32 = 9 TX_32X16 = 10 TX_32X64 = 11 TX_64X32 = 12 TX_4X16 = 13 TX_16X4 = 14 TX_8X32 = 15 TX_32X8 = 16 TX_16X64 = 17 TX_64X16 = 18 )
From 07.bitstream.semantics.md, table "TxSize | Name of TxSize".
const ( TX_SET_DCTONLY = 0 TX_SET_INTRA_1 = 1 TX_SET_INTRA_2 = 2 TX_SET_INTER_1 = 1 TX_SET_INTER_2 = 2 TX_SET_INTER_3 = 3 )
From 07.bitstream.semantics.md, table "is_inter | set | Name of transform set".
const ( NEARESTMV = 14 NEARMV = 15 GLOBALMV = 16 NEWMV = 17 NEAREST_NEARESTMV = 18 NEAR_NEARMV = 19 NEAREST_NEWMV = 20 NEW_NEARESTMV = 21 NEAR_NEWMV = 22 NEW_NEARMV = 23 GLOBAL_GLOBALMV = 24 NEW_NEWMV = 25 )
From 07.bitstream.semantics.md, table "YMode | Name of YMode".
const ( FILTER_DC_PRED = 0 FILTER_V_PRED = 1 FILTER_H_PRED = 2 FILTER_D157_PRED = 3 FILTER_PAETH_PRED = 4 )
From 07.bitstream.semantics.md, table "filter_intra_mode | Name of filter_intra_mode".
const ( SINGLE_REFERENCE = 0 COMPOUND_REFERENCE = 1 )
From 07.bitstream.semantics.md, table "comp_mode | Name of comp_mode".
const ( UNIDIR_COMP_REFERENCE = 0 BIDIR_COMP_REFERENCE = 1 )
From 07.bitstream.semantics.md, table "comp_ref_type | Name of comp_ref_type | Description".
const ( INTRA_FRAME = 0 LAST_FRAME = 1 LAST2_FRAME = 2 LAST3_FRAME = 3 GOLDEN_FRAME = 4 BWDREF_FRAME = 5 ALTREF2_FRAME = 6 ALTREF_FRAME = 7 )
From 07.bitstream.semantics.md, table "RefFrame[ 0 ] | Name of ref_frame".
const ( II_DC_PRED = 0 II_V_PRED = 1 II_H_PRED = 2 II_SMOOTH_PRED = 3 )
From 07.bitstream.semantics.md, table "interintra_mode | Name of interintra_mode".
const ( COMPOUND_WEDGE = 0 COMPOUND_DIFFWTD = 1 COMPOUND_AVERAGE = 2 COMPOUND_INTRA = 3 COMPOUND_DISTANCE = 4 )
From 07.bitstream.semantics.md, table "compound_type | Name of compound_type".
const ( UNIFORM_45 = 0 UNIFORM_45_INV = 1 )
From 07.bitstream.semantics.md, table "mask_type | Name of mask_type".
const ( MV_JOINT_ZERO = 0 MV_JOINT_HNZVZ = 1 MV_JOINT_HZVNZ = 2 MV_JOINT_HNZVNZ = 3 )
From 07.bitstream.semantics.md, table "mv_joint | Name of mv_joint | Changes row | Changes col".
const ( MV_CLASS_0 = 0 MV_CLASS_1 = 1 MV_CLASS_2 = 2 MV_CLASS_3 = 3 MV_CLASS_4 = 4 MV_CLASS_5 = 5 MV_CLASS_6 = 6 MV_CLASS_7 = 7 MV_CLASS_8 = 8 MV_CLASS_9 = 9 MV_CLASS_10 = 10 )
From 07.bitstream.semantics.md, table "mv_class | Name of mv_class".
const ( CFL_SIGN_ZERO = 0 CFL_SIGN_NEG = 1 CFL_SIGN_POS = 2 )
From 07.bitstream.semantics.md, table "signU | Name of signU".
const ( WEDGE_HORIZONTAL = 0 WEDGE_VERTICAL = 1 WEDGE_OBLIQUE27 = 2 WEDGE_OBLIQUE63 = 3 WEDGE_OBLIQUE117 = 4 WEDGE_OBLIQUE153 = 5 )
From 08.decoding.process.md, table "Constant | Value".
const ( SINPI_1_9 = 1321 SINPI_2_9 = 2482 SINPI_3_9 = 3344 SINPI_4_9 = 3803 )
From 08.decoding.process.md, table "Symbol | Value".
const (
NONE = -1
)
From 07.bitstream.semantics.md, table "RefFrame[ 1 ] | Name of ref_frame".
const (
UV_CFL_PRED = 13
)
From 07.bitstream.semantics.md, table "uv_mode | Name of uv_mode".
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder codes pictures.
func (*Encoder) Encode ¶
Encode takes the next picture, giving the temporal units that are complete (a mini-GOP is coded once all its pictures are in, and while the next ones come in: its units come from a later call, or Flush).
func (*Encoder) SequenceHeader ¶
SequenceHeader is the sequence header OBU (for a container's configuration record).
type EncoderOptions ¶
type EncoderOptions struct {
Width, Height int
BitDepth int // 8 or 10
// QIndex is the quantizer index, 1..255 (0 codes losslessly).
QIndex int
FPSNum, FPSDen int
// Primaries, Transfer and Matrix are the colour description the
// stream states (H.273); 0 for unspecified.
Primaries, Transfer, Matrix int
FullRange bool
// TileColsLog2 and TileRowsLog2 ask for 1<<n tile columns and rows
// (as the limits allow), coded at once: -1 the fewest the limits
// allow, one tile to 4096x2304. (A tile starts its CDFs and its
// neighbours afresh: on the two 120-picture 1080p clips one tile is
// 5.9% smaller than 2x2, two columns 3.6%, for 1.31 and 1.17 times
// the time; the superblock rows of a tile and several frames are
// coded at once still.)
TileColsLog2, TileRowsLog2 int
// Keyint is the key frame interval; 0 picks 250, 1 codes key frames
// only.
Keyint int
// MiniGOP is how many pictures a mini-GOP has (coded as a pyramid,
// the last first); 0 picks 32, 1 codes each picture from the one
// before.
MiniGOP int
// Speed trades size for time: -2 the partitions searched without
// pruning (5.3 times slower, 3.0% smaller on two 120-picture 1080p
// clips); -1 those after a skipped whole block too, intra everywhere
// and every inter candidate coded in full, its transforms searched,
// the best's interpolation filter by coding it with each (2.8 times
// slower, 2.3% smaller); 0 every tool searched, intra in
// inter pictures where its estimate is near inter's, inter candidates
// coded in full where theirs are near the best's, with their largest
// transforms, DCT_DCT, the best's transforms then searched; 1 no
// warped motion, masked compound or inter-intra, no compound of two
// earlier frames or joint compound motion search, luma's two
// deblocking levels the same and nine of the self-guided filter's
// sixteen sets (1.56 times faster, 2.6% larger on six clips); 2 also
// four references and three candidates coded in full
// (1.88 times, 3.8%).
Speed int
// Tune is what the encoder leans toward: "" or "psnr" (the default:
// the allocation and filters by squared error), or "vmaf" (the
// anchors a little coarser, the deblocking sharper and, from speed
// 2, no CDEF on the deep frames: on the six 240-picture clips, at
// speed 2 3.7% smaller by VMAF and 0.2% by SSIM, 0.6% larger by
// PSNR-Y and 1.1% by PSNR-YUV, 3.5% less CPU; at speed 0 1.7%, 0.3%,
// -0.2% and 0.4%).
Tune string
}
EncoderOptions are an encoder's settings.
Source Files
¶
- bits.go
- block.go
- cdef.go
- cdefsearch_amd64.go
- cdf.go
- cfl.go
- coder.go
- coeffs.go
- compound.go
- consts_gen.go
- depthpass.go
- dirpred_amd64.go
- encoder.go
- filter_amd64.go
- fwdtx_amd64.go
- gop.go
- headers.go
- iiblend_amd64.go
- inter.go
- interblock.go
- interintra.go
- interpred.go
- intrapred.go
- invtx_amd64.go
- lf_amd64.go
- loopfilter.go
- lrstats_amd64.go
- masked.go
- mfmv.go
- motion.go
- mv.go
- mvpred.go
- pack.go
- quant_amd64.go
- rdoq.go
- resid_amd64.go
- restoration.go
- satd.go
- satd_amd64.go
- scan.go
- scenecut.go
- sgr_amd64.go
- sse_amd64.go
- symbol.go
- tables_gen.go
- tfilter.go
- tile.go
- tpl.go
- transform.go
- transform_bf.go
- transform_fwd.go
- warp.go