FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
diracdec.c File Reference
#include "libavutil/mem_internal.h"
#include "libavutil/pixdesc.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "get_bits.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "internal.h"
#include "golomb.h"
#include "dirac_arith.h"
#include "dirac_vlc.h"
#include "mpeg12data.h"
#include "mpegpicture.h"
#include "mpegvideoencdsp.h"
#include "dirac_dwt.h"
#include "dirac.h"
#include "diractab.h"
#include "diracdsp.h"
#include "videodsp.h"

Go to the source code of this file.

Data Structures

struct  DiracFrame
 
struct  DiracBlock
 
struct  SubBand
 
struct  Plane
 
struct  DiracSlice
 
struct  DiracContext
 
struct  SliceCoeffs
 

Macros

#define MAX_REFERENCE_FRAMES   8
 The spec limits this to 3 for frame coding, but in practice can be as high as 6. More...
 
#define MAX_DELAY   5 /* limit for main profile for frame coding (TODO: field coding) */
 
#define MAX_FRAMES   (MAX_REFERENCE_FRAMES + MAX_DELAY + 1)
 
#define MAX_QUANT   255 /* max quant for VC-2 */
 
#define MAX_BLOCKSIZE   32 /* maximum xblen/yblen we support */
 
#define DIRAC_REF_MASK_REF1   1
 DiracBlock->ref flags, if set then the block does MC from the given ref. More...
 
#define DIRAC_REF_MASK_REF2   2
 
#define DIRAC_REF_MASK_GLOBAL   4
 
#define DELAYED_PIC_REF   4
 Value of Picture.reference when Picture is not a reference picture, but is held for delayed output. More...
 
#define CALC_PADDING(size, depth)   (((size + (1 << depth) - 1) >> depth) << depth)
 
#define DIVRNDUP(a, b)   (((a) + (b) - 1) / (b))
 
#define SIGN_CTX(x)   (CTX_SIGN_ZERO + ((x) > 0) - ((x) < 0))
 
#define UNPACK_ARITH(n, type)
 
#define INTRA_DC_PRED(n, type)
 Dirac Specification -> 13.3 intra_dc_prediction(band) More...
 
#define PARSE_VALUES(type, x, gb, ebits, buf1, buf2)
 
#define CHECKEDREAD(dst, cond, errmsg)
 
#define ROLLOFF(i)
 
#define DATA_UNIT_HEADER_SIZE   13
 Dirac Specification -> 9.6 Parse Info Header Syntax. More...
 

Enumerations

enum  dirac_subband {
  subband_ll = 0, subband_hl = 1, subband_lh = 2, subband_hh = 3,
  subband_nb
}
 

Functions

static int divide3 (int x)
 
static DiracFrameremove_frame (DiracFrame *framelist[], int picnum)
 
static int add_frame (DiracFrame *framelist[], int maxframes, DiracFrame *frame)
 
static int alloc_sequence_buffers (DiracContext *s)
 
static int alloc_buffers (DiracContext *s, int stride)
 
static void free_sequence_buffers (DiracContext *s)
 
static av_cold int dirac_decode_init (AVCodecContext *avctx)
 
static void dirac_decode_flush (AVCodecContext *avctx)
 
static av_cold int dirac_decode_end (AVCodecContext *avctx)
 
static int coeff_unpack_golomb (GetBitContext *gb, int qfactor, int qoffset)
 
static int codeblock (DiracContext *s, SubBand *b, GetBitContext *gb, DiracArith *c, int left, int right, int top, int bottom, int blockcnt_one, int is_arith)
 Decode the coeffs in the rectangle defined by left, right, top, bottom [DIRAC_STD] 13.4.3.2 Codeblock unpacking loop. More...
 
static av_always_inline int decode_subband_internal (DiracContext *s, SubBand *b, int is_arith)
 Dirac Specification -> 13.4.2 Non-skipped subbands. More...
 
static int decode_subband_arith (AVCodecContext *avctx, void *b)
 
static int decode_subband_golomb (AVCodecContext *avctx, void *arg)
 
static int decode_component (DiracContext *s, int comp)
 Dirac Specification -> [DIRAC_STD] 13.4.1 core_transform_data() More...
 
static void decode_subband (DiracContext *s, GetBitContext *gb, int quant, int slice_x, int slice_y, int bits_end, SubBand *b1, SubBand *b2)
 
static int decode_lowdelay_slice (AVCodecContext *avctx, void *arg)
 Dirac Specification -> 13.5.2 Slices. More...
 
static int subband_coeffs (DiracContext *s, int x, int y, int p, SliceCoeffs c[MAX_DWT_LEVELS])
 
static int decode_hq_slice (DiracContext *s, DiracSlice *slice, uint8_t *tmp_buf)
 VC-2 Specification -> 13.5.3 hq_slice(sx,sy) More...
 
