| Index: source/libvpx/vp9/common/vp9_onyxc_int.h
 | 
| ===================================================================
 | 
| --- source/libvpx/vp9/common/vp9_onyxc_int.h	(revision 263011)
 | 
| +++ source/libvpx/vp9/common/vp9_onyxc_int.h	(working copy)
 | 
| @@ -48,43 +48,7 @@
 | 
|    PARTITION_CONTEXT left;
 | 
|  } partition_context_lookup[BLOCK_SIZES];
 | 
|  
 | 
| -typedef struct frame_contexts {
 | 
| -  vp9_prob y_mode_prob[BLOCK_SIZE_GROUPS][INTRA_MODES - 1];
 | 
| -  vp9_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
 | 
| -  vp9_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
 | 
| -  vp9_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES];
 | 
| -  vp9_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
 | 
| -                                 [SWITCHABLE_FILTERS - 1];
 | 
| -  vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1];
 | 
| -  vp9_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
 | 
| -  vp9_prob comp_inter_prob[COMP_INTER_CONTEXTS];
 | 
| -  vp9_prob single_ref_prob[REF_CONTEXTS][2];
 | 
| -  vp9_prob comp_ref_prob[REF_CONTEXTS];
 | 
| -  struct tx_probs tx_probs;
 | 
| -  vp9_prob skip_probs[SKIP_CONTEXTS];
 | 
| -  nmv_context nmvc;
 | 
| -} FRAME_CONTEXT;
 | 
|  
 | 
| -typedef struct {
 | 
| -  unsigned int y_mode[BLOCK_SIZE_GROUPS][INTRA_MODES];
 | 
| -  unsigned int uv_mode[INTRA_MODES][INTRA_MODES];
 | 
| -  unsigned int partition[PARTITION_CONTEXTS][PARTITION_TYPES];
 | 
| -  vp9_coeff_count_model coef[TX_SIZES][PLANE_TYPES];
 | 
| -  unsigned int eob_branch[TX_SIZES][PLANE_TYPES][REF_TYPES]
 | 
| -                         [COEF_BANDS][COEFF_CONTEXTS];
 | 
| -  unsigned int switchable_interp[SWITCHABLE_FILTER_CONTEXTS]
 | 
| -                                [SWITCHABLE_FILTERS];
 | 
| -  unsigned int inter_mode[INTER_MODE_CONTEXTS][INTER_MODES];
 | 
| -  unsigned int intra_inter[INTRA_INTER_CONTEXTS][2];
 | 
| -  unsigned int comp_inter[COMP_INTER_CONTEXTS][2];
 | 
| -  unsigned int single_ref[REF_CONTEXTS][2][2];
 | 
| -  unsigned int comp_ref[REF_CONTEXTS][2];
 | 
| -  struct tx_counts tx;
 | 
| -  unsigned int skip[SKIP_CONTEXTS][2];
 | 
| -  nmv_context_counts mv;
 | 
| -} FRAME_COUNTS;
 | 
| -
 | 
| -
 | 
|  typedef enum {
 | 
|    SINGLE_REFERENCE      = 0,
 | 
|    COMPOUND_REFERENCE    = 1,
 | 
| @@ -162,7 +126,7 @@
 | 
|    int MBs;
 | 
|    int mb_rows, mi_rows;
 | 
|    int mb_cols, mi_cols;
 | 
| -  int mode_info_stride;
 | 
| +  int mi_stride;
 | 
|  
 | 
|    /* profile settings */
 | 
|    TX_MODE tx_mode;
 | 
| @@ -215,8 +179,11 @@
 | 
|    FRAME_COUNTS counts;
 | 
|  
 | 
|    unsigned int current_video_frame;
 | 
| -  int version;
 | 
| +  BITSTREAM_PROFILE profile;
 | 
|  
 | 
| +  // BITS_8 in versions 0 and 1, BITS_10 or BITS_12 in version 2
 | 
| +  BIT_DEPTH bit_depth;
 | 
| +
 | 
|  #if CONFIG_VP9_POSTPROC
 | 
|    struct postproc_state  postproc_state;
 | 
|  #endif
 | 
| @@ -238,6 +205,9 @@
 | 
|  
 | 
|    // Handles memory for the codec.
 | 
|    InternalFrameBufferList int_frame_buffers;
 | 
| +
 | 
| +  PARTITION_CONTEXT *above_seg_context;
 | 
| +  ENTROPY_CONTEXT *above_context;
 | 
|  } VP9_COMMON;
 | 
|  
 | 
|  static INLINE YV12_BUFFER_CONFIG *get_frame_new_buffer(VP9_COMMON *cm) {
 | 
| @@ -270,23 +240,33 @@
 | 
|    return ALIGN_POWER_OF_TWO(n_mis, MI_BLOCK_SIZE_LOG2);
 | 
|  }
 | 
|  
 | 
