Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
dav1d
Commits
859ae6aa
Commit
859ae6aa
authored
Oct 23, 2018
by
Janne Grunau
Committed by
Ronald S. Bultje
Oct 23, 2018
Browse files
remove unused unused code from src/ref_mvs.c
Fixes 9 warnings. See
#97
.
parent
6e9ca034
Pipeline
#1243
passed with stage
in 2 minutes and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/ref_mvs.c
View file @
859ae6aa
...
...
@@ -255,17 +255,6 @@ typedef enum {
AFFINE
=
3
,
// affine, 6-parameter
TRANS_TYPES
,
}
TransformationType
;
#if 0
typedef enum {
KEY_FRAME = 0,
INTER_FRAME = 1,
#if CONFIG_OBU
INTRA_ONLY_FRAME = 2, // replaces intra-only
S_FRAME = 3,
#endif
FRAME_TYPES,
} FRAME_TYPE;
#endif
#define LEAST_SQUARES_SAMPLES_MAX_BITS 3
#define LEAST_SQUARES_SAMPLES_MAX (1 << LEAST_SQUARES_SAMPLES_MAX_BITS)
...
...
@@ -306,31 +295,6 @@ static const uint8_t block_size_high[BLOCK_SIZES_ALL] = {
16
,
128
,
32
};
static
const
uint8_t
num_8x8_blocks_wide_lookup
[
BLOCK_SIZES_ALL
]
=
{
1
,
1
,
1
,
1
,
1
,
2
,
2
,
2
,
4
,
4
,
4
,
8
,
8
,
8
,
16
,
16
,
1
,
2
,
1
,
4
,
2
,
8
,
4
,
16
};
static
const
uint8_t
num_8x8_blocks_high_lookup
[
BLOCK_SIZES_ALL
]
=
{
1
,
1
,
1
,
1
,
2
,
1
,
2
,
4
,
2
,
4
,
8
,
4
,
8
,
16
,
8
,
16
,
2
,
1
,
4
,
1
,
8
,
2
,
16
,
4
};
static
INLINE
int
is_global_mv_block
(
const
MB_MODE_INFO
*
const
mbmi
,
TransformationType
type
)
{
const
PREDICTION_MODE
mode
=
mbmi
->
mode
;
...
...
@@ -347,67 +311,19 @@ typedef struct {
int16_t
alpha
,
beta
,
gamma
,
delta
;
}
WarpedMotionParams
;
#define WARPEDMODEL_PREC_BITS 16
static
const
WarpedMotionParams
default_warp_params
=
{
IDENTITY
,
{
0
,
0
,
(
1
<<
WARPEDMODEL_PREC_BITS
),
0
,
0
,
(
1
<<
WARPEDMODEL_PREC_BITS
)
},
0
,
0
,
0
,
0
,
};
#define REF_FRAMES_LOG2 3
#define REF_FRAMES (1 << REF_FRAMES_LOG2)
#define FRAME_BUFFERS (REF_FRAMES + 7)
typedef
struct
{
#if 0
int ref_count;
#endif
unsigned
int
cur_frame_offset
;
unsigned
int
ref_frame_offset
[
INTER_REFS_PER_FRAME
];
MV_REF
*
mvs
;
ptrdiff_t
mv_stride
;
#if 0
#if CONFIG_SEGMENT_PRED_LAST
uint8_t *seg_map;
#endif
#endif
int
mi_rows
;
int
mi_cols
;
#if 0
// Width and height give the size of the buffer (before any upscaling, unlike
// the sizes that can be derived from the buf structure)
int width;
int height;
WarpedMotionParams global_motion[TOTAL_REFS_PER_FRAME];
#if CONFIG_FILM_GRAIN_SHOWEX
int showable_frame; // frame can be used as show existing frame in future
#endif
#if CONFIG_FILM_GRAIN
int film_grain_params_present;
aom_film_grain_t film_grain_params;
#endif
aom_codec_frame_buffer_t raw_frame_buffer;
YV12_BUFFER_CONFIG buf;
#if CONFIG_HASH_ME
hash_table hash_table;
#endif
#endif
uint8_t
intra_only
;
#if 0
FRAME_TYPE frame_type;
// The Following variables will only be used in frame parallel decode.
// frame_worker_owner indicates which FrameWorker owns this buffer. NULL means
// that no FrameWorker owns, or is decoding, this buffer.
AVxWorker *frame_worker_owner;
// row and col indicate which position frame has been decoded to in real
// pixel unit. They are reset to -1 when decoding begins and set to INT_MAX
// when the frame is fully decoded.
int row;
int col;
#endif
}
RefCntBuffer
;
#define INVALID_IDX -1 // Invalid buffer index.
...
...
@@ -417,537 +333,64 @@ typedef struct TileInfo {
int
tg_horz_boundary
;
}
TileInfo
;
typedef
struct
macroblockd
{
#if 0
struct macroblockd_plane plane[MAX_MB_PLANE];
uint8_t bmode_blocks_wl;
uint8_t bmode_blocks_hl;
FRAME_COUNTS *counts;
#endif
TileInfo
tile
;
int
mi_stride
;
CUR_MODE_INFO
cur_mi
;
MB_MODE_INFO
*
mi
;
#if 0
MODE_INFO *left_mi;
MODE_INFO *above_mi;
MB_MODE_INFO *left_mbmi;
MB_MODE_INFO *above_mbmi;
MB_MODE_INFO *chroma_left_mbmi;
MB_MODE_INFO *chroma_above_mbmi;
#endif
int
up_available
;
int
left_available
;
#if 0
int chroma_up_available;
int chroma_left_available;
#endif
/* Distance of MB away from frame edges in subpixels (1/8th pixel) */
int
mb_to_left_edge
;
int
mb_to_right_edge
;
int
mb_to_top_edge
;
int
mb_to_bottom_edge
;
#if 0
FRAME_CONTEXT *fc;
/* pointers to reference frames */
const RefBuffer *block_refs[2];
/* pointer to current frame */
const YV12_BUFFER_CONFIG *cur_buf;
ENTROPY_CONTEXT *above_context[MAX_MB_PLANE];
ENTROPY_CONTEXT left_context[MAX_MB_PLANE][2 * MAX_MIB_SIZE];
PARTITION_CONTEXT *above_seg_context;
PARTITION_CONTEXT left_seg_context[MAX_MIB_SIZE];
TXFM_CONTEXT *above_txfm_context;
TXFM_CONTEXT *left_txfm_context;
TXFM_CONTEXT left_txfm_context_buffer[2 * MAX_MIB_SIZE];
#if CONFIG_LOOP_RESTORATION
WienerInfo wiener_info[MAX_MB_PLANE];
SgrprojInfo sgrproj_info[MAX_MB_PLANE];
#endif // CONFIG_LOOP_RESTORATION
#endif
// block dimension in the unit of mode_info.
uint8_t
n8_w
,
n8_h
;
#if 0
uint8_t ref_mv_count[MODE_CTX_REF_FRAMES];
CANDIDATE_MV ref_mv_stack[MODE_CTX_REF_FRAMES][MAX_REF_MV_STACK_SIZE];
#endif
uint8_t
is_sec_rect
;
#if 0
// Counts of each reference frame in the above and left neighboring blocks.
// NOTE: Take into account both single and comp references.
uint8_t neighbors_ref_counts[TOTAL_REFS_PER_FRAME];
FRAME_CONTEXT *tile_ctx;
/* Bit depth: 8, 10, 12 */
int bd;
int qindex[MAX_SEGMENTS];
int lossless[MAX_SEGMENTS];
int corrupted;
int cur_frame_force_integer_mv;
// same with that in AV1_COMMON
struct aom_internal_error_info *error_info;
const WarpedMotionParams *global_motion;
int prev_qindex;
int delta_qindex;
int current_qindex;
#if CONFIG_EXT_DELTA_Q
// Since actual frame level loop filtering level value is not available
// at the beginning of the tile (only available during actual filtering)
// at encoder side.we record the delta_lf (against the frame level loop
// filtering level) and code the delta between previous superblock's delta
// lf and current delta lf. It is equivalent to the delta between previous
// superblock's actual lf and current lf.
int prev_delta_lf_from_base;
int current_delta_lf_from_base;
// For this experiment, we have four frame filter levels for different plane
// and direction. So, to support the per superblock update, we need to add
// a few more params as below.
// 0: delta loop filter level for y plane vertical
// 1: delta loop filter level for y plane horizontal
// 2: delta loop filter level for u plane
// 3: delta loop filter level for v plane
// To make it consistent with the reference to each filter level in segment,
// we need to -1, since
// SEG_LVL_ALT_LF_Y_V = 1;
// SEG_LVL_ALT_LF_Y_H = 2;
// SEG_LVL_ALT_LF_U = 3;
// SEG_LVL_ALT_LF_V = 4;
int prev_delta_lf[FRAME_LF_COUNT];
int curr_delta_lf[FRAME_LF_COUNT];
#endif
DECLARE_ALIGNED(16, uint8_t, seg_mask[2 * MAX_SB_SQUARE]);
CFL_CTX cfl;
JNT_COMP_PARAMS jcp_param;
int all_one_sided_refs;
#endif
}
MACROBLOCKD
;
typedef
struct
RefBuffer
{
int
idx
;
// frame buf idx
#if 0
int map_idx; // frame map idx
YV12_BUFFER_CONFIG *buf;
struct scale_factors sf;
#endif
}
RefBuffer
;
typedef
struct
BufferPool
{
#if 0
// Protect BufferPool from being accessed by several FrameWorkers at
// the same time during frame parallel decode.
// TODO(hkuang): Try to use atomic variable instead of locking the whole pool.
#if CONFIG_MULTITHREAD
pthread_mutex_t pool_mutex;
#endif
// Private data associated with the frame buffer callbacks.
void *cb_priv;
aom_get_frame_buffer_cb_fn_t get_fb_cb;
aom_release_frame_buffer_cb_fn_t release_fb_cb;
#endif
RefCntBuffer
frame_bufs
[
FRAME_BUFFERS
];
#if 0
// Frame buffers allocated internally by the codec.
InternalFrameBufferList int_frame_buffers;
#endif
}
BufferPool
;
typedef
struct
AV1Common
{
#if 0
struct aom_internal_error_info error;
aom_color_primaries_t color_primaries;
aom_transfer_characteristics_t transfer_characteristics;
aom_matrix_coefficients_t matrix_coefficients;
int color_range;
int width;
int height;
int render_width;
int render_height;
int last_width;
int last_height;
int timing_info_present;
uint32_t num_units_in_tick;
uint32_t time_scale;
int equal_picture_interval;
uint32_t num_ticks_per_picture;
// TODO(jkoleszar): this implies chroma ss right now, but could vary per
// plane. Revisit as part of the future change to YV12_BUFFER_CONFIG to
// support additional planes.
int subsampling_x;
int subsampling_y;
int largest_tile_id;
size_t largest_tile_size;
// Scale of the current frame with respect to itself.
struct scale_factors sf_identity;
// Marks if we need to use 16bit frame buffers (1: yes, 0: no).
int use_highbitdepth;
YV12_BUFFER_CONFIG *frame_to_show;
#endif
// TODO(hkuang): Combine this with cur_buf in macroblockd.
RefCntBuffer
cur_frame
;
#if 0
int ref_frame_map[REF_FRAMES]; /* maps fb_idx to reference slot */
// Prepare ref_frame_map for the next frame.
// Only used in frame parallel decode.
int next_ref_frame_map[REF_FRAMES];
// TODO(jkoleszar): could expand active_ref_idx to 4, with 0 as intra, and
// roll new_fb_idx into it.
#endif
// Each Inter frame can reference INTER_REFS_PER_FRAME buffers
RefBuffer
frame_refs
[
INTER_REFS_PER_FRAME
];
#if 0
int is_skip_mode_allowed;
int skip_mode_flag;
int ref_frame_idx_0;
int ref_frame_idx_1;
int new_fb_idx;
FRAME_TYPE last_frame_type; /* last frame's frame type for motion search.*/
FRAME_TYPE frame_type;
int show_frame;
#if CONFIG_FILM_GRAIN_SHOWEX
int showable_frame; // frame can be used as show existing frame in future
#endif
int last_show_frame;
int show_existing_frame;
// Flag for a frame used as a reference - not written to the bitstream
int is_reference_frame;
#if CONFIG_FWD_KF
int reset_decoder_state;
#endif // CONFIG_FWD_KF
// Flag signaling that the frame is encoded using only INTRA modes.
uint8_t intra_only;
uint8_t last_intra_only;
#if CONFIG_CDF_UPDATE_MODE
uint8_t disable_cdf_update;
#endif // CONFIG_CDF_UPDATE_MODE
#endif
int
allow_high_precision_mv
;
int
cur_frame_force_integer_mv
;
// 0 the default in AOM, 1 only integer
#if 0
int disable_intra_edge_filter; // 1 - disable corner/edge/upsampling
int allow_screen_content_tools;
int allow_intrabc;
int allow_interintra_compound;
int allow_masked_compound;
#if !CONFIG_NO_FRAME_CONTEXT_SIGNALING
// Flag signaling which frame contexts should be reset to default values.
RESET_FRAME_CONTEXT_MODE reset_frame_context;
#endif
// MBs, mb_rows/cols is in 16-pixel units; mi_rows/cols is in
// MODE_INFO (8-pixel) units.
int MBs;
int mb_rows, mi_rows;
int mb_cols, mi_cols;
#endif
int
mi_rows
;
int
mi_cols
;
int
mi_stride
;
#if 0
/* profile settings */
TX_MODE tx_mode;
int base_qindex;
int y_dc_delta_q;
int u_dc_delta_q;
int v_dc_delta_q;
int u_ac_delta_q;
int v_ac_delta_q;
int separate_uv_delta_q;
// The dequantizers below are true dequntizers used only in the
// dequantization process. They have the same coefficient
// shift/scale as TX.
int16_t y_dequant_QTX[MAX_SEGMENTS][2];
int16_t u_dequant_QTX[MAX_SEGMENTS][2];
int16_t v_dequant_QTX[MAX_SEGMENTS][2];
// Global quant matrix tables
const qm_val_t *giqmatrix[NUM_QM_LEVELS][3][TX_SIZES_ALL];
const qm_val_t *gqmatrix[NUM_QM_LEVELS][3][TX_SIZES_ALL];
// Local quant matrix tables for each frame
const qm_val_t *y_iqmatrix[MAX_SEGMENTS][TX_SIZES_ALL];
const qm_val_t *u_iqmatrix[MAX_SEGMENTS][TX_SIZES_ALL];
const qm_val_t *v_iqmatrix[MAX_SEGMENTS][TX_SIZES_ALL];
// Encoder
int using_qmatrix;
#if CONFIG_AOM_QM_EXT
int qm_y;
int qm_u;
int qm_v;
#endif // CONFIG_AOM_QM_EXT
int min_qmlevel;
int max_qmlevel;
/* We allocate a MODE_INFO struct for each macroblock, together with
an extra row on top and column on the left to simplify prediction. */
int mi_alloc_size;
MODE_INFO *mip; /* Base of allocated array */
MODE_INFO *mi; /* Corresponds to upper left visible macroblock */
// TODO(agrange): Move prev_mi into encoder structure.
// prev_mip and prev_mi will only be allocated in encoder.
MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */
MODE_INFO *prev_mi; /* 'mi' from last frame (points into prev_mip) */
// Separate mi functions between encoder and decoder.
int (*alloc_mi)(struct AV1Common *cm, int mi_size);
void (*free_mi)(struct AV1Common *cm);
void (*setup_mi)(struct AV1Common *cm);
// Grid of pointers to 8x8 MODE_INFO structs. Any 8x8 not in the visible
// area will be NULL.
MODE_INFO **mi_grid_base;
MODE_INFO **mi_grid_visible;
MODE_INFO **prev_mi_grid_base;
MODE_INFO **prev_mi_grid_visible;
#endif
// Whether to use previous frame's motion vectors for prediction.
int
allow_ref_frame_mvs
;
#if 0
#if !CONFIG_SEGMENT_PRED_LAST
// Persistent mb segment id map used in prediction.
int seg_map_idx;
int prev_seg_map_idx;
uint8_t *seg_map_array[NUM_PING_PONG_BUFFERS];
#endif
uint8_t *last_frame_seg_map;
uint8_t *current_frame_seg_map;
int seg_map_alloc_size;
InterpFilter interp_filter;
int switchable_motion_mode;
loop_filter_info_n lf_info;
// The denominator of the superres scale; the numerator is fixed.
uint8_t superres_scale_denominator;
int superres_upscaled_width;
int superres_upscaled_height;
RestorationInfo rst_info[MAX_MB_PLANE];
// rst_end_stripe[i] is one more than the index of the bottom stripe
// for tile row i.
int rst_end_stripe[MAX_TILE_ROWS];
// Pointer to a scratch buffer used by self-guided restoration
int32_t *rst_tmpbuf;
// Flag signaling how frame contexts should be updated at the end of
// a frame decode
REFRESH_FRAME_CONTEXT_MODE refresh_frame_context;
#endif
int
ref_frame_sign_bias
[
TOTAL_REFS_PER_FRAME
];
/* Two state 0, 1 */
#if 0
struct loopfilter lf;
struct segmentation seg;
int all_lossless;
#endif
int
frame_parallel_decode
;
// frame-based threading.
#if 0
int reduced_tx_set_used;
// Context probabilities for reference frame prediction
MV_REFERENCE_FRAME comp_fwd_ref[FWD_REFS];
MV_REFERENCE_FRAME comp_bwd_ref[BWD_REFS];
REFERENCE_MODE reference_mode;
FRAME_CONTEXT *fc; /* this frame entropy */
FRAME_CONTEXT *frame_contexts; // FRAME_CONTEXTS
FRAME_CONTEXT *pre_fc; // Context referenced in this frame
unsigned int frame_context_idx; /* Context to use/update */
#if CONFIG_NO_FRAME_CONTEXT_SIGNALING
int fb_of_context_type[REF_FRAMES];
int primary_ref_frame;
#endif
FRAME_COUNTS counts;
#endif
unsigned
int
frame_offset
;
#if 0
unsigned int current_video_frame;
BITSTREAM_PROFILE profile;
// AOM_BITS_8 in profile 0 or 1, AOM_BITS_10 or AOM_BITS_12 in profile 2 or 3.
aom_bit_depth_t bit_depth;
aom_bit_depth_t dequant_bit_depth; // bit_depth of current dequantizer
int error_resilient_mode;
int tile_cols, tile_rows;
int last_tile_cols, last_tile_rows;
BOUNDARY_TYPE *boundary_info;
int boundary_info_alloc_size;
#if CONFIG_MAX_TILE
int min_log2_tile_cols;
int max_log2_tile_cols;
int max_log2_tile_rows;
int min_log2_tile_rows;
int min_log2_tiles;
int max_tile_width_sb;
int max_tile_height_sb;
int uniform_tile_spacing_flag;
int log2_tile_cols; // only valid for uniform tiles
int log2_tile_rows; // only valid for uniform tiles
int tile_col_start_sb[MAX_TILE_COLS + 1]; // valid for 0 <= i <= tile_cols
int tile_row_start_sb[MAX_TILE_ROWS + 1]; // valid for 0 <= i <= tile_rows
#if CONFIG_DEPENDENT_HORZTILES
int tile_row_independent[MAX_TILE_ROWS]; // valid for 0 <= i < tile_rows
#endif
int tile_width, tile_height; // In MI units
#else
int log2_tile_cols, log2_tile_rows; // Used in non-large_scale_tile_coding.
int tile_width, tile_height; // In MI units
#endif // CONFIG_MAX_TILE
#if CONFIG_EXT_TILE
unsigned
int
large_scale_tile
;
unsigned
int
single_tile_decoding
;
#endif // CONFIG_EXT_TILE
#if CONFIG_DEPENDENT_HORZTILES
int
dependent_horz_tiles
;
int
tile_group_start_row
[
MAX_TILE_ROWS
][
MAX_TILE_COLS
];
int
tile_group_start_col
[
MAX_TILE_ROWS
][
MAX_TILE_COLS
];
#endif
#if CONFIG_LOOPFILTERING_ACROSS_TILES
#if CONFIG_LOOPFILTERING_ACROSS_TILES_EXT
int
loop_filter_across_tiles_v_enabled
;
int
loop_filter_across_tiles_h_enabled
;
#else
int
loop_filter_across_tiles_enabled
;
#endif // CONFIG_LOOPFILTERING_ACROSS_TILES_EXT
#endif // CONFIG_LOOPFILTERING_ACROSS_TILES
int
byte_alignment
;
int
skip_loop_filter
;
// Private data associated with the frame buffer callbacks.
void
*
cb_priv
;
aom_get_frame_buffer_cb_fn_t
get_fb_cb
;
aom_release_frame_buffer_cb_fn_t
release_fb_cb
;
// Handles memory for the codec.
InternalFrameBufferList
int_frame_buffers
;
#endif
// External BufferPool passed from outside.
BufferPool
buffer_pool
;
#if 0
PARTITION_CONTEXT *above_seg_context;
ENTROPY_CONTEXT *above_context[MAX_MB_PLANE];
TXFM_CONTEXT *above_txfm_context;
TXFM_CONTEXT *top_txfm_context[MAX_MB_PLANE];
TXFM_CONTEXT left_txfm_context[MAX_MB_PLANE][2 * MAX_MIB_SIZE];
int above_context_alloc_cols;
#endif
WarpedMotionParams
global_motion
[
TOTAL_REFS_PER_FRAME
];
#if 0
#if CONFIG_FILM_GRAIN
int film_grain_params_present;
aom_film_grain_t film_grain_params;
#endif
int cdef_pri_damping;
int cdef_sec_damping;
int nb_cdef_strengths;
int cdef_strengths[CDEF_MAX_STRENGTHS];
int cdef_uv_strengths[CDEF_MAX_STRENGTHS];
int cdef_bits;
int cdef_preset[4];
int delta_q_present_flag;
// Resolution of delta quant
int delta_q_res;
#if CONFIG_EXT_DELTA_Q
int delta_lf_present_flag;
// Resolution of delta lf level
int delta_lf_res;
// This is a flag for number of deltas of loop filter level
// 0: use 1 delta, for y_vertical, y_horizontal, u, and v
// 1: use separate deltas for each filter level
int delta_lf_multi;
#endif
int num_tg;
#endif
struct
{
BLOCK_SIZE
sb_size
;
int
enable_order_hint
;
int
order_hint_bits_minus1
;
}
seq_params
;
#if 0
SequenceHeader seq_params;
int current_frame_id;
int ref_frame_id[REF_FRAMES];
int valid_for_referencing[REF_FRAMES];
int refresh_mask;
int invalid_delta_frame_id_minus1;
LV_MAP_CTX_TABLE coeff_ctx_table;
#endif
TPL_MV_REF
*
tpl_mvs
;
#if 0
int tpl_mvs_mem_size;
#endif
// TODO(jingning): This can be combined with sign_bias later.
int8_t
ref_frame_side
[
TOTAL_REFS_PER_FRAME
];
#if 0
int frame_refs_short_signaling;
#if CONFIG_SCALABILITY
int temporal_layer_id;
int enhancement_layer_id;
int enhancement_layers_cnt;
#endif
#if TXCOEFF_TIMER
int64_t cum_txcoeff_timer;
int64_t txcoeff_timer;
int txb_count;
#endif
#if TXCOEFF_COST_TIMER
int64_t cum_txcoeff_cost_timer;
int64_t txcoeff_cost_timer;
int64_t txcoeff_cost_count;
#endif
const cfg_options_t *options;
#endif
int
ref_buf_idx
[
INTER_REFS_PER_FRAME
];
int
ref_order_hint
[
INTER_REFS_PER_FRAME
];
}
AV1_COMMON
;
...
...
@@ -988,12 +431,6 @@ static INLINE void clamp_mv(MV *mv, int min_col, int max_col, int min_row,
mv
->
row
=
clamp
(
mv
->
row
,
min_row
,
max_row
);
}