Mercurial > libavcodec.hg
annotate wnv1.c @ 11311:ee2e050815be libavcodec
Fix avcodec_align_dimensions to return values suitably aligned for FLV decoding
with SSE and add a avcodec_align_dimensions2 taht returns the stride alignment
requirements independently from doing the width/height padding.
author | reimar |
---|---|
date | Sat, 27 Feb 2010 21:13:22 +0000 |
parents | bdf4a9ca162a |
children | 8a4984c5cacc |
rev | line source |
---|---|
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
1 /* |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
2 * Winnov WNV1 codec |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
3 * Copyright (c) 2005 Konstantin Shishkov |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
4 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3036
diff
changeset
|
5 * This file is part of FFmpeg. |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3036
diff
changeset
|
6 * |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3036
diff
changeset
|
7 * FFmpeg is free software; you can redistribute it and/or |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
9 * License as published by the Free Software Foundation; either |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3036
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
11 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3036
diff
changeset
|
12 * FFmpeg is distributed in the hope that it will be useful, |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
15 * Lesser General Public License for more details. |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
16 * |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3036
diff
changeset
|
18 * License along with FFmpeg; if not, write to the Free Software |
3036
0b546eab515d
Update licensing information: The FSF changed postal address.
diego
parents:
2967
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
20 */ |
2967 | 21 |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
22 /** |
8718
e9d9d946f213
Use full internal pathname in doxygen @file directives.
diego
parents:
7129
diff
changeset
|
23 * @file libavcodec/wnv1.c |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
24 * Winnov WNV1 codec. |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
25 */ |
2967 | 26 |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
27 #include "avcodec.h" |
9428 | 28 #include "get_bits.h" |
10501
bdf4a9ca162a
Move ff_reverse in libavcodec to av_reverse in libavutil.
cehoyos
parents:
10413
diff
changeset
|
29 #include "libavutil/common.h" |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
30 |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
31 |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
32 typedef struct WNV1Context{ |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
33 AVCodecContext *avctx; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
34 AVFrame pic; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
35 |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
36 int shift; |
2579
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
37 GetBitContext gb; |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
38 } WNV1Context; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
39 |
7129 | 40 static const uint16_t code_tab[16][2]={ |
2579
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
41 {0x1FD,9}, {0xFD,8}, {0x7D,7}, {0x3D,6}, {0x1D,5}, {0x0D,4}, {0x005,3}, |
2967 | 42 {0x000,1}, |
2579
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
43 {0x004,3}, {0x0C,4}, {0x1C,5}, {0x3C,6}, {0x7C,7}, {0xFC,8}, {0x1FC,9}, {0xFF,8} |
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
44 }; |
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
45 |
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
46 #define CODE_VLC_BITS 9 |
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
47 static VLC code_vlc; |
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
48 |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
49 /* returns modified base_value */ |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
50 static inline int wnv1_get_code(WNV1Context *w, int base_value) |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
51 { |
2579
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
52 int v = get_vlc2(&w->gb, code_vlc.table, CODE_VLC_BITS, 1); |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
53 |
2579
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
54 if(v==15) |
10501
bdf4a9ca162a
Move ff_reverse in libavcodec to av_reverse in libavutil.
cehoyos
parents:
10413
diff
changeset
|
55 return av_reverse[ get_bits(&w->gb, 8 - w->shift) ]; |
2579
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
56 else |
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
57 return base_value + ((v - 7)<<w->shift); |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
58 } |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
59 |
2967 | 60 static int decode_frame(AVCodecContext *avctx, |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
61 void *data, int *data_size, |
9355
54bc8a2727b0
Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an
rbultje
parents:
8725
diff
changeset
|
62 AVPacket *avpkt) |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
63 { |
9355
54bc8a2727b0
Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an
rbultje
parents:
8725
diff
changeset
|
64 const uint8_t *buf = avpkt->data; |
54bc8a2727b0
Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an
rbultje
parents:
8725
diff
changeset
|
65 int buf_size = avpkt->size; |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
66 WNV1Context * const l = avctx->priv_data; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
67 AVFrame * const p= (AVFrame*)&l->pic; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
68 unsigned char *Y,*U,*V; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
69 int i, j; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
70 int prev_y = 0, prev_u = 0, prev_v = 0; |
8725
66f5d619a8b3
Make WNV1 decoder use temporary buffer for bit-reversed input
kostya
parents:
8718
diff
changeset
|
71 uint8_t *rbuf; |
66f5d619a8b3
Make WNV1 decoder use temporary buffer for bit-reversed input
kostya
parents:
8718
diff
changeset
|
72 |
66f5d619a8b3
Make WNV1 decoder use temporary buffer for bit-reversed input
kostya
parents:
8718
diff
changeset
|
73 rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE); |
66f5d619a8b3
Make WNV1 decoder use temporary buffer for bit-reversed input
kostya
parents:
8718
diff
changeset
|
74 if(!rbuf){ |
66f5d619a8b3
Make WNV1 decoder use temporary buffer for bit-reversed input
kostya
parents:
8718
diff
changeset
|
75 av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n"); |
66f5d619a8b3
Make WNV1 decoder use temporary buffer for bit-reversed input
kostya
parents:
8718
diff
changeset
|
76 return -1; |
66f5d619a8b3
Make WNV1 decoder use temporary buffer for bit-reversed input
kostya
parents:
8718
diff
changeset
|
77 } |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
78 |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
79 if(p->data[0]) |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
80 avctx->release_buffer(avctx, p); |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
81 |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
82 p->reference = 0; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
83 if(avctx->get_buffer(avctx, p) < 0){ |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
84 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
8725
66f5d619a8b3
Make WNV1 decoder use temporary buffer for bit-reversed input
kostya
parents:
8718
diff
changeset
|
85 av_free(rbuf); |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
86 return -1; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
87 } |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
88 p->key_frame = 1; |
2579
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
89 |
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
90 for(i=8; i<buf_size; i++) |
10501
bdf4a9ca162a
Move ff_reverse in libavcodec to av_reverse in libavutil.
cehoyos
parents:
10413
diff
changeset
|
91 rbuf[i]= av_reverse[ buf[i] ]; |
8725
66f5d619a8b3
Make WNV1 decoder use temporary buffer for bit-reversed input
kostya
parents:
8718
diff
changeset
|
92 init_get_bits(&l->gb, rbuf+8, (buf_size-8)*8); |
2579
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
93 |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
94 if (buf[2] >> 4 == 6) |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
95 l->shift = 2; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
96 else { |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
97 l->shift = 8 - (buf[2] >> 4); |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
98 if (l->shift > 4) { |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
99 av_log(avctx, AV_LOG_ERROR, "Unknown WNV1 frame header value %i, please upload file for study\n", buf[2] >> 4); |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
100 l->shift = 4; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
101 } |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
102 if (l->shift < 1) { |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
103 av_log(avctx, AV_LOG_ERROR, "Unknown WNV1 frame header value %i, please upload file for study\n", buf[2] >> 4); |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
104 l->shift = 1; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
105 } |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
106 } |
2967 | 107 |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
108 Y = p->data[0]; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
109 U = p->data[1]; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
110 V = p->data[2]; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
111 for (j = 0; j < avctx->height; j++) { |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
112 for (i = 0; i < avctx->width / 2; i++) { |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
113 Y[i * 2] = wnv1_get_code(l, prev_y); |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
114 prev_u = U[i] = wnv1_get_code(l, prev_u); |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
115 prev_y = Y[(i * 2) + 1] = wnv1_get_code(l, Y[i * 2]); |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
116 prev_v = V[i] = wnv1_get_code(l, prev_v); |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
117 } |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
118 Y += p->linesize[0]; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
119 U += p->linesize[1]; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
120 V += p->linesize[2]; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
121 } |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
122 |
2967 | 123 |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
124 *data_size = sizeof(AVFrame); |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
125 *(AVFrame*)data = l->pic; |
8725
66f5d619a8b3
Make WNV1 decoder use temporary buffer for bit-reversed input
kostya
parents:
8718
diff
changeset
|
126 av_free(rbuf); |
2967 | 127 |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
128 return buf_size; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
129 } |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
130 |
6517
48759bfbd073
Apply 'cold' attribute to init/uninit functions in libavcodec
zuxy
parents:
5215
diff
changeset
|
131 static av_cold int decode_init(AVCodecContext *avctx){ |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
132 WNV1Context * const l = avctx->priv_data; |
9463
d719a2711c64
Use new static VLC scheme in Indeo2, Musepack and WNV1 decoders
kostya
parents:
9428
diff
changeset
|
133 static VLC_TYPE code_table[1 << CODE_VLC_BITS][2]; |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
134 |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
135 l->avctx = avctx; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
136 avctx->pix_fmt = PIX_FMT_YUV422P; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
137 |
9463
d719a2711c64
Use new static VLC scheme in Indeo2, Musepack and WNV1 decoders
kostya
parents:
9428
diff
changeset
|
138 code_vlc.table = code_table; |
d719a2711c64
Use new static VLC scheme in Indeo2, Musepack and WNV1 decoders
kostya
parents:
9428
diff
changeset
|
139 code_vlc.table_allocated = 1 << CODE_VLC_BITS; |
9464 | 140 init_vlc(&code_vlc, CODE_VLC_BITS, 16, |
141 &code_tab[0][1], 4, 2, | |
142 &code_tab[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC); | |
2579
e027765cf410
replace custom bitstream reader with get_bits/vlc()
michael
parents:
2577
diff
changeset
|
143 |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
144 return 0; |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
145 } |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
146 |
10399 | 147 static av_cold int decode_end(AVCodecContext *avctx){ |
148 WNV1Context * const l = avctx->priv_data; | |
149 AVFrame *pic = &l->pic; | |
150 | |
151 if (pic->data[0]) | |
152 avctx->release_buffer(avctx, pic); | |
153 | |
154 return 0; | |
155 } | |
156 | |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
157 AVCodec wnv1_decoder = { |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
158 "wnv1", |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
159 CODEC_TYPE_VIDEO, |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
160 CODEC_ID_WNV1, |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
161 sizeof(WNV1Context), |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
162 decode_init, |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
163 NULL, |
10399 | 164 decode_end, |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
165 decode_frame, |
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
166 CODEC_CAP_DR1, |
7040
e943e1409077
Make AVCodec long_names definition conditional depending on CONFIG_SMALL.
stefano
parents:
6710
diff
changeset
|
167 .long_name = NULL_IF_CONFIG_SMALL("Winnov WNV1"), |
2577
7d9997a69158
Winnov WNV1 video decoder, courtesy of Konstantin Shishkov
melanson
parents:
diff
changeset
|
168 }; |