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

NewTek SpeedHQ decoder. More...

#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"
#include "thread.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, int slice_number)
 
static int decode_slice_progressive (AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
 
static int decode_slice_interlaced (AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
 
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 VLCElem dc_lum_vlc_le [512]
 
static VLCElem dc_chroma_vlc_le [514]
 
static VLCElem dc_alpha_run_vlc_le [160]
 
static VLCElem dc_alpha_level_vlc_le [288]
 
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 45 of file speedhqdec.c.

◆ ALPHA_VLC_BITS

#define ALPHA_VLC_BITS   5

Definition at line 51 of file speedhqdec.c.

Referenced by compute_alpha_vlcs(), and decode_alpha_block().

Function Documentation

◆ decode_dc_le()

static int decode_dc_le ( GetBitContext * gb,
int component )
inlinestatic

Definition at line 84 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 101 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 141 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 198 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,
int slice_number )
static

Definition at line 271 of file speedhqdec.c.

Referenced by decode_slice_interlaced(), and decode_slice_progressive().

◆ decode_slice_progressive()

static int decode_slice_progressive ( AVCodecContext * avctx,
void * arg,
int jobnr,
int threadnr )
static

Definition at line 399 of file speedhqdec.c.

Referenced by speedhq_decode_frame().

◆ decode_slice_interlaced()

static int decode_slice_interlaced ( AVCodecContext * avctx,
void * arg,
int jobnr,
int threadnr )
static

Definition at line 407 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 420 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 426 of file speedhqdec.c.

◆ compute_alpha_vlcs()

static av_cold void compute_alpha_vlcs ( void )
static

Definition at line 490 of file speedhqdec.c.

Referenced by speedhq_static_init().

◆ speedhq_static_init()

static av_cold void speedhq_static_init ( void )
static

Definition at line 577 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 596 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 66 of file speedhqdec.c.

Referenced by compute_quant_matrix().

◆ dc_lum_vlc_le

VLCElem dc_lum_vlc_le[512]
static

Definition at line 77 of file speedhqdec.c.

Referenced by decode_dc_le(), and speedhq_static_init().

◆ dc_chroma_vlc_le

VLCElem dc_chroma_vlc_le[514]
static

Definition at line 78 of file speedhqdec.c.

Referenced by decode_dc_le(), and speedhq_static_init().

◆ dc_alpha_run_vlc_le

VLCElem dc_alpha_run_vlc_le[160]
static

Definition at line 79 of file speedhqdec.c.

Referenced by compute_alpha_vlcs(), and decode_alpha_block().

◆ dc_alpha_level_vlc_le

VLCElem dc_alpha_level_vlc_le[288]
static

Definition at line 80 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 82 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),
}
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
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_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition codec.h:102
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition codec.h:98
@ AV_CODEC_ID_SPEEDHQ
Definition codec_id.h:270
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int speedhq_decode_init(AVCodecContext *avctx)
Definition speedhqdec.c:596
static int speedhq_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition speedhqdec.c:426

Definition at line 665 of file speedhqdec.c.