static int decode_hq_slice_row (AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
 
static int decode_lowdelay (DiracContext *s)
 Dirac Specification -> 13.5.1 low_delay_transform_data() More...
 
static void init_planes (DiracContext *s)
 
static int dirac_unpack_prediction_parameters (DiracContext *s)
 Unpack the motion compensation parameters Dirac Specification -> 11.2 Picture prediction data. More...
 
static int dirac_unpack_idwt_params (DiracContext *s)
 Dirac Specification -> 11.3 Wavelet transform data. More...
 
static int pred_sbsplit (uint8_t *sbsplit, int stride, int x, int y)
 
static int pred_block_mode (DiracBlock *block, int stride, int x, int y, int refmask)
 
static void pred_block_dc (DiracBlock *block, int stride, int x, int y)
 
static void pred_mv (DiracBlock *block, int stride, int x, int y, int ref)
 
static void global_mv (DiracContext *s, DiracBlock *block, int x, int y, int ref)
 
static void decode_block_params (DiracContext *s, DiracArith arith[8], DiracBlock *block, int stride, int x, int y)
 
static void propagate_block_data (DiracBlock *block, int stride, int size)
 Copies the current block to the other blocks covered by the current superblock split mode. More...
 
static int dirac_unpack_block_motion_data (DiracContext *s)
 Dirac Specification -> More...
 
static int weight (int i, int blen, int offset)
 
static void init_obmc_weight_row (Plane *p, uint8_t *obmc_weight, int stride, int left, int right, int wy)
 
static void init_obmc_weight (Plane *p, uint8_t *obmc_weight, int stride, int left, int right, int top, int bottom)
 
static void init_obmc_weights (DiracContext *s, Plane *p, int by)
 
static int mc_subpel (DiracContext *s, DiracBlock *block, const uint8_t *src[5], int x, int y, int ref, int plane)
 For block x,y, determine which of the hpel planes to do bilinear interpolation from and set src[] to the location in each hpel plane to MC from. More...
 
static void add_dc (uint16_t *dst, int dc, int stride, uint8_t *obmc_weight, int xblen, int yblen)
 
static void block_mc (DiracContext *s, DiracBlock *block, uint16_t *mctmp, uint8_t *obmc_weight, int plane, int dstx, int dsty)
 
static void mc_row (DiracContext *s, DiracBlock *block, uint16_t *mctmp, int plane, int dsty)
 
static void select_dsp_funcs (DiracContext *s, int width, int height, int xblen, int yblen)
 
static int interpolate_refplane (DiracContext *s, DiracFrame *ref, int plane, int width, int height)
 
static int dirac_decode_frame_internal (DiracContext *s)
 Dirac Specification -> 13.0 Transform data syntax. More...
 
static int get_buffer_with_edge (AVCodecContext *avctx, AVFrame *f, int flags)
 
static int dirac_decode_picture_header (DiracContext *s)
 Dirac Specification -> 11.1.1 Picture Header. More...
 
static int get_delayed_pic (DiracContext *s, AVFrame *picture, int *got_frame)
 
static int dirac_decode_data_unit (AVCodecContext *avctx, const uint8_t *buf, int size)
 
static int dirac_decode_frame (AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *pkt)
 

Variables

static AVOnce dirac_arith_init = AV_ONCE_INIT
 
static const uint8_t epel_weights [4][4][4]
 
const FFCodec ff_dirac_decoder
 

Detailed Description

Dirac Decoder

Author
Marco Gerards marco.nosp@m.@gnu.nosp@m..org, David Conrad, Jordi Ortiz nenjo.nosp@m.rdi@.nosp@m.gmail.nosp@m..com

Definition in file diracdec.c.

Macro Definition Documentation

◆ MAX_REFERENCE_FRAMES

#define MAX_REFERENCE_FRAMES   8

The spec limits this to 3 for frame coding, but in practice can be as high as 6.

Definition at line 52 of file diracdec.c.

◆ MAX_DELAY

#define MAX_DELAY   5 /* limit for main profile for frame coding (TODO: field coding) */

Definition at line 53 of file diracdec.c.

◆ MAX_FRAMES

#define MAX_FRAMES   (MAX_REFERENCE_FRAMES + MAX_DELAY + 1)

Definition at line 54 of file diracdec.c.

◆ MAX_QUANT

#define MAX_QUANT   255 /* max quant for VC-2 */

Definition at line 55 of file diracdec.c.

◆ MAX_BLOCKSIZE

#define MAX_BLOCKSIZE   32 /* maximum xblen/yblen we support */

Definition at line 56 of file diracdec.c.

◆ DIRAC_REF_MASK_REF1

#define DIRAC_REF_MASK_REF1   1

DiracBlock->ref flags, if set then the block does MC from the given ref.

Definition at line 61 of file diracdec.c.

◆ DIRAC_REF_MASK_REF2

#define DIRAC_REF_MASK_REF2   2

Definition at line 62 of file diracdec.c.

◆ DIRAC_REF_MASK_GLOBAL

#define DIRAC_REF_MASK_GLOBAL   4

Definition at line 63 of file diracdec.c.

◆ DELAYED_PIC_REF

#define DELAYED_PIC_REF   4

Value of Picture.reference when Picture is not a reference picture, but is held for delayed output.

Definition at line 69 of file diracdec.c.

◆ CALC_PADDING

#define CALC_PADDING (   size,
  depth 
)    (((size + (1 << depth) - 1) >> depth) << depth)

Definition at line 71 of file diracdec.c.

◆ DIVRNDUP

#define DIVRNDUP (   a,
  b 
)    (((a) + (b) - 1) / (b))

Definition at line 74 of file diracdec.c.

◆ SIGN_CTX

#define SIGN_CTX (   x)    (CTX_SIGN_ZERO + ((x) > 0) - ((x) < 0))

Definition at line 450 of file diracdec.c.

◆ UNPACK_ARITH

#define UNPACK_ARITH (   n,
  type 
)
Value:
static inline void coeff_unpack_arith_##n(DiracArith *c, int qfactor, int qoffset, \
SubBand *b, type *buf, int x, int y) \
{ \
int sign, sign_pred = 0, pred_ctx = CTX_ZPZN_F1; \
unsigned coeff; \
const int mstride = -(b->stride >> (1+b->pshift)); \
if (b->parent) { \
const type *pbuf = (type *)b->parent->ibuf; \
const int stride = b->parent->stride >> (1+b->parent->pshift); \
pred_ctx += !!pbuf[stride * (y>>1) + (x>>1)] << 1; \
} \
if (b->orientation == subband_hl) \
sign_pred = buf[mstride]; \
if (x) { \
pred_ctx += !(buf[-1] | buf[mstride] | buf[-1 + mstride]); \
if (b->orientation == subband_lh) \
sign_pred = buf[-1]; \
} else { \
pred_ctx += !buf[mstride]; \
} \
coeff = dirac_get_arith_uint(c, pred_ctx, CTX_COEFF_DATA); \
if (coeff) { \
coeff = (coeff * qfactor + qoffset) >> 2; \
sign = dirac_get_arith_bit(c, SIGN_CTX(sign_pred)); \
coeff = (coeff ^ -sign) + sign; \
} \
*buf = coeff; \
} \

Definition at line 452 of file diracdec.c.

◆ INTRA_DC_PRED

#define INTRA_DC_PRED (   n,
  type 
)
Value:
static inline void intra_dc_prediction_##n(SubBand *b) \
{ \
type *buf = (type*)b->ibuf; \
int x, y; \
\
for (x = 1; x < b->width; x++) \
buf[x] += buf[x-1]; \
buf += (b->stride >> (1+b->pshift)); \
for (y = 1; y < b->height; y++) { \
buf[0] += buf[-(b->stride >> (1+b->pshift))]; \
for (x = 1; x < b->width; x++) { \
int pred = buf[x - 1] + buf[x - (b->stride >> (1+b->pshift))] + buf[x - (b->stride >> (1+b->pshift))-1]; \
buf[x] += divide3(pred); \
} \
buf += (b->stride >> (1+b->pshift)); \
} \
} \

Dirac Specification -> 13.3 intra_dc_prediction(band)

Definition at line 571 of file diracdec.c.

◆ PARSE_VALUES

#define PARSE_VALUES (   type,
  x,
  gb,
  ebits,
  buf1,
  buf2 
)
Value:
type *buf = (type *)buf1; \
buf[x] = coeff_unpack_golomb(gb, qfactor, qoffset); \
if (get_bits_count(gb) >= ebits) \
return; \
if (buf2) { \
buf = (type *)buf2; \
buf[x] = coeff_unpack_golomb(gb, qfactor, qoffset); \
if (get_bits_count(gb) >= ebits) \
return; \
} \

Definition at line 712 of file diracdec.c.

◆ CHECKEDREAD

#define CHECKEDREAD (   dst,
  cond,
  errmsg 
)
Value:
if (cond) { \
av_log(s->avctx, AV_LOG_ERROR, errmsg); \
}\
dst = tmp;

◆ ROLLOFF

#define ROLLOFF (   i)
Value:
offset == 1 ? ((i) ? 5 : 3) : \
(1 + (6*(i) + offset - 1) / (2*offset - 1))

◆ DATA_UNIT_HEADER_SIZE

#define DATA_UNIT_HEADER_SIZE   13

Dirac Specification -> 9.6 Parse Info Header Syntax.

parse_info() 4 byte start code + byte parse code + 4 byte size + 4 byte previous size

Definition at line 2117 of file diracdec.c.

Enumeration Type Documentation

◆ dirac_subband

Enumerator
subband_ll 
subband_hl 
subband_lh 
subband_hh 
subband_nb 

Definition at line 243 of file diracdec.c.

Function Documentation

◆ divide3()

static int divide3 ( int  x)
inlinestatic

Definition at line 252 of file diracdec.c.

Referenced by pred_block_dc().

◆ remove_frame()

static DiracFrame* remove_frame ( DiracFrame framelist[],
int  picnum 
)
static

Definition at line 257 of file diracdec.c.

Referenced by dirac_decode_frame(), and dirac_decode_picture_header().

◆ add_frame()

static int add_frame ( DiracFrame framelist[],
int  maxframes,
DiracFrame frame 
)
static

Definition at line 275 of file diracdec.c.

Referenced by dirac_decode_frame(), and dirac_decode_picture_header().

◆ alloc_sequence_buffers()

static int alloc_sequence_buffers ( DiracContext s)
static

Definition at line 286 of file diracdec.c.

Referenced by dirac_decode_data_unit().

◆ alloc_buffers()

static int alloc_buffers ( DiracContext s,
int  stride 
)
static

Definition at line 324 of file diracdec.c.

Referenced by dirac_decode_data_unit().

◆ free_sequence_buffers()

static void free_sequence_buffers ( DiracContext s)
static

Definition at line 353 of file diracdec.c.

Referenced by dirac_decode_data_unit(), and dirac_decode_flush().

◆ dirac_decode_init()

static av_cold int dirac_decode_init ( AVCodecContext avctx)
static

Definition at line 387 of file diracdec.c.

◆ dirac_decode_flush()

static void dirac_decode_flush ( AVCodecContext avctx)
static

Definition at line 418 of file diracdec.c.

Referenced by dirac_decode_end().

◆ dirac_decode_end()

static av_cold int dirac_decode_end ( AVCodecContext avctx)
static

Definition at line 426 of file diracdec.c.

◆ coeff_unpack_golomb()

static int coeff_unpack_golomb ( GetBitContext gb,
int  qfactor,
int  qoffset 
)
inlinestatic

Definition at line 441 of file diracdec.c.

Referenced by codeblock().

◆ codeblock()

static int codeblock ( DiracContext s,
SubBand b,
GetBitContext gb,
DiracArith c,
int  left,
int  right,
int  top,
int  bottom,
int  blockcnt_one,
int  is_arith 
)
inlinestatic

Decode the coeffs in the rectangle defined by left, right, top, bottom [DIRAC_STD] 13.4.3.2 Codeblock unpacking loop.

codeblock()

Definition at line 489 of file diracdec.c.

Referenced by decode_subband_internal().

◆ decode_subband_internal()

static av_always_inline int decode_subband_internal ( DiracContext s,
SubBand b,
int  is_arith 
)
static

Dirac Specification -> 13.4.2 Non-skipped subbands.

subband_coeffs()

Definition at line 599 of file diracdec.c.

Referenced by decode_subband_arith(), and decode_subband_golomb().

◆ decode_subband_arith()

static int decode_subband_arith ( AVCodecContext avctx,
void *  b 
)
static

Definition at line 641 of file diracdec.c.

Referenced by decode_component().

◆ decode_subband_golomb()

static int decode_subband_golomb ( AVCodecContext avctx,
void *  arg 
)
static

Definition at line 647 of file diracdec.c.

Referenced by decode_component().

◆ decode_component()

static int decode_component ( DiracContext s,
int  comp 
)
static

Dirac Specification -> [DIRAC_STD] 13.4.1 core_transform_data()

Definition at line 658 of file diracdec.c.

Referenced by dirac_decode_frame_internal().

◆ decode_subband()

static void decode_subband ( DiracContext s,
GetBitContext gb,
int  quant,
int  slice_x,
int  slice_y,
int  bits_end,
SubBand b1,
SubBand b2 
)
static

Definition at line 724 of file diracdec.c.

Referenced by decode_lowdelay_slice().

◆ decode_lowdelay_slice()

static int decode_lowdelay_slice ( AVCodecContext avctx,
void *  arg 
)
static

Dirac Specification -> 13.5.2 Slices.

slice(sx,sy)

Definition at line 776 of file diracdec.c.

Referenced by decode_lowdelay().

◆ subband_coeffs()

static int subband_coeffs ( DiracContext s,
int  x,
int  y,
int  p,
SliceCoeffs  c[MAX_DWT_LEVELS] 
)
static

Definition at line 822 of file diracdec.c.

Referenced by decode_hq_slice(), and decode_lowdelay().

◆ decode_hq_slice()

static int decode_hq_slice ( DiracContext s,
DiracSlice slice,
uint8_t *  tmp_buf 
)
static

VC-2 Specification -> 13.5.3 hq_slice(sx,sy)

Definition at line 843 of file diracdec.c.

Referenced by decode_hq_slice_row().

◆ decode_hq_slice_row()

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

Definition at line 917 of file diracdec.c.

Referenced by decode_lowdelay().

◆ decode_lowdelay()

static int decode_lowdelay ( DiracContext s)
static

Dirac Specification -> 13.5.1 low_delay_transform_data()

Definition at line 932 of file diracdec.c.

Referenced by dirac_decode_frame_internal().

◆ init_planes()

static void init_planes ( DiracContext s)
static

Definition at line 1050 of file diracdec.c.

Referenced by dirac_decode_picture_header().

◆ dirac_unpack_prediction_parameters()

static int dirac_unpack_prediction_parameters ( DiracContext s)
static

Unpack the motion compensation parameters Dirac Specification -> 11.2 Picture prediction data.

picture_prediction()

Definition at line 1104 of file diracdec.c.

Referenced by dirac_decode_picture_header().

◆ dirac_unpack_idwt_params()

static int dirac_unpack_idwt_params ( DiracContext s)
static

Dirac Specification -> 11.3 Wavelet transform data.

wavelet_transform()

Definition at line 1232 of file diracdec.c.

Referenced by dirac_decode_picture_header().

◆ pred_sbsplit()

static int pred_sbsplit ( uint8_t *  sbsplit,
int  stride,
int  x,
int  y 
)
inlinestatic

Definition at line 1328 of file diracdec.c.

Referenced by dirac_unpack_block_motion_data().

◆ pred_block_mode()

static int pred_block_mode ( DiracBlock block,
int  stride,
int  x,
int  y,
int  refmask 
)
inlinestatic

Definition at line 1342 of file diracdec.c.

Referenced by decode_block_params().

◆ pred_block_dc()

static void pred_block_dc ( DiracBlock block,
int  stride,
int  x,
int  y 
)
inlinestatic

Definition at line 1358 of file diracdec.c.

Referenced by decode_block_params().

◆ pred_mv()

static void pred_mv ( DiracBlock block,
int  stride,
int  x,
int  y,
int  ref 
)
inlinestatic

◆ global_mv()

static void global_mv ( DiracContext s,
DiracBlock block,
int  x,
int  y,
int  ref 
)
static

Definition at line 1427 of file diracdec.c.

Referenced by decode_block_params().

◆ decode_block_params()

static void decode_block_params ( DiracContext s,
DiracArith  arith[8],
DiracBlock block,
int  stride,
int  x,
int  y 
)
static

Definition at line 1443 of file diracdec.c.

Referenced by dirac_unpack_block_motion_data().

◆ propagate_block_data()

static void propagate_block_data ( DiracBlock block,
int  stride,
int  size 
)
static

Copies the current block to the other blocks covered by the current superblock split mode.

Definition at line 1483 of file diracdec.c.

Referenced by dirac_unpack_block_motion_data().

◆ dirac_unpack_block_motion_data()

static int dirac_unpack_block_motion_data ( DiracContext s)
static

Dirac Specification ->

  1. Block motion data syntax

Definition at line 1502 of file diracdec.c.

Referenced by dirac_decode_picture_header().

◆ weight()

static int weight ( int  i,
int  blen,
int  offset 
)
static

Definition at line 1562 of file diracdec.c.

