Commit b1e607e1 authored by Fiona Glaser's avatar Fiona Glaser

Fix regression in r1450

I_PCM blocks would cause x264 to crash or generate bad output. Simplify PCM handling.
parent 5f77d1c4
......@@ -785,11 +785,6 @@ void x264_macroblock_write_cabac( x264_t *h, x264_cabac_t *cb )
cb->i_queue = -1;
cb->i_bytes_outstanding = 0;
/* if PCM is chosen, we need to store reconstructed frame data */
h->mc.copy[PIXEL_16x16]( h->mb.pic.p_fdec[0], FDEC_STRIDE, h->mb.pic.p_fenc[0], FENC_STRIDE, 16 );
h->mc.copy[PIXEL_8x8] ( h->mb.pic.p_fdec[1], FDEC_STRIDE, h->mb.pic.p_fenc[1], FENC_STRIDE, 8 );
h->mc.copy[PIXEL_8x8] ( h->mb.pic.p_fdec[2], FDEC_STRIDE, h->mb.pic.p_fenc[2], FENC_STRIDE, 8 );
h->stat.frame.i_tex_bits += x264_cabac_pos( cb ) - i_mb_pos_tex;
return;
}
......
......@@ -323,11 +323,6 @@ void x264_macroblock_write_cavlc( x264_t *h )
bs_init( s, s->p, s->p_end - s->p );
s->p_start = p_start;
/* if PCM is chosen, we need to store reconstructed frame data */
h->mc.copy[PIXEL_16x16]( h->mb.pic.p_fdec[0], FDEC_STRIDE, h->mb.pic.p_fenc[0], FENC_STRIDE, 16 );
h->mc.copy[PIXEL_8x8] ( h->mb.pic.p_fdec[1], FDEC_STRIDE, h->mb.pic.p_fenc[1], FENC_STRIDE, 8 );
h->mc.copy[PIXEL_8x8] ( h->mb.pic.p_fdec[2], FDEC_STRIDE, h->mb.pic.p_fenc[2], FENC_STRIDE, 8 );
h->stat.frame.i_tex_bits += bs_pos(s) - i_mb_pos_tex;
return;
}
......
......@@ -593,6 +593,15 @@ void x264_macroblock_encode( x264_t *h )
h->mb.i_cbp_luma = 0;
h->mb.cache.non_zero_count[x264_scan8[24]] = 0;
if( h->mb.i_type == I_PCM )
{
/* if PCM is chosen, we need to store reconstructed frame data */
h->mc.copy[PIXEL_16x16]( h->mb.pic.p_fdec[0], FDEC_STRIDE, h->mb.pic.p_fenc[0], FENC_STRIDE, 16 );
h->mc.copy[PIXEL_8x8] ( h->mb.pic.p_fdec[1], FDEC_STRIDE, h->mb.pic.p_fenc[1], FENC_STRIDE, 8 );
h->mc.copy[PIXEL_8x8] ( h->mb.pic.p_fdec[2], FDEC_STRIDE, h->mb.pic.p_fenc[2], FENC_STRIDE, 8 );
return;
}
if( h->sh.b_mbaff
&& h->mb.i_mb_xy == h->sh.i_first_mb + h->mb.i_mb_stride
&& IS_SKIP(h->mb.type[h->sh.i_first_mb]) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment