avfilter/vf_scale_*: add enum names for force_oar magic values

This commit is contained in:
Niklas Haas
2025-09-23 16:17:12 +02:00
committed by Niklas Haas
parent 74115b017c
commit 6ad839ff2e
10 changed files with 38 additions and 29 deletions

View File

@@ -148,14 +148,14 @@ int ff_scale_adjust_dimensions(AVFilterLink *inlink,
/* Note that force_original_aspect_ratio may overwrite the previous set
* dimensions so that it is not divisible by the set factors anymore
* unless force_divisible_by is defined as well */
if (force_original_aspect_ratio) {
if (force_original_aspect_ratio != SCALE_FORCE_OAR_DISABLE) {
// Including force_divisible_by here rounds to the nearest multiple of it.
int64_t tmp_w = av_rescale(h, inlink->w * w_adj, inlink->h * (int64_t)force_divisible_by)
* force_divisible_by;
int64_t tmp_h = av_rescale(w, inlink->h, inlink->w * w_adj * (int64_t)force_divisible_by)
* force_divisible_by;
if (force_original_aspect_ratio == 1) {
if (force_original_aspect_ratio == SCALE_FORCE_OAR_DECREASE) {
w = FFMIN(tmp_w, w);
h = FFMIN(tmp_h, h);
if (force_divisible_by > 1) {
@@ -163,7 +163,7 @@ int ff_scale_adjust_dimensions(AVFilterLink *inlink,
w = w / force_divisible_by * force_divisible_by;
h = h / force_divisible_by * force_divisible_by;
}
} else {
} else { // SCALE_FORCE_OAR_INCREASE
w = FFMAX(tmp_w, w);
h = FFMAX(tmp_h, h);
if (force_divisible_by > 1) {