Referenced by apply_delogo(), aptx_process_subband(), cas_slice16(), cas_slice8(), celt_gauge_psy_weight(), check_decorrelate_stereo(), compute_contrast_function(), compute_weights_line_c(), dct_quantize_refine(), dv_set_class_number_hd(), dv_set_class_number_sd(), encode_mb_internal(), ff_h264_biweight_pixels4_8_mmi(), ff_h264_weight_pixels16_8_mmi(), ff_h264_weight_pixels4_8_mmi(), ff_h264_weight_pixels8_8_mmi(), ff_lpc_calc_coefs(), ff_lpc_calc_ref_coefs_f(), find_form_factor(), get_visual_weight(), guess_dc(), hevc_biwgt_copy_12w_msa(), hevc_biwgt_copy_16w_msa(), hevc_biwgt_copy_24w_msa(), hevc_biwgt_copy_32w_msa(), hevc_biwgt_copy_48w_msa(), hevc_biwgt_copy_4w_msa(), hevc_biwgt_copy_64w_msa(), hevc_biwgt_copy_6w_msa(), hevc_biwgt_copy_8w_msa(), hevc_hv_8t_16w_lsx(), hevc_hv_8t_24w_lsx(), hevc_hv_8t_32w_lsx(), hevc_hv_8t_48w_lsx(), hevc_hv_8t_64w_lsx(), hevc_hv_8t_8w_lsx(), hevc_hv_8t_8x2_lsx(), hevc_hv_biwgt_4t_12w_msa(), hevc_hv_biwgt_4t_4multx8mult_msa(), hevc_hv_biwgt_4t_4x2_msa(), hevc_hv_biwgt_4t_4x4_msa(), hevc_hv_biwgt_4t_6w_msa(), hevc_hv_biwgt_4t_8multx4_msa(), hevc_hv_biwgt_4t_8multx4mult_msa(), hevc_hv_biwgt_4t_8x2_msa(), hevc_hv_biwgt_4t_8x6_msa(), hevc_hv_biwgt_8t_12w_msa(), hevc_hv_biwgt_8t_4w_msa(), hevc_hv_biwgt_8t_8multx2mult_msa(), hevc_hv_uniwgt_4t_12w_msa(), hevc_hv_uniwgt_4t_16w_msa(), hevc_hv_uniwgt_4t_24w_msa(), hevc_hv_uniwgt_4t_32w_msa(), hevc_hv_uniwgt_4t_4multx8mult_msa(), hevc_hv_uniwgt_4t_4w_msa(), hevc_hv_uniwgt_4t_4x2_msa(), hevc_hv_uniwgt_4t_4x4_msa(), hevc_hv_uniwgt_4t_6w_msa(), hevc_hv_uniwgt_4t_8multx4_msa(), hevc_hv_uniwgt_4t_8multx4mult_msa(), hevc_hv_uniwgt_4t_8w_msa(), hevc_hv_uniwgt_4t_8x2_msa(), hevc_hv_uniwgt_4t_8x6_msa(), hevc_hv_uniwgt_8t_12w_msa(), hevc_hv_uniwgt_8t_16w_msa(), hevc_hv_uniwgt_8t_24w_msa(), hevc_hv_uniwgt_8t_32w_msa(), hevc_hv_uniwgt_8t_48w_msa(), hevc_hv_uniwgt_8t_4w_msa(), hevc_hv_uniwgt_8t_64w_msa(), hevc_hv_uniwgt_8t_8multx2mult_msa(), hevc_hv_uniwgt_8t_8w_msa(), hevc_hz_biwgt_4t_12w_msa(), hevc_hz_biwgt_4t_16w_msa(), hevc_hz_biwgt_4t_24w_msa(), hevc_hz_biwgt_4t_32w_msa(), hevc_hz_biwgt_4t_4x2_msa(), hevc_hz_biwgt_4t_4x4_msa(), hevc_hz_biwgt_4t_4x8multiple_msa(), hevc_hz_biwgt_4t_6w_msa(), hevc_hz_biwgt_4t_8x2_msa(), hevc_hz_biwgt_4t_8x4multiple_msa(), hevc_hz_biwgt_4t_8x6_msa(), hevc_hz_biwgt_8t_12w_msa(), hevc_hz_biwgt_8t_16w_msa(), hevc_hz_biwgt_8t_24w_msa(), hevc_hz_biwgt_8t_32w_msa(), hevc_hz_biwgt_8t_48w_msa(), hevc_hz_biwgt_8t_4w_msa(), hevc_hz_biwgt_8t_64w_msa(), hevc_hz_biwgt_8t_8w_msa(), hevc_hz_uniwgt_4t_12w_msa(), hevc_hz_uniwgt_4t_16w_msa(), hevc_hz_uniwgt_4t_24w_msa(), hevc_hz_uniwgt_4t_32w_msa(), hevc_hz_uniwgt_4t_4w_msa(), hevc_hz_uniwgt_4t_4x2_msa(), hevc_hz_uniwgt_4t_4x4_msa(), hevc_hz_uniwgt_4t_4x8multiple_msa(), hevc_hz_uniwgt_4t_6w_msa(), hevc_hz_uniwgt_4t_8w_msa(), hevc_hz_uniwgt_4t_8x2_msa(), hevc_hz_uniwgt_4t_8x4_msa(), hevc_hz_uniwgt_4t_8x6_msa(), hevc_hz_uniwgt_4t_8x8multiple_msa(), hevc_hz_uniwgt_8t_12w_msa(), hevc_hz_uniwgt_8t_16w_msa(), hevc_hz_uniwgt_8t_24w_msa(), hevc_hz_uniwgt_8t_32w_msa(), hevc_hz_uniwgt_8t_48w_msa(), hevc_hz_uniwgt_8t_4w_msa(), hevc_hz_uniwgt_8t_64w_msa(), hevc_hz_uniwgt_8t_8w_msa(), hevc_uniwgt_copy_12w_msa(), hevc_uniwgt_copy_16w_msa(), hevc_uniwgt_copy_24w_msa(), hevc_uniwgt_copy_32w_msa(), hevc_uniwgt_copy_48w_msa(), hevc_uniwgt_copy_4w_msa(), hevc_uniwgt_copy_64w_msa(), hevc_uniwgt_copy_6w_msa(), hevc_uniwgt_copy_8w_msa(), hevc_vt_biwgt_4t_12w_msa(), hevc_vt_biwgt_4t_16w_msa(), hevc_vt_biwgt_4t_24w_msa(), hevc_vt_biwgt_4t_32w_msa(), hevc_vt_biwgt_4t_4x2_msa(), hevc_vt_biwgt_4t_4x4_msa(), hevc_vt_biwgt_4t_4x8multiple_msa(), hevc_vt_biwgt_4t_6w_msa(), hevc_vt_biwgt_4t_8x2_msa(), hevc_vt_biwgt_4t_8x4multiple_msa(), hevc_vt_biwgt_4t_8x6_msa(), hevc_vt_biwgt_8t_12w_msa(), hevc_vt_biwgt_8t_16multx2mult_msa(), hevc_vt_biwgt_8t_4w_msa(), hevc_vt_biwgt_8t_8w_msa(), hevc_vt_uniwgt_4t_12w_msa(), hevc_vt_uniwgt_4t_16w_msa(), hevc_vt_uniwgt_4t_24w_msa(), hevc_vt_uniwgt_4t_32w_msa(), hevc_vt_uniwgt_4t_4w_msa(), hevc_vt_uniwgt_4t_4x2_msa(), hevc_vt_uniwgt_4t_4x4_msa(), hevc_vt_uniwgt_4t_4x8multiple_msa(), hevc_vt_uniwgt_4t_6w_msa(), hevc_vt_uniwgt_4t_8w_msa(), hevc_vt_uniwgt_4t_8x2_msa(), hevc_vt_uniwgt_4t_8x4_msa(), hevc_vt_uniwgt_4t_8x6_msa(), hevc_vt_uniwgt_4t_8x8mult_msa(), hevc_vt_uniwgt_8t_12w_msa(), hevc_vt_uniwgt_8t_16multx4mult_msa(), hevc_vt_uniwgt_8t_16w_msa(), hevc_vt_uniwgt_8t_24w_msa(), hevc_vt_uniwgt_8t_32w_msa(), hevc_vt_uniwgt_8t_48w_msa(), hevc_vt_uniwgt_8t_4w_msa(), hevc_vt_uniwgt_8t_64w_msa(), hevc_vt_uniwgt_8t_8w_msa(), init_obmc_weight(), init_obmc_weight_row(), interpolate_lpc(), lsp_quantize(), mc_block(), multiply_data(), restore_weight(), silk_decode_lpc(), ssim_db(), store_weight(), try_8x8basis_c(), and try_8x8basis_TMPL().

