diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index 4af521e38..32311796d 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -140,7 +140,7 @@ typedef struct { // Flags used for prediction status of various bit-stream signals unsigned char seg_id_predicted; - INTERPOLATIONFILTERTYPE interp_filter; + INTERPOLATION_TYPE interp_filter; BLOCK_SIZE sb_type; } MB_MODE_INFO; diff --git a/vp9/common/vp9_common.h b/vp9/common/vp9_common.h index 3ac192b4a..36d1cdf14 100644 --- a/vp9/common/vp9_common.h +++ b/vp9/common/vp9_common.h @@ -84,9 +84,11 @@ static int get_unsigned_bits(unsigned int num_values) { } while (0) #endif -#define SYNC_CODE_0 0x49 -#define SYNC_CODE_1 0x83 -#define SYNC_CODE_2 0x42 +#define VP9_SYNC_CODE_0 0x49 +#define VP9_SYNC_CODE_1 0x83 +#define VP9_SYNC_CODE_2 0x42 + +#define VP9_FRAME_MARKER 0x2 #endif // VP9_COMMON_VP9_COMMON_H_ diff --git a/vp9/common/vp9_filter.c b/vp9/common/vp9_filter.c index cedd44cad..8f24052c7 100644 --- a/vp9/common/vp9_filter.c +++ b/vp9/common/vp9_filter.c @@ -97,7 +97,7 @@ DECLARE_ALIGNED(256, const subpel_kernel, { 0, -3, 1, 38, 64, 32, -1, -3} }; -const subpel_kernel *vp9_get_filter_kernel(INTERPOLATIONFILTERTYPE type) { +const subpel_kernel *vp9_get_filter_kernel(INTERPOLATION_TYPE type) { switch (type) { case EIGHTTAP: return vp9_sub_pel_filters_8; @@ -108,7 +108,7 @@ const subpel_kernel *vp9_get_filter_kernel(INTERPOLATIONFILTERTYPE type) { case BILINEAR: return vp9_bilinear_filters; default: - assert(!"Invalid filter type."); + assert(!"Invalid interpolation type."); return NULL; } } diff --git a/vp9/common/vp9_filter.h b/vp9/common/vp9_filter.h index 302945374..8652a6e3b 100644 --- a/vp9/common/vp9_filter.h +++ b/vp9/common/vp9_filter.h @@ -27,7 +27,7 @@ typedef enum { EIGHTTAP_SHARP = 2, BILINEAR = 3, SWITCHABLE = 4 /* should be the last one */ -} INTERPOLATIONFILTERTYPE; +} INTERPOLATION_TYPE; typedef int16_t subpel_kernel[SUBPEL_TAPS]; @@ -36,7 +36,7 @@ struct subpix_fn_table { const subpel_kernel *filter_y; }; -const subpel_kernel *vp9_get_filter_kernel(INTERPOLATIONFILTERTYPE type); +const subpel_kernel *vp9_get_filter_kernel(INTERPOLATION_TYPE type); extern const subpel_kernel vp9_bilinear_filters[SUBPEL_SHIFTS]; extern const subpel_kernel vp9_sub_pel_filters_6[SUBPEL_SHIFTS]; diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 254da14ac..289210ecb 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -172,7 +172,7 @@ typedef struct VP9Common { // Persistent mb segment id map used in prediction. unsigned char *last_frame_seg_map; - INTERPOLATIONFILTERTYPE mcomp_filter_type; + INTERPOLATION_TYPE mcomp_filter_type; loop_filter_info_n lf_info; diff --git a/vp9/common/vp9_reconinter.c b/vp9/common/vp9_reconinter.c index 85020e295..53b90035f 100644 --- a/vp9/common/vp9_reconinter.c +++ b/vp9/common/vp9_reconinter.c @@ -21,7 +21,7 @@ #include "vp9/common/vp9_reconintra.h" void vp9_setup_interp_filters(MACROBLOCKD *xd, - INTERPOLATIONFILTERTYPE mcomp_filter_type, + INTERPOLATION_TYPE mcomp_filter_type, VP9_COMMON *cm) { if (xd->mi_8x8 && xd->mi_8x8[0]) { MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi; diff --git a/vp9/common/vp9_reconinter.h b/vp9/common/vp9_reconinter.h index 610ee4acc..2c8a6e4d9 100644 --- a/vp9/common/vp9_reconinter.h +++ b/vp9/common/vp9_reconinter.h @@ -25,7 +25,7 @@ void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col, BLOCK_SIZE bsize); void vp9_setup_interp_filters(MACROBLOCKD *xd, - INTERPOLATIONFILTERTYPE filter, + INTERPOLATION_TYPE filter, VP9_COMMON *cm); void vp9_build_inter_predictor(const uint8_t *src, int src_stride, diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c index 33793eee0..78c85b03a 100644 --- a/vp9/decoder/vp9_decodemv.c +++ b/vp9/decoder/vp9_decodemv.c @@ -311,7 +311,7 @@ static void read_ref_frames(VP9_COMMON *const cm, MACROBLOCKD *const xd, } -static INLINE INTERPOLATIONFILTERTYPE read_switchable_filter_type( +static INLINE INTERPOLATION_TYPE read_switchable_filter_type( VP9_COMMON *const cm, MACROBLOCKD *const xd, vp9_reader *r) { const int ctx = vp9_get_pred_context_switchable_interp(xd); const int type = treed_read(r, vp9_switchable_interp_tree, diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c index 08819e700..b415e2532 100644 --- a/vp9/decoder/vp9_decodframe.c +++ b/vp9/decoder/vp9_decodframe.c @@ -569,12 +569,12 @@ static void setup_quantization(VP9D_COMP *pbi, struct vp9_read_bit_buffer *rb) { xd->itxm_add = xd->lossless ? vp9_iwht4x4_add : vp9_idct4x4_add; } -static INTERPOLATIONFILTERTYPE read_interp_filter_type( - struct vp9_read_bit_buffer *rb) { - const INTERPOLATIONFILTERTYPE literal_to_type[] = { EIGHTTAP_SMOOTH, - EIGHTTAP, - EIGHTTAP_SHARP, - BILINEAR }; +static INTERPOLATION_TYPE read_interp_filter_type( + struct vp9_read_bit_buffer *rb) { + const INTERPOLATION_TYPE literal_to_type[] = { EIGHTTAP_SMOOTH, + EIGHTTAP, + EIGHTTAP_SHARP, + BILINEAR }; return vp9_rb_read_bit(rb) ? SWITCHABLE : literal_to_type[vp9_rb_read_literal(rb, 2)]; } @@ -821,9 +821,9 @@ static const uint8_t *decode_tiles(VP9D_COMP *pbi, const uint8_t *data) { } static void check_sync_code(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) { - if (vp9_rb_read_literal(rb, 8) != SYNC_CODE_0 || - vp9_rb_read_literal(rb, 8) != SYNC_CODE_1 || - vp9_rb_read_literal(rb, 8) != SYNC_CODE_2) { + if (vp9_rb_read_literal(rb, 8) != VP9_SYNC_CODE_0 || + vp9_rb_read_literal(rb, 8) != VP9_SYNC_CODE_1 || + vp9_rb_read_literal(rb, 8) != VP9_SYNC_CODE_2) { vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, "Invalid frame sync code"); } @@ -875,7 +875,7 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi, cm->last_frame_type = cm->frame_type; - if (vp9_rb_read_literal(rb, 2) != 0x2) + if (vp9_rb_read_literal(rb, 2) != VP9_FRAME_MARKER) vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, "Invalid frame marker"); diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index 8378a78e1..b0cfee3c4 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -1103,7 +1103,7 @@ static void encode_txfm_probs(VP9_COMP *cpi, vp9_writer *w) { } } -static void write_interp_filter_type(INTERPOLATIONFILTERTYPE type, +static void write_interp_filter_type(INTERPOLATION_TYPE type, struct vp9_write_bit_buffer *wb) { const int type_to_literal[] = { 1, 0, 2, 3 }; @@ -1295,17 +1295,16 @@ static void write_frame_size_with_refs(VP9_COMP *cpi, } static void write_sync_code(struct vp9_write_bit_buffer *wb) { - vp9_wb_write_literal(wb, SYNC_CODE_0, 8); - vp9_wb_write_literal(wb, SYNC_CODE_1, 8); - vp9_wb_write_literal(wb, SYNC_CODE_2, 8); + vp9_wb_write_literal(wb, VP9_SYNC_CODE_0, 8); + vp9_wb_write_literal(wb, VP9_SYNC_CODE_1, 8); + vp9_wb_write_literal(wb, VP9_SYNC_CODE_2, 8); } static void write_uncompressed_header(VP9_COMP *cpi, struct vp9_write_bit_buffer *wb) { VP9_COMMON *const cm = &cpi->common; - // frame marker bits - vp9_wb_write_literal(wb, 0x2, 2); + vp9_wb_write_literal(wb, VP9_FRAME_MARKER, 2); // bitstream version. // 00 - profile 0. 4:2:0 only diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 98284a690..edb20ba2f 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -2188,7 +2188,7 @@ void vp9_encode_frame(VP9_COMP *cpi) { if (cpi->sf.RD) { int i, pred_type; - INTERPOLATIONFILTERTYPE filter_type; + INTERPOLATION_TYPE filter_type; /* * This code does a single RD pass over the whole frame assuming * either compound, single or hybrid prediction as per whatever has diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index d8098ed6f..d9a28c15a 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -2621,7 +2621,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, int *rate_y, int64_t *distortion_y, int *rate_uv, int64_t *distortion_uv, int *mode_excluded, int *disable_skip, - INTERPOLATIONFILTERTYPE *best_filter, + INTERPOLATION_TYPE *best_filter, int_mv (*mode_mv)[MAX_REF_FRAMES], int mi_row, int mi_col, int_mv single_newmv[MAX_REF_FRAMES], @@ -3123,7 +3123,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, int64_t best_inter_rd = INT64_MAX; MB_PREDICTION_MODE best_intra_mode = DC_PRED; MV_REFERENCE_FRAME best_inter_ref_frame = LAST_FRAME; - INTERPOLATIONFILTERTYPE tmp_best_filter = SWITCHABLE; + INTERPOLATION_TYPE tmp_best_filter = SWITCHABLE; int rate_uv_intra[TX_SIZES], rate_uv_tokenonly[TX_SIZES]; int64_t dist_uv[TX_SIZES]; int skip_uv[TX_SIZES]; @@ -3816,7 +3816,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, vp9_prob comp_mode_p; int64_t best_inter_rd = INT64_MAX; MV_REFERENCE_FRAME best_inter_ref_frame = LAST_FRAME; - INTERPOLATIONFILTERTYPE tmp_best_filter = SWITCHABLE; + INTERPOLATION_TYPE tmp_best_filter = SWITCHABLE; int rate_uv_intra[TX_SIZES], rate_uv_tokenonly[TX_SIZES]; int64_t dist_uv[TX_SIZES]; int skip_uv[TX_SIZES]; diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c index 6b923162f..5dacab454 100644 --- a/vp9/vp9_dx_iface.c +++ b/vp9/vp9_dx_iface.c @@ -172,9 +172,9 @@ static vpx_codec_err_t vp9_peek_si(const uint8_t *data, rb.bit_offset += 1; // show frame rb.bit_offset += 1; // error resilient - if (vp9_rb_read_literal(&rb, 8) != SYNC_CODE_0 || - vp9_rb_read_literal(&rb, 8) != SYNC_CODE_1 || - vp9_rb_read_literal(&rb, 8) != SYNC_CODE_2) { + if (vp9_rb_read_literal(&rb, 8) != VP9_SYNC_CODE_0 || + vp9_rb_read_literal(&rb, 8) != VP9_SYNC_CODE_1 || + vp9_rb_read_literal(&rb, 8) != VP9_SYNC_CODE_2) { return VPX_CODEC_UNSUP_BITSTREAM; }