FFmpeg
|
#include "libavutil/mem.h"
#include "libavutil/mem_internal.h"
#include "libavutil/pixdesc.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "get_bits.h"
#include "codec_internal.h"
#include "decode.h"
#include "golomb.h"
#include "dirac_arith.h"
#include "dirac_vlc.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 | EDGE_WIDTH 16 |
#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 DiracFrame * | remove_frame (DiracFrame *framelist[], unsigned 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 av_cold void | free_sequence_buffers (DiracContext *s) |
static av_cold int | dirac_decode_init (AVCodecContext *avctx) |
static av_cold 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 (const 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 (const 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 (const DiracContext *s, GetBitContext *gb, int quant, int slice_x, int slice_y, int bits_end, const SubBand *b1, const SubBand *b2) |
static int | decode_lowdelay_slice (AVCodecContext *avctx, void *arg) |
Dirac Specification -> 13.5.2 Slices. More... | |
static int | subband_coeffs (const DiracContext *s, int x, int y, int p, SliceCoeffs c[MAX_DWT_LEVELS]) |
static int | decode_hq_slice (const 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 |
Dirac Decoder
Definition in file diracdec.c.
#define EDGE_WIDTH 16 |
Definition at line 47 of file diracdec.c.
#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.
Definition at line 53 of file diracdec.c.
#define MAX_FRAMES (MAX_REFERENCE_FRAMES + MAX_DELAY + 1) |
Definition at line 54 of file diracdec.c.
Definition at line 55 of file diracdec.c.
#define MAX_BLOCKSIZE 32 /* maximum xblen/yblen we support */ |
Definition at line 56 of file diracdec.c.
#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.
#define DIRAC_REF_MASK_REF2 2 |
Definition at line 62 of file diracdec.c.
#define DIRAC_REF_MASK_GLOBAL 4 |
Definition at line 63 of file diracdec.c.
#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.
Definition at line 71 of file diracdec.c.
#define SIGN_CTX | ( | x | ) | (CTX_SIGN_ZERO + ((x) > 0) - ((x) < 0)) |
Definition at line 450 of file diracdec.c.
#define UNPACK_ARITH | ( | n, | |
type | |||
) |
Definition at line 452 of file diracdec.c.
#define INTRA_DC_PRED | ( | n, | |
type | |||
) |
#define PARSE_VALUES | ( | type, | |
x, | |||
gb, | |||
ebits, | |||
buf1, | |||
buf2 | |||
) |
Definition at line 713 of file diracdec.c.
#define ROLLOFF | ( | i | ) |
#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 2118 of file diracdec.c.
enum dirac_subband |
Enumerator | |
---|---|
subband_ll | |
subband_hl | |
subband_lh | |
subband_hh | |
subband_nb |
Definition at line 244 of file diracdec.c.
|
inlinestatic |
Definition at line 253 of file diracdec.c.
Referenced by pred_block_dc().
|
static |
Definition at line 258 of file diracdec.c.
Referenced by dirac_decode_frame(), and dirac_decode_picture_header().
|
static |
Definition at line 276 of file diracdec.c.
Referenced by dirac_decode_frame(), and dirac_decode_picture_header().
|
static |
Definition at line 287 of file diracdec.c.
Referenced by dirac_decode_data_unit().
|
static |
Definition at line 325 of file diracdec.c.
Referenced by dirac_decode_data_unit().
|
static |
Definition at line 354 of file diracdec.c.
Referenced by dirac_decode_data_unit(), dirac_decode_end(), and dirac_decode_flush().
|
static |
Definition at line 388 of file diracdec.c.
|
static |
Definition at line 416 of file diracdec.c.
|
static |
Definition at line 424 of file diracdec.c.
|
inlinestatic |
Definition at line 441 of file diracdec.c.
Referenced by codeblock().
|
inlinestatic |
Decode the coeffs in the rectangle defined by left, right, top, bottom [DIRAC_STD] 13.4.3.2 Codeblock unpacking loop.
Definition at line 489 of file diracdec.c.
Referenced by decode_subband_internal().
|
static |
Dirac Specification -> 13.4.2 Non-skipped subbands.
Definition at line 599 of file diracdec.c.
Referenced by decode_subband_arith(), and decode_subband_golomb().
|
static |
Definition at line 642 of file diracdec.c.
Referenced by decode_component().
|
static |
Definition at line 648 of file diracdec.c.
Referenced by decode_component().
|
static |
Dirac Specification -> [DIRAC_STD] 13.4.1 core_transform_data()
Definition at line 659 of file diracdec.c.
Referenced by dirac_decode_frame_internal().
|
static |
Definition at line 725 of file diracdec.c.
Referenced by decode_lowdelay_slice().
|
static |
Dirac Specification -> 13.5.2 Slices.
slice(sx,sy)
Definition at line 777 of file diracdec.c.
Referenced by decode_lowdelay().
|
static |
Definition at line 823 of file diracdec.c.
Referenced by decode_hq_slice(), and decode_lowdelay().
|
static |
VC-2 Specification -> 13.5.3 hq_slice(sx,sy)
Definition at line 844 of file diracdec.c.
Referenced by decode_hq_slice_row().
|
static |
Definition at line 918 of file diracdec.c.
Referenced by decode_lowdelay().
|
static |
Dirac Specification -> 13.5.1 low_delay_transform_data()
Definition at line 933 of file diracdec.c.
Referenced by dirac_decode_frame_internal().
|
static |
Definition at line 1051 of file diracdec.c.
Referenced by dirac_decode_picture_header().
|
static |
Unpack the motion compensation parameters Dirac Specification -> 11.2 Picture prediction data.
picture_prediction()
Definition at line 1105 of file diracdec.c.
Referenced by dirac_decode_picture_header().
|
static |
Dirac Specification -> 11.3 Wavelet transform data.
wavelet_transform()
Definition at line 1233 of file diracdec.c.
Referenced by dirac_decode_picture_header().
|
inlinestatic |
Definition at line 1329 of file diracdec.c.
Referenced by dirac_unpack_block_motion_data().
|
inlinestatic |
Definition at line 1343 of file diracdec.c.
Referenced by decode_block_params().
|
inlinestatic |
Definition at line 1359 of file diracdec.c.
Referenced by decode_block_params().
|
inlinestatic |
Definition at line 1392 of file diracdec.c.
Referenced by decode_block_params(), decode_q_branch(), encode_q_branch(), encode_q_branch2(), get_block_bits(), and mvi_predict().
|
static |
Definition at line 1428 of file diracdec.c.
Referenced by decode_block_params().
|
static |
Definition at line 1444 of file diracdec.c.
Referenced by dirac_unpack_block_motion_data().
|
static |
Copies the current block to the other blocks covered by the current superblock split mode.
Definition at line 1484 of file diracdec.c.
Referenced by dirac_unpack_block_motion_data().
|
static |
Dirac Specification ->
Definition at line 1503 of file diracdec.c.
Referenced by dirac_decode_picture_header().
|
static |
Definition at line 1563 of file diracdec.c.
Referenced by init_obmc_weight(), and init_obmc_weight_row().
|
static |
Definition at line 1575 of file diracdec.c.
Referenced by init_obmc_weight().
|
static |
Definition at line 1589 of file diracdec.c.
Referenced by init_obmc_weights().
|
static |
Definition at line 1608 of file diracdec.c.
Referenced by dirac_decode_frame_internal().
|
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.
Definition at line 1648 of file diracdec.c.
Referenced by block_mc().
|
static |
Definition at line 1743 of file diracdec.c.
Referenced by block_mc().
|
static |
Definition at line 1759 of file diracdec.c.
Referenced by mc_row().
|
static |
Definition at line 1795 of file diracdec.c.
Referenced by dirac_decode_frame_internal().
|
static |
Definition at line 1811 of file diracdec.c.
Referenced by dirac_decode_frame_internal().
|
static |
Definition at line 1831 of file diracdec.c.
Referenced by dirac_decode_frame_internal().
|
static |
Dirac Specification -> 13.0 Transform data syntax.
transform_data()
Definition at line 1872 of file diracdec.c.
Referenced by dirac_decode_data_unit().
|
static |
Definition at line 1969 of file diracdec.c.
Referenced by dirac_decode_data_unit(), and dirac_decode_picture_header().
|
static |
Dirac Specification -> 11.1.1 Picture Header.
Definition at line 1999 of file diracdec.c.
Referenced by dirac_decode_data_unit().
|
static |
Definition at line 2087 of file diracdec.c.
Referenced by dirac_decode_frame().
|
static |
Definition at line 2122 of file diracdec.c.
Referenced by dirac_decode_frame().
|
static |
Definition at line 2267 of file diracdec.c.
|
static |
Definition at line 386 of file diracdec.c.
Referenced by dirac_decode_init().
|
static |
Definition at line 1621 of file diracdec.c.
Referenced by mc_subpel().
const FFCodec ff_dirac_decoder |
Definition at line 2362 of file diracdec.c.