FFmpeg
Loading...
Searching...
No Matches
hdrenc.c File Reference
#include "libavutil/mem.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "encode.h"

Go to the source code of this file.

Data Structures

struct  HDREncContext
 

Macros

#define MIN_RLE   4
 

Functions

static av_cold int hdr_encode_init (AVCodecContext *avctx)
 
static av_cold int hdr_encode_close (AVCodecContext *avctx)
 
static void bytestream_put_str (uint8_t **buf, const char *const line)
 
static void float2rgbe (uint8_t *rgbe, float red, float green, float blue)
 
static void rle (uint8_t **buffer, const uint8_t *data, int width)
 
static int hdr_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 

Variables

const FFCodec ff_hdr_encoder
 

Macro Definition Documentation

◆ MIN_RLE

#define MIN_RLE   4

Referenced by rle().

Function Documentation

◆ hdr_encode_init()

static av_cold int hdr_encode_init ( AVCodecContext * avctx)
static

Definition at line 31 of file hdrenc.c.

◆ hdr_encode_close()

static av_cold int hdr_encode_close ( AVCodecContext * avctx)
static

Definition at line 42 of file hdrenc.c.

◆ bytestream_put_str()

static void bytestream_put_str ( uint8_t ** buf,
const char *const line )
static

Definition at line 51 of file hdrenc.c.

Referenced by hdr_encode_frame().

◆ float2rgbe()

static void float2rgbe ( uint8_t * rgbe,
float red,
float green,
float blue )
static

Definition at line 56 of file hdrenc.c.

Referenced by hdr_encode_frame().

◆ rle()

static void rle ( uint8_t ** buffer,
const uint8_t * data,
int width )
static

Definition at line 75 of file hdrenc.c.

Referenced by hdr_encode_frame().

◆ hdr_encode_frame()

static int hdr_encode_frame ( AVCodecContext * avctx,
AVPacket * pkt,
const AVFrame * frame,
int * got_packet )
static

Definition at line 119 of file hdrenc.c.

Variable Documentation

◆ ff_hdr_encoder

const FFCodec ff_hdr_encoder
Initial value:
= {
.p.name = "hdr",
CODEC_LONG_NAME("HDR (Radiance RGBE format) image"),
.priv_data_size = sizeof(HDREncContext),
.p.type = AVMEDIA_TYPE_VIDEO,
.init = hdr_encode_init,
.close = hdr_encode_close,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
#define CODEC_PIXFMTS(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition codec.h:147
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition codec.h:98
@ AV_CODEC_ID_RADIANCE_HDR
Definition codec_id.h:311
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static int hdr_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
Definition hdrenc.c:119
static av_cold int hdr_encode_init(AVCodecContext *avctx)
Definition hdrenc.c:31
static av_cold int hdr_encode_close(AVCodecContext *avctx)
Definition hdrenc.c:42
#define AV_PIX_FMT_GBRPF32
Definition pixfmt.h:584

Definition at line 174 of file hdrenc.c.