FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Enumerations | Functions | Variables
exr.c File Reference

OpenEXR decoder. More...

#include <zlib.h>
#include "avcodec.h"
#include "bytestream.h"
#include "mathops.h"
#include "thread.h"
#include "libavutil/imgutils.h"
#include "libavutil/avassert.h"

Go to the source code of this file.

Data Structures

struct  EXRChannel
 
struct  EXRThreadData
 
struct  EXRContext
 

Enumerations

enum  ExrCompr {
  EXR_RAW = 0, EXR_RLE = 1, EXR_ZIP1 = 2, EXR_ZIP16 = 3,
  EXR_PIZ = 4, EXR_PXR24 = 5, EXR_B44 = 6, EXR_B44A = 7
}
 
enum  ExrPixelType { EXR_UINT, EXR_HALF, EXR_FLOAT }
 

Functions

static uint16_t exr_flt2uint (uint32_t v)
 Converts from 32-bit float as uint32_t to uint16_t.
 
static uint16_t exr_halflt2uint (uint16_t v)
 Converts from 16-bit float as uint16_t to uint16_t.
 
static unsigned int get_header_variable_length (const uint8_t **buf, const uint8_t *buf_end)
 Gets the size of the header variable.
 
static int check_header_variable (AVCodecContext *avctx, const uint8_t **buf, const uint8_t *buf_end, const char *value_name, const char *value_type, unsigned int minimum_length, unsigned int *variable_buffer_data_size)
 Checks if the variable name corresponds with it's data type.
 
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 int pxr24_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 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

AVCodec ff_exr_decoder
 

Detailed Description

OpenEXR decoder.

Author
Jimmy Christensen

For more information on the OpenEXR format, visit: http://openexr.com/

exr_flt2uint() and exr_halflt2uint() is credited to Reimar Döffinger

Definition in file exr.c.

Enumeration Type Documentation

enum ExrCompr
Enumerator:
EXR_RAW 
EXR_RLE 
EXR_ZIP1 
EXR_ZIP16 
EXR_PIZ 
EXR_PXR24 
EXR_B44 
EXR_B44A 

Definition at line 42 of file exr.c.

Enumerator:
EXR_UINT 
EXR_HALF 
EXR_FLOAT 

Definition at line 53 of file exr.c.

Function Documentation

static uint16_t exr_flt2uint ( uint32_t  v)
inlinestatic

Converts from 32-bit float as uint32_t to uint16_t.

Parameters
v32-bit float
Returns
normalized 16-bit unsigned int

Definition at line 104 of file exr.c.

Referenced by decode_block().

static uint16_t exr_halflt2uint ( uint16_t  v)
inlinestatic

Converts from 16-bit float as uint16_t to uint16_t.

Parameters
v16-bit float
Returns
normalized 16-bit unsigned int

Definition at line 123 of file exr.c.

Referenced by decode_block().

static unsigned int get_header_variable_length ( const uint8_t **  buf,
const uint8_t buf_end 
)
static

Gets the size of the header variable.

Parameters
**bufthe current pointer location in the header where the variable data starts
*buf_endpointer location of the end of the buffer
Returns
size of variable data

Definition at line 142 of file exr.c.

Referenced by check_header_variable(), and decode_frame().

static int check_header_variable ( AVCodecContext avctx,
const uint8_t **  buf,
const uint8_t buf_end,
const char *  value_name,
const char *  value_type,
unsigned int  minimum_length,
unsigned int *  variable_buffer_data_size 
)
static

Checks if the variable name corresponds with it's data type.

Parameters
*avctxthe AVCodecContext
**bufthe current pointer location in the header where the variable name starts
*buf_endpointer location of the end of the buffer
*value_namename of the varible to check
*value_typetype of the varible to check
minimum_lengthminimum length of the variable data
variable_buffer_data_sizevariable length read from the header after it's checked
Returns
negative if variable is invalid

Definition at line 165 of file exr.c.

Referenced by decode_frame().

static void predictor ( uint8_t src,
int  size 
)
static
static void reorder_pixels ( uint8_t src,
uint8_t dst,
int  size 
)
static

Definition at line 200 of file exr.c.

Referenced by rle_uncompress(), and zip_uncompress().

static int zip_uncompress ( const uint8_t src,
int  compressed_size,
int  uncompressed_size,
EXRThreadData td 
)
static

Definition at line 220 of file exr.c.

Referenced by decode_block().

static int rle_uncompress ( const uint8_t src,
int  compressed_size,
int  uncompressed_size,
EXRThreadData td 
)
static

Definition at line 235 of file exr.c.

Referenced by decode_block().

static int pxr24_uncompress ( EXRContext s,
const uint8_t src,
int  compressed_size,
int  uncompressed_size,
EXRThreadData td 
)
static

Definition at line 280 of file exr.c.

Referenced by decode_block().

static int decode_block ( AVCodecContext avctx,
void tdata,
int  jobnr,
int  threadnr 
)
static

Definition at line 335 of file exr.c.

Referenced by decode_frame().

static int decode_frame ( AVCodecContext avctx,
void data,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 452 of file exr.c.

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 790 of file exr.c.

static av_cold int decode_end ( AVCodecContext avctx)
static

Definition at line 800 of file exr.c.

Variable Documentation

AVCodec ff_exr_decoder
Initial value:
= {
.name = "exr",
.priv_data_size = sizeof(EXRContext),
.long_name = NULL_IF_CONFIG_SMALL("OpenEXR image"),
}

Definition at line 821 of file exr.c.