FFmpeg
Macros | Enumerations | 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
 

Enumerations

enum  CFHDParam {
  ChannelCount = 12, SubbandCount = 14, ImageWidth = 20, ImageHeight = 21,
  LowpassPrecision = 35, SubbandNumber = 48, Quantization = 53, ChannelNumber = 62,
  SampleFlags = 68, BitsPerComponent = 101, ChannelWidth = 104, ChannelHeight = 105,
  PrescaleShift = 109
}
 

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 (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 filter (int16_t *output, ptrdiff_t out_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len, int clip)
 
static void interlaced_vertical_filter (int16_t *output, int16_t *low, int16_t *high, int width, int linesize, int plane)
 
static void horiz_filter (int16_t *output, int16_t *low, int16_t *high, int width)
 
static void horiz_filter_clip (int16_t *output, int16_t *low, int16_t *high, int width, int clip)
 
static void vert_filter (int16_t *output, ptrdiff_t out_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len)
 
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

◆ 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.

Enumeration Type Documentation

◆ CFHDParam

enum CFHDParam
Enumerator
ChannelCount 
SubbandCount 
ImageWidth 
ImageHeight 
LowpassPrecision 
SubbandNumber 
Quantization 
ChannelNumber 
SampleFlags 
BitsPerComponent 
ChannelWidth 
ChannelHeight 
PrescaleShift 

Definition at line 43 of file cfhd.c.

Function Documentation

◆ cfhd_init()

static av_cold int cfhd_init ( AVCodecContext avctx)
static

Definition at line 61 of file cfhd.c.

◆ init_plane_defaults()

static void init_plane_defaults ( CFHDContext s)
static

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

Referenced by init_frame_defaults().

◆ init_frame_defaults()

static void init_frame_defaults ( CFHDContext s)
static

Definition at line 85 of file cfhd.c.

Referenced by cfhd_decode().

◆ dequant_and_decompand()

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

Definition at line 106 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 119 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 131 of file cfhd.c.

Referenced by cfhd_decode().

◆ process_alpha()

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

Definition at line 139 of file cfhd.c.

Referenced by cfhd_decode().

◆ filter()

static void filter ( int16_t *  output,
ptrdiff_t  out_stride,
int16_t *  low,
ptrdiff_t  low_stride,
int16_t *  high,
ptrdiff_t  high_stride,
int  len,
int  clip 
)
inlinestatic

Definition at line 153 of file cfhd.c.

Referenced by horiz_filter(), horiz_filter_clip(), and vert_filter().

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

◆ horiz_filter()

static void horiz_filter ( int16_t *  output,
int16_t *  low,
int16_t *  high,
int  width 
)
static

Definition at line 208 of file cfhd.c.

Referenced by cfhd_decode().

◆ horiz_filter_clip()

static void horiz_filter_clip ( int16_t *  output,
int16_t *  low,
int16_t *  high,
int  width,
int  clip 
)
static

Definition at line 214 of file cfhd.c.

Referenced by cfhd_decode().

◆ vert_filter()

static void vert_filter ( int16_t *  output,
ptrdiff_t  out_stride,
int16_t *  low,
ptrdiff_t  low_stride,
int16_t *  high,
ptrdiff_t  high_stride,
int  len 
)
static

Definition at line 220 of file cfhd.c.

Referenced by cfhd_decode().

◆ free_buffers()

static void free_buffers ( CFHDContext s)
static

Definition at line 227 of file cfhd.c.

Referenced by cfhd_close(), and cfhd_decode().

◆ alloc_buffers()

static int alloc_buffers ( AVCodecContext avctx)
static

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

◆ cfhd_close()

static av_cold int cfhd_close ( AVCodecContext avctx)
static

Definition at line 947 of file cfhd.c.

Variable Documentation

◆ ff_cfhd_decoder

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

Definition at line 961 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:40
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
cfhd_init
static av_cold int cfhd_init(AVCodecContext *avctx)
Definition: cfhd.c:61
cfhd_decode
static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: cfhd.c:323
AV_CODEC_ID_CFHD
@ AV_CODEC_ID_CFHD
Definition: avcodec.h:430
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:1037
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
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:188
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:48
CFHDContext
Definition: cfhd.h:78
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
cfhd_close
static av_cold int cfhd_close(AVCodecContext *avctx)
Definition: cfhd.c:947