summaryrefslogtreecommitdiff
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-24 00:56:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-24 01:04:23 +0200
commit5cc8b816875d3ae110ba7bde6b16bd0246f2e225 (patch)
tree2dab113d33f28b8a116d04ffe0ec611233040722 /libavcodec/h263dec.c
parent3941a4f5c2a48d46dd67a788983de89594231479 (diff)
mpeg4videodec: fix GEOV/GEOX fliping
Fixes Ticket317 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r--libavcodec/h263dec.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index bf9e072546..3fe37e95a8 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -757,6 +757,21 @@ intrax8_decoded:
}
if(s->last_picture_ptr || s->low_delay){
+ if ( pict->format == AV_PIX_FMT_YUV420P
+ && (s->codec_tag == AV_RL32("GEOV") || s->codec_tag == AV_RL32("GEOX"))) {
+ int x, y, p;
+ av_frame_make_writable(pict);
+ for (p=0; p<3; p++) {
+ int w = -((-pict-> width)>>!!p);
+ int h = -((-pict->height)>>!!p);
+ int linesize = pict->linesize[p];
+ for (y=0; y<(h>>1); y++)
+ for (x=0; x<w; x++)
+ FFSWAP(int,
+ pict->data[p][x + y*linesize],
+ pict->data[p][x + (h-1-y)*linesize]);
+ }
+ }
*got_frame = 1;
}