Merge "Adding several consts to assign_std_frame_bits()."
This commit is contained in:
		@@ -1757,23 +1757,14 @@ static void assign_std_frame_bits(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
 | 
				
			|||||||
  const int max_bits = frame_max_bits(&cpi->rc, oxcf);
 | 
					  const int max_bits = frame_max_bits(&cpi->rc, oxcf);
 | 
				
			||||||
  // Calculate modified prediction error used in bit allocation.
 | 
					  // Calculate modified prediction error used in bit allocation.
 | 
				
			||||||
  const double modified_err = calculate_modified_err(twopass, oxcf, this_frame);
 | 
					  const double modified_err = calculate_modified_err(twopass, oxcf, this_frame);
 | 
				
			||||||
  int target_frame_size;
 | 
					  // What portion of the remaining GF group error is used by this frame.
 | 
				
			||||||
  double err_fraction;
 | 
					  const double err_fraction = twopass->gf_group_error_left > 0 ?
 | 
				
			||||||
 | 
					      modified_err / twopass->gf_group_error_left : 0.0;
 | 
				
			||||||
  if (twopass->gf_group_error_left > 0)
 | 
					  // How many of those bits available for allocation should we give it? Clip
 | 
				
			||||||
    // What portion of the remaining GF group error is used by this frame.
 | 
					  // target size to 0 - max_bits (or cpi->twopass.gf_group_bits) at the top end.
 | 
				
			||||||
    err_fraction = modified_err / twopass->gf_group_error_left;
 | 
					  const int target_frame_size =
 | 
				
			||||||
  else
 | 
					     clamp((int)(twopass->gf_group_bits * err_fraction),
 | 
				
			||||||
    err_fraction = 0.0;
 | 
					           0, MIN(max_bits, (int)twopass->gf_group_bits));
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // How many of those bits available for allocation should we give it?
 | 
					 | 
				
			||||||
  target_frame_size = (int)((double)twopass->gf_group_bits * err_fraction);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // Clip target size to 0 - max_bits (or cpi->twopass.gf_group_bits) at
 | 
					 | 
				
			||||||
  // the top end.
 | 
					 | 
				
			||||||
  target_frame_size = clamp(target_frame_size, 0,
 | 
					 | 
				
			||||||
                            MIN(max_bits, (int)twopass->gf_group_bits));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // Adjust error and bits remaining.
 | 
					  // Adjust error and bits remaining.
 | 
				
			||||||
  twopass->gf_group_error_left -= (int64_t)modified_err;
 | 
					  twopass->gf_group_error_left -= (int64_t)modified_err;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user