Commit 982deebb authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

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
parent 43da8f14
......@@ -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[]);
......
......@@ -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;
......
......@@ -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__ */
......@@ -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;
......
......@@ -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;
......
......@@ -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();
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment