FFmpeg
Macros | Functions | Variables
cfhd.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/buffer.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"
#include "internal.h"
#include "thread.h"
#include "cfhd.h"

Go to the source code of this file.

Macros

#define ALPHA_COMPAND_DC_OFFSET   256
 
#define ALPHA_COMPAND_GAIN   9400
 

Functions

static av_cold int cfhd_init (AVCodecContext *avctx)
 
static void init_plane_defaults (CFHDContext *s)
 
static void init_peak_table_defaults (CFHDContext *s)
 
static void init_frame_defaults (CFHDContext *s)
 
static int dequant_and_decompand (CFHDContext *s, int level, int quantisation, int codebook)
 
static void difference_coding (int16_t *band, int width, int height)
 
static void peak_table (int16_t *band, Peak *peak, int length)
 
static void process_alpha (int16_t *alpha, int width)
 
static void process_bayer (AVFrame *frame, int bpc)
 
static void interlaced_vertical_filter (int16_t *output, int16_t *low, int16_t *high, int width, int linesize, int plane)
 
static void inverse_temporal_filter (int16_t *low, int16_t *high, int width)
 
static void free_buffers (CFHDContext *s)
 
static int alloc_buffers (AVCodecContext *avctx)
 
static int cfhd_decode (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int cfhd_close (AVCodecContext *avctx)
 

Variables

const AVCodec ff_cfhd_decoder
 

Detailed Description

Cineform HD video decoder

Definition in file cfhd.c.

Macro Definition Documentation

◆ ALPHA_COMPAND_DC_OFFSET

#define ALPHA_COMPAND_DC_OFFSET   256

Definition at line 40 of file cfhd.c.

◆ ALPHA_COMPAND_GAIN

#define ALPHA_COMPAND_GAIN   9400

Definition at line 41 of file cfhd.c.

Function Documentation

◆ cfhd_init()

static av_cold int cfhd_init ( AVCodecContext avctx)
static

Definition at line 43 of file cfhd.c.

◆ init_plane_defaults()

static void init_plane_defaults ( CFHDContext s)
static

Definition at line 73 of file cfhd.c.

Referenced by cfhd_decode(), and init_frame_defaults().

◆ init_peak_table_defaults()

static void init_peak_table_defaults ( CFHDContext s)
static

Definition at line 80 of file cfhd.c.

Referenced by init_frame_defaults().

◆ init_frame_defaults()

static void init_frame_defaults ( CFHDContext s)
static

Definition at line 87 of file cfhd.c.

Referenced by cfhd_decode().

◆ dequant_and_decompand()

static int dequant_and_decompand ( CFHDContext s,
int  level,
int  quantisation,
int  codebook 
)
inlinestatic

Definition at line 109 of file cfhd.c.

Referenced by cfhd_decode().

◆ difference_coding()

static void difference_coding ( int16_t *  band,
int  width,
int  height 
)
inlinestatic

Definition at line 117 of file cfhd.c.

Referenced by cfhd_decode().

◆ peak_table()

static void peak_table ( int16_t *  band,
Peak peak,
int  length 
)
inlinestatic

Definition at line 129 of file cfhd.c.

Referenced by cfhd_decode().

◆ process_alpha()

static void process_alpha ( int16_t *  alpha,
int  width 
)
inlinestatic

Definition at line 137 of file cfhd.c.

Referenced by cfhd_decode().

◆ process_bayer()

static void process_bayer ( AVFrame frame,
int  bpc 
)
inlinestatic

Definition at line 151 of file cfhd.c.

Referenced by cfhd_decode().

◆ interlaced_vertical_filter()

static void interlaced_vertical_filter ( int16_t *  output,
int16_t *  low,
int16_t *  high,
int  width,
int  linesize,
int  plane 
)
inlinestatic

Definition at line 195 of file cfhd.c.

Referenced by cfhd_decode().

◆ inverse_temporal_filter()

static void inverse_temporal_filter ( int16_t *  low,
int16_t *  high,
int  width 
)
inlinestatic

Definition at line 208 of file cfhd.c.

Referenced by cfhd_decode().

◆ free_buffers()

static void free_buffers ( CFHDContext s)
static

Definition at line 219 of file cfhd.c.

Referenced by cfhd_close(), and cfhd_decode().

◆ alloc_buffers()

static int alloc_buffers ( AVCodecContext avctx)
static

Definition at line 246 of file cfhd.c.

Referenced by cfhd_decode().

◆ cfhd_decode()

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

Definition at line 375 of file cfhd.c.

◆ cfhd_close()

static av_cold int cfhd_close ( AVCodecContext avctx)
static

Definition at line 1404 of file cfhd.c.

Variable Documentation

◆ ff_cfhd_decoder

const AVCodec ff_cfhd_decoder
Initial value:
= {
.name = "cfhd",
.long_name = NULL_IF_CONFIG_SMALL("GoPro CineForm HD"),
.priv_data_size = sizeof(CFHDContext),
.close = cfhd_close,
}

Definition at line 1461 of file cfhd.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:42
cfhd_init
static av_cold int cfhd_init(AVCodecContext *avctx)
Definition: cfhd.c:43
init
static int init
Definition: av_tx.c:47
cfhd_decode
static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: cfhd.c:375
AV_CODEC_ID_CFHD
@ AV_CODEC_ID_CFHD
Definition: codec_id.h:266
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:113
ONLY_IF_THREADS_ENABLED
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
Definition: internal.h:156
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:50
CFHDContext
Definition: cfhd.h:140
update_thread_context
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have update_thread_context() run it in the next thread. Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little speed gain at this point but it should work. If there are inter-frame dependencies
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
cfhd_close
static av_cold int cfhd_close(AVCodecContext *avctx)
Definition: cfhd.c:1404