Ticket #317: patchgeox

File patchgeox, 1.5 KB (added by cehoyos, 4 years ago)
Line 
1diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
2index c897bc3..babedf2 100644
3--- a/libavcodec/h263dec.c
4+++ b/libavcodec/h263dec.c
5@@ -754,6 +754,14 @@ intrax8_decoded:
6 
7     if(s->last_picture_ptr || s->low_delay){
8         *data_size = sizeof(AVFrame);
9+        if (s->codec_tag == AV_RL32("GEOX")) {
10+            pict->data[0] += pict->linesize[0] * (avctx->height-1);
11+            pict->data[1] += pict->linesize[1] * (avctx->height/2-1);
12+            pict->data[2] += pict->linesize[2] * (avctx->height/2-1);
13+            pict->linesize[0] *= -1;
14+            pict->linesize[1] *= -1;
15+            pict->linesize[2] *= -1;
16+        }
17         ff_print_debug_info(s, pict);
18     }
19 
20diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
21index 8a308be..c33beeb 100644
22--- a/libavcodec/mpegvideo.c
23+++ b/libavcodec/mpegvideo.c
24@@ -267,6 +267,15 @@ static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
25         return -1;
26     }
27 
28+    if (s->codec_tag == AV_RL32("GEOX")) {
29+        pic->f.data[0] += pic->f.linesize[0] * (s->avctx->height-1);
30+        pic->f.data[1] += pic->f.linesize[1] * (s->avctx->height/2-1);
31+        pic->f.data[2] += pic->f.linesize[2] * (s->avctx->height/2-1);
32+        pic->f.linesize[0] *= -1;
33+        pic->f.linesize[1] *= -1;
34+        pic->f.linesize[2] *= -1;
35+    }
36+
37     if (s->linesize && (s->linesize   != pic->f.linesize[0] ||
38                         s->uvlinesize != pic->f.linesize[1])) {
39         av_log(s->avctx, AV_LOG_ERROR,