◆ init_obmc_weight_row()

static void init_obmc_weight_row ( Plane p,
uint8_t *  obmc_weight,
int  stride,
int  left,
int  right,
int  wy 
)
static

Definition at line 1574 of file diracdec.c.

Referenced by init_obmc_weight().

◆ init_obmc_weight()

static void init_obmc_weight ( Plane p,
uint8_t *  obmc_weight,
int  stride,
int  left,
int  right,
int  top,
int  bottom 
)
static

Definition at line 1588 of file diracdec.c.

Referenced by init_obmc_weights().

◆ init_obmc_weights()

static void init_obmc_weights ( DiracContext s,
Plane p,
int  by 
)
static

Definition at line 1607 of file diracdec.c.

Referenced by dirac_decode_frame_internal().

◆ mc_subpel()

static int mc_subpel ( DiracContext s,
DiracBlock block,
const uint8_t *  src[5],
int  x,
int  y,
int  ref,
int  plane 
)
static

For block x,y, determine which of the hpel planes to do bilinear interpolation from and set src[] to the location in each hpel plane to MC from.

Returns
the index of the put_dirac_pixels_tab function to use 0 for 1 plane (fpel,hpel), 1 for 2 planes (qpel), 2 for 4 planes (qpel), and 3 for epel

Definition at line 1647 of file diracdec.c.

Referenced by block_mc().

◆ add_dc()

static void add_dc ( uint16_t *  dst,
int  dc,
int  stride,
uint8_t *  obmc_weight,
int  xblen,
int  yblen 
)
static

Definition at line 1742 of file diracdec.c.

Referenced by block_mc().

◆ block_mc()

static void block_mc ( DiracContext s,
DiracBlock block,
uint16_t *  mctmp,
uint8_t *  obmc_weight,
int  plane,
int  dstx,
int  dsty 
)
static

Definition at line 1758 of file diracdec.c.

Referenced by mc_row().

◆ mc_row()

static void mc_row ( DiracContext s,
DiracBlock block,
uint16_t *  mctmp,
int  plane,
int  dsty 
)
static

Definition at line 1794 of file diracdec.c.

Referenced by dirac_decode_frame_internal().

◆ select_dsp_funcs()

static void select_dsp_funcs ( DiracContext s,
int  width,
int  height,
int  xblen,
int  yblen 
)
static

Definition at line 1810 of file diracdec.c.

Referenced by dirac_decode_frame_internal().

◆ interpolate_refplane()

static int interpolate_refplane ( DiracContext s,
DiracFrame ref,
int  plane,
int  width,
int  height 
)
static

Definition at line 1830 of file diracdec.c.

Referenced by dirac_decode_frame_internal().

◆ dirac_decode_frame_internal()

static int dirac_decode_frame_internal ( DiracContext s)
static

Dirac Specification -> 13.0 Transform data syntax.

transform_data()

Definition at line 1871 of file diracdec.c.

Referenced by dirac_decode_data_unit().

◆ get_buffer_with_edge()

static int get_buffer_with_edge ( AVCodecContext avctx,
AVFrame f,
int  flags 
)
static

Definition at line 1968 of file diracdec.c.

