FFmpeg
Data Structures | Macros | Functions | Variables
speedhqdec.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/mem_internal.h"
#include "avcodec.h"
#include "blockdsp.h"
#include "codec_internal.h"
#include "decode.h"
#include "get_bits.h"
#include "idctdsp.h"
#include "libavutil/thread.h"
#include "mathops.h"
#include "mpeg12data.h"
#include "mpeg12vlc.h"
#include "speedhq.h"

Go to the source code of this file.

Data Structures

struct  SHQContext
 

Macros

#define BITSTREAM_READER_LE
 
#define MAX_INDEX   (64 - 1)
 
#define ALPHA_VLC_BITS   5
 

Functions

static int decode_dc_le (GetBitContext *gb, int component)
 
static int decode_alpha_block (const SHQContext *s, GetBitContext *gb, uint8_t last_alpha[16], uint8_t *dest, int linesize)
 
static int decode_dct_block (const SHQContext *s, GetBitContext *gb, int last_dc[4], int component, uint8_t *dest, int linesize)
 
static int decode_speedhq_border (const SHQContext *s, GetBitContext *gb, AVFrame *frame, int field_number, int line_stride)
 
static int decode_speedhq_field (const SHQContext *s, const uint8_t *buf, int buf_size, AVFrame *frame, int field_number, int start, int end, int line_stride)
 
static void compute_quant_matrix (int *output, int qscale)
 
static int speedhq_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 
static av_cold void compute_alpha_vlcs (void)
 
static av_cold void speedhq_static_init (void)
 
static av_cold int speedhq_decode_init (AVCodecContext *avctx)
 

Variables

static const uint8_t unscaled_quant_matrix [64]
 
static VLC dc_lum_vlc_le
 
static VLC dc_chroma_vlc_le
 
static VLC dc_alpha_run_vlc_le
 
static VLC dc_alpha_level_vlc_le
 
static RL_VLC_ELEM speedhq_rl_vlc [674]
 
const FFCodec ff_speedhq_decoder
 

Detailed Description

NewTek SpeedHQ decoder.

Definition in file speedhqdec.c.

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 27 of file speedhqdec.c.

◆ MAX_INDEX

#define MAX_INDEX   (64 - 1)

Definition at line 44 of file speedhqdec.c.

◆ ALPHA_VLC_BITS

#define ALPHA_VLC_BITS   5

Definition at line 50 of file speedhqdec.c.

Function Documentation

◆ decode_dc_le()

static int decode_dc_le ( GetBitContext gb,
int  component 
)
inlinestatic

Definition at line 81 of file speedhqdec.c.

Referenced by decode_dct_block().

◆ decode_alpha_block()

static int decode_alpha_block ( const SHQContext s,
GetBitContext gb,
uint8_t  last_alpha[16],
uint8_t *  dest,
int  linesize 
)
inlinestatic

Definition at line 98 of file speedhqdec.c.

Referenced by decode_speedhq_border(), and decode_speedhq_field().

◆ decode_dct_block()

static int decode_dct_block ( const SHQContext s,
GetBitContext gb,
int  last_dc[4],
int  component,
uint8_t *  dest,
int  linesize 
)
inlinestatic

Definition at line 138 of file speedhqdec.c.

Referenced by decode_speedhq_border(), and decode_speedhq_field().

◆ decode_speedhq_border()

static int decode_speedhq_border ( const SHQContext s,
GetBitContext gb,
AVFrame frame,
int  field_number,
int  line_stride 
)
static

Definition at line 195 of file speedhqdec.c.

Referenced by decode_speedhq_field().

◆ decode_speedhq_field()

static int decode_speedhq_field ( const SHQContext s,
const uint8_t *  buf,
int  buf_size,
AVFrame frame,
int  field_number,
int  start,
int  end,
int  line_stride 
)
static

Definition at line 268 of file speedhqdec.c.

Referenced by speedhq_decode_frame().

◆ compute_quant_matrix()

static void compute_quant_matrix ( int output,
int  qscale 
)
static

Definition at line 400 of file speedhqdec.c.

Referenced by speedhq_decode_frame().

◆ speedhq_decode_frame()

static int speedhq_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 406 of file speedhqdec.c.

◆ compute_alpha_vlcs()

static av_cold void compute_alpha_vlcs ( void  )
static

Definition at line 469 of file speedhqdec.c.

Referenced by speedhq_static_init().

◆ speedhq_static_init()

static av_cold void speedhq_static_init ( void  )
static

Definition at line 556 of file speedhqdec.c.

Referenced by speedhq_decode_init().

◆ speedhq_decode_init()

static av_cold int speedhq_decode_init ( AVCodecContext avctx)
static

Definition at line 575 of file speedhqdec.c.

Variable Documentation

◆ unscaled_quant_matrix

const uint8_t unscaled_quant_matrix[64]
static
Initial value:
= {
16, 16, 19, 22, 26, 27, 29, 34,
16, 16, 22, 24, 27, 29, 34, 37,
19, 22, 26, 27, 29, 34, 34, 38,
22, 22, 26, 27, 29, 34, 37, 40,
22, 26, 27, 29, 32, 35, 40, 48,
26, 27, 29, 32, 35, 40, 48, 58,
26, 27, 29, 34, 38, 46, 56, 69,
27, 29, 35, 38, 46, 56, 69, 83
}

Definition at line 63 of file speedhqdec.c.

Referenced by compute_quant_matrix().

◆ dc_lum_vlc_le

VLC dc_lum_vlc_le
static

Definition at line 74 of file speedhqdec.c.

Referenced by decode_dc_le(), and speedhq_static_init().

◆ dc_chroma_vlc_le

VLC dc_chroma_vlc_le
static

Definition at line 75 of file speedhqdec.c.

Referenced by decode_dc_le(), and speedhq_static_init().

◆ dc_alpha_run_vlc_le

VLC dc_alpha_run_vlc_le
static

Definition at line 76 of file speedhqdec.c.

Referenced by compute_alpha_vlcs(), and decode_alpha_block().

◆ dc_alpha_level_vlc_le

VLC dc_alpha_level_vlc_le
static

Definition at line 77 of file speedhqdec.c.

Referenced by compute_alpha_vlcs(), and decode_alpha_block().

◆ speedhq_rl_vlc

RL_VLC_ELEM speedhq_rl_vlc[674]
static

Definition at line 79 of file speedhqdec.c.

Referenced by decode_dct_block(), and speedhq_static_init().

◆ ff_speedhq_decoder

const FFCodec ff_speedhq_decoder
Initial value:
= {
.p.name = "speedhq",
CODEC_LONG_NAME("NewTek SpeedHQ"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(SHQContext),
.p.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 644 of file speedhqdec.c.

FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
SHQContext
Definition: speedhqdec.c:52
speedhq_decode_frame
static int speedhq_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: speedhqdec.c:406
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
AV_CODEC_ID_SPEEDHQ
@ AV_CODEC_ID_SPEEDHQ
Definition: codec_id.h:278
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
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
speedhq_decode_init
static av_cold int speedhq_decode_init(AVCodecContext *avctx)
Definition: speedhqdec.c:575