fix for inter trellis quant, vbv_delay and mpeg1 run/level vlc escape
This commit is contained in:
parent
4a92a0c0a4
commit
df475dedd7
3 changed files with 9 additions and 7 deletions
|
@ -647,8 +647,9 @@ void y262_ratectrl_start_picture( y262_t *ps_y262, int32_t i_header_bits )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
i64_occupancy_ticks = ( ( ( ( int64_t ) 90000 ) * ( i_occupancy_bits + !!ps_ratectrl->i64_vbv_occupancy_fractional ) ) + ( ps_ratectrl->i_vbvrate - 1 ) ) / ps_ratectrl->i_vbvrate;
|
i64_occupancy_ticks = ( ( ( ( int64_t ) 90000 ) * ( i_occupancy_bits + !!ps_ratectrl->i64_vbv_occupancy_fractional ) ) + ( ps_ratectrl->i_vbvrate - 1 ) ) / ps_ratectrl->i_vbvrate;
|
||||||
|
i_vbv_delay = ( int32_t ) i64_occupancy_ticks;
|
||||||
}
|
}
|
||||||
ps_y262->ps_input_picture->i_vbv_delay = ( int32_t ) i64_occupancy_ticks;
|
ps_y262->ps_input_picture->i_vbv_delay = i_vbv_delay;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -672,9 +673,10 @@ void y262_ratectrl_start_picture( y262_t *ps_y262, int32_t i_header_bits )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
i64_occupancy_ticks = ( ( ( ( int64_t ) 90000 ) * ( i_occupancy_bits + !!ps_ratectrl->i64_vbv_occupancy_fractional ) ) + ( ps_ratectrl->i_vbvrate - 1 ) ) / ps_ratectrl->i_vbvrate;
|
i64_occupancy_ticks = ( ( ( ( int64_t ) 90000 ) * ( i_occupancy_bits + !!ps_ratectrl->i64_vbv_occupancy_fractional ) ) + ( ps_ratectrl->i_vbvrate - 1 ) ) / ps_ratectrl->i_vbvrate;
|
||||||
|
i_vbv_delay = ( int32_t ) i64_occupancy_ticks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ps_y262->ps_input_picture->i_vbv_delay = ( int32_t ) i64_occupancy_ticks;
|
ps_y262->ps_input_picture->i_vbv_delay = i_vbv_delay;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -652,7 +652,7 @@ int32_t y262_quant8x8_trellis_fw( y262_t *ps_y262, y262_slice_t *ps_slice, int16
|
||||||
i_dc = 0;
|
i_dc = 0;
|
||||||
i_start = 0;
|
i_start = 0;
|
||||||
pui8_qmat = ps_y262->rgui8_non_intra_quantiser_matrix;
|
pui8_qmat = ps_y262->rgui8_non_intra_quantiser_matrix;
|
||||||
y262_quant8x8_inter_fw( ps_y262, rgi16_levels, 8, ps_y262->rgui16_non_intra_quantizer_matrices[ i_quantizer ] );
|
i_nz = y262_quant8x8_inter_fw( ps_y262, rgi16_levels, 8, ps_y262->rgui16_non_intra_quantizer_matrices[ i_quantizer ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( i_nz )
|
if( i_nz )
|
||||||
|
|
|
@ -2142,8 +2142,8 @@ void y262_write_intra_block_mpeg1( y262_t *ps_y262, y262_slice_t *ps_slice, int3
|
||||||
|
|
||||||
if( i_level_sign < -127 )
|
if( i_level_sign < -127 )
|
||||||
{
|
{
|
||||||
y262_bitstream_write( ps_bitstream, ( -127 & 0xff ), 8 );
|
y262_bitstream_write( ps_bitstream, 0x80, 8 );
|
||||||
y262_bitstream_write( ps_bitstream, i_level_sign & 0xff, 8 );
|
y262_bitstream_write( ps_bitstream, ( i_level_sign + 256 ) & 0xff, 8 );
|
||||||
}
|
}
|
||||||
else if( i_level_sign < 128 )
|
else if( i_level_sign < 128 )
|
||||||
{
|
{
|
||||||
|
@ -2293,8 +2293,8 @@ void y262_write_inter_block_mpeg1( y262_t *ps_y262, y262_slice_t *ps_slice, int3
|
||||||
|
|
||||||
if( i_level_sign < -127 )
|
if( i_level_sign < -127 )
|
||||||
{
|
{
|
||||||
y262_bitstream_write( ps_bitstream, ( -127 & 0xff ), 8 );
|
y262_bitstream_write( ps_bitstream, 0x80, 8 );
|
||||||
y262_bitstream_write( ps_bitstream, i_level_sign & 0xff, 8 );
|
y262_bitstream_write( ps_bitstream, ( i_level_sign + 256 ) & 0xff, 8 );
|
||||||
}
|
}
|
||||||
else if( i_level_sign < 128 )
|
else if( i_level_sign < 128 )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue