From 434336b072ede09c69fc1ebf59810da63565ad32 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Thu, 6 Dec 2012 13:56:25 -0800 Subject: [PATCH 1/4] libvpx_test: ensure rtcd init functions are called In addition to allowing tests to use the RTCD-enabled functions (perhaps transitively) without having run a full encode/decode test yet, this fixes a linking issue with Apple's G++ whereby the Common symbols (the function pointers themselves) wouldn't be resolved. Fixing this linking issue is the primary impetus for this patch, as none of the tests exercise the RTCD functionality except through the main API. Change-Id: I12aed91ca37a707e5309aa6cb9c38a649c06bc6a --- test/test_libvpx.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/test_libvpx.cc b/test/test_libvpx.cc index 2b9b0c21f..52a4fb9d5 100644 --- a/test/test_libvpx.cc +++ b/test/test_libvpx.cc @@ -12,6 +12,12 @@ #if ARCH_X86 || ARCH_X86_64 extern "C" { #include "vpx_ports/x86.h" +#if CONFIG_VP8 +extern void vp8_rtcd(); +#endif +#if CONFIG_VP9 +extern void vp9_rtcd(); +#endif } #endif #include "third_party/googletest/src/include/gtest/gtest.h" @@ -41,5 +47,12 @@ int main(int argc, char **argv) { append_gtest_filter(":-SSE4_1/*"); #endif +#if CONFIG_VP8 + vp8_rtcd(); +#endif +#if CONFIG_VP9 + vp9_rtcd(); +#endif + return RUN_ALL_TESTS(); } From eec0bc4f1e70818e517fff3074d27ec946defbbd Mon Sep 17 00:00:00 2001 From: Frank Galligan Date: Fri, 7 Dec 2012 15:25:44 -0800 Subject: [PATCH 2/4] Fix implicit cast. Change-Id: I1eb7433061a6c529471026e0ebdc6467942062eb --- vp9/common/vp9_findnearmv.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vp9/common/vp9_findnearmv.h b/vp9/common/vp9_findnearmv.h index d401c7373..8dab55300 100644 --- a/vp9/common/vp9_findnearmv.h +++ b/vp9/common/vp9_findnearmv.h @@ -150,7 +150,8 @@ static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) { if (cur_mb->mbmi.mode < I8X8_PRED) { return pred_mode_conv(cur_mb->mbmi.mode); } else if (cur_mb->mbmi.mode == I8X8_PRED) { - return pred_mode_conv((cur_mb->bmi + 3 + b)->as_mode.first); + return pred_mode_conv( + (MB_PREDICTION_MODE)(cur_mb->bmi + 3 + b)->as_mode.first); } else if (cur_mb->mbmi.mode == B_PRED) { return ((cur_mb->bmi + 3 + b)->as_mode.first); } else { @@ -169,7 +170,8 @@ static B_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb, if (cur_mb->mbmi.mode < I8X8_PRED) { return pred_mode_conv(cur_mb->mbmi.mode); } else if (cur_mb->mbmi.mode == I8X8_PRED) { - return pred_mode_conv((cur_mb->bmi + 12 + b)->as_mode.first); + return pred_mode_conv( + (MB_PREDICTION_MODE)(cur_mb->bmi + 12 + b)->as_mode.first); } else if (cur_mb->mbmi.mode == B_PRED) { return ((cur_mb->bmi + 12 + b)->as_mode.first); } else { From 8d449ce0a919dad33a0ec0ba03368e8449317851 Mon Sep 17 00:00:00 2001 From: Frank Galligan Date: Fri, 7 Dec 2012 15:29:18 -0800 Subject: [PATCH 3/4] Remove unused symbols from vp9 asm offsets C files. Change-Id: I366e6d175da3012f1c8607fd7fad99fbbb616091 --- vp9/decoder/vp9_asm_dec_offsets.c | 19 -------------- vp9/encoder/vp9_asm_enc_offsets.c | 41 ------------------------------- 2 files changed, 60 deletions(-) diff --git a/vp9/decoder/vp9_asm_dec_offsets.c b/vp9/decoder/vp9_asm_dec_offsets.c index 5abc40f8c..e4b9c97af 100644 --- a/vp9/decoder/vp9_asm_dec_offsets.c +++ b/vp9/decoder/vp9_asm_dec_offsets.c @@ -14,25 +14,6 @@ BEGIN -DEFINE(detok_scan, offsetof(DETOK, scan)); -DEFINE(detok_ptr_block2leftabove, offsetof(DETOK, ptr_block2leftabove)); -DEFINE(detok_coef_tree_ptr, offsetof(DETOK, vp9_coef_tree_ptr)); -DEFINE(detok_norm_ptr, offsetof(DETOK, norm_ptr)); -DEFINE(detok_ptr_coef_bands_x, offsetof(DETOK, ptr_coef_bands_x)); - -DEFINE(detok_A, offsetof(DETOK, A)); -DEFINE(detok_L, offsetof(DETOK, L)); - -DEFINE(detok_qcoeff_start_ptr, offsetof(DETOK, qcoeff_start_ptr)); -DEFINE(detok_coef_probs, offsetof(DETOK, coef_probs)); -DEFINE(detok_eob, offsetof(DETOK, eob)); - -DEFINE(bool_decoder_user_buffer_end, offsetof(BOOL_DECODER, user_buffer_end)); -DEFINE(bool_decoder_user_buffer, offsetof(BOOL_DECODER, user_buffer)); -DEFINE(bool_decoder_value, offsetof(BOOL_DECODER, value)); -DEFINE(bool_decoder_count, offsetof(BOOL_DECODER, count)); -DEFINE(bool_decoder_range, offsetof(BOOL_DECODER, range)); - END /* add asserts for any offset that is not supported by assembly code */ diff --git a/vp9/encoder/vp9_asm_enc_offsets.c b/vp9/encoder/vp9_asm_enc_offsets.c index 30431ff8c..71fad2e07 100644 --- a/vp9/encoder/vp9_asm_enc_offsets.c +++ b/vp9/encoder/vp9_asm_enc_offsets.c @@ -34,47 +34,6 @@ DEFINE(vp9_blockd_dequant, offsetof(BLOCKD, dequant)); DEFINE(vp9_blockd_dqcoeff, offsetof(BLOCKD, dqcoeff)); DEFINE(vp9_blockd_eob, offsetof(BLOCKD, eob)); -/* subtract */ -DEFINE(vp9_block_base_src, offsetof(BLOCK, base_src)); -DEFINE(vp9_block_src, offsetof(BLOCK, src)); -DEFINE(vp9_block_src_diff, offsetof(BLOCK, src_diff)); -DEFINE(vp9_block_src_stride, offsetof(BLOCK, src_stride)); - -DEFINE(vp9_blockd_predictor, offsetof(BLOCKD, predictor)); - -/* pack tokens */ -DEFINE(vp9_writer_lowvalue, offsetof(vp9_writer, lowvalue)); -DEFINE(vp9_writer_range, offsetof(vp9_writer, range)); -DEFINE(vp9_writer_value, offsetof(vp9_writer, value)); -DEFINE(vp9_writer_count, offsetof(vp9_writer, count)); -DEFINE(vp9_writer_pos, offsetof(vp9_writer, pos)); -DEFINE(vp9_writer_buffer, offsetof(vp9_writer, buffer)); - -DEFINE(tokenextra_token, offsetof(TOKENEXTRA, Token)); -DEFINE(tokenextra_extra, offsetof(TOKENEXTRA, Extra)); -DEFINE(tokenextra_context_tree, offsetof(TOKENEXTRA, context_tree)); -DEFINE(tokenextra_skip_eob_node, offsetof(TOKENEXTRA, skip_eob_node)); -DEFINE(TOKENEXTRA_SZ, sizeof(TOKENEXTRA)); - -DEFINE(vp9_extra_bit_struct_sz, sizeof(vp9_extra_bit_struct)); - -DEFINE(vp9_token_value, offsetof(vp9_token, value)); -DEFINE(vp9_token_len, offsetof(vp9_token, Len)); - -DEFINE(vp9_extra_bit_struct_tree, offsetof(vp9_extra_bit_struct, tree)); -DEFINE(vp9_extra_bit_struct_prob, offsetof(vp9_extra_bit_struct, prob)); -DEFINE(vp9_extra_bit_struct_len, offsetof(vp9_extra_bit_struct, Len)); -DEFINE(vp9_extra_bit_struct_base_val, offsetof(vp9_extra_bit_struct, base_val)); - -DEFINE(vp9_comp_tplist, offsetof(VP9_COMP, tplist)); -DEFINE(vp9_comp_common, offsetof(VP9_COMP, common)); - -DEFINE(tokenlist_start, offsetof(TOKENLIST, start)); -DEFINE(tokenlist_stop, offsetof(TOKENLIST, stop)); -DEFINE(TOKENLIST_SZ, sizeof(TOKENLIST)); - -DEFINE(vp9_common_mb_rows, offsetof(VP9_COMMON, mb_rows)); - END /* add asserts for any offset that is not supported by assembly code From 1c0ee77589b05a99ec50abdd373d2ba15d4fc8d6 Mon Sep 17 00:00:00 2001 From: Frank Galligan Date: Fri, 7 Dec 2012 15:20:39 -0800 Subject: [PATCH 4/4] Fix meaninglesss if. Change-Id: I0cb06d77805246fe39d39ad3bc5df3c3f52c7050 --- vp9/encoder/vp9_firstpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 71a8cefe6..0acda25ad 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -780,7 +780,7 @@ void vp9_first_pass(VP9_COMP *cpi) { else recon_file = fopen(filename, "ab"); - if (fwrite(lst_yv12->buffer_alloc, lst_yv12->frame_size, 1, recon_file)); + (void)fwrite(lst_yv12->buffer_alloc, lst_yv12->frame_size, 1, recon_file); fclose(recon_file); }