mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 16:22:37 +00:00
Fix alpha plane flipping for the yuva420p and similar pixel formats.
Originally committed as revision 20771 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
e185a2f649
commit
e87eb039cc
@ -48,11 +48,11 @@ static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms,
|
||||
AVFilterPicRef *picref = avfilter_get_video_buffer(link->dst->outputs[0],
|
||||
perms, w, h);
|
||||
|
||||
picref->data[0] += (h-1) * picref->linesize[0];
|
||||
picref->linesize[0] = -picref->linesize[0];
|
||||
for (i = 1; i < 4; i ++) {
|
||||
for (i = 0; i < 4; i ++) {
|
||||
int vsub = i == 1 || i == 2 ? flip->vsub : 0;
|
||||
|
||||
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];
|
||||
}
|
||||
}
|
||||
@ -66,11 +66,11 @@ static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
|
||||
AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0);
|
||||
int i;
|
||||
|
||||
ref2->data[0] += (link->h-1) * ref2->linesize[0];
|
||||
ref2->linesize[0] = -ref2->linesize[0];
|
||||
for (i = 1; i < 4; i ++) {
|
||||
for (i = 0; i < 4; i ++) {
|
||||
int vsub = i == 1 || i == 2 ? flip->vsub : 0;
|
||||
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user