1 /*
2 * FFV1 codec for libavcodec
3 *
4 * Copyright (c) 2003-2013 Michael Niedermayer <michaelni@gmx.at>
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 /**
24 * @file
25 * FF Video Codec 1 (a lossless codec)
26 */
27
41
43 {
45
48
51
56
59
60 // defaults
63
64 return 0;
65 }
66
68 {
69 int j, i;
70
75
82 } else {
90 }
91 }
92 }
93 }
94
96 //FIXME only redo if state_transition changed
97 for (j = 1; j < 256; j++) {
100 }
101 }
102
103 return 0;
104 }
105
107 {
108 int i, ret;
113 }
114 return 0;
115 }
116
118 {
119 int i;
120
123
132
133 if (!fs)
134 goto memfail;
135
137 memcpy(fs, f, sizeof(*fs));
139
144
149 goto memfail;
150 }
151 }
152 return 0;
153
154 memfail:
155 while(--i >= 0) {
158 }
160 }
161
163 {
164 int i;
165
173 }
174 return 0;
175 }
176
178 {
179 int i, j;
180
183
186
191 } else
193 } else {
199 }
200 }
201 }
202 }
203
204
206 {
208 int i, j;
209
213
217
222
225 }
227 }
228
235 }
237 }
238
241
242 return 0;
243 }
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
uint64_t(*[MAX_QUANT_TABLES] rc_stat2)[32][2]
FF Video Codec 1 (a lossless codec)
Macro definitions for various function/variable attributes.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
av_cold int ff_ffv1_common_init(AVCodecContext *avctx)
uint8_t(*[MAX_QUANT_TABLES] initial_states)[32]
av_cold int ff_ffv1_close(AVCodecContext *avctx)
char * stats_out
pass1 encoding statistics output buffer
high precision timer, useful to profile code
av_cold int ff_ffv1_init_slices_state(FFV1Context *f)
void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
Wrapper around release_buffer() frame-for multithreaded codecs.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int flags
AV_CODEC_FLAG_*.
simple assert() macros that are a bit more flexible than ISO C assert().
int ff_ffv1_allocate_initial_states(FFV1Context *f)
int ac
1=range coder <-> 0=golomb rice
#define AC_RANGE_CUSTOM_TAB
uint8_t state_transition[256]
int width
picture width / height.
av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
int context_count[MAX_QUANT_TABLES]
Libavcodec external API header.
main external API structure.
common internal api header.
void ff_ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs)
uint8_t(* state)[CONTEXT_SIZE]
PlaneContext plane[MAX_PLANES]
struct FFV1Context * slice_context[MAX_SLICES]
static void * av_mallocz_array(size_t nmemb, size_t size)
uint8_t interlace_bit_state[2]
#define av_malloc_array(a, b)
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...