Commit 4790a69f authored by Urvang Joshi's avatar Urvang Joshi

Add compiler warning flag -Wextra and fix related warnings.

Note: some of these warnings are enabled by a combination of -Wunused
(added earlier) and -Wextra.

Change-Id: I322a1366bd4fd6c0dec9e758c2d5e88e003b1cbf
parent 45592a39
...@@ -65,6 +65,10 @@ void aom_convolve8_avg_horiz_neon(const uint8_t *src, ptrdiff_t src_stride, ...@@ -65,6 +65,10 @@ void aom_convolve8_avg_horiz_neon(const uint8_t *src, ptrdiff_t src_stride,
assert(x_step_q4 == 16); assert(x_step_q4 == 16);
(void)x_step_q4;
(void)y_step_q4;
(void)filter_y;
q0s16 = vld1q_s16(filter_x); q0s16 = vld1q_s16(filter_x);
src -= 3; // adjust for taps src -= 3; // adjust for taps
...@@ -241,6 +245,10 @@ void aom_convolve8_avg_vert_neon(const uint8_t *src, ptrdiff_t src_stride, ...@@ -241,6 +245,10 @@ void aom_convolve8_avg_vert_neon(const uint8_t *src, ptrdiff_t src_stride,
assert(y_step_q4 == 16); assert(y_step_q4 == 16);
(void)x_step_q4;
(void)y_step_q4;
(void)filter_x;
src -= src_stride * 3; src -= src_stride * 3;
q0s16 = vld1q_s16(filter_y); q0s16 = vld1q_s16(filter_y);
for (; w > 0; w -= 4, src += 4, dst += 4) { // loop_vert_h for (; w > 0; w -= 4, src += 4, dst += 4) { // loop_vert_h
......
...@@ -65,6 +65,10 @@ void aom_convolve8_horiz_neon(const uint8_t *src, ptrdiff_t src_stride, ...@@ -65,6 +65,10 @@ void aom_convolve8_horiz_neon(const uint8_t *src, ptrdiff_t src_stride,
assert(x_step_q4 == 16); assert(x_step_q4 == 16);
(void)x_step_q4;
(void)y_step_q4;
(void)filter_y;
q0s16 = vld1q_s16(filter_x); q0s16 = vld1q_s16(filter_x);
src -= 3; // adjust for taps src -= 3; // adjust for taps
...@@ -225,6 +229,10 @@ void aom_convolve8_vert_neon(const uint8_t *src, ptrdiff_t src_stride, ...@@ -225,6 +229,10 @@ void aom_convolve8_vert_neon(const uint8_t *src, ptrdiff_t src_stride,
assert(y_step_q4 == 16); assert(y_step_q4 == 16);
(void)x_step_q4;
(void)y_step_q4;
(void)filter_x;
src -= src_stride * 3; src -= src_stride * 3;
q0s16 = vld1q_s16(filter_y); q0s16 = vld1q_s16(filter_y);
for (; w > 0; w -= 4, src += 4, dst += 4) { // loop_vert_h for (; w > 0; w -= 4, src += 4, dst += 4) { // loop_vert_h
......
...@@ -49,6 +49,7 @@ void aom_highbd_blend_a64_hmask_c(uint8_t *dst_8, uint32_t dst_stride, ...@@ -49,6 +49,7 @@ void aom_highbd_blend_a64_hmask_c(uint8_t *dst_8, uint32_t dst_stride,
uint16_t *dst = CONVERT_TO_SHORTPTR(dst_8); uint16_t *dst = CONVERT_TO_SHORTPTR(dst_8);
const uint16_t *src0 = CONVERT_TO_SHORTPTR(src0_8); const uint16_t *src0 = CONVERT_TO_SHORTPTR(src0_8);
const uint16_t *src1 = CONVERT_TO_SHORTPTR(src1_8); const uint16_t *src1 = CONVERT_TO_SHORTPTR(src1_8);
(void)bd;
assert(IMPLIES(src0 == dst, src0_stride == dst_stride)); assert(IMPLIES(src0 == dst, src0_stride == dst_stride));
assert(IMPLIES(src1 == dst, src1_stride == dst_stride)); assert(IMPLIES(src1 == dst, src1_stride == dst_stride));
......
...@@ -89,6 +89,7 @@ void aom_highbd_blend_a64_mask_c(uint8_t *dst_8, uint32_t dst_stride, ...@@ -89,6 +89,7 @@ void aom_highbd_blend_a64_mask_c(uint8_t *dst_8, uint32_t dst_stride,
uint16_t *dst = CONVERT_TO_SHORTPTR(dst_8); uint16_t *dst = CONVERT_TO_SHORTPTR(dst_8);
const uint16_t *src0 = CONVERT_TO_SHORTPTR(src0_8); const uint16_t *src0 = CONVERT_TO_SHORTPTR(src0_8);
const uint16_t *src1 = CONVERT_TO_SHORTPTR(src1_8); const uint16_t *src1 = CONVERT_TO_SHORTPTR(src1_8);
(void)bd;
assert(IMPLIES(src0 == dst, src0_stride == dst_stride)); assert(IMPLIES(src0 == dst, src0_stride == dst_stride));
assert(IMPLIES(src1 == dst, src1_stride == dst_stride)); assert(IMPLIES(src1 == dst, src1_stride == dst_stride));
......
...@@ -50,6 +50,7 @@ void aom_highbd_blend_a64_vmask_c(uint8_t *dst_8, uint32_t dst_stride, ...@@ -50,6 +50,7 @@ void aom_highbd_blend_a64_vmask_c(uint8_t *dst_8, uint32_t dst_stride,
uint16_t *dst = CONVERT_TO_SHORTPTR(dst_8); uint16_t *dst = CONVERT_TO_SHORTPTR(dst_8);
const uint16_t *src0 = CONVERT_TO_SHORTPTR(src0_8); const uint16_t *src0 = CONVERT_TO_SHORTPTR(src0_8);
const uint16_t *src1 = CONVERT_TO_SHORTPTR(src1_8); const uint16_t *src1 = CONVERT_TO_SHORTPTR(src1_8);
(void)bd;
assert(IMPLIES(src0 == dst, src0_stride == dst_stride)); assert(IMPLIES(src0 == dst, src0_stride == dst_stride));
assert(IMPLIES(src1 == dst, src1_stride == dst_stride)); assert(IMPLIES(src1 == dst, src1_stride == dst_stride));
......
...@@ -202,6 +202,7 @@ static void fs_apply_luminance(fs_ctx *_ctx, int _l, int bit_depth) { ...@@ -202,6 +202,7 @@ static void fs_apply_luminance(fs_ctx *_ctx, int _l, int bit_depth) {
if (bit_depth == 12) ssim_c1 = SSIM_C1_12; if (bit_depth == 12) ssim_c1 = SSIM_C1_12;
#else #else
assert(bit_depth == 8); assert(bit_depth == 8);
(void)bit_depth;
#endif #endif
w = _ctx->level[_l].w; w = _ctx->level[_l].w;
h = _ctx->level[_l].h; h = _ctx->level[_l].h;
...@@ -326,6 +327,7 @@ static void fs_calc_structure(fs_ctx *_ctx, int _l, int bit_depth) { ...@@ -326,6 +327,7 @@ static void fs_calc_structure(fs_ctx *_ctx, int _l, int bit_depth) {
if (bit_depth == 12) ssim_c2 = SSIM_C2_12; if (bit_depth == 12) ssim_c2 = SSIM_C2_12;
#else #else
assert(bit_depth == 8); assert(bit_depth == 8);
(void)bit_depth;
#endif #endif
w = _ctx->level[_l].w; w = _ctx->level[_l].w;
......
...@@ -302,6 +302,7 @@ void aom_ve_predictor_2x2_c(uint8_t *dst, ptrdiff_t stride, ...@@ -302,6 +302,7 @@ void aom_ve_predictor_2x2_c(uint8_t *dst, ptrdiff_t stride,
const int I = above[0]; const int I = above[0];
const int J = above[1]; const int J = above[1];
const int K = above[2]; const int K = above[2];
(void)left;
dst[0] = AVG3(H, I, J); dst[0] = AVG3(H, I, J);
dst[1] = AVG3(I, J, K); dst[1] = AVG3(I, J, K);
...@@ -435,6 +436,7 @@ void aom_ve_predictor_4x4_c(uint8_t *dst, ptrdiff_t stride, ...@@ -435,6 +436,7 @@ void aom_ve_predictor_4x4_c(uint8_t *dst, ptrdiff_t stride,
const int K = above[2]; const int K = above[2];
const int L = above[3]; const int L = above[3];
const int M = above[4]; const int M = above[4];
(void)left;
dst[0] = AVG3(H, I, J); dst[0] = AVG3(H, I, J);
dst[1] = AVG3(I, J, K); dst[1] = AVG3(I, J, K);
......
...@@ -26,6 +26,10 @@ typedef void filter8_1dfunction(const uint8_t *src_ptr, ptrdiff_t src_pitch, ...@@ -26,6 +26,10 @@ typedef void filter8_1dfunction(const uint8_t *src_ptr, ptrdiff_t src_pitch,
const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, \ const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, \
ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, \ ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, \
const int16_t *filter_y, int y_step_q4, int w, int h) { \ const int16_t *filter_y, int y_step_q4, int w, int h) { \
(void) filter_x; \
(void) x_step_q4; \
(void) filter_y; \
(void) y_step_q4; \
assert(filter[3] != 128); \ assert(filter[3] != 128); \
assert(step_q4 == 16); \ assert(step_q4 == 16); \
if (filter[0] || filter[1] || filter[2]) { \ if (filter[0] || filter[1] || filter[2]) { \
......
...@@ -1387,10 +1387,11 @@ static void open_output_file(struct stream_state *stream, ...@@ -1387,10 +1387,11 @@ static void open_output_file(struct stream_state *stream,
#if CONFIG_WEBM_IO #if CONFIG_WEBM_IO
if (stream->config.write_webm) { if (stream->config.write_webm) {
stream->ebml.stream = stream->file; stream->ebml.stream = stream->file;
write_webm_file_header(&stream->ebml, cfg, &global->framerate, write_webm_file_header(&stream->ebml, cfg, stream->config.stereo_fmt,
stream->config.stereo_fmt, global->codec->fourcc, global->codec->fourcc, pixel_aspect_ratio);
pixel_aspect_ratio);
} }
#else
(void)pixel_aspect_ratio;
#endif #endif
if (!stream->config.write_webm) { if (!stream->config.write_webm) {
...@@ -1710,8 +1711,7 @@ static float usec_to_fps(uint64_t usec, unsigned int frames) { ...@@ -1710,8 +1711,7 @@ static float usec_to_fps(uint64_t usec, unsigned int frames) {
} }
static void test_decode(struct stream_state *stream, static void test_decode(struct stream_state *stream,
enum TestDecodeFatality fatal, enum TestDecodeFatality fatal) {
const AvxInterface *codec) {
aom_image_t enc_img, dec_img; aom_image_t enc_img, dec_img;
struct av1_ref_frame ref_enc, ref_dec; struct av1_ref_frame ref_enc, ref_dec;
...@@ -2128,7 +2128,7 @@ int main(int argc, const char **argv_) { ...@@ -2128,7 +2128,7 @@ int main(int argc, const char **argv_) {
} }
if (got_data && global.test_decode != TEST_DECODE_OFF) if (got_data && global.test_decode != TEST_DECODE_OFF)
FOREACH_STREAM(test_decode(stream, global.test_decode, global.codec)); FOREACH_STREAM(test_decode(stream, global.test_decode));
} }
fflush(stdout); fflush(stdout);
......
...@@ -577,6 +577,10 @@ process_toolchain() { ...@@ -577,6 +577,10 @@ process_toolchain() {
check_add_cflags -Wuninitialized check_add_cflags -Wuninitialized
check_add_cflags -Wunused check_add_cflags -Wunused
check_add_cflags -Wsign-compare check_add_cflags -Wsign-compare
# Enabling the following warning (in combination with -Wunused above)
# for C++ generates errors in third_party code including googletest and
# libyuv. So enable it only for C code.
check_cflags "-Wextra" && add_cflags_only "-Wextra"
# Enabling the following warning for C++ generates some useless warnings # Enabling the following warning for C++ generates some useless warnings
# about some function parameters shadowing class member function names. # about some function parameters shadowing class member function names.
# So, only enable this warning for C code. # So, only enable this warning for C code.
......
...@@ -191,8 +191,7 @@ static void find_mismatch(const aom_image_t *const img1, ...@@ -191,8 +191,7 @@ static void find_mismatch(const aom_image_t *const img1,
} }
static void testing_decode(aom_codec_ctx_t *encoder, aom_codec_ctx_t *decoder, static void testing_decode(aom_codec_ctx_t *encoder, aom_codec_ctx_t *decoder,
aom_codec_enc_cfg_t *cfg, unsigned int frame_out, unsigned int frame_out, int *mismatch_seen) {
int *mismatch_seen) {
aom_image_t enc_img, dec_img; aom_image_t enc_img, dec_img;
struct av1_ref_frame ref_enc, ref_dec; struct av1_ref_frame ref_enc, ref_dec;
...@@ -226,11 +225,10 @@ static void testing_decode(aom_codec_ctx_t *encoder, aom_codec_ctx_t *decoder, ...@@ -226,11 +225,10 @@ static void testing_decode(aom_codec_ctx_t *encoder, aom_codec_ctx_t *decoder,
aom_img_free(&dec_img); aom_img_free(&dec_img);
} }
static int encode_frame(aom_codec_ctx_t *ecodec, aom_codec_enc_cfg_t *cfg, static int encode_frame(aom_codec_ctx_t *ecodec, aom_image_t *img,
aom_image_t *img, unsigned int frame_in, unsigned int frame_in, AvxVideoWriter *writer,
AvxVideoWriter *writer, int test_decode, int test_decode, aom_codec_ctx_t *dcodec,
aom_codec_ctx_t *dcodec, unsigned int *frame_out, unsigned int *frame_out, int *mismatch_seen) {
int *mismatch_seen) {
int got_pkts = 0; int got_pkts = 0;
aom_codec_iter_t iter = NULL; aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL; const aom_codec_cx_pkt_t *pkt = NULL;
...@@ -271,7 +269,7 @@ static int encode_frame(aom_codec_ctx_t *ecodec, aom_codec_enc_cfg_t *cfg, ...@@ -271,7 +269,7 @@ static int encode_frame(aom_codec_ctx_t *ecodec, aom_codec_enc_cfg_t *cfg,
// Mismatch checking // Mismatch checking
if (got_data && test_decode) { if (got_data && test_decode) {
testing_decode(ecodec, dcodec, cfg, *frame_out, mismatch_seen); testing_decode(ecodec, dcodec, *frame_out, mismatch_seen);
} }
return got_pkts; return got_pkts;
...@@ -404,7 +402,7 @@ int main(int argc, char **argv) { ...@@ -404,7 +402,7 @@ int main(int argc, char **argv) {
} }
} }
encode_frame(&ecodec, &cfg, &raw, frame_in, writer, test_decode, &dcodec, encode_frame(&ecodec, &raw, frame_in, writer, test_decode, &dcodec,
&frame_out, &mismatch_seen); &frame_out, &mismatch_seen);
frame_in++; frame_in++;
if (mismatch_seen) break; if (mismatch_seen) break;
...@@ -412,8 +410,8 @@ int main(int argc, char **argv) { ...@@ -412,8 +410,8 @@ int main(int argc, char **argv) {
// Flush encoder. // Flush encoder.
if (!mismatch_seen) if (!mismatch_seen)
while (encode_frame(&ecodec, &cfg, NULL, frame_in, writer, test_decode, while (encode_frame(&ecodec, NULL, frame_in, writer, test_decode, &dcodec,
&dcodec, &frame_out, &mismatch_seen)) { &frame_out, &mismatch_seen)) {
} }
printf("\n"); printf("\n");
......
...@@ -53,7 +53,6 @@ const size_t maxHeight = 256; ...@@ -53,7 +53,6 @@ const size_t maxHeight = 256;
const size_t maxBlockSize = maxWidth * maxHeight; const size_t maxBlockSize = maxWidth * maxHeight;
const int horizOffset = 32; const int horizOffset = 32;
const int vertiOffset = 32; const int vertiOffset = 32;
const size_t testMaxBlk = 128;
const int stride = 128; const int stride = 128;
const int x_step_q4 = 16; const int x_step_q4 = 16;
...@@ -89,7 +88,7 @@ class VP10ConvolveOptimzTest : public ::testing::TestWithParam<ConvParams> { ...@@ -89,7 +88,7 @@ class VP10ConvolveOptimzTest : public ::testing::TestWithParam<ConvParams> {
void RunVertFilterBitExactCheck(); void RunVertFilterBitExactCheck();
private: private:
void PrepFilterBuffer(int w, int h); void PrepFilterBuffer();
void DiffFilterBuffer(); void DiffFilterBuffer();
conv_filter_t conv_horiz_; conv_filter_t conv_horiz_;
conv_filter_t conv_vert_; conv_filter_t conv_vert_;
...@@ -105,7 +104,7 @@ class VP10ConvolveOptimzTest : public ::testing::TestWithParam<ConvParams> { ...@@ -105,7 +104,7 @@ class VP10ConvolveOptimzTest : public ::testing::TestWithParam<ConvParams> {
int avg_; int avg_;
}; };
void VP10ConvolveOptimzTest::PrepFilterBuffer(int w, int h) { void VP10ConvolveOptimzTest::PrepFilterBuffer() {
int r, c; int r, c;
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
...@@ -149,7 +148,7 @@ void VP10ConvolveOptimzTest::DiffFilterBuffer() { ...@@ -149,7 +148,7 @@ void VP10ConvolveOptimzTest::DiffFilterBuffer() {
} }
void VP10ConvolveOptimzTest::RunHorizFilterBitExactCheck() { void VP10ConvolveOptimzTest::RunHorizFilterBitExactCheck() {
PrepFilterBuffer(testMaxBlk, testMaxBlk); PrepFilterBuffer();
InterpFilterParams filter_params = get_interp_filter_params(filter_); InterpFilterParams filter_params = get_interp_filter_params(filter_);
...@@ -166,7 +165,7 @@ void VP10ConvolveOptimzTest::RunHorizFilterBitExactCheck() { ...@@ -166,7 +165,7 @@ void VP10ConvolveOptimzTest::RunHorizFilterBitExactCheck() {
// and test again. // and test again.
int intermediate_height = int intermediate_height =
(((height_ - 1) * 16 + subpel_) >> SUBPEL_BITS) + filter_params.taps; (((height_ - 1) * 16 + subpel_) >> SUBPEL_BITS) + filter_params.taps;
PrepFilterBuffer(testMaxBlk, testMaxBlk); PrepFilterBuffer();
av1_convolve_horiz_c(src_ref_, stride, dst_ref_, stride, width_, av1_convolve_horiz_c(src_ref_, stride, dst_ref_, stride, width_,
intermediate_height, filter_params, subpel_, x_step_q4, intermediate_height, filter_params, subpel_, x_step_q4,
...@@ -179,7 +178,7 @@ void VP10ConvolveOptimzTest::RunHorizFilterBitExactCheck() { ...@@ -179,7 +178,7 @@ void VP10ConvolveOptimzTest::RunHorizFilterBitExactCheck() {
} }
void VP10ConvolveOptimzTest::RunVertFilterBitExactCheck() { void VP10ConvolveOptimzTest::RunVertFilterBitExactCheck() {
PrepFilterBuffer(testMaxBlk, testMaxBlk); PrepFilterBuffer();
InterpFilterParams filter_params = get_interp_filter_params(filter_); InterpFilterParams filter_params = get_interp_filter_params(filter_);
...@@ -265,7 +264,7 @@ class VP10HbdConvolveOptimzTest : public TestWithHbdConvParams { ...@@ -265,7 +264,7 @@ class VP10HbdConvolveOptimzTest : public TestWithHbdConvParams {
void RunVertFilterBitExactCheck(); void RunVertFilterBitExactCheck();
private: private:
void PrepFilterBuffer(int w, int h); void PrepFilterBuffer();
void DiffFilterBuffer(); void DiffFilterBuffer();
hbd_conv_filter_t conv_horiz_; hbd_conv_filter_t conv_horiz_;
hbd_conv_filter_t conv_vert_; hbd_conv_filter_t conv_vert_;
...@@ -282,7 +281,7 @@ class VP10HbdConvolveOptimzTest : public TestWithHbdConvParams { ...@@ -282,7 +281,7 @@ class VP10HbdConvolveOptimzTest : public TestWithHbdConvParams {
int bit_depth_; int bit_depth_;
}; };
void VP10HbdConvolveOptimzTest::PrepFilterBuffer(int w, int h) { void VP10HbdConvolveOptimzTest::PrepFilterBuffer() {
int r, c; int r, c;
ACMRandom rnd(ACMRandom::DeterministicSeed()); ACMRandom rnd(ACMRandom::DeterministicSeed());
...@@ -325,7 +324,7 @@ void VP10HbdConvolveOptimzTest::DiffFilterBuffer() { ...@@ -325,7 +324,7 @@ void VP10HbdConvolveOptimzTest::DiffFilterBuffer() {
} }
void VP10HbdConvolveOptimzTest::RunHorizFilterBitExactCheck() { void VP10HbdConvolveOptimzTest::RunHorizFilterBitExactCheck() {
PrepFilterBuffer(testMaxBlk, testMaxBlk); PrepFilterBuffer();
InterpFilterParams filter_params = get_interp_filter_params(filter_); InterpFilterParams filter_params = get_interp_filter_params(filter_);
...@@ -343,7 +342,7 @@ void VP10HbdConvolveOptimzTest::RunHorizFilterBitExactCheck() { ...@@ -343,7 +342,7 @@ void VP10HbdConvolveOptimzTest::RunHorizFilterBitExactCheck() {
// and test again. // and test again.
int intermediate_height = int intermediate_height =
(((height_ - 1) * 16 + subpel_) >> SUBPEL_BITS) + filter_params.taps; (((height_ - 1) * 16 + subpel_) >> SUBPEL_BITS) + filter_params.taps;
PrepFilterBuffer(testMaxBlk, testMaxBlk); PrepFilterBuffer();
av1_highbd_convolve_horiz_c(src_, stride, dst_ref_, stride, width_, av1_highbd_convolve_horiz_c(src_, stride, dst_ref_, stride, width_,
intermediate_height, filter_params, subpel_, intermediate_height, filter_params, subpel_,
...@@ -356,7 +355,7 @@ void VP10HbdConvolveOptimzTest::RunHorizFilterBitExactCheck() { ...@@ -356,7 +355,7 @@ void VP10HbdConvolveOptimzTest::RunHorizFilterBitExactCheck() {
} }
void VP10HbdConvolveOptimzTest::RunVertFilterBitExactCheck() { void VP10HbdConvolveOptimzTest::RunVertFilterBitExactCheck() {
PrepFilterBuffer(testMaxBlk, testMaxBlk); PrepFilterBuffer();
InterpFilterParams filter_params = get_interp_filter_params(filter_); InterpFilterParams filter_params = get_interp_filter_params(filter_);
......
...@@ -54,17 +54,17 @@ class AverageTestBase : public ::testing::Test { ...@@ -54,17 +54,17 @@ class AverageTestBase : public ::testing::Test {
} }
// Sum Pixels // Sum Pixels
unsigned int ReferenceAverage8x8(const uint8_t *source, int pitch) { static unsigned int ReferenceAverage8x8(const uint8_t *source, int pitch) {
unsigned int average = 0; unsigned int average = 0;
for (int h = 0; h < 8; ++h) for (int h = 0; h < 8; ++h)
for (int w = 0; w < 8; ++w) average += source[h * source_stride_ + w]; for (int w = 0; w < 8; ++w) average += source[h * pitch + w];
return ((average + 32) >> 6); return ((average + 32) >> 6);
} }
unsigned int ReferenceAverage4x4(const uint8_t *source, int pitch) { static unsigned int ReferenceAverage4x4(const uint8_t *source, int pitch) {
unsigned int average = 0; unsigned int average = 0;
for (int h = 0; h < 4; ++h) for (int h = 0; h < 4; ++h)
for (int w = 0; w < 4; ++w) average += source[h * source_stride_ + w]; for (int w = 0; w < 4; ++w) average += source[h * pitch + w];
return ((average + 8) >> 4); return ((average + 8) >> 4);
} }
...@@ -97,11 +97,12 @@ class AverageTest : public AverageTestBase, ...@@ -97,11 +97,12 @@ class AverageTest : public AverageTestBase,
protected: protected:
void CheckAverages() { void CheckAverages() {
const int block_size = GET_PARAM(3);
unsigned int expected = 0; unsigned int expected = 0;
if (GET_PARAM(3) == 8) { if (block_size == 8) {
expected = expected =
ReferenceAverage8x8(source_data_ + GET_PARAM(2), source_stride_); ReferenceAverage8x8(source_data_ + GET_PARAM(2), source_stride_);
} else if (GET_PARAM(3) == 4) { } else if (block_size == 4) {
expected = expected =
ReferenceAverage4x4(source_data_ + GET_PARAM(2), source_stride_); ReferenceAverage4x4(source_data_ + GET_PARAM(2), source_stride_);
} }
......
...@@ -123,6 +123,9 @@ class AV1CodecFactory : public CodecFactory { ...@@ -123,6 +123,9 @@ class AV1CodecFactory : public CodecFactory {
#if CONFIG_AV1_DECODER #if CONFIG_AV1_DECODER
return new AV1Decoder(cfg, flags, deadline); return new AV1Decoder(cfg, flags, deadline);
#else #else
(void)cfg;
(void)flags;
(void)deadline;
return NULL; return NULL;
#endif #endif
} }
...@@ -134,6 +137,10 @@ class AV1CodecFactory : public CodecFactory { ...@@ -134,6 +137,10 @@ class AV1CodecFactory : public CodecFactory {
#if CONFIG_AV1_ENCODER #if CONFIG_AV1_ENCODER
return new AV1Encoder(cfg, deadline, init_flags, stats); return new AV1Encoder(cfg, deadline, init_flags, stats);
#else #else
(void)cfg;
(void)deadline;
(void)init_flags;
(void)stats;
return NULL; return NULL;
#endif #endif
} }
...@@ -143,6 +150,8 @@ class AV1CodecFactory : public CodecFactory { ...@@ -143,6 +150,8 @@ class AV1CodecFactory : public CodecFactory {
#if CONFIG_AV1_ENCODER #if CONFIG_AV1_ENCODER
return aom_codec_enc_config_default(&aom_codec_av1_cx_algo, cfg, usage); return aom_codec_enc_config_default(&aom_codec_av1_cx_algo, cfg, usage);
#else #else
(void)cfg;
(void)usage;
return AOM_CODEC_INCAPABLE; return AOM_CODEC_INCAPABLE;
#endif #endif
} }
......
...@@ -246,7 +246,7 @@ void highbd_filter_block2d_8_c(const uint16_t *src_ptr, ...@@ -246,7 +246,7 @@ void highbd_filter_block2d_8_c(const uint16_t *src_ptr,
void highbd_block2d_average_c(uint16_t *src, unsigned int src_stride, void highbd_block2d_average_c(uint16_t *src, unsigned int src_stride,
uint16_t *output_ptr, unsigned int output_stride, uint16_t *output_ptr, unsigned int output_stride,
unsigned int output_width, unsigned int output_width,
unsigned int output_height, int bd) { unsigned int output_height) {
unsigned int i, j; unsigned int i, j;
for (i = 0; i < output_height; ++i) { for (i = 0; i < output_height; ++i) {
for (j = 0; j < output_width; ++j) { for (j = 0; j < output_width; ++j) {
...@@ -268,7 +268,7 @@ void highbd_filter_average_block2d_8_c( ...@@ -268,7 +268,7 @@ void highbd_filter_average_block2d_8_c(
highbd_filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64, highbd_filter_block2d_8_c(src_ptr, src_stride, HFilter, VFilter, tmp, 64,
output_width, output_height, bd); output_width, output_height, bd);
highbd_block2d_average_c(tmp, 64, dst_ptr, dst_stride, output_width, highbd_block2d_average_c(tmp, 64, dst_ptr, dst_stride, output_width,
output_height, bd); output_height);
} }
#endif // CONFIG_AOM_HIGHBITDEPTH #endif // CONFIG_AOM_HIGHBITDEPTH
......
...@@ -287,11 +287,6 @@ class DatarateTestAV1Large ...@@ -287,11 +287,6 @@ class DatarateTestAV1Large
denoiser_offon_period_ = -1; denoiser_offon_period_ = -1;
} }
int SetFrameFlags(int frame_num, int num_temp_layers) {
int frame_flags = 0;
return frame_flags;
}
virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video, virtual void PreEncodeFrameHook(::libaom_test::VideoSource *video,
::libaom_test::Encoder *encoder) { ::libaom_test::Encoder *encoder) {
if (video->frame() == 0) encoder->Control(AOME_SET_CPUUSED, set_cpu_used_); if (video->frame() == 0) encoder->Control(AOME_SET_CPUUSED, set_cpu_used_);
......
...@@ -272,12 +272,12 @@ void idct16x16_12(const tran_low_t *in, uint8_t *out, int stride) { ...@@ -272,12 +272,12 @@ void idct16x16_12(const tran_low_t *in, uint8_t *out, int stride) {
} }
void idct16x16_10_ref(const tran_low_t *in, uint8_t *out, int stride, void idct16x16_10_ref(const tran_low_t *in, uint8_t *out, int stride,
int tx_type) { int /*tx_type*/) {
idct16x16_10(in, out, stride); idct16x16_10(in, out, stride);
} }
void idct16x16_12_ref(const tran_low_t *in, uint8_t *out, int stride, void idct16x16_12_ref(const tran_low_t *in, uint8_t *out, int stride,
int tx_type) { int /*tx_type*/) {
idct16x16_12(in, out, stride); idct16x16_12(in, out, stride);
} }
...@@ -736,7 +736,7 @@ class InvTrans16x16DCT : public Trans16x16TestBase, ...@@ -736,7 +736,7 @@ class InvTrans16x16DCT : public Trans16x16TestBase,
virtual void TearDown() { libaom_test::ClearSystemState(); } virtual void TearDown() { libaom_test::ClearSystemState(); }
protected: protected:
void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {} void RunFwdTxfm(int16_t * /*in*/, tran_low_t * /*out*/, int /*stride*/) {}
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) { void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
inv_txfm_(out, dst, stride); inv_txfm_(out, dst, stride);
} }
......
...@@ -86,7 +86,7 @@ void DecoderTest::RunLoop(CompressedVideoSource *video, ...@@ -86,7 +86,7 @@ void DecoderTest::RunLoop(CompressedVideoSource *video,
aom_codec_err_t res_dec = aom_codec_err_t res_dec =
decoder->DecodeFrame(video->cxdata(), video->frame_size()); decoder->DecodeFrame(video->cxdata(), video->frame_size());
if (!HandleDecodeResult(res_dec, *video, decoder)) break; if (!HandleDecodeResult(res_dec, decoder)) break;
} else { } else {
// Signal end of the file to the decoder. // Signal end of the file to the decoder.
const aom_codec_err_t res_dec = decoder->DecodeFrame(NULL, 0); const aom_codec_err_t res_dec = decoder->DecodeFrame(NULL, 0);
......
...@@ -139,7 +139,6 @@ class DecoderTest { ...@@ -139,7 +139,6 @@ class DecoderTest {
// Hook to be called to handle decode result. Return true to continue. // Hook to be called to handle decode result. Return true to continue.
virtual bool HandleDecodeResult(const aom_codec_err_t res_dec, virtual bool HandleDecodeResult(const aom_codec_err_t res_dec,
const CompressedVideoSource & /*video*/,
Decoder *decoder) { Decoder *decoder) {
EXPECT_EQ(AOM_CODEC_OK, res_dec) << decoder->DecodeError(); EXPECT_EQ(AOM_CODEC_OK, res_dec) << decoder->DecodeError();
return AOM_CODEC_OK == res_dec; return AOM_CODEC_OK == res_dec;
......
...@@ -202,7 +202,7 @@ void EncoderTest::RunLoop(VideoSource *video) { ...@@ -202,7 +202,7 @@ void EncoderTest::RunLoop(VideoSource *video) {
aom_codec_err_t res_dec = decoder->DecodeFrame( aom_codec_err_t res_dec = decoder->DecodeFrame(
(const uint8_t *)pkt->data.frame.buf, pkt->data.frame.sz); (const uint8_t *)pkt->data.frame.buf, pkt->data.frame.sz);
if (!HandleDecodeResult(res_dec, *video, decoder)) break; if (!HandleDecodeResult(res_dec, decoder)) break;
has_dxdata = true; has_dxdata = true;
} }
...@@ -220,7 +220,7 @@ void EncoderTest::RunLoop(VideoSource *video) { ...@@ -220,7 +220,7 @@ void EncoderTest::RunLoop(VideoSource *video) {
// Flush the decoder when there are no more fragments. // Flush the decoder when there are no more fragments.
if ((init_flags_ & AOM_CODEC_USE_OUTPUT_PARTITION) && has_dxdata) { if ((init_flags_ & AOM_CODEC_USE_OUTPUT_PARTITION) && has_dxdata) {
const aom_codec_err_t res_dec = decoder->DecodeFrame(NULL, 0); const aom_codec_err_t res_dec = decoder->DecodeFrame(NULL, 0);
if (!HandleDecodeResult(res_dec, *video, decoder)) break; if (!HandleDecodeResult(res_dec, decoder)) break;
} }
if (has_dxdata && has_cxdata) { if (has_dxdata && has_cxdata) {
......
...@@ -233,7 +233,6 @@ class EncoderTest { ...@@ -233,7 +233,6 @@ class EncoderTest {
// Hook to be called to handle decode result. Return true to continue. // Hook to be called to handle decode result. Return true to continue.
virtual bool HandleDecodeResult(const aom_codec_err_t res_dec, virtual bool HandleDecodeResult(const aom_codec_err_t res_dec,
const VideoSource & /*video*/,
Decoder *decoder) { Decoder *decoder) {
EXPECT_EQ(AOM_CODEC_OK, res_dec) << decoder->DecodeError(); EXPECT_EQ(AOM_CODEC_OK, res_dec) << decoder->DecodeError();
return AOM_CODEC_OK == res_dec; return AOM_CODEC_OK == res_dec;
......
...@@ -46,9 +46,9 @@ struct EncodeParameters { ...@@ -46,9 +46,9 @@ struct EncodeParameters {
}; };
const EncodeParameters kAV1EncodeParameterSet[] = { const EncodeParameters kAV1EncodeParameterSet[] = {
{ 0, 0, 0, 1, 0, AOM_CR_STUDIO_RANGE, AOM_CS_BT_601 },