Skip to content

Commit

Permalink
avfilter/vf_stack: round down internal item heights
Browse files Browse the repository at this point in the history
  • Loading branch information
BtbN committed Mar 31, 2024
1 parent 271a0a5 commit 0896472
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions libavfilter/vf_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ static int config_output(AVFilterLink *outlink)
return ret;
}

item->height[1] = item->height[2] = AV_CEIL_RSHIFT(inlink->h, s->desc->log2_chroma_h);
item->height[1] = item->height[2] = inlink->h / (1 << s->desc->log2_chroma_h);
item->height[0] = item->height[3] = inlink->h;

if (i) {
item->y[1] = item->y[2] = AV_CEIL_RSHIFT(height, s->desc->log2_chroma_h);
item->y[1] = item->y[2] = height / (1 << s->desc->log2_chroma_h);
item->y[0] = item->y[3] = height;

height += ctx->inputs[i]->h;
Expand All @@ -245,7 +245,7 @@ static int config_output(AVFilterLink *outlink)
return ret;
}

item->height[1] = item->height[2] = AV_CEIL_RSHIFT(inlink->h, s->desc->log2_chroma_h);
item->height[1] = item->height[2] = inlink->h / (1 << s->desc->log2_chroma_h);
item->height[0] = item->height[3] = inlink->h;

if (i) {
Expand Down Expand Up @@ -279,14 +279,14 @@ static int config_output(AVFilterLink *outlink)
return ret;
}

item->height[1] = item->height[2] = AV_CEIL_RSHIFT(inlink->h, s->desc->log2_chroma_h);
item->height[1] = item->height[2] = inlink->h / (1 << s->desc->log2_chroma_h);
item->height[0] = item->height[3] = inlink->h;

if ((ret = av_image_fill_linesizes(item->x, inlink->format, inw)) < 0) {
return ret;
}

item->y[1] = item->y[2] = AV_CEIL_RSHIFT(inh, s->desc->log2_chroma_h);
item->y[1] = item->y[2] = inh / (1 << s->desc->log2_chroma_h);
item->y[0] = item->y[3] = inh;
inw += ctx->inputs[k]->w;
}
Expand Down Expand Up @@ -323,7 +323,7 @@ static int config_output(AVFilterLink *outlink)
return ret;
}

item->height[1] = item->height[2] = AV_CEIL_RSHIFT(inlink->h, s->desc->log2_chroma_h);
item->height[1] = item->height[2] = inlink->h / (1 << s->desc->log2_chroma_h);
item->height[0] = item->height[3] = inlink->h;

p2 = arg;
Expand Down Expand Up @@ -371,7 +371,7 @@ static int config_output(AVFilterLink *outlink)
return ret;
}

item->y[1] = item->y[2] = AV_CEIL_RSHIFT(inh, s->desc->log2_chroma_h);
item->y[1] = item->y[2] = inh / (1 << s->desc->log2_chroma_h);
item->y[0] = item->y[3] = inh;

width = FFMAX(width, inlink->w + inw);
Expand Down

0 comments on commit 0896472

Please sign in to comment.