if( sh->i_type == SLICE_TYPE_B )
bs_write1( s, sh->b_direct_spatial_mv_pred );
- if( sh->i_type == SLICE_TYPE_P || sh->i_type == SLICE_TYPE_SP || sh->i_type == SLICE_TYPE_B )
+ if( sh->i_type == SLICE_TYPE_P || sh->i_type == SLICE_TYPE_B )
{
bs_write1( s, sh->b_num_ref_idx_override );
if( sh->b_num_ref_idx_override )
}
}
- if( sh->pps->b_weighted_pred && ( sh->i_type == SLICE_TYPE_P || sh->i_type == SLICE_TYPE_SP ) )
+ if( sh->pps->b_weighted_pred && sh->i_type == SLICE_TYPE_P )
{
/* pred_weight_table() */
bs_write_ue( s, sh->weight[0][0].i_denom );
h->i_frame++;
/* Slices used and PSNR */
- for( int i = 0; i < 5; i++ )
+ for( int i = 0; i < 3; i++ )
{
- static const uint8_t slice_order[] = { SLICE_TYPE_I, SLICE_TYPE_SI, SLICE_TYPE_P, SLICE_TYPE_SP, SLICE_TYPE_B };
- static const char * const slice_name[] = { "P", "B", "I", "SP", "SI" };
+ static const uint8_t slice_order[] = { SLICE_TYPE_I, SLICE_TYPE_P, SLICE_TYPE_B };
int i_slice = slice_order[i];
if( h->stat.i_frame_count[i_slice] > 0 )
if( h->param.analyse.b_psnr )
{
x264_log( h, X264_LOG_INFO,
- "frame %s:%-5d Avg QP:%5.2f size:%6.0f PSNR Mean Y:%5.2f U:%5.2f V:%5.2f Avg:%5.2f Global:%5.2f\n",
- slice_name[i_slice],
+ "frame %c:%-5d Avg QP:%5.2f size:%6.0f PSNR Mean Y:%5.2f U:%5.2f V:%5.2f Avg:%5.2f Global:%5.2f\n",
+ slice_type_to_char[i_slice],
i_count,
h->stat.f_frame_qp[i_slice] / i_count,
(double)h->stat.i_frame_size[i_slice] / i_count,
else
{
x264_log( h, X264_LOG_INFO,
- "frame %s:%-5d Avg QP:%5.2f size:%6.0f\n",
- slice_name[i_slice],
+ "frame %c:%-5d Avg QP:%5.2f size:%6.0f\n",
+ slice_type_to_char[i_slice],
i_count,
h->stat.f_frame_qp[i_slice] / i_count,
(double)h->stat.i_frame_size[i_slice] / i_count );
double rate_tolerance;
double qcompress;
int nmb; /* number of macroblocks in a frame */
- int qp_constant[5];
+ int qp_constant[3];
/* current frame */
ratecontrol_entry_t *rce;
int num_entries; /* number of ratecontrol_entry_ts */
ratecontrol_entry_t *entry; /* FIXME: copy needed data and free this once init is done */
double last_qscale;
- double last_qscale_for[5]; /* last qscale for a specific pict type, used for max_diff & ipb factor stuff */
+ double last_qscale_for[3]; /* last qscale for a specific pict type, used for max_diff & ipb factor stuff */
int last_non_b_pict_type;
double accum_p_qp; /* for determining I-frame quant */
double accum_p_norm;
double last_accum_p_norm;
- double lmin[5]; /* min qscale by frame type */
- double lmax[5];
+ double lmin[3]; /* min qscale by frame type */
+ double lmax[3];
double lstep; /* max change (multiply) in qscale per frame */
uint16_t *qp_buffer[2]; /* Global buffers for converting MB-tree quantizer data. */
int qpbuf_pos; /* In order to handle pyramid reordering, QP buffer acts as a stack.
double slice_size_planned;
double max_frame_error;
predictor_t (*row_pred)[2];
- predictor_t row_preds[5][2];
+ predictor_t row_preds[3][2];
predictor_t *pred_b_from_p; /* predict B-frame size from P-frame satd */
int bframes; /* # consecutive B-frames before this P-frame */
int bframe_bits; /* total cost of those frames */
int num_preds = h->param.b_sliced_threads * h->param.i_threads + 1;
CHECKED_MALLOC( rc->pred, 5 * sizeof(predictor_t) * num_preds );
CHECKED_MALLOC( rc->pred_b_from_p, sizeof(predictor_t) );
- for( int i = 0; i < 5; i++ )
+ for( int i = 0; i < 3; i++ )
{
rc->last_qscale_for[i] = qp2qscale( ABR_INIT_QP );
rc->lmin[i] = qp2qscale( h->param.rc.i_qp_min );