Commit e83e8f04 authored by James Zern's avatar James Zern Committed by Gerrit Code Review
Browse files

Merge changes Ib1e853f9,Ifd75c809,If3e83404

* changes:
  consistently name VP9_COMMON variables #3
  consistently name VP9_COMMON variables #2
  consistently name VP9_COMMON variables #1
parents ee961599 d765df27
......@@ -13,6 +13,7 @@
#include "vp9_rtcd.h"
#include "vp9/common/vp9_onyxc_int.h"
void vp9_machine_specific_config(VP9_COMMON *ctx) {
void vp9_machine_specific_config(VP9_COMMON *cm) {
(void)cm;
vp9_rtcd();
}
......@@ -47,26 +47,26 @@ void vp9_update_mode_info_in_image(VP9_COMMON *cm, MODE_INFO *mi) {
}
}
void vp9_free_frame_buffers(VP9_COMMON *oci) {
void vp9_free_frame_buffers(VP9_COMMON *cm) {
int i;
for (i = 0; i < NUM_YV12_BUFFERS; i++)
vp9_free_frame_buffer(&oci->yv12_fb[i]);
vp9_free_frame_buffer(&cm->yv12_fb[i]);
vp9_free_frame_buffer(&oci->post_proc_buffer);
vp9_free_frame_buffer(&cm->post_proc_buffer);
vpx_free(oci->mip);
vpx_free(oci->prev_mip);
vpx_free(oci->above_seg_context);
vpx_free(oci->last_frame_seg_map);
vpx_free(cm->mip);
vpx_free(cm->prev_mip);
vpx_free(cm->above_seg_context);
vpx_free(cm->last_frame_seg_map);
vpx_free(oci->above_context[0]);
vpx_free(cm->above_context[0]);
for (i = 0; i < MAX_MB_PLANE; i++)
oci->above_context[i] = 0;
oci->mip = NULL;
oci->prev_mip = NULL;
oci->above_seg_context = NULL;
oci->last_frame_seg_map = NULL;
cm->above_context[i] = 0;
cm->mip = NULL;
cm->prev_mip = NULL;
cm->above_seg_context = NULL;
cm->last_frame_seg_map = NULL;
}
static void set_mb_mi(VP9_COMMON *cm, int aligned_width, int aligned_height) {
......@@ -93,95 +93,95 @@ static void setup_mi(VP9_COMMON *cm) {
vp9_update_mode_info_in_image(cm, cm->prev_mi);
}
int vp9_alloc_frame_buffers(VP9_COMMON *oci, int width, int height) {
int vp9_alloc_frame_buffers(VP9_COMMON *cm, int width, int height) {
int i, mi_cols;
const int aligned_width = ALIGN_POWER_OF_TWO(width, MI_SIZE_LOG2);
const int aligned_height = ALIGN_POWER_OF_TWO(height, MI_SIZE_LOG2);
const int ss_x = oci->subsampling_x;
const int ss_y = oci->subsampling_y;
const int ss_x = cm->subsampling_x;
const int ss_y = cm->subsampling_y;
int mi_size;
vp9_free_frame_buffers(oci);
vp9_free_frame_buffers(cm);
for (i = 0; i < NUM_YV12_BUFFERS; i++) {
oci->fb_idx_ref_cnt[i] = 0;
if (vp9_alloc_frame_buffer(&oci->yv12_fb[i], width, height, ss_x, ss_y,
cm->fb_idx_ref_cnt[i] = 0;
if (vp9_alloc_frame_buffer(&cm->yv12_fb[i], width, height, ss_x, ss_y,
VP9BORDERINPIXELS) < 0)
goto fail;
}
oci->new_fb_idx = NUM_YV12_BUFFERS - 1;
oci->fb_idx_ref_cnt[oci->new_fb_idx] = 1;
cm->new_fb_idx = NUM_YV12_BUFFERS - 1;
cm->fb_idx_ref_cnt[cm->new_fb_idx] = 1;
for (i = 0; i < ALLOWED_REFS_PER_FRAME; i++)
oci->active_ref_idx[i] = i;
cm->active_ref_idx[i] = i;
for (i = 0; i < NUM_REF_FRAMES; i++) {
oci->ref_frame_map[i] = i;
oci->fb_idx_ref_cnt[i] = 1;
cm->ref_frame_map[i] = i;
cm->fb_idx_ref_cnt[i] = 1;
}
if (vp9_alloc_frame_buffer(&oci->post_proc_buffer, width, height, ss_x, ss_y,
if (vp9_alloc_frame_buffer(&cm->post_proc_buffer, width, height, ss_x, ss_y,
VP9BORDERINPIXELS) < 0)
goto fail;
set_mb_mi(oci, aligned_width, aligned_height);
set_mb_mi(cm, aligned_width, aligned_height);
// Allocation
mi_size = oci->mode_info_stride * (oci->mi_rows + MI_BLOCK_SIZE);
mi_size = cm->mode_info_stride * (cm->mi_rows + MI_BLOCK_SIZE);
oci->mip = vpx_calloc(mi_size, sizeof(MODE_INFO));
if (!oci->mip)
cm->mip = vpx_calloc(mi_size, sizeof(MODE_INFO));
if (!cm->mip)
goto fail;
oci->prev_mip = vpx_calloc(mi_size, sizeof(MODE_INFO));
if (!oci->prev_mip)
cm->prev_mip = vpx_calloc(mi_size, sizeof(MODE_INFO));
if (!cm->prev_mip)
goto fail;
setup_mi(oci);
setup_mi(cm);
// FIXME(jkoleszar): allocate subsampled arrays for U/V once subsampling
// information is exposed at this level
mi_cols = mi_cols_aligned_to_sb(oci->mi_cols);
mi_cols = mi_cols_aligned_to_sb(cm->mi_cols);
// 2 contexts per 'mi unit', so that we have one context per 4x4 txfm
// block where mi unit size is 8x8.
oci->above_context[0] = vpx_calloc(sizeof(ENTROPY_CONTEXT) * MAX_MB_PLANE *
cm->above_context[0] = vpx_calloc(sizeof(ENTROPY_CONTEXT) * MAX_MB_PLANE *
(2 * mi_cols), 1);
if (!oci->above_context[0])
if (!cm->above_context[0])
goto fail;
oci->above_seg_context = vpx_calloc(sizeof(PARTITION_CONTEXT) * mi_cols, 1);
if (!oci->above_seg_context)
cm->above_seg_context = vpx_calloc(sizeof(PARTITION_CONTEXT) * mi_cols, 1);
if (!cm->above_seg_context)
goto fail;
// Create the segmentation map structure and set to 0.
oci->last_frame_seg_map = vpx_calloc(oci->mi_rows * oci->mi_cols, 1);
if (!oci->last_frame_seg_map)
cm->last_frame_seg_map = vpx_calloc(cm->mi_rows * cm->mi_cols, 1);
if (!cm->last_frame_seg_map)
goto fail;
return 0;
fail:
vp9_free_frame_buffers(oci);
vp9_free_frame_buffers(cm);
return 1;
}
void vp9_create_common(VP9_COMMON *oci) {
vp9_machine_specific_config(oci);
void vp9_create_common(VP9_COMMON *cm) {
vp9_machine_specific_config(cm);
vp9_init_mbmode_probs(oci);
vp9_init_mbmode_probs(cm);
oci->tx_mode = ONLY_4X4;
oci->comp_pred_mode = HYBRID_PREDICTION;
cm->tx_mode = ONLY_4X4;
cm->comp_pred_mode = HYBRID_PREDICTION;
// Initialize reference frame sign bias structure to defaults
vpx_memset(oci->ref_frame_sign_bias, 0, sizeof(oci->ref_frame_sign_bias));
vpx_memset(cm->ref_frame_sign_bias, 0, sizeof(cm->ref_frame_sign_bias));
}
void vp9_remove_common(VP9_COMMON *oci) {
vp9_free_frame_buffers(oci);
void vp9_remove_common(VP9_COMMON *cm) {
vp9_free_frame_buffers(cm);
}
void vp9_initialize_common() {
......
......@@ -16,14 +16,14 @@
void vp9_initialize_common();
void vp9_update_mode_info_border(VP9_COMMON *cpi, MODE_INFO *mi);
void vp9_update_mode_info_in_image(VP9_COMMON *cpi, MODE_INFO *mi);
void vp9_update_mode_info_border(VP9_COMMON *cm, MODE_INFO *mi);
void vp9_update_mode_info_in_image(VP9_COMMON *cm, MODE_INFO *mi);
void vp9_create_common(VP9_COMMON *oci);
void vp9_remove_common(VP9_COMMON *oci);
void vp9_create_common(VP9_COMMON *cm);
void vp9_remove_common(VP9_COMMON *cm);
int vp9_alloc_frame_buffers(VP9_COMMON *oci, int width, int height);
void vp9_free_frame_buffers(VP9_COMMON *oci);
int vp9_alloc_frame_buffers(VP9_COMMON *cm, int width, int height);
void vp9_free_frame_buffers(VP9_COMMON *cm);
void vp9_update_frame_size(VP9_COMMON *cm);
......
......@@ -22,17 +22,17 @@ 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 *common, FILE *file, char *descriptor,
static void print_mi_data(VP9_COMMON *cm, FILE *file, char *descriptor,
size_t member_offset) {
int mi_row;
int mi_col;
int mi_index = 0;
MODE_INFO *mi = common->mi;
int rows = common->mi_rows;
int cols = common->mi_cols;
MODE_INFO *mi = cm->mi;
int rows = cm->mi_rows;
int cols = cm->mi_cols;
char prefix = descriptor[0];
log_frame_info(common, descriptor, file);
log_frame_info(cm, descriptor, file);
mi_index = 0;
for (mi_row = 0; mi_row < rows; mi_row++) {
fprintf(file, "%c ", prefix);
......
......@@ -436,11 +436,11 @@ const vp9_extra_bit vp9_extra_bits[12] = {
#include "vp9/common/vp9_default_coef_probs.h"
void vp9_default_coef_probs(VP9_COMMON *pc) {
vp9_copy(pc->fc.coef_probs[TX_4X4], default_coef_probs_4x4);
vp9_copy(pc->fc.coef_probs[TX_8X8], default_coef_probs_8x8);
vp9_copy(pc->fc.coef_probs[TX_16X16], default_coef_probs_16x16);
vp9_copy(pc->fc.coef_probs[TX_32X32], default_coef_probs_32x32);
void vp9_default_coef_probs(VP9_COMMON *cm) {
vp9_copy(cm->fc.coef_probs[TX_4X4], default_coef_probs_4x4);
vp9_copy(cm->fc.coef_probs[TX_8X8], default_coef_probs_8x8);
vp9_copy(cm->fc.coef_probs[TX_16X16], default_coef_probs_16x16);
vp9_copy(cm->fc.coef_probs[TX_32X32], default_coef_probs_32x32);
}
// Neighborhood 5-tuples for various scans and blocksizes,
......
......@@ -95,7 +95,7 @@ typedef vp9_prob vp9_coeff_probs[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
#define MODULUS_PARAM 13 /* Modulus parameter */
struct VP9Common;
void vp9_default_coef_probs(struct VP9Common *);
void vp9_default_coef_probs(struct VP9Common *cm);
extern DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_4x4[16]);
extern DECLARE_ALIGNED(16, const int16_t, vp9_col_scan_4x4[16]);
......@@ -154,7 +154,7 @@ extern DECLARE_ALIGNED(16, int16_t,
vp9_default_scan_32x32_neighbors[1025 * MAX_NEIGHBORS]);
void vp9_coef_tree_initialize(void);
void vp9_adapt_coef_probs(struct VP9Common *);
void vp9_adapt_coef_probs(struct VP9Common *cm);
static INLINE void reset_skip_context(MACROBLOCKD *xd, BLOCK_SIZE bsize) {
int i;
......
......@@ -58,9 +58,9 @@ void vp9_entropy_mode_init();
void vp9_setup_past_independence(struct VP9Common *cm);
void vp9_init_mbmode_probs(struct VP9Common *x);
void vp9_init_mbmode_probs(struct VP9Common *cm);
void vp9_adapt_mode_probs(struct VP9Common *);
void vp9_adapt_mode_probs(struct VP9Common *cm);
void tx_counts_to_branch_counts_32x32(unsigned int *tx_count_32x32p,
unsigned int (*ct_32x32p)[2]);
......
......@@ -36,7 +36,7 @@ static void clamp_mv2(MV *mv, const MACROBLOCKD *xd) {
xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN);
}
void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *pc,
void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm,
MACROBLOCKD *xd,
int_mv *dst_nearest,
int_mv *dst_near,
......
......@@ -630,21 +630,21 @@ static void constrain_line(int x0, int *x1, int y0, int *y1,
}
}
int vp9_post_proc_frame(struct VP9Common *oci,
int vp9_post_proc_frame(struct VP9Common *cm,
YV12_BUFFER_CONFIG *dest, vp9_ppflags_t *ppflags) {
int q = oci->lf.filter_level * 10 / 6;
int q = cm->lf.filter_level * 10 / 6;
int flags = ppflags->post_proc_flag;
int deblock_level = ppflags->deblocking_level;
int noise_level = ppflags->noise_level;
if (!oci->frame_to_show)
if (!cm->frame_to_show)
return -1;
if (q > 63)
q = 63;
if (!flags) {
*dest = *oci->frame_to_show;
*dest = *cm->frame_to_show;
return 0;
}
......@@ -653,52 +653,52 @@ int vp9_post_proc_frame(struct VP9Common *oci,
#endif
if (flags & VP9D_DEMACROBLOCK) {
deblock_and_de_macro_block(oci->frame_to_show, &oci->post_proc_buffer,
deblock_and_de_macro_block(cm->frame_to_show, &cm->post_proc_buffer,
q + (deblock_level - 5) * 10, 1, 0);
} else if (flags & VP9D_DEBLOCK) {
vp9_deblock(oci->frame_to_show, &oci->post_proc_buffer, q);
vp9_deblock(cm->frame_to_show, &cm->post_proc_buffer, q);
} else {
vp8_yv12_copy_frame(oci->frame_to_show, &oci->post_proc_buffer);
vp8_yv12_copy_frame(cm->frame_to_show, &cm->post_proc_buffer);
}
if (flags & VP9D_ADDNOISE) {
if (oci->postproc_state.last_q != q
|| oci->postproc_state.last_noise != noise_level) {
fillrd(&oci->postproc_state, 63 - q, noise_level);
if (cm->postproc_state.last_q != q
|| cm->postproc_state.last_noise != noise_level) {
fillrd(&cm->postproc_state, 63 - q, noise_level);
}
vp9_plane_add_noise(oci->post_proc_buffer.y_buffer,
oci->postproc_state.noise,
oci->postproc_state.blackclamp,
oci->postproc_state.whiteclamp,
oci->postproc_state.bothclamp,
oci->post_proc_buffer.y_width,
oci->post_proc_buffer.y_height,
oci->post_proc_buffer.y_stride);
vp9_plane_add_noise(cm->post_proc_buffer.y_buffer,
cm->postproc_state.noise,
cm->postproc_state.blackclamp,
cm->postproc_state.whiteclamp,
cm->postproc_state.bothclamp,
cm->post_proc_buffer.y_width,
cm->post_proc_buffer.y_height,
cm->post_proc_buffer.y_stride);
}
#if 0 && CONFIG_POSTPROC_VISUALIZER
if (flags & VP9D_DEBUG_TXT_FRAME_INFO) {
char message[512];
sprintf(message, "F%1dG%1dQ%3dF%3dP%d_s%dx%d",
(oci->frame_type == KEY_FRAME),
oci->refresh_golden_frame,
oci->base_qindex,
oci->filter_level,
(cm->frame_type == KEY_FRAME),
cm->refresh_golden_frame,
cm->base_qindex,
cm->filter_level,
flags,
oci->mb_cols, oci->mb_rows);
vp9_blit_text(message, oci->post_proc_buffer.y_buffer,
oci->post_proc_buffer.y_stride);
cm->mb_cols, cm->mb_rows);
vp9_blit_text(message, cm->post_proc_buffer.y_buffer,
cm->post_proc_buffer.y_stride);
}
if (flags & VP9D_DEBUG_TXT_MBLK_MODES) {
int i, j;
uint8_t *y_ptr;
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
YV12_BUFFER_CONFIG *post = &cm->post_proc_buffer;
int mb_rows = post->y_height >> 4;
int mb_cols = post->y_width >> 4;
int mb_index = 0;
MODE_INFO *mi = oci->mi;
MODE_INFO *mi = cm->mi;
y_ptr = post->y_buffer + 4 * post->y_stride + 4;
......@@ -723,11 +723,11 @@ int vp9_post_proc_frame(struct VP9Common *oci,
if (flags & VP9D_DEBUG_TXT_DC_DIFF) {
int i, j;
uint8_t *y_ptr;
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
YV12_BUFFER_CONFIG *post = &cm->post_proc_buffer;
int mb_rows = post->y_height >> 4;
int mb_cols = post->y_width >> 4;
int mb_index = 0;
MODE_INFO *mi = oci->mi;
MODE_INFO *mi = cm->mi;
y_ptr = post->y_buffer + 4 * post->y_stride + 4;
......@@ -739,7 +739,7 @@ int vp9_post_proc_frame(struct VP9Common *oci,
mi[mb_index].mbmi.mode != SPLITMV &&
mi[mb_index].mbmi.skip_coeff);
if (oci->frame_type == KEY_FRAME)
if (cm->frame_type == KEY_FRAME)
sprintf(zz, "a");
else
sprintf(zz, "%c", dc_diff + '0');
......@@ -759,19 +759,19 @@ int vp9_post_proc_frame(struct VP9Common *oci,
char message[512];
snprintf(message, sizeof(message),
"Bitrate: %10.2f framerate: %10.2f ",
oci->bitrate, oci->framerate);
vp9_blit_text(message, oci->post_proc_buffer.y_buffer,
oci->post_proc_buffer.y_stride);
cm->bitrate, cm->framerate);
vp9_blit_text(message, cm->post_proc_buffer.y_buffer,
cm->post_proc_buffer.y_stride);
}
/* Draw motion vectors */
if ((flags & VP9D_DEBUG_DRAW_MV) && ppflags->display_mv_flag) {
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
YV12_BUFFER_CONFIG *post = &cm->post_proc_buffer;
int width = post->y_width;
int height = post->y_height;
uint8_t *y_buffer = oci->post_proc_buffer.y_buffer;
int y_stride = oci->post_proc_buffer.y_stride;
MODE_INFO *mi = oci->mi;
uint8_t *y_buffer = cm->post_proc_buffer.y_buffer;
int y_stride = cm->post_proc_buffer.y_stride;
MODE_INFO *mi = cm->mi;
int x0, y0;
for (y0 = 0; y0 < height; y0 += 16) {
......@@ -908,14 +908,14 @@ int vp9_post_proc_frame(struct VP9Common *oci,
if ((flags & VP9D_DEBUG_CLR_BLK_MODES)
&& (ppflags->display_mb_modes_flag || ppflags->display_b_modes_flag)) {
int y, x;
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
YV12_BUFFER_CONFIG *post = &cm->post_proc_buffer;
int width = post->y_width;
int height = post->y_height;
uint8_t *y_ptr = oci->post_proc_buffer.y_buffer;
uint8_t *u_ptr = oci->post_proc_buffer.u_buffer;
uint8_t *v_ptr = oci->post_proc_buffer.v_buffer;
int y_stride = oci->post_proc_buffer.y_stride;
MODE_INFO *mi = oci->mi;
uint8_t *y_ptr = cm->post_proc_buffer.y_buffer;
uint8_t *u_ptr = cm->post_proc_buffer.u_buffer;
uint8_t *v_ptr = cm->post_proc_buffer.v_buffer;
int y_stride = cm->post_proc_buffer.y_stride;
MODE_INFO *mi = cm->mi;
for (y = 0; y < height; y += 16) {
for (x = 0; x < width; x += 16) {
......@@ -973,14 +973,14 @@ int vp9_post_proc_frame(struct VP9Common *oci,
if ((flags & VP9D_DEBUG_CLR_FRM_REF_BLKS) &&
ppflags->display_ref_frame_flag) {
int y, x;
YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer;
YV12_BUFFER_CONFIG *post = &cm->post_proc_buffer;
int width = post->y_width;
int height = post->y_height;
uint8_t *y_ptr = oci->post_proc_buffer.y_buffer;
uint8_t *u_ptr = oci->post_proc_buffer.u_buffer;
uint8_t *v_ptr = oci->post_proc_buffer.v_buffer;
int y_stride = oci->post_proc_buffer.y_stride;
MODE_INFO *mi = oci->mi;
uint8_t *y_ptr = cm->post_proc_buffer.y_buffer;
uint8_t *u_ptr = cm->post_proc_buffer.u_buffer;
uint8_t *v_ptr = cm->post_proc_buffer.v_buffer;
int y_stride = cm->post_proc_buffer.y_stride;
MODE_INFO *mi = cm->mi;
for (y = 0; y < height; y += 16) {
for (x = 0; x < width; x += 16) {
......@@ -1006,11 +1006,11 @@ int vp9_post_proc_frame(struct VP9Common *oci,
}
#endif
*dest = oci->post_proc_buffer;
*dest = cm->post_proc_buffer;
/* handle problem with extending borders */
dest->y_width = oci->width;
dest->y_height = oci->height;
dest->y_width = cm->width;
dest->y_height = cm->height;
dest->uv_height = dest->y_height / 2;
return 0;
......
......@@ -26,7 +26,7 @@ struct postproc_state {
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_ppflags.h"
int vp9_post_proc_frame(struct VP9Common *oci,
int vp9_post_proc_frame(struct VP9Common *cm,
YV12_BUFFER_CONFIG *dest, vp9_ppflags_t *flags);
void vp9_denoise(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, int q);
......
......@@ -34,6 +34,6 @@ static int round(double x) {
#endif
struct VP9Common;
void vp9_machine_specific_config(struct VP9Common *);
void vp9_machine_specific_config(struct VP9Common *cm);
#endif // VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
......@@ -255,13 +255,13 @@ static void decode_modes_b(VP9D_COMP *pbi, int mi_row, int mi_col,
static void decode_modes_sb(VP9D_COMP *pbi, int mi_row, int mi_col,
vp9_reader* r, BLOCK_SIZE bsize) {
VP9_COMMON *const pc = &pbi->common;
VP9_COMMON *const cm = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
const int hbs = num_8x8_blocks_wide_lookup[bsize] / 2;
PARTITION_TYPE partition = PARTITION_NONE;
BLOCK_SIZE subsize;
if (mi_row >= pc->mi_rows || mi_col >= pc->mi_cols)
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
return;
if (bsize < BLOCK_8X8) {
......@@ -269,21 +269,21 @@ static void decode_modes_sb(VP9D_COMP *pbi, int mi_row, int mi_col,
return;
} else {
int pl;
const int idx = check_bsize_coverage(hbs, pc->mi_rows, pc->mi_cols,
const int idx = check_bsize_coverage(hbs, cm->mi_rows, cm->mi_cols,
mi_row, mi_col);
set_partition_seg_context(pc, xd, mi_row, mi_col);
set_partition_seg_context(cm, xd, mi_row, mi_col);
pl = partition_plane_context(xd, bsize);
if (idx == 0)
partition = treed_read(r, vp9_partition_tree,
pc->fc.partition_prob[pc->frame_type][pl]);
cm->fc.partition_prob[cm->frame_type][pl]);
else if (idx > 0 &&
!vp9_read(r, pc->fc.partition_prob[pc->frame_type][pl][idx]))
!vp9_read(r, cm->fc.partition_prob[cm->frame_type][pl][idx]))
partition = (idx == 1) ? PARTITION_HORZ : PARTITION_VERT;
else
partition = PARTITION_SPLIT;
pc->counts.partition[pl][partition]++;
cm->counts.partition[pl][partition]++;
}
subsize = get_subsize(bsize, partition);
......@@ -296,13 +296,13 @@ static void decode_modes_sb(VP9D_COMP *pbi, int mi_row, int mi_col,
case PARTITION_HORZ:
decode_modes_b(pbi, mi_row, mi_col, r, subsize);
*get_sb_index(xd, subsize) = 1;
if (mi_row + hbs < pc->mi_rows)
if (mi_row + hbs < cm->mi_rows)
decode_modes_b(pbi, mi_row + hbs, mi_col, r, subsize);
break;
case PARTITION_VERT:
decode_modes_b(pbi, mi_row, mi_col, r, subsize);
*get_sb_index(xd, subsize) = 1;
if (mi_col + hbs < pc->mi_cols)
if (mi_col + hbs < cm->mi_cols)
decode_modes_b(pbi, mi_row, mi_col + hbs, r, subsize);
break;
case PARTITION_SPLIT: {
......@@ -320,7 +320,7 @@ static void decode_modes_sb(VP9D_COMP *pbi, int mi_row, int mi_col,
// update partition context
if (bsize >= BLOCK_8X8 &&
(bsize == BLOCK_8X8 || partition != PARTITION_SPLIT)) {
set_partition_seg_context(pc, xd, mi_row, mi_col);
set_partition_seg_context(cm, xd, mi_row, mi_col);
update_partition_context(xd, subsize, bsize);
}
}
......@@ -328,18 +328,18 @@ static void decode_modes_sb(VP9D_COMP *pbi, int mi_row, int mi_col,
static void setup_token_decoder(VP9D_COMP *pbi,
const uint8_t *data, size_t read_size,
vp9_reader *r) {
VP9_COMMON *pc = &pbi->common;
VP9_COMMON *cm = &pbi->common;
const uint8_t *data_end = pbi->source + pbi->source_sz;
// Validate the calculated partition length. If the buffer
// described by the partition can't be fully read, then restrict
// it to the portion that can be (for EC mode) or throw an error.
if (!read_is_valid(data, read_size, data_end))
vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
"Truncated packet or corrupt tile length");
if (vp9_reader_init(r, data, read_size))
vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to allocate bool decoder %d", 1);
}
......@@ -571,28 +571,28 @@ static void setup_frame_size_with_refs(VP9D_COMP *pbi,
static void decode_tile(VP9D_COMP *pbi, vp9_reader *r) {
const int num_threads = pbi->oxcf.max_threads;
VP9_COMMON *const pc = &pbi->common;