Commit fc7cbd1f authored by Yaowu Xu's avatar Yaowu Xu

VP9_COMMON -> VP10->COMMON

Change-Id: I651b7bee90f33581368853da81f9622805ccc0ea
parent 2dcefd9c
......@@ -17,7 +17,7 @@
#include "vp10/common/entropymv.h"
#include "vp10/common/onyxc_int.h"
void vp10_set_mb_mi(VP9_COMMON *cm, int width, int height) {
void vp10_set_mb_mi(VP10_COMMON *cm, int width, int height) {
const int aligned_width = ALIGN_POWER_OF_TWO(width, MI_SIZE_LOG2);
const int aligned_height = ALIGN_POWER_OF_TWO(height, MI_SIZE_LOG2);
......@@ -30,7 +30,7 @@ void vp10_set_mb_mi(VP9_COMMON *cm, int width, int height) {
cm->MBs = cm->mb_rows * cm->mb_cols;
}
static int alloc_seg_map(VP9_COMMON *cm, int seg_map_size) {
static int alloc_seg_map(VP10_COMMON *cm, int seg_map_size) {
int i;
for (i = 0; i < NUM_PING_PONG_BUFFERS; ++i) {
......@@ -51,7 +51,7 @@ static int alloc_seg_map(VP9_COMMON *cm, int seg_map_size) {
return 0;
}
static void free_seg_map(VP9_COMMON *cm) {
static void free_seg_map(VP10_COMMON *cm) {
int i;
for (i = 0; i < NUM_PING_PONG_BUFFERS; ++i) {
......@@ -81,7 +81,7 @@ void vp10_free_ref_frame_buffers(BufferPool *pool) {
}
}
void vp10_free_postproc_buffers(VP9_COMMON *cm) {
void vp10_free_postproc_buffers(VP10_COMMON *cm) {
#if CONFIG_VP9_POSTPROC
vp9_free_frame_buffer(&cm->post_proc_buffer);
vp9_free_frame_buffer(&cm->post_proc_buffer_int);
......@@ -90,7 +90,7 @@ void vp10_free_postproc_buffers(VP9_COMMON *cm) {
#endif
}
void vp10_free_context_buffers(VP9_COMMON *cm) {
void vp10_free_context_buffers(VP10_COMMON *cm) {
cm->free_mi(cm);
free_seg_map(cm);
vpx_free(cm->above_context);
......@@ -99,7 +99,7 @@ void vp10_free_context_buffers(VP9_COMMON *cm) {
cm->above_seg_context = NULL;
}
int vp10_alloc_context_buffers(VP9_COMMON *cm, int width, int height) {
int vp10_alloc_context_buffers(VP10_COMMON *cm, int width, int height) {
int new_mi_size;
vp10_set_mb_mi(cm, width, height);
......@@ -138,7 +138,7 @@ int vp10_alloc_context_buffers(VP9_COMMON *cm, int width, int height) {
return 1;
}
void vp10_remove_common(VP9_COMMON *cm) {
void vp10_remove_common(VP10_COMMON *cm) {
vp10_free_context_buffers(cm);
vpx_free(cm->fc);
......@@ -147,13 +147,13 @@ void vp10_remove_common(VP9_COMMON *cm) {
cm->frame_contexts = NULL;
}
void vp10_init_context_buffers(VP9_COMMON *cm) {
void vp10_init_context_buffers(VP10_COMMON *cm) {
cm->setup_mi(cm);
if (cm->last_frame_seg_map && !cm->frame_parallel_decode)
memset(cm->last_frame_seg_map, 0, cm->mi_rows * cm->mi_cols);
}
void vp10_swap_current_and_last_seg_map(VP9_COMMON *cm) {
void vp10_swap_current_and_last_seg_map(VP10_COMMON *cm) {
// Swap indices.
const int tmp = cm->seg_map_idx;
cm->seg_map_idx = cm->prev_seg_map_idx;
......
......@@ -13,7 +13,7 @@
#include "vp10/common/blockd.h"
#include "vp10/common/onyxc_int.h"
static void log_frame_info(VP9_COMMON *cm, const char *str, FILE *f) {
static void log_frame_info(VP10_COMMON *cm, const char *str, FILE *f) {
fprintf(f, "%s", str);
fprintf(f, "(Frame %d, Show:%d, Q:%d): \n", cm->current_video_frame,
cm->show_frame, cm->base_qindex);
......@@ -22,7 +22,7 @@ static void log_frame_info(VP9_COMMON *cm, const char *str, FILE *f) {
* and uses the passed in member offset to print out the value of an integer
* for each mbmi member value in the mi structure.
*/
static void print_mi_data(VP9_COMMON *cm, FILE *file, const char *descriptor,
static void print_mi_data(VP10_COMMON *cm, FILE *file, const char *descriptor,
size_t member_offset) {
int mi_row, mi_col;
MODE_INFO **mi = cm->mi_grid_visible;
......@@ -45,7 +45,7 @@ static void print_mi_data(VP9_COMMON *cm, FILE *file, const char *descriptor,
fprintf(file, "\n");
}
void vp10_print_modes_and_motion_vectors(VP9_COMMON *cm, const char *file) {
void vp10_print_modes_and_motion_vectors(VP10_COMMON *cm, const char *file) {
int mi_row;
int mi_col;
FILE *mvs = fopen(file, "a");
......
......@@ -753,7 +753,7 @@ void vp10_model_to_full_probs(const vpx_prob *model, vpx_prob *full) {
extend_to_full_distribution(&full[UNCONSTRAINED_NODES], model[PIVOT_NODE]);
}
void vp10_default_coef_probs(VP9_COMMON *cm) {
void vp10_default_coef_probs(VP10_COMMON *cm) {
vp10_copy(cm->fc->coef_probs[TX_4X4], default_coef_probs_4x4);
vp10_copy(cm->fc->coef_probs[TX_8X8], default_coef_probs_8x8);
vp10_copy(cm->fc->coef_probs[TX_16X16], default_coef_probs_16x16);
......@@ -767,7 +767,7 @@ void vp10_default_coef_probs(VP9_COMMON *cm) {
#define COEF_COUNT_SAT_AFTER_KEY 24
#define COEF_MAX_UPDATE_FACTOR_AFTER_KEY 128
static void adapt_coef_probs(VP9_COMMON *cm, TX_SIZE tx_size,
static void adapt_coef_probs(VP10_COMMON *cm, TX_SIZE tx_size,
unsigned int count_sat,
unsigned int update_factor) {
const FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx];
......@@ -798,7 +798,7 @@ static void adapt_coef_probs(VP9_COMMON *cm, TX_SIZE tx_size,
}
}
void vp10_adapt_coef_probs(VP9_COMMON *cm) {
void vp10_adapt_coef_probs(VP10_COMMON *cm) {
TX_SIZE t;
unsigned int count_sat, update_factor;
......
......@@ -334,7 +334,7 @@ const vpx_tree_index vp10_switchable_interp_tree
-EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP
};
void vp10_adapt_mode_probs(VP9_COMMON *cm) {
void vp10_adapt_mode_probs(VP10_COMMON *cm) {
int i, j;
FRAME_CONTEXT *fc = cm->fc;
const FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx];
......@@ -420,7 +420,7 @@ static void set_default_lf_deltas(struct loopfilter *lf) {
lf->mode_deltas[1] = 0;
}
void vp10_setup_past_independence(VP9_COMMON *cm) {
void vp10_setup_past_independence(VP10_COMMON *cm) {
// Reset the segment feature data to the default stats:
// Features disabled, 0, with delta coding (Default state).
struct loopfilter *const lf = &cm->lf;
......
......@@ -176,7 +176,7 @@ void vp10_inc_mv(const MV *mv, nmv_context_counts *counts) {
}
}
void vp10_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) {
void vp10_adapt_mv_probs(VP10_COMMON *cm, int allow_hp) {
int i, j;
nmv_context *fc = &cm->fc->nmvc;
......@@ -213,6 +213,6 @@ void vp10_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) {
}
}
void vp10_init_mv_probs(VP9_COMMON *cm) {
void vp10_init_mv_probs(VP10_COMMON *cm) {
cm->fc->nmvc = default_nmv_context;
}
......@@ -236,7 +236,7 @@ static uint8_t get_filter_level(const loop_filter_info_n *lfi_n,
[mode_lf_lut[mbmi->mode]];
}
void vp10_loop_filter_init(VP9_COMMON *cm) {
void vp10_loop_filter_init(VP10_COMMON *cm) {
loop_filter_info_n *lfi = &cm->lf_info;
struct loopfilter *lf = &cm->lf;
int lvl;
......@@ -250,7 +250,7 @@ void vp10_loop_filter_init(VP9_COMMON *cm) {
memset(lfi->lfthr[lvl].hev_thr, (lvl >> 4), SIMD_WIDTH);
}
void vp10_loop_filter_frame_init(VP9_COMMON *cm, int default_filt_lvl) {
void vp10_loop_filter_frame_init(VP10_COMMON *cm, int default_filt_lvl) {
int seg_id;
// n_shift is the multiplier for lf_deltas
// the multiplier is 1 for when filter_lvl is between 0 and 31;
......@@ -827,7 +827,7 @@ static void build_y_mask(const loop_filter_info_n *const lfi_n,
// This function sets up the bit masks for the entire 64x64 region represented
// by mi_row, mi_col.
// TODO(JBB): This function only works for yv12.
void vp10_setup_mask(VP9_COMMON *const cm, const int mi_row, const int mi_col,
void vp10_setup_mask(VP10_COMMON *const cm, const int mi_row, const int mi_col,
MODE_INFO **mi, const int mode_info_stride,
LOOP_FILTER_MASK *lfm) {
int idx_32, idx_16, idx_8;
......@@ -1151,7 +1151,7 @@ static void highbd_filter_selectively_vert(uint16_t *s, int pitch,
}
#endif // CONFIG_VP9_HIGHBITDEPTH
void vp10_filter_block_plane_non420(VP9_COMMON *cm,
void vp10_filter_block_plane_non420(VP10_COMMON *cm,
struct macroblockd_plane *plane,
MODE_INFO **mi_8x8,
int mi_row, int mi_col) {
......@@ -1328,7 +1328,7 @@ void vp10_filter_block_plane_non420(VP9_COMMON *cm,
}
}
void vp10_filter_block_plane_ss00(VP9_COMMON *const cm,
void vp10_filter_block_plane_ss00(VP10_COMMON *const cm,
struct macroblockd_plane *const plane,
int mi_row,
LOOP_FILTER_MASK *lfm) {
......@@ -1420,7 +1420,7 @@ void vp10_filter_block_plane_ss00(VP9_COMMON *const cm,
}
}
void vp10_filter_block_plane_ss11(VP9_COMMON *const cm,
void vp10_filter_block_plane_ss11(VP10_COMMON *const cm,
struct macroblockd_plane *const plane,
int mi_row,
LOOP_FILTER_MASK *lfm) {
......@@ -1529,7 +1529,7 @@ void vp10_filter_block_plane_ss11(VP9_COMMON *const cm,
}
void vp10_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer,
VP9_COMMON *cm,
VP10_COMMON *cm,
struct macroblockd_plane planes[MAX_MB_PLANE],
int start, int stop, int y_only) {
const int num_planes = y_only ? 1 : MAX_MB_PLANE;
......@@ -1578,7 +1578,7 @@ void vp10_loop_filter_rows(YV12_BUFFER_CONFIG *frame_buffer,
}
void vp10_loop_filter_frame(YV12_BUFFER_CONFIG *frame,
VP9_COMMON *cm, MACROBLOCKD *xd,
VP10_COMMON *cm, MACROBLOCKD *xd,
int frame_filter_level,
int y_only, int partial_frame) {
int start_mi_row, end_mi_row, mi_rows_to_filter;
......
......@@ -214,7 +214,7 @@ static int mfqe_decision(MODE_INFO *mi, BLOCK_SIZE cur_bs) {
}
// Process each partiton in a super block, recursively.
static void mfqe_partition(VP9_COMMON *cm, MODE_INFO *mi, BLOCK_SIZE bs,
static void mfqe_partition(VP10_COMMON *cm, MODE_INFO *mi, BLOCK_SIZE bs,
const uint8_t *y, const uint8_t *u,
const uint8_t *v, int y_stride, int uv_stride,
uint8_t *yd, uint8_t *ud, uint8_t *vd,
......@@ -349,7 +349,7 @@ static void mfqe_partition(VP9_COMMON *cm, MODE_INFO *mi, BLOCK_SIZE bs,
}
}
void vp10_mfqe(VP9_COMMON *cm) {
void vp10_mfqe(VP10_COMMON *cm) {
int mi_row, mi_col;
// Current decoded frame.
const YV12_BUFFER_CONFIG *show = cm->frame_to_show;
......
......@@ -13,7 +13,7 @@
// This function searches the neighbourhood of a given MB/SB
// to try and find candidate reference vectors.
static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
static void find_mv_refs_idx(const VP10_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list,
int block, int mi_row, int mi_col,
......@@ -146,7 +146,7 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
clamp_mv_ref(&mv_ref_list[i].as_mv, xd);
}
void vp10_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd,
void vp10_find_mv_refs(const VP10_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list,
int mi_row, int mi_col,
......@@ -179,7 +179,7 @@ void vp10_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp,
*near_mv = mvlist[1];
}
void vp10_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
void vp10_append_sub8x8_mvs_for_idx(VP10_COMMON *cm, MACROBLOCKD *xd,
int block, int ref, int mi_row, int mi_col,
int_mv *nearest_mv, int_mv *near_mv,
uint8_t *mode_context) {
......
......@@ -208,7 +208,7 @@ static INLINE void clamp_mv2(MV *mv, const MACROBLOCKD *xd) {
}
typedef void (*find_mv_refs_sync)(void *const data, int mi_row);
void vp10_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd,
void vp10_find_mv_refs(const VP10_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list, int mi_row, int mi_col,
find_mv_refs_sync sync, void *const data,
......@@ -220,7 +220,7 @@ void vp10_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd,
void vp10_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp,
int_mv *mvlist, int_mv *nearest_mv, int_mv *near_mv);
void vp10_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
void vp10_append_sub8x8_mvs_for_idx(VP10_COMMON *cm, MACROBLOCKD *xd,
int block, int ref, int mi_row, int mi_col,
int_mv *nearest_mv, int_mv *near_mv,
uint8_t *mode_context);
......
......@@ -275,7 +275,7 @@ typedef struct VP9Common {
PARTITION_CONTEXT *above_seg_context;
ENTROPY_CONTEXT *above_context;
int above_context_alloc_cols;
} VP9_COMMON;
} VP10_COMMON;
// TODO(hkuang): Don't need to lock the whole pool after implementing atomic
// frame reference count.
......@@ -295,7 +295,7 @@ static void unlock_buffer_pool(BufferPool *const pool) {
#endif
}
static INLINE YV12_BUFFER_CONFIG *get_ref_frame(VP9_COMMON *cm, int index) {
static INLINE YV12_BUFFER_CONFIG *get_ref_frame(VP10_COMMON *cm, int index) {
if (index < 0 || index >= REF_FRAMES)
return NULL;
if (cm->ref_frame_map[index] < 0)
......@@ -304,11 +304,11 @@ static INLINE YV12_BUFFER_CONFIG *get_ref_frame(VP9_COMMON *cm, int index) {
return &cm->buffer_pool->frame_bufs[cm->ref_frame_map[index]].buf;
}
static INLINE YV12_BUFFER_CONFIG *get_frame_new_buffer(VP9_COMMON *cm) {
static INLINE YV12_BUFFER_CONFIG *get_frame_new_buffer(VP10_COMMON *cm) {
return &cm->buffer_pool->frame_bufs[cm->new_fb_idx].buf;
}
static INLINE int get_free_fb(VP9_COMMON *cm) {
static INLINE int get_free_fb(VP10_COMMON *cm) {
RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs;
int i;
......@@ -343,11 +343,11 @@ static INLINE int mi_cols_aligned_to_sb(int n_mis) {
return ALIGN_POWER_OF_TWO(n_mis, MI_BLOCK_SIZE_LOG2);
}
static INLINE int frame_is_intra_only(const VP9_COMMON *const cm) {
static INLINE int frame_is_intra_only(const VP10_COMMON *const cm) {
return cm->frame_type == KEY_FRAME || cm->intra_only;
}
static INLINE void set_partition_probs(const VP9_COMMON *const cm,
static INLINE void set_partition_probs(const VP10_COMMON *const cm,
MACROBLOCKD *const xd) {
xd->partition_probs =
frame_is_intra_only(cm) ?
......@@ -355,7 +355,7 @@ static INLINE void set_partition_probs(const VP9_COMMON *const cm,
(const vpx_prob (*)[PARTITION_TYPES - 1])cm->fc->partition_prob;
}
static INLINE void vp10_init_macroblockd(VP9_COMMON *cm, MACROBLOCKD *xd,
static INLINE void vp10_init_macroblockd(VP10_COMMON *cm, MACROBLOCKD *xd,
tran_low_t *dqcoeff) {
int i;
......
......@@ -612,7 +612,7 @@ void vp10_plane_add_noise_c(uint8_t *start, char *noise,
}
}
static void swap_mi_and_prev_mi(VP9_COMMON *cm) {
static void swap_mi_and_prev_mi(VP10_COMMON *cm) {
// Current mip will be the prev_mip for the next frame.
MODE_INFO *temp = cm->postproc_state.prev_mip;
cm->postproc_state.prev_mip = cm->mip;
......
......@@ -61,7 +61,7 @@ int vp10_get_intra_inter_context(const MACROBLOCKD *xd) {
}
}
int vp10_get_reference_mode_context(const VP9_COMMON *cm,
int vp10_get_reference_mode_context(const VP10_COMMON *cm,
const MACROBLOCKD *xd) {
int ctx;
const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
......@@ -104,7 +104,7 @@ int vp10_get_reference_mode_context(const VP9_COMMON *cm,
}
// Returns a context number for the given MB prediction signal
int vp10_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
int vp10_get_pred_context_comp_ref_p(const VP10_COMMON *cm,
const MACROBLOCKD *xd) {
int pred_context;
const MB_MODE_INFO *const above_mbmi = xd->above_mbmi;
......
......@@ -18,7 +18,7 @@
extern "C" {
#endif
static INLINE int get_segment_id(const VP9_COMMON *cm,
static INLINE int get_segment_id(const VP10_COMMON *cm,
const uint8_t *segment_ids,
BLOCK_SIZE bsize, int mi_row, int mi_col) {
const int mi_offset = mi_row * cm->mi_cols + mi_col;
......@@ -60,7 +60,7 @@ static INLINE int vp10_get_skip_context(const MACROBLOCKD *xd) {
return above_skip + left_skip;
}
static INLINE vpx_prob vp10_get_skip_prob(const VP9_COMMON *cm,
static INLINE vpx_prob vp10_get_skip_prob(const VP10_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc->skip_probs[vp10_get_skip_context(xd)];
}
......@@ -69,22 +69,23 @@ int vp10_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
int vp10_get_intra_inter_context(const MACROBLOCKD *xd);
static INLINE vpx_prob vp10_get_intra_inter_prob(const VP9_COMMON *cm,
static INLINE vpx_prob vp10_get_intra_inter_prob(const VP10_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc->intra_inter_prob[vp10_get_intra_inter_context(xd)];
}
int vp10_get_reference_mode_context(const VP9_COMMON *cm, const MACROBLOCKD *xd);
int vp10_get_reference_mode_context(const VP10_COMMON *cm,
const MACROBLOCKD *xd);
static INLINE vpx_prob vp10_get_reference_mode_prob(const VP9_COMMON *cm,
static INLINE vpx_prob vp10_get_reference_mode_prob(const VP10_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc->comp_inter_prob[vp10_get_reference_mode_context(cm, xd)];
}
int vp10_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
int vp10_get_pred_context_comp_ref_p(const VP10_COMMON *cm,
const MACROBLOCKD *xd);
static INLINE vpx_prob vp10_get_pred_prob_comp_ref_p(const VP9_COMMON *cm,
static INLINE vpx_prob vp10_get_pred_prob_comp_ref_p(const VP10_COMMON *cm,
const MACROBLOCKD *xd) {
const int pred_context = vp10_get_pred_context_comp_ref_p(cm, xd);
return cm->fc->comp_ref_prob[pred_context];
......@@ -92,14 +93,14 @@ static INLINE vpx_prob vp10_get_pred_prob_comp_ref_p(const VP9_COMMON *cm,
int vp10_get_pred_context_single_ref_p1(const MACROBLOCKD *xd);
static INLINE vpx_prob vp10_get_pred_prob_single_ref_p1(const VP9_COMMON *cm,
static INLINE vpx_prob vp10_get_pred_prob_single_ref_p1(const VP10_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc->single_ref_prob[vp10_get_pred_context_single_ref_p1(xd)][0];
}
int vp10_get_pred_context_single_ref_p2(const MACROBLOCKD *xd);
static INLINE vpx_prob vp10_get_pred_prob_single_ref_p2(const VP9_COMMON *cm,
static INLINE vpx_prob vp10_get_pred_prob_single_ref_p2(const VP10_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc->single_ref_prob[vp10_get_pred_context_single_ref_p2(xd)][1];
}
......
......@@ -88,7 +88,7 @@ static INLINE void sync_write(VP9LfSync *const lf_sync, int r, int c,
// Implement row loopfiltering for each thread.
static INLINE
void thread_loop_filter_rows(const YV12_BUFFER_CONFIG *const frame_buffer,
VP9_COMMON *const cm,
VP10_COMMON *const cm,
struct macroblockd_plane planes[MAX_MB_PLANE],
int start, int stop, int y_only,
VP9LfSync *const lf_sync) {
......@@ -154,7 +154,7 @@ static int loop_filter_row_worker(VP9LfSync *const lf_sync,
}
static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame,
VP9_COMMON *cm,
VP10_COMMON *cm,
struct macroblockd_plane planes[MAX_MB_PLANE],
int start, int stop, int y_only,
VPxWorker *workers, int nworkers,
......@@ -214,7 +214,7 @@ static void loop_filter_rows_mt(YV12_BUFFER_CONFIG *frame,
}
void vp10_loop_filter_frame_mt(YV12_BUFFER_CONFIG *frame,
VP9_COMMON *cm,
VP10_COMMON *cm,
struct macroblockd_plane planes[MAX_MB_PLANE],
int frame_filter_level,
int y_only, int partial_frame,
......@@ -253,7 +253,7 @@ static INLINE int get_sync_range(int width) {
}
// Allocate memory for lf row synchronization
void vp10_loop_filter_alloc(VP9LfSync *lf_sync, VP9_COMMON *cm, int rows,
void vp10_loop_filter_alloc(VP9LfSync *lf_sync, VP10_COMMON *cm, int rows,
int width, int num_workers) {
lf_sync->rows = rows;
#if CONFIG_MULTITHREAD
......@@ -317,7 +317,7 @@ void vp10_loop_filter_dealloc(VP9LfSync *lf_sync) {
}
// Accumulate frame counts.
void vp10_accumulate_frame_counts(VP9_COMMON *cm, FRAME_COUNTS *counts,
void vp10_accumulate_frame_counts(VP10_COMMON *cm, FRAME_COUNTS *counts,
int is_dec) {
int i, j, k, l, m;
......
......@@ -21,17 +21,17 @@ static int get_tile_offset(int idx, int mis, int log2) {
return MIN(offset, mis);
}
void vp10_tile_set_row(TileInfo *tile, const VP9_COMMON *cm, int row) {
void vp10_tile_set_row(TileInfo *tile, const VP10_COMMON *cm, int row) {
tile->mi_row_start = get_tile_offset(row, cm->mi_rows, cm->log2_tile_rows);
tile->mi_row_end = get_tile_offset(row + 1, cm->mi_rows, cm->log2_tile_rows);
}
void vp10_tile_set_col(TileInfo *tile, const VP9_COMMON *cm, int col) {
void vp10_tile_set_col(TileInfo *tile, const VP10_COMMON *cm, int col) {
tile->mi_col_start = get_tile_offset(col, cm->mi_cols, cm->log2_tile_cols);
tile->mi_col_end = get_tile_offset(col + 1, cm->mi_cols, cm->log2_tile_cols);
}
void vp10_tile_init(TileInfo *tile, const VP9_COMMON *cm, int row, int col) {
void vp10_tile_init(TileInfo *tile, const VP10_COMMON *cm, int row, int col) {
vp10_tile_set_row(tile, cm, row);
vp10_tile_set_col(tile, cm, col);
}
......
......@@ -44,7 +44,7 @@
#define MAX_VP9_HEADER_SIZE 80
static int is_compound_reference_allowed(const VP9_COMMON *cm) {
static int is_compound_reference_allowed(const VP10_COMMON *cm) {
int i;
for (i = 1; i < REFS_PER_FRAME; ++i)
if (cm->ref_frame_sign_bias[i + 1] != cm->ref_frame_sign_bias[1])
......@@ -53,7 +53,7 @@ static int is_compound_reference_allowed(const VP9_COMMON *cm) {
return 0;
}
static void setup_compound_reference_mode(VP9_COMMON *cm) {
static void setup_compound_reference_mode(VP10_COMMON *cm) {
if (cm->ref_frame_sign_bias[LAST_FRAME] ==
cm->ref_frame_sign_bias[GOLDEN_FRAME]) {
cm->comp_fixed_ref = ALTREF_FRAME;
......@@ -117,7 +117,7 @@ static void read_inter_mode_probs(FRAME_CONTEXT *fc, vpx_reader *r) {
vp10_diff_update_prob(r, &fc->inter_mode_probs[i][j]);
}
static REFERENCE_MODE read_frame_reference_mode(const VP9_COMMON *cm,
static REFERENCE_MODE read_frame_reference_mode(const VP10_COMMON *cm,
vpx_reader *r) {
if (is_compound_reference_allowed(cm)) {
return vpx_read_bit(r) ? (vpx_read_bit(r) ? REFERENCE_MODE_SELECT
......@@ -128,7 +128,7 @@ static REFERENCE_MODE read_frame_reference_mode(const VP9_COMMON *cm,
}
}
static void read_frame_reference_mode_probs(VP9_COMMON *cm, vpx_reader *r) {
static void read_frame_reference_mode_probs(VP10_COMMON *cm, vpx_reader *r) {
FRAME_CONTEXT *const fc = cm->fc;
int i;
......@@ -781,7 +781,7 @@ static void set_plane_n4(MACROBLOCKD *const xd, int bw, int bh, int bwl,
}
}
static MB_MODE_INFO *set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd,
static MB_MODE_INFO *set_offsets(VP10_COMMON *const cm, MACROBLOCKD *const xd,
BLOCK_SIZE bsize, int mi_row, int mi_col,
int bw, int bh, int x_mis, int y_mis,
int bwl, int bhl) {
......@@ -815,7 +815,7 @@ static void decode_block(VP9Decoder *const pbi, MACROBLOCKD *const xd,
int mi_row, int mi_col,
vpx_reader *r, BLOCK_SIZE bsize,
int bwl, int bhl) {
VP9_COMMON *const cm = &pbi->common;
VP10_COMMON *const cm = &pbi->common;
const int less8x8 = bsize < BLOCK_8X8;
const int bw = 1 << (bwl - 1);
const int bh = 1 << (bhl - 1);
......@@ -950,7 +950,7 @@ static PARTITION_TYPE read_partition(MACROBLOCKD *xd, int mi_row, int mi_col,
static void decode_partition(VP9Decoder *const pbi, MACROBLOCKD *const xd,
int mi_row, int mi_col,
vpx_reader* r, BLOCK_SIZE bsize, int n4x4_l2) {
VP9_COMMON *const cm = &pbi->common;
VP10_COMMON *const cm = &pbi->common;
const int n8x8_l2 = n4x4_l2 - 1;
const int num_8x8_wh = 1 << n8x8_l2;
const int hbs = num_8x8_wh >> 1;
......@@ -1127,7 +1127,7 @@ static INLINE int read_delta_q(struct vpx_read_bit_buffer *rb) {
return vpx_rb_read_bit(rb) ? vpx_rb_read_signed_literal(rb, 4) : 0;
}
static void setup_quantization(VP9_COMMON *const cm, MACROBLOCKD *const xd,
static void setup_quantization(VP10_COMMON *const cm, MACROBLOCKD *const xd,
struct vpx_read_bit_buffer *rb) {
cm->base_qindex = vpx_rb_read_literal(rb, QINDEX_BITS);
cm->y_dc_delta_q = read_delta_q(rb);
......@@ -1144,7 +1144,7 @@ static void setup_quantization(VP9_COMMON *const cm, MACROBLOCKD *const xd,
#endif
}
static void setup_segmentation_dequant(VP9_COMMON *const cm) {
static void setup_segmentation_dequant(VP10_COMMON *const cm) {
// Build y/uv dequant values based on segmentation.
if (cm->seg.enabled) {
int i;
......@@ -1180,14 +1180,15 @@ static INTERP_FILTER read_interp_filter(struct vpx_read_bit_buffer *rb) {
: literal_to_filter[vpx_rb_read_literal(rb, 2)];
}
static void setup_display_size(VP9_COMMON *cm, struct vpx_read_bit_buffer *rb) {
static void setup_display_size(VP10_COMMON *cm,
struct vpx_read_bit_buffer *rb) {
cm->display_width = cm->width;
cm->display_height = cm->height;
if (vpx_rb_read_bit(rb))
vp10_read_frame_size(rb, &cm->display_width, &cm->display_height);
}
static void resize_mv_buffer(VP9_COMMON *cm) {
static void resize_mv_buffer(VP10_COMMON *cm) {
vpx_free(cm->cur_frame->mvs);
cm->cur_frame->mi_rows = cm->mi_rows;
cm->cur_frame->mi_cols = cm->mi_cols;
......@@ -1195,7 +1196,7 @@ static void resize_mv_buffer(VP9_COMMON *cm) {
sizeof(*cm->cur_frame->mvs));
}
static void resize_context_buffers(VP9_COMMON *cm, int width, int height) {
static void resize_context_buffers(VP10_COMMON *cm, int width, int height) {
#if CONFIG_SIZE_LIMIT
if (width > DECODE_WIDTH_LIMIT || height > DECODE_HEIGHT_LIMIT)
vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
......@@ -1227,7 +1228,7 @@ static void resize_context_buffers(VP9_COMMON *cm, int width, int height) {
}
}
static void setup_frame_size(VP9_COMMON *cm, struct vpx_read_bit_buffer *rb) {
static void setup_frame_size(VP10_COMMON *cm, struct vpx_read_bit_buffer *rb) {
int width, height;
BufferPool *const pool = cm->buffer_pool;
vp10_read_frame_size(rb, &width, &height);
......@@ -1265,7 +1266,7 @@ static INLINE int valid_ref_frame_img_fmt(vpx_bit_depth_t ref_bit_depth,
ref_yss == this_yss;
}
static void setup_frame_size_with_refs(VP9_COMMON *cm,
static void setup_frame_size_with_refs(VP10_COMMON *cm,
struct vpx_read_bit_buffer *rb) {
int width, height;
int found = 0, i;
......@@ -1338,7 +1339,7 @@ static void setup_frame_size_with_refs(VP9_COMMON *cm,
pool->frame_bufs[cm->new_fb_idx].buf.color_space = cm->color_space;
}
static void setup_tile_info(VP9_COMMON *cm, struct vpx_read_bit_buffer *rb) {
static void setup_tile_info(VP10_COMMON *cm, struct vpx_read_bit_buffer *rb) {
int min_log2_tile_cols, max_log2_tile_cols, max_ones;
vp10_get_tile_n_bits(cm->mi_cols, &min_log2_tile_cols, &max_log2_tile_cols);
......@@ -1421,7 +1422,7 @@ static void get_tile_buffers(VP9Decoder *pbi,
static const uint8_t *decode_tiles(VP9Decoder *pbi,
const uint8_t *data,
const uint8_t *data_end) {
VP9_COMMON *const cm = &pbi->common;
VP10_COMMON *const cm = &pbi->common;
const VPxWorkerInterface *const winterface = vpx_get_worker_interface();
const int aligned_cols = mi_cols_aligned_to_sb(cm->mi_cols);
const int tile_cols = 1 << cm->log2_tile_cols;
......@@ -1597,7 +1598,7 @@ static int compare_tile_buffers(const void *a, const void *b) {
static const uint8_t *decode_tiles_mt(VP9Decoder *pbi,
const uint8_t *data,
const uint8_t *data_end) {
VP9_COMMON *const cm = &pbi->common;
VP10_COMMON *const cm = &pbi->common;
const VPxWorkerInterface *const winterface = vpx_get_worker_interface();
const uint8_t *bit_reader_end = NULL;
const int aligned_mi_cols = mi_cols_aligned_to_sb(cm->mi_cols);
......@@ -1754,12 +1755,12 @@ static const uint8_t *decode_tiles_mt(VP9Decoder *pbi,
}
static void error_handler(void *data) {
VP9_COMMON *const cm = (VP9_COMMON *)data;
VP10_COMMON *const cm = (VP10_COMMON *)data;
vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, "Truncated packet");
}
static void read_bitdepth_colorspace_sampling(
VP9_COMMON *cm, struct vpx_read_bit_buffer *rb) {
VP10_COMMON *cm, struct vpx_read_bit_buffer *rb) {
if (cm->profile >= PROFILE_2) {
cm->bit_depth = vpx_rb_read_bit(rb) ? VPX_BITS_12 : VPX_BITS_10;
#if CONFIG_VP9_HIGHBITDEPTH
......@@ -1803,7 +1804,7 @@ static void read_bitdepth_colorspace_sampling(
static size_t read_uncompressed_header(VP9Decoder *pbi,
struct vpx_read_bit_buffer *rb) {
VP9_COMMON *const cm = &pbi->common;
VP10_COMMON *const cm = &pbi->common;
BufferPool *const pool = cm->buffer_pool;
RefCntBuffer *const frame_bufs = pool->frame_bufs;
int i, mask, ref_index = 0;
......@@ -2005,7 +2006,7 @@ static size_t read_uncompressed_header(VP9Decoder *pbi,
static int read_compressed_header(VP9Decoder *pbi, const uint8_t *data,
size_t partition_size) {
VP9_COMMON *const cm = &pbi->common;
VP10_COMMON *const cm = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
FRAME_CONTEXT *const fc = cm->fc;
vpx_reader r;
......@@ -2060,7 +2061,7 @@ static int read_compressed_header(VP9Decoder *pbi, const uint8_t *data,
#else // !NDEBUG
// Counts should only be incremented when frame_parallel_decoding_mode and
// error_resilient_mode are disabled.
static void debug_check_frame_counts(const VP9_COMMON *const cm) {
static void debug_check_frame_counts(const VP10_COMMON *const cm) {
FRAME_COUNTS zero_counts;
vp10_zero(zero_counts);
assert(cm->frame_parallel_decoding_mode || cm->error_resilient_mode);
......@@ -2138,7 +2139,7 @@ BITSTREAM_PROFILE vp10_read_profile(struct vpx_read_bit_buffer *rb) {
void vp10_decode_frame(VP9Decoder *pbi,
const uint8_t *data, const uint8_t *data_end,
const uint8_t **p_data_end) {
VP9_COMMON *const cm = &pbi->common;
VP10_COMMON *const cm = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
struct vpx_read_bit_buffer rb;
int context_updated = 0;
......
......@@ -26,7 +26,7 @@ static PREDICTION_MODE read_intra_mode(vpx_reader *r, const vpx_prob *p) {
return (PREDICTION_MODE)vpx_read_tree(r, vp10_intra_mode_tree, p);
}