unsigned int i_neighbour_intra; /* for constrained intra pred */
unsigned int i_neighbour_frame; /* ignoring slice boundaries */
int i_mb_type_top;
- int i_mb_type_left;
+ int i_mb_type_left[2];
int i_mb_type_topleft;
int i_mb_type_topright;
int i_mb_prev_xy;
- int i_mb_left_xy;
+ int i_mb_left_xy[2];
int i_mb_top_xy;
int i_mb_topleft_xy;
int i_mb_topright_xy;
if( h->mb.i_neighbour & MB_LEFT )
{
- int qpl = h->mb.qp[h->mb.i_mb_left_xy];
+ int qpl = h->mb.qp[h->mb.i_mb_left_xy[0]];
int qp_left = (qp + qpl + 1) >> 1;
int qpc_left = (h->chroma_qp_table[qp] + h->chroma_qp_table[qpl] + 1) >> 1;
- int intra_left = IS_INTRA( h->mb.type[h->mb.i_mb_left_xy] );
+ int intra_left = IS_INTRA( h->mb.type[h->mb.i_mb_left_xy[0]] );
if( intra_cur || intra_left )
FILTER( _intra, 0, 0, qp_left, qpc_left );
else
h->mb.i_neighbour_intra = 0;
h->mb.i_neighbour_frame = 0;
h->mb.i_mb_top_xy = -1;
- h->mb.i_mb_left_xy = -1;
+ h->mb.i_mb_left_xy[0] = h->mb.i_mb_left_xy[1] = -1;
h->mb.i_mb_topleft_xy = -1;
h->mb.i_mb_topright_xy = -1;
h->mb.i_mb_type_top = -1;
- h->mb.i_mb_type_left = -1;
+ h->mb.i_mb_type_left[0] = h->mb.i_mb_type_left[1] = -1;
h->mb.i_mb_type_topleft = -1;
h->mb.i_mb_type_topright = -1;
h->mb.left_index_table = &left_indices[3];
if( mb_x > 0 )
{
h->mb.i_neighbour_frame |= MB_LEFT;
- h->mb.i_mb_left_xy = h->mb.i_mb_xy - 1;
- h->mb.i_mb_type_left = h->mb.type[h->mb.i_mb_left_xy];
+ h->mb.i_mb_left_xy[0] = h->mb.i_mb_xy - 1;
+ h->mb.i_mb_type_left[0] = h->mb.type[h->mb.i_mb_left_xy[0]];
if( h->mb.i_mb_xy > h->sh.i_first_mb )
{
h->mb.i_neighbour |= MB_LEFT;
- if( !h->param.b_constrained_intra || IS_INTRA( h->mb.i_mb_type_left ) )
+ if( !h->param.b_constrained_intra || IS_INTRA( h->mb.i_mb_type_left[0] ) )
h->mb.i_neighbour_intra |= MB_LEFT;
}
}
{
x264_macroblock_cache_load_neighbours( h, mb_x, mb_y );
- int left = h->mb.i_mb_left_xy;
+ int left = h->mb.i_mb_left_xy[0];
int top = h->mb.i_mb_top_xy;
int top_y = mb_y - (1 << h->mb.b_interlaced);
int s8x8 = h->mb.i_b8_stride;
if( mb_x > 0 )
{
- h->mb.i_mb_left_xy = h->mb.i_mb_xy - 1;
- if( deblock_on_slice_edges || h->mb.slice_table[h->mb.i_mb_left_xy] == h->mb.slice_table[h->mb.i_mb_xy] )
+ h->mb.i_mb_left_xy[0] = h->mb.i_mb_xy - 1;
+ if( deblock_on_slice_edges || h->mb.slice_table[h->mb.i_mb_left_xy[0]] == h->mb.slice_table[h->mb.i_mb_xy] )
h->mb.i_neighbour |= MB_LEFT;
}
if( h->mb.i_neighbour & MB_LEFT )
{
- int left = h->mb.i_mb_left_xy;
+ int left = h->mb.i_mb_left_xy[0];
h->mb.cache.non_zero_count[x264_scan8[0 ] - 1] = nnz[left][left_index_table->nnz[0]];
h->mb.cache.non_zero_count[x264_scan8[2 ] - 1] = nnz[left][left_index_table->nnz[1]];
h->mb.cache.non_zero_count[x264_scan8[8 ] - 1] = nnz[left][left_index_table->nnz[2]];
{
uint8_t (*nnz)[24] = h->mb.non_zero_count;
int top = h->mb.i_mb_top_xy;
- int left = h->mb.i_mb_left_xy;
+ int left = h->mb.i_mb_left_xy[0];
if( (h->mb.i_neighbour & MB_TOP) && h->mb.mb_transform_size[top] )
{
}
/* spatial predictors */
- SET_MVP( mvr[h->mb.i_mb_left_xy] );
+ SET_MVP( mvr[h->mb.i_mb_left_xy[0]] );
SET_MVP( mvr[h->mb.i_mb_top_xy] );
SET_MVP( mvr[h->mb.i_mb_topleft_xy] );
SET_MVP( mvr[h->mb.i_mb_topright_xy] );
{
/* Always run in fast-intra mode for subme < 3 */
if( h->mb.i_subpel_refine > 2 &&
- ( IS_INTRA( h->mb.i_mb_type_left ) ||
+ ( IS_INTRA( h->mb.i_mb_type_left[0] ) ||
IS_INTRA( h->mb.i_mb_type_top ) ||
IS_INTRA( h->mb.i_mb_type_topleft ) ||
IS_INTRA( h->mb.i_mb_type_topright ) ||
/* early termination: if 16x16 chose ref 0, then evalute no refs older
* than those used by the neighbors */
if( i_maxref > 0 && (a->l0.me16x16.i_ref == 0 || a->l0.me16x16.i_ref == h->mb.ref_blind_dupe) &&
- h->mb.i_mb_type_top > 0 && h->mb.i_mb_type_left > 0 )
+ h->mb.i_mb_type_top > 0 && h->mb.i_mb_type_left[0] > 0 )
{
i_maxref = 0;
CHECK_NEIGHBOUR( -8 - 1 );
{
x264_mb_analysis_list_t *lX = l ? &a->l1 : &a->l0;
if( i_maxref[l] > 0 && lX->me16x16.i_ref == 0 &&
- h->mb.i_mb_type_top > 0 && h->mb.i_mb_type_left > 0 )
+ h->mb.i_mb_type_top > 0 && h->mb.i_mb_type_left[0] > 0 )
{
i_maxref[l] = 0;
CHECK_NEIGHBOUR( -8 - 1 );
{}
else if( h->param.analyse.i_subpel_refine >= 3 )
analysis.b_try_skip = 1;
- else if( h->mb.i_mb_type_left == P_SKIP ||
+ else if( h->mb.i_mb_type_left[0] == P_SKIP ||
h->mb.i_mb_type_top == P_SKIP ||
h->mb.i_mb_type_topleft == P_SKIP ||
h->mb.i_mb_type_topright == P_SKIP )
if( h->sh.i_type == SLICE_TYPE_I )
{
int ctx = 0;
- if( (h->mb.i_neighbour & MB_LEFT) && h->mb.i_mb_type_left != I_4x4 )
+ if( (h->mb.i_neighbour & MB_LEFT) && h->mb.i_mb_type_left[0] != I_4x4 )
ctx++;
if( (h->mb.i_neighbour & MB_TOP) && h->mb.i_mb_type_top != I_4x4 )
ctx++;
else //if( h->sh.i_type == SLICE_TYPE_B )
{
int ctx = 0;
- if( (h->mb.i_neighbour & MB_LEFT) && h->mb.i_mb_type_left != B_SKIP && h->mb.i_mb_type_left != B_DIRECT )
+ if( (h->mb.i_neighbour & MB_LEFT) && h->mb.i_mb_type_left[0] != B_SKIP && h->mb.i_mb_type_left[0] != B_DIRECT )
ctx++;
if( (h->mb.i_neighbour & MB_TOP) && h->mb.i_mb_type_top != B_SKIP && h->mb.i_mb_type_top != B_DIRECT )
ctx++;
int ctx = 0;
/* No need to test for I4x4 or I_16x16 as cache_save handle that */
- if( (h->mb.i_neighbour & MB_LEFT) && h->mb.chroma_pred_mode[h->mb.i_mb_left_xy] != 0 )
+ if( (h->mb.i_neighbour & MB_LEFT) && h->mb.chroma_pred_mode[h->mb.i_mb_left_xy[0]] != 0 )
ctx++;
if( (h->mb.i_neighbour & MB_TOP) && h->mb.chroma_pred_mode[h->mb.i_mb_top_xy] != 0 )
ctx++;
#if !RDO_SKIP_BS
void x264_cabac_mb_skip( x264_t *h, int b_skip )
{
- int ctx = ((h->mb.i_neighbour & MB_LEFT) && !IS_SKIP( h->mb.i_mb_type_left ))
+ int ctx = ((h->mb.i_neighbour & MB_LEFT) && !IS_SKIP( h->mb.i_mb_type_left[0] ))
+ ((h->mb.i_neighbour & MB_TOP) && !IS_SKIP( h->mb.i_mb_type_top ))
+ (h->sh.i_type == SLICE_TYPE_P ? 11 : 24);
x264_cabac_encode_decision( &h->cabac, ctx, b_skip );