FFmpeg
Loading...
Searching...
No Matches
pnmdec.c
Go to the documentation of this file.
1/*
2 * PNM image format
3 * Copyright (c) 2002, 2003 Fabrice Bellard
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#include "config_components.h"
23
25#include "libavutil/intfloat.h"
26
27#include "avcodec.h"
28#include "codec_internal.h"
29#include "decode.h"
30#include "put_bits.h"
31#include "pnm.h"
32
33static void samplecpy(uint8_t *dst, const uint8_t *src, int n, int maxval)
34{
35 if (maxval <= 255) {
36 memcpy(dst, src, n);
37 } else {
38 int i;
39 for (i=0; i<n/2; i++) {
40 ((uint16_t *)dst)[i] = AV_RB16(src+2*i);
41 }
42 }
43}
44
46 int *got_frame, AVPacket *avpkt)
47{
48 const uint8_t *buf = avpkt->data;
49 int buf_size = avpkt->size;
50 PNMContext * const s = avctx->priv_data;
51 int i, j, k, n, linesize, h, upgrade = 0, is_mono = 0;
52 unsigned char *ptr;
53 int components, sample_len, ret;
54 float scale;
55
56 s->bytestream_start =
57 s->bytestream = buf;
58 s->bytestream_end = buf + buf_size;
59
60 if ((ret = ff_pnm_decode_header(avctx, s)) < 0)
61 return ret;
62
63 if (avctx->skip_frame >= AVDISCARD_ALL)
64 return avpkt->size;
65
66 if (avctx->width * avctx->height / 8 > s->bytestream_end - s->bytestream)
68
69 if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
70 return ret;
71 avctx->bits_per_raw_sample = av_log2(s->maxval) + 1;
72
73 switch (avctx->pix_fmt) {
74 default:
75 return AVERROR(EINVAL);
77 n = avctx->width * 8;
78 components=4;
79 sample_len=16;
80 if (s->maxval < 65535)
81 upgrade = 2;
82 goto do_read;
84 n = avctx->width * 6;
85 components=3;
86 sample_len=16;
87 if (s->maxval < 65535)
88 upgrade = 2;
89 goto do_read;
90 case AV_PIX_FMT_RGBA:
91 n = avctx->width * 4;
92 components=4;
93 sample_len=8;
94 goto do_read;
96 n = avctx->width * 3;
97 components=3;
98 sample_len=8;
99 if (s->maxval < 255)
100 upgrade = 1;
101 goto do_read;
102 case AV_PIX_FMT_GRAY8:
103 n = avctx->width;
104 components=1;
105 sample_len=8;
106 if (s->maxval < 255)
107 upgrade = 1;
108 goto do_read;
110 n = avctx->width * 2;
111 components=2;
112 sample_len=8;
113 goto do_read;
115 n = avctx->width * 2;
116 components=1;
117 sample_len=16;
118 if (s->maxval < 65535)
119 upgrade = 2;
120 goto do_read;
121 case AV_PIX_FMT_YA16:
122 n = avctx->width * 4;
123 components=2;
124 sample_len=16;
125 if (s->maxval < 65535)
126 upgrade = 2;
127 goto do_read;
130 n = (avctx->width + 7) >> 3;
131 components=1;
132 sample_len=1;
133 is_mono = 1;
134 do_read:
135 ptr = p->data[0];
136 linesize = p->linesize[0];
137 if (n * avctx->height > s->bytestream_end - s->bytestream)
138 return AVERROR_INVALIDDATA;
139 if(s->type < 4 || (is_mono && s->type==7)){
140 for (i=0; i<avctx->height; i++) {
141 PutBitContext pb;
142 init_put_bits(&pb, ptr, FFABS(linesize));
143 for(j=0; j<avctx->width * components; j++){
144 unsigned int c=0;
145 unsigned v=0;
146 if(s->type < 4)
147 while(s->bytestream < s->bytestream_end && (*s->bytestream < '0' || *s->bytestream > '9' ))
148 s->bytestream++;
149 if(s->bytestream >= s->bytestream_end)
150 return AVERROR_INVALIDDATA;
151 if (is_mono) {
152 /* read a single digit */
153 v = (*s->bytestream++)&1;
154 } else {
155 /* read a sequence of digits */
156 for (k = 0; k < 6 && c <= 9; k += 1) {
157 v = 10*v + c;
158 c = (*s->bytestream++) - '0';
159 }
160 if (v > s->maxval) {
161 av_log(avctx, AV_LOG_ERROR, "value %d larger than maxval %d\n", v, s->maxval);
162 return AVERROR_INVALIDDATA;
163 }
164 }
165 if (sample_len == 16) {
166 ((uint16_t*)ptr)[j] = (((1<<sample_len)-1)*v + (s->maxval>>1))/s->maxval;
167 } else
168 put_bits(&pb, sample_len, (((1<<sample_len)-1)*v + (s->maxval>>1))/s->maxval);
169 }
170 if (sample_len != 16)
171 flush_put_bits(&pb);
172 ptr+= linesize;
173 }
174 }else{
175 for (int i = 0; i < avctx->height; i++) {
176 if (!upgrade)
177 samplecpy(ptr, s->bytestream, n, s->maxval);
178 else if (upgrade == 1) {
179 unsigned int f = (255 * 128 + s->maxval / 2) / s->maxval;
180 for (unsigned j = 0; j < n; j++)
181 ptr[j] = (s->bytestream[j] * f + 64) >> 7;
182 } else if (upgrade == 2) {
183 unsigned int f = (65535 * 32768 + s->maxval / 2) / s->maxval;
184 for (unsigned j = 0; j < n / 2; j++) {
185 unsigned v = AV_RB16(s->bytestream + 2*j);
186 ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15;
187 }
188 }
189 s->bytestream += n;
190 ptr += linesize;
191 }
192 }
193 break;
197 {
198 unsigned char *ptr1, *ptr2;
199
200 n = avctx->width;
201 ptr = p->data[0];
202 linesize = p->linesize[0];
203 if (s->maxval >= 256)
204 n *= 2;
205 if (n * avctx->height * 3 / 2 > s->bytestream_end - s->bytestream)
206 return AVERROR_INVALIDDATA;
207 for (i = 0; i < avctx->height; i++) {
208 samplecpy(ptr, s->bytestream, n, s->maxval);
209 s->bytestream += n;
210 ptr += linesize;
211 }
212 ptr1 = p->data[1];
213 ptr2 = p->data[2];
214 n >>= 1;
215 h = avctx->height >> 1;
216 for (i = 0; i < h; i++) {
217 samplecpy(ptr1, s->bytestream, n, s->maxval);
218 s->bytestream += n;
219 samplecpy(ptr2, s->bytestream, n, s->maxval);
220 s->bytestream += n;
221 ptr1 += p->linesize[1];
222 ptr2 += p->linesize[2];
223 }
224 }
225 break;
227 {
228 uint16_t *ptr1, *ptr2;
229 const int f = (65535 * 32768 + s->maxval / 2) / s->maxval;
230 unsigned int j, v;
231
232 n = avctx->width * 2;
233 ptr = p->data[0];
234 linesize = p->linesize[0];
235 if (n * avctx->height * 3 / 2 > s->bytestream_end - s->bytestream)
236 return AVERROR_INVALIDDATA;
237 for (i = 0; i < avctx->height; i++) {
238 for (j = 0; j < n / 2; j++) {
239 v = AV_RB16(s->bytestream + 2*j);
240 ((uint16_t *)ptr)[j] = (v * f + 16384) >> 15;
241 }
242 s->bytestream += n;
243 ptr += linesize;
244 }
245 ptr1 = (uint16_t*)p->data[1];
246 ptr2 = (uint16_t*)p->data[2];
247 n >>= 1;
248 h = avctx->height >> 1;
249 for (i = 0; i < h; i++) {
250 for (j = 0; j < n / 2; j++) {
251 v = AV_RB16(s->bytestream + 2*j);
252 ptr1[j] = (v * f + 16384) >> 15;
253 }
254 s->bytestream += n;
255
256 for (j = 0; j < n / 2; j++) {
257 v = AV_RB16(s->bytestream + 2*j);
258 ptr2[j] = (v * f + 16384) >> 15;
259 }
260 s->bytestream += n;
261
262 ptr1 += p->linesize[1] / 2;
263 ptr2 += p->linesize[2] / 2;
264 }
265 }
266 break;
268 if (!s->half) {
269 if (avctx->width * avctx->height * 12LL > s->bytestream_end - s->bytestream)
270 return AVERROR_INVALIDDATA;
271 scale = 1.f / s->scale;
272 if (s->endian) {
273 float *r, *g, *b;
274
275 r = (float *)p->data[2];
276 g = (float *)p->data[0];
277 b = (float *)p->data[1];
278 for (int i = 0; i < avctx->height; i++) {
279 for (int j = 0; j < avctx->width; j++) {
280 r[j] = av_int2float(AV_RL32(s->bytestream+0)) * scale;
281 g[j] = av_int2float(AV_RL32(s->bytestream+4)) * scale;
282 b[j] = av_int2float(AV_RL32(s->bytestream+8)) * scale;
283 s->bytestream += 12;
284 }
285
286 r += p->linesize[2] / 4;
287 g += p->linesize[0] / 4;
288 b += p->linesize[1] / 4;
289 }
290 } else {
291 float *r, *g, *b;
292
293 r = (float *)p->data[2];
294 g = (float *)p->data[0];
295 b = (float *)p->data[1];
296 for (int i = 0; i < avctx->height; i++) {
297 for (int j = 0; j < avctx->width; j++) {
298 r[j] = av_int2float(AV_RB32(s->bytestream+0)) * scale;
299 g[j] = av_int2float(AV_RB32(s->bytestream+4)) * scale;
300 b[j] = av_int2float(AV_RB32(s->bytestream+8)) * scale;
301 s->bytestream += 12;
302 }
303
304 r += p->linesize[2] / 4;
305 g += p->linesize[0] / 4;
306 b += p->linesize[1] / 4;
307 }
308 }
309 } else {
310 if (avctx->width * avctx->height * 6 > s->bytestream_end - s->bytestream)
311 return AVERROR_INVALIDDATA;
312 scale = 1.f / s->scale;
313 if (s->endian) {
314 float *r, *g, *b;
315
316 r = (float *)p->data[2];
317 g = (float *)p->data[0];
318 b = (float *)p->data[1];
319 for (int i = 0; i < avctx->height; i++) {
320 for (int j = 0; j < avctx->width; j++) {
321 r[j] = av_int2float(half2float(AV_RL16(s->bytestream+0), &s->h2f_tables)) * scale;
322 g[j] = av_int2float(half2float(AV_RL16(s->bytestream+2), &s->h2f_tables)) * scale;
323 b[j] = av_int2float(half2float(AV_RL16(s->bytestream+4), &s->h2f_tables)) * scale;
324 s->bytestream += 6;
325 }
326
327 r += p->linesize[2] / 4;
328 g += p->linesize[0] / 4;
329 b += p->linesize[1] / 4;
330 }
331 } else {
332 float *r, *g, *b;
333
334 r = (float *)p->data[2];
335 g = (float *)p->data[0];
336 b = (float *)p->data[1];
337 for (int i = 0; i < avctx->height; i++) {
338 for (int j = 0; j < avctx->width; j++) {
339 r[j] = av_int2float(half2float(AV_RB16(s->bytestream+0), &s->h2f_tables)) * scale;
340 g[j] = av_int2float(half2float(AV_RB16(s->bytestream+2), &s->h2f_tables)) * scale;
341 b[j] = av_int2float(half2float(AV_RB16(s->bytestream+4), &s->h2f_tables)) * scale;
342 s->bytestream += 6;
343 }
344
345 r += p->linesize[2] / 4;
346 g += p->linesize[0] / 4;
347 b += p->linesize[1] / 4;
348 }
349 }
350 }
351 /* PFM is encoded from bottom to top */
352 p->data[0] += (avctx->height - 1) * p->linesize[0];
353 p->data[1] += (avctx->height - 1) * p->linesize[1];
354 p->data[2] += (avctx->height - 1) * p->linesize[2];
355 p->linesize[0] = -p->linesize[0];
356 p->linesize[1] = -p->linesize[1];
357 p->linesize[2] = -p->linesize[2];
358 break;
360 if (!s->half) {
361 if (avctx->width * avctx->height * 4 > s->bytestream_end - s->bytestream)
362 return AVERROR_INVALIDDATA;
363 scale = 1.f / s->scale;
364 if (s->endian) {
365 float *g = (float *)p->data[0];
366 for (int i = 0; i < avctx->height; i++) {
367 for (int j = 0; j < avctx->width; j++) {
368 g[j] = av_int2float(AV_RL32(s->bytestream)) * scale;
369 s->bytestream += 4;
370 }
371 g += p->linesize[0] / 4;
372 }
373 } else {
374 float *g = (float *)p->data[0];
375 for (int i = 0; i < avctx->height; i++) {
376 for (int j = 0; j < avctx->width; j++) {
377 g[j] = av_int2float(AV_RB32(s->bytestream)) * scale;
378 s->bytestream += 4;
379 }
380 g += p->linesize[0] / 4;
381 }
382 }
383 } else {
384 if (avctx->width * avctx->height * 2 > s->bytestream_end - s->bytestream)
385 return AVERROR_INVALIDDATA;
386 scale = 1.f / s->scale;
387 if (s->endian) {
388 float *g = (float *)p->data[0];
389 for (int i = 0; i < avctx->height; i++) {
390 for (int j = 0; j < avctx->width; j++) {
391 g[j] = av_int2float(half2float(AV_RL16(s->bytestream), &s->h2f_tables)) * scale;
392 s->bytestream += 2;
393 }
394 g += p->linesize[0] / 4;
395 }
396 } else {
397 float *g = (float *)p->data[0];
398 for (int i = 0; i < avctx->height; i++) {
399 for (int j = 0; j < avctx->width; j++) {
400 g[j] = av_int2float(half2float(AV_RB16(s->bytestream), &s->h2f_tables)) * scale;
401 s->bytestream += 2;
402 }
403 g += p->linesize[0] / 4;
404 }
405 }
406 }
407 /* PFM is encoded from bottom to top */
408 p->data[0] += (avctx->height - 1) * p->linesize[0];
409 p->linesize[0] = -p->linesize[0];
410 break;
411 }
412 *got_frame = 1;
413
414 return s->bytestream - s->bytestream_start;
415}
416
417
418#if CONFIG_PGM_DECODER
419const FFCodec ff_pgm_decoder = {
420 .p.name = "pgm",
421 CODEC_LONG_NAME("PGM (Portable GrayMap) image"),
422 .p.type = AVMEDIA_TYPE_VIDEO,
423 .p.id = AV_CODEC_ID_PGM,
424 .p.capabilities = AV_CODEC_CAP_DR1,
425 .priv_data_size = sizeof(PNMContext),
426 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
428};
429#endif
430
431#if CONFIG_PGMYUV_DECODER
433 .p.name = "pgmyuv",
434 CODEC_LONG_NAME("PGMYUV (Portable GrayMap YUV) image"),
435 .p.type = AVMEDIA_TYPE_VIDEO,
436 .p.id = AV_CODEC_ID_PGMYUV,
437 .p.capabilities = AV_CODEC_CAP_DR1,
438 .priv_data_size = sizeof(PNMContext),
439 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
441};
442#endif
443
444#if CONFIG_PPM_DECODER
445const FFCodec ff_ppm_decoder = {
446 .p.name = "ppm",
447 CODEC_LONG_NAME("PPM (Portable PixelMap) image"),
448 .p.type = AVMEDIA_TYPE_VIDEO,
449 .p.id = AV_CODEC_ID_PPM,
450 .p.capabilities = AV_CODEC_CAP_DR1,
451 .priv_data_size = sizeof(PNMContext),
452 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
454};
455#endif
456
457#if CONFIG_PBM_DECODER
458const FFCodec ff_pbm_decoder = {
459 .p.name = "pbm",
460 CODEC_LONG_NAME("PBM (Portable BitMap) image"),
461 .p.type = AVMEDIA_TYPE_VIDEO,
462 .p.id = AV_CODEC_ID_PBM,
463 .p.capabilities = AV_CODEC_CAP_DR1,
464 .priv_data_size = sizeof(PNMContext),
465 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
467};
468#endif
469
470#if CONFIG_PAM_DECODER
471const FFCodec ff_pam_decoder = {
472 .p.name = "pam",
473 CODEC_LONG_NAME("PAM (Portable AnyMap) image"),
474 .p.type = AVMEDIA_TYPE_VIDEO,
475 .p.id = AV_CODEC_ID_PAM,
476 .p.capabilities = AV_CODEC_CAP_DR1,
477 .priv_data_size = sizeof(PNMContext),
478 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
480};
481#endif
482
483#if CONFIG_PFM_DECODER
484const FFCodec ff_pfm_decoder = {
485 .p.name = "pfm",
486 CODEC_LONG_NAME("PFM (Portable FloatMap) image"),
487 .p.type = AVMEDIA_TYPE_VIDEO,
488 .p.id = AV_CODEC_ID_PFM,
489 .p.capabilities = AV_CODEC_CAP_DR1,
490 .priv_data_size = sizeof(PNMContext),
491 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
493};
494#endif
495
496#if CONFIG_PHM_DECODER
497static av_cold int phm_dec_init(AVCodecContext *avctx)
498{
499 PNMContext *s = avctx->priv_data;
500
501 ff_init_half2float_tables(&s->h2f_tables);
502
503 return 0;
504}
505
506const FFCodec ff_phm_decoder = {
507 .p.name = "phm",
508 CODEC_LONG_NAME("PHM (Portable HalfFloatMap) image"),
509 .p.type = AVMEDIA_TYPE_VIDEO,
510 .p.id = AV_CODEC_ID_PHM,
511 .p.capabilities = AV_CODEC_CAP_DR1,
512 .priv_data_size = sizeof(PNMContext),
513 .init = phm_dec_init,
514 .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
516};
517#endif
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
const FFCodec ff_pgmyuv_decoder
const FFCodec ff_pgm_decoder
const FFCodec ff_ppm_decoder
const FFCodec ff_phm_decoder
const FFCodec ff_pbm_decoder
const FFCodec ff_pam_decoder
const FFCodec ff_pfm_decoder
Libavcodec external API header.
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define f(width, name)
Definition cbs_vp8.c:236
#define s(width, name)
Definition cbs_vp9.c:198
#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
The decoder extracts and fills its parameters even if the frame is skipped due to the skip_frame sett...
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition common.h:74
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition decode.c:1777
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
@ AV_CODEC_ID_PGM
Definition codec_id.h:114
@ AV_CODEC_ID_PHM
Definition codec_id.h:310
@ AV_CODEC_ID_PAM
Definition codec_id.h:116
@ AV_CODEC_ID_PBM
Definition codec_id.h:113
@ AV_CODEC_ID_PGMYUV
Definition codec_id.h:115
@ AV_CODEC_ID_PPM
Definition codec_id.h:112
@ AV_CODEC_ID_PFM
Definition codec_id.h:298
@ AVDISCARD_ALL
discard all
Definition defs.h:232
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition error.h:61
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static uint32_t half2float(uint16_t h, const Half2FloatTables *t)
Definition half2float.h:39
#define r
Definition input.c:42
#define b
Definition input.c:43
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
Definition intfloat.h:40
#define av_log2
Definition intmath.h:84
static void scale(int *out, const int *in, const int w, const int h, const int shift)
Definition intra.c:278
#define AV_RL32(p)
#define AV_RB32(p)
#define AV_RL16(p)
#define AV_RB16(p)
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
Definition j2kenc.c:154
#define av_cold
Definition attributes.h:117
void ff_init_half2float_tables(Half2FloatTables *t)
Definition half2float.c:39
#define AV_PIX_FMT_YUV420P16
Definition pixfmt.h:556
#define AV_PIX_FMT_GBRPF32
Definition pixfmt.h:584
#define AV_PIX_FMT_YUV420P10
Definition pixfmt.h:545
#define AV_PIX_FMT_YA16
Definition pixfmt.h:530
#define AV_PIX_FMT_RGBA64
Definition pixfmt.h:535
#define AV_PIX_FMT_YUV420P9
Definition pixfmt.h:542
#define AV_PIX_FMT_RGB48
Definition pixfmt.h:531
#define AV_PIX_FMT_GRAYF32
Definition pixfmt.h:588
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition pixfmt.h:75
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
Definition pixfmt.h:83
@ AV_PIX_FMT_GRAY8A
alias for AV_PIX_FMT_YA8
Definition pixfmt.h:143
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition pixfmt.h:100
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
Definition pixfmt.h:82
#define AV_PIX_FMT_GRAY16
Definition pixfmt.h:528
int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext *const s)
Definition pnm.c:65
static int pnm_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
Definition pnmdec.c:45
static void samplecpy(uint8_t *dst, const uint8_t *src, int n, int maxval)
Definition pnmdec.c:33
bitstream writer API
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
Definition put_bits.h:62
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
Definition put_bits.h:153
main external API structure.
Definition avcodec.h:443
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition avcodec.h:643
int width
picture width / height.
Definition avcodec.h:604
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
Definition avcodec.h:1571
void * priv_data
Definition avcodec.h:470
enum AVDiscard skip_frame
Skip decoding for selected frames.
Definition avcodec.h:1667
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
This structure stores compressed data.
Definition packet.h:580
int size
Definition packet.h:604
uint8_t * data
Definition packet.h:603
#define av_log(a,...)
#define src
Definition vp8dsp.c:248
const char * g
Definition vf_curves.c:128
static double c[64]