Lines Matching defs:buf
61 uint8_t buf[IOBUF_SIZE];
227 const uint8_t *buf, int length)
238 crc = av_crc(crc_table, crc, buf, length);
239 if (*f != buf)
240 memcpy(*f, buf, length);
247 const uint8_t *buf, int length)
254 png_write_chunk(&s->bytestream, MKTAG('I', 'D', 'A', 'T'), buf, length);
264 crc = av_crc(crc_table, crc, buf, length);
265 memcpy(s->bytestream, buf, length);
288 png_write_image_data(avctx, s->buf, IOBUF_SIZE);
290 zstream->next_out = s->buf;
296 #define AV_WB32_PNG(buf, n) AV_WB32(buf, lrint((n) * 100000))
297 static int png_get_chrm(enum AVColorPrimaries prim, uint8_t *buf)
332 AV_WB32_PNG(buf , wx); AV_WB32_PNG(buf + 4 , wy);
333 AV_WB32_PNG(buf + 8 , rx); AV_WB32_PNG(buf + 12, ry);
334 AV_WB32_PNG(buf + 16, gx); AV_WB32_PNG(buf + 20, gy);
335 AV_WB32_PNG(buf + 24, bx); AV_WB32_PNG(buf + 28, by);
339 static int png_get_gama(enum AVColorTransferCharacteristic trc, uint8_t *buf)
345 AV_WB32_PNG(buf, 1.0 / gamma);
354 uint8_t *start, *buf;
364 buf = start;
371 bytestream_put_byte(&buf, c);
377 bytestream_put_byte(&buf, 0);
378 zstream->next_out = buf;
379 zstream->avail_out = s->bytestream_end - buf;
398 AV_WB32(s->buf, avctx->width);
399 AV_WB32(s->buf + 4, avctx->height);
400 s->buf[8] = s->bit_depth;
401 s->buf[9] = s->color_type;
402 s->buf[10] = 0; /* compression type */
403 s->buf[11] = 0; /* filter type */
404 s->buf[12] = s->is_progressive; /* interlace type */
405 png_write_chunk(&s->bytestream, MKTAG('I', 'H', 'D', 'R'), s->buf, 13);
409 AV_WB32(s->buf, s->dpm);
410 AV_WB32(s->buf + 4, s->dpm);
411 s->buf[8] = 1; /* unit specifier is meter */
413 AV_WB32(s->buf, avctx->sample_aspect_ratio.num);
414 AV_WB32(s->buf + 4, avctx->sample_aspect_ratio.den);
415 s->buf[8] = 0; /* unit specifier is unknown */
417 png_write_chunk(&s->bytestream, MKTAG('p', 'H', 'Y', 's'), s->buf, 9);
425 s->buf[0] = ((stereo3d->flags & AV_STEREO3D_FLAG_INVERT) == 0) ? 1 : 0;
426 png_write_chunk(&s->bytestream, MKTAG('s', 'T', 'E', 'R'), s->buf, 1);
439 s->buf[0] = 1; /* rendering intent, relative colorimetric by default */
440 png_write_chunk(&s->bytestream, MKTAG('s', 'R', 'G', 'B'), s->buf, 1);
443 if (png_get_chrm(pict->color_primaries, s->buf))
444 png_write_chunk(&s->bytestream, MKTAG('c', 'H', 'R', 'M'), s->buf, 32);
445 if (png_get_gama(pict->color_trc, s->buf))
446 png_write_chunk(&s->bytestream, MKTAG('g', 'A', 'M', 'A'), s->buf, 4);
460 ptr = s->buf;
461 alpha_ptr = s->buf + 256 * 3;
472 MKTAG('P', 'L', 'T', 'E'), s->buf, 256 * 3);
475 MKTAG('t', 'R', 'N', 'S'), s->buf + 256 * 3, 256);
514 zstream->next_out = s->buf;
554 png_write_image_data(avctx, s->buf, len);
557 zstream->next_out = s->buf;
1005 uint8_t buf[APNG_FCTL_CHUNK_SIZE];
1014 AV_WB32(buf + 0, s->last_frame_fctl.sequence_number);
1015 AV_WB32(buf + 4, s->last_frame_fctl.width);
1016 AV_WB32(buf + 8, s->last_frame_fctl.height);
1017 AV_WB32(buf + 12, s->last_frame_fctl.x_offset);
1018 AV_WB32(buf + 16, s->last_frame_fctl.y_offset);
1019 AV_WB16(buf + 20, s->last_frame_fctl.delay_num);
1020 AV_WB16(buf + 22, s->last_frame_fctl.delay_den);
1021 buf[24] = s->last_frame_fctl.dispose_op;
1022 buf[25] = s->last_frame_fctl.blend_op;
1023 png_write_chunk(&last_fctl_chunk_start, MKTAG('f', 'c', 'T', 'L'), buf, sizeof(buf));