ref: b453941caffb0bf7e826c1e092f5d8affd101089
parent: 40aa910c19d2dc03b905966c66a75ed68d52f5c7
author: James Zern <jzern@google.com>
date: Sat Jan 18 07:16:11 EST 2014
vp9/encoder: add extern "C" to headers Change-Id: I4f51ce859a97bf1b8fd2b37ac585b7c643232b69
--- a/vp9/encoder/vp9_bitstream.h
+++ b/vp9/encoder/vp9_bitstream.h
@@ -12,6 +12,14 @@
#ifndef VP9_ENCODER_VP9_BITSTREAM_H_
#define VP9_ENCODER_VP9_BITSTREAM_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_update_skip_probs(VP9_COMMON *cm, vp9_writer *bc);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_BITSTREAM_H_
--- a/vp9/encoder/vp9_block.h
+++ b/vp9/encoder/vp9_block.h
@@ -17,6 +17,10 @@
#include "vpx_ports/mem.h"
#include "vp9/common/vp9_onyxc_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// motion search site
typedef struct {
MV mv;
@@ -253,5 +257,9 @@
int skip;
const int16_t *scan, *nb;
};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_BLOCK_H_
--- a/vp9/encoder/vp9_dct.h
+++ b/vp9/encoder/vp9_dct.h
@@ -12,6 +12,10 @@
#ifndef VP9_ENCODER_VP9_DCT_H_
#define VP9_ENCODER_VP9_DCT_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_fht4x4(TX_TYPE tx_type, const int16_t *input, int16_t *output,
int stride);
@@ -20,5 +24,9 @@
void vp9_fht16x16(TX_TYPE tx_type, const int16_t *input, int16_t *output,
int stride);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_DCT_H_
--- a/vp9/encoder/vp9_encodeframe.h
+++ b/vp9/encoder/vp9_encodeframe.h
@@ -12,6 +12,10 @@
#ifndef VP9_ENCODER_VP9_ENCODEFRAME_H_
#define VP9_ENCODER_VP9_ENCODEFRAME_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct macroblock;
struct yv12_buffer_config;
@@ -18,5 +22,9 @@
void vp9_setup_src_planes(struct macroblock *x,
const struct yv12_buffer_config *src,
int mi_row, int mi_col);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_ENCODEFRAME_H_
--- a/vp9/encoder/vp9_encodemb.h
+++ b/vp9/encoder/vp9_encodemb.h
@@ -16,6 +16,10 @@
#include "vp9/encoder/vp9_onyx_int.h"
#include "vp9/common/vp9_onyxc_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct optimize_ctx {
ENTROPY_CONTEXT ta[MAX_MB_PLANE][16];
ENTROPY_CONTEXT tl[MAX_MB_PLANE][16];
@@ -47,4 +51,8 @@
void vp9_setup_interp_filters(MACROBLOCKD *xd,
INTERPOLATION_TYPE mcomp_filter_type,
VP9_COMMON *cm);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_ENCODEMB_H_
--- a/vp9/encoder/vp9_encodemv.h
+++ b/vp9/encoder/vp9_encodemv.h
@@ -14,6 +14,10 @@
#include "vp9/encoder/vp9_onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_entropy_mv_init();
void vp9_write_nmv_probs(VP9_COMMON *cm, int usehp, vp9_writer* const);
@@ -29,5 +33,9 @@
int mvc_flag_h);
void vp9_update_mv_count(VP9_COMP *cpi, MACROBLOCK *x, int_mv best_ref_mv[2]);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_ENCODEMV_H_
--- a/vp9/encoder/vp9_extend.h
+++ b/vp9/encoder/vp9_extend.h
@@ -14,7 +14,11 @@
#include "vpx_scale/yv12config.h"
#include "vpx/vpx_integer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src,
YV12_BUFFER_CONFIG *dst);
@@ -22,4 +26,8 @@
YV12_BUFFER_CONFIG *dst,
int srcy, int srcx,
int srch, int srcw);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_EXTEND_H_
--- a/vp9/encoder/vp9_firstpass.h
+++ b/vp9/encoder/vp9_firstpass.h
@@ -12,6 +12,10 @@
#define VP9_ENCODER_VP9_FIRSTPASS_H_
#include "vp9/encoder/vp9_onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_init_first_pass(VP9_COMP *cpi);
void vp9_first_pass(VP9_COMP *cpi);
void vp9_end_first_pass(VP9_COMP *cpi);
@@ -24,5 +28,9 @@
void vp9_get_one_pass_params(VP9_COMP *cpi);
void vp9_get_one_pass_cbr_params(VP9_COMP *cpi);
void vp9_get_svc_params(VP9_COMP *cpi);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_FIRSTPASS_H_
--- a/vp9/encoder/vp9_lookahead.h
+++ b/vp9/encoder/vp9_lookahead.h
@@ -14,6 +14,10 @@
#include "vpx_scale/yv12config.h"
#include "vpx/vpx_integer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MAX_LAG_BUFFERS 25
struct lookahead_entry {
@@ -93,5 +97,9 @@
* \param[in] ctx Pointer to the lookahead context
*/
unsigned int vp9_lookahead_depth(struct lookahead_ctx *ctx);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_LOOKAHEAD_H_
--- a/vp9/encoder/vp9_mbgraph.h
+++ b/vp9/encoder/vp9_mbgraph.h
@@ -11,6 +11,14 @@
#ifndef VP9_ENCODER_VP9_MBGRAPH_H_
#define VP9_ENCODER_VP9_MBGRAPH_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_update_mbgraph_stats(VP9_COMP *cpi);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_MBGRAPH_H_
--- a/vp9/encoder/vp9_mcomp.h
+++ b/vp9/encoder/vp9_mcomp.h
@@ -15,6 +15,10 @@
#include "vp9/encoder/vp9_block.h"
#include "vp9/encoder/vp9_variance.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// The maximum number of steps in a step search given the largest
// allowed initial step
#define MAX_MVSEARCH_STEPS 11
@@ -129,4 +133,8 @@
int *mvjcost, int *mvcost[2],
const MV *center_mv, const uint8_t *second_pred,
int w, int h);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_MCOMP_H_
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -28,6 +28,10 @@
#include "vp9/encoder/vp9_mcomp.h"
#include "vp9/encoder/vp9_lookahead.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define DISABLE_RC_LONG_TERM_MEM 0
// #define MODE_TEST_HIT_STATS
@@ -824,5 +828,9 @@
static int get_token_alloc(int mb_rows, int mb_cols) {
return mb_rows * mb_cols * (48 * 16 + 4);
}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_ONYX_INT_H_
--- a/vp9/encoder/vp9_picklpf.h
+++ b/vp9/encoder/vp9_picklpf.h
@@ -12,6 +12,10 @@
#ifndef VP9_ENCODER_VP9_PICKLPF_H_
#define VP9_ENCODER_VP9_PICKLPF_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct yv12_buffer_config;
struct VP9_COMP;
@@ -19,4 +23,8 @@
void vp9_pick_filter_level(struct yv12_buffer_config *sd,
struct VP9_COMP *cpi, int partial);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_PICKLPF_H_
--- a/vp9/encoder/vp9_pickmode.h
+++ b/vp9/encoder/vp9_pickmode.h
@@ -8,8 +8,15 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP9_ENCODER_VP9_PICKMODE_H_
+#define VP9_ENCODER_VP9_PICKMODE_H_
+
#include "vp9/encoder/vp9_onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
const struct TileInfo *const tile,
int mi_row, int mi_col,
@@ -17,3 +24,9 @@
int64_t *returndistortion,
BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_ENCODER_VP9_PICKMODE_H_
--- a/vp9/encoder/vp9_psnr.h
+++ b/vp9/encoder/vp9_psnr.h
@@ -12,6 +12,14 @@
#ifndef VP9_ENCODER_VP9_PSNR_H_
#define VP9_ENCODER_VP9_PSNR_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
double vp9_mse2psnr(double samples, double peak, double mse);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_PSNR_H_
--- a/vp9/encoder/vp9_quantize.h
+++ b/vp9/encoder/vp9_quantize.h
@@ -13,6 +13,10 @@
#include "vp9/encoder/vp9_block.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block,
const int16_t *scan, const int16_t *iscan);
@@ -27,5 +31,9 @@
void vp9_mb_init_quantizer(struct VP9_COMP *cpi, MACROBLOCK *x);
void vp9_init_quantizer(struct VP9_COMP *cpi);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_QUANTIZE_H_
--- a/vp9/encoder/vp9_ratectrl.h
+++ b/vp9/encoder/vp9_ratectrl.h
@@ -14,6 +14,10 @@
#include "vp9/encoder/vp9_onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define FRAME_OVERHEAD_BITS 200
void vp9_save_coding_context(VP9_COMP *cpi);
@@ -68,5 +72,9 @@
// Update the buffer level.
void vp9_update_buffer_level(VP9_COMP *cpi, int encoded_frame_size);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_RATECTRL_H_
--- a/vp9/encoder/vp9_rdopt.h
+++ b/vp9/encoder/vp9_rdopt.h
@@ -13,6 +13,10 @@
#include "vp9/encoder/vp9_onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RDDIV_BITS 7
#define RDCOST(RM, DM, R, D) \
@@ -79,5 +83,9 @@
ENTROPY_CONTEXT t_above[16], ENTROPY_CONTEXT t_left[16],
const ENTROPY_CONTEXT *above, const ENTROPY_CONTEXT *left,
int num_4x4_w, int num_4x4_h);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_RDOPT_H_
--- a/vp9/encoder/vp9_segmentation.h
+++ b/vp9/encoder/vp9_segmentation.h
@@ -15,6 +15,10 @@
#include "vp9/common/vp9_blockd.h"
#include "vp9/encoder/vp9_onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_enable_segmentation(VP9_PTR ptr);
void vp9_disable_segmentation(VP9_PTR ptr);
@@ -44,5 +48,9 @@
void vp9_choose_segmap_coding_method(VP9_COMP *cpi);
void vp9_reset_segment_features(struct segmentation *seg);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_SEGMENTATION_H_
--- a/vp9/encoder/vp9_subexp.h
+++ b/vp9/encoder/vp9_subexp.h
@@ -12,6 +12,10 @@
#ifndef VP9_ENCODER_VP9_SUBEXP_H_
#define VP9_ENCODER_VP9_SUBEXP_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_compute_update_table();
@@ -31,5 +35,9 @@
vp9_prob *bestp,
vp9_prob upd,
int b, int r);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_SUBEXP_H_
--- a/vp9/encoder/vp9_temporal_filter.h
+++ b/vp9/encoder/vp9_temporal_filter.h
@@ -11,8 +11,16 @@
#ifndef VP9_ENCODER_VP9_TEMPORAL_FILTER_H_
#define VP9_ENCODER_VP9_TEMPORAL_FILTER_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_temporal_filter_prepare(VP9_COMP *cpi, int distance);
void configure_arnr_filter(VP9_COMP *cpi, const unsigned int this_frame,
const int group_boost);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_TEMPORAL_FILTER_H_
--- a/vp9/encoder/vp9_tokenize.h
+++ b/vp9/encoder/vp9_tokenize.h
@@ -16,6 +16,10 @@
#include "vp9/encoder/vp9_block.h"
#include "vp9/encoder/vp9_treewriter.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_tokenize_initialize();
#define EOSB_TOKEN 127 // Not signalled, encoder only
@@ -49,5 +53,9 @@
* fields are not.
*/
extern const TOKENVALUE *vp9_dct_value_tokens_ptr;
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_TOKENIZE_H_
--- a/vp9/encoder/vp9_treewriter.h
+++ b/vp9/encoder/vp9_treewriter.h
@@ -13,6 +13,10 @@
#include "vp9/encoder/vp9_writer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define vp9_cost_zero(prob) (vp9_prob_cost[prob])
#define vp9_cost_one(prob) vp9_cost_zero(vp9_complement(prob))
@@ -68,5 +72,9 @@
const struct vp9_token *token) {
vp9_write_tree(w, tree, probs, token->value, token->len, 0);
}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_TREEWRITER_H_
--- a/vp9/encoder/vp9_vaq.h
+++ b/vp9/encoder/vp9_vaq.h
@@ -14,6 +14,10 @@
#include "vp9/encoder/vp9_onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
unsigned int vp9_vaq_segment_id(int energy);
double vp9_vaq_rdmult_ratio(int energy);
double vp9_vaq_inv_q_ratio(int energy);
@@ -22,5 +26,9 @@
void vp9_vaq_frame_setup(VP9_COMP *cpi);
int vp9_block_energy(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_VAQ_H_
--- a/vp9/encoder/vp9_variance.h
+++ b/vp9/encoder/vp9_variance.h
@@ -12,8 +12,11 @@
#define VP9_ENCODER_VP9_VARIANCE_H_
#include "vpx/vpx_integer.h"
-// #include "./vpx_config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void variance(const uint8_t *src_ptr,
int source_stride,
const uint8_t *ref_ptr,
@@ -112,4 +115,8 @@
ref += ref_stride;
}
}
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_VARIANCE_H_
--- a/vp9/encoder/vp9_write_bit_buffer.h
+++ b/vp9/encoder/vp9_write_bit_buffer.h
@@ -15,6 +15,10 @@
#include "vpx/vpx_integer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct vp9_write_bit_buffer {
uint8_t *bit_buffer;
size_t bit_offset;
@@ -44,5 +48,9 @@
vp9_wb_write_bit(wb, (data >> bit) & 1);
}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_WRITE_BIT_BUFFER_H_
--- a/vp9/encoder/vp9_writer.h
+++ b/vp9/encoder/vp9_writer.h
@@ -15,6 +15,10 @@
#include "vp9/common/vp9_prob.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
unsigned int lowvalue;
unsigned int range;
@@ -104,5 +108,9 @@
}
#define vp9_write_prob(w, v) vp9_write_literal((w), (v), 8)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_WRITER_H_
--- a/vp9/encoder/x86/vp9_mcomp_x86.h
+++ b/vp9/encoder/x86/vp9_mcomp_x86.h
@@ -12,6 +12,10 @@
#ifndef VP9_ENCODER_X86_VP9_MCOMP_X86_H_
#define VP9_ENCODER_X86_VP9_MCOMP_X86_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if HAVE_SSE3
#if !CONFIG_RUNTIME_CPU_DETECT
@@ -34,6 +38,10 @@
#define vp9_search_full_search vp9_full_search_sadx8
#endif
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
#endif
#endif // VP9_ENCODER_X86_VP9_MCOMP_X86_H_
--
⑨