87 int channel_offsets[4];
120 unsigned int exp = v >> 23;
123 if (exp <= 127 + 7 - 24)
128 return (v + (1 << 23)) >> (127 + 7 - exp);
140 unsigned exp = 14 - (v >> 10);
145 return (v & 0x8000) ? 0 : 0xffff;
148 return (v + (1 << 16)) >> (exp + 1);
157 int d = (int) t[-1] + (
int) t[0] - 128;
165 const int8_t *t1 = src;
166 const int8_t *t2 = src + (size + 1) / 2;
168 int8_t *stop = s +
size;
186 unsigned long dest_len = uncompressed_size;
188 if (uncompress(td->
tmp, &dest_len, src, compressed_size) != Z_OK ||
189 dest_len != uncompressed_size)
202 const int8_t *s = src;
203 int ssize = compressed_size;
204 int dsize = uncompressed_size;
214 if ((dsize -= count) < 0 ||
215 (ssize -= count + 1) < 0)
223 if ((dsize -= count) < 0 ||
243 #define USHORT_RANGE (1 << 16) 244 #define BITMAP_SIZE (1 << 13) 251 if ((i == 0) || (bitmap[i >> 3] & (1 << (i & 7))))
256 memset(lut + k, 0, (USHORT_RANGE - k) * 2);
261 static void apply_lut(
const uint16_t *lut, uint16_t *dst,
int dsize)
265 for (i = 0; i < dsize; ++i)
266 dst[i] = lut[dst[i]];
269 #define HUF_ENCBITS 16 // literal (value) bit length 270 #define HUF_DECBITS 14 // decoding bit size (>= 8) 272 #define HUF_ENCSIZE ((1 << HUF_ENCBITS) + 1) // encoding table size 273 #define HUF_DECSIZE (1 << HUF_DECBITS) // decoding table size 274 #define HUF_DECMASK (HUF_DECSIZE - 1) 284 uint64_t c, n[59] = { 0 };
291 for (i = 58; i > 0; --i) {
292 uint64_t nc = ((c + n[i]) >> 1);
301 hcode[i] = l | (n[l]++ << 6);
305 #define SHORT_ZEROCODE_RUN 59 306 #define LONG_ZEROCODE_RUN 63 307 #define SHORTEST_LONG_RUN (2 + LONG_ZEROCODE_RUN - SHORT_ZEROCODE_RUN) 308 #define LONGEST_LONG_RUN (255 + SHORTEST_LONG_RUN) 317 for (; im <= iM; im++) {
323 if (im + zerun > iM + 1)
333 if (im + zerun > iM + 1)
352 for (; im <= iM; im++) {
353 uint64_t c = hcode[
im] >> 6;
354 int i, l = hcode[
im] & 63;
374 for (i = 1 << (
HUF_DECBITS - l); i > 0; i--, pl++) {
375 if (pl->
len || pl->
p)
386 #define get_char(c, lc, gb) \ 388 c = (c << 8) | bytestream2_get_byte(gb); \ 392 #define get_code(po, rlc, c, lc, gb, out, oe) \ 396 get_char(c, lc, gb); \ 402 return AVERROR_INVALIDDATA; \ 408 } else if (out < oe) { \ 411 return AVERROR_INVALIDDATA; \ 417 int rlc,
int no, uint16_t *
out)
420 uint16_t *outb =
out;
421 uint16_t *oe = out + no;
441 for (j = 0; j < pl.
lit; j++) {
442 int l = hcode[pl.
p[j]] & 63;
448 if ((hcode[pl.
p[j]] >> 6) ==
449 ((c >> (lc - l)) & ((1LL << l) - 1))) {
451 get_code(pl.
p[j], rlc, c, lc, gb, out, oe);
478 if (out - outb != no)
484 uint16_t *dst,
int dst_size)
492 src_size = bytestream2_get_le32(gb);
493 im = bytestream2_get_le32(gb);
494 iM = bytestream2_get_le32(gb);
496 nBits = bytestream2_get_le32(gb);
506 if (!freq || !hdec) {
521 ret =
huf_decode(freq, hdec, gb, nBits, iM, dst_size, dst);
534 static inline void wdec14(uint16_t l, uint16_t h, uint16_t *
a, uint16_t *
b)
539 int ai = ls + (hi & 1) + (hi >> 1);
541 int16_t bs = ai - hi;
548 #define A_OFFSET (1 << (NBITS - 1)) 549 #define MOD_MASK ((1 << NBITS) - 1) 551 static inline void wdec16(uint16_t l, uint16_t h, uint16_t *
a, uint16_t *
b)
562 int ny,
int oy, uint16_t mx)
564 int w14 = (mx < (1 << 14));
565 int n = (nx > ny) ? ny : nx;
578 uint16_t *ey = in + oy * (ny - p2);
579 uint16_t i00, i01, i10, i11;
585 for (; py <= ey; py += oy2) {
587 uint16_t *ex = py + ox * (nx - p2);
589 for (; px <= ex; px += ox2) {
590 uint16_t *p01 = px + ox1;
591 uint16_t *p10 = px + oy1;
592 uint16_t *p11 = p10 + ox1;
595 wdec14(*px, *p10, &i00, &i10);
596 wdec14(*p01, *p11, &i01, &i11);
597 wdec14(i00, i01, px, p01);
598 wdec14(i10, i11, p10, p11);
600 wdec16(*px, *p10, &i00, &i10);
601 wdec16(*p01, *p11, &i01, &i11);
602 wdec16(i00, i01, px, p01);
603 wdec16(i10, i11, p10, p11);
608 uint16_t *p10 = px + oy1;
611 wdec14(*px, *p10, &i00, p10);
613 wdec16(*px, *p10, &i00, p10);
621 uint16_t *ex = py + ox * (nx - p2);
623 for (; px <= ex; px += ox2) {
624 uint16_t *p01 = px + ox1;
627 wdec14(*px, *p01, &i00, p01);
629 wdec16(*px, *p01, &i00, p01);
644 uint16_t maxval, min_non_zero, max_non_zero;
646 uint16_t *tmp = (uint16_t *)td->
tmp;
661 min_non_zero = bytestream2_get_le16(&gb);
662 max_non_zero = bytestream2_get_le16(&gb);
668 if (min_non_zero <= max_non_zero)
670 max_non_zero - min_non_zero + 1);
684 for (j = 0; j <
size; j++)
686 s->
xdelta * size, maxval);
693 for (i = 0; i < s->
ysize; i++)
704 int compressed_size,
int uncompressed_size,
707 unsigned long dest_len = uncompressed_size;
712 if (uncompress(td->
tmp, &dest_len, src, compressed_size) != Z_OK ||
713 dest_len != uncompressed_size)
717 for (i = 0; i < s->
ysize; i++)
726 ptr[1] = ptr[0] + s->
xdelta;
727 ptr[2] = ptr[1] + s->
xdelta;
730 for (j = 0; j < s->
xdelta; ++j) {
731 uint32_t diff = (*(ptr[0]++) << 24) |
732 (*(ptr[1]++) << 16) |
735 bytestream_put_le32(&out, pixel);
740 ptr[1] = ptr[0] + s->
xdelta;
742 for (j = 0; j < s->
xdelta; j++) {
743 uint32_t diff = (*(ptr[0]++) << 8) | *(ptr[1]++);
746 bytestream_put_le16(&out, pixel);
758 int jobnr,
int threadnr)
763 const uint8_t *channel_buffer[4] = { 0 };
765 uint64_t line_offset, uncompressed_size;
766 uint32_t xdelta = s->
xdelta;
769 uint32_t data_size,
line;
778 if (line_offset > buf_size - 8)
781 src = buf + line_offset + 8;
787 if (data_size <= 0 || data_size > buf_size)
793 line_offset > buf_size - uncompressed_size)) ||
795 line_offset > buf_size - data_size))) {
799 if (data_size < uncompressed_size) {
840 r = channel_buffer[0];
841 g = channel_buffer[1];
842 b = channel_buffer[2];
843 if (channel_buffer[3])
844 a = channel_buffer[3];
846 ptr_x = (uint16_t *) ptr;
849 memset(ptr_x, 0, bxmin);
853 for (x = 0; x < xdelta; x++) {
857 if (channel_buffer[3])
862 for (x = 0; x < xdelta; x++) {
866 if (channel_buffer[3])
872 memset(ptr_x, 0, axmax);
877 if (channel_buffer[3])
897 const char *value_name,
898 const char *value_type,
899 unsigned int minimum_length)
904 !strcmp(s->
gb.
buffer, value_name)) {
906 s->
gb.
buffer += strlen(value_name) + 1;
907 if (!strcmp(s->
gb.
buffer, value_type)) {
908 s->
gb.
buffer += strlen(value_type) + 1;
909 var_size = bytestream2_get_le32(&s->
gb);
915 s->
gb.
buffer -= strlen(value_name) + 1;
917 "Unknown data type %s for header variable %s.\n",
918 value_type, value_name);
927 int current_channel_offset = 0;
935 magic_number = bytestream2_get_le32(&s->
gb);
936 if (magic_number != 20000630) {
943 version = bytestream2_get_byte(&s->
gb);
949 flags = bytestream2_get_le24(&s->
gb);
959 "chlist", 38)) >= 0) {
969 int channel_index = -1;
972 if (strcmp(s->
layer,
"") != 0) {
982 if (!strcmp(ch_gb.
buffer,
"R") ||
983 !strcmp(ch_gb.
buffer,
"X") ||
984 !strcmp(ch_gb.
buffer,
"U"))
986 else if (!strcmp(ch_gb.
buffer,
"G") ||
987 !strcmp(ch_gb.
buffer,
"Y") ||
988 !strcmp(ch_gb.
buffer,
"V"))
990 else if (!strcmp(ch_gb.
buffer,
"B") ||
991 !strcmp(ch_gb.
buffer,
"Z") ||
992 !strcmp(ch_gb.
buffer,
"W"))
994 else if (!strcmp(ch_gb.
buffer,
"A"))
998 "Unsupported channel %.256s.\n", ch_gb.
buffer);
1002 bytestream2_get_byte(&ch_gb))
1010 current_pixel_type = bytestream2_get_le32(&ch_gb);
1014 current_pixel_type);
1019 xsub = bytestream2_get_le32(&ch_gb);
1020 ysub = bytestream2_get_le32(&ch_gb);
1021 if (xsub != 1 || ysub != 1) {
1023 "Subsampling %dx%d",
1028 if (channel_index >= 0) {
1032 "RGB channels not of the same depth.\n");
1048 current_channel_offset += 1 << current_pixel_type;
1073 s->
xmin = bytestream2_get_le32(&s->
gb);
1074 s->
ymin = bytestream2_get_le32(&s->
gb);
1075 s->
xmax = bytestream2_get_le32(&s->
gb);
1076 s->
ymax = bytestream2_get_le32(&s->
gb);
1082 "box2i", 34)) >= 0) {
1087 s->
w = bytestream2_get_le32(&s->
gb) + 1;
1088 s->
h = bytestream2_get_le32(&s->
gb) + 1;
1092 "lineOrder", 25)) >= 0) {
1097 line_order = bytestream2_get_byte(&s->
gb);
1099 if (line_order > 2) {
1106 "float", 31)) >= 0) {
1115 "compression", 29)) >= 0) {
1123 "Found more than one compression attribute.\n");
1135 for (i = 0; i < 2; i++)
1136 while (bytestream2_get_byte(&s->
gb) != 0);
1168 int scan_line_blocks;
1239 ptr = picture->
data[0];
1242 for (y = 0; y < s->
ymin; y++) {
1243 memset(ptr, 0, out_line_size);
1251 for (y = s->
ymax + 1; y < avctx->
height; y++) {
1252 memset(ptr, 0, out_line_size);
1320 #define OFFSET(x) offsetof(EXRContext, x) 1321 #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM 1323 {
"layer",
"Set the decoding layer",
OFFSET(layer),
static uint16_t exr_flt2uint(uint32_t v)
Convert from 32-bit float as uint32_t to uint16_t.
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
static uint16_t reverse_lut(const uint8_t *bitmap, uint16_t *lut)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_LOG_WARNING
Something somehow does not look correct.
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
#define AV_PIX_FMT_RGBA64
static int pxr24_uncompress(EXRContext *s, const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Allocate a buffer with padding, reusing the given one if large enough.
enum ExrPixelType pixel_type
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_dlog(ac->avr, "%d samples - audio_convert: %s to %s (dithered)\", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> out
static int decode_block(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
static void wav_decode(uint16_t *in, int nx, int ox, int ny, int oy, uint16_t mx)
Multithreading support functions.
static int huf_uncompress(GetByteContext *gb, uint16_t *dst, int dst_size)
static int huf_build_dec_table(const uint64_t *hcode, int im, int iM, HufDec *hdecod)
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define get_char(c, lc, gb)
static int get_bits_count(const GetBitContext *s)
static const AVOption options[]
int ff_set_sar(AVCodecContext *avctx, AVRational sar)
Check that the provided sample aspect ratio is valid and set it on the codec context.
bitstream reader API header.
static int decode_init_thread_copy(AVCodecContext *avctx)
uint8_t * uncompressed_data
static int huf_decode(const uint64_t *hcode, const HufDec *hdecod, GetByteContext *gb, int nbits, int rlc, int no, uint16_t *out)
static void predictor(uint8_t *src, int size)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static av_cold int decode_init(AVCodecContext *avctx)
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_dlog(ac->avr, "%d samples - audio_convert: %s to %s (dithered)\", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
static void reorder_pixels(uint8_t *src, uint8_t *dst, int size)
enum ExrPixelType pixel_type
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
#define LONG_ZEROCODE_RUN
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
EXRThreadData * thread_data
uint8_t nb_components
The number of components each pixel has, (1-4)
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
enum ExrCompr compression
static uint16_t exr_halflt2uint(uint16_t v)
Convert from 16-bit float as uint16_t to uint16_t.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute() ...
#define SHORTEST_LONG_RUN
if(ac->has_optimized_func)
static int check_header_variable(EXRContext *s, const char *value_name, const char *value_type, unsigned int minimum_length)
Check if the variable name corresponds to its data type.
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
int(* execute2)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count)
The codec may call this to execute several independent things.
#define AV_LOG_INFO
Standard information.
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
main external API structure.
static int zip_uncompress(const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td)
Describe the class of an AVClass context structure.
#define get_code(po, rlc, c, lc, gb, out, oe)
static av_cold int decode_end(AVCodecContext *avctx)
static int rle_uncompress(const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td)
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define SHORT_ZEROCODE_RUN
#define CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
common internal api header.
#define CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
void * av_realloc(void *ptr, size_t size)
Allocate or reallocate a block of memory.
static av_cold int init(AVCodecParserContext *s)
static int piz_uncompress(EXRContext *s, const uint8_t *src, int ssize, int dsize, EXRThreadData *td)
static void huf_canonical_code_table(uint64_t *hcode)
static void * av_mallocz_array(size_t nmemb, size_t size)
static void apply_lut(const uint16_t *lut, uint16_t *dst, int dsize)
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static void wdec14(uint16_t l, uint16_t h, uint16_t *a, uint16_t *b)
static int decode_header(EXRContext *s)
static void wdec16(uint16_t l, uint16_t h, uint16_t *a, uint16_t *b)
static int huf_unpack_enc_table(GetByteContext *gb, int32_t im, int32_t iM, uint64_t *hcode)
const AVPixFmtDescriptor * desc
This structure stores compressed data.
static const AVClass exr_class