FFmpeg
Macros | Functions | Variables
cfhd.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/common.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 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",
CODEC_LONG_NAME("GoPro CineForm HD"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(CFHDContext),
.close = cfhd_close,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 1455 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:43
cfhd_init
static av_cold int cfhd_init(AVCodecContext *avctx)
Definition: cfhd.c:44
AV_CODEC_ID_CFHD
@ AV_CODEC_ID_CFHD
Definition: codec_id.h:267
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:110
UPDATE_THREAD_CONTEXT
#define UPDATE_THREAD_CONTEXT(func)
Definition: codec_internal.h:305
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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
cfhd_decode
static int cfhd_decode(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt)
Definition: cfhd.c:376
CFHDContext
Definition: cfhd.h:139
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. Use ff_thread_get_buffer()(or ff_progress_frame_get_buffer() in case you have inter-frame dependencies and use the ProgressFrame API) to allocate frame buffers. Call ff_progress_frame_report() after some part of the current picture has decoded. A good place to put this is where draw_horiz_band() is called - add this if it isn 't called anywhere
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
cfhd_close
static av_cold int cfhd_close(AVCodecContext *avctx)
Definition: cfhd.c:1401