| -static INLINE const vp9_prob* get_partition_probs(VP9_COMMON *cm, int ctx) {
 | 
| +static INLINE void init_macroblockd(VP9_COMMON *cm, MACROBLOCKD *xd) {
 | 
| +  int i;
 | 
| +
 | 
| +  for (i = 0; i < MAX_MB_PLANE; ++i) {
 | 
| +    xd->plane[i].dqcoeff = xd->dqcoeff[i];
 | 
| +    xd->above_context[i] = cm->above_context +
 | 
| +        i * sizeof(*cm->above_context) * 2 * mi_cols_aligned_to_sb(cm->mi_cols);
 | 
| +  }
 | 
| +
 | 
| +  xd->above_seg_context = cm->above_seg_context;
 | 
| +  xd->mi_stride = cm->mi_stride;
 | 
| +}
 | 
| +
 | 
| +static INLINE const vp9_prob* get_partition_probs(const VP9_COMMON *cm,
 | 
| +                                                  int ctx) {
 | 
|    return cm->frame_type == KEY_FRAME ? vp9_kf_partition_probs[ctx]
 | 
|                                       : cm->fc.partition_prob[ctx];
 | 
|  }
 | 
|  
 | 
| -static INLINE void set_skip_context(
 | 
| -    MACROBLOCKD *xd,
 | 
| -    ENTROPY_CONTEXT *above_context[MAX_MB_PLANE],
 | 
| -    ENTROPY_CONTEXT left_context[MAX_MB_PLANE][16],
 | 
| -    int mi_row, int mi_col) {
 | 
| +static INLINE void set_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col) {
 | 
|    const int above_idx = mi_col * 2;
 | 
|    const int left_idx = (mi_row * 2) & 15;
 | 
|    int i;
 | 
| -  for (i = 0; i < MAX_MB_PLANE; i++) {
 | 
| +  for (i = 0; i < MAX_MB_PLANE; ++i) {
 | 
|      struct macroblockd_plane *const pd = &xd->plane[i];
 | 
| -    pd->above_context = above_context[i] + (above_idx >> pd->subsampling_x);
 | 
| -    pd->left_context = left_context[i] + (left_idx >> pd->subsampling_y);
 | 
| +    pd->above_context = &xd->above_context[i][above_idx >> pd->subsampling_x];
 | 
| +    pd->left_context = &xd->left_context[i][left_idx >> pd->subsampling_y];
 | 
|    }
 | 
|  }
 | 
|  
 | 
| @@ -304,7 +284,7 @@
 | 
|    xd->left_available  = (mi_col > tile->mi_col_start);
 | 
|  }
 | 
|  
 | 
| -static void set_prev_mi(VP9_COMMON *cm) {
 | 
| +static INLINE void set_prev_mi(VP9_COMMON *cm) {
 | 
|    const int use_prev_in_find_mv_refs = cm->width == cm->last_width &&
 | 
|                                         cm->height == cm->last_height &&
 | 
|                                         !cm->intra_only &&
 | 
| @@ -312,19 +292,19 @@
 | 
|    // Special case: set prev_mi to NULL when the previous mode info
 | 
|    // context cannot be used.
 | 
|    cm->prev_mi = use_prev_in_find_mv_refs ?
 | 
| -                  cm->prev_mip + cm->mode_info_stride + 1 : NULL;
 | 
| +                  cm->prev_mip + cm->mi_stride + 1 : NULL;
 | 
|  }
 | 
|  
 | 
|  static INLINE int frame_is_intra_only(const VP9_COMMON *const cm) {
 | 
|    return cm->frame_type == KEY_FRAME || cm->intra_only;
 | 
|  }
 | 
|  
 | 
| -static INLINE void update_partition_context(
 | 
| -    PARTITION_CONTEXT *above_seg_context,
 | 
| -    PARTITION_CONTEXT left_seg_context[8],
 | 
| -    int mi_row, int mi_col, BLOCK_SIZE subsize, BLOCK_SIZE bsize) {
 | 
| -  PARTITION_CONTEXT *const above_ctx = above_seg_context + mi_col;
 | 
| -  PARTITION_CONTEXT *const left_ctx = left_seg_context + (mi_row & MI_MASK);
 | 
| +static INLINE void update_partition_context(MACROBLOCKD *xd,
 | 
| +                                            int mi_row, int mi_col,
 | 
| +                                            BLOCK_SIZE subsize,
 | 
| +                                            BLOCK_SIZE bsize) {
 | 
| +  PARTITION_CONTEXT *const above_ctx = xd->above_seg_context + mi_col;
 | 
| +  PARTITION_CONTEXT *const left_ctx = xd->left_seg_context + (mi_row & MI_MASK);
 | 
|  
 | 
|    // num_4x4_blocks_wide_lookup[bsize] / 2
 | 
|    const int bs = num_8x8_blocks_wide_lookup[bsize];
 | 
| @@ -336,12 +316,11 @@
 | 
|    vpx_memset(left_ctx, partition_context_lookup[subsize].left, bs);
 | 
|  }
 | 
|  
 | 
| -static INLINE int partition_plane_context(
 | 
| -    const PARTITION_CONTEXT *above_seg_context,
 | 
| -    const PARTITION_CONTEXT left_seg_context[8],
 | 
| -    int mi_row, int mi_col, BLOCK_SIZE bsize) {
 | 
| -  const PARTITION_CONTEXT *above_ctx = above_seg_context + mi_col;
 | 
| -  const PARTITION_CONTEXT *left_ctx = left_seg_context + (mi_row & MI_MASK);
 | 
| +static INLINE int partition_plane_context(const MACROBLOCKD *xd,
 | 
| +                                          int mi_row, int mi_col,
 | 
| +                                          BLOCK_SIZE bsize) {
 | 
| +  const PARTITION_CONTEXT *above_ctx = xd->above_seg_context + mi_col;
 | 
| +  const PARTITION_CONTEXT *left_ctx = xd->left_seg_context + (mi_row & MI_MASK);
 | 
|  
 | 
|    const int bsl = mi_width_log2(bsize);
 | 
|    const int bs = 1 << bsl;
 | 
| 
 |