static void predict_4x4_mode_available( unsigned int i_neighbour,
int *mode, int *pi_count )
{
- /* FIXME even when b_tr == 0 there is some case where missing pixels
- * are emulated and thus more mode are available TODO
- * analysis and encode should be fixed too */
int b_l = i_neighbour & MB_LEFT;
int b_t = i_neighbour & MB_TOP;
- int b_tr = i_neighbour & MB_TOPRIGHT;
if( b_l && b_t )
{
*mode++ = I_PRED_4x4_DC;
*mode++ = I_PRED_4x4_H;
*mode++ = I_PRED_4x4_V;
+ *mode++ = I_PRED_4x4_DDL;
*mode++ = I_PRED_4x4_DDR;
*mode++ = I_PRED_4x4_VR;
*mode++ = I_PRED_4x4_HD;
+ *mode++ = I_PRED_4x4_VL;
*mode++ = I_PRED_4x4_HU;
- *pi_count = 7;
+ *pi_count = 9;
}
else if( b_l )
{
{
*mode++ = I_PRED_4x4_DC_TOP;
*mode++ = I_PRED_4x4_V;
- *pi_count = 2;
+ *mode++ = I_PRED_4x4_DDL;
+ *mode++ = I_PRED_4x4_VL;
+ *pi_count = 4;
}
else
{
*mode++ = I_PRED_4x4_DC_128;
*pi_count = 1;
}
-
- if( b_t && b_tr )
- {
- *mode++ = I_PRED_4x4_DDL;
- *mode++ = I_PRED_4x4_VL;
- (*pi_count) += 2;
- }
}
static void x264_mb_analyse_intra_chroma( x264_t *h, x264_mb_analysis_t *a )
i_best = COST_MAX;
predict_4x4_mode_available( h->mb.i_neighbour4[idx], predict_mode, &i_max );
+
+ if( (h->mb.i_neighbour4[i] & (MB_TOPRIGHT|MB_TOP)) == MB_TOP )
+ /* emulate missing topright samples */
+ *(uint32_t*) &p_dst_by[4 - i_stride] = p_dst_by[3 - i_stride] * 0x01010101U;
+
for( i = 0; i < i_max; i++ )
{
int i_sad;
uint8_t *p_dst = &h->mb.pic.p_fdec[0][4 * block_idx_x[i] + 4 * block_idx_y[i] * i_dst];
int i_mode = h->mb.cache.intra4x4_pred_mode[x264_scan8[i]];
+ if( (h->mb.i_neighbour4[i] & (MB_TOPRIGHT|MB_TOP)) == MB_TOP )
+ /* emulate missing topright samples */
+ *(uint32_t*) &p_dst[4 - i_dst] = p_dst[3 - i_dst] * 0x01010101U;
+
h->predict_4x4[i_mode]( p_dst, i_dst );
x264_mb_encode_i4x4( h, i, i_qp );
h->mb.cache.intra4x4_pred_mode[x264_scan8[i]] = x264_mb_pred_mode4x4_fix(i_mode);