#endif
}
-// return of 0 means drop frame
-static int pick_frame_size(VP8_COMP *cpi)
-{
- VP8_COMMON *cm = &cpi->common;
-
- // First Frame is a special case
- if (cm->current_video_frame == 0)
- {
-#if !(CONFIG_REALTIME_ONLY)
-
- if (cpi->pass == 2)
- vp8_calc_auto_iframe_target_size(cpi);
-
- // 1 Pass there is no information on which to base size so use bandwidth per second * fixed fraction
- else
-#endif
- cpi->this_frame_target = cpi->oxcf.target_bandwidth / 2;
-
- // in error resilient mode the first frame is bigger since it likely contains
- // all the static background
- if (cpi->oxcf.error_resilient_mode == 1 || (cpi->compressor_speed == 2))
- {
- cpi->this_frame_target *= 3; // 5;
- }
-
- // Key frame from VFW/auto-keyframe/first frame
- cm->frame_type = KEY_FRAME;
-
- }
- // Special case for forced key frames
- // The frame sizing here is still far from ideal for 2 pass.
- else if (cm->frame_flags & FRAMEFLAGS_KEY)
- {
- cm->frame_type = KEY_FRAME;
- resize_key_frame(cpi);
- vp8_calc_iframe_target_size(cpi);
- }
- else if (cm->frame_type == KEY_FRAME)
- {
- vp8_calc_auto_iframe_target_size(cpi);
- }
- else
- {
- // INTER frame: compute target frame size
- cm->frame_type = INTER_FRAME;
- vp8_calc_pframe_target_size(cpi);
-
- // Check if we're dropping the frame:
- if (cpi->drop_frame)
- {
- cpi->drop_frame = FALSE;
- cpi->drop_count++;
- return 0;
- }
- }
-
- return 1;
-}
-static void set_quantizer(VP8_COMP *cpi, int Q)
-{
- VP8_COMMON *cm = &cpi->common;
- MACROBLOCKD *mbd = &cpi->mb.e_mbd;
- int update = 0;
- int new_delta_q;
- cm->base_qindex = Q;
-
- /* if any of the delta_q values are changing update flag has to be set */
- /* currently only y2dc_delta_q may change */
-
- cm->y1dc_delta_q = 0;
- cm->y2ac_delta_q = 0;
- cm->uvdc_delta_q = 0;
- cm->uvac_delta_q = 0;
-
- if (Q < 4)
- {
- new_delta_q = 4-Q;
- }
- else
- new_delta_q = 0;
-
- update |= cm->y2dc_delta_q != new_delta_q;
- cm->y2dc_delta_q = new_delta_q;
-
-
- // Set Segment specific quatizers
- mbd->segment_feature_data[MB_LVL_ALT_Q][0] = cpi->segment_feature_data[MB_LVL_ALT_Q][0];
- mbd->segment_feature_data[MB_LVL_ALT_Q][1] = cpi->segment_feature_data[MB_LVL_ALT_Q][1];
- mbd->segment_feature_data[MB_LVL_ALT_Q][2] = cpi->segment_feature_data[MB_LVL_ALT_Q][2];
- mbd->segment_feature_data[MB_LVL_ALT_Q][3] = cpi->segment_feature_data[MB_LVL_ALT_Q][3];
-
- /* quantizer has to be reinitialized for any delta_q changes */
- if(update)
- vp8cx_init_quantizer(cpi);
-
-}
- static void update_alt_ref_frame_and_stats(VP8_COMP *cpi)
+ static void update_alt_ref_frame_stats(VP8_COMP *cpi)
{
VP8_COMMON *cm = &cpi->common;