FFmpeg
Loading...
Searching...
No Matches
cfhd.c File Reference

Cineform HD video decoder. More...

#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.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 42 of file cfhd.c.

Referenced by process_alpha().

◆ ALPHA_COMPAND_GAIN

#define ALPHA_COMPAND_GAIN   9400

Definition at line 43 of file cfhd.c.

Referenced by process_alpha().

Function Documentation

◆ cfhd_init()

static av_cold int cfhd_init ( AVCodecContext * avctx)
static

Definition at line 45 of file cfhd.c.

◆ init_plane_defaults()

static void init_plane_defaults ( CFHDContext * s)
static

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

Referenced by init_frame_defaults().

◆ init_frame_defaults()

static void init_frame_defaults ( CFHDContext * s)
static

Definition at line 89 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 111 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 129 of file cfhd.c.

Referenced by cfhd_decode().

◆ process_alpha()

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

Definition at line 136 of file cfhd.c.

Referenced by cfhd_decode().

◆ process_bayer()

static void process_bayer ( AVFrame * frame,
int bpc )
inlinestatic

Definition at line 149 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 193 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 204 of file cfhd.c.

Referenced by cfhd_decode().

◆ free_buffers()

static void free_buffers ( CFHDContext * s)
static

Definition at line 215 of file cfhd.c.

Referenced by cfhd_close(), and cfhd_decode().

◆ alloc_buffers()

static int alloc_buffers ( AVCodecContext * avctx)
static

Definition at line 240 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 371 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 FFCodec ff_cfhd_decoder
Initial value:
= {
.p.name = "cfhd",
CODEC_LONG_NAME("GoPro CineForm HD"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(CFHDContext),
UPDATE_THREAD_CONTEXT(update_thread_context),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
static av_cold int cfhd_init(AVCodecContext *avctx)
Definition cfhd.c:45
static int cfhd_decode(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt)
Definition cfhd.c:371
static av_cold int cfhd_close(AVCodecContext *avctx)
Definition cfhd.c:1404
#define UPDATE_THREAD_CONTEXT(func)
#define FF_CODEC_DECODE_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...
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#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_CFHD
Definition codec_id.h:262
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200

Definition at line 1458 of file cfhd.c.