Commit e87eb039 authored by Stefano Sabatini's avatar Stefano Sabatini

Fix alpha plane flipping for the yuva420p and similar pixel formats.

Originally committed as revision 20771 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent e185a2f6
...@@ -48,11 +48,11 @@ static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms, ...@@ -48,11 +48,11 @@ static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms,
AVFilterPicRef *picref = avfilter_get_video_buffer(link->dst->outputs[0], AVFilterPicRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],
perms, w, h); perms, w, h);
picref->data[0] += (h-1) * picref->linesize[0]; for (i = 0; i < 4; i ++) {
picref->linesize[0] = -picref->linesize[0]; int vsub = i == 1 || i == 2 ? flip->vsub : 0;
for (i = 1; i < 4; i ++) {
if (picref->data[i]) { if (picref->data[i]) {
picref->data[i] += ((h >> flip->vsub)-1) * picref->linesize[i]; picref->data[i] += ((h >> vsub)-1) * picref->linesize[i];
picref->linesize[i] = -picref->linesize[i]; picref->linesize[i] = -picref->linesize[i];
} }
} }
...@@ -66,11 +66,11 @@ static void start_frame(AVFilterLink *link, AVFilterPicRef *picref) ...@@ -66,11 +66,11 @@ static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0); AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0);
int i; int i;
ref2->data[0] += (link->h-1) * ref2->linesize[0]; for (i = 0; i < 4; i ++) {
ref2->linesize[0] = -ref2->linesize[0]; int vsub = i == 1 || i == 2 ? flip->vsub : 0;
for (i = 1; i < 4; i ++) {
if (ref2->data[i]) { if (ref2->data[i]) {
ref2->data[i] += ((link->h >> flip->vsub)-1) * ref2->linesize[i]; ref2->data[i] += ((link->h >> vsub)-1) * ref2->linesize[i];
ref2->linesize[i] = -ref2->linesize[i]; ref2->linesize[i] = -ref2->linesize[i];
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment