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 "codec_internal.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, AVFrame *pic, int *got_frame, AVPacket *avpkt)
 
static av_cold int cfhd_close (AVCodecContext *avctx)
 

Variables

const FFCodec 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 41 of file cfhd.c.

◆ ALPHA_COMPAND_GAIN

#define ALPHA_COMPAND_GAIN   9400

Definition at line 42 of file cfhd.c.

Function Documentation

◆ cfhd_init()

static av_cold int cfhd_init ( AVCodecContext avctx)
static

Definition at line 44 of file cfhd.c.

◆ init_plane_defaults()

static void init_plane_defaults ( CFHDContext s)
static

Definition at line 74 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 81 of file cfhd.c.

Referenced by init_frame_defaults().

◆ init_frame_defaults()

static void init_frame_defaults ( CFHDContext s)
static

Definition at line 88 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 110 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 118 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 130 of file cfhd.c.

Referenced by cfhd_decode().

◆ process_alpha()

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

Definition at line 138 of file cfhd.c.

Referenced by cfhd_decode().

◆ process_bayer()

static void process_bayer ( AVFrame frame,
int  bpc 
)
inlinestatic

Definition at line 152 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 196 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 209 of file cfhd.c.

Referenced by cfhd_decode().

◆ free_buffers()

static void free_buffers ( CFHDContext s)
static

Definition at line 220 of file cfhd.c.

Referenced by cfhd_close(), and cfhd_decode().

◆ alloc_buffers()

static int alloc_buffers ( AVCodecContext avctx)
static

Definition at line 247 of file cfhd.c.

Referenced by cfhd_decode().

◆ cfhd_decode()

static int cfhd_decode ( AVCodecContext avctx,
AVFrame pic,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 376 of file cfhd.c.

◆ cfhd_close()

static av_cold int cfhd_close ( AVCodecContext avctx)
static

Definition at line 1401 of file cfhd.c.

Variable Documentation

◆ ff_cfhd_decoder

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

Definition at line 1458 of file cfhd.c.

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: codec_internal.h:39
cfhd_init
static av_cold int cfhd_init(AVCodecContext *avctx)
Definition: cfhd.c:44
init
static int init
Definition: av_tx.c:47
AV_CODEC_ID_CFHD
@ AV_CODEC_ID_CFHD
Definition: codec_id.h:266
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:254
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
cfhd_decode
static int cfhd_decode(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt)
Definition: cfhd.c:376
CFHDContext
Definition: cfhd.h:140
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: codec_internal.h:31
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:1401