From ab77e73b77571ebed608708465a1b1d4b848e5a6 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Tue, 28 Feb 2017 15:20:59 -0800 Subject: [PATCH] Fix compiling warnings in var-tx and pvq Change-Id: Ie836a113978028f3bde2acd31061d9a663547087 --- av1/common/blockd.c | 2 +- av1/decoder/detokenize.c | 4 ++-- av1/decoder/detokenize.h | 4 ++-- av1/encoder/bitstream.c | 2 +- av1/encoder/encodemb.c | 8 +++++--- av1/encoder/rdopt.c | 2 +- av1/encoder/rdopt.h | 2 +- av1/encoder/tokenize.c | 4 ++-- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/av1/common/blockd.c b/av1/common/blockd.c index e38f62ae7..57343fa20 100644 --- a/av1/common/blockd.c +++ b/av1/common/blockd.c @@ -195,7 +195,7 @@ void av1_foreach_8x8_transformed_block_in_plane( } #endif -#if !CONFIG_PVQ +#if !CONFIG_PVQ || CONFIG_VAR_TX void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd, int plane, TX_SIZE tx_size, int has_eob, int aoff, int loff) { diff --git a/av1/decoder/detokenize.c b/av1/decoder/detokenize.c index bbdc7ade3..195faca1d 100644 --- a/av1/decoder/detokenize.c +++ b/av1/decoder/detokenize.c @@ -19,7 +19,7 @@ #endif // CONFIG_ANS #include "av1/common/blockd.h" -#if !CONFIG_PVQ +#if !CONFIG_PVQ || CONFIG_VAR_TX #include "av1/common/common.h" #include "av1/common/entropy.h" #include "av1/common/idct.h" @@ -546,7 +546,7 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane, #endif // CONFIG_PALETTE_THROUGHPUT #endif // CONFIG_PALETTE -#if !CONFIG_PVQ +#if !CONFIG_PVQ || CONFIG_VAR_TX int av1_decode_block_tokens(MACROBLOCKD *const xd, int plane, const SCAN_ORDER *sc, int x, int y, TX_SIZE tx_size, TX_TYPE tx_type, int16_t *max_scan_line, diff --git a/av1/decoder/detokenize.h b/av1/decoder/detokenize.h index 5a0c7bb69..e528f922c 100644 --- a/av1/decoder/detokenize.h +++ b/av1/decoder/detokenize.h @@ -12,7 +12,7 @@ #ifndef AV1_DECODER_DETOKENIZE_H_ #define AV1_DECODER_DETOKENIZE_H_ -#if !CONFIG_PVQ +#if !CONFIG_PVQ || CONFIG_VAR_TX #include "av1/decoder/decoder.h" #if CONFIG_ANS #include "aom_dsp/ans.h" @@ -34,7 +34,7 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane, aom_reader *r); #endif // CONFIG_PALETTE_THROUGHPUT #endif // CONFIG_PALETTE -#if !CONFIG_PVQ +#if !CONFIG_PVQ || CONFIG_VAR_TX int av1_decode_block_tokens(MACROBLOCKD *const xd, int plane, const SCAN_ORDER *sc, int x, int y, TX_SIZE tx_size, TX_TYPE tx_type, int16_t *max_scan_line, diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c index da60f2945..61216aba5 100644 --- a/av1/encoder/bitstream.c +++ b/av1/encoder/bitstream.c @@ -961,7 +961,7 @@ static void pack_mb_tokens(aom_writer *w, const TOKENEXTRA **tp, } #endif #endif // !CONFIG_PVG -#if CONFIG_VAR_TX && !CONFIG_COEF_INTERLEAVE +#if CONFIG_VAR_TX && !CONFIG_COEF_INTERLEAVE && !CONFIG_PVQ static void pack_txb_tokens(aom_writer *w, const TOKENEXTRA **tp, const TOKENEXTRA *const tok_end, MACROBLOCKD *xd, MB_MODE_INFO *mbmi, int plane, diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c index d5ddbfa47..cdc752b7d 100644 --- a/av1/encoder/encodemb.c +++ b/av1/encoder/encodemb.c @@ -665,10 +665,9 @@ static void encode_block(int plane, int block, int blk_row, int blk_col, const int block_raster_idx = av1_block_index_to_raster_order(tx_size, block); #if CONFIG_PVQ int tx_width_pixels, tx_height_pixels; - int i, j; + int j; #endif #if CONFIG_VAR_TX - int i; int bw = block_size_wide[plane_bsize] >> tx_size_wide_log2[0]; #endif dst = &pd->dst @@ -710,6 +709,7 @@ static void encode_block(int plane, int block, int blk_row, int blk_col, } #if CONFIG_VAR_TX + int i; for (i = 0; i < tx_size_wide_unit[tx_size]; ++i) a[i] = a[0]; for (i = 0; i < tx_size_high_unit[tx_size]; ++i) l[i] = l[0]; @@ -734,8 +734,10 @@ static void encode_block(int plane, int block, int blk_row, int blk_col, // but av1_inv_txfm_add_*x*() also does addition of predicted image to // inverse transformed image, // pass blank dummy image to av1_inv_txfm_add_*x*(), i.e. set dst as zeros - for (j = 0; j < tx_height_pixels; j++) + for (j = 0; j < tx_height_pixels; j++) { + int i; for (i = 0; i < tx_width_pixels; i++) dst[j * pd->dst.stride + i] = 0; + } #endif // inverse transform parameters diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c index e4d1920e6..60547352b 100644 --- a/av1/encoder/rdopt.c +++ b/av1/encoder/rdopt.c @@ -1088,7 +1088,7 @@ int64_t av1_highbd_block_error_c(const tran_low_t *coeff, } #endif // CONFIG_AOM_HIGHBITDEPTH -#if !CONFIG_PVQ +#if !CONFIG_PVQ || CONFIG_VAR_TX /* The trailing '0' is a terminator which is used inside av1_cost_coeffs() to * decide whether to include cost of a trailing EOB node or not (i.e. we * can skip this if the last coefficient in this transform block, e.g. the diff --git a/av1/encoder/rdopt.h b/av1/encoder/rdopt.h index bedf8e7a5..f8cd10ffd 100644 --- a/av1/encoder/rdopt.h +++ b/av1/encoder/rdopt.h @@ -127,7 +127,7 @@ static INLINE void av1_merge_rd_stats(RD_STATS *rd_stats_dst, } #endif } -#if !CONFIG_PVQ +#if !CONFIG_PVQ || CONFIG_VAR_TX int av1_cost_coeffs(const AV1_COMMON *const cm, MACROBLOCK *x, int plane, int block, int coeff_ctx, TX_SIZE tx_size, const int16_t *scan, const int16_t *nb, diff --git a/av1/encoder/tokenize.c b/av1/encoder/tokenize.c index 5a8552467..283dd3bc7 100644 --- a/av1/encoder/tokenize.c +++ b/av1/encoder/tokenize.c @@ -320,7 +320,7 @@ struct tokenize_b_args { int this_rate; }; -#if !CONFIG_PVQ +#if !CONFIG_PVQ || CONFIG_VAR_TX static void cost_coeffs_b(int plane, int block, int blk_row, int blk_col, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, void *arg) { struct tokenize_b_args *const args = arg; @@ -441,7 +441,7 @@ void av1_tokenize_palette_sb(const AV1_COMP *cpi, } #endif // CONFIG_PALETTE -#if !CONFIG_PVQ +#if !CONFIG_PVQ || CONFIG_VAR_TX #if CONFIG_PALETTE && CONFIG_PALETTE_THROUGHPUT void tokenize_palette_b(int plane, int block, int blk_row, int blk_col, BLOCK_SIZE plane_bsize, TX_SIZE tx_size, void *arg) { -- GitLab