Resolve merge issues with --enable-pvq
This commit resolves some compiling issues due to merge.
Change-Id: I0eef8aa36c404e185e0b0004948a49307c360d3e
diff --git a/av1/encoder/context_tree.c b/av1/encoder/context_tree.c
index 239c365..5a26d9b 100644
--- a/av1/encoder/context_tree.c
+++ b/av1/encoder/context_tree.c
@@ -78,8 +78,8 @@
aom_free(ctx->dqcoeff[i][k]);
ctx->dqcoeff[i][k] = 0;
#if CONFIG_PVQ
- aom_free(ctx->pvq_ref_coeff[i]);
- ctx->pvq_ref_coeff[i] = 0;
+ aom_free(ctx->pvq_ref_coeff[i]);
+ ctx->pvq_ref_coeff[i] = 0;
#endif
aom_free(ctx->eobs[i][k]);
ctx->eobs[i][k] = 0;
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index bb1c151..0a30186 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -2084,11 +2084,11 @@
static void restore_context(MACROBLOCK *x,
const RD_SEARCH_MACROBLOCK_CONTEXT *ctx, int mi_row,
- int mi_col,
+ int mi_col,
#if CONFIG_PVQ
od_rollback_buffer *rdo_buf,
-#endif
- BLOCK_SIZE bsize) {
+#endif
+ BLOCK_SIZE bsize) {
MACROBLOCKD *xd = &x->e_mbd;
int p;
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
@@ -2124,11 +2124,11 @@
}
static void save_context(const MACROBLOCK *x, RD_SEARCH_MACROBLOCK_CONTEXT *ctx,
- int mi_row, int mi_col,
+ int mi_row, int mi_col,
#if CONFIG_PVQ
od_rollback_buffer *rdo_buf,
#endif
- BLOCK_SIZE bsize) {
+ BLOCK_SIZE bsize) {
const MACROBLOCKD *xd = &x->e_mbd;
int p;
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
@@ -4499,8 +4499,9 @@
#if CONFIG_PVQ
// This will be dynamically increased as more pvq block is encoded.
tile_data->pvq_q.buf_len = 1000;
- CHECK_MEM_ERROR(cm, tile_data->pvq_q.buf,
- aom_malloc(tile_data->pvq_q.buf_len * sizeof(PVQ_INFO)));
+ CHECK_MEM_ERROR(
+ cm, tile_data->pvq_q.buf,
+ aom_malloc(tile_data->pvq_q.buf_len * sizeof(PVQ_INFO)));
tile_data->pvq_q.curr_pos = 0;
#endif
}
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index 83d463b..4d035ae 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -62,7 +62,6 @@
tran_low_t dqc;
} av1_token_state;
-#if !CONFIG_PVQ
// These numbers are empirically obtained.
static const int plane_rd_mult[REF_TYPES][PLANE_TYPES] = {
{ 10, 6 }, { 8, 5 },
@@ -404,7 +403,6 @@
assert(final_eob <= default_eob);
return final_eob;
}
-#endif // !CONFIG_PVG
#if CONFIG_AOM_HIGHBITDEPTH
typedef enum QUANT_FUNC {
@@ -1166,7 +1164,7 @@
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
void *arg) {
struct encode_b_args *const args = arg;
-#if !CONFIG_PVG
+#if !CONFIG_PVQ
AV1_COMMON *cm = args->cm;
#endif
MACROBLOCK *const x = args->x;
@@ -1431,8 +1429,7 @@
(int)quant[1] >> quant_shift, // scale/quantizer
// TODO(yushin): Instead of 0,
// use daala_enc->use_activity_masking for activity masking.
- plane, tx_size, OD_PVQ_BETA[0][plane][tx_size],
- OD_ROBUST_STREAM,
+ plane, tx_size, OD_PVQ_BETA[0][plane][tx_size], OD_ROBUST_STREAM,
0, // is_keyframe,
0, 0, 0, // q_scaling, bx, by,
daala_enc->state.qm + off, daala_enc->state.qm_inv + off,
diff --git a/av1/encoder/encodemb.h b/av1/encoder/encodemb.h
index 3c496d9..2f2b93b 100644
--- a/av1/encoder/encodemb.h
+++ b/av1/encoder/encodemb.h
@@ -13,6 +13,7 @@
#define AV1_ENCODER_ENCODEMB_H_
#include "./aom_config.h"
+#include "av1/common/onyxc_int.h"
#include "av1/encoder/block.h"
#ifdef __cplusplus
diff --git a/av1/encoder/firstpass.c b/av1/encoder/firstpass.c
index 2f6731e..52a1cce 100644
--- a/av1/encoder/firstpass.c
+++ b/av1/encoder/firstpass.c
@@ -536,7 +536,8 @@
od_adapt_ctx *adapt;
pvq_q.buf_len = 5000;
- CHECK_MEM_ERROR(cm, pvq_q.buf, aom_malloc(pvq_q.buf_len * sizeof(PVQ_INFO)));
+ CHECK_MEM_ERROR(cm, pvq_q.buf,
+ aom_malloc(pvq_q.buf_len * sizeof(PVQ_INFO)));
pvq_q.curr_pos = 0;
x->pvq_coded = 0;
diff --git a/av1/encoder/pvq_encoder.c b/av1/encoder/pvq_encoder.c
index b0ee102..611f0b6 100644
--- a/av1/encoder/pvq_encoder.c
+++ b/av1/encoder/pvq_encoder.c
@@ -25,7 +25,7 @@
#include "av1/common/partition.h"
#include "av1/common/pvq_state.h"
#include "av1/encoder/encodemb.h"
-#include "pvq_encoder.h"
+#include "av1/encoder/pvq_encoder.h"
#define OD_PVQ_RATE_APPROX (0)
/*Shift to ensure that the upper bound (i.e. for the max blocksize) of the
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index c0abb68..9e5419f 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -68,7 +68,6 @@
#endif
#endif
-
#if CONFIG_EXT_REFS
#define LAST_FRAME_MODE_MASK \
@@ -1031,7 +1030,7 @@
tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block);
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
#if CONFIG_PVQ
- tran_low_t *ref_coeff = BLOCK_OFFSET(pd->pvq_ref_coeff, block);
+ tran_low_t *ref_coeff = BLOCK_OFFSET(pd->pvq_ref_coeff, block);
#endif
#if CONFIG_AOM_HIGHBITDEPTH
const int bd = (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? xd->bd : 8;
diff --git a/av1/encoder/tokenize.c b/av1/encoder/tokenize.c
index 50735ad..5aafa79 100644
--- a/av1/encoder/tokenize.c
+++ b/av1/encoder/tokenize.c
@@ -320,6 +320,7 @@
int this_rate;
};
+#if !CONFIG_PVQ
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;
@@ -343,7 +344,6 @@
av1_set_contexts(xd, pd, tx_size, p->eobs[block] > 0, blk_col, blk_row);
}
-#if !CONFIG_PVQ
static void set_entropy_context_b(int plane, int block, int blk_row,
int blk_col, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
@@ -567,9 +567,10 @@
PVQ_QUEUE *q = x->pvq_q;
if (q->curr_pos >= q->buf_len) {
q->buf_len = 2 * q->buf_len + 1;
- CHECK_MEM_ERROR(cm, q->buf, aom_realloc(q->buf, q->buf_len * sizeof(PVQ_INFO)));
+ CHECK_MEM_ERROR(cm, q->buf,
+ aom_realloc(q->buf, q->buf_len * sizeof(PVQ_INFO)));
}
- //memcpy(q->buf + q->curr_pos, pvq, sizeof(PVQ_INFO));
+ // memcpy(q->buf + q->curr_pos, pvq, sizeof(PVQ_INFO));
OD_COPY(q->buf + q->curr_pos, pvq, 1);
++q->curr_pos;
}
@@ -594,7 +595,7 @@
assert(block < MAX_PVQ_BLOCKS_IN_SB);
pvq_info = &x->pvq[block][plane];
- add_pvq_block((AV1_COMMON *const)cm, x, pvq_info);
+ add_pvq_block((AV1_COMMON * const)cm, x, pvq_info);
}
#endif
#if CONFIG_VAR_TX