From 982deebb5ed944b280fa4765c9cd6383c47c7ff2 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Tue, 30 Oct 2012 17:53:32 -0700 Subject: [PATCH] Change name of common top-level structures from VP8 to VP9. This change encompasses VP8_PTR, VP8_COMP, VP8D_COMP, VP8_COMMON, VP8Decompressor and VP8Common. Change-Id: I514ef4ad4e682370f36d656af1c09ee20da216ad --- vp8/common/alloccommon.c | 14 +- vp8/common/alloccommon.h | 14 +- vp8/common/arm/arm_systemdependent.c | 4 +- vp8/common/blockd.h | 2 +- vp8/common/entropy.c | 4 +- vp8/common/entropy.h | 6 +- vp8/common/entropymode.c | 12 +- vp8/common/entropymode.h | 12 +- vp8/common/entropymv.c | 4 +- vp8/common/entropymv.h | 8 +- vp8/common/findnearmv.c | 2 +- vp8/common/findnearmv.h | 2 +- vp8/common/generic/systemdependent.c | 8 +- vp8/common/implicit_segmentation.c | 2 +- vp8/common/loopfilter.c | 10 +- vp8/common/loopfilter.h | 12 +- vp8/common/onyx.h | 34 ++--- vp8/common/onyxc_int.h | 10 +- vp8/common/postproc.c | 2 +- vp8/common/postproc.h | 2 +- vp8/common/pred_common.c | 12 +- vp8/common/pred_common.h | 12 +- vp8/common/reconinter.c | 2 +- vp8/common/reconinter.h | 2 +- vp8/common/systemdependent.h | 4 +- vp8/common/x86/x86_systemdependent.c | 4 +- vp8/decoder/decodemv.c | 30 ++-- vp8/decoder/decodemv.h | 4 +- vp8/decoder/decodframe.c | 36 ++--- vp8/decoder/detokenize.c | 8 +- vp8/decoder/detokenize.h | 6 +- vp8/decoder/onyxd_if.c | 32 ++-- vp8/decoder/onyxd_int.h | 8 +- vp8/decoder/reconintra_mt.c | 12 +- vp8/encoder/arm/arm_csystemdependent.c | 2 +- vp8/encoder/asm_enc_offsets.c | 6 +- vp8/encoder/bitstream.c | 48 +++--- vp8/encoder/bitstream.h | 2 +- vp8/encoder/encodeframe.c | 90 +++++------ vp8/encoder/encodeintra.c | 2 +- vp8/encoder/encodeintra.h | 2 +- vp8/encoder/encodemv.c | 2 +- vp8/encoder/encodemv.h | 2 +- vp8/encoder/firstpass.c | 70 ++++----- vp8/encoder/firstpass.h | 12 +- vp8/encoder/generic/csystemdependent.c | 6 +- vp8/encoder/mbgraph.c | 26 ++-- vp8/encoder/mbgraph.h | 2 +- vp8/encoder/mcomp.c | 2 +- vp8/encoder/mcomp.h | 4 +- vp8/encoder/modecosts.c | 4 +- vp8/encoder/modecosts.h | 2 +- vp8/encoder/onyx_if.c | 204 ++++++++++++------------- vp8/encoder/onyx_int.h | 20 +-- vp8/encoder/picklpf.c | 14 +- vp8/encoder/quantize.c | 12 +- vp8/encoder/quantize.h | 12 +- vp8/encoder/ratectrl.c | 34 ++--- vp8/encoder/ratectrl.h | 18 +-- vp8/encoder/rdopt.c | 86 +++++------ vp8/encoder/rdopt.h | 10 +- vp8/encoder/segmentation.c | 22 +-- vp8/encoder/segmentation.h | 12 +- vp8/encoder/temporal_filter.c | 6 +- vp8/encoder/tokenize.c | 18 +-- vp8/encoder/x86/x86_csystemdependent.c | 2 +- vp8/vp8_cx_iface.c | 12 +- vp8/vp8_dx_iface.c | 6 +- 68 files changed, 554 insertions(+), 554 deletions(-) diff --git a/vp8/common/alloccommon.c b/vp8/common/alloccommon.c index 659cd5d69..3330bd265 100644 --- a/vp8/common/alloccommon.c +++ b/vp8/common/alloccommon.c @@ -21,7 +21,7 @@ extern void vp8_init_scan_order_mask(); -void vp9_update_mode_info_border(VP8_COMMON *cpi, MODE_INFO *mi_base) { +void vp9_update_mode_info_border(VP9_COMMON *cpi, MODE_INFO *mi_base) { int stride = cpi->mode_info_stride; int i; @@ -34,7 +34,7 @@ void vp9_update_mode_info_border(VP8_COMMON *cpi, MODE_INFO *mi_base) { } } -void vp9_update_mode_info_in_image(VP8_COMMON *cpi, MODE_INFO *mi) { +void vp9_update_mode_info_in_image(VP9_COMMON *cpi, MODE_INFO *mi) { int i, j; // For each in image mode_info element set the in image flag to 1 @@ -48,7 +48,7 @@ void vp9_update_mode_info_in_image(VP8_COMMON *cpi, MODE_INFO *mi) { } } -void vp9_de_alloc_frame_buffers(VP8_COMMON *oci) { +void vp9_de_alloc_frame_buffers(VP9_COMMON *oci) { int i; for (i = 0; i < NUM_YV12_BUFFERS; i++) @@ -67,7 +67,7 @@ void vp9_de_alloc_frame_buffers(VP8_COMMON *oci) { } -int vp9_alloc_frame_buffers(VP8_COMMON *oci, int width, int height) { +int vp9_alloc_frame_buffers(VP9_COMMON *oci, int width, int height) { int i; vp9_de_alloc_frame_buffers(oci); @@ -145,7 +145,7 @@ int vp9_alloc_frame_buffers(VP8_COMMON *oci, int width, int height) { return 0; } -void vp9_setup_version(VP8_COMMON *cm) { +void vp9_setup_version(VP9_COMMON *cm) { if (cm->version & 0x4) { if (!CONFIG_EXPERIMENTAL) vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, @@ -183,7 +183,7 @@ void vp9_setup_version(VP8_COMMON *cm) { // break; } } -void vp9_create_common(VP8_COMMON *oci) { +void vp9_create_common(VP9_COMMON *oci) { vp9_machine_specific_config(oci); vp9_init_mbmode_probs(oci); @@ -209,7 +209,7 @@ void vp9_create_common(VP8_COMMON *oci) { oci->kf_ymode_probs_update = 0; } -void vp9_remove_common(VP8_COMMON *oci) { +void vp9_remove_common(VP9_COMMON *oci) { vp9_de_alloc_frame_buffers(oci); } diff --git a/vp8/common/alloccommon.h b/vp8/common/alloccommon.h index 0214afa74..490b869b7 100644 --- a/vp8/common/alloccommon.h +++ b/vp8/common/alloccommon.h @@ -14,13 +14,13 @@ #include "onyxc_int.h" -void vp9_create_common(VP8_COMMON *oci); -void vp9_remove_common(VP8_COMMON *oci); -void vp9_de_alloc_frame_buffers(VP8_COMMON *oci); -int vp9_alloc_frame_buffers(VP8_COMMON *oci, int width, int height); -void vp9_setup_version(VP8_COMMON *oci); +void vp9_create_common(VP9_COMMON *oci); +void vp9_remove_common(VP9_COMMON *oci); +void vp9_de_alloc_frame_buffers(VP9_COMMON *oci); +int vp9_alloc_frame_buffers(VP9_COMMON *oci, int width, int height); +void vp9_setup_version(VP9_COMMON *oci); -void vp9_update_mode_info_border(VP8_COMMON *cpi, MODE_INFO *mi_base); -void vp9_update_mode_info_in_image(VP8_COMMON *cpi, MODE_INFO *mi); +void vp9_update_mode_info_border(VP9_COMMON *cpi, MODE_INFO *mi_base); +void vp9_update_mode_info_in_image(VP9_COMMON *cpi, MODE_INFO *mi); #endif diff --git a/vp8/common/arm/arm_systemdependent.c b/vp8/common/arm/arm_systemdependent.c index a0028d654..8026670b1 100644 --- a/vp8/common/arm/arm_systemdependent.c +++ b/vp8/common/arm/arm_systemdependent.c @@ -19,9 +19,9 @@ #include "vp8/common/idct.h" #include "vp8/common/onyxc_int.h" -void vp8_arch_arm_common_init(VP8_COMMON *ctx) { +void vp8_arch_arm_common_init(VP9_COMMON *ctx) { #if CONFIG_RUNTIME_CPU_DETECT - VP8_COMMON_RTCD *rtcd = &ctx->rtcd; + VP9_COMMON_RTCD *rtcd = &ctx->rtcd; int flags = arm_cpu_caps(); rtcd->flags = flags; diff --git a/vp8/common/blockd.h b/vp8/common/blockd.h index 90b78502b..4db6fdb18 100644 --- a/vp8/common/blockd.h +++ b/vp8/common/blockd.h @@ -370,7 +370,7 @@ typedef struct macroblockd { #endif #if CONFIG_RUNTIME_CPU_DETECT - struct VP8_COMMON_RTCD *rtcd; + struct VP9_COMMON_RTCD *rtcd; #endif int mb_index; // Index of the MB in the SB (0..3) diff --git a/vp8/common/entropy.c b/vp8/common/entropy.c index 34c3c2fdd..c3a7c1bd3 100644 --- a/vp8/common/entropy.c +++ b/vp8/common/entropy.c @@ -202,7 +202,7 @@ vp8_extra_bit_struct vp9_extra_bits[12] = { #include "default_coef_probs.h" -void vp9_default_coef_probs(VP8_COMMON *pc) { +void vp9_default_coef_probs(VP9_COMMON *pc) { vpx_memcpy(pc->fc.coef_probs, default_coef_probs, sizeof(pc->fc.coef_probs)); vpx_memcpy(pc->fc.hybrid_coef_probs, default_hybrid_coef_probs, @@ -234,7 +234,7 @@ void vp9_coef_tree_initialize() { #define COEF_COUNT_SAT_AFTER_KEY 24 #define COEF_MAX_UPDATE_FACTOR_AFTER_KEY 128 -void vp9_adapt_coef_probs(VP8_COMMON *cm) { +void vp9_adapt_coef_probs(VP9_COMMON *cm) { int t, i, j, k, count; unsigned int branch_ct[ENTROPY_NODES][2]; vp8_prob coef_probs[ENTROPY_NODES]; diff --git a/vp8/common/entropy.h b/vp8/common/entropy.h index a96b4044b..8dd7d0023 100644 --- a/vp8/common/entropy.h +++ b/vp8/common/entropy.h @@ -100,8 +100,8 @@ extern DECLARE_ALIGNED(16, const int, vp9_coef_bands_16x16[256]); extern DECLARE_ALIGNED(16, const unsigned char, vp9_prev_token_class[MAX_ENTROPY_TOKENS]); -struct VP8Common; -void vp9_default_coef_probs(struct VP8Common *); +struct VP9Common; +void vp9_default_coef_probs(struct VP9Common *); extern DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d[16]); extern DECLARE_ALIGNED(16, const int, vp9_col_scan[16]); @@ -112,6 +112,6 @@ extern DECLARE_ALIGNED(64, const int, vp9_default_zig_zag1d_8x8[64]); void vp9_coef_tree_initialize(void); extern DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_16x16[256]); -void vp9_adapt_coef_probs(struct VP8Common *); +void vp9_adapt_coef_probs(struct VP9Common *); #endif diff --git a/vp8/common/entropymode.c b/vp8/common/entropymode.c index 4578b4a23..8e6855075 100644 --- a/vp8/common/entropymode.c +++ b/vp8/common/entropymode.c @@ -260,7 +260,7 @@ struct vp8_token_struct vp9_sub_mv_ref_encoding_array [VP8_SUBMVREFS]; -void vp9_init_mbmode_probs(VP8_COMMON *x) { +void vp9_init_mbmode_probs(VP9_COMMON *x) { unsigned int bct [VP8_YMODES] [2]; /* num Ymodes > num UV modes */ vp9_tree_probs_from_distribution(VP8_YMODES, vp9_ymode_encodings, @@ -387,7 +387,7 @@ void vp9_entropy_mode_init() { vp9_sub_mv_ref_tree, LEFT4X4); } -void vp9_init_mode_contexts(VP8_COMMON *pc) { +void vp9_init_mode_contexts(VP9_COMMON *pc) { vpx_memset(pc->fc.mv_ref_ct, 0, sizeof(pc->fc.mv_ref_ct)); vpx_memset(pc->fc.mv_ref_ct_a, 0, sizeof(pc->fc.mv_ref_ct_a)); @@ -400,7 +400,7 @@ void vp9_init_mode_contexts(VP8_COMMON *pc) { } -void vp9_accum_mv_refs(VP8_COMMON *pc, +void vp9_accum_mv_refs(VP9_COMMON *pc, MB_PREDICTION_MODE m, const int ct[4]) { int (*mv_ref_ct)[4][2]; @@ -434,7 +434,7 @@ void vp9_accum_mv_refs(VP8_COMMON *pc, #define MVREF_COUNT_SAT 20 #define MVREF_MAX_UPDATE_FACTOR 144 -void vp9_update_mode_context(VP8_COMMON *pc) { +void vp9_update_mode_context(VP9_COMMON *pc) { int i, j; int (*mv_ref_ct)[4][2]; int (*mode_context)[4]; @@ -467,7 +467,7 @@ void vp9_update_mode_context(VP8_COMMON *pc) { #ifdef MODE_STATS #include "vp8/common/modecont.h" -void print_mode_contexts(VP8_COMMON *pc) { +void print_mode_contexts(VP9_COMMON *pc) { int j, i; printf("\n====================\n"); for (j = 0; j < 6; j++) { @@ -489,7 +489,7 @@ void print_mode_contexts(VP8_COMMON *pc) { // #define MODE_COUNT_TESTING #define MODE_COUNT_SAT 20 #define MODE_MAX_UPDATE_FACTOR 144 -void vp9_adapt_mode_probs(VP8_COMMON *cm) { +void vp9_adapt_mode_probs(VP9_COMMON *cm) { int i, t, count, factor; unsigned int branch_ct[32][2]; vp8_prob ymode_probs[VP8_YMODES - 1]; diff --git a/vp8/common/entropymode.h b/vp8/common/entropymode.h index ff22fa014..5af6d9ab2 100644 --- a/vp8/common/entropymode.h +++ b/vp8/common/entropymode.h @@ -63,18 +63,18 @@ extern struct vp8_token_struct vp9_sub_mv_ref_encoding_array [VP8_SUBMVREFS]; void vp9_entropy_mode_init(void); -struct VP8Common; -void vp9_init_mbmode_probs(struct VP8Common *x); -extern void vp9_init_mode_contexts(struct VP8Common *pc); -extern void vp9_update_mode_context(struct VP8Common *pc);; -extern void vp9_accum_mv_refs(struct VP8Common *pc, +struct VP9Common; +void vp9_init_mbmode_probs(struct VP9Common *x); +extern void vp9_init_mode_contexts(struct VP9Common *pc); +extern void vp9_update_mode_context(struct VP9Common *pc);; +extern void vp9_accum_mv_refs(struct VP9Common *pc, MB_PREDICTION_MODE m, const int ct[4]); void vp9_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES - 1]); void vp9_kf_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES - 1]); -void vp9_adapt_mode_probs(struct VP8Common *); +void vp9_adapt_mode_probs(struct VP9Common *); #define VP8_SWITCHABLE_FILTERS 2 /* number of switchable filters */ extern const INTERPOLATIONFILTERTYPE vp9_switchable_interp diff --git a/vp8/common/entropymv.c b/vp8/common/entropymv.c index a393e1a99..e89520d47 100644 --- a/vp8/common/entropymv.c +++ b/vp8/common/entropymv.c @@ -308,7 +308,7 @@ void vp9_counts_to_nmv_context( } } -void vp9_adapt_nmv_probs(VP8_COMMON *cm, int usehp) { +void vp9_adapt_nmv_probs(VP9_COMMON *cm, int usehp) { int i, j, k; nmv_context prob; unsigned int branch_ct_joint[MV_JOINTS - 1][2]; @@ -460,6 +460,6 @@ void vp9_entropy_mv_init() { vp9_tokens_from_tree(vp9_mv_fp_encodings, vp9_mv_fp_tree); } -void vp9_init_mv_probs(VP8_COMMON *cm) { +void vp9_init_mv_probs(VP9_COMMON *cm) { vpx_memcpy(&cm->fc.nmvc, &vp9_default_nmv_context, sizeof(nmv_context)); } diff --git a/vp8/common/entropymv.h b/vp8/common/entropymv.h index a64ac74e4..85e14f137 100644 --- a/vp8/common/entropymv.h +++ b/vp8/common/entropymv.h @@ -16,13 +16,13 @@ #include "vpx_config.h" #include "blockd.h" -struct VP8Common; +struct VP9Common; void vp9_entropy_mv_init(); -void vp9_init_mv_probs(struct VP8Common *cm); -void vp8_adapt_mv_probs(struct VP8Common *cm); +void vp9_init_mv_probs(struct VP9Common *cm); +void vp8_adapt_mv_probs(struct VP9Common *cm); -void vp9_adapt_nmv_probs(struct VP8Common *cm, int usehp); +void vp9_adapt_nmv_probs(struct VP9Common *cm, int usehp); void vp8_lower_mv_precision(MV *mv); int vp9_use_nmv_hp(const MV *ref); diff --git a/vp8/common/findnearmv.c b/vp8/common/findnearmv.c index cffa77e39..8b0efeffa 100644 --- a/vp8/common/findnearmv.c +++ b/vp8/common/findnearmv.c @@ -157,7 +157,7 @@ void vp9_find_near_mvs vp8_clamp_mv2(best_mv, xd); } -vp8_prob *vp9_mv_ref_probs(VP8_COMMON *pc, +vp8_prob *vp9_mv_ref_probs(VP9_COMMON *pc, vp8_prob p[VP8_MVREFS - 1], const int near_mv_ref_ct[4] ) { p[0] = pc->fc.vp8_mode_contexts [near_mv_ref_ct[0]] [0]; diff --git a/vp8/common/findnearmv.h b/vp8/common/findnearmv.h index c429be7c7..715105d68 100644 --- a/vp8/common/findnearmv.h +++ b/vp8/common/findnearmv.h @@ -96,7 +96,7 @@ void vp9_find_near_mvs int *ref_frame_sign_bias ); -vp8_prob *vp9_mv_ref_probs(VP8_COMMON *pc, +vp8_prob *vp9_mv_ref_probs(VP9_COMMON *pc, vp8_prob p[VP8_MVREFS - 1], const int near_mv_ref_ct[4] ); diff --git a/vp8/common/generic/systemdependent.c b/vp8/common/generic/systemdependent.c index 761424a13..6fff66df7 100644 --- a/vp8/common/generic/systemdependent.c +++ b/vp8/common/generic/systemdependent.c @@ -17,12 +17,12 @@ #include "vp8/common/idct.h" #include "vp8/common/onyxc_int.h" -extern void vp9_arch_x86_common_init(VP8_COMMON *ctx); -extern void vp8_arch_arm_common_init(VP8_COMMON *ctx); +extern void vp9_arch_x86_common_init(VP9_COMMON *ctx); +extern void vp8_arch_arm_common_init(VP9_COMMON *ctx); -void vp9_machine_specific_config(VP8_COMMON *ctx) { +void vp9_machine_specific_config(VP9_COMMON *ctx) { #if CONFIG_RUNTIME_CPU_DETECT - VP8_COMMON_RTCD *rtcd = &ctx->rtcd; + VP9_COMMON_RTCD *rtcd = &ctx->rtcd; rtcd->idct.idct1 = vp9_short_idct4x4llm_1_c; rtcd->idct.idct16 = vp9_short_idct4x4llm_c; diff --git a/vp8/common/implicit_segmentation.c b/vp8/common/implicit_segmentation.c index 2b9b7ad32..d9de6032a 100644 --- a/vp8/common/implicit_segmentation.c +++ b/vp8/common/implicit_segmentation.c @@ -94,7 +94,7 @@ void merge(item *labels, int u, int v) { } -void segment_via_mode_info(VP8_COMMON *oci, int how) { +void segment_via_mode_info(VP9_COMMON *oci, int how) { MODE_INFO *mi = oci->mi; int i, j; int mb_index = 0; diff --git a/vp8/common/loopfilter.c b/vp8/common/loopfilter.c index 579780639..16e75e9f1 100644 --- a/vp8/common/loopfilter.c +++ b/vp8/common/loopfilter.c @@ -84,7 +84,7 @@ void vp9_loop_filter_update_sharpness(loop_filter_info_n *lfi, } } -void vp9_loop_filter_init(VP8_COMMON *cm) { +void vp9_loop_filter_init(VP9_COMMON *cm) { loop_filter_info_n *lfi = &cm->lf_info; int i; @@ -101,7 +101,7 @@ void vp9_loop_filter_init(VP8_COMMON *cm) { } } -void vp9_loop_filter_frame_init(VP8_COMMON *cm, +void vp9_loop_filter_frame_init(VP9_COMMON *cm, MACROBLOCKD *xd, int default_filt_lvl) { int seg, /* segment number */ @@ -180,7 +180,7 @@ void vp9_loop_filter_frame_init(VP8_COMMON *cm, void vp9_loop_filter_frame ( - VP8_COMMON *cm, + VP9_COMMON *cm, MACROBLOCKD *xd ) { YV12_BUFFER_CONFIG *post = cm->frame_to_show; @@ -318,7 +318,7 @@ void vp9_loop_filter_frame void vp9_loop_filter_frame_yonly ( - VP8_COMMON *cm, + VP9_COMMON *cm, MACROBLOCKD *xd, int default_filt_lvl ) { @@ -424,7 +424,7 @@ void vp9_loop_filter_frame_yonly void vp9_loop_filter_partial_frame ( - VP8_COMMON *cm, + VP9_COMMON *cm, MACROBLOCKD *xd, int default_filt_lvl ) { diff --git a/vp8/common/loopfilter.h b/vp8/common/loopfilter.h index 01e174e20..99c135742 100644 --- a/vp8/common/loopfilter.h +++ b/vp8/common/loopfilter.h @@ -80,22 +80,22 @@ typedef void loop_filter_uvfunction ); /* assorted loopfilter functions which get used elsewhere */ -struct VP8Common; +struct VP9Common; struct macroblockd; -void vp9_loop_filter_init(struct VP8Common *cm); +void vp9_loop_filter_init(struct VP9Common *cm); -void vp9_loop_filter_frame_init(struct VP8Common *cm, +void vp9_loop_filter_frame_init(struct VP9Common *cm, struct macroblockd *mbd, int default_filt_lvl); -void vp9_loop_filter_frame(struct VP8Common *cm, struct macroblockd *mbd); +void vp9_loop_filter_frame(struct VP9Common *cm, struct macroblockd *mbd); -void vp9_loop_filter_partial_frame(struct VP8Common *cm, +void vp9_loop_filter_partial_frame(struct VP9Common *cm, struct macroblockd *mbd, int default_filt_lvl); -void vp9_loop_filter_frame_yonly(struct VP8Common *cm, +void vp9_loop_filter_frame_yonly(struct VP9Common *cm, struct macroblockd *mbd, int default_filt_lvl); diff --git a/vp8/common/onyx.h b/vp8/common/onyx.h index c8f2b4e55..38034b85f 100644 --- a/vp8/common/onyx.h +++ b/vp8/common/onyx.h @@ -22,7 +22,7 @@ extern "C" #include "vpx_scale/yv12config.h" #include "type_aliases.h" #include "ppflags.h" - typedef int *VP8_PTR; + typedef int *VP9_PTR; /* Create/destroy static data structures. */ @@ -174,50 +174,50 @@ extern "C" void vp9_initialize_enc(); - VP8_PTR vp9_create_compressor(VP8_CONFIG *oxcf); - void vp9_remove_compressor(VP8_PTR *comp); + VP9_PTR vp9_create_compressor(VP8_CONFIG *oxcf); + void vp9_remove_compressor(VP9_PTR *comp); - void vp8_init_config(VP8_PTR onyx, VP8_CONFIG *oxcf); - void vp9_change_config(VP8_PTR onyx, VP8_CONFIG *oxcf); + void vp8_init_config(VP9_PTR onyx, VP8_CONFIG *oxcf); + void vp9_change_config(VP9_PTR onyx, VP8_CONFIG *oxcf); // receive a frames worth of data caller can assume that a copy of this frame is made // and not just a copy of the pointer.. - int vp9_receive_raw_frame(VP8_PTR comp, unsigned int frame_flags, + int vp9_receive_raw_frame(VP9_PTR comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time_stamp); - int vp9_get_compressed_data(VP8_PTR comp, unsigned int *frame_flags, + int vp9_get_compressed_data(VP9_PTR comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, int64_t *time_stamp, int64_t *time_end, int flush); - int vp9_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, + int vp9_get_preview_raw_frame(VP9_PTR comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags); - int vp9_use_as_reference(VP8_PTR comp, int ref_frame_flags); + int vp9_use_as_reference(VP9_PTR comp, int ref_frame_flags); - int vp9_update_reference(VP8_PTR comp, int ref_frame_flags); + int vp9_update_reference(VP9_PTR comp, int ref_frame_flags); - int vp9_get_reference_enc(VP8_PTR comp, VP8_REFFRAME ref_frame_flag, + int vp9_get_reference_enc(VP9_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); - int vp9_set_reference_enc(VP8_PTR comp, VP8_REFFRAME ref_frame_flag, + int vp9_set_reference_enc(VP9_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); - int vp9_update_entropy(VP8_PTR comp, int update); + int vp9_update_entropy(VP9_PTR comp, int update); - int vp9_set_roimap(VP8_PTR comp, unsigned char *map, + int vp9_set_roimap(VP9_PTR comp, unsigned char *map, unsigned int rows, unsigned int cols, int delta_q[4], int delta_lf[4], unsigned int threshold[4]); - int vp9_set_active_map(VP8_PTR comp, unsigned char *map, + int vp9_set_active_map(VP9_PTR comp, unsigned char *map, unsigned int rows, unsigned int cols); - int vp9_set_internal_size(VP8_PTR comp, + int vp9_set_internal_size(VP9_PTR comp, VPX_SCALING horiz_mode, VPX_SCALING vert_mode); - int vp9_get_quantizer(VP8_PTR c); + int vp9_get_quantizer(VP9_PTR c); #ifdef __cplusplus } diff --git a/vp8/common/onyxc_int.h b/vp8/common/onyxc_int.h index 9281c6bb4..342d1e229 100644 --- a/vp8/common/onyxc_int.h +++ b/vp8/common/onyxc_int.h @@ -133,7 +133,7 @@ typedef enum { NB_TXFM_MODES = 4, } TXFM_MODE; -typedef struct VP8_COMMON_RTCD { +typedef struct VP9_COMMON_RTCD { #if CONFIG_RUNTIME_CPU_DETECT vp8_idct_rtcd_vtable_t idct; vp8_subpix_rtcd_vtable_t subpix; @@ -144,9 +144,9 @@ typedef struct VP8_COMMON_RTCD { #else int unused; #endif -} VP8_COMMON_RTCD; +} VP9_COMMON_RTCD; -typedef struct VP8Common { +typedef struct VP9Common { struct vpx_internal_error_info error; DECLARE_ALIGNED(16, short, Y1dequant[QINDEX_RANGE][16]); @@ -294,7 +294,7 @@ typedef struct VP8Common { double framerate; #if CONFIG_RUNTIME_CPU_DETECT - VP8_COMMON_RTCD rtcd; + VP9_COMMON_RTCD rtcd; #endif #if CONFIG_POSTPROC @@ -309,6 +309,6 @@ typedef struct VP8Common { vp8_prob prob_pred_filter_off; #endif -} VP8_COMMON; +} VP9_COMMON; #endif diff --git a/vp8/common/postproc.c b/vp8/common/postproc.c index ea6bd9229..7ea42369e 100644 --- a/vp8/common/postproc.c +++ b/vp8/common/postproc.c @@ -626,7 +626,7 @@ static void constrain_line(int x0, int *x1, int y0, int *y1, int width, int heig #define RTCD_VTABLE(oci) NULL #endif -int vp9_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *ppflags) { +int vp9_post_proc_frame(VP9_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *ppflags) { int q = oci->filter_level * 10 / 6; int flags = ppflags->post_proc_flag; int deblock_level = ppflags->deblocking_level; diff --git a/vp8/common/postproc.h b/vp8/common/postproc.h index 6dd836b28..f34dd116e 100644 --- a/vp8/common/postproc.h +++ b/vp8/common/postproc.h @@ -108,7 +108,7 @@ struct postproc_state { }; #include "onyxc_int.h" #include "ppflags.h" -int vp9_post_proc_frame(struct VP8Common *oci, YV12_BUFFER_CONFIG *dest, +int vp9_post_proc_frame(struct VP9Common *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags); diff --git a/vp8/common/pred_common.c b/vp8/common/pred_common.c index 2fb8c44b1..50b9b1c5d 100644 --- a/vp8/common/pred_common.c +++ b/vp8/common/pred_common.c @@ -15,7 +15,7 @@ // TBD prediction functions for various bitstream signals // Returns a context number for the given MB prediction signal -unsigned char vp9_get_pred_context(const VP8_COMMON *const cm, +unsigned char vp9_get_pred_context(const VP9_COMMON *const cm, const MACROBLOCKD *const xd, PRED_ID pred_id) { int pred_context; @@ -104,7 +104,7 @@ unsigned char vp9_get_pred_context(const VP8_COMMON *const cm, // This function returns a context probability for coding a given // prediction signal -vp8_prob vp9_get_pred_prob(const VP8_COMMON *const cm, +vp8_prob vp9_get_pred_prob(const VP9_COMMON *const cm, const MACROBLOCKD *const xd, PRED_ID pred_id) { vp8_prob pred_probability; @@ -144,7 +144,7 @@ vp8_prob vp9_get_pred_prob(const VP8_COMMON *const cm, // This function returns a context probability ptr for coding a given // prediction signal -const vp8_prob *vp9_get_pred_probs(const VP8_COMMON *const cm, +const vp8_prob *vp9_get_pred_probs(const VP9_COMMON *const cm, const MACROBLOCKD *const xd, PRED_ID pred_id) { const vp8_prob *pred_probability; @@ -280,7 +280,7 @@ void vp9_set_pred_flag(MACROBLOCKD *const xd, // peredict various bitstream signals. // Macroblock segment id prediction function -unsigned char vp9_get_pred_mb_segid(const VP8_COMMON *const cm, +unsigned char vp9_get_pred_mb_segid(const VP9_COMMON *const cm, const MACROBLOCKD *const xd, int MbIndex) { // Currently the prediction for the macroblock segment ID is // the value stored for this macroblock in the previous frame. @@ -305,7 +305,7 @@ unsigned char vp9_get_pred_mb_segid(const VP8_COMMON *const cm, #endif } -MV_REFERENCE_FRAME vp9_get_pred_ref(const VP8_COMMON *const cm, +MV_REFERENCE_FRAME vp9_get_pred_ref(const VP9_COMMON *const cm, const MACROBLOCKD *const xd) { MODE_INFO *m = xd->mode_info_context; @@ -407,7 +407,7 @@ void vp9_calc_ref_probs(int *count, vp8_prob *probs) { // Values willbe set to 0 for reference frame options that are not possible // because wither they were predicted and prediction has failed or because // they are not allowed for a given segment. -void vp9_compute_mod_refprobs(VP8_COMMON *const cm) { +void vp9_compute_mod_refprobs(VP9_COMMON *const cm) { int norm_cnt[MAX_REF_FRAMES]; int intra_count; int inter_count; diff --git a/vp8/common/pred_common.h b/vp8/common/pred_common.h index fa591defb..7dd517f77 100644 --- a/vp8/common/pred_common.h +++ b/vp8/common/pred_common.h @@ -25,15 +25,15 @@ typedef enum { PRED_SWITCHABLE_INTERP = 4 } PRED_ID; -extern unsigned char vp9_get_pred_context(const VP8_COMMON *const cm, +extern unsigned char vp9_get_pred_context(const VP9_COMMON *const cm, const MACROBLOCKD *const xd, PRED_ID pred_id); -extern vp8_prob vp9_get_pred_prob(const VP8_COMMON *const cm, +extern vp8_prob vp9_get_pred_prob(const VP9_COMMON *const cm, const MACROBLOCKD *const xd, PRED_ID pred_id); -extern const vp8_prob *vp9_get_pred_probs(const VP8_COMMON *const cm, +extern const vp8_prob *vp9_get_pred_probs(const VP9_COMMON *const cm, const MACROBLOCKD *const xd, PRED_ID pred_id); @@ -45,12 +45,12 @@ extern void vp9_set_pred_flag(MACROBLOCKD *const xd, unsigned char pred_flag); -extern unsigned char vp9_get_pred_mb_segid(const VP8_COMMON *const cm, +extern unsigned char vp9_get_pred_mb_segid(const VP9_COMMON *const cm, const MACROBLOCKD *const xd, int MbIndex); -extern MV_REFERENCE_FRAME vp9_get_pred_ref(const VP8_COMMON *const cm, +extern MV_REFERENCE_FRAME vp9_get_pred_ref(const VP9_COMMON *const cm, const MACROBLOCKD *const xd); -extern void vp9_compute_mod_refprobs(VP8_COMMON *const cm); +extern void vp9_compute_mod_refprobs(VP9_COMMON *const cm); #endif /* __INC_PRED_COMMON_H__ */ diff --git a/vp8/common/reconinter.c b/vp8/common/reconinter.c index 70dedc9df..8892113a4 100644 --- a/vp8/common/reconinter.c +++ b/vp8/common/reconinter.c @@ -20,7 +20,7 @@ void vp9_setup_interp_filters(MACROBLOCKD *xd, INTERPOLATIONFILTERTYPE mcomp_filter_type, - VP8_COMMON *cm) { + VP9_COMMON *cm) { if (mcomp_filter_type == SIXTAP) { xd->subpixel_predict = SUBPIX_INVOKE( &cm->rtcd.subpix, sixtap4x4); diff --git a/vp8/common/reconinter.h b/vp8/common/reconinter.h index 0a3767420..001bdd457 100644 --- a/vp8/common/reconinter.h +++ b/vp8/common/reconinter.h @@ -67,6 +67,6 @@ extern void vp9_build_2nd_inter_predictors4b(MACROBLOCKD *xd, extern void vp9_build_inter4x4_predictors_mbuv(MACROBLOCKD *xd); extern void vp9_setup_interp_filters(MACROBLOCKD *xd, INTERPOLATIONFILTERTYPE filter, - VP8_COMMON *cm); + VP9_COMMON *cm); #endif diff --git a/vp8/common/systemdependent.h b/vp8/common/systemdependent.h index 09fc1e4a8..436f56d5d 100644 --- a/vp8/common/systemdependent.h +++ b/vp8/common/systemdependent.h @@ -17,5 +17,5 @@ void vpx_reset_mmx_state(void); #define vp8_clear_system_state() #endif -struct VP8Common; -void vp9_machine_specific_config(struct VP8Common *); +struct VP9Common; +void vp9_machine_specific_config(struct VP9Common *); diff --git a/vp8/common/x86/x86_systemdependent.c b/vp8/common/x86/x86_systemdependent.c index d82aa236c..bf6456323 100644 --- a/vp8/common/x86/x86_systemdependent.c +++ b/vp8/common/x86/x86_systemdependent.c @@ -18,9 +18,9 @@ #include "vp8/common/pragmas.h" #include "vp8/common/onyxc_int.h" -void vp9_arch_x86_common_init(VP8_COMMON *ctx) { +void vp9_arch_x86_common_init(VP9_COMMON *ctx) { #if CONFIG_RUNTIME_CPU_DETECT - VP8_COMMON_RTCD *rtcd = &ctx->rtcd; + VP9_COMMON_RTCD *rtcd = &ctx->rtcd; int flags = x86_simd_caps(); /* Note: diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c index b2c51f5f6..afe2a24f7 100644 --- a/vp8/decoder/decodemv.c +++ b/vp8/decoder/decodemv.c @@ -90,12 +90,12 @@ int vp8_read_mv_ref_id(vp8_reader *r, #endif extern const int vp9_i8x8_block[4]; -static void kfread_modes(VP8D_COMP *pbi, +static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m, int mb_row, int mb_col, BOOL_DECODER* const bc) { - VP8_COMMON *const cm = &pbi->common; + VP9_COMMON *const cm = &pbi->common; const int mis = pbi->common.mode_info_stride; int map_index = mb_row * pbi->common.mb_cols + mb_col; MB_PREDICTION_MODE y_mode; @@ -353,14 +353,14 @@ static void read_nmvprobs(vp8_reader *bc, nmv_context *mvctx, } // Read the referncence frame -static MV_REFERENCE_FRAME read_ref_frame(VP8D_COMP *pbi, +static MV_REFERENCE_FRAME read_ref_frame(VP9D_COMP *pbi, vp8_reader *const bc, unsigned char segment_id) { MV_REFERENCE_FRAME ref_frame; int seg_ref_active; int seg_ref_count = 0; - VP8_COMMON *const cm = &pbi->common; + VP9_COMMON *const cm = &pbi->common; MACROBLOCKD *const xd = &pbi->mb; seg_ref_active = vp9_segfeature_active(xd, @@ -498,9 +498,9 @@ static const unsigned char mbsplit_fill_offset[4][16] = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} }; -static void read_switchable_interp_probs(VP8D_COMP* const pbi, +static void read_switchable_interp_probs(VP9D_COMP* const pbi, BOOL_DECODER* const bc) { - VP8_COMMON *const cm = &pbi->common; + VP9_COMMON *const cm = &pbi->common; int i, j; for (j = 0; j <= VP8_SWITCHABLE_FILTERS; ++j) { for (i = 0; i < VP8_SWITCHABLE_FILTERS - 1; ++i) { @@ -511,8 +511,8 @@ static void read_switchable_interp_probs(VP8D_COMP* const pbi, //cm->fc.switchable_interp_prob[1]); } -static void mb_mode_mv_init(VP8D_COMP *pbi, vp8_reader *bc) { - VP8_COMMON *const cm = &pbi->common; +static void mb_mode_mv_init(VP9D_COMP *pbi, vp8_reader *bc) { + VP9_COMMON *const cm = &pbi->common; nmv_context *const nmvc = &pbi->common.fc.nmvc; MACROBLOCKD *const xd = &pbi->mb; @@ -566,10 +566,10 @@ static void mb_mode_mv_init(VP8D_COMP *pbi, vp8_reader *bc) { // This function either reads the segment id for the current macroblock from // the bitstream or if the value is temporally predicted asserts the predicted // value -static void read_mb_segment_id(VP8D_COMP *pbi, +static void read_mb_segment_id(VP9D_COMP *pbi, int mb_row, int mb_col, BOOL_DECODER* const bc) { - VP8_COMMON *const cm = &pbi->common; + VP9_COMMON *const cm = &pbi->common; MACROBLOCKD *const xd = &pbi->mb; MODE_INFO *mi = xd->mode_info_context; MB_MODE_INFO *mbmi = &mi->mbmi; @@ -647,11 +647,11 @@ static void read_mb_segment_id(VP8D_COMP *pbi, } } -static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, +static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, MODE_INFO *prev_mi, int mb_row, int mb_col, BOOL_DECODER* const bc) { - VP8_COMMON *const cm = &pbi->common; + VP9_COMMON *const cm = &pbi->common; nmv_context *const nmvc = &pbi->common.fc.nmvc; const int mis = pbi->common.mode_info_stride; MACROBLOCKD *const xd = &pbi->mb; @@ -1174,8 +1174,8 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, } } -void vp9_decode_mode_mvs_init(VP8D_COMP *pbi, BOOL_DECODER* const bc) { - VP8_COMMON *cm = &pbi->common; +void vp9_decode_mode_mvs_init(VP9D_COMP *pbi, BOOL_DECODER* const bc) { + VP9_COMMON *cm = &pbi->common; vpx_memset(cm->mbskip_pred_probs, 0, sizeof(cm->mbskip_pred_probs)); if (pbi->common.mb_no_coeff_skip) { @@ -1186,7 +1186,7 @@ void vp9_decode_mode_mvs_init(VP8D_COMP *pbi, BOOL_DECODER* const bc) { mb_mode_mv_init(pbi, bc); } -void vp9_decode_mb_mode_mv(VP8D_COMP *pbi, +void vp9_decode_mb_mode_mv(VP9D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col, diff --git a/vp8/decoder/decodemv.h b/vp8/decoder/decodemv.h index 83c158dcb..8b0406f6d 100644 --- a/vp8/decoder/decodemv.h +++ b/vp8/decoder/decodemv.h @@ -11,9 +11,9 @@ #include "onyxd_int.h" -void vp9_decode_mb_mode_mv(VP8D_COMP* const pbi, +void vp9_decode_mb_mode_mv(VP9D_COMP* const pbi, MACROBLOCKD* const xd, int mb_row, int mb_col, BOOL_DECODER* const bc); -void vp9_decode_mode_mvs_init(VP8D_COMP* const pbi, BOOL_DECODER* const bc); +void vp9_decode_mode_mvs_init(VP9D_COMP* const pbi, BOOL_DECODER* const bc); diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c index 504ac6424..7e7334c6c 100644 --- a/vp8/decoder/decodframe.c +++ b/vp8/decoder/decodframe.c @@ -72,10 +72,10 @@ static vp8_prob read_prob_diff_update(vp8_reader *const bc, int oldp) { return (vp8_prob)inv_remap_prob(delp, oldp); } -void vp9_init_de_quantizer(VP8D_COMP *pbi) { +void vp9_init_de_quantizer(VP9D_COMP *pbi) { int i; int Q; - VP8_COMMON *const pc = &pbi->common; + VP9_COMMON *const pc = &pbi->common; for (Q = 0; Q < QINDEX_RANGE; Q++) { pc->Y1dequant[Q][0] = (short)vp9_dc_quant(Q, pc->y1dc_delta_q); @@ -93,10 +93,10 @@ void vp9_init_de_quantizer(VP8D_COMP *pbi) { } } -static void mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd) { +static void mb_init_dequantizer(VP9D_COMP *pbi, MACROBLOCKD *xd) { int i; int QIndex; - VP8_COMMON *const pc = &pbi->common; + VP9_COMMON *const pc = &pbi->common; int segment_id = xd->mode_info_context->mbmi.segment_id; // Set the Q baseline allowing for any segment level adjustment @@ -169,7 +169,7 @@ static void mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd) { /* skip_recon_mb() is Modified: Instead of writing the result to predictor buffer and then copying it * to dst buffer, we can write the result directly to dst buffer. This eliminates unnecessary copy. */ -static void skip_recon_mb(VP8D_COMP *pbi, MACROBLOCKD *xd) { +static void skip_recon_mb(VP9D_COMP *pbi, MACROBLOCKD *xd) { if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) { #if CONFIG_SUPERBLOCKS if (xd->mode_info_context->mbmi.encoded_as_sb) { @@ -205,7 +205,7 @@ static void skip_recon_mb(VP8D_COMP *pbi, MACROBLOCKD *xd) { } } -static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, +static void decode_macroblock(VP9D_COMP *pbi, MACROBLOCKD *xd, int mb_row, unsigned int mb_col, BOOL_DECODER* const bc) { int eobtotal = 0; @@ -213,7 +213,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, int i; int tx_size; TX_TYPE tx_type; - VP8_COMMON *pc = &pbi->common; + VP9_COMMON *pc = &pbi->common; #if CONFIG_SUPERBLOCKS int orig_skip_flag = xd->mode_info_context->mbmi.mb_skip_coeff; #endif @@ -535,7 +535,7 @@ FILE *vpxlog = 0; /* Decode a row of Superblocks (2x2 region of MBs) */ static void -decode_sb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mbrow, MACROBLOCKD *xd, +decode_sb_row(VP9D_COMP *pbi, VP9_COMMON *pc, int mbrow, MACROBLOCKD *xd, BOOL_DECODER* const bc) { int i; int sb_col; @@ -704,10 +704,10 @@ static int read_is_valid(const unsigned char *start, } -static void setup_token_decoder(VP8D_COMP *pbi, +static void setup_token_decoder(VP9D_COMP *pbi, const unsigned char *cx_data, BOOL_DECODER* const bool_decoder) { - VP8_COMMON *pc = &pbi->common; + VP9_COMMON *pc = &pbi->common; const unsigned char *user_data_end = pbi->Source + pbi->source_sz; const unsigned char *partition; @@ -734,8 +734,8 @@ static void setup_token_decoder(VP8D_COMP *pbi, "Failed to allocate bool decoder %d", 1); } -static void init_frame(VP8D_COMP *pbi) { - VP8_COMMON *const pc = &pbi->common; +static void init_frame(VP9D_COMP *pbi) { + VP9_COMMON *const pc = &pbi->common; MACROBLOCKD *const xd = &pbi->mb; if (pc->frame_type == KEY_FRAME) { @@ -810,11 +810,11 @@ static void init_frame(VP8D_COMP *pbi) { } #if 0 -static void read_coef_probs2(VP8D_COMP *pbi) { +static void read_coef_probs2(VP9D_COMP *pbi) { const vp8_prob grpupd = 192; int i, j, k, l; vp8_reader *const bc = &pbi->bc; - VP8_COMMON *const pc = &pbi->common; + VP9_COMMON *const pc = &pbi->common; for (l = 0; l < ENTROPY_NODES; l++) { if (vp8_read(bc, grpupd)) { // printf("Decoding %d\n", l); @@ -881,8 +881,8 @@ static void read_coef_probs_common( } } -static void read_coef_probs(VP8D_COMP *pbi, BOOL_DECODER* const bc) { - VP8_COMMON *const pc = &pbi->common; +static void read_coef_probs(VP9D_COMP *pbi, BOOL_DECODER* const bc) { + VP9_COMMON *const pc = &pbi->common; read_coef_probs_common(bc, pc->fc.coef_probs); read_coef_probs_common(bc, pc->fc.hybrid_coef_probs); @@ -897,9 +897,9 @@ static void read_coef_probs(VP8D_COMP *pbi, BOOL_DECODER* const bc) { } } -int vp9_decode_frame(VP8D_COMP *pbi) { +int vp9_decode_frame(VP9D_COMP *pbi) { BOOL_DECODER header_bc, residual_bc; - VP8_COMMON *const pc = &pbi->common; + VP9_COMMON *const pc = &pbi->common; MACROBLOCKD *const xd = &pbi->mb; const unsigned char *data = (const unsigned char *)pbi->Source; const unsigned char *data_end = data + pbi->source_sz; diff --git a/vp8/decoder/detokenize.c b/vp8/decoder/detokenize.c index 37dfa6a57..19534f8dc 100644 --- a/vp8/decoder/detokenize.c +++ b/vp8/decoder/detokenize.c @@ -287,7 +287,7 @@ static int vp8_get_signed(BOOL_DECODER *br, int value_to_sign) { val += (UINT16)(1 << bits_count);\ } while (0); -static int decode_coefs(VP8D_COMP *dx, const MACROBLOCKD *xd, +static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd, BOOL_DECODER* const br, ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l, PLANE_TYPE type, @@ -414,7 +414,7 @@ SKIP_START: return c; } -int vp9_decode_mb_tokens_16x16(VP8D_COMP *pbi, MACROBLOCKD *xd, +int vp9_decode_mb_tokens_16x16(VP9D_COMP *pbi, MACROBLOCKD *xd, BOOL_DECODER* const bc) { ENTROPY_CONTEXT* const A = (ENTROPY_CONTEXT *)xd->above_context; ENTROPY_CONTEXT* const L = (ENTROPY_CONTEXT *)xd->left_context; @@ -477,7 +477,7 @@ int vp9_decode_mb_tokens_16x16(VP8D_COMP *pbi, MACROBLOCKD *xd, return eobtotal; } -int vp9_decode_mb_tokens_8x8(VP8D_COMP *pbi, MACROBLOCKD *xd, +int vp9_decode_mb_tokens_8x8(VP9D_COMP *pbi, MACROBLOCKD *xd, BOOL_DECODER* const bc) { ENTROPY_CONTEXT *const A = (ENTROPY_CONTEXT *)xd->above_context; ENTROPY_CONTEXT *const L = (ENTROPY_CONTEXT *)xd->left_context; @@ -571,7 +571,7 @@ int vp9_decode_mb_tokens_8x8(VP8D_COMP *pbi, MACROBLOCKD *xd, } -int vp9_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *xd, +int vp9_decode_mb_tokens(VP9D_COMP *dx, MACROBLOCKD *xd, BOOL_DECODER* const bc) { ENTROPY_CONTEXT *const A = (ENTROPY_CONTEXT *)xd->above_context; ENTROPY_CONTEXT *const L = (ENTROPY_CONTEXT *)xd->left_context; diff --git a/vp8/decoder/detokenize.h b/vp8/decoder/detokenize.h index 7fb60e6f0..aa36402c1 100644 --- a/vp8/decoder/detokenize.h +++ b/vp8/decoder/detokenize.h @@ -15,11 +15,11 @@ #include "onyxd_int.h" void vp9_reset_mb_tokens_context(MACROBLOCKD* const); -int vp9_decode_mb_tokens(VP8D_COMP* const, MACROBLOCKD* const, +int vp9_decode_mb_tokens(VP9D_COMP* const, MACROBLOCKD* const, BOOL_DECODER* const); -int vp9_decode_mb_tokens_8x8(VP8D_COMP* const, MACROBLOCKD* const, +int vp9_decode_mb_tokens_8x8(VP9D_COMP* const, MACROBLOCKD* const, BOOL_DECODER* const); -int vp9_decode_mb_tokens_16x16(VP8D_COMP* const, MACROBLOCKD* const, +int vp9_decode_mb_tokens_16x16(VP9D_COMP* const, MACROBLOCKD* const, BOOL_DECODER* const); #endif /* DETOKENIZE_H */ diff --git a/vp8/decoder/onyxd_if.c b/vp8/decoder/onyxd_if.c index 8f6feb42c..c2a5e488b 100644 --- a/vp8/decoder/onyxd_if.c +++ b/vp8/decoder/onyxd_if.c @@ -33,9 +33,9 @@ #include "vpx_ports/arm.h" #endif -extern void vp8_init_loop_filter(VP8_COMMON *cm); -extern void vp9_init_de_quantizer(VP8D_COMP *pbi); -static int get_free_fb(VP8_COMMON *cm); +extern void vp8_init_loop_filter(VP9_COMMON *cm); +extern void vp9_init_de_quantizer(VP9D_COMP *pbi); +static int get_free_fb(VP9_COMMON *cm); static void ref_cnt_fb(int *buf, int *idx, int new_idx); #if CONFIG_DEBUG @@ -116,12 +116,12 @@ void vp9_initialize_dec(void) { } VP8D_PTR vp9_create_decompressor(VP8D_CONFIG *oxcf) { - VP8D_COMP *pbi = vpx_memalign(32, sizeof(VP8D_COMP)); + VP9D_COMP *pbi = vpx_memalign(32, sizeof(VP9D_COMP)); if (!pbi) return NULL; - vpx_memset(pbi, 0, sizeof(VP8D_COMP)); + vpx_memset(pbi, 0, sizeof(VP9D_COMP)); if (setjmp(pbi->common.error.jmp)) { pbi->common.error.setjmp = 0; @@ -153,7 +153,7 @@ VP8D_PTR vp9_create_decompressor(VP8D_CONFIG *oxcf) { } void vp9_remove_decompressor(VP8D_PTR ptr) { - VP8D_COMP *pbi = (VP8D_COMP *) ptr; + VP9D_COMP *pbi = (VP9D_COMP *) ptr; if (!pbi) return; @@ -170,8 +170,8 @@ void vp9_remove_decompressor(VP8D_PTR ptr) { vpx_codec_err_t vp9_get_reference_dec(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd) { - VP8D_COMP *pbi = (VP8D_COMP *) ptr; - VP8_COMMON *cm = &pbi->common; + VP9D_COMP *pbi = (VP9D_COMP *) ptr; + VP9_COMMON *cm = &pbi->common; int ref_fb_idx; if (ref_frame_flag == VP8_LAST_FLAG) @@ -201,8 +201,8 @@ vpx_codec_err_t vp9_get_reference_dec(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, vpx_codec_err_t vp9_set_reference_dec(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd) { - VP8D_COMP *pbi = (VP8D_COMP *) ptr; - VP8_COMMON *cm = &pbi->common; + VP9D_COMP *pbi = (VP9D_COMP *) ptr; + VP9_COMMON *cm = &pbi->common; int *ref_fb_ptr = NULL; int free_fb; @@ -245,7 +245,7 @@ extern void vp8_push_neon(int64_t *store); extern void vp8_pop_neon(int64_t *store); #endif -static int get_free_fb(VP8_COMMON *cm) { +static int get_free_fb(VP9_COMMON *cm) { int i; for (i = 0; i < NUM_YV12_BUFFERS; i++) if (cm->fb_idx_ref_cnt[i] == 0) @@ -266,7 +266,7 @@ static void ref_cnt_fb(int *buf, int *idx, int new_idx) { } /* If any buffer copy / swapping is signalled it should be done here. */ -static int swap_frame_buffers(VP8_COMMON *cm) { +static int swap_frame_buffers(VP9_COMMON *cm) { int err = 0; /* The alternate reference frame or golden frame can be updated @@ -319,7 +319,7 @@ static int swap_frame_buffers(VP8_COMMON *cm) { } /* -static void vp8_print_yuv_rec_mb(VP8_COMMON *cm, int mb_row, int mb_col) +static void vp8_print_yuv_rec_mb(VP9_COMMON *cm, int mb_row, int mb_col) { YV12_BUFFER_CONFIG *s = cm->frame_to_show; unsigned char *src = s->y_buffer; @@ -340,8 +340,8 @@ int vp9_receive_compressed_data(VP8D_PTR ptr, unsigned long size, #if HAVE_ARMV7 int64_t dx_store_reg[8]; #endif - VP8D_COMP *pbi = (VP8D_COMP *) ptr; - VP8_COMMON *cm = &pbi->common; + VP9D_COMP *pbi = (VP9D_COMP *) ptr; + VP9_COMMON *cm = &pbi->common; int retcode = 0; /*if(pbi->ready_for_new_data == 0) @@ -490,7 +490,7 @@ int vp9_get_raw_frame(VP8D_PTR ptr, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags) { int ret = -1; - VP8D_COMP *pbi = (VP8D_COMP *) ptr; + VP9D_COMP *pbi = (VP9D_COMP *) ptr; if (pbi->ready_for_new_data == 1) return ret; diff --git a/vp8/decoder/onyxd_int.h b/vp8/decoder/onyxd_int.h index 437c1926e..de5f7057a 100644 --- a/vp8/decoder/onyxd_int.h +++ b/vp8/decoder/onyxd_int.h @@ -54,10 +54,10 @@ typedef struct { } DETOK; -typedef struct VP8Decompressor { +typedef struct VP9Decompressor { DECLARE_ALIGNED(16, MACROBLOCKD, mb); - DECLARE_ALIGNED(16, VP8_COMMON, common); + DECLARE_ALIGNED(16, VP9_COMMON, common); VP8D_CONFIG oxcf; @@ -81,9 +81,9 @@ typedef struct VP8Decompressor { int decoded_key_frame; -} VP8D_COMP; +} VP9D_COMP; -int vp9_decode_frame(VP8D_COMP *cpi); +int vp9_decode_frame(VP9D_COMP *cpi); #if CONFIG_DEBUG diff --git a/vp8/decoder/reconintra_mt.c b/vp8/decoder/reconintra_mt.c index 6fffeeed5..23c8f453e 100644 --- a/vp8/decoder/reconintra_mt.c +++ b/vp8/decoder/reconintra_mt.c @@ -18,7 +18,7 @@ * and vp9_build_intra_predictors_mbuv_s(MACROBLOCKD *xd). */ -void vp8mt_build_intra_predictors_mby(VP8D_COMP *pbi, MACROBLOCKD *xd, +void vp8mt_build_intra_predictors_mby(VP9D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col) { unsigned char *yabove_row; /* = xd->dst.y_buffer - xd->dst.y_stride; */ unsigned char *yleft_col; @@ -128,7 +128,7 @@ void vp8mt_build_intra_predictors_mby(VP8D_COMP *pbi, MACROBLOCKD *xd, } } -void vp8mt_build_intra_predictors_mby_s(VP8D_COMP *pbi, MACROBLOCKD *xd, +void vp8mt_build_intra_predictors_mby_s(VP9D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col) { unsigned char *yabove_row; /* = xd->dst.y_buffer - xd->dst.y_stride; */ unsigned char *yleft_col; @@ -245,7 +245,7 @@ void vp8mt_build_intra_predictors_mby_s(VP8D_COMP *pbi, MACROBLOCKD *xd, } } -void vp8mt_build_intra_predictors_mbuv(VP8D_COMP *pbi, MACROBLOCKD *xd, +void vp8mt_build_intra_predictors_mbuv(VP9D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col) { unsigned char *uabove_row; /* = xd->dst.u_buffer - xd->dst.uv_stride; */ unsigned char *uleft_col; /*[16];*/ @@ -382,7 +382,7 @@ void vp8mt_build_intra_predictors_mbuv(VP8D_COMP *pbi, MACROBLOCKD *xd, } } -void vp8mt_build_intra_predictors_mbuv_s(VP8D_COMP *pbi, MACROBLOCKD *xd, +void vp8mt_build_intra_predictors_mbuv_s(VP9D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col) { unsigned char *uabove_row; /* = xd->dst.u_buffer - xd->dst.uv_stride; */ unsigned char *uleft_col; /*[16];*/ @@ -525,7 +525,7 @@ void vp8mt_build_intra_predictors_mbuv_s(VP8D_COMP *pbi, MACROBLOCKD *xd, } -void vp8mt_predict_intra4x4(VP8D_COMP *pbi, +void vp8mt_predict_intra4x4(VP9D_COMP *pbi, MACROBLOCKD *xd, int b_mode, unsigned char *predictor, @@ -811,7 +811,7 @@ void vp8mt_predict_intra4x4(VP8D_COMP *pbi, /* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and * to the right prediction have filled in pixels to use. */ -void vp8mt_intra_prediction_down_copy(VP8D_COMP *pbi, MACROBLOCKD *xd, +void vp8mt_intra_prediction_down_copy(VP9D_COMP *pbi, MACROBLOCKD *xd, int mb_row, int mb_col) { unsigned char *above_right; // = *(xd->block[0].base_dst) + // xd->block[0].dst - diff --git a/vp8/encoder/arm/arm_csystemdependent.c b/vp8/encoder/arm/arm_csystemdependent.c index 2efeafb99..1d73768dd 100644 --- a/vp8/encoder/arm/arm_csystemdependent.c +++ b/vp8/encoder/arm/arm_csystemdependent.c @@ -18,7 +18,7 @@ extern void (*vp9_yv12_copy_partial_frame_ptr)(YV12_BUFFER_CONFIG *src_ybc, YV12 extern void vp9_yv12_copy_partial_frame(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc, int Fraction); extern void vpxyv12_copy_partial_frame_neon(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc, int Fraction); -void vp8_arch_arm_encoder_init(VP8_COMP *cpi) { +void vp8_arch_arm_encoder_init(VP9_COMP *cpi) { #if CONFIG_RUNTIME_CPU_DETECT int flags = cpi->common.rtcd.flags; diff --git a/vp8/encoder/asm_enc_offsets.c b/vp8/encoder/asm_enc_offsets.c index 9749f05b4..754337117 100644 --- a/vp8/encoder/asm_enc_offsets.c +++ b/vp8/encoder/asm_enc_offsets.c @@ -66,14 +66,14 @@ DEFINE(vp9_extra_bit_struct_prob, offsetof(vp8_extra_bit_struct, p DEFINE(vp9_extra_bit_struct_len, offsetof(vp8_extra_bit_struct, Len)); DEFINE(vp9_extra_bit_struct_base_val, offsetof(vp8_extra_bit_struct, base_val)); -DEFINE(vp9_comp_tplist, offsetof(VP8_COMP, tplist)); -DEFINE(vp9_comp_common, offsetof(VP8_COMP, common)); +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(VP8_COMMON, mb_rows)); +DEFINE(vp9_common_mb_rows, offsetof(VP9_COMMON, mb_rows)); END diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c index c50c59f2a..598fc85aa 100644 --- a/vp8/encoder/bitstream.c +++ b/vp8/encoder/bitstream.c @@ -155,9 +155,9 @@ static void update_mode( vp8_write_bit(bc, 0); } -static void update_mbintra_mode_probs(VP8_COMP* const cpi, +static void update_mbintra_mode_probs(VP9_COMP* const cpi, vp8_writer* const bc) { - VP8_COMMON *const cm = &cpi->common; + VP9_COMMON *const cm = &cpi->common; { vp8_prob Pnew [VP8_YMODES - 1]; @@ -186,8 +186,8 @@ static int get_binary_prob(int n0, int n1) { return get_prob(n0, n0 + n1); } -void vp9_update_skip_probs(VP8_COMP *cpi) { - VP8_COMMON *const pc = &cpi->common; +void vp9_update_skip_probs(VP9_COMP *cpi) { + VP9_COMMON *const pc = &cpi->common; int prob_skip_false[3] = {0, 0, 0}; int k; @@ -197,9 +197,9 @@ void vp9_update_skip_probs(VP8_COMP *cpi) { } } -static void update_switchable_interp_probs(VP8_COMP *cpi, +static void update_switchable_interp_probs(VP9_COMP *cpi, vp8_writer* const bc) { - VP8_COMMON *const pc = &cpi->common; + VP9_COMMON *const pc = &cpi->common; unsigned int branch_ct[32][2]; int i, j; for (j = 0; j <= VP8_SWITCHABLE_FILTERS; ++j) { @@ -217,8 +217,8 @@ static void update_switchable_interp_probs(VP8_COMP *cpi, } // This function updates the reference frame prediction stats -static void update_refpred_stats(VP8_COMP *cpi) { - VP8_COMMON *const cm = &cpi->common; +static void update_refpred_stats(VP9_COMP *cpi) { + VP9_COMMON *const cm = &cpi->common; int i; int tot_count; vp8_prob new_pred_probs[PREDICTION_PROBS]; @@ -260,7 +260,7 @@ static void update_refpred_stats(VP8_COMP *cpi) { } } -static void update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, +static void update_mvcount(VP9_COMP *cpi, MACROBLOCK *x, int_mv *best_ref_mv, int_mv *second_best_ref_mv) { MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi; MV mv; @@ -789,7 +789,7 @@ static void write_mb_segid(vp8_writer *bc, // This function encodes the reference frame static void encode_ref_frame(vp8_writer *const bc, - VP8_COMMON *const cm, + VP9_COMMON *const cm, MACROBLOCKD *xd, int segment_id, MV_REFERENCE_FRAME rf) { @@ -870,8 +870,8 @@ static void encode_ref_frame(vp8_writer *const bc, } // Update the probabilities used to encode reference frame data -static void update_ref_probs(VP8_COMP *const cpi) { - VP8_COMMON *const cm = &cpi->common; +static void update_ref_probs(VP9_COMP *const cpi) { + VP9_COMMON *const cm = &cpi->common; const int *const rfct = cpi->count_mb_ref_frame_usage; const int rf_intra = rfct[INTRA_FRAME]; @@ -887,9 +887,9 @@ static void update_ref_probs(VP8_COMP *const cpi) { vp9_compute_mod_refprobs(cm); } -static void pack_inter_mode_mvs(VP8_COMP *const cpi, vp8_writer *const bc) { +static void pack_inter_mode_mvs(VP9_COMP *const cpi, vp8_writer *const bc) { int i; - VP8_COMMON *const pc = &cpi->common; + VP9_COMMON *const pc = &cpi->common; const nmv_context *nmvc = &pc->fc.nmvc; MACROBLOCK *x = &cpi->mb; MACROBLOCKD *xd = &cpi->mb.e_mbd; @@ -1316,7 +1316,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi, vp8_writer *const bc) { } -static void write_mb_modes_kf(const VP8_COMMON *c, +static void write_mb_modes_kf(const VP9_COMMON *c, const MACROBLOCKD *xd, const MODE_INFO *m, int mode_info_stride, @@ -1420,8 +1420,8 @@ static void write_mb_modes_kf(const VP8_COMMON *c, } } -static void write_kfmodes(VP8_COMP* const cpi, vp8_writer* const bc) { - VP8_COMMON *const c = &cpi->common; +static void write_kfmodes(VP9_COMP* const cpi, vp8_writer* const bc) { + VP9_COMMON *const c = &cpi->common; const int mis = c->mode_info_stride; MACROBLOCKD *xd = &cpi->mb.e_mbd; MODE_INFO *m; @@ -1513,7 +1513,7 @@ static void print_prob_tree(vp8_prob fclose(f); } -static void build_coeff_contexts(VP8_COMP *cpi) { +static void build_coeff_contexts(VP9_COMP *cpi) { int i = 0, j, k; #ifdef ENTROPY_STATS int t = 0; @@ -1753,7 +1753,7 @@ static void update_coef_probs_common( } } -static void update_coef_probs(VP8_COMP* const cpi, vp8_writer* const bc) { +static void update_coef_probs(VP9_COMP* const cpi, vp8_writer* const bc) { vp8_clear_system_state(); // Build the cofficient contexts based on counts collected in encode loop @@ -1811,7 +1811,7 @@ static void put_delta_q(vp8_writer *bc, int delta_q) { vp8_write_bit(bc, 0); } -static void decide_kf_ymode_entropy(VP8_COMP *cpi) { +static void decide_kf_ymode_entropy(VP9_COMP *cpi) { int mode_cost[MB_MODE_COUNT]; int cost; @@ -1840,8 +1840,8 @@ static void decide_kf_ymode_entropy(VP8_COMP *cpi) { cpi->common.kf_ymode_probs_index = bestindex; } -static void segment_reference_frames(VP8_COMP *cpi) { - VP8_COMMON *oci = &cpi->common; +static void segment_reference_frames(VP9_COMP *cpi) { + VP9_COMMON *oci = &cpi->common; MODE_INFO *mi = oci->mi; int ref[MAX_MB_SEGMENTS] = {0}; int i, j; @@ -1860,11 +1860,11 @@ static void segment_reference_frames(VP8_COMP *cpi) { } } -void vp9_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, +void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest, unsigned long *size) { int i, j; VP8_HEADER oh; - VP8_COMMON *const pc = &cpi->common; + VP9_COMMON *const pc = &cpi->common; vp8_writer header_bc, residual_bc; MACROBLOCKD *const xd = &cpi->mb.e_mbd; int extra_bytes_packed = 0; diff --git a/vp8/encoder/bitstream.h b/vp8/encoder/bitstream.h index 87f0aa80b..a0ac8b5db 100644 --- a/vp8/encoder/bitstream.h +++ b/vp8/encoder/bitstream.h @@ -12,6 +12,6 @@ #ifndef __INC_BITSTREAM_H #define __INC_BITSTREAM_H -void vp9_update_skip_probs(VP8_COMP *cpi); +void vp9_update_skip_probs(VP9_COMP *cpi); #endif diff --git a/vp8/encoder/encodeframe.c b/vp8/encoder/encodeframe.c index f53d55a91..5eae1f1f4 100644 --- a/vp8/encoder/encodeframe.c +++ b/vp8/encoder/encodeframe.c @@ -54,15 +54,15 @@ int enc_debug = 0; int mb_row_debug, mb_col_debug; #endif -extern void vp9_initialize_me_consts(VP8_COMP *cpi, int QIndex); +extern void vp9_initialize_me_consts(VP9_COMP *cpi, int QIndex); -extern void vp9_auto_select_speed(VP8_COMP *cpi); +extern void vp9_auto_select_speed(VP9_COMP *cpi); -int64_t vp9_rd_pick_inter_mode_sb(VP8_COMP *cpi, MACROBLOCK *x, +int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset, int *returnrate, int *returndistortion); -extern void vp9_pick_mode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x, +extern void vp9_pick_mode_inter_macroblock(VP9_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset, int *r, int *d); @@ -70,21 +70,21 @@ void vp9_build_block_offsets(MACROBLOCK *x); void vp9_setup_block_ptrs(MACROBLOCK *x); -void vp9_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, +void vp9_encode_inter_macroblock(VP9_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, int recon_yoffset, int recon_uvoffset, int output_enabled); -void vp9_encode_inter_superblock(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, +void vp9_encode_inter_superblock(VP9_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, int recon_yoffset, int recon_uvoffset, int mb_col, int mb_row); -void vp9_encode_intra_macro_block(VP8_COMP *cpi, MACROBLOCK *x, +void vp9_encode_intra_macro_block(VP9_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, int output_enabled); -void vp9_encode_intra_super_block(VP8_COMP *cpi, MACROBLOCK *x, +void vp9_encode_intra_super_block(VP9_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, int mb_col); -static void adjust_act_zbin(VP8_COMP *cpi, MACROBLOCK *x); +static void adjust_act_zbin(VP9_COMP *cpi, MACROBLOCK *x); #ifdef MODE_STATS unsigned int inter_y_modes[MB_MODE_COUNT]; @@ -116,7 +116,7 @@ static const unsigned char VP8_VAR_OFFS[16] = { // Original activity measure from Tim T's code. -static unsigned int tt_activity_measure(VP8_COMP *cpi, MACROBLOCK *x) { +static unsigned int tt_activity_measure(VP9_COMP *cpi, MACROBLOCK *x) { unsigned int act; unsigned int sse; /* TODO: This could also be done over smaller areas (8x8), but that would @@ -138,7 +138,7 @@ static unsigned int tt_activity_measure(VP8_COMP *cpi, MACROBLOCK *x) { } // Stub for alternative experimental activity measures. -static unsigned int alt_activity_measure(VP8_COMP *cpi, +static unsigned int alt_activity_measure(VP9_COMP *cpi, MACROBLOCK *x, int use_dc_pred) { return vp9_encode_intra(cpi, x, use_dc_pred); } @@ -147,7 +147,7 @@ static unsigned int alt_activity_measure(VP8_COMP *cpi, // Measure the activity of the current macroblock // What we measure here is TBD so abstracted to this function #define ALT_ACT_MEASURE 1 -static unsigned int mb_activity_measure(VP8_COMP *cpi, MACROBLOCK *x, +static unsigned int mb_activity_measure(VP9_COMP *cpi, MACROBLOCK *x, int mb_row, int mb_col) { unsigned int mb_activity; @@ -169,7 +169,7 @@ static unsigned int mb_activity_measure(VP8_COMP *cpi, MACROBLOCK *x, // Calculate an "average" mb activity value for the frame #define ACT_MEDIAN 0 -static void calc_av_activity(VP8_COMP *cpi, int64_t activity_sum) { +static void calc_av_activity(VP9_COMP *cpi, int64_t activity_sum) { #if ACT_MEDIAN // Find median: Simple n^2 algorithm for experimentation { @@ -227,8 +227,8 @@ static void calc_av_activity(VP8_COMP *cpi, int64_t activity_sum) { #if USE_ACT_INDEX // Calculate and activity index for each mb -static void calc_activity_index(VP8_COMP *cpi, MACROBLOCK *x) { - VP8_COMMON *const cm = &cpi->common; +static void calc_activity_index(VP9_COMP *cpi, MACROBLOCK *x) { + VP9_COMMON *const cm = &cpi->common; int mb_row, mb_col; int64_t act; @@ -281,10 +281,10 @@ static void calc_activity_index(VP8_COMP *cpi, MACROBLOCK *x) { // Loop through all MBs. Note activity of each, average activity and // calculate a normalized activity for each -static void build_activity_map(VP8_COMP *cpi) { +static void build_activity_map(VP9_COMP *cpi) { MACROBLOCK *const x = &cpi->mb; MACROBLOCKD *xd = &x->e_mbd; - VP8_COMMON *const cm = &cpi->common; + VP9_COMMON *const cm = &cpi->common; #if ALT_ACT_MEASURE YV12_BUFFER_CONFIG *new_yv12 = &cm->yv12_fb[cm->new_fb_idx]; @@ -352,7 +352,7 @@ static void build_activity_map(VP8_COMP *cpi) { } // Macroblock activity masking -void vp9_activity_masking(VP8_COMP *cpi, MACROBLOCK *x) { +void vp9_activity_masking(VP9_COMP *cpi, MACROBLOCK *x) { #if USE_ACT_INDEX x->rdmult += *(x->mb_activity_ptr) * (x->rdmult >> 2); x->errorperbit = x->rdmult * 100 / (110 * x->rddiv); @@ -375,7 +375,7 @@ void vp9_activity_masking(VP8_COMP *cpi, MACROBLOCK *x) { adjust_act_zbin(cpi, x); } -static void update_state(VP8_COMP *cpi, MACROBLOCK *x, PICK_MODE_CONTEXT *ctx) { +static void update_state(VP9_COMP *cpi, MACROBLOCK *x, PICK_MODE_CONTEXT *ctx) { int i; MACROBLOCKD *xd = &x->e_mbd; MODE_INFO *mi = &ctx->mic; @@ -489,8 +489,8 @@ static void update_state(VP8_COMP *cpi, MACROBLOCK *x, PICK_MODE_CONTEXT *ctx) { } } -static void pick_mb_modes(VP8_COMP *cpi, - VP8_COMMON *cm, +static void pick_mb_modes(VP9_COMP *cpi, + VP9_COMMON *cm, int mb_row, int mb_col, MACROBLOCK *x, @@ -712,8 +712,8 @@ static void pick_mb_modes(VP8_COMP *cpi, } #if CONFIG_SUPERBLOCKS -static void pick_sb_modes (VP8_COMP *cpi, - VP8_COMMON *cm, +static void pick_sb_modes (VP9_COMP *cpi, + VP9_COMMON *cm, int mb_row, int mb_col, MACROBLOCK *x, @@ -854,8 +854,8 @@ static void pick_sb_modes (VP8_COMP *cpi, } #endif -static void encode_sb(VP8_COMP *cpi, - VP8_COMMON *cm, +static void encode_sb(VP9_COMP *cpi, + VP9_COMMON *cm, int mbrow, int mbcol, MACROBLOCK *x, @@ -1114,8 +1114,8 @@ static void encode_sb(VP8_COMP *cpi, } static -void encode_sb_row(VP8_COMP *cpi, - VP8_COMMON *cm, +void encode_sb_row(VP9_COMP *cpi, + VP9_COMMON *cm, int mb_row, MACROBLOCK *x, MACROBLOCKD *xd, @@ -1229,9 +1229,9 @@ void encode_sb_row(VP8_COMP *cpi, #endif } -static void init_encode_frame_mb_context(VP8_COMP *cpi) { +static void init_encode_frame_mb_context(VP9_COMP *cpi) { MACROBLOCK *const x = &cpi->mb; - VP8_COMMON *const cm = &cpi->common; + VP9_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; // GF active flags data structure @@ -1299,10 +1299,10 @@ static void init_encode_frame_mb_context(VP8_COMP *cpi) { xd->fullpixel_mask = 0xfffffff8; } -static void encode_frame_internal(VP8_COMP *cpi) { +static void encode_frame_internal(VP9_COMP *cpi) { int mb_row; MACROBLOCK *const x = &cpi->mb; - VP8_COMMON *const cm = &cpi->common; + VP9_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; TOKENEXTRA *tp = cpi->tok; @@ -1425,7 +1425,7 @@ static void encode_frame_internal(VP8_COMP *cpi) { } -static int check_dual_ref_flags(VP8_COMP *cpi) { +static int check_dual_ref_flags(VP9_COMP *cpi) { MACROBLOCKD *xd = &cpi->mb.e_mbd; int ref_flags = cpi->ref_frame_flags; @@ -1447,8 +1447,8 @@ static int check_dual_ref_flags(VP8_COMP *cpi) { } } -static void reset_skip_txfm_size(VP8_COMP *cpi, TX_SIZE txfm_max) { - VP8_COMMON *cm = &cpi->common; +static void reset_skip_txfm_size(VP9_COMP *cpi, TX_SIZE txfm_max) { + VP9_COMMON *cm = &cpi->common; int mb_row, mb_col, mis = cm->mode_info_stride, segment_id; MODE_INFO *mi, *mi_ptr = cm->mi; #if CONFIG_SUPERBLOCKS @@ -1493,7 +1493,7 @@ static void reset_skip_txfm_size(VP8_COMP *cpi, TX_SIZE txfm_max) { } } -void vp9_encode_frame(VP8_COMP *cpi) { +void vp9_encode_frame(VP9_COMP *cpi) { if (cpi->sf.RD) { int i, frame_type, pred_type; TXFM_MODE txfm_type; @@ -1721,7 +1721,7 @@ void vp9_build_block_offsets(MACROBLOCK *x) { } } -static void sum_intra_stats(VP8_COMP *cpi, MACROBLOCK *x) { +static void sum_intra_stats(VP9_COMP *cpi, MACROBLOCK *x) { const MACROBLOCKD *xd = &x->e_mbd; const MB_PREDICTION_MODE m = xd->mode_info_context->mbmi.mode; const MB_PREDICTION_MODE uvm = xd->mode_info_context->mbmi.uv_mode; @@ -1774,7 +1774,7 @@ static void sum_intra_stats(VP8_COMP *cpi, MACROBLOCK *x) { // Experimental stub function to create a per MB zbin adjustment based on // some previously calculated measure of MB activity. -static void adjust_act_zbin(VP8_COMP *cpi, MACROBLOCK *x) { +static void adjust_act_zbin(VP9_COMP *cpi, MACROBLOCK *x) { #if USE_ACT_INDEX x->act_zbin_adj = *(x->mb_activity_ptr); #else @@ -1794,7 +1794,7 @@ static void adjust_act_zbin(VP8_COMP *cpi, MACROBLOCK *x) { } #if CONFIG_SUPERBLOCKS -static void update_sb_skip_coeff_state(VP8_COMP *cpi, +static void update_sb_skip_coeff_state(VP9_COMP *cpi, MACROBLOCK *x, ENTROPY_CONTEXT_PLANES ta[4], ENTROPY_CONTEXT_PLANES tl[4], @@ -1852,14 +1852,14 @@ static void update_sb_skip_coeff_state(VP8_COMP *cpi, } } -void vp9_encode_intra_super_block(VP8_COMP *cpi, +void vp9_encode_intra_super_block(VP9_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, int mb_col) { const int output_enabled = 1; int n; MACROBLOCKD *xd = &x->e_mbd; - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; const uint8_t *src = x->src.y_buffer; uint8_t *dst = xd->dst.y_buffer; const uint8_t *usrc = x->src.u_buffer; @@ -1932,7 +1932,7 @@ void vp9_encode_intra_super_block(VP8_COMP *cpi, } #endif /* CONFIG_SUPERBLOCKS */ -void vp9_encode_intra_macro_block(VP8_COMP *cpi, +void vp9_encode_intra_macro_block(VP9_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, int output_enabled) { @@ -1990,10 +1990,10 @@ extern int cnt_pm; extern void vp9_fix_contexts(MACROBLOCKD *xd); -void vp9_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x, +void vp9_encode_inter_macroblock(VP9_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, int recon_yoffset, int recon_uvoffset, int output_enabled) { - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO * mbmi = &xd->mode_info_context->mbmi; unsigned char *segment_id = &mbmi->segment_id; @@ -2176,11 +2176,11 @@ void vp9_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x, } #if CONFIG_SUPERBLOCKS -void vp9_encode_inter_superblock(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, +void vp9_encode_inter_superblock(VP9_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t, int recon_yoffset, int recon_uvoffset, int mb_col, int mb_row) { const int output_enabled = 1; - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *xd = &x->e_mbd; const uint8_t *src = x->src.y_buffer; uint8_t *dst = xd->dst.y_buffer; diff --git a/vp8/encoder/encodeintra.c b/vp8/encoder/encodeintra.c index 60cf60256..074becd30 100644 --- a/vp8/encoder/encodeintra.c +++ b/vp8/encoder/encodeintra.c @@ -25,7 +25,7 @@ #define IF_RTCD(x) NULL #endif -int vp9_encode_intra(VP8_COMP *cpi, MACROBLOCK *x, int use_16x16_pred) { +int vp9_encode_intra(VP9_COMP *cpi, MACROBLOCK *x, int use_16x16_pred) { int i; int intra_pred_var = 0; MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi; diff --git a/vp8/encoder/encodeintra.h b/vp8/encoder/encodeintra.h index 9f2d4a286..29ecc0e1e 100644 --- a/vp8/encoder/encodeintra.h +++ b/vp8/encoder/encodeintra.h @@ -13,7 +13,7 @@ #define _ENCODEINTRA_H_ #include "onyx_int.h" -int vp9_encode_intra(VP8_COMP *cpi, MACROBLOCK *x, int use_16x16_pred); +int vp9_encode_intra(VP9_COMP *cpi, MACROBLOCK *x, int use_16x16_pred); void vp9_encode_intra16x16mby(const VP8_ENCODER_RTCD *, MACROBLOCK *x); void vp9_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *, MACROBLOCK *x); void vp9_encode_intra4x4mby(const VP8_ENCODER_RTCD *, MACROBLOCK *mb); diff --git a/vp8/encoder/encodemv.c b/vp8/encoder/encodemv.c index 972255459..6db356f6b 100644 --- a/vp8/encoder/encodemv.c +++ b/vp8/encoder/encodemv.c @@ -356,7 +356,7 @@ static void add_nmvcount(nmv_context_counts* const dst, } #endif -void vp9_write_nmvprobs(VP8_COMP* const cpi, int usehp, vp8_writer* const bc) { +void vp9_write_nmvprobs(VP9_COMP* const cpi, int usehp, vp8_writer* const bc) { int i, j; nmv_context prob; unsigned int branch_ct_joint[MV_JOINTS - 1][2]; diff --git a/vp8/encoder/encodemv.h b/vp8/encoder/encodemv.h index d15a4d3f7..6d96a2498 100644 --- a/vp8/encoder/encodemv.h +++ b/vp8/encoder/encodemv.h @@ -14,7 +14,7 @@ #include "onyx_int.h" -void vp9_write_nmvprobs(VP8_COMP* const, int usehp, vp8_writer* const); +void vp9_write_nmvprobs(VP9_COMP* const, int usehp, vp8_writer* const); void vp9_encode_nmv(vp8_writer* const w, const MV* const mv, const MV* const ref, const nmv_context* const mvctx); void vp9_encode_nmv_fp(vp8_writer* const w, const MV* const mv, diff --git a/vp8/encoder/firstpass.c b/vp8/encoder/firstpass.c index 782b210c8..6645523e6 100644 --- a/vp8/encoder/firstpass.c +++ b/vp8/encoder/firstpass.c @@ -43,12 +43,12 @@ extern void vp9_build_block_offsets(MACROBLOCK *x); extern void vp9_setup_block_ptrs(MACROBLOCK *x); -extern void vp9_frame_init_quantizer(VP8_COMP *cpi); +extern void vp9_frame_init_quantizer(VP9_COMP *cpi); extern void vp9_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv); -extern void vp9_alloc_compressor_data(VP8_COMP *cpi); +extern void vp9_alloc_compressor_data(VP9_COMP *cpi); #define IIFACTOR 12.5 #define IIKFACTOR1 12.5 @@ -65,7 +65,7 @@ extern void vp9_alloc_compressor_data(VP8_COMP *cpi); #define POW1 (double)cpi->oxcf.two_pass_vbrbias/100.0 #define POW2 (double)cpi->oxcf.two_pass_vbrbias/100.0 -static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame); +static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame); static int select_cq_level(int qindex) { int ret_val = QINDEX_RANGE - 1; @@ -85,11 +85,11 @@ static int select_cq_level(int qindex) { // Resets the first pass file to the given position using a relative seek from the current position -static void reset_fpf_position(VP8_COMP *cpi, FIRSTPASS_STATS *Position) { +static void reset_fpf_position(VP9_COMP *cpi, FIRSTPASS_STATS *Position) { cpi->twopass.stats_in = Position; } -static int lookup_next_frame_stats(VP8_COMP *cpi, FIRSTPASS_STATS *next_frame) { +static int lookup_next_frame_stats(VP9_COMP *cpi, FIRSTPASS_STATS *next_frame) { if (cpi->twopass.stats_in >= cpi->twopass.stats_in_end) return EOF; @@ -98,7 +98,7 @@ static int lookup_next_frame_stats(VP8_COMP *cpi, FIRSTPASS_STATS *next_frame) { } // Read frame stats at an offset from the current position -static int read_frame_stats(VP8_COMP *cpi, +static int read_frame_stats(VP9_COMP *cpi, FIRSTPASS_STATS *frame_stats, int offset) { FIRSTPASS_STATS *fps_ptr = cpi->twopass.stats_in; @@ -116,7 +116,7 @@ static int read_frame_stats(VP8_COMP *cpi, return 1; } -static int input_stats(VP8_COMP *cpi, FIRSTPASS_STATS *fps) { +static int input_stats(VP9_COMP *cpi, FIRSTPASS_STATS *fps) { if (cpi->twopass.stats_in >= cpi->twopass.stats_in_end) return EOF; @@ -126,7 +126,7 @@ static int input_stats(VP8_COMP *cpi, FIRSTPASS_STATS *fps) { return 1; } -static void output_stats(const VP8_COMP *cpi, +static void output_stats(const VP9_COMP *cpi, struct vpx_codec_pkt_list *pktlist, FIRSTPASS_STATS *stats) { struct vpx_codec_cx_pkt pkt; @@ -258,7 +258,7 @@ static void avg_stats(FIRSTPASS_STATS *section) { } // Calculate a modified Error used in distributing bits between easier and harder frames -static double calculate_modified_err(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) { +static double calculate_modified_err(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { double av_err = (cpi->twopass.total_stats->ssim_weighted_pred_err / cpi->twopass.total_stats->count); double this_err = this_frame->ssim_weighted_pred_err; @@ -332,7 +332,7 @@ static double simple_weight(YV12_BUFFER_CONFIG *source) { // This function returns the current per frame maximum bitrate target -static int frame_max_bits(VP8_COMP *cpi) { +static int frame_max_bits(VP9_COMP *cpi) { // Max allocation for a single frame based on the max section guidelines passed in and how many bits are left int max_bits; @@ -346,15 +346,15 @@ static int frame_max_bits(VP8_COMP *cpi) { return max_bits; } -void vp9_init_first_pass(VP8_COMP *cpi) { +void vp9_init_first_pass(VP9_COMP *cpi) { zero_stats(cpi->twopass.total_stats); } -void vp9_end_first_pass(VP8_COMP *cpi) { +void vp9_end_first_pass(VP9_COMP *cpi) { output_stats(cpi, cpi->output_pkt_list, cpi->twopass.total_stats); } -static void zz_motion_search(VP8_COMP *cpi, MACROBLOCK *x, YV12_BUFFER_CONFIG *recon_buffer, int *best_motion_err, int recon_yoffset) { +static void zz_motion_search(VP9_COMP *cpi, MACROBLOCK *x, YV12_BUFFER_CONFIG *recon_buffer, int *best_motion_err, int recon_yoffset) { MACROBLOCKD *const xd = &x->e_mbd; BLOCK *b = &x->block[0]; BLOCKD *d = &x->e_mbd.block[0]; @@ -373,7 +373,7 @@ static void zz_motion_search(VP8_COMP *cpi, MACROBLOCK *x, YV12_BUFFER_CONFIG *r (unsigned int *)(best_motion_err)); } -static void first_pass_motion_search(VP8_COMP *cpi, MACROBLOCK *x, +static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x, int_mv *ref_mv, MV *best_mv, YV12_BUFFER_CONFIG *recon_buffer, int *best_motion_err, int recon_yoffset) { @@ -440,10 +440,10 @@ static void first_pass_motion_search(VP8_COMP *cpi, MACROBLOCK *x, } } -void vp9_first_pass(VP8_COMP *cpi) { +void vp9_first_pass(VP9_COMP *cpi) { int mb_row, mb_col; MACROBLOCK *const x = &cpi->mb; - VP8_COMMON *const cm = &cpi->common; + VP9_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; int recon_yoffset, recon_uvoffset; @@ -807,7 +807,7 @@ static double bitcost(double prob) { return -(log(prob) / log(2.0)); } -static long long estimate_modemvcost(VP8_COMP *cpi, +static long long estimate_modemvcost(VP9_COMP *cpi, FIRSTPASS_STATS *fpstats) { int mv_cost; int mode_cost; @@ -871,7 +871,7 @@ static double calc_correction_factor(double err_per_mb, // PGW TODO.. // This code removes direct dependency on QIndex to determin the range // (now uses the actual quantizer) but has not been tuned. -static void adjust_maxq_qrange(VP8_COMP *cpi) { +static void adjust_maxq_qrange(VP9_COMP *cpi) { int i; double q; @@ -894,7 +894,7 @@ static void adjust_maxq_qrange(VP8_COMP *cpi) { } } -static int estimate_max_q(VP8_COMP *cpi, +static int estimate_max_q(VP9_COMP *cpi, FIRSTPASS_STATS *fpstats, int section_target_bandwitdh, int overhead_bits) { @@ -1020,7 +1020,7 @@ static int estimate_max_q(VP8_COMP *cpi, // For cq mode estimate a cq level that matches the observed // complexity and data rate. -static int estimate_cq(VP8_COMP *cpi, +static int estimate_cq(VP9_COMP *cpi, FIRSTPASS_STATS *fpstats, int section_target_bandwitdh, int overhead_bits) { @@ -1116,9 +1116,9 @@ static int estimate_cq(VP8_COMP *cpi, } -extern void vp9_new_frame_rate(VP8_COMP *cpi, double framerate); +extern void vp9_new_frame_rate(VP9_COMP *cpi, double framerate); -void vp9_init_second_pass(VP8_COMP *cpi) { +void vp9_init_second_pass(VP9_COMP *cpi) { FIRSTPASS_STATS this_frame; FIRSTPASS_STATS *start_pos; @@ -1200,12 +1200,12 @@ void vp9_init_second_pass(VP8_COMP *cpi) { } } -void vp9_end_second_pass(VP8_COMP *cpi) { +void vp9_end_second_pass(VP9_COMP *cpi) { } // This function gives and estimate of how badly we believe // the prediction quality is decaying from frame to frame. -static double get_prediction_decay_rate(VP8_COMP *cpi, +static double get_prediction_decay_rate(VP9_COMP *cpi, FIRSTPASS_STATS *next_frame) { double prediction_decay_rate; double second_ref_decay; @@ -1236,7 +1236,7 @@ static double get_prediction_decay_rate(VP8_COMP *cpi, // by a static section. For example in slide shows where there is a fade // between slides. This is to help with more optimal kf and gf positioning. static int detect_transition_to_still( - VP8_COMP *cpi, + VP9_COMP *cpi, int frame_interval, int still_interval, double loop_decay_rate, @@ -1279,7 +1279,7 @@ static int detect_transition_to_still( // This function detects a flash through the high relative pcnt_second_ref // score in the frame following a flash frame. The offset passed in should // reflect this -static BOOL detect_flash(VP8_COMP *cpi, int offset) { +static BOOL detect_flash(VP9_COMP *cpi, int offset) { FIRSTPASS_STATS next_frame; BOOL flash_detected = FALSE; @@ -1303,7 +1303,7 @@ static BOOL detect_flash(VP8_COMP *cpi, int offset) { // Update the motion related elements to the GF arf boost calculation static void accumulate_frame_motion_stats( - VP8_COMP *cpi, + VP9_COMP *cpi, FIRSTPASS_STATS *this_frame, double *this_frame_mv_in_out, double *mv_in_out_accumulator, @@ -1347,7 +1347,7 @@ static void accumulate_frame_motion_stats( // Calculate a baseline boost number for the current frame. static double calc_frame_boost( - VP8_COMP *cpi, + VP9_COMP *cpi, FIRSTPASS_STATS *this_frame, double this_frame_mv_in_out) { double frame_boost; @@ -1378,7 +1378,7 @@ static double calc_frame_boost( } static int calc_arf_boost( - VP8_COMP *cpi, + VP9_COMP *cpi, int offset, int f_frames, int b_frames, @@ -1471,7 +1471,7 @@ static int calc_arf_boost( return arf_boost; } -static void configure_arnr_filter(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) { +static void configure_arnr_filter(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { int half_gf_int; int frames_after_arf; int frames_bwd = cpi->oxcf.arnr_max_frames - 1; @@ -1523,7 +1523,7 @@ static void configure_arnr_filter(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) { } // Analyse and define a gf/arf group . -static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) { +static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { FIRSTPASS_STATS next_frame; FIRSTPASS_STATS *start_pos; int i; @@ -1879,7 +1879,7 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) { } // Allocate bits to a normal frame that is neither a gf an arf or a key frame. -static void assign_std_frame_bits(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) { +static void assign_std_frame_bits(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { int target_frame_size; // gf_group_error_left double modified_err; @@ -1952,7 +1952,7 @@ static int adjust_active_maxq(int old_maxqi, int new_maxqi) { return ret_val; } -void vp9_second_pass(VP8_COMP *cpi) { +void vp9_second_pass(VP9_COMP *cpi) { int tmp_q; int frames_left = (int)(cpi->twopass.total_stats->count - cpi->common.current_video_frame); @@ -2107,7 +2107,7 @@ void vp9_second_pass(VP8_COMP *cpi) { } -static BOOL test_candidate_kf(VP8_COMP *cpi, FIRSTPASS_STATS *last_frame, FIRSTPASS_STATS *this_frame, FIRSTPASS_STATS *next_frame) { +static BOOL test_candidate_kf(VP9_COMP *cpi, FIRSTPASS_STATS *last_frame, FIRSTPASS_STATS *this_frame, FIRSTPASS_STATS *next_frame) { BOOL is_viable_kf = FALSE; // Does the frame satisfy the primary criteria of a key frame @@ -2190,7 +2190,7 @@ static BOOL test_candidate_kf(VP8_COMP *cpi, FIRSTPASS_STATS *last_frame, FIRST return is_viable_kf; } -static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame) { +static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) { int i, j; FIRSTPASS_STATS last_frame; FIRSTPASS_STATS first_frame; diff --git a/vp8/encoder/firstpass.h b/vp8/encoder/firstpass.h index 805fb0d5e..8deaba3f6 100644 --- a/vp8/encoder/firstpass.h +++ b/vp8/encoder/firstpass.h @@ -12,13 +12,13 @@ #if !defined __INC_FIRSTPASS_H #define __INC_FIRSTPASS_H -extern void vp9_init_first_pass(VP8_COMP *cpi); -extern void vp9_first_pass(VP8_COMP *cpi); -extern void vp9_end_first_pass(VP8_COMP *cpi); +extern void vp9_init_first_pass(VP9_COMP *cpi); +extern void vp9_first_pass(VP9_COMP *cpi); +extern void vp9_end_first_pass(VP9_COMP *cpi); -extern void vp9_init_second_pass(VP8_COMP *cpi); -extern void vp9_second_pass(VP8_COMP *cpi); -extern void vp9_end_second_pass(VP8_COMP *cpi); +extern void vp9_init_second_pass(VP9_COMP *cpi); +extern void vp9_second_pass(VP9_COMP *cpi); +extern void vp9_end_second_pass(VP9_COMP *cpi); extern size_t vp8_firstpass_stats_sz(unsigned int mb_count); #endif diff --git a/vp8/encoder/generic/csystemdependent.c b/vp8/encoder/generic/csystemdependent.c index 8cb992bcf..4f440fc97 100644 --- a/vp8/encoder/generic/csystemdependent.c +++ b/vp8/encoder/generic/csystemdependent.c @@ -14,8 +14,8 @@ #include "vp8/encoder/onyx_int.h" -void vp9_arch_x86_encoder_init(VP8_COMP *cpi); -void vp8_arch_arm_encoder_init(VP8_COMP *cpi); +void vp9_arch_x86_encoder_init(VP9_COMP *cpi); +void vp8_arch_arm_encoder_init(VP9_COMP *cpi); void (*vp9_yv12_copy_partial_frame_ptr)(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc, @@ -24,7 +24,7 @@ extern void vp9_yv12_copy_partial_frame(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc, int fraction); -void vp9_cmachine_specific_config(VP8_COMP *cpi) { +void vp9_cmachine_specific_config(VP9_COMP *cpi) { #if CONFIG_RUNTIME_CPU_DETECT cpi->rtcd.common = &cpi->common.rtcd; diff --git a/vp8/encoder/mbgraph.c b/vp8/encoder/mbgraph.c index 8b91c7d57..554c14d62 100644 --- a/vp8/encoder/mbgraph.c +++ b/vp8/encoder/mbgraph.c @@ -20,7 +20,7 @@ static unsigned int do_16x16_motion_iteration ( - VP8_COMP *cpi, + VP9_COMP *cpi, int_mv *ref_mv, int_mv *dst_mv ) { @@ -97,7 +97,7 @@ static unsigned int do_16x16_motion_iteration static int do_16x16_motion_search ( - VP8_COMP *cpi, + VP9_COMP *cpi, int_mv *ref_mv, int_mv *dst_mv, YV12_BUFFER_CONFIG *buf, @@ -158,7 +158,7 @@ static int do_16x16_motion_search static int do_16x16_zerozero_search ( - VP8_COMP *cpi, + VP9_COMP *cpi, int_mv *dst_mv, YV12_BUFFER_CONFIG *buf, int buf_mb_y_offset, @@ -197,7 +197,7 @@ static int do_16x16_zerozero_search } static int find_best_16x16_intra ( - VP8_COMP *cpi, + VP9_COMP *cpi, YV12_BUFFER_CONFIG *buf, int mb_y_offset, MB_PREDICTION_MODE *pbest_mode @@ -231,7 +231,7 @@ static int find_best_16x16_intra static void update_mbgraph_mb_stats ( - VP8_COMP *cpi, + VP9_COMP *cpi, MBGRAPH_MB_STATS *stats, YV12_BUFFER_CONFIG *buf, int mb_y_offset, @@ -289,14 +289,14 @@ static void update_mbgraph_mb_stats static void update_mbgraph_frame_stats ( - VP8_COMP *cpi, + VP9_COMP *cpi, MBGRAPH_FRAME_STATS *stats, YV12_BUFFER_CONFIG *buf, YV12_BUFFER_CONFIG *golden_ref, YV12_BUFFER_CONFIG *alt_ref ) { MACROBLOCK *const x = &cpi->mb; - VP8_COMMON *const cm = &cpi->common; + VP9_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; int mb_col, mb_row, offset = 0; int mb_y_offset = 0, arf_y_offset = 0, gld_y_offset = 0; @@ -358,8 +358,8 @@ static void update_mbgraph_frame_stats } // void separate_arf_mbs_byzz -static void separate_arf_mbs(VP8_COMP *cpi) { - VP8_COMMON *const cm = &cpi->common; +static void separate_arf_mbs(VP9_COMP *cpi) { + VP9_COMMON *const cm = &cpi->common; int mb_col, mb_row, offset, i; int ncnt[4]; int n_frames = cpi->mbgraph_n_frames; @@ -428,10 +428,10 @@ static void separate_arf_mbs(VP8_COMP *cpi) { cpi->static_mb_pct = 0; cpi->seg0_cnt = ncnt[0]; - vp9_enable_segmentation((VP8_PTR) cpi); + vp9_enable_segmentation((VP9_PTR) cpi); } else { cpi->static_mb_pct = 0; - vp9_disable_segmentation((VP8_PTR) cpi); + vp9_disable_segmentation((VP9_PTR) cpi); } // Free localy allocated storage @@ -440,9 +440,9 @@ static void separate_arf_mbs(VP8_COMP *cpi) { void vp9_update_mbgraph_stats ( - VP8_COMP *cpi + VP9_COMP *cpi ) { - VP8_COMMON *const cm = &cpi->common; + VP9_COMMON *const cm = &cpi->common; int i, n_frames = vp9_lookahead_depth(cpi->lookahead); YV12_BUFFER_CONFIG *golden_ref = &cm->yv12_fb[cm->gld_fb_idx]; diff --git a/vp8/encoder/mbgraph.h b/vp8/encoder/mbgraph.h index 757b2754d..516fe23d2 100644 --- a/vp8/encoder/mbgraph.h +++ b/vp8/encoder/mbgraph.h @@ -11,6 +11,6 @@ #ifndef __INC_MBGRAPH_H__ #define __INC_MBGRAPH_H__ 1 -extern void vp9_update_mbgraph_stats(VP8_COMP *cpi); +extern void vp9_update_mbgraph_stats(VP9_COMP *cpi); #endif /* __INC_MBGRAPH_H__ */ diff --git a/vp8/encoder/mcomp.c b/vp8/encoder/mcomp.c index 5c9887e8b..d4daec098 100644 --- a/vp8/encoder/mcomp.c +++ b/vp8/encoder/mcomp.c @@ -1512,7 +1512,7 @@ int vp9_diamond_search_sadx4(MACROBLOCK *x, BLOCK *b, BLOCKD *d, /* do_refine: If last step (1-away) of n-step search doesn't pick the center point as the best match, we will do a final 1-away diamond refining search */ -int vp9_full_pixel_diamond(VP8_COMP *cpi, MACROBLOCK *x, BLOCK *b, +int vp9_full_pixel_diamond(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *mvp_full, int step_param, int sadpb, int further_steps, int do_refine, vp8_variance_fn_ptr_t *fn_ptr, diff --git a/vp8/encoder/mcomp.h b/vp8/encoder/mcomp.h index 1c6e322e0..eed598221 100644 --- a/vp8/encoder/mcomp.h +++ b/vp8/encoder/mcomp.h @@ -38,8 +38,8 @@ extern int vp9_mv_bit_cost(int_mv *mv, int_mv *ref, DEC_MVCOSTS, extern void vp9_init_dsmotion_compensation(MACROBLOCK *x, int stride); extern void vp9_init3smotion_compensation(MACROBLOCK *x, int stride); // Runs sequence of diamond searches in smaller steps for RD -struct VP8_COMP; -int vp9_full_pixel_diamond(struct VP8_COMP *cpi, MACROBLOCK *x, BLOCK *b, +struct VP9_COMP; +int vp9_full_pixel_diamond(struct VP9_COMP *cpi, MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *mvp_full, int step_param, int sadpb, int further_steps, int do_refine, vp8_variance_fn_ptr_t *fn_ptr, diff --git a/vp8/encoder/modecosts.c b/vp8/encoder/modecosts.c index 523dfc241..e145e791b 100644 --- a/vp8/encoder/modecosts.c +++ b/vp8/encoder/modecosts.c @@ -15,8 +15,8 @@ #include "vp8/common/entropymode.h" -void vp9_init_mode_costs(VP8_COMP *c) { - VP8_COMMON *x = &c->common; +void vp9_init_mode_costs(VP9_COMP *c) { + VP9_COMMON *x = &c->common; const vp8_tree_p T = vp9_bmode_tree; int i, j; diff --git a/vp8/encoder/modecosts.h b/vp8/encoder/modecosts.h index 88dc3fc79..c37604edc 100644 --- a/vp8/encoder/modecosts.h +++ b/vp8/encoder/modecosts.h @@ -12,6 +12,6 @@ #ifndef __INC_MODECOSTS_H #define __INC_MODECOSTS_H -void vp9_init_mode_costs(VP8_COMP *x); +void vp9_init_mode_costs(VP9_COMP *x); #endif diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index bc17432d3..8f6d220ed 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -60,13 +60,13 @@ #define RTCD(x) NULL #endif -extern void vp9_pick_filter_level_fast(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi); +extern void vp9_pick_filter_level_fast(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi); -extern void vp9_set_alt_lf_level(VP8_COMP *cpi, int filt_val); +extern void vp9_set_alt_lf_level(VP9_COMP *cpi, int filt_val); -extern void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi); +extern void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi); -extern void vp9_cmachine_specific_config(VP8_COMP *cpi); +extern void vp9_cmachine_specific_config(VP9_COMP *cpi); extern void vp9_deblock_frame(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *post, @@ -78,9 +78,9 @@ extern unsigned int vp8_get_processor_freq(); extern void print_tree_update_probs(); -extern void vp8cx_create_encoder_threads(VP8_COMP *cpi); +extern void vp8cx_create_encoder_threads(VP9_COMP *cpi); -extern void vp8cx_remove_encoder_threads(VP8_COMP *cpi); +extern void vp8cx_remove_encoder_threads(VP9_COMP *cpi); #if HAVE_ARMV7 extern void vp8_yv12_copy_frame_func_neon(YV12_BUFFER_CONFIG *src_ybc, @@ -92,9 +92,9 @@ extern void vp8_yv12_copy_src_frame_func_neon(YV12_BUFFER_CONFIG *src_ybc, int vp9_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest); -extern void vp9_temporal_filter_prepare_c(VP8_COMP *cpi, int distance); +extern void vp9_temporal_filter_prepare_c(VP9_COMP *cpi, int distance); -static void set_default_lf_deltas(VP8_COMP *cpi); +static void set_default_lf_deltas(VP9_COMP *cpi); extern const int vp8_gf_interval_table[101]; @@ -180,7 +180,7 @@ extern unsigned int inter_uv_modes[VP8_UV_MODES]; extern unsigned int inter_b_modes[B_MODE_COUNT]; #endif -extern void vp9_init_quantizer(VP8_COMP *cpi); +extern void vp9_init_quantizer(VP9_COMP *cpi); static int base_skip_false_prob[QINDEX_RANGE][3]; @@ -289,8 +289,8 @@ static void init_base_skip_probs(void) { } } -static void update_base_skip_probs(VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +static void update_base_skip_probs(VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; if (cm->frame_type != KEY_FRAME) { vp9_update_skip_probs(cpi); @@ -338,7 +338,7 @@ void vp9_initialize_enc() { extern FILE *vpxlogc; #endif -static void setup_features(VP8_COMP *cpi) { +static void setup_features(VP9_COMP *cpi) { MACROBLOCKD *xd = &cpi->mb.e_mbd; // Set up default state for MB feature flags @@ -363,7 +363,7 @@ static void setup_features(VP8_COMP *cpi) { } -static void dealloc_compressor_data(VP8_COMP *cpi) { +static void dealloc_compressor_data(VP9_COMP *cpi) { vpx_free(cpi->tplist); cpi->tplist = NULL; @@ -426,7 +426,7 @@ static void dealloc_compressor_data(VP8_COMP *cpi) { // Computes a q delta (in "q index" terms) to get from a starting q value // to a target value // target q value -static int compute_qdelta(VP8_COMP *cpi, double qstart, double qtarget) { +static int compute_qdelta(VP9_COMP *cpi, double qstart, double qtarget) { int i; int start_index = cpi->worst_quality; int target_index = cpi->worst_quality; @@ -448,8 +448,8 @@ static int compute_qdelta(VP8_COMP *cpi, double qstart, double qtarget) { return target_index - start_index; } -static void init_seg_features(VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +static void init_seg_features(VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *xd = &cpi->mb.e_mbd; int high_q = (int)(cpi->avg_q > 48.0); @@ -464,7 +464,7 @@ static void init_seg_features(VP8_COMP *cpi) { cpi->static_mb_pct = 0; // Disable segmentation - vp9_disable_segmentation((VP8_PTR)cpi); + vp9_disable_segmentation((VP9_PTR)cpi); // Clear down the segment features. vp9_clearall_segfeatures(xd); @@ -479,7 +479,7 @@ static void init_seg_features(VP8_COMP *cpi) { cpi->static_mb_pct = 0; // Disable segmentation and individual segment features by default - vp9_disable_segmentation((VP8_PTR)cpi); + vp9_disable_segmentation((VP9_PTR)cpi); vp9_clearall_segfeatures(xd); // Scan frames from current to arf frame. @@ -540,7 +540,7 @@ static void init_seg_features(VP8_COMP *cpi) { // Disable segmentation and clear down features if alt ref // is not active for this group else { - vp9_disable_segmentation((VP8_PTR)cpi); + vp9_disable_segmentation((VP9_PTR)cpi); vpx_memset(cpi->segmentation_map, 0, (cm->mb_rows * cm->mb_cols)); @@ -590,8 +590,8 @@ static void init_seg_features(VP8_COMP *cpi) { } // DEBUG: Print out the segment id of each MB in the current frame. -static void print_seg_map(VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +static void print_seg_map(VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; int row, col; int map_index = 0; FILE *statsfile; @@ -614,8 +614,8 @@ static void print_seg_map(VP8_COMP *cpi) { fclose(statsfile); } -static void update_reference_segmentation_map(VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +static void update_reference_segmentation_map(VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; int row, col, sb_rows = (cm->mb_rows + 1) >> 1, sb_cols = (cm->mb_cols + 1) >> 1; MODE_INFO *mi = cm->mi; uint8_t *segmap = cpi->segmentation_map; @@ -655,7 +655,7 @@ static void update_reference_segmentation_map(VP8_COMP *cpi) { } } -static void set_default_lf_deltas(VP8_COMP *cpi) { +static void set_default_lf_deltas(VP9_COMP *cpi) { cpi->mb.e_mbd.mode_ref_lf_delta_enabled = 1; cpi->mb.e_mbd.mode_ref_lf_delta_update = 1; @@ -674,12 +674,12 @@ static void set_default_lf_deltas(VP8_COMP *cpi) { cpi->mb.e_mbd.mode_lf_deltas[3] = 4; // Split mv } -void vp9_set_speed_features(VP8_COMP *cpi) { +void vp9_set_speed_features(VP9_COMP *cpi) { SPEED_FEATURES *sf = &cpi->sf; int Mode = cpi->compressor_speed; int Speed = cpi->Speed; int i; - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; // Only modes 0 and 1 supported for now in experimental code basae if (Mode > 1) @@ -1241,7 +1241,7 @@ void vp9_set_speed_features(VP8_COMP *cpi) { frames_at_speed[cpi->Speed]++; #endif } -static void alloc_raw_frame_buffers(VP8_COMP *cpi) { +static void alloc_raw_frame_buffers(VP9_COMP *cpi) { int width = (cpi->oxcf.Width + 15) & ~15; int height = (cpi->oxcf.Height + 15) & ~15; @@ -1261,7 +1261,7 @@ static void alloc_raw_frame_buffers(VP8_COMP *cpi) { #endif } -static int vp8_alloc_partition_data(VP8_COMP *cpi) { +static int vp8_alloc_partition_data(VP9_COMP *cpi) { vpx_free(cpi->mb.pip); cpi->mb.pip = vpx_calloc((cpi->common.mb_cols + 1) * @@ -1275,8 +1275,8 @@ static int vp8_alloc_partition_data(VP8_COMP *cpi) { return 0; } -void vp9_alloc_compressor_data(VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +void vp9_alloc_compressor_data(VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; int width = cm->Width; int height = cm->Height; @@ -1388,7 +1388,7 @@ int vp9_reverse_trans(int x) { return 63; }; -void vp9_new_frame_rate(VP8_COMP *cpi, double framerate) { +void vp9_new_frame_rate(VP9_COMP *cpi, double framerate) { if (framerate < .1) framerate = 30; @@ -1434,9 +1434,9 @@ rescale(int val, int num, int denom) { } -static void init_config(VP8_PTR ptr, VP8_CONFIG *oxcf) { - VP8_COMP *cpi = (VP8_COMP *)(ptr); - VP8_COMMON *cm = &cpi->common; +static void init_config(VP9_PTR ptr, VP8_CONFIG *oxcf) { + VP9_COMP *cpi = (VP9_COMP *)(ptr); + VP9_COMMON *cm = &cpi->common; cpi->oxcf = *oxcf; @@ -1480,9 +1480,9 @@ static void init_config(VP8_PTR ptr, VP8_CONFIG *oxcf) { } -void vp9_change_config(VP8_PTR ptr, VP8_CONFIG *oxcf) { - VP8_COMP *cpi = (VP8_COMP *)(ptr); - VP8_COMMON *cm = &cpi->common; +void vp9_change_config(VP9_PTR ptr, VP8_CONFIG *oxcf) { + VP9_COMP *cpi = (VP9_COMP *)(ptr); + VP9_COMMON *cm = &cpi->common; if (!cpi) return; @@ -1726,27 +1726,27 @@ static void cal_nmvsadcosts_hp(int *mvsadcost[2]) { } while (++i <= MV_MAX); } -VP8_PTR vp9_create_compressor(VP8_CONFIG *oxcf) { +VP9_PTR vp9_create_compressor(VP8_CONFIG *oxcf) { int i; volatile union { - VP8_COMP *cpi; - VP8_PTR ptr; + VP9_COMP *cpi; + VP9_PTR ptr; } ctx; - VP8_COMP *cpi; - VP8_COMMON *cm; + VP9_COMP *cpi; + VP9_COMMON *cm; - cpi = ctx.cpi = vpx_memalign(32, sizeof(VP8_COMP)); + cpi = ctx.cpi = vpx_memalign(32, sizeof(VP9_COMP)); // Check that the CPI instance is valid if (!cpi) return 0; cm = &cpi->common; - vpx_memset(cpi, 0, sizeof(VP8_COMP)); + vpx_memset(cpi, 0, sizeof(VP9_COMP)); if (setjmp(cm->error.jmp)) { - VP8_PTR ptr = ctx.ptr; + VP9_PTR ptr = ctx.ptr; ctx.cpi->common.error.setjmp = 0; vp9_remove_compressor(&ptr); @@ -1760,7 +1760,7 @@ VP8_PTR vp9_create_compressor(VP8_CONFIG *oxcf) { vp9_create_common(&cpi->common); vp9_cmachine_specific_config(cpi); - init_config((VP8_PTR)cpi, oxcf); + init_config((VP9_PTR)cpi, oxcf); memcpy(cpi->base_skip_false_prob, base_skip_false_prob, sizeof(base_skip_false_prob)); cpi->common.current_video_frame = 0; @@ -2026,11 +2026,11 @@ VP8_PTR vp9_create_compressor(VP8_CONFIG *oxcf) { vp8_zero(cpi->y_uv_mode_count) - return (VP8_PTR) cpi; + return (VP9_PTR) cpi; } -void vp9_remove_compressor(VP8_PTR *ptr) { - VP8_COMP *cpi = (VP8_COMP *)(*ptr); +void vp9_remove_compressor(VP9_PTR *ptr) { + VP9_COMP *cpi = (VP9_COMP *)(*ptr); int i; if (!cpi) @@ -2329,7 +2329,7 @@ static uint64_t calc_plane_error(unsigned char *orig, int orig_stride, } -static void generate_psnr_packet(VP8_COMP *cpi) { +static void generate_psnr_packet(VP9_COMP *cpi) { YV12_BUFFER_CONFIG *orig = cpi->Source; YV12_BUFFER_CONFIG *recon = cpi->common.frame_to_show; struct vpx_codec_cx_pkt pkt; @@ -2374,8 +2374,8 @@ static void generate_psnr_packet(VP8_COMP *cpi) { } -int vp9_use_as_reference(VP8_PTR ptr, int ref_frame_flags) { - VP8_COMP *cpi = (VP8_COMP *)(ptr); +int vp9_use_as_reference(VP9_PTR ptr, int ref_frame_flags) { + VP9_COMP *cpi = (VP9_COMP *)(ptr); if (ref_frame_flags > 7) return -1; @@ -2383,8 +2383,8 @@ int vp9_use_as_reference(VP8_PTR ptr, int ref_frame_flags) { cpi->ref_frame_flags = ref_frame_flags; return 0; } -int vp9_update_reference(VP8_PTR ptr, int ref_frame_flags) { - VP8_COMP *cpi = (VP8_COMP *)(ptr); +int vp9_update_reference(VP9_PTR ptr, int ref_frame_flags) { + VP9_COMP *cpi = (VP9_COMP *)(ptr); if (ref_frame_flags > 7) return -1; @@ -2405,10 +2405,10 @@ int vp9_update_reference(VP8_PTR ptr, int ref_frame_flags) { return 0; } -int vp9_get_reference_enc(VP8_PTR ptr, VP8_REFFRAME ref_frame_flag, +int vp9_get_reference_enc(VP9_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd) { - VP8_COMP *cpi = (VP8_COMP *)(ptr); - VP8_COMMON *cm = &cpi->common; + VP9_COMP *cpi = (VP9_COMP *)(ptr); + VP9_COMMON *cm = &cpi->common; int ref_fb_idx; if (ref_frame_flag == VP8_LAST_FLAG) @@ -2425,10 +2425,10 @@ int vp9_get_reference_enc(VP8_PTR ptr, VP8_REFFRAME ref_frame_flag, return 0; } -int vp9_set_reference_enc(VP8_PTR ptr, VP8_REFFRAME ref_frame_flag, +int vp9_set_reference_enc(VP9_PTR ptr, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd) { - VP8_COMP *cpi = (VP8_COMP *)(ptr); - VP8_COMMON *cm = &cpi->common; + VP9_COMP *cpi = (VP9_COMP *)(ptr); + VP9_COMMON *cm = &cpi->common; int ref_fb_idx; @@ -2445,9 +2445,9 @@ int vp9_set_reference_enc(VP8_PTR ptr, VP8_REFFRAME ref_frame_flag, return 0; } -int vp9_update_entropy(VP8_PTR comp, int update) { - VP8_COMP *cpi = (VP8_COMP *) comp; - VP8_COMMON *cm = &cpi->common; +int vp9_update_entropy(VP9_PTR comp, int update) { + VP9_COMP *cpi = (VP9_COMP *) comp; + VP9_COMMON *cm = &cpi->common; cm->refresh_entropy_probs = update; return 0; @@ -2483,7 +2483,7 @@ void vp8_write_yuv_frame(YV12_BUFFER_CONFIG *s) { #endif #ifdef OUTPUT_YUV_REC -void vp8_write_yuv_rec_frame(VP8_COMMON *cm) { +void vp8_write_yuv_rec_frame(VP9_COMMON *cm) { YV12_BUFFER_CONFIG *s = cm->frame_to_show; unsigned char *src = s->y_buffer; int h = cm->Height; @@ -2511,8 +2511,8 @@ void vp8_write_yuv_rec_frame(VP8_COMMON *cm) { } #endif -static void update_alt_ref_frame_stats(VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +static void update_alt_ref_frame_stats(VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; // Update data structure that monitors level of reference to last GF vpx_memset(cpi->gf_active_flags, 1, (cm->mb_rows * cm->mb_cols)); @@ -2529,8 +2529,8 @@ static void update_alt_ref_frame_stats(VP8_COMP *cpi) { } -static void update_golden_frame_stats(VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +static void update_golden_frame_stats(VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; // Update the Golden frame usage counts. if (cm->refresh_golden_frame) { @@ -2607,7 +2607,7 @@ static int find_fp_qindex() { return i; } -static void Pass1Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest, unsigned int *frame_flags) { +static void Pass1Encode(VP9_COMP *cpi, unsigned long *size, unsigned char *dest, unsigned int *frame_flags) { (void) size; (void) dest; (void) frame_flags; @@ -2682,11 +2682,11 @@ static double compute_edge_pixel_proportion(YV12_BUFFER_CONFIG *frame) { // Function to test for conditions that indicate we should loop // back and recode a frame. -static BOOL recode_loop_test(VP8_COMP *cpi, +static BOOL recode_loop_test(VP9_COMP *cpi, int high_limit, int low_limit, int q, int maxq, int minq) { BOOL force_recode = FALSE; - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; // Is frame recode allowed at all // Yes if either recode mode 1 is selected or mode two is selcted @@ -2722,7 +2722,7 @@ static BOOL recode_loop_test(VP8_COMP *cpi, return force_recode; } -static void update_reference_frames(VP8_COMMON *cm) { +static void update_reference_frames(VP9_COMMON *cm) { YV12_BUFFER_CONFIG *yv12_fb = cm->yv12_fb; // At this point the new frame has been encoded. @@ -2792,7 +2792,7 @@ static void update_reference_frames(VP8_COMMON *cm) { } } -static void loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm) { +static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) { if (cm->no_lpf) { cm->filter_level = 0; } @@ -2826,8 +2826,8 @@ static void loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm) { } #if CONFIG_PRED_FILTER -void select_pred_filter_mode(VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +void select_pred_filter_mode(VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; int prob_pred_filter_off = cm->prob_pred_filter_off; @@ -2840,8 +2840,8 @@ void select_pred_filter_mode(VP8_COMP *cpi) { cm->pred_filter_mode = 2; // Selectable at the MB level } -void update_pred_filt_prob(VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +void update_pred_filt_prob(VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; int prob_pred_filter_off; // Based on the selection in the previous frame determine what mode @@ -2872,12 +2872,12 @@ void update_pred_filt_prob(VP8_COMP *cpi) { static void encode_frame_to_data_rate ( - VP8_COMP *cpi, + VP9_COMP *cpi, unsigned long *size, unsigned char *dest, unsigned int *frame_flags ) { - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *xd = &cpi->mb.e_mbd; int Q; @@ -3948,7 +3948,7 @@ static void encode_frame_to_data_rate } } -static void Pass2Encode(VP8_COMP *cpi, unsigned long *size, +static void Pass2Encode(VP9_COMP *cpi, unsigned long *size, unsigned char *dest, unsigned int *frame_flags) { if (!cpi->common.refresh_alt_ref_frame) @@ -3976,14 +3976,14 @@ extern void vp8_pop_neon(int64_t *store); #endif -int vp9_receive_raw_frame(VP8_PTR ptr, unsigned int frame_flags, +int vp9_receive_raw_frame(VP9_PTR ptr, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time) { #if HAVE_ARMV7 int64_t store_reg[8]; #endif - VP8_COMP *cpi = (VP8_COMP *) ptr; - VP8_COMMON *cm = &cpi->common; + VP9_COMP *cpi = (VP9_COMP *) ptr; + VP9_COMMON *cm = &cpi->common; struct vpx_usec_timer timer; int res = 0; @@ -4017,8 +4017,8 @@ int vp9_receive_raw_frame(VP8_PTR ptr, unsigned int frame_flags, } -static int frame_is_reference(const VP8_COMP *cpi) { - const VP8_COMMON *cm = &cpi->common; +static int frame_is_reference(const VP9_COMP *cpi) { + const VP9_COMMON *cm = &cpi->common; const MACROBLOCKD *xd = &cpi->mb.e_mbd; return cm->frame_type == KEY_FRAME || cm->refresh_last_frame @@ -4030,14 +4030,14 @@ static int frame_is_reference(const VP8_COMP *cpi) { } -int vp9_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, +int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, int64_t *time_stamp, int64_t *time_end, int flush) { #if HAVE_ARMV7 int64_t store_reg[8]; #endif - VP8_COMP *cpi = (VP8_COMP *) ptr; - VP8_COMMON *cm = &cpi->common; + VP9_COMP *cpi = (VP9_COMP *) ptr; + VP9_COMMON *cm = &cpi->common; struct vpx_usec_timer cmptimer; YV12_BUFFER_CONFIG *force_src_buffer = NULL; @@ -4348,9 +4348,9 @@ int vp9_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, return 0; } -int vp9_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, +int vp9_get_preview_raw_frame(VP9_PTR comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags) { - VP8_COMP *cpi = (VP8_COMP *) comp; + VP9_COMP *cpi = (VP9_COMP *) comp; if (cpi->common.refresh_alt_ref_frame) return -1; @@ -4376,10 +4376,10 @@ int vp9_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, } } -int vp9_set_roimap(VP8_PTR comp, unsigned char *map, unsigned int rows, +int vp9_set_roimap(VP9_PTR comp, unsigned char *map, unsigned int rows, unsigned int cols, int delta_q[4], int delta_lf[4], unsigned int threshold[4]) { - VP8_COMP *cpi = (VP8_COMP *) comp; + VP9_COMP *cpi = (VP9_COMP *) comp; signed char feature_data[SEG_LVL_MAX][MAX_MB_SEGMENTS]; MACROBLOCKD *xd = &cpi->mb.e_mbd; int i; @@ -4388,15 +4388,15 @@ int vp9_set_roimap(VP8_PTR comp, unsigned char *map, unsigned int rows, return -1; if (!map) { - vp9_disable_segmentation((VP8_PTR)cpi); + vp9_disable_segmentation((VP9_PTR)cpi); return 0; } // Set the segmentation Map - vp9_set_segmentation_map((VP8_PTR)cpi, map); + vp9_set_segmentation_map((VP9_PTR)cpi, map); // Activate segmentation. - vp9_enable_segmentation((VP8_PTR)cpi); + vp9_enable_segmentation((VP9_PTR)cpi); // Set up the quant segment data feature_data[SEG_LVL_ALT_Q][0] = delta_q[0]; @@ -4430,14 +4430,14 @@ int vp9_set_roimap(VP8_PTR comp, unsigned char *map, unsigned int rows, // Initialise the feature data structure // SEGMENT_DELTADATA 0, SEGMENT_ABSDATA 1 - vp9_set_segment_data((VP8_PTR)cpi, &feature_data[0][0], SEGMENT_DELTADATA); + vp9_set_segment_data((VP9_PTR)cpi, &feature_data[0][0], SEGMENT_DELTADATA); return 0; } -int vp9_set_active_map(VP8_PTR comp, unsigned char *map, +int vp9_set_active_map(VP9_PTR comp, unsigned char *map, unsigned int rows, unsigned int cols) { - VP8_COMP *cpi = (VP8_COMP *) comp; + VP9_COMP *cpi = (VP9_COMP *) comp; if (rows == cpi->common.mb_rows && cols == cpi->common.mb_cols) { if (map) { @@ -4453,9 +4453,9 @@ int vp9_set_active_map(VP8_PTR comp, unsigned char *map, } } -int vp9_set_internal_size(VP8_PTR comp, +int vp9_set_internal_size(VP9_PTR comp, VPX_SCALING horiz_mode, VPX_SCALING vert_mode) { - VP8_COMP *cpi = (VP8_COMP *) comp; + VP9_COMP *cpi = (VP9_COMP *) comp; if (horiz_mode <= ONETWO) cpi->common.horiz_scale = horiz_mode; @@ -4495,7 +4495,7 @@ int vp9_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest) { } -int vp9_get_quantizer(VP8_PTR c) { - VP8_COMP *cpi = (VP8_COMP *) c; +int vp9_get_quantizer(VP9_PTR c) { + VP9_COMP *cpi = (VP9_COMP *) c; return cpi->common.base_qindex; } diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index f768ec5a1..22c9ffc4c 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -348,7 +348,7 @@ typedef struct { typedef struct VP8_ENCODER_RTCD { - VP8_COMMON_RTCD *common; + VP9_COMMON_RTCD *common; vp8_search_rtcd_vtable_t search; vp8_temporal_rtcd_vtable_t temporal; } VP8_ENCODER_RTCD; @@ -364,7 +364,7 @@ enum BlockSize { BLOCK_MAX_SB_SEGMENTS, }; -typedef struct VP8_COMP { +typedef struct VP9_COMP { DECLARE_ALIGNED(16, short, Y1quant[QINDEX_RANGE][16]); DECLARE_ALIGNED(16, unsigned char, Y1quant_shift[QINDEX_RANGE][16]); @@ -400,7 +400,7 @@ typedef struct VP8_COMP { DECLARE_ALIGNED(16, short, zrun_zbin_boost_uv_16x16[QINDEX_RANGE][256]); MACROBLOCK mb; - VP8_COMMON common; + VP9_COMMON common; VP8_CONFIG oxcf; struct lookahead_ctx *lookahead; @@ -755,19 +755,19 @@ typedef struct VP8_COMP { unsigned int best_ref_index_counts[MAX_REF_FRAMES][MAX_MV_REFS]; #endif -} VP8_COMP; +} VP9_COMP; -void vp9_encode_frame(VP8_COMP *cpi); +void vp9_encode_frame(VP9_COMP *cpi); -void vp9_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, +void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest, unsigned long *size); -void vp9_activity_masking(VP8_COMP *cpi, MACROBLOCK *x); +void vp9_activity_masking(VP9_COMP *cpi, MACROBLOCK *x); -void vp9_tokenize_mb(VP8_COMP *, MACROBLOCKD *, TOKENEXTRA **, int dry_run); -void vp9_stuff_mb(VP8_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run); +void vp9_tokenize_mb(VP9_COMP *, MACROBLOCKD *, TOKENEXTRA **, int dry_run); +void vp9_stuff_mb(VP9_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run); -void vp9_set_speed_features(VP8_COMP *cpi); +void vp9_set_speed_features(VP9_COMP *cpi); #if CONFIG_DEBUG #define CHECK_MEM_ERROR(lval,expr) do {\ diff --git a/vp8/encoder/picklpf.c b/vp8/encoder/picklpf.c index f957f9c1f..c993ab033 100644 --- a/vp8/encoder/picklpf.c +++ b/vp8/encoder/picklpf.c @@ -102,7 +102,7 @@ static int vp8_calc_partial_ssl_err(YV12_BUFFER_CONFIG *source, } // Enforce a minimum filter level based upon baseline Q -static int get_min_filter_level(VP8_COMP *cpi, int base_qindex) { +static int get_min_filter_level(VP9_COMP *cpi, int base_qindex) { int min_filter_level; /*int q = (int) vp9_convert_qindex_to_q(base_qindex); @@ -124,7 +124,7 @@ static int get_min_filter_level(VP8_COMP *cpi, int base_qindex) { } // Enforce a maximum filter level based upon baseline Q -static int get_max_filter_level(VP8_COMP *cpi, int base_qindex) { +static int get_max_filter_level(VP9_COMP *cpi, int base_qindex) { // PGW August 2006: Highest filter values almost always a bad idea // jbb chg: 20100118 - not so any more with this overquant stuff allow high values @@ -138,8 +138,8 @@ static int get_max_filter_level(VP8_COMP *cpi, int base_qindex) { return max_filter_level; } -void vp9_pick_filter_level_fast(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +void vp9_pick_filter_level_fast(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; int best_err = 0; int filt_err = 0; @@ -245,11 +245,11 @@ void vp9_pick_filter_level_fast(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi) { } // Stub function for now Alt LF not used -void vp9_set_alt_lf_level(VP8_COMP *cpi, int filt_val) { +void vp9_set_alt_lf_level(VP9_COMP *cpi, int filt_val) { } -void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; int best_err = 0; int filt_err = 0; diff --git a/vp8/encoder/quantize.c b/vp8/encoder/quantize.c index b5476b698..65b533d2c 100644 --- a/vp8/encoder/quantize.c +++ b/vp8/encoder/quantize.c @@ -367,7 +367,7 @@ static void invert_quant(short *quant, *shift = l; } -void vp9_init_quantizer(VP8_COMP *cpi) { +void vp9_init_quantizer(VP9_COMP *cpi) { int i; int quant_val; int Q; @@ -531,7 +531,7 @@ void vp9_init_quantizer(VP8_COMP *cpi) { } } -void vp9_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x) { +void vp9_mb_init_quantizer(VP9_COMP *cpi, MACROBLOCK *x) { int i; int QIndex; MACROBLOCKD *xd = &x->e_mbd; @@ -655,7 +655,7 @@ void vp9_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x) { x->e_mbd.q_index = QIndex; } -void vp9_update_zbin_extra(VP8_COMP *cpi, MACROBLOCK *x) { +void vp9_update_zbin_extra(VP9_COMP *cpi, MACROBLOCK *x) { int i; int QIndex = x->e_mbd.q_index; int zbin_extra; @@ -688,7 +688,7 @@ void vp9_update_zbin_extra(VP8_COMP *cpi, MACROBLOCK *x) { x->block[24].zbin_extra = (short)zbin_extra; } -void vp9_frame_init_quantizer(VP8_COMP *cpi) { +void vp9_frame_init_quantizer(VP9_COMP *cpi) { // Clear Zbin mode boost for default case cpi->zbin_mode_boost = 0; @@ -696,8 +696,8 @@ void vp9_frame_init_quantizer(VP8_COMP *cpi) { vp9_mb_init_quantizer(cpi, &cpi->mb); } -void vp9_set_quantizer(struct VP8_COMP *cpi, int Q) { - VP8_COMMON *cm = &cpi->common; +void vp9_set_quantizer(struct VP9_COMP *cpi, int Q) { + VP9_COMMON *cm = &cpi->common; cm->base_qindex = Q; diff --git a/vp8/encoder/quantize.h b/vp8/encoder/quantize.h index 51a7d9118..b81854336 100644 --- a/vp8/encoder/quantize.h +++ b/vp8/encoder/quantize.h @@ -82,16 +82,16 @@ void vp9_quantize_mb_16x16(MACROBLOCK *x); extern prototype_quantize_block(vp8_quantize_quantb_16x16); extern prototype_quantize_mb(vp9_quantize_mby_16x16); -struct VP8_COMP; +struct VP9_COMP; -extern void vp9_set_quantizer(struct VP8_COMP *cpi, int Q); +extern void vp9_set_quantizer(struct VP9_COMP *cpi, int Q); -extern void vp9_frame_init_quantizer(struct VP8_COMP *cpi); +extern void vp9_frame_init_quantizer(struct VP9_COMP *cpi); -extern void vp9_update_zbin_extra(struct VP8_COMP *cpi, MACROBLOCK *x); +extern void vp9_update_zbin_extra(struct VP9_COMP *cpi, MACROBLOCK *x); -extern void vp9_mb_init_quantizer(struct VP8_COMP *cpi, MACROBLOCK *x); +extern void vp9_mb_init_quantizer(struct VP9_COMP *cpi, MACROBLOCK *x); -extern void vp9_init_quantizer(struct VP8_COMP *cpi); +extern void vp9_init_quantizer(struct VP9_COMP *cpi); #endif diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c index 3191ab802..f1f13bd0e 100644 --- a/vp8/encoder/ratectrl.c +++ b/vp8/encoder/ratectrl.c @@ -120,9 +120,9 @@ int vp9_bits_per_mb(FRAME_TYPE frame_type, int qindex) { } -void vp9_save_coding_context(VP8_COMP *cpi) { +void vp9_save_coding_context(VP9_COMP *cpi) { CODING_CONTEXT *const cc = &cpi->coding_context; - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *xd = &cpi->mb.e_mbd; // Stores a snapshot of key state variables which can subsequently be @@ -177,9 +177,9 @@ void vp9_save_coding_context(VP8_COMP *cpi) { vp8_copy(cc->switchable_interp_prob, cm->fc.switchable_interp_prob); } -void vp9_restore_coding_context(VP8_COMP *cpi) { +void vp9_restore_coding_context(VP9_COMP *cpi) { CODING_CONTEXT *const cc = &cpi->coding_context; - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *xd = &cpi->mb.e_mbd; // Restore key state variables to the snapshot state stored in the @@ -234,8 +234,8 @@ void vp9_restore_coding_context(VP8_COMP *cpi) { } -void vp9_setup_key_frame(VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +void vp9_setup_key_frame(VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; // Setup for Key frame: vp9_default_coef_probs(& cpi->common); vp9_kf_default_bmode_probs(cpi->common.kf_bmode_prob); @@ -266,7 +266,7 @@ void vp9_setup_key_frame(VP8_COMP *cpi) { vp9_update_mode_info_in_image(cm, cm->mi); } -void vp9_setup_inter_frame(VP8_COMP *cpi) { +void vp9_setup_inter_frame(VP9_COMP *cpi) { if (cpi->common.refresh_alt_ref_frame) { vpx_memcpy(&cpi->common.fc, &cpi->common.lfc_a, @@ -300,7 +300,7 @@ static int estimate_bits_at_q(int frame_kind, int Q, int MBs, } -static void calc_iframe_target_size(VP8_COMP *cpi) { +static void calc_iframe_target_size(VP9_COMP *cpi) { // boost defaults to half second int target; @@ -328,13 +328,13 @@ static void calc_iframe_target_size(VP8_COMP *cpi) { // // In this experimental code only two pass is supported // so we just use the interval determined in the two pass code. -static void calc_gf_params(VP8_COMP *cpi) { +static void calc_gf_params(VP9_COMP *cpi) { // Set the gf interval cpi->frames_till_gf_update_due = cpi->baseline_gf_interval; } -static void calc_pframe_target_size(VP8_COMP *cpi) { +static void calc_pframe_target_size(VP9_COMP *cpi) { int min_frame_target; min_frame_target = 0; @@ -405,7 +405,7 @@ static void calc_pframe_target_size(VP8_COMP *cpi) { } -void vp9_update_rate_correction_factors(VP8_COMP *cpi, int damp_var) { +void vp9_update_rate_correction_factors(VP9_COMP *cpi, int damp_var) { int Q = cpi->common.base_qindex; int correction_factor = 100; double rate_correction_factor; @@ -501,7 +501,7 @@ void vp9_update_rate_correction_factors(VP8_COMP *cpi, int damp_var) { } -int vp9_regulate_q(VP8_COMP *cpi, int target_bits_per_frame) { +int vp9_regulate_q(VP9_COMP *cpi, int target_bits_per_frame) { int Q = cpi->active_worst_quality; int i; @@ -590,7 +590,7 @@ int vp9_regulate_q(VP8_COMP *cpi, int target_bits_per_frame) { } -static int estimate_keyframe_frequency(VP8_COMP *cpi) { +static int estimate_keyframe_frequency(VP9_COMP *cpi) { int i; // Average key frame frequency @@ -638,7 +638,7 @@ static int estimate_keyframe_frequency(VP8_COMP *cpi) { } -void vp9_adjust_key_frame_context(VP8_COMP *cpi) { +void vp9_adjust_key_frame_context(VP9_COMP *cpi) { // Clear down mmx registers to allow floating point in what follows vp8_clear_system_state(); @@ -647,7 +647,7 @@ void vp9_adjust_key_frame_context(VP8_COMP *cpi) { } -void vp9_compute_frame_size_bounds(VP8_COMP *cpi, int *frame_under_shoot_limit, +void vp9_compute_frame_size_bounds(VP9_COMP *cpi, int *frame_under_shoot_limit, int *frame_over_shoot_limit) { // Set-up bounds on acceptable frame size: if (cpi->oxcf.fixed_q >= 0) { @@ -686,8 +686,8 @@ void vp9_compute_frame_size_bounds(VP8_COMP *cpi, int *frame_under_shoot_limit, // return of 0 means drop frame -int vp9_pick_frame_size(VP8_COMP *cpi) { - VP8_COMMON *cm = &cpi->common; +int vp9_pick_frame_size(VP9_COMP *cpi) { + VP9_COMMON *cm = &cpi->common; if (cm->frame_type == KEY_FRAME) calc_iframe_target_size(cpi); diff --git a/vp8/encoder/ratectrl.h b/vp8/encoder/ratectrl.h index 8add1dad6..f5c751ea0 100644 --- a/vp8/encoder/ratectrl.h +++ b/vp8/encoder/ratectrl.h @@ -15,23 +15,23 @@ #define FRAME_OVERHEAD_BITS 200 -extern void vp9_save_coding_context(VP8_COMP *cpi); -extern void vp9_restore_coding_context(VP8_COMP *cpi); +extern void vp9_save_coding_context(VP9_COMP *cpi); +extern void vp9_restore_coding_context(VP9_COMP *cpi); -extern void vp9_setup_key_frame(VP8_COMP *cpi); -extern void vp9_update_rate_correction_factors(VP8_COMP *cpi, int damp_var); -extern int vp9_regulate_q(VP8_COMP *cpi, int target_bits_per_frame); -extern void vp9_adjust_key_frame_context(VP8_COMP *cpi); -extern void vp9_compute_frame_size_bounds(VP8_COMP *cpi, +extern void vp9_setup_key_frame(VP9_COMP *cpi); +extern void vp9_update_rate_correction_factors(VP9_COMP *cpi, int damp_var); +extern int vp9_regulate_q(VP9_COMP *cpi, int target_bits_per_frame); +extern void vp9_adjust_key_frame_context(VP9_COMP *cpi); +extern void vp9_compute_frame_size_bounds(VP9_COMP *cpi, int *frame_under_shoot_limit, int *frame_over_shoot_limit); // return of 0 means drop frame -extern int vp9_pick_frame_size(VP8_COMP *cpi); +extern int vp9_pick_frame_size(VP9_COMP *cpi); extern double vp9_convert_qindex_to_q(int qindex); extern int vp9_gfboost_qadjust(int qindex); extern int vp9_bits_per_mb(FRAME_TYPE frame_type, int qindex); -void vp9_setup_inter_frame(VP8_COMP *cpi); +void vp9_setup_inter_frame(VP9_COMP *cpi); #endif diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 02076b280..cc25f6108 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -52,8 +52,8 @@ #define IF_RTCD(x) NULL #endif -extern void vp9_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x); -extern void vp9_update_zbin_extra(VP8_COMP *cpi, MACROBLOCK *x); +extern void vp9_mb_init_quantizer(VP9_COMP *cpi, MACROBLOCK *x); +extern void vp9_update_zbin_extra(VP9_COMP *cpi, MACROBLOCK *x); #define MAXF(a,b) (((a) > (b)) ? (a) : (b)) @@ -268,13 +268,13 @@ static int compute_rd_mult(int qindex) { return (11 * q * q) >> 6; } -void vp9_initialize_me_consts(VP8_COMP *cpi, int QIndex) { +void vp9_initialize_me_consts(VP9_COMP *cpi, int QIndex) { cpi->mb.sadperbit16 = sad_per_bit16lut[QIndex]; cpi->mb.sadperbit4 = sad_per_bit4lut[QIndex]; } -void vp9_initialize_rd_consts(VP8_COMP *cpi, int QIndex) { +void vp9_initialize_rd_consts(VP9_COMP *cpi, int QIndex) { int q, i; vp8_clear_system_state(); // __asm emms; @@ -392,7 +392,7 @@ void vp9_initialize_rd_consts(VP8_COMP *cpi, int QIndex) { } } -void vp9_auto_select_speed(VP8_COMP *cpi) { +void vp9_auto_select_speed(VP9_COMP *cpi) { int milliseconds_for_compress = (int)(1000000 / cpi->oxcf.frame_rate); milliseconds_for_compress = milliseconds_for_compress * (16 - cpi->oxcf.cpu_used) / 16; @@ -852,10 +852,10 @@ static void macro_block_yrd_16x16(MACROBLOCK *mb, int *Rate, int *Distortion, *skippable = vp9_mby_is_skippable_16x16(&mb->e_mbd); } -static void macro_block_yrd(VP8_COMP *cpi, MACROBLOCK *x, int *rate, +static void macro_block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int *distortion, int *skippable, int64_t txfm_cache[NB_TXFM_MODES]) { - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; MB_MODE_INFO *mbmi = &x->e_mbd.mode_info_context->mbmi; MACROBLOCKD *xd = &x->e_mbd; @@ -1057,7 +1057,7 @@ static void copy_predictor_8x8(unsigned char *dst, const unsigned char *predicto d[29] = p[29]; } -static int64_t rd_pick_intra4x4block(VP8_COMP *cpi, MACROBLOCK *x, BLOCK *be, +static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *be, BLOCKD *b, B_PREDICTION_MODE *best_mode, #if CONFIG_COMP_INTRA_PRED B_PREDICTION_MODE *best_second_mode, @@ -1168,7 +1168,7 @@ static int64_t rd_pick_intra4x4block(VP8_COMP *cpi, MACROBLOCK *x, BLOCK *be, return best_rd; } -static int64_t rd_pick_intra4x4mby_modes(VP8_COMP *cpi, MACROBLOCK *mb, int *Rate, +static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb, int *Rate, int *rate_y, int *Distortion, int64_t best_rd, #if CONFIG_COMP_INTRA_PRED int allow_comp, @@ -1251,7 +1251,7 @@ static int64_t rd_pick_intra4x4mby_modes(VP8_COMP *cpi, MACROBLOCK *mb, int *Rat } #if CONFIG_SUPERBLOCKS -static int64_t rd_pick_intra_sby_mode(VP8_COMP *cpi, +static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, @@ -1291,7 +1291,7 @@ static int64_t rd_pick_intra_sby_mode(VP8_COMP *cpi, } #endif -static int64_t rd_pick_intra16x16mby_mode(VP8_COMP *cpi, +static int64_t rd_pick_intra16x16mby_mode(VP9_COMP *cpi, MACROBLOCK *x, int *Rate, int *rate_y, @@ -1380,7 +1380,7 @@ static int64_t rd_pick_intra16x16mby_mode(VP8_COMP *cpi, } -static int64_t rd_pick_intra8x8block(VP8_COMP *cpi, MACROBLOCK *x, int ib, +static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib, B_PREDICTION_MODE *best_mode, #if CONFIG_COMP_INTRA_PRED B_PREDICTION_MODE *best_second_mode, @@ -1534,7 +1534,7 @@ static int64_t rd_pick_intra8x8block(VP8_COMP *cpi, MACROBLOCK *x, int ib, return best_rd; } -static int64_t rd_pick_intra8x8mby_modes(VP8_COMP *cpi, MACROBLOCK *mb, +static int64_t rd_pick_intra8x8mby_modes(VP9_COMP *cpi, MACROBLOCK *mb, int *Rate, int *rate_y, int *Distortion, int64_t best_rd) { MACROBLOCKD *const xd = &mb->e_mbd; @@ -1607,7 +1607,7 @@ static int rd_cost_mbuv(MACROBLOCK *mb) { } -static int64_t rd_inter16x16_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate, +static int64_t rd_inter16x16_uv(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int *distortion, int fullpixel, int *skip) { vp9_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer, x->e_mbd.predictor, x->src.uv_stride); @@ -1649,7 +1649,7 @@ static int rd_cost_mbuv_8x8(MACROBLOCK *mb, int backup) { } #if CONFIG_SUPERBLOCKS -static int64_t rd_inter32x32_uv_8x8(VP8_COMP *cpi, MACROBLOCK *x, int *rate, +static int64_t rd_inter32x32_uv_8x8(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int *distortion, int fullpixel, int *skip) { MACROBLOCKD *xd = &x->e_mbd; int n, r = 0, d = 0; @@ -1697,7 +1697,7 @@ static int64_t rd_inter32x32_uv_8x8(VP8_COMP *cpi, MACROBLOCK *x, int *rate, } #endif -static int64_t rd_inter16x16_uv_8x8(VP8_COMP *cpi, MACROBLOCK *x, int *rate, +static int64_t rd_inter16x16_uv_8x8(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int *distortion, int fullpixel, int *skip) { vp9_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer, x->e_mbd.predictor, x->src.uv_stride); @@ -1713,7 +1713,7 @@ static int64_t rd_inter16x16_uv_8x8(VP8_COMP *cpi, MACROBLOCK *x, int *rate, } -static int64_t rd_inter4x4_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate, +static int64_t rd_inter4x4_uv(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int *distortion, int *skippable, int fullpixel) { vp9_build_inter4x4_predictors_mbuv(&x->e_mbd); vp9_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer, @@ -1729,7 +1729,7 @@ static int64_t rd_inter4x4_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate, return RDCOST(x->rdmult, x->rddiv, *rate, *distortion); } -static void rd_pick_intra_mbuv_mode(VP8_COMP *cpi, +static void rd_pick_intra_mbuv_mode(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, @@ -1805,7 +1805,7 @@ static void rd_pick_intra_mbuv_mode(VP8_COMP *cpi, #endif } -static void rd_pick_intra_mbuv_mode_8x8(VP8_COMP *cpi, +static void rd_pick_intra_mbuv_mode_8x8(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, @@ -1903,7 +1903,7 @@ static void super_block_uvrd_8x8(MACROBLOCK *x, memcpy(xd->left_context, t_left, sizeof(t_left)); } -static int64_t rd_pick_intra_sbuv_mode(VP8_COMP *cpi, +static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x, int *rate, int *rate_tokenonly, @@ -1942,7 +1942,7 @@ static int64_t rd_pick_intra_sbuv_mode(VP8_COMP *cpi, } #endif -int vp9_cost_mv_ref(VP8_COMP *cpi, +int vp9_cost_mv_ref(VP9_COMP *cpi, MB_PREDICTION_MODE m, const int near_mv_ref_ct[4]) { MACROBLOCKD *xd = &cpi->mb.e_mbd; @@ -1954,7 +1954,7 @@ int vp9_cost_mv_ref(VP8_COMP *cpi, // to multiple mode masks as per reference frame coding we will need // to do something different here. if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_MODE)) { - VP8_COMMON *pc = &cpi->common; + VP9_COMMON *pc = &cpi->common; vp8_prob p [VP8_MVREFS - 1]; assert(NEARESTMV <= m && m <= SPLITMV); @@ -2245,7 +2245,7 @@ int mv_check_bounds(MACROBLOCK *x, int_mv *mv) { return r; } -static void rd_check_segment_txsize(VP8_COMP *cpi, MACROBLOCK *x, +static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x, BEST_SEG_INFO *bsi, SPLITMV_PARTITIONING_TYPE segmentation, TX_SIZE tx_size, int64_t *otherrds, @@ -2515,7 +2515,7 @@ static void rd_check_segment_txsize(VP8_COMP *cpi, MACROBLOCK *x, } } -static void rd_check_segment(VP8_COMP *cpi, MACROBLOCK *x, +static void rd_check_segment(VP9_COMP *cpi, MACROBLOCK *x, BEST_SEG_INFO *bsi, unsigned int segmentation, /* 16 = n_blocks */ @@ -2623,7 +2623,7 @@ void vp8_cal_step_param(int sr, int *sp) { *sp = MAX_MVSEARCH_STEPS - 1 - step; } -static int rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x, +static int rd_pick_best_mbsegmentation(VP9_COMP *cpi, MACROBLOCK *x, int_mv *best_ref_mv, int_mv *second_best_ref_mv, int64_t best_rd, @@ -2816,7 +2816,7 @@ static void insertsortsad(int arr[], int idx[], int len) { } // The improved MV prediction -void vp9_mv_pred(VP8_COMP *cpi, MACROBLOCKD *xd, const MODE_INFO *here, +void vp9_mv_pred(VP9_COMP *cpi, MACROBLOCKD *xd, const MODE_INFO *here, int_mv *mvp, int refframe, int *ref_frame_sign_bias, int *sr, int near_sadidx[]) { const MODE_INFO *above = here - xd->mode_info_stride; @@ -2940,7 +2940,7 @@ void vp9_mv_pred(VP8_COMP *cpi, MACROBLOCKD *xd, const MODE_INFO *here, vp8_clamp_mv2(mvp, xd); } -static void cal_sad(VP8_COMP *cpi, MACROBLOCKD *xd, MACROBLOCK *x, +static void cal_sad(VP9_COMP *cpi, MACROBLOCKD *xd, MACROBLOCK *x, int recon_yoffset, int near_sadidx[], enum BlockSize block_size) { /* 0-cf above, 1-cf left, 2-cf aboveleft, 3-lf current, 4-lf above, @@ -3043,7 +3043,7 @@ static void set_i8x8_block_modes(MACROBLOCK *x, int modes[2][4]) { } extern void vp9_calc_ref_probs(int *count, vp8_prob *probs); -static void estimate_curframe_refprobs(VP8_COMP *cpi, vp8_prob mod_refprobs[3], int pred_ref) { +static void estimate_curframe_refprobs(VP9_COMP *cpi, vp8_prob mod_refprobs[3], int pred_ref) { int norm_cnt[MAX_REF_FRAMES]; const int *const rfct = cpi->count_mb_ref_frame_usage; int intra_count = rfct[INTRA_FRAME]; @@ -3092,8 +3092,8 @@ static __inline unsigned weighted_cost(vp8_prob *tab0, vp8_prob *tab1, int idx, return (0x8000 + weight * cost1 + (0x10000 - weight) * cost0) >> 16; } -static void vp8_estimate_ref_frame_costs(VP8_COMP *cpi, int segment_id, unsigned int *ref_costs) { - VP8_COMMON *cm = &cpi->common; +static void vp8_estimate_ref_frame_costs(VP9_COMP *cpi, int segment_id, unsigned int *ref_costs) { + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *xd = &cpi->mb.e_mbd; vp8_prob *mod_refprobs; @@ -3213,7 +3213,7 @@ static void store_coding_context(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx, } } -static void inter_mode_cost(VP8_COMP *cpi, MACROBLOCK *x, int this_mode, +static void inter_mode_cost(VP9_COMP *cpi, MACROBLOCK *x, int this_mode, int *rate2, int *distortion2, int *rate_y, int *distortion, int* rate_uv, int *distortion_uv, int *skippable, int64_t txfm_cache[NB_TXFM_MODES]) { @@ -3239,7 +3239,7 @@ static void inter_mode_cost(VP8_COMP *cpi, MACROBLOCK *x, int this_mode, #define MIN(x,y) (((x)<(y))?(x):(y)) #define MAX(x,y) (((x)>(y))?(x):(y)) -static void setup_buffer_inter(VP8_COMP *cpi, MACROBLOCK *x, +static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x, int idx, int frame_type, int recon_yoffset, int recon_uvoffset, int_mv frame_nearest_mv[4], @@ -3280,7 +3280,7 @@ static void setup_buffer_inter(VP8_COMP *cpi, MACROBLOCK *x, #endif } -static int64_t handle_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, +static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, enum BlockSize block_size, int *saddone, int near_sadidx[], int mdcounts[4], int64_t txfm_cache[], @@ -3292,7 +3292,7 @@ static int64_t handle_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int mode_index, int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES], int_mv frame_best_ref_mv[4]) { - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi; BLOCK *b = &x->block[0]; @@ -3529,11 +3529,11 @@ static int64_t handle_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, return this_rd; // if 0, this will be re-calculated by caller } -void vp9_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, +void vp9_rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset, int *returnrate, int *returndistortion, int64_t *returnintra) { - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *xd = &x->e_mbd; union b_mode_info best_bmodes[16]; MB_MODE_INFO best_mbmode; @@ -4278,10 +4278,10 @@ end: } #if CONFIG_SUPERBLOCKS -void vp9_rd_pick_intra_mode_sb(VP8_COMP *cpi, MACROBLOCK *x, +void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, int *returnrate, int *returndist) { - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *xd = &x->e_mbd; int rate_y, rate_uv; int rate_y_tokenonly, rate_uv_tokenonly; @@ -4309,9 +4309,9 @@ void vp9_rd_pick_intra_mode_sb(VP8_COMP *cpi, MACROBLOCK *x, } #endif -void vp9_rd_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, +void vp9_rd_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x, int *returnrate, int *returndist) { - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi; int64_t error4x4, error16x16; @@ -4466,10 +4466,10 @@ void vp9_rd_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, } #if CONFIG_SUPERBLOCKS -int64_t vp9_rd_pick_inter_mode_sb(VP8_COMP *cpi, MACROBLOCK *x, +int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset, int *returnrate, int *returndistortion) { - VP8_COMMON *cm = &cpi->common; + VP9_COMMON *cm = &cpi->common; MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi; MB_PREDICTION_MODE this_mode; @@ -4816,7 +4816,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP8_COMP *cpi, MACROBLOCK *x, } #endif -void vp9_pick_mode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x, +void vp9_pick_mode_inter_macroblock(VP9_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset, int *totalrate, int *totaldist) { diff --git a/vp8/encoder/rdopt.h b/vp8/encoder/rdopt.h index 95413e4dd..ce7c8ca6c 100644 --- a/vp8/encoder/rdopt.h +++ b/vp8/encoder/rdopt.h @@ -15,20 +15,20 @@ #define RDCOST(RM,DM,R,D) ( ((128+((int64_t)R)*(RM)) >> 8) + ((int64_t)DM)*(D) ) #define RDCOST_8x8(RM,DM,R,D) ( ((128+((int64_t)R)*(RM)) >> 8) + ((int64_t)DM)*(D) ) -extern void vp9_initialize_rd_consts(VP8_COMP *cpi, int Qvalue); +extern void vp9_initialize_rd_consts(VP9_COMP *cpi, int Qvalue); -extern void vp9_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, +extern void vp9_rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset, int *returnrate, int *returndistortion, int64_t *returnintra); -extern void vp9_rd_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, +extern void vp9_rd_pick_intra_mode(VP9_COMP *cpi, MACROBLOCK *x, int *r, int *d); -extern void vp9_rd_pick_intra_mode_sb(VP8_COMP *cpi, MACROBLOCK *x, +extern void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, int *r, int *d); -extern void vp9_mv_pred(VP8_COMP *cpi, MACROBLOCKD *xd, +extern void vp9_mv_pred(VP9_COMP *cpi, MACROBLOCKD *xd, const MODE_INFO *here, int_mv *mvp, int refframe, int *ref_frame_sign_bias, int *sr, int near_sadidx[]); diff --git a/vp8/encoder/segmentation.c b/vp8/encoder/segmentation.c index 1b33aa10d..5d537dd6c 100644 --- a/vp8/encoder/segmentation.c +++ b/vp8/encoder/segmentation.c @@ -14,7 +14,7 @@ #include "segmentation.h" #include "vp8/common/pred_common.h" -void vp9_update_gf_useage_maps(VP8_COMP *cpi, VP8_COMMON *cm, MACROBLOCK *x) { +void vp9_update_gf_useage_maps(VP9_COMP *cpi, VP9_COMMON *cm, MACROBLOCK *x) { int mb_row, mb_col; MODE_INFO *this_mb_mode_info = cm->mi; @@ -58,8 +58,8 @@ void vp9_update_gf_useage_maps(VP8_COMP *cpi, VP8_COMMON *cm, MACROBLOCK *x) { } } -void vp9_enable_segmentation(VP8_PTR ptr) { - VP8_COMP *cpi = (VP8_COMP *)(ptr); +void vp9_enable_segmentation(VP9_PTR ptr) { + VP9_COMP *cpi = (VP9_COMP *)(ptr); // Set the appropriate feature bit cpi->mb.e_mbd.segmentation_enabled = 1; @@ -67,16 +67,16 @@ void vp9_enable_segmentation(VP8_PTR ptr) { cpi->mb.e_mbd.update_mb_segmentation_data = 1; } -void vp9_disable_segmentation(VP8_PTR ptr) { - VP8_COMP *cpi = (VP8_COMP *)(ptr); +void vp9_disable_segmentation(VP9_PTR ptr) { + VP9_COMP *cpi = (VP9_COMP *)(ptr); // Clear the appropriate feature bit cpi->mb.e_mbd.segmentation_enabled = 0; } -void vp9_set_segmentation_map(VP8_PTR ptr, +void vp9_set_segmentation_map(VP9_PTR ptr, unsigned char *segmentation_map) { - VP8_COMP *cpi = (VP8_COMP *)(ptr); + VP9_COMP *cpi = (VP9_COMP *)(ptr); // Copy in the new segmentation map vpx_memcpy(cpi->segmentation_map, segmentation_map, @@ -87,10 +87,10 @@ void vp9_set_segmentation_map(VP8_PTR ptr, cpi->mb.e_mbd.update_mb_segmentation_data = 1; } -void vp9_set_segment_data(VP8_PTR ptr, +void vp9_set_segment_data(VP9_PTR ptr, signed char *feature_data, unsigned char abs_delta) { - VP8_COMP *cpi = (VP8_COMP *)(ptr); + VP9_COMP *cpi = (VP9_COMP *)(ptr); cpi->mb.e_mbd.mb_segment_abs_delta = abs_delta; @@ -160,8 +160,8 @@ static int cost_segmap(MACROBLOCKD *xd, } -void vp9_choose_segmap_coding_method(VP8_COMP *cpi) { - VP8_COMMON *const cm = &cpi->common; +void vp9_choose_segmap_coding_method(VP9_COMP *cpi) { + VP9_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &cpi->mb.e_mbd; const int mis = cm->mode_info_stride; diff --git a/vp8/encoder/segmentation.h b/vp8/encoder/segmentation.h index 4ef6c799f..7719da38a 100644 --- a/vp8/encoder/segmentation.h +++ b/vp8/encoder/segmentation.h @@ -16,15 +16,15 @@ #ifndef __INC_SEGMENTATION_H__ #define __INC_SEGMENTATION_H__ 1 -extern void vp9_update_gf_useage_maps(VP8_COMP *cpi, VP8_COMMON *cm, +extern void vp9_update_gf_useage_maps(VP9_COMP *cpi, VP9_COMMON *cm, MACROBLOCK *x); -extern void vp9_enable_segmentation(VP8_PTR ptr); -extern void vp9_disable_segmentation(VP8_PTR ptr); +extern void vp9_enable_segmentation(VP9_PTR ptr); +extern void vp9_disable_segmentation(VP9_PTR ptr); // Valid values for a segment are 0 to 3 // Segmentation map is arrange as [Rows][Columns] -extern void vp9_set_segmentation_map(VP8_PTR ptr, +extern void vp9_set_segmentation_map(VP9_PTR ptr, unsigned char *segmentation_map); // The values given for each segment can be either deltas (from the default @@ -38,9 +38,9 @@ extern void vp9_set_segmentation_map(VP8_PTR ptr, // abs_delta = SEGMENT_DELTADATA (deltas) abs_delta = SEGMENT_ABSDATA (use // the absolute values given). // -extern void vp9_set_segment_data(VP8_PTR ptr, signed char *feature_data, +extern void vp9_set_segment_data(VP9_PTR ptr, signed char *feature_data, unsigned char abs_delta); -extern void vp9_choose_segmap_coding_method(VP8_COMP *cpi); +extern void vp9_choose_segmap_coding_method(VP9_COMP *cpi); #endif /* __INC_SEGMENTATION_H__ */ diff --git a/vp8/encoder/temporal_filter.c b/vp8/encoder/temporal_filter.c index 60c4dada5..0c483ed35 100644 --- a/vp8/encoder/temporal_filter.c +++ b/vp8/encoder/temporal_filter.c @@ -133,7 +133,7 @@ void vp9_temporal_filter_apply_c static int vp8_temporal_filter_find_matching_mb_c ( - VP8_COMP *cpi, + VP9_COMP *cpi, YV12_BUFFER_CONFIG *arf_frame, YV12_BUFFER_CONFIG *frame_ptr, int mb_offset, @@ -220,7 +220,7 @@ static int vp8_temporal_filter_find_matching_mb_c static void vp8_temporal_filter_iterate_c ( - VP8_COMP *cpi, + VP9_COMP *cpi, int frame_count, int alt_ref_index, int strength @@ -412,7 +412,7 @@ static void vp8_temporal_filter_iterate_c void vp9_temporal_filter_prepare_c ( - VP8_COMP *cpi, + VP9_COMP *cpi, int distance ) { int frame = 0; diff --git a/vp8/encoder/tokenize.c b/vp8/encoder/tokenize.c index 1a30deb95..be07331bc 100644 --- a/vp8/encoder/tokenize.c +++ b/vp8/encoder/tokenize.c @@ -48,7 +48,7 @@ extern unsigned int hybrid_tree_update_hist_16x16[BLOCK_TYPES_16X16][COEF_BANDS] [PREV_COEF_CONTEXTS][ENTROPY_NODES] [2]; #endif /* ENTROPY_STATS */ -void vp9_stuff_mb(VP8_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run); +void vp9_stuff_mb(VP9_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run); void vp9_fix_contexts(MACROBLOCKD *xd); static TOKENVALUE dct_value_tokens[DCT_MAX_VALUE * 2]; @@ -109,7 +109,7 @@ static void fill_value_tokens() { vp9_dct_value_cost_ptr = dct_value_cost + DCT_MAX_VALUE; } -static void tokenize_b(VP8_COMP *cpi, +static void tokenize_b(VP9_COMP *cpi, MACROBLOCKD *xd, const BLOCKD * const b, TOKENEXTRA **tp, @@ -286,7 +286,7 @@ static int mb_is_skippable_16x16(MACROBLOCKD *xd) { return (vp9_mby_is_skippable_16x16(xd) & vp9_mbuv_is_skippable_8x8(xd)); } -void vp9_tokenize_mb(VP8_COMP *cpi, +void vp9_tokenize_mb(VP9_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run) { @@ -667,7 +667,7 @@ void vp9_tokenize_initialize() { fill_value_tokens(); } -static __inline void stuff_b(VP8_COMP *cpi, +static __inline void stuff_b(VP9_COMP *cpi, MACROBLOCKD *xd, const BLOCKD * const b, TOKENEXTRA **tp, @@ -730,7 +730,7 @@ static __inline void stuff_b(VP8_COMP *cpi, } } -static void vp9_stuff_mb_8x8(VP8_COMP *cpi, MACROBLOCKD *xd, +static void vp9_stuff_mb_8x8(VP9_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run) { ENTROPY_CONTEXT *A = (ENTROPY_CONTEXT *)xd->above_context; ENTROPY_CONTEXT *L = (ENTROPY_CONTEXT *)xd->left_context; @@ -765,7 +765,7 @@ static void vp9_stuff_mb_8x8(VP8_COMP *cpi, MACROBLOCKD *xd, } } -static void vp9_stuff_mb_16x16(VP8_COMP *cpi, MACROBLOCKD *xd, +static void vp9_stuff_mb_16x16(VP9_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run) { ENTROPY_CONTEXT * A = (ENTROPY_CONTEXT *)xd->above_context; ENTROPY_CONTEXT * L = (ENTROPY_CONTEXT *)xd->left_context; @@ -784,7 +784,7 @@ static void vp9_stuff_mb_16x16(VP8_COMP *cpi, MACROBLOCKD *xd, vpx_memset(&L[8], 0, sizeof(L[8])); } -static void vp9_stuff_mb_4x4(VP8_COMP *cpi, MACROBLOCKD *xd, +static void vp9_stuff_mb_4x4(VP9_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run) { ENTROPY_CONTEXT *A = (ENTROPY_CONTEXT *)xd->above_context; ENTROPY_CONTEXT *L = (ENTROPY_CONTEXT *)xd->left_context; @@ -811,7 +811,7 @@ static void vp9_stuff_mb_4x4(VP8_COMP *cpi, MACROBLOCKD *xd, L + vp9_block2left[b], TX_4X4, dry_run); } -static void vp9_stuff_mb_8x8_4x4uv(VP8_COMP *cpi, MACROBLOCKD *xd, +static void vp9_stuff_mb_8x8_4x4uv(VP9_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run) { ENTROPY_CONTEXT *A = (ENTROPY_CONTEXT *)xd->above_context; ENTROPY_CONTEXT *L = (ENTROPY_CONTEXT *)xd->left_context; @@ -830,7 +830,7 @@ static void vp9_stuff_mb_8x8_4x4uv(VP8_COMP *cpi, MACROBLOCKD *xd, L + vp9_block2left[b], TX_4X4, dry_run); } -void vp9_stuff_mb(VP8_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run) { +void vp9_stuff_mb(VP9_COMP *cpi, MACROBLOCKD *xd, TOKENEXTRA **t, int dry_run) { TX_SIZE tx_size = xd->mode_info_context->mbmi.txfm_size; TOKENEXTRA * const t_backup = *t; diff --git a/vp8/encoder/x86/x86_csystemdependent.c b/vp8/encoder/x86/x86_csystemdependent.c index 3c3922757..4af69c719 100644 --- a/vp8/encoder/x86/x86_csystemdependent.c +++ b/vp8/encoder/x86/x86_csystemdependent.c @@ -76,7 +76,7 @@ void vp9_subtract_b_sse2(BLOCK *be, BLOCKD *bd, int pitch) { #endif -void vp9_arch_x86_encoder_init(VP8_COMP *cpi) { +void vp9_arch_x86_encoder_init(VP9_COMP *cpi) { #if CONFIG_RUNTIME_CPU_DETECT int flags = x86_simd_caps(); diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index 9b77a690f..9195fd3f8 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -76,7 +76,7 @@ struct vpx_codec_alg_priv { vpx_codec_enc_cfg_t cfg; struct vp8_extracfg vp8_cfg; VP8_CONFIG oxcf; - VP8_PTR cpi; + VP9_PTR cpi; unsigned char *cx_data; unsigned int cx_data_sz; vpx_image_t preview_img; @@ -434,7 +434,7 @@ static vpx_codec_err_t vp8e_common_init(vpx_codec_ctx_t *ctx, vpx_codec_enc_cfg_t *cfg; unsigned int i; - VP8_PTR optr; + VP9_PTR optr; if (!ctx->priv) { priv = calloc(1, sizeof(struct vpx_codec_alg_priv)); @@ -646,10 +646,10 @@ static vpx_codec_err_t vp8e_encode(vpx_codec_alg_priv_t *ctx, /* Set up internal flags */ if (ctx->base.init_flags & VPX_CODEC_USE_PSNR) - ((VP8_COMP *)ctx->cpi)->b_calculate_psnr = 1; + ((VP9_COMP *)ctx->cpi)->b_calculate_psnr = 1; // if (ctx->base.init_flags & VPX_CODEC_USE_OUTPUT_PARTITION) - // ((VP8_COMP *)ctx->cpi)->output_partition = 1; + // ((VP9_COMP *)ctx->cpi)->output_partition = 1; /* Convert API flags to internal codec lib flags */ lib_flags = (flags & VPX_EFLAG_FORCE_KF) ? FRAMEFLAGS_KEY : 0; @@ -663,7 +663,7 @@ static vpx_codec_err_t vp8e_encode(vpx_codec_alg_priv_t *ctx, if (vp9_receive_raw_frame(ctx->cpi, ctx->next_frame_flag | lib_flags, &sd, dst_time_stamp, dst_end_time_stamp)) { - VP8_COMP *cpi = (VP8_COMP *)ctx->cpi; + VP9_COMP *cpi = (VP9_COMP *)ctx->cpi; res = update_error_state(ctx, &cpi->common.error); } @@ -682,7 +682,7 @@ static vpx_codec_err_t vp8e_encode(vpx_codec_alg_priv_t *ctx, if (size) { vpx_codec_pts_t round, delta; vpx_codec_cx_pkt_t pkt; - VP8_COMP *cpi = (VP8_COMP *)ctx->cpi; + VP9_COMP *cpi = (VP9_COMP *)ctx->cpi; /* Add the frame packet to the list of returned packets. */ round = 1000000 * ctx->cfg.g_timebase.num / 2 - 1; diff --git a/vp8/vp8_dx_iface.c b/vp8/vp8_dx_iface.c index 599df7dec..c873ad1f2 100644 --- a/vp8/vp8_dx_iface.c +++ b/vp8/vp8_dx_iface.c @@ -409,7 +409,7 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx, } if (vp9_receive_compressed_data(ctx->pbi, data_sz, data, deadline)) { - VP8D_COMP *pbi = (VP8D_COMP *)ctx->pbi; + VP9D_COMP *pbi = (VP9D_COMP *)ctx->pbi; res = update_error_state(ctx, &pbi->common.error); } @@ -612,7 +612,7 @@ static vpx_codec_err_t vp8_get_last_ref_updates(vpx_codec_alg_priv_t *ctx, int ctrl_id, va_list args) { int *update_info = va_arg(args, int *); - VP8D_COMP *pbi = (VP8D_COMP *)ctx->pbi; + VP9D_COMP *pbi = (VP9D_COMP *)ctx->pbi; if (update_info) { *update_info = pbi->common.refresh_alt_ref_frame * (int) VP8_ALTR_FRAME @@ -632,7 +632,7 @@ static vpx_codec_err_t vp8_get_frame_corrupted(vpx_codec_alg_priv_t *ctx, int *corrupted = va_arg(args, int *); if (corrupted) { - VP8D_COMP *pbi = (VP8D_COMP *)ctx->pbi; + VP9D_COMP *pbi = (VP9D_COMP *)ctx->pbi; *corrupted = pbi->common.frame_to_show->corrupted; return VPX_CODEC_OK;