aomedia /
avm /
fecb2abc4ebc66054ae1ac4d3caa1a1b500a0c8d resize-refactor: Change resizing process with helpers
Adds three new helpers and changes one other. The intention of this is
to make the triggering and function of resizing simpler. The new process
is to resize to the next state and then update the current state to
match. The new helpers reflect this change and make the overall flow
simpler.
resize_pending is now a helper instead of a member, so it doesn't need
to be raised manually. A resize is pending when the numerator or
denominator of the next resize state is different from the current one.
resize_pending could be 1 (scale down), 0 (no change), or -1 (return to
original resolution if 1-pass CBR), but now it can only be 1 or 0. To
return to the original resolution just set the scale to 1:1. This
reduces complexity with no change in functionality.
resize_unscaled just returns 1 if the current numerator and denominator
are equal. This makes some if conditions cleaner.
resize_step makes the current scale equal to the next scale. This
signifies that a resize is complete and will cause resize_pending to be
false until the next state is changed. This is the end of the new
resizing procedure.
av1_calculate_coded_size has been changed to calculate the next size
instead of the current size. The current state can't be updated until
the resize is complete because if it were, the resize_pending state
would drop and the resize wouldn't finish. This just means the next
resolution is the target resolution until the resize is complete.
Change-Id: I5d5855cc83f532d3a8b1f8853ba70a0d43221fbf
6 files changed