diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2009-12-08 17:08:49 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2009-12-08 17:08:49 +0000 |
commit | e87eb039cc35ed432ad93691427a5f3bedb4d620 (patch) | |
tree | d16b6d98b424042b5b28ba177d350fc54ae24f0c /libavfilter/vf_vflip.c | |
parent | e185a2f649d970bd333f2c82ff1716ffd54e04ba (diff) | |
download | ffmpeg-e87eb039cc35ed432ad93691427a5f3bedb4d620.tar.gz |
Fix alpha plane flipping for the yuva420p and similar pixel formats.
Originally committed as revision 20771 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/vf_vflip.c')
-rw-r--r-- | libavfilter/vf_vflip.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c index 2080053d20..39c0405c04 100644 --- a/libavfilter/vf_vflip.c +++ b/libavfilter/vf_vflip.c @@ -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]; } } |