}
}
}
+ if( h->sh.i_type == SLICE_TYPE_P )
+ memset( h->mb.cache.skip, 0, X264_SCAN8_SIZE * sizeof( int8_t ) );
}
}
/* load skip */
- if( h->param.b_cabac )
+ if( h->sh.i_type == SLICE_TYPE_B && h->param.b_cabac )
{
- if( h->sh.i_type == SLICE_TYPE_B )
+ memset( h->mb.cache.skip, 0, X264_SCAN8_SIZE * sizeof( int8_t ) );
+ if( i_left_xy >= 0 )
{
- memset( h->mb.cache.skip, 0, X264_SCAN8_SIZE * sizeof( int8_t ) );
- if( i_left_xy >= 0 )
- {
- h->mb.cache.skip[x264_scan8[0] - 1] = h->mb.skipbp[i_left_xy] & 0x2;
- h->mb.cache.skip[x264_scan8[8] - 1] = h->mb.skipbp[i_left_xy] & 0x8;
- }
- if( i_top_xy >= 0 )
- {
- h->mb.cache.skip[x264_scan8[0] - 8] = h->mb.skipbp[i_top_xy] & 0x4;
- h->mb.cache.skip[x264_scan8[4] - 8] = h->mb.skipbp[i_top_xy] & 0x8;
- }
+ h->mb.cache.skip[x264_scan8[0] - 1] = h->mb.skipbp[i_left_xy] & 0x2;
+ h->mb.cache.skip[x264_scan8[8] - 1] = h->mb.skipbp[i_left_xy] & 0x8;
}
- else if( h->mb.i_mb_xy == 0 && h->sh.i_type == SLICE_TYPE_P )
+ if( i_top_xy >= 0 )
{
- memset( h->mb.cache.skip, 0, X264_SCAN8_SIZE * sizeof( int8_t ) );
+ h->mb.cache.skip[x264_scan8[0] - 8] = h->mb.skipbp[i_top_xy] & 0x4;
+ h->mb.cache.skip[x264_scan8[4] - 8] = h->mb.skipbp[i_top_xy] & 0x8;
}
}
}
h->mb.i_last_qp = h->pps->i_pic_init_qp + h->sh.i_qp_delta;
h->mb.i_last_dqp = 0;
-#if VISUALIZE
- if( h->param.b_visualize )
- x264_visualize_init( h );
-#endif
-
for( mb_xy = h->sh.i_first_mb, i_skip = 0; mb_xy < h->sh.i_last_mb; mb_xy++ )
{
const int i_mb_y = mb_xy / h->sps->i_mb_width;
x264_nal_end( h );
-#if VISUALIZE
- if( h->param.b_visualize )
- {
- x264_visualize_show( h );
- x264_visualize_close( h );
- }
-#endif
-
/* Compute misc bits */
h->stat.frame.i_misc_bits = bs_pos( &h->out.bs )
+ NALU_OVERHEAD * 8
static inline int x264_slices_write( x264_t *h )
{
+ int i_frame_size;
+
+#if VISUALIZE
+ if( h->param.b_visualize )
+ x264_visualize_init( h );
+#endif
+
if( h->param.i_threads == 1 )
{
x264_slice_write( h );
- return h->out.nal[h->out.i_nal-1].i_payload;
+ i_frame_size = h->out.nal[h->out.i_nal-1].i_payload;
}
else
{
int i_nal = h->out.i_nal;
int i_bs_size = h->out.i_bitstream / h->param.i_threads;
- int i_frame_size;
int i;
/* duplicate contexts */
for( i = 0; i < h->param.i_threads; i++ )
((int*)&h->stat.frame)[j] += ((int*)&t->stat.frame)[j];
}
h->out.i_nal = i_nal + h->param.i_threads;
- return i_frame_size;
}
+
+#if VISUALIZE
+ if( h->param.b_visualize )
+ {
+ x264_visualize_show( h );
+ x264_visualize_close( h );
+ }
+#endif
+
+ return i_frame_size;
}
/****************************************************************************