annotate src/ffmpeg/libavcodec/kmvc.c @ 825:3cbdc6e19d7c trunk

[svn] - make this compile again
author nenolod
date Mon, 12 Mar 2007 14:37:31 -0700
parents e8776388b02a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
808
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
1 /*
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
2 * KMVC decoder
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
3 * Copyright (c) 2006 Konstantin Shishkov
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
4 *
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
5 * This file is part of FFmpeg.
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
6 *
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
11 *
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
15 * Lesser General Public License for more details.
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
16 *
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
20 *
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
21 */
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
22
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
23 /**
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
24 * @file kmvc.c
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
25 * Karl Morton's Video Codec decoder
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
26 */
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
27
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
28 #include <stdio.h>
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
29 #include <stdlib.h>
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
30
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
31 #include "common.h"
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
32 #include "avcodec.h"
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
33
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
34 #define KMVC_KEYFRAME 0x80
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
35 #define KMVC_PALETTE 0x40
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
36 #define KMVC_METHOD 0x0F
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
37
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
38 /*
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
39 * Decoder context
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
40 */
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
41 typedef struct KmvcContext {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
42 AVCodecContext *avctx;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
43 AVFrame pic;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
44
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
45 int setpal;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
46 int palsize;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
47 uint32_t pal[256];
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
48 uint8_t *cur, *prev;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
49 uint8_t *frm0, *frm1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
50 } KmvcContext;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
51
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
52 typedef struct BitBuf {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
53 int bits;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
54 int bitbuf;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
55 } BitBuf;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
56
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
57 #define BLK(data, x, y) data[(x) + (y) * 320]
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
58
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
59 #define kmvc_init_getbits(bb, src) bb.bits = 7; bb.bitbuf = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
60
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
61 #define kmvc_getbit(bb, src, res) {\
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
62 res = 0; \
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
63 if (bb.bitbuf & (1 << bb.bits)) res = 1; \
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
64 bb.bits--; \
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
65 if(bb.bits == -1) { \
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
66 bb.bitbuf = *src++; \
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
67 bb.bits = 7; \
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
68 } \
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
69 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
70
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
71 static void kmvc_decode_intra_8x8(KmvcContext * ctx, uint8_t * src, int w, int h)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
72 {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
73 BitBuf bb;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
74 int res, val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
75 int i, j;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
76 int bx, by;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
77 int l0x, l1x, l0y, l1y;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
78 int mx, my;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
79
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
80 kmvc_init_getbits(bb, src);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
81
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
82 for (by = 0; by < h; by += 8)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
83 for (bx = 0; bx < w; bx += 8) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
84 kmvc_getbit(bb, src, res);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
85 if (!res) { // fill whole 8x8 block
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
86 val = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
87 for (i = 0; i < 64; i++)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
88 BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
89 } else { // handle four 4x4 subblocks
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
90 for (i = 0; i < 4; i++) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
91 l0x = bx + (i & 1) * 4;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
92 l0y = by + (i & 2) * 2;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
93 kmvc_getbit(bb, src, res);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
94 if (!res) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
95 kmvc_getbit(bb, src, res);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
96 if (!res) { // fill whole 4x4 block
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
97 val = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
98 for (j = 0; j < 16; j++)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
99 BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
100 } else { // copy block from already decoded place
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
101 val = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
102 mx = val & 0xF;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
103 my = val >> 4;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
104 for (j = 0; j < 16; j++)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
105 BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) =
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
106 BLK(ctx->cur, l0x + (j & 3) - mx, l0y + (j >> 2) - my);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
107 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
108 } else { // descend to 2x2 sub-sub-blocks
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
109 for (j = 0; j < 4; j++) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
110 l1x = l0x + (j & 1) * 2;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
111 l1y = l0y + (j & 2);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
112 kmvc_getbit(bb, src, res);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
113 if (!res) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
114 kmvc_getbit(bb, src, res);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
115 if (!res) { // fill whole 2x2 block
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
116 val = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
117 BLK(ctx->cur, l1x, l1y) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
118 BLK(ctx->cur, l1x + 1, l1y) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
119 BLK(ctx->cur, l1x, l1y + 1) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
120 BLK(ctx->cur, l1x + 1, l1y + 1) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
121 } else { // copy block from already decoded place
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
122 val = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
123 mx = val & 0xF;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
124 my = val >> 4;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
125 BLK(ctx->cur, l1x, l1y) = BLK(ctx->cur, l1x - mx, l1y - my);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
126 BLK(ctx->cur, l1x + 1, l1y) =
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
127 BLK(ctx->cur, l1x + 1 - mx, l1y - my);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
128 BLK(ctx->cur, l1x, l1y + 1) =
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
129 BLK(ctx->cur, l1x - mx, l1y + 1 - my);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
130 BLK(ctx->cur, l1x + 1, l1y + 1) =
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
131 BLK(ctx->cur, l1x + 1 - mx, l1y + 1 - my);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
132 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
133 } else { // read values for block
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
134 BLK(ctx->cur, l1x, l1y) = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
135 BLK(ctx->cur, l1x + 1, l1y) = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
136 BLK(ctx->cur, l1x, l1y + 1) = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
137 BLK(ctx->cur, l1x + 1, l1y + 1) = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
138 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
139 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
140 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
141 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
142 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
143 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
144 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
145
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
146 static void kmvc_decode_inter_8x8(KmvcContext * ctx, uint8_t * src, int w, int h)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
147 {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
148 BitBuf bb;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
149 int res, val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
150 int i, j;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
151 int bx, by;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
152 int l0x, l1x, l0y, l1y;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
153 int mx, my;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
154
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
155 kmvc_init_getbits(bb, src);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
156
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
157 for (by = 0; by < h; by += 8)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
158 for (bx = 0; bx < w; bx += 8) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
159 kmvc_getbit(bb, src, res);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
160 if (!res) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
161 kmvc_getbit(bb, src, res);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
162 if (!res) { // fill whole 8x8 block
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
163 val = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
164 for (i = 0; i < 64; i++)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
165 BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
166 } else { // copy block from previous frame
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
167 for (i = 0; i < 64; i++)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
168 BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) =
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
169 BLK(ctx->prev, bx + (i & 0x7), by + (i >> 3));
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
170 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
171 } else { // handle four 4x4 subblocks
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
172 for (i = 0; i < 4; i++) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
173 l0x = bx + (i & 1) * 4;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
174 l0y = by + (i & 2) * 2;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
175 kmvc_getbit(bb, src, res);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
176 if (!res) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
177 kmvc_getbit(bb, src, res);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
178 if (!res) { // fill whole 4x4 block
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
179 val = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
180 for (j = 0; j < 16; j++)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
181 BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
182 } else { // copy block
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
183 val = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
184 mx = (val & 0xF) - 8;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
185 my = (val >> 4) - 8;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
186 for (j = 0; j < 16; j++)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
187 BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) =
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
188 BLK(ctx->prev, l0x + (j & 3) + mx, l0y + (j >> 2) + my);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
189 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
190 } else { // descend to 2x2 sub-sub-blocks
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
191 for (j = 0; j < 4; j++) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
192 l1x = l0x + (j & 1) * 2;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
193 l1y = l0y + (j & 2);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
194 kmvc_getbit(bb, src, res);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
195 if (!res) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
196 kmvc_getbit(bb, src, res);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
197 if (!res) { // fill whole 2x2 block
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
198 val = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
199 BLK(ctx->cur, l1x, l1y) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
200 BLK(ctx->cur, l1x + 1, l1y) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
201 BLK(ctx->cur, l1x, l1y + 1) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
202 BLK(ctx->cur, l1x + 1, l1y + 1) = val;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
203 } else { // copy block
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
204 val = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
205 mx = (val & 0xF) - 8;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
206 my = (val >> 4) - 8;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
207 BLK(ctx->cur, l1x, l1y) = BLK(ctx->prev, l1x + mx, l1y + my);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
208 BLK(ctx->cur, l1x + 1, l1y) =
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
209 BLK(ctx->prev, l1x + 1 + mx, l1y + my);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
210 BLK(ctx->cur, l1x, l1y + 1) =
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
211 BLK(ctx->prev, l1x + mx, l1y + 1 + my);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
212 BLK(ctx->cur, l1x + 1, l1y + 1) =
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
213 BLK(ctx->prev, l1x + 1 + mx, l1y + 1 + my);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
214 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
215 } else { // read values for block
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
216 BLK(ctx->cur, l1x, l1y) = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
217 BLK(ctx->cur, l1x + 1, l1y) = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
218 BLK(ctx->cur, l1x, l1y + 1) = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
219 BLK(ctx->cur, l1x + 1, l1y + 1) = *src++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
220 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
221 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
222 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
223 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
224 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
225 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
226 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
227
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
228 static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, uint8_t * buf,
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
229 int buf_size)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
230 {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
231 KmvcContext *const ctx = (KmvcContext *) avctx->priv_data;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
232 uint8_t *out, *src;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
233 int i;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
234 int header;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
235 int blocksize;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
236
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
237 if (ctx->pic.data[0])
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
238 avctx->release_buffer(avctx, &ctx->pic);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
239
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
240 ctx->pic.reference = 1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
241 ctx->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
242 if (avctx->get_buffer(avctx, &ctx->pic) < 0) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
243 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
244 return -1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
245 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
246
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
247 header = *buf++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
248
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
249 /* blocksize 127 is really palette change event */
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
250 if (buf[0] == 127) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
251 buf += 3;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
252 for (i = 0; i < 127; i++) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
253 ctx->pal[i + (header & 0x81)] = (buf[0] << 16) | (buf[1] << 8) | buf[2];
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
254 buf += 4;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
255 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
256 buf -= 127 * 4 + 3;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
257 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
258
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
259 if (header & KMVC_KEYFRAME) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
260 ctx->pic.key_frame = 1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
261 ctx->pic.pict_type = FF_I_TYPE;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
262 } else {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
263 ctx->pic.key_frame = 0;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
264 ctx->pic.pict_type = FF_P_TYPE;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
265 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
266
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
267 /* if palette has been changed, copy it from palctrl */
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
268 if (ctx->avctx->palctrl && ctx->avctx->palctrl->palette_changed) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
269 memcpy(ctx->pal, ctx->avctx->palctrl->palette, AVPALETTE_SIZE);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
270 ctx->setpal = 1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
271 ctx->avctx->palctrl->palette_changed = 0;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
272 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
273
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
274 if (header & KMVC_PALETTE) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
275 ctx->pic.palette_has_changed = 1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
276 // palette starts from index 1 and has 127 entries
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
277 for (i = 1; i <= ctx->palsize; i++) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
278 ctx->pal[i] = (buf[0] << 16) | (buf[1] << 8) | buf[2];
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
279 buf += 3;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
280 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
281 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
282
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
283 if (ctx->setpal) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
284 ctx->setpal = 0;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
285 ctx->pic.palette_has_changed = 1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
286 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
287
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
288 /* make the palette available on the way out */
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
289 memcpy(ctx->pic.data[1], ctx->pal, 1024);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
290
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
291 blocksize = *buf++;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
292
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
293 if (blocksize != 8 && blocksize != 127) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
294 av_log(avctx, AV_LOG_ERROR, "Block size = %i\n", blocksize);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
295 return -1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
296 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
297 memset(ctx->cur, 0, 320 * 200);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
298 switch (header & KMVC_METHOD) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
299 case 0:
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
300 case 1: // used in palette changed event
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
301 memcpy(ctx->cur, ctx->prev, 320 * 200);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
302 break;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
303 case 3:
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
304 kmvc_decode_intra_8x8(ctx, buf, avctx->width, avctx->height);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
305 break;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
306 case 4:
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
307 kmvc_decode_inter_8x8(ctx, buf, avctx->width, avctx->height);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
308 break;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
309 default:
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
310 av_log(avctx, AV_LOG_ERROR, "Unknown compression method %i\n", header & KMVC_METHOD);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
311 return -1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
312 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
313
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
314 out = ctx->pic.data[0];
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
315 src = ctx->cur;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
316 for (i = 0; i < avctx->height; i++) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
317 memcpy(out, src, avctx->width);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
318 src += 320;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
319 out += ctx->pic.linesize[0];
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
320 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
321
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
322 /* flip buffers */
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
323 if (ctx->cur == ctx->frm0) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
324 ctx->cur = ctx->frm1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
325 ctx->prev = ctx->frm0;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
326 } else {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
327 ctx->cur = ctx->frm0;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
328 ctx->prev = ctx->frm1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
329 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
330
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
331 *data_size = sizeof(AVFrame);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
332 *(AVFrame *) data = ctx->pic;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
333
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
334 /* always report that the buffer was completely consumed */
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
335 return buf_size;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
336 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
337
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
338
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
339
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
340 /*
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
341 * Init kmvc decoder
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
342 */
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
343 static int decode_init(AVCodecContext * avctx)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
344 {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
345 KmvcContext *const c = (KmvcContext *) avctx->priv_data;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
346 int i;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
347
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
348 c->avctx = avctx;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
349 avctx->has_b_frames = 0;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
350
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
351 c->pic.data[0] = NULL;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
352
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
353 if (avctx->width > 320 || avctx->height > 200) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
354 av_log(avctx, AV_LOG_ERROR, "KMVC supports frames <= 320x200\n");
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
355 return -1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
356 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
357
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
358 c->frm0 = av_mallocz(320 * 200);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
359 c->frm1 = av_mallocz(320 * 200);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
360 c->cur = c->frm0;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
361 c->prev = c->frm1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
362
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
363 for (i = 0; i < 256; i++) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
364 c->pal[i] = i * 0x10101;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
365 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
366
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
367 if (avctx->extradata_size < 12) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
368 av_log(NULL, 0, "Extradata missing, decoding may not work properly...\n");
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
369 c->palsize = 127;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
370 } else {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
371 c->palsize = LE_16(avctx->extradata + 10);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
372 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
373
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
374 if (avctx->extradata_size == 1036) { // palette in extradata
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
375 uint8_t *src = avctx->extradata + 12;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
376 for (i = 0; i < 256; i++) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
377 c->pal[i] = LE_32(src);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
378 src += 4;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
379 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
380 c->setpal = 1;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
381 if (c->avctx->palctrl) {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
382 c->avctx->palctrl->palette_changed = 0;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
383 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
384 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
385
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
386 avctx->pix_fmt = PIX_FMT_PAL8;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
387
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
388 return 0;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
389 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
390
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
391
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
392
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
393 /*
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
394 * Uninit kmvc decoder
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
395 */
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
396 static int decode_end(AVCodecContext * avctx)
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
397 {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
398 KmvcContext *const c = (KmvcContext *) avctx->priv_data;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
399
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
400 av_freep(&c->frm0);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
401 av_freep(&c->frm1);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
402 if (c->pic.data[0])
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
403 avctx->release_buffer(avctx, &c->pic);
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
404
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
405 return 0;
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
406 }
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
407
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
408 AVCodec kmvc_decoder = {
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
409 "kmvc",
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
410 CODEC_TYPE_VIDEO,
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
411 CODEC_ID_KMVC,
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
412 sizeof(KmvcContext),
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
413 decode_init,
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
414 NULL,
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
415 decode_end,
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
416 decode_frame
e8776388b02a [svn] - add ffmpeg
nenolod
parents:
diff changeset
417 };