FFmpeg
Macros | Functions | Variables
cfhd.c File Reference

Cineform HD video decoder. More...

#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

AVCodec ff_cfhd_decoder
 

Detailed Description

Cineform HD video decoder.

Definition in file cfhd.c.

Macro Definition Documentation

#define ALPHA_COMPAND_DC_OFFSET   256

Definition at line 40 of file cfhd.c.

Referenced by process_alpha().

#define ALPHA_COMPAND_GAIN   9400

Definition at line 41 of file cfhd.c.

Referenced by process_alpha().

Function Documentation

static av_cold int cfhd_init ( AVCodecContext avctx)
static

Definition at line 43 of file cfhd.c.

static void init_plane_defaults ( CFHDContext s)
static

Definition at line 73 of file cfhd.c.

Referenced by cfhd_decode(), and init_frame_defaults().

static void init_peak_table_defaults ( CFHDContext s)
static

Definition at line 80 of file cfhd.c.

Referenced by init_frame_defaults().

static void init_frame_defaults ( CFHDContext s)
static

Definition at line 87 of file cfhd.c.

Referenced by cfhd_decode().

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().

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

Definition at line 117 of file cfhd.c.

Referenced by cfhd_decode().

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

Definition at line 129 of file cfhd.c.

Referenced by cfhd_decode().

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

Definition at line 137 of file cfhd.c.

Referenced by cfhd_decode().

static void process_bayer ( AVFrame frame,
int  bpc 
)
inlinestatic

Definition at line 151 of file cfhd.c.

Referenced by cfhd_decode().

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().

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().

static void free_buffers ( CFHDContext s)
static

Definition at line 219 of file cfhd.c.

Referenced by cfhd_close(), and cfhd_decode().

static int alloc_buffers ( AVCodecContext avctx)
static

Definition at line 238 of file cfhd.c.

Referenced by cfhd_close(), and cfhd_decode().

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

Definition at line 366 of file cfhd.c.

static av_cold int cfhd_close ( AVCodecContext avctx)
static

Definition at line 1353 of file cfhd.c.

Variable Documentation

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,
}
#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:48
static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: cfhd.c:366
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
#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:40
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:153
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:106
static av_cold int cfhd_close(AVCodecContext *avctx)
Definition: cfhd.c:1353
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
Definition: internal.h:192
static av_cold int cfhd_init(AVCodecContext *avctx)
Definition: cfhd.c:43
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
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:50

Definition at line 1401 of file cfhd.c.