Commit 54c8e5da authored by clang-format's avatar clang-format Committed by Yaowu Xu

Apply Clang-format

Change-Id: Iaa3ca871a8106a8e57bbc40f4743cf934c98dcbf
parent f87b0f9c
......@@ -152,4 +152,3 @@ AOM_CTRL_USE_TYPE(AV1_GET_REFERENCE, av1_ref_frame_t *)
#endif
#endif // AOM_AOM_H_
......@@ -842,4 +842,3 @@ AOM_CTRL_USE_TYPE(AV1E_SET_RENDER_SIZE, int *)
#endif
#endif // AOM_AOMCX_H_
......@@ -64,7 +64,7 @@ enum aom_dec_control_id {
* a callback function and opaque context pointer.
*/
AOMD_SET_DECRYPTOR,
// AOMD_SET_DECRYPTOR = AOMD_SET_DECRYPTOR,
// AOMD_SET_DECRYPTOR = AOMD_SET_DECRYPTOR,
/** control function to get the dimensions that the current frame is decoded
* at. This may be different to the intended display size for the frame as
......@@ -144,7 +144,7 @@ AOM_CTRL_USE_TYPE(AOMD_GET_LAST_REF_USED, int *)
#define AOM_CTRL_AOMD_GET_LAST_REF_USED
AOM_CTRL_USE_TYPE(AOMD_SET_DECRYPTOR, aom_decrypt_init *)
#define AOM_CTRL_AOMD_SET_DECRYPTOR
//AOM_CTRL_USE_TYPE(AOMD_SET_DECRYPTOR, aom_decrypt_init *)
// AOM_CTRL_USE_TYPE(AOMD_SET_DECRYPTOR, aom_decrypt_init *)
//#define AOM_CTRL_AOMD_SET_DECRYPTOR
AOM_CTRL_USE_TYPE(AV1D_GET_DISPLAY_SIZE, int *)
#define AOM_CTRL_AV1D_GET_DISPLAY_SIZE
......@@ -163,4 +163,3 @@ AOM_CTRL_USE_TYPE(AV1_INVERT_TILE_DECODE_ORDER, int)
#endif
#endif // AOM_AOMDX_H_
......@@ -124,10 +124,10 @@ static INLINE int has_second_ref(const MB_MODE_INFO *mbmi) {
}
PREDICTION_MODE av1_left_block_mode(const MODE_INFO *cur_mi,
const MODE_INFO *left_mi, int b);
const MODE_INFO *left_mi, int b);
PREDICTION_MODE av1_above_block_mode(const MODE_INFO *cur_mi,
const MODE_INFO *above_mi, int b);
const MODE_INFO *above_mi, int b);
enum mv_precision { MV_PRECISION_Q3, MV_PRECISION_Q4 };
......@@ -307,13 +307,13 @@ void av1_foreach_transformed_block_in_plane(
foreach_transformed_block_visitor visit, void *arg);
void av1_foreach_transformed_block(const MACROBLOCKD *const xd,
BLOCK_SIZE bsize,
foreach_transformed_block_visitor visit,
void *arg);
BLOCK_SIZE bsize,
foreach_transformed_block_visitor visit,
void *arg);
void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob,
int aoff, int loff);
BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob,
int aoff, int loff);
#ifdef __cplusplus
} // extern "C"
......
......@@ -22,6 +22,6 @@
0 // 1 = filter both luma and chroma, 0 = filter only luma
void av1_clpf_frame(const YV12_BUFFER_CONFIG *frame, const AV1_COMMON *cm,
MACROBLOCKD *xd);
MACROBLOCKD *xd);
#endif
......@@ -27,14 +27,14 @@ extern "C" {
#endif
// Only need this for fixed-size arrays, for structs just assign.
#define av1_copy(dest, src) \
#define av1_copy(dest, src) \
{ \
assert(sizeof(dest) == sizeof(src)); \
memcpy(dest, src, sizeof(src)); \
}
// Use this for variably-sized arrays.
#define av1_copy_array(dest, src, n) \
#define av1_copy_array(dest, src, n) \
{ \
assert(sizeof(*dest) == sizeof(*src)); \
memcpy(dest, src, n * sizeof(*src)); \
......
......@@ -31,11 +31,10 @@ extern "C" {
int compute_level_from_index(int global_level, int gi);
int sb_all_skip(const AV1_COMMON *const cm, int mi_row, int mi_col);
void av1_dering_frame(YV12_BUFFER_CONFIG *frame, AV1_COMMON *cm,
MACROBLOCKD *xd, int global_level);
MACROBLOCKD *xd, int global_level);
int av1_dering_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref,
AV1_COMMON *cm,
MACROBLOCKD *xd);
AV1_COMMON *cm, MACROBLOCKD *xd);
#ifdef __cplusplus
} // extern "C"
......
......@@ -166,7 +166,7 @@ extern const aom_tree_index av1_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)];
extern const aom_prob av1_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES];
typedef aom_prob av1_coeff_probs_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
[UNCONSTRAINED_NODES];
[UNCONSTRAINED_NODES];
typedef unsigned int av1_coeff_count_model
[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1];
......
......@@ -55,8 +55,8 @@ typedef struct frame_contexts {
aom_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
av1_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES];
aom_prob
switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS - 1];
switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS -
1];
#if CONFIG_REF_MV
aom_prob newmv_prob[NEWMV_MODE_CONTEXTS];
......@@ -142,11 +142,11 @@ void av1_adapt_intra_frame_probs(struct AV1Common *cm);
void av1_adapt_inter_frame_probs(struct AV1Common *cm);
void av1_tx_counts_to_branch_counts_32x32(const unsigned int *tx_count_32x32p,
unsigned int (*ct_32x32p)[2]);
unsigned int (*ct_32x32p)[2]);
void av1_tx_counts_to_branch_counts_16x16(const unsigned int *tx_count_16x16p,
unsigned int (*ct_16x16p)[2]);
unsigned int (*ct_16x16p)[2]);
void av1_tx_counts_to_branch_counts_8x8(const unsigned int *tx_count_8x8p,
unsigned int (*ct_8x8p)[2]);
unsigned int (*ct_8x8p)[2]);
extern const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)];
......
......@@ -134,21 +134,21 @@ typedef uint8_t PREDICTION_MODE;
#if CONFIG_REF_MV
#define NMV_CONTEXTS 3
#define NEWMV_MODE_CONTEXTS 7
#define NEWMV_MODE_CONTEXTS 7
#define ZEROMV_MODE_CONTEXTS 2
#define REFMV_MODE_CONTEXTS 9
#define DRL_MODE_CONTEXTS 5
#define REFMV_MODE_CONTEXTS 9
#define DRL_MODE_CONTEXTS 5
#define ZEROMV_OFFSET 3
#define REFMV_OFFSET 4
#define REFMV_OFFSET 4
#define NEWMV_CTX_MASK ((1 << ZEROMV_OFFSET) - 1)
#define ZEROMV_CTX_MASK ((1 << (REFMV_OFFSET - ZEROMV_OFFSET)) - 1)
#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
#define ALL_ZERO_FLAG_OFFSET 8
#define SKIP_NEARESTMV_OFFSET 9
#define SKIP_NEARMV_OFFSET 10
#define ALL_ZERO_FLAG_OFFSET 8
#define SKIP_NEARESTMV_OFFSET 9
#define SKIP_NEARMV_OFFSET 10
#define SKIP_NEARESTMV_SUB8X8_OFFSET 11
#endif
......@@ -159,7 +159,7 @@ typedef uint8_t PREDICTION_MODE;
#if CONFIG_REF_MV
#define MAX_REF_MV_STACK_SIZE 16
#define REF_CAT_LEVEL 160
#define REF_CAT_LEVEL 160
#endif
#define INTRA_INTER_CONTEXTS 4
......
......@@ -41,7 +41,7 @@ void av1_free_internal_frame_buffers(InternalFrameBufferList *list);
// |min_size| is the minimum size in bytes needed to decode the next frame.
// |fb| pointer to the frame buffer.
int av1_get_frame_buffer(void *cb_priv, size_t min_size,
aom_codec_frame_buffer_t *fb);
aom_codec_frame_buffer_t *fb);
// Callback used by libaom when there are no references to the frame buffer.
// |cb_priv| is not used. |fb| pointer to the frame buffer.
......
......@@ -40,41 +40,41 @@ typedef struct {
#endif // CONFIG_AOM_HIGHBITDEPTH
void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
int eob);
int eob);
void av1_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
int eob);
int eob);
void av1_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest, int stride,
int eob, TX_TYPE tx_type, int lossless);
int eob, TX_TYPE tx_type, int lossless);
void av1_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, int stride,
int eob, TX_TYPE tx_type);
int eob, TX_TYPE tx_type);
void av1_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest, int stride,
int eob, TX_TYPE tx_type);
int eob, TX_TYPE tx_type);
void av1_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest, int stride,
int eob, TX_TYPE tx_type);
int eob, TX_TYPE tx_type);
#if CONFIG_AOM_HIGHBITDEPTH
void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
int eob, int bd);
int eob, int bd);
void av1_highbd_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
int eob, int bd);
int eob, int bd);
void av1_highbd_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride,
int eob, int bd);
int eob, int bd);
void av1_highbd_idct16x16_add(const tran_low_t *input, uint8_t *dest,
int stride, int eob, int bd);
int stride, int eob, int bd);
void av1_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest,
int stride, int eob, int bd);
int stride, int eob, int bd);
void av1_highbd_inv_txfm_add_4x4(const tran_low_t *input, uint8_t *dest,
int stride, int eob, int bd, TX_TYPE tx_type,
int lossless);
int stride, int eob, int bd, TX_TYPE tx_type,
int lossless);
void av1_highbd_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest,
int stride, int eob, int bd, TX_TYPE tx_type);
int stride, int eob, int bd, TX_TYPE tx_type);
void av1_highbd_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest,
int stride, int eob, int bd,
TX_TYPE tx_type);
int stride, int eob, int bd,
TX_TYPE tx_type);
void av1_highbd_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest,
int stride, int eob, int bd,
TX_TYPE tx_type);
int stride, int eob, int bd,
TX_TYPE tx_type);
#endif // CONFIG_AOM_HIGHBITDEPTH
#ifdef __cplusplus
} // extern "C"
......
......@@ -99,20 +99,20 @@ struct AV1LfSyncData;
// This function sets up the bit masks for the entire 64x64 region represented
// by mi_row, mi_col.
void av1_setup_mask(struct AV1Common *const cm, const int mi_row,
const int mi_col, MODE_INFO **mi_8x8,
const int mode_info_stride, LOOP_FILTER_MASK *lfm);
const int mi_col, MODE_INFO **mi_8x8,
const int mode_info_stride, LOOP_FILTER_MASK *lfm);
void av1_filter_block_plane_ss00(struct AV1Common *const cm,
struct macroblockd_plane *const plane,
int mi_row, LOOP_FILTER_MASK *lfm);
struct macroblockd_plane *const plane,
int mi_row, LOOP_FILTER_MASK *lfm);
void av1_filter_block_plane_ss11(struct AV1Common *const cm,
struct macroblockd_plane *const plane,
int mi_row, LOOP_FILTER_MASK *lfm);
struct macroblockd_plane *const plane,
int mi_row, LOOP_FILTER_MASK *lfm);
void av1_filter_block_plane_non420(struct AV1Common *cm,
struct macroblockd_plane *plane,
MODE_INFO **mi_8x8, int mi_row, int mi_col);
struct macroblockd_plane *plane,
MODE_INFO **mi_8x8, int mi_row, int mi_col);
void av1_loop_filter_init(struct AV1Common *cm);
......@@ -123,14 +123,14 @@ void av1_loop_filter_init(struct AV1Common *cm);
void av1_loop_filter_frame_init(struct AV1Common *cm, int default_filt_lvl);
void av1_loop_filter_frame(YV12_BUFFER_CONFIG *frame, struct AV1Common *cm,
struct macroblockd *mbd, int filter_level,
int y_only, int partial_frame);
struct macroblockd *mbd, int filter_level,
int y_only, int partial_frame);
// Apply the loop filter to [start, stop) macro block rows in frame_buffer.
void av1_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer,
struct AV1Common *cm,
struct macroblockd_plane planes[MAX_MB_PLANE],
int start, int stop, int y_only);
struct AV1Common *cm,
struct macroblockd_plane planes[MAX_MB_PLANE],
int start, int stop, int y_only);
typedef struct LoopFilterWorkerData {
YV12_BUFFER_CONFIG *frame_buffer;
......
......@@ -242,12 +242,13 @@ static INLINE int_mv get_sub_block_mv(const MODE_INFO *candidate, int which_mv,
#if CONFIG_REF_MV
static INLINE int_mv get_sub_block_pred_mv(const MODE_INFO *candidate,
int which_mv,
int search_col, int block_idx) {
return block_idx >= 0 && candidate->mbmi.sb_type < BLOCK_8X8 ?
candidate->bmi[idx_n_column_to_subblock[block_idx]
[search_col == 0]].pred_mv[which_mv] :
candidate->mbmi.pred_mv[which_mv];
int which_mv, int search_col,
int block_idx) {
return block_idx >= 0 && candidate->mbmi.sb_type < BLOCK_8X8
? candidate
->bmi[idx_n_column_to_subblock[block_idx][search_col == 0]]
.pred_mv[which_mv]
: candidate->mbmi.pred_mv[which_mv];
}
#endif
......@@ -316,18 +317,15 @@ static INLINE int is_inside(const TileInfo *const tile, int mi_col, int mi_row,
static INLINE void lower_mv_precision(MV *mv, int allow_hp) {
const int use_hp = allow_hp && av1_use_mv_hp(mv);
if (!use_hp) {
if (mv->row & 1)
mv->row += (mv->row > 0 ? -1 : 1);
if (mv->col & 1)
mv->col += (mv->col > 0 ? -1 : 1);
if (mv->row & 1) mv->row += (mv->row > 0 ? -1 : 1);
if (mv->col & 1) mv->col += (mv->col > 0 ? -1 : 1);
}
}
#if CONFIG_REF_MV
static INLINE int av1_nmv_ctx(const uint8_t ref_mv_count,
const CANDIDATE_MV *ref_mv_stack) {
if (ref_mv_stack[0].weight >= REF_CAT_LEVEL &&
ref_mv_count > 0) {
if (ref_mv_stack[0].weight >= REF_CAT_LEVEL && ref_mv_count > 0) {
if (abs(ref_mv_stack[0].this_mv.as_mv.row -
ref_mv_stack[0].pred_mv.as_mv.row) <= 4 &&
abs(ref_mv_stack[0].this_mv.as_mv.col -
......@@ -340,8 +338,7 @@ static INLINE int av1_nmv_ctx(const uint8_t ref_mv_count,
}
static int8_t av1_ref_frame_type(const MV_REFERENCE_FRAME *const rf) {
if (rf[1] > INTRA_FRAME)
return rf[0] + ALTREF_FRAME;
if (rf[1] > INTRA_FRAME) return rf[0] + ALTREF_FRAME;
return rf[0];
}
......@@ -376,7 +373,7 @@ static int16_t av1_mode_context_analyzer(const int16_t *const mode_context,
}
static INLINE uint8_t av1_drl_ctx(const CANDIDATE_MV *ref_mv_stack,
int ref_idx) {
int ref_idx) {
if (ref_mv_stack[ref_idx].weight >= REF_CAT_LEVEL &&
ref_mv_stack[ref_idx + 1].weight >= REF_CAT_LEVEL) {
if (ref_mv_stack[ref_idx].weight == ref_mv_stack[ref_idx + 1].weight)
......@@ -406,8 +403,7 @@ typedef void (*find_mv_refs_sync)(void *const data, int mi_row);
void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
#if CONFIG_REF_MV
uint8_t *ref_mv_count,
CANDIDATE_MV *ref_mv_stack,
uint8_t *ref_mv_count, CANDIDATE_MV *ref_mv_stack,
#endif
int_mv *mv_ref_list, int mi_row, int mi_col,
find_mv_refs_sync sync, void *const data,
......@@ -417,7 +413,7 @@ void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
// above and a number cols of pixels in the left to select the one with best
// score to use as ref motion vector
void av1_find_best_ref_mvs(int allow_hp, int_mv *mvlist, int_mv *nearest_mv,
int_mv *near_mv);
int_mv *near_mv);
void av1_append_sub8x8_mvs_for_idx(AV1_COMMON *cm, MACROBLOCKD *xd, int block,
int ref, int mi_row, int mi_col,
......
......@@ -10,14 +10,14 @@
*/
#if !defined(_dering_H)
# define _dering_H (1)
#define _dering_H (1)
# include "odintrin.h"
#include "odintrin.h"
# if defined(DAALA_ODINTRIN)
# include "filter.h"
#if defined(DAALA_ODINTRIN)
#include "filter.h"
typedef int16_t od_dering_in;
# endif
#endif
#define OD_DERINGSIZES (2)
......@@ -27,18 +27,21 @@ typedef int16_t od_dering_in;
#define OD_DERING_LEVELS (6)
extern const double OD_DERING_GAIN_TABLE[OD_DERING_LEVELS];
#define OD_DERING_NBLOCKS (OD_BSIZE_MAX/8)
#define OD_DERING_NBLOCKS (OD_BSIZE_MAX / 8)
#define OD_FILT_BORDER (3)
#define OD_FILT_BSTRIDE (OD_BSIZE_MAX + 2*OD_FILT_BORDER)
#define OD_FILT_BSTRIDE (OD_BSIZE_MAX + 2 * OD_FILT_BORDER)
extern const int OD_DIRECTION_OFFSETS_TABLE[8][3];
typedef void (*od_filter_dering_direction_func)(int16_t *y, int ystride,
const int16_t *in, int threshold, int dir);
const int16_t *in,
int threshold, int dir);
typedef void (*od_filter_dering_orthogonal_func)(int16_t *y, int ystride,
const int16_t *in, const od_dering_in *x, int xstride, int threshold,
int dir);
const int16_t *in,
const od_dering_in *x,
int xstride, int threshold,
int dir);
struct od_dering_opt_vtbl {
od_filter_dering_direction_func filter_dering_direction[OD_DERINGSIZES];
......@@ -46,28 +49,31 @@ struct od_dering_opt_vtbl {
};
typedef struct od_dering_opt_vtbl od_dering_opt_vtbl;
void od_dering(const od_dering_opt_vtbl *vtbl, int16_t *y, int ystride,
const od_dering_in *x, int xstride, int nvb, int nhb, int sbx, int sby,
int nhsb, int nvsb, int xdec, int dir[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS],
int pli, unsigned char *bskip, int skip_stride, int threshold, int overlap,
int coeff_shift);
const od_dering_in *x, int xstride, int nvb, int nhb, int sbx,
int sby, int nhsb, int nvsb, int xdec,
int dir[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS], int pli,
unsigned char *bskip, int skip_stride, int threshold,
int overlap, int coeff_shift);
void od_filter_dering_direction_c(int16_t *y, int ystride, const int16_t *in,
int ln, int threshold, int dir);
int ln, int threshold, int dir);
void od_filter_dering_orthogonal_c(int16_t *y, int ystride, const int16_t *in,
const od_dering_in *x, int xstride, int ln, int threshold, int dir);
const od_dering_in *x, int xstride, int ln,
int threshold, int dir);
extern const od_dering_opt_vtbl OD_DERING_VTBL_C;
void od_filter_dering_direction_4x4_c(int16_t *y, int ystride,
const int16_t *in, int threshold, int dir);
const int16_t *in, int threshold,
int dir);
void od_filter_dering_direction_8x8_c(int16_t *y, int ystride,
const int16_t *in, int threshold, int dir);
const int16_t *in, int threshold,
int dir);
void od_filter_dering_orthogonal_4x4_c(int16_t *y, int ystride,
const int16_t *in, const od_dering_in *x, int xstride, int threshold,
int dir);
const int16_t *in, const od_dering_in *x,
int xstride, int threshold, int dir);
void od_filter_dering_orthogonal_8x8_c(int16_t *y, int ystride,
const int16_t *in, const od_dering_in *x, int xstride, int threshold,
int dir);
const int16_t *in, const od_dering_in *x,
int xstride, int threshold, int dir);
#endif
......@@ -21,42 +21,43 @@ extern "C" {
#endif
/*Smallest blocks are 4x4*/
# define OD_LOG_BSIZE0 (2)
#define OD_LOG_BSIZE0 (2)
/*There are 5 block sizes total (4x4, 8x8, 16x16, 32x32 and 64x64).*/
# define OD_NBSIZES (5)
#define OD_NBSIZES (5)
/*The log of the maximum length of the side of a block.*/
# define OD_LOG_BSIZE_MAX (OD_LOG_BSIZE0 + OD_NBSIZES - 1)
#define OD_LOG_BSIZE_MAX (OD_LOG_BSIZE0 + OD_NBSIZES - 1)
/*The maximum length of the side of a block.*/
# define OD_BSIZE_MAX (1 << OD_LOG_BSIZE_MAX)
#define OD_BSIZE_MAX (1 << OD_LOG_BSIZE_MAX)
typedef int od_coeff;
typedef int16_t od_dering_in;
# define OD_DIVU_DMAX (1024)
#define OD_DIVU_DMAX (1024)
extern uint32_t OD_DIVU_SMALL_CONSTS[OD_DIVU_DMAX][2];
/*Translate unsigned division by small divisors into multiplications.*/
# define OD_DIVU_SMALL(_x, _d) \
((uint32_t)((OD_DIVU_SMALL_CONSTS[(_d)-1][0]* \
(uint64_t)(_x)+OD_DIVU_SMALL_CONSTS[(_d)-1][1])>>32)>> \
(OD_ILOG(_d)-1))
#define OD_DIVU_SMALL(_x, _d) \
((uint32_t)((OD_DIVU_SMALL_CONSTS[(_d)-1][0] * (uint64_t)(_x) + \
OD_DIVU_SMALL_CONSTS[(_d)-1][1]) >> \
32) >> \
(OD_ILOG(_d) - 1))
# define OD_DIVU(_x, _d) \
(((_d) < OD_DIVU_DMAX)?(OD_DIVU_SMALL((_x), (_d))):((_x)/(_d)))
#define OD_DIVU(_x, _d) \
(((_d) < OD_DIVU_DMAX) ? (OD_DIVU_SMALL((_x), (_d))) : ((_x) / (_d)))
#define OD_MINI AOMMIN
#define OD_CLAMPI(min, val, max) clamp((val), (min), (max))
# define OD_CLZ0 (1)
# define OD_CLZ(x) (-get_msb(x))
# define OD_ILOG_NZ(x) (OD_CLZ0 - OD_CLZ(x))
#define OD_CLZ0 (1)
#define OD_CLZ(x) (-get_msb(x))
#define OD_ILOG_NZ(x) (OD_CLZ0 - OD_CLZ(x))
/*Note that __builtin_clz is not defined when x == 0, according to the gcc
documentation (and that of the x86 BSR instruction that implements it), so
we have to special-case it.
We define a special version of the macro to use when x can be zero.*/
# define OD_ILOG(x) ((x) ? OD_ILOG_NZ(x) : 0)
#define OD_ILOG(x) ((x) ? OD_ILOG_NZ(x) : 0)
#ifdef __cplusplus
} // extern "C"
......
......@@ -389,7 +389,7 @@ static INLINE int frame_is_intra_only(const AV1_COMMON *const cm) {
}
static INLINE void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd,
tran_low_t *dqcoeff) {
tran_low_t *dqcoeff) {
int i;
for (i = 0; i < MAX_MB_PLANE; ++i) {
......@@ -469,12 +469,10 @@ static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile,
#if CONFIG_REF_MV
xd->is_sec_rect = 0;
if (xd->n8_w < xd->n8_h)
if (mi_col & (xd->n8_h - 1))
xd->is_sec_rect = 1;
if (mi_col & (xd->n8_h - 1)) xd->is_sec_rect = 1;
if (xd->n8_w > xd->n8_h)
if (mi_row & (xd->n8_w - 1))
xd->is_sec_rect = 1;
if (mi_row & (xd->n8_w - 1)) xd->is_sec_rect = 1;
#endif
}
......
......@@ -63,7 +63,7 @@ static INLINE int av1_get_skip_context(const MACROBLOCKD *xd) {
}
static INLINE aom_prob av1_get_skip_prob(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
const MACROBLOCKD *xd) {
return cm->fc->skip_probs[av1_get_skip_context(xd)];
}
......@@ -72,23 +72,22 @@ int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
int av1_get_intra_inter_context(const MACROBLOCKD *xd);
static INLINE aom_prob av1_get_intra_inter_prob(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
const MACROBLOCKD *xd) {
return cm->fc->intra_inter_prob[av1_get_intra_inter_context(xd)];
}
int av1_get_reference_mode_context(const AV1_COMMON *cm,
const MACROBLOCKD *xd);
int av1_get_reference_mode_context(const AV1_COMMON *cm, const MACROBLOCKD *xd);
static INLINE aom_prob av1_get_reference_mode_prob(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
const MACROBLOCKD *xd) {
return cm->fc->comp_inter_prob[av1_get_reference_mode_context(cm, xd)];
}
int av1_get_pred_context_comp_ref_p(const AV1_COMMON *cm,
const MACROBLOCKD *xd);
const MACROBLOCKD *xd);
static INLINE aom_prob av1_get_pred_prob_comp_ref_p(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
const MACROBLOCKD *xd) {
const int pred_context = av1_get_pred_context_comp_ref_p(cm, xd);
return cm->fc->comp_ref_prob[pred_context];
}
......@@ -96,14 +95,14 @@ static INLINE aom_prob av1_get_pred_prob_comp_ref_p(const AV1_COMMON *cm,
int av1_get_pred_context_single_ref_p1(const MACROBLOCKD *xd);
static INLINE aom_prob av1_get_pred_prob_single_ref_p1(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
const MACROBLOCKD *xd) {
return cm->fc->single_ref_prob[av1_get_pred_context_single_ref_p1(xd)][0];
}
int av1_get_pred_context_single_ref_p2(const MACROBLOCKD *xd);
static INLINE aom_prob av1_get_pred_prob_single_ref_p2(const AV1_COMMON *cm,
const MACROBLOCKD *xd) {
const MACROBLOCKD *xd) {
return cm->fc->single_ref_prob[av1_get_pred_context_single_ref_p2(xd)][1];
}
......
......@@ -41,7 +41,7 @@ int16_t av1_dc_quant(int qindex, int delta, aom_bit_depth_t bit_depth);
int16_t av1_ac_quant(int qindex, int delta, aom_bit_depth_t bit_depth);
int av1_get_qindex(const struct segmentation *seg, int segment_id,
int base_qindex);
int base_qindex);
#if CONFIG_AOM_QM
// Reduce the large number of quantizers to a smaller number of levels for which
// different matrices may be defined
......
......@@ -113,26 +113,26 @@ void build_inter_predictors(MACROBLOCKD *xd, int plane, int block, int bw,
int bh, int x, int y, int w, int h, int mi_x,
int mi_y);
void av1_build_inter_predictor_sub8x8(MACROBLOCKD *xd, int plane, int i,
int ir, int ic, int mi_row, int mi_col);
void av1_build_inter_predictor_sub8x8(MACROBLOCKD *xd, int plane, int i, int ir,
int ic, int mi_row, int mi_col);
void av1_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col,
BLOCK_SIZE bsize);
BLOCK_SIZE bsize);
void av1_build_inter_predictors_sbp(MACROBLOCKD *xd, int mi_row, int mi_col,
BLOCK_SIZE bsize, int plane);
BLOCK_SIZE bsize, int plane);
void av1_build_inter_predictors_sbuv(MACROBLOCKD *xd, int mi_row, int mi_col,
BLOCK_SIZE bsize);
BLOCK_SIZE bsize);
void av1_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col,
BLOCK_SIZE bsize);
BLOCK_SIZE bsize);
void av1_build_inter_predictor(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride, const MV *mv_q3,
const struct scale_factors *sf, int w, int h,
int do_avg, const InterpKernel *kernel,
enum mv_precision precision, int x, int y);
void av1_build_inter_predictor(const uint8_t *src, int src_stride, uint8_t *dst,
int dst_stride, const MV *mv_q3,
const struct scale_factors *sf, int w, int h,
int do_avg, const InterpKernel *kernel,
enum mv_precision precision, int x, int y);
#if CONFIG_AOM_HIGHBITDEPTH
void av1_highbd_build_inter_predictor(
......@@ -160,12 +160,12 @@ static INLINE void setup_pred_plane(struct buf_2d *dst, uint8_t *src,
}
void av1_setup_dst_planes(struct macroblockd_plane planes[MAX_MB_PLANE],
const YV12_BUFFER_CONFIG *src, int mi_row,
int mi_col);
const YV12_BUFFER_CONFIG *src, int mi_row,
int mi_col);
void av1_setup_pre_planes(MACROBLOCKD *xd, int idx,
const YV12_BUFFER_CONFIG *src, int mi_row,
int mi_col, const struct scale_factors *sf);
const YV12_BUFFER_CONFIG *src, int mi_row, int mi_col,
const struct scale_factors *sf);
#ifdef __cplusplus
} // extern "C"
......
......@@ -22,9 +22,9 @@ extern "C" {
void av1_init_intra_predictors(void);
void av1_predict_intra_block(const MACROBLOCKD *xd, int bwl_in, int bhl_in,
TX_SIZE tx_size, PREDICTION_MODE mode,
const uint8_t *ref, int ref_stride, uint8_t *dst,
int dst_stride, int aoff, int loff, int plane);
TX_SIZE tx_size, PREDICTION_MODE mode,
const uint8_t *ref, int ref_stride, uint8_t *dst,
int dst_stride, int aoff, int loff, int plane);
#ifdef __cplusplus
} // extern "C"