Referenced by dirac_decode_data_unit(), and dirac_decode_picture_header().

◆ dirac_decode_picture_header()

static int dirac_decode_picture_header ( DiracContext s)
static

Dirac Specification -> 11.1.1 Picture Header.

picture_header()

Definition at line 1998 of file diracdec.c.

Referenced by dirac_decode_data_unit().

◆ get_delayed_pic()

static int get_delayed_pic ( DiracContext s,
AVFrame picture,
int got_frame 
)
static

Definition at line 2086 of file diracdec.c.

Referenced by dirac_decode_frame().

◆ dirac_decode_data_unit()

static int dirac_decode_data_unit ( AVCodecContext avctx,
const uint8_t *  buf,
int  size 
)
static

Definition at line 2121 of file diracdec.c.

Referenced by dirac_decode_frame().

◆ dirac_decode_frame()

static int dirac_decode_frame ( AVCodecContext avctx,
AVFrame picture,
int got_frame,
AVPacket pkt 
)
static

Definition at line 2263 of file diracdec.c.

Variable Documentation

◆ dirac_arith_init

AVOnce dirac_arith_init = AV_ONCE_INIT
static

Definition at line 385 of file diracdec.c.

Referenced by dirac_decode_init().

◆ epel_weights

const uint8_t epel_weights[4][4][4]
static
Initial value:
= {
{{ 16, 0, 0, 0 },
{ 12, 4, 0, 0 },
{ 8, 8, 0, 0 },
{ 4, 12, 0, 0 }},
{{ 12, 0, 4, 0 },
{ 9, 3, 3, 1 },
{ 6, 6, 2, 2 },
{ 3, 9, 1, 3 }},
{{ 8, 0, 8, 0 },
{ 6, 2, 6, 2 },
{ 4, 4, 4, 4 },
{ 2, 6, 2, 6 }},
{{ 4, 0, 12, 0 },
{ 3, 1, 9, 3 },
{ 2, 2, 6, 6 },
{ 1, 3, 3, 9 }}
}

Definition at line 1620 of file diracdec.c.

Referenced by mc_subpel().

◆ ff_dirac_decoder

const FFCodec ff_dirac_decoder
Initial value:
= {
.p.name = "dirac",
.p.long_name = NULL_IF_CONFIG_SMALL("BBC Dirac VC-2"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(DiracContext),
.close = dirac_decode_end,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 2359 of file diracdec.c.

CTX_COEFF_DATA
@ CTX_COEFF_DATA
Definition: dirac_arith.h:50
AV_CODEC_ID_DIRAC
@ AV_CODEC_ID_DIRAC
Definition: codec_id.h:166
get_bits_count
static int get_bits_count(const GetBitContext *s)
Definition: get_bits.h:219
get_interleaved_ue_golomb
static unsigned get_interleaved_ue_golomb(GetBitContext *gb)
Definition: golomb.h:143
tmp
static uint8_t tmp[11]
Definition: aes_ctr.c:28
CTX_ZPZN_F1
@ CTX_ZPZN_F1
Definition: dirac_arith.h:36
b
#define b
Definition: input.c:34
DiracArith
Definition: dirac_arith.h:75
init
static int init
Definition: av_tx.c:47
subband_lh
@ subband_lh
Definition: diracdec.c:246
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
coeff_unpack_golomb
static int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffset)
Definition: diracdec.c:441
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:254
s
#define s(width, name)
Definition: cbs_vp9.c:256
dirac_get_arith_bit
static int dirac_get_arith_bit(DiracArith *c, int ctx)
Definition: dirac_arith.h:133
dirac_get_arith_uint
static int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_ctx)
Definition: dirac_arith.h:174
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
dirac_decode_end
static av_cold int dirac_decode_end(AVCodecContext *avctx)
Definition: diracdec.c:426
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
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:117
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
SubBand
Definition: cfhd.h:109
SIGN_CTX
#define SIGN_CTX(x)
Definition: diracdec.c:450
AV_CODEC_CAP_SLICE_THREADS
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition: codec.h:117
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
dirac_decode_frame
static int dirac_decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *pkt)
Definition: diracdec.c:2263
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
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: codec_internal.h:31
stride
#define stride
Definition: h264pred_template.c:537
pred
static const float pred[4]
Definition: siprdata.h:259
DiracContext
Definition: diracdec.c:136
subband_hl
@ subband_hl
Definition: diracdec.c:245
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:82
divide3
static int divide3(int x)
Definition: diracdec.c:252
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
coeff
static const double coeff[2][5]
Definition: vf_owdenoise.c:78
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
dirac_decode_init
static av_cold int dirac_decode_init(AVCodecContext *avctx)
Definition: diracdec.c:387
dirac_decode_flush
static void dirac_decode_flush(AVCodecContext *avctx)
Definition: diracdec.c:418
cond
int(* cond)(enum AVPixelFormat pix_fmt)
Definition: pixdesc_query.c:28