Browse code

ZeroCodec: Flip output

The initial testing of the VFW binary codec was flawed,
likely due to an AviSynth bug.

Re-testing using VirtualDub and various professional editing
applications has revealed it should have been flipped.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>

Carl Eugen Hoyos authored on 2012/12/09 18:24:16
Showing 3 changed files
... ...
@@ -28,7 +28,7 @@
28 28
 
29 29
 #define LIBAVCODEC_VERSION_MAJOR 54
30 30
 #define LIBAVCODEC_VERSION_MINOR 34
31
-#define LIBAVCODEC_VERSION_MICRO  0
31
+#define LIBAVCODEC_VERSION_MICRO  1
32 32
 
33 33
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
34 34
                                                LIBAVCODEC_VERSION_MINOR, \
... ...
@@ -49,6 +49,9 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
49 49
             av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
50 50
             return AVERROR_INVALIDDATA;
51 51
         }
52
+
53
+        prev += (avctx->height - 1) * prev_pic->linesize[0];
54
+
52 55
         pic->key_frame = 0;
53 56
         pic->pict_type = AV_PICTURE_TYPE_P;
54 57
     }
... ...
@@ -67,7 +70,7 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
67 67
     zstream->next_in  = avpkt->data;
68 68
     zstream->avail_in = avpkt->size;
69 69
 
70
-    dst = pic->data[0];
70
+    dst = pic->data[0] + (avctx->height - 1) * pic->linesize[0];
71 71
 
72 72
     /**
73 73
      * ZeroCodec has very simple interframe compression. If a value
... ...
@@ -90,8 +93,8 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
90 90
             for (j = 0; j < avctx->width << 1; j++)
91 91
                 dst[j] += prev[j] & -!dst[j];
92 92
 
93
-        prev += prev_pic->linesize[0];
94
-        dst  += pic->linesize[0];
93
+        prev -= prev_pic->linesize[0];
94
+        dst  -= pic->linesize[0];
95 95
     }
96 96
 
97 97
     /* Release the previous buffer if need be */
... ...
@@ -1,39 +1,39 @@
1 1
 #tb 0: 417083/10000000
2
-0,          0,          0,        1,  1843200, 0x09f24bd5
3
-0,          1,          1,        1,  1843200, 0x8c932d04
4
-0,          2,          2,        1,  1843200, 0xe04904a0
5
-0,          3,          3,        1,  1843200, 0x1969f383
6
-0,          4,          4,        1,  1843200, 0x70781331
7
-0,          5,          5,        1,  1843200, 0xf494496b
8
-0,          6,          6,        1,  1843200, 0xf6226da2
9
-0,          7,          7,        1,  1843200, 0x5d657925
10
-0,          8,          8,        1,  1843200, 0xde15820d
11
-0,          9,          9,        1,  1843200, 0xb6768df1
12
-0,         10,         10,        1,  1843200, 0xc4318e08
13
-0,         11,         11,        1,  1843200, 0x8530a7d5
14
-0,         12,         12,        1,  1843200, 0x0ee29f10
15
-0,         13,         13,        1,  1843200, 0xcbb6b185
16
-0,         14,         14,        1,  1843200, 0x085aac47
17
-0,         15,         15,        1,  1843200, 0xb42e7b1b
18
-0,         16,         16,        1,  1843200, 0xea3a2cd6
19
-0,         17,         17,        1,  1843200, 0x7600ee09
20
-0,         18,         18,        1,  1843200, 0xe39fc9d4
21
-0,         19,         19,        1,  1843200, 0xc122cd4c
22
-0,         20,         20,        1,  1843200, 0x5fb4c1cb
23
-0,         21,         21,        1,  1843200, 0x1552cb6c
24
-0,         22,         22,        1,  1843200, 0x5b66ce2f
25
-0,         23,         23,        1,  1843200, 0x70a8c318
26
-0,         24,         24,        1,  1843200, 0x8b86af2d
27
-0,         25,         25,        1,  1843200, 0x94886a49
28
-0,         26,         26,        1,  1843200, 0xda05684f
29
-0,         27,         27,        1,  1843200, 0xe57c8f33
30
-0,         28,         28,        1,  1843200, 0x39ef9c7e
31
-0,         29,         29,        1,  1843200, 0xe7a0cab8
32
-0,         30,         30,        1,  1843200, 0x43f0d766
33
-0,         31,         31,        1,  1843200, 0x733d3c7b
34
-0,         32,         32,        1,  1843200, 0x42713cea
35
-0,         33,         33,        1,  1843200, 0xdd844e53
36
-0,         34,         34,        1,  1843200, 0xa0875ba8
37
-0,         35,         35,        1,  1843200, 0x318b6114
38
-0,         36,         36,        1,  1843200, 0xcc986275
39
-0,         37,         37,        1,  1843200, 0x14eb6704
2
+0,          0,          0,        1,  1843200, 0x04154bd5
3
+0,          1,          1,        1,  1843200, 0x3a872d04
4
+0,          2,          2,        1,  1843200, 0x3b1304a0
5
+0,          3,          3,        1,  1843200, 0x7474f383
6
+0,          4,          4,        1,  1843200, 0xce7d1331
7
+0,          5,          5,        1,  1843200, 0x3cdf496b
8
+0,          6,          6,        1,  1843200, 0xe9096da2
9
+0,          7,          7,        1,  1843200, 0x30be7925
10
+0,          8,          8,        1,  1843200, 0x600b820d
11
+0,          9,          9,        1,  1843200, 0xe7bb8df1
12
+0,         10,         10,        1,  1843200, 0x62848e08
13
+0,         11,         11,        1,  1843200, 0x9a71a7d5
14
+0,         12,         12,        1,  1843200, 0x743a9f10
15
+0,         13,         13,        1,  1843200, 0x62b0b185
16
+0,         14,         14,        1,  1843200, 0xd94eac47
17
+0,         15,         15,        1,  1843200, 0xa1007b1b
18
+0,         16,         16,        1,  1843200, 0x11d72cd6
19
+0,         17,         17,        1,  1843200, 0x141aee09
20
+0,         18,         18,        1,  1843200, 0x9a90c9d4
21
+0,         19,         19,        1,  1843200, 0x6bd5cd4c
22
+0,         20,         20,        1,  1843200, 0xdf2ec1cb
23
+0,         21,         21,        1,  1843200, 0xeecbcb6c
24
+0,         22,         22,        1,  1843200, 0x9ecace2f
25
+0,         23,         23,        1,  1843200, 0x7b59c318
26
+0,         24,         24,        1,  1843200, 0x050baf2d
27
+0,         25,         25,        1,  1843200, 0xada36a49
28
+0,         26,         26,        1,  1843200, 0x4f4d684f
29
+0,         27,         27,        1,  1843200, 0x9ddc8f33
30
+0,         28,         28,        1,  1843200, 0x914d9c7e
31
+0,         29,         29,        1,  1843200, 0x0dc3cab8
32
+0,         30,         30,        1,  1843200, 0x98f8d766
33
+0,         31,         31,        1,  1843200, 0x872e3c7b
34
+0,         32,         32,        1,  1843200, 0xdf7b3cea
35
+0,         33,         33,        1,  1843200, 0xf7864e53
36
+0,         34,         34,        1,  1843200, 0x13315ba8
37
+0,         35,         35,        1,  1843200, 0xc4586114
38
+0,         36,         36,        1,  1843200, 0x57a96275
39
+0,         37,         37,        1,  1843200, 0x6e756704