FFmpeg
|
OpenEXR decoder. More...
#include <float.h>
#include <zlib.h>
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/intfloat.h"
#include "libavutil/opt.h"
#include "libavutil/color_utils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"
#include "internal.h"
#include "mathops.h"
#include "thread.h"
Go to the source code of this file.
Data Structures | |
struct | EXRChannel |
struct | EXRTileAttribute |
struct | EXRThreadData |
struct | EXRContext |
struct | HufDec |
Macros | |
#define | HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP 0x38000000 |
#define | HALF_FLOAT_MAX_BIASED_EXP_AS_SINGLE_FP_EXP 0x47800000 |
#define | FLOAT_MAX_BIASED_EXP (0xFF << 23) |
#define | HALF_FLOAT_MAX_BIASED_EXP (0x1F << 10) |
#define | USHORT_RANGE (1 << 16) |
#define | BITMAP_SIZE (1 << 13) |
#define | HUF_ENCBITS 16 |
#define | HUF_DECBITS 14 |
#define | HUF_ENCSIZE ((1 << HUF_ENCBITS) + 1) |
#define | HUF_DECSIZE (1 << HUF_DECBITS) |
#define | HUF_DECMASK (HUF_DECSIZE - 1) |
#define | SHORT_ZEROCODE_RUN 59 |
#define | LONG_ZEROCODE_RUN 63 |
#define | SHORTEST_LONG_RUN (2 + LONG_ZEROCODE_RUN - SHORT_ZEROCODE_RUN) |
#define | LONGEST_LONG_RUN (255 + SHORTEST_LONG_RUN) |
#define | get_char(c, lc, gb) |
#define | get_code(po, rlc, c, lc, gb, out, oe, outb) |
#define | NBITS 16 |
#define | A_OFFSET (1 << (NBITS - 1)) |
#define | MOD_MASK ((1 << NBITS) - 1) |
#define | OFFSET(x) offsetof(EXRContext, x) |
#define | VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM |
Enumerations | |
enum | ExrCompr { EXR_RAW, EXR_RLE, EXR_ZIP1, EXR_ZIP16, EXR_PIZ, EXR_PXR24, EXR_B44, EXR_B44A, EXR_UNKN } |
enum | ExrPixelType { EXR_UINT, EXR_HALF, EXR_FLOAT, EXR_UNKNOWN } |
enum | ExrTileLevelMode { EXR_TILE_LEVEL_ONE, EXR_TILE_LEVEL_MIPMAP, EXR_TILE_LEVEL_RIPMAP, EXR_TILE_LEVEL_UNKNOWN } |
enum | ExrTileLevelRound { EXR_TILE_ROUND_UP, EXR_TILE_ROUND_DOWN, EXR_TILE_ROUND_UNKNOWN } |
Functions | |
static union av_intfloat32 | exr_half2float (uint16_t hf) |
Convert a half float as a uint16_t into a full float. More... | |
static uint16_t | exr_flt2uint (uint32_t v) |
Convert from 32-bit float as uint32_t to uint16_t. More... | |
static uint16_t | exr_halflt2uint (uint16_t v) |
Convert from 16-bit float as uint16_t to uint16_t. More... | |
static void | predictor (uint8_t *src, int size) |
static void | reorder_pixels (uint8_t *src, uint8_t *dst, int size) |
static int | zip_uncompress (const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td) |
static int | rle_uncompress (const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td) |
static uint16_t | reverse_lut (const uint8_t *bitmap, uint16_t *lut) |
static void | apply_lut (const uint16_t *lut, uint16_t *dst, int dsize) |
static void | huf_canonical_code_table (uint64_t *hcode) |
static int | huf_unpack_enc_table (GetByteContext *gb, int32_t im, int32_t iM, uint64_t *hcode) |
static int | huf_build_dec_table (const uint64_t *hcode, int im, int iM, HufDec *hdecod) |
static int | huf_decode (const uint64_t *hcode, const HufDec *hdecod, GetByteContext *gb, int nbits, int rlc, int no, uint16_t *out) |
static int | huf_uncompress (GetByteContext *gb, uint16_t *dst, int dst_size) |
static void | wdec14 (uint16_t l, uint16_t h, uint16_t *a, uint16_t *b) |
static void | wdec16 (uint16_t l, uint16_t h, uint16_t *a, uint16_t *b) |
static void | wav_decode (uint16_t *in, int nx, int ox, int ny, int oy, uint16_t mx) |
static int | piz_uncompress (EXRContext *s, const uint8_t *src, int ssize, int dsize, EXRThreadData *td) |
static int | pxr24_uncompress (EXRContext *s, const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td) |
static void | unpack_14 (const uint8_t b[14], uint16_t s[16]) |
static void | unpack_3 (const uint8_t b[3], uint16_t s[16]) |
static int | b44_uncompress (EXRContext *s, const uint8_t *src, int compressed_size, int uncompressed_size, EXRThreadData *td) |
static int | decode_block (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) |
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. More... | |
static int | decode_header (EXRContext *s) |
static int | decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) |
static av_cold int | decode_init (AVCodecContext *avctx) |
static av_cold int | decode_end (AVCodecContext *avctx) |
Variables | |
static const AVOption | options [] |
static const AVClass | exr_class |
AVCodec | ff_exr_decoder |
OpenEXR decoder.
For more information on the OpenEXR format, visit: http://openexr.com/
exr_flt2uint() and exr_halflt2uint() is credited to Reimar Döffinger. exr_half2float() is credited to Aaftab Munshi, Dan Ginsburg, Dave Shreiner.
Definition in file exr.c.
#define HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP 0x38000000 |
Definition at line 150 of file exr.c.
Referenced by exr_half2float().
#define FLOAT_MAX_BIASED_EXP (0xFF << 23) |
Definition at line 157 of file exr.c.
Referenced by exr_half2float().
#define HALF_FLOAT_MAX_BIASED_EXP (0x1F << 10) |
Definition at line 159 of file exr.c.
Referenced by exr_half2float().
#define USHORT_RANGE (1 << 16) |
Definition at line 344 of file exr.c.
Referenced by reverse_lut().
#define BITMAP_SIZE (1 << 13) |
Definition at line 345 of file exr.c.
Referenced by piz_uncompress().
#define HUF_DECBITS 14 |
Definition at line 371 of file exr.c.
Referenced by huf_build_dec_table(), and huf_decode().
#define HUF_ENCSIZE ((1 << HUF_ENCBITS) + 1) |
Definition at line 373 of file exr.c.
Referenced by huf_canonical_code_table(), and huf_uncompress().
#define HUF_DECSIZE (1 << HUF_DECBITS) |
Definition at line 374 of file exr.c.
Referenced by huf_uncompress().
#define HUF_DECMASK (HUF_DECSIZE - 1) |
Definition at line 375 of file exr.c.
Referenced by huf_decode().
#define SHORT_ZEROCODE_RUN 59 |
Definition at line 406 of file exr.c.
Referenced by huf_unpack_enc_table().
#define LONG_ZEROCODE_RUN 63 |
Definition at line 407 of file exr.c.
Referenced by huf_unpack_enc_table().
#define SHORTEST_LONG_RUN (2 + LONG_ZEROCODE_RUN - SHORT_ZEROCODE_RUN) |
Definition at line 408 of file exr.c.
Referenced by huf_unpack_enc_table().
#define LONGEST_LONG_RUN (255 + SHORTEST_LONG_RUN) |
#define get_char | ( | c, | |
lc, | |||
gb | |||
) |
Definition at line 494 of file exr.c.
Referenced by huf_decode().
#define OFFSET | ( | x | ) | offsetof(EXRContext, x) |
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM |
enum ExrCompr |
enum ExrPixelType |
enum ExrTileLevelMode |
enum ExrTileLevelRound |
|
static |
Convert a half float as a uint16_t into a full float.
hf | half float as uint16_t |
Definition at line 168 of file exr.c.
Referenced by decode_init().
|
inlinestatic |
Convert from 32-bit float as uint32_t to uint16_t.
v | 32-bit float |
Definition at line 219 of file exr.c.
Referenced by decode_block(), and decode_init().
|
inlinestatic |
Convert from 16-bit float as uint16_t to uint16_t.
v | 16-bit float |
Definition at line 239 of file exr.c.
Referenced by decode_block(), and decode_init().
Definition at line 252 of file exr.c.
Referenced by adpcm_compress_trellis(), adpcm_decode_frame(), adpcm_encode_frame(), adpcm_ima_expand_nibble(), adpcm_ima_oki_expand_nibble(), adpcm_ima_qt_expand_nibble(), adpcm_ima_wav_expand_nibble(), adpcm_ms_compress_sample(), adpcm_ms_expand_nibble(), decode_audio_s16(), dpcm_decode_frame(), ff_mjpeg_decode_sos(), ljpeg_decode_rgb_scan(), rle_uncompress(), tta_decode_frame(), and zip_uncompress().
Definition at line 264 of file exr.c.
Referenced by rle_uncompress(), and zip_uncompress().
|
static |
Definition at line 284 of file exr.c.
Referenced by decode_block().
|
static |
Definition at line 299 of file exr.c.
Referenced by decode_block().
|
static |
Definition at line 347 of file exr.c.
Referenced by piz_uncompress().
|
static |
Definition at line 362 of file exr.c.
Referenced by piz_uncompress().
|
static |
Definition at line 383 of file exr.c.
Referenced by huf_unpack_enc_table().
|
static |
Definition at line 411 of file exr.c.
Referenced by huf_uncompress().
|
static |
Definition at line 451 of file exr.c.
Referenced by huf_uncompress().
|
static |
Definition at line 517 of file exr.c.
Referenced by huf_uncompress().
|
static |
Definition at line 586 of file exr.c.
Referenced by piz_uncompress().
|
inlinestatic |
Definition at line 637 of file exr.c.
Referenced by wav_decode().
|
inlinestatic |
Definition at line 654 of file exr.c.
Referenced by wav_decode().
|
static |
Definition at line 664 of file exr.c.
Referenced by piz_uncompress().
|
static |
Definition at line 743 of file exr.c.
Referenced by decode_block().
|
static |
Definition at line 806 of file exr.c.
Referenced by decode_block().
Definition at line 874 of file exr.c.
Referenced by b44_uncompress().
Definition at line 909 of file exr.c.
Referenced by b44_uncompress().
|
static |
Definition at line 925 of file exr.c.
Referenced by decode_block().
|
static |
Definition at line 1002 of file exr.c.
Referenced by decode_frame().
|
static |
Check if the variable name corresponds to its data type.
s | the EXRContext |
value_name | name of the variable to check |
value_type | type of the variable to check |
minimum_length | minimum length of the variable data |
Definition at line 1229 of file exr.c.
Referenced by decode_header().
|
static |
Definition at line 1258 of file exr.c.
Referenced by decode_frame().
|
static |
|
static |
|
static |
|
static |
AVCodec ff_exr_decoder |