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 *) ...@@ -152,4 +152,3 @@ AOM_CTRL_USE_TYPE(AV1_GET_REFERENCE, av1_ref_frame_t *)
#endif #endif
#endif // AOM_AOM_H_ #endif // AOM_AOM_H_
...@@ -842,4 +842,3 @@ AOM_CTRL_USE_TYPE(AV1E_SET_RENDER_SIZE, int *) ...@@ -842,4 +842,3 @@ AOM_CTRL_USE_TYPE(AV1E_SET_RENDER_SIZE, int *)
#endif #endif
#endif // AOM_AOMCX_H_ #endif // AOM_AOMCX_H_
...@@ -64,7 +64,7 @@ enum aom_dec_control_id { ...@@ -64,7 +64,7 @@ enum aom_dec_control_id {
* a callback function and opaque context pointer. * a callback function and opaque context pointer.
*/ */
AOMD_SET_DECRYPTOR, 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 /** 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 * 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 *) ...@@ -144,7 +144,7 @@ AOM_CTRL_USE_TYPE(AOMD_GET_LAST_REF_USED, int *)
#define AOM_CTRL_AOMD_GET_LAST_REF_USED #define AOM_CTRL_AOMD_GET_LAST_REF_USED
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 #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 //#define AOM_CTRL_AOMD_SET_DECRYPTOR
AOM_CTRL_USE_TYPE(AV1D_GET_DISPLAY_SIZE, int *) AOM_CTRL_USE_TYPE(AV1D_GET_DISPLAY_SIZE, int *)
#define AOM_CTRL_AV1D_GET_DISPLAY_SIZE #define AOM_CTRL_AV1D_GET_DISPLAY_SIZE
...@@ -163,4 +163,3 @@ AOM_CTRL_USE_TYPE(AV1_INVERT_TILE_DECODE_ORDER, int) ...@@ -163,4 +163,3 @@ AOM_CTRL_USE_TYPE(AV1_INVERT_TILE_DECODE_ORDER, int)
#endif #endif
#endif // AOM_AOMDX_H_ #endif // AOM_AOMDX_H_
...@@ -124,10 +124,10 @@ static INLINE int has_second_ref(const MB_MODE_INFO *mbmi) { ...@@ -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, 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, 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 }; enum mv_precision { MV_PRECISION_Q3, MV_PRECISION_Q4 };
...@@ -307,13 +307,13 @@ void av1_foreach_transformed_block_in_plane( ...@@ -307,13 +307,13 @@ void av1_foreach_transformed_block_in_plane(
foreach_transformed_block_visitor visit, void *arg); foreach_transformed_block_visitor visit, void *arg);
void av1_foreach_transformed_block(const MACROBLOCKD *const xd, void av1_foreach_transformed_block(const MACROBLOCKD *const xd,
BLOCK_SIZE bsize, BLOCK_SIZE bsize,
foreach_transformed_block_visitor visit, foreach_transformed_block_visitor visit,
void *arg); void *arg);
void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob,
int aoff, int loff); int aoff, int loff);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
......
...@@ -22,6 +22,6 @@ ...@@ -22,6 +22,6 @@
0 // 1 = filter both luma and chroma, 0 = filter only luma 0 // 1 = filter both luma and chroma, 0 = filter only luma
void av1_clpf_frame(const YV12_BUFFER_CONFIG *frame, const AV1_COMMON *cm, void av1_clpf_frame(const YV12_BUFFER_CONFIG *frame, const AV1_COMMON *cm,
MACROBLOCKD *xd); MACROBLOCKD *xd);
#endif #endif
...@@ -27,14 +27,14 @@ extern "C" { ...@@ -27,14 +27,14 @@ extern "C" {
#endif #endif
// Only need this for fixed-size arrays, for structs just assign. // 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)); \ assert(sizeof(dest) == sizeof(src)); \
memcpy(dest, src, sizeof(src)); \ memcpy(dest, src, sizeof(src)); \
} }
// Use this for variably-sized arrays. // 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)); \ assert(sizeof(*dest) == sizeof(*src)); \
memcpy(dest, src, n * sizeof(*src)); \ memcpy(dest, src, n * sizeof(*src)); \
......
...@@ -31,11 +31,10 @@ extern "C" { ...@@ -31,11 +31,10 @@ extern "C" {
int compute_level_from_index(int global_level, int gi); 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); 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, 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, int av1_dering_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref,
AV1_COMMON *cm, AV1_COMMON *cm, MACROBLOCKD *xd);
MACROBLOCKD *xd);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
......
...@@ -166,7 +166,7 @@ extern const aom_tree_index av1_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)]; ...@@ -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]; 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] typedef aom_prob av1_coeff_probs_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
[UNCONSTRAINED_NODES]; [UNCONSTRAINED_NODES];
typedef unsigned int av1_coeff_count_model typedef unsigned int av1_coeff_count_model
[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1]; [REF_TYPES][COEF_BANDS][COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1];
......
...@@ -55,8 +55,8 @@ typedef struct frame_contexts { ...@@ -55,8 +55,8 @@ typedef struct frame_contexts {
aom_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1]; aom_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
av1_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES]; av1_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES];
aom_prob aom_prob
switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS] switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS -
[SWITCHABLE_FILTERS - 1]; 1];
#if CONFIG_REF_MV #if CONFIG_REF_MV
aom_prob newmv_prob[NEWMV_MODE_CONTEXTS]; aom_prob newmv_prob[NEWMV_MODE_CONTEXTS];
...@@ -142,11 +142,11 @@ void av1_adapt_intra_frame_probs(struct AV1Common *cm); ...@@ -142,11 +142,11 @@ void av1_adapt_intra_frame_probs(struct AV1Common *cm);
void av1_adapt_inter_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, 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, 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, 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)]; extern const aom_tree_index av1_ext_tx_tree[TREE_SIZE(TX_TYPES)];
......
...@@ -134,21 +134,21 @@ typedef uint8_t PREDICTION_MODE; ...@@ -134,21 +134,21 @@ typedef uint8_t PREDICTION_MODE;
#if CONFIG_REF_MV #if CONFIG_REF_MV
#define NMV_CONTEXTS 3 #define NMV_CONTEXTS 3
#define NEWMV_MODE_CONTEXTS 7 #define NEWMV_MODE_CONTEXTS 7
#define ZEROMV_MODE_CONTEXTS 2 #define ZEROMV_MODE_CONTEXTS 2
#define REFMV_MODE_CONTEXTS 9 #define REFMV_MODE_CONTEXTS 9
#define DRL_MODE_CONTEXTS 5 #define DRL_MODE_CONTEXTS 5
#define ZEROMV_OFFSET 3 #define ZEROMV_OFFSET 3
#define REFMV_OFFSET 4 #define REFMV_OFFSET 4
#define NEWMV_CTX_MASK ((1 << ZEROMV_OFFSET) - 1) #define NEWMV_CTX_MASK ((1 << ZEROMV_OFFSET) - 1)
#define ZEROMV_CTX_MASK ((1 << (REFMV_OFFSET - ZEROMV_OFFSET)) - 1) #define ZEROMV_CTX_MASK ((1 << (REFMV_OFFSET - ZEROMV_OFFSET)) - 1)
#define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1) #define REFMV_CTX_MASK ((1 << (8 - REFMV_OFFSET)) - 1)
#define ALL_ZERO_FLAG_OFFSET 8 #define ALL_ZERO_FLAG_OFFSET 8
#define SKIP_NEARESTMV_OFFSET 9 #define SKIP_NEARESTMV_OFFSET 9
#define SKIP_NEARMV_OFFSET 10 #define SKIP_NEARMV_OFFSET 10
#define SKIP_NEARESTMV_SUB8X8_OFFSET 11 #define SKIP_NEARESTMV_SUB8X8_OFFSET 11
#endif #endif
...@@ -159,7 +159,7 @@ typedef uint8_t PREDICTION_MODE; ...@@ -159,7 +159,7 @@ typedef uint8_t PREDICTION_MODE;
#if CONFIG_REF_MV #if CONFIG_REF_MV
#define MAX_REF_MV_STACK_SIZE 16 #define MAX_REF_MV_STACK_SIZE 16
#define REF_CAT_LEVEL 160 #define REF_CAT_LEVEL 160
#endif #endif
#define INTRA_INTER_CONTEXTS 4 #define INTRA_INTER_CONTEXTS 4
......
...@@ -41,7 +41,7 @@ void av1_free_internal_frame_buffers(InternalFrameBufferList *list); ...@@ -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. // |min_size| is the minimum size in bytes needed to decode the next frame.
// |fb| pointer to the frame buffer. // |fb| pointer to the frame buffer.
int av1_get_frame_buffer(void *cb_priv, size_t min_size, 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. // Callback used by libaom when there are no references to the frame buffer.
// |cb_priv| is not used. |fb| pointer to the frame buffer. // |cb_priv| is not used. |fb| pointer to the frame buffer.
......
...@@ -40,41 +40,41 @@ typedef struct { ...@@ -40,41 +40,41 @@ typedef struct {
#endif // CONFIG_AOM_HIGHBITDEPTH #endif // CONFIG_AOM_HIGHBITDEPTH
void av1_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, 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, 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, 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, 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, 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, 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 #if CONFIG_AOM_HIGHBITDEPTH
void av1_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride, 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, 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, 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, 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, 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, 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 stride, int eob, int bd, TX_TYPE tx_type,
int lossless); int lossless);
void av1_highbd_inv_txfm_add_8x8(const tran_low_t *input, uint8_t *dest, 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, void av1_highbd_inv_txfm_add_16x16(const tran_low_t *input, uint8_t *dest,
int stride, int eob, int bd, int stride, int eob, int bd,
TX_TYPE tx_type); TX_TYPE tx_type);
void av1_highbd_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest, void av1_highbd_inv_txfm_add_32x32(const tran_low_t *input, uint8_t *dest,
int stride, int eob, int bd, int stride, int eob, int bd,
TX_TYPE tx_type); TX_TYPE tx_type);
#endif // CONFIG_AOM_HIGHBITDEPTH #endif // CONFIG_AOM_HIGHBITDEPTH
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
......
...@@ -99,20 +99,20 @@ struct AV1LfSyncData; ...@@ -99,20 +99,20 @@ struct AV1LfSyncData;
// This function sets up the bit masks for the entire 64x64 region represented // This function sets up the bit masks for the entire 64x64 region represented
// by mi_row, mi_col. // by mi_row, mi_col.
void av1_setup_mask(struct AV1Common *const cm, const int mi_row, void av1_setup_mask(struct AV1Common *const cm, const int mi_row,
const int mi_col, MODE_INFO **mi_8x8, const int mi_col, MODE_INFO **mi_8x8,
const int mode_info_stride, LOOP_FILTER_MASK *lfm); const int mode_info_stride, LOOP_FILTER_MASK *lfm);
void av1_filter_block_plane_ss00(struct AV1Common *const cm, void av1_filter_block_plane_ss00(struct AV1Common *const cm,
struct macroblockd_plane *const plane, struct macroblockd_plane *const plane,
int mi_row, LOOP_FILTER_MASK *lfm); int mi_row, LOOP_FILTER_MASK *lfm);
void av1_filter_block_plane_ss11(struct AV1Common *const cm, void av1_filter_block_plane_ss11(struct AV1Common *const cm,
struct macroblockd_plane *const plane, struct macroblockd_plane *const plane,
int mi_row, LOOP_FILTER_MASK *lfm); int mi_row, LOOP_FILTER_MASK *lfm);
void av1_filter_block_plane_non420(struct AV1Common *cm, void av1_filter_block_plane_non420(struct AV1Common *cm,
struct macroblockd_plane *plane, struct macroblockd_plane *plane,
MODE_INFO **mi_8x8, int mi_row, int mi_col); MODE_INFO **mi_8x8, int mi_row, int mi_col);
void av1_loop_filter_init(struct AV1Common *cm); void av1_loop_filter_init(struct AV1Common *cm);
...@@ -123,14 +123,14 @@ 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_init(struct AV1Common *cm, int default_filt_lvl);
void av1_loop_filter_frame(YV12_BUFFER_CONFIG *frame, struct AV1Common *cm, void av1_loop_filter_frame(YV12_BUFFER_CONFIG *frame, struct AV1Common *cm,
struct macroblockd *mbd, int filter_level, struct macroblockd *mbd, int filter_level,
int y_only, int partial_frame); int y_only, int partial_frame);
// Apply the loop filter to [start, stop) macro block rows in frame_buffer. // Apply the loop filter to [start, stop) macro block rows in frame_buffer.
void av1_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer, void av1_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer,
struct AV1Common *cm, struct AV1Common *cm,
struct macroblockd_plane planes[MAX_MB_PLANE], struct macroblockd_plane planes[MAX_MB_PLANE],
int start, int stop, int y_only); int start, int stop, int y_only);
typedef struct LoopFilterWorkerData { typedef struct LoopFilterWorkerData {
YV12_BUFFER_CONFIG *frame_buffer; YV12_BUFFER_CONFIG *frame_buffer;
......
...@@ -242,12 +242,13 @@ static INLINE int_mv get_sub_block_mv(const MODE_INFO *candidate, int which_mv, ...@@ -242,12 +242,13 @@ static INLINE int_mv get_sub_block_mv(const MODE_INFO *candidate, int which_mv,
#if CONFIG_REF_MV #if CONFIG_REF_MV
static INLINE int_mv get_sub_block_pred_mv(const MODE_INFO *candidate, static INLINE int_mv get_sub_block_pred_mv(const MODE_INFO *candidate,
int which_mv, int which_mv, int search_col,
int search_col, int block_idx) { int block_idx) {
return block_idx >= 0 && candidate->mbmi.sb_type < BLOCK_8X8 ? return block_idx >= 0 && candidate->mbmi.sb_type < BLOCK_8X8
candidate->bmi[idx_n_column_to_subblock[block_idx] ? candidate
[search_col == 0]].pred_mv[which_mv] : ->bmi[idx_n_column_to_subblock[block_idx][search_col == 0]]
candidate->mbmi.pred_mv[which_mv]; .pred_mv[which_mv]
: candidate->mbmi.pred_mv[which_mv];
} }
#endif #endif
...@@ -316,18 +317,15 @@ static INLINE int is_inside(const TileInfo *const tile, int mi_col, int mi_row, ...@@ -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) { static INLINE void lower_mv_precision(MV *mv, int allow_hp) {
const int use_hp = allow_hp && av1_use_mv_hp(mv); const int use_hp = allow_hp && av1_use_mv_hp(mv);
if (!use_hp) { if (!use_hp) {
if (mv->row & 1) if (mv->row & 1) mv->row += (mv->row > 0 ? -1 : 1);
mv->row += (mv->row > 0 ? -1 : 1); if (mv->col & 1) mv->col += (mv->col > 0 ? -1 : 1);
if (mv->col & 1)
mv->col += (mv->col > 0 ? -1 : 1);
} }
} }
#if CONFIG_REF_MV #if CONFIG_REF_MV
static INLINE int av1_nmv_ctx(const uint8_t ref_mv_count, static INLINE int av1_nmv_ctx(const uint8_t ref_mv_count,
const CANDIDATE_MV *ref_mv_stack) { const CANDIDATE_MV *ref_mv_stack) {
if (ref_mv_stack[0].weight >= REF_CAT_LEVEL && if (ref_mv_stack[0].weight >= REF_CAT_LEVEL && ref_mv_count > 0) {
ref_mv_count > 0) {
if (abs(ref_mv_stack[0].this_mv.as_mv.row - if (abs(ref_mv_stack[0].this_mv.as_mv.row -
ref_mv_stack[0].pred_mv.as_mv.row) <= 4 && ref_mv_stack[0].pred_mv.as_mv.row) <= 4 &&
abs(ref_mv_stack[0].this_mv.as_mv.col - 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, ...@@ -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) { static int8_t av1_ref_frame_type(const MV_REFERENCE_FRAME *const rf) {
if (rf[1] > INTRA_FRAME) if (rf[1] > INTRA_FRAME) return rf[0] + ALTREF_FRAME;
return rf[0] + ALTREF_FRAME;
return rf[0]; return rf[0];
} }
...@@ -376,7 +373,7 @@ static int16_t av1_mode_context_analyzer(const int16_t *const mode_context, ...@@ -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, 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 && if (ref_mv_stack[ref_idx].weight >= REF_CAT_LEVEL &&
ref_mv_stack[ref_idx + 1].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) 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); ...@@ -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, void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame, MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
#if CONFIG_REF_MV #if CONFIG_REF_MV
uint8_t *ref_mv_count, uint8_t *ref_mv_count, CANDIDATE_MV *ref_mv_stack,
CANDIDATE_MV *ref_mv_stack,
#endif #endif
int_mv *mv_ref_list, int mi_row, int mi_col, int_mv *mv_ref_list, int mi_row, int mi_col,
find_mv_refs_sync sync, void *const data, find_mv_refs_sync sync, void *const data,
...@@ -417,7 +413,7 @@ void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -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 // above and a number cols of pixels in the left to select the one with best
// score to use as ref motion vector // score to use as ref motion vector
void av1_find_best_ref_mvs(int allow_hp, int_mv *mvlist, int_mv *nearest_mv, 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, void av1_append_sub8x8_mvs_for_idx(AV1_COMMON *cm, MACROBLOCKD *xd, int block,
int ref, int mi_row, int mi_col, int ref, int mi_row, int mi_col,
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
*/ */
#if !defined(_dering_H) #if !defined(_dering_H)
# define _dering_H (1) #define _dering_H (1)
# include "odintrin.h" #include "odintrin.h"
# if defined(DAALA_ODINTRIN) #if defined(DAALA_ODINTRIN)
# include "filter.h" #include "filter.h"
typedef int16_t od_dering_in; typedef int16_t od_dering_in;
# endif #endif
#define OD_DERINGSIZES (2) #define OD_DERINGSIZES (2)
...@@ -27,18 +27,21 @@ typedef int16_t od_dering_in; ...@@ -27,18 +27,21 @@ typedef int16_t od_dering_in;
#define OD_DERING_LEVELS (6) #define OD_DERING_LEVELS (6)
extern const double OD_DERING_GAIN_TABLE[OD_DERING_LEVELS]; 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_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]; extern const int OD_DIRECTION_OFFSETS_TABLE[8][3];
typedef void (*od_filter_dering_direction_func)(int16_t *y, int ystride, 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, 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, const int16_t *in,
int dir); const od_dering_in *x,
int xstride, int threshold,
int dir);
struct od_dering_opt_vtbl { struct od_dering_opt_vtbl {
od_filter_dering_direction_func filter_dering_direction[OD_DERINGSIZES]; od_filter_dering_direction_func filter_dering_direction[OD_DERINGSIZES];
...@@ -46,28 +49,31 @@ struct od_dering_opt_vtbl { ...@@ -46,28 +49,31 @@ struct od_dering_opt_vtbl {
}; };
typedef struct od_dering_opt_vtbl 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, 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, const od_dering_in *x, int xstride, int nvb, int nhb, int sbx,
int nhsb, int nvsb, int xdec, int dir[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS], int sby, int nhsb, int nvsb, int xdec,
int pli, unsigned char *bskip, int skip_stride, int threshold, int overlap, int dir[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS], int pli,
int coeff_shift); unsigned char *bskip, int skip_stride, int threshold,
int overlap, int coeff_shift);
void od_filter_dering_direction_c(int16_t *y, int