FFmpeg
hevcdec.h
Go to the documentation of this file.
1 /*
2  * HEVC video decoder
3  *
4  * Copyright (C) 2012 - 2013 Guillaume Martres
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef AVCODEC_HEVCDEC_H
24 #define AVCODEC_HEVCDEC_H
25 
26 #include <stdatomic.h>
27 
28 #include "libavutil/buffer.h"
29 #include "libavutil/mem_internal.h"
30 
31 #include "avcodec.h"
32 #include "bswapdsp.h"
33 #include "cabac.h"
34 #include "dovi_rpu.h"
35 #include "get_bits.h"
36 #include "hevcpred.h"
37 #include "h2645_parse.h"
38 #include "hevc.h"
39 #include "hevc_ps.h"
40 #include "hevc_sei.h"
41 #include "hevcdsp.h"
42 #include "h274.h"
43 #include "threadframe.h"
44 #include "videodsp.h"
45 
46 #define SHIFT_CTB_WPP 2
47 
48 #define MAX_TB_SIZE 32
49 #define MAX_QP 51
50 #define DEFAULT_INTRA_TC_OFFSET 2
51 
52 #define HEVC_CONTEXTS 199
53 #define HEVC_STAT_COEFFS 4
54 
55 #define MRG_MAX_NUM_CANDS 5
56 
57 #define L0 0
58 #define L1 1
59 
60 #define EPEL_EXTRA_BEFORE 1
61 #define EPEL_EXTRA_AFTER 2
62 #define EPEL_EXTRA 3
63 #define QPEL_EXTRA_BEFORE 3
64 #define QPEL_EXTRA_AFTER 4
65 #define QPEL_EXTRA 7
66 
67 #define EDGE_EMU_BUFFER_STRIDE 80
68 
69 /**
70  * Value of the luma sample at position (x, y) in the 2D array tab.
71  */
72 #define SAMPLE(tab, x, y) ((tab)[(y) * s->sps->width + (x)])
73 #define SAMPLE_CTB(tab, x, y) ((tab)[(y) * min_cb_width + (x)])
74 
75 #define IS_IDR(s) ((s)->nal_unit_type == HEVC_NAL_IDR_W_RADL || (s)->nal_unit_type == HEVC_NAL_IDR_N_LP)
76 #define IS_BLA(s) ((s)->nal_unit_type == HEVC_NAL_BLA_W_RADL || (s)->nal_unit_type == HEVC_NAL_BLA_W_LP || \
77  (s)->nal_unit_type == HEVC_NAL_BLA_N_LP)
78 #define IS_IRAP(s) ((s)->nal_unit_type >= HEVC_NAL_BLA_W_LP && (s)->nal_unit_type <= HEVC_NAL_RSV_IRAP_VCL23)
79 
80 enum RPSType {
87 };
88 
139 };
140 
141 enum PartMode {
145  PART_NxN = 3,
150 };
151 
152 enum PredMode {
156 };
157 
159  PRED_L0 = 0,
162 };
163 
164 enum PredFlag {
165  PF_INTRA = 0,
169 };
170 
207 };
208 
209 enum SAOType {
214 };
215 
221 };
222 
223 enum ScanType {
227 };
228 
229 typedef struct HEVCCABACState {
233 
234 typedef struct LongTermRPS {
235  int poc[32];
236  uint8_t poc_msb_present[32];
237  uint8_t used[32];
238  uint8_t nb_refs;
239 } LongTermRPS;
240 
241 typedef struct RefPicList {
245  int nb_refs;
246 } RefPicList;
247 
248 typedef struct RefPicListTab {
250 } RefPicListTab;
251 
252 typedef struct SliceHeader {
253  unsigned int pps_id;
254 
255  ///< address (in raster order) of the first block in the current slice segment
256  unsigned int slice_segment_addr;
257  ///< address (in raster order) of the first block in the current slice
258  unsigned int slice_addr;
259 
261 
263 
268 
269  ///< RPS coded in the slice header itself is stored here
276  unsigned int list_entry_lx[2][32];
277 
281 
282  unsigned int nb_refs[2];
283 
286 
288  uint8_t disable_deblocking_filter_flag; ///< slice_header_disable_deblocking_filter_flag
291 
292  unsigned int collocated_ref_idx;
293 
297 
301 
303 
304  int beta_offset; ///< beta_offset_div2 * 2
305  int tc_offset; ///< tc_offset_div2 * 2
306 
307  uint8_t max_num_merge_cand; ///< 5 - 5_minus_max_num_merge_cand
309 
311  int * offset;
312  int * size;
314 
315  int8_t slice_qp;
316 
319 
320  int16_t luma_weight_l0[16];
321  int16_t chroma_weight_l0[16][2];
322  int16_t chroma_weight_l1[16][2];
323  int16_t luma_weight_l1[16];
324 
325  int16_t luma_offset_l0[16];
326  int16_t chroma_offset_l0[16][2];
327 
328  int16_t luma_offset_l1[16];
329  int16_t chroma_offset_l1[16][2];
330 
332 } SliceHeader;
333 
334 typedef struct CodingUnit {
335  int x;
336  int y;
337 
338  enum PredMode pred_mode; ///< PredMode
339  enum PartMode part_mode; ///< PartMode
340 
341  // Inferred parameters
342  uint8_t intra_split_flag; ///< IntraSplitFlag
343  uint8_t max_trafo_depth; ///< MaxTrafoDepth
345 } CodingUnit;
346 
347 typedef struct Mv {
348  int16_t x; ///< horizontal component of motion vector
349  int16_t y; ///< vertical component of motion vector
350 } Mv;
351 
352 typedef struct MvField {
354  int8_t ref_idx[2];
355  int8_t pred_flag;
356 } MvField;
357 
358 typedef struct NeighbourAvailable {
361  int cand_up;
366 
367 typedef struct PredictionUnit {
368  int mpm_idx;
370  uint8_t intra_pred_mode[4];
372  uint8_t merge_flag;
373  uint8_t intra_pred_mode_c[4];
374  uint8_t chroma_mode_c[4];
376 
377 typedef struct TransformUnit {
379 
381 
382  // Inferred parameters;
390  uint8_t cross_pf;
391 } TransformUnit;
392 
393 typedef struct DBParams {
396 } DBParams;
397 
398 #define HEVC_FRAME_FLAG_OUTPUT (1 << 0)
399 #define HEVC_FRAME_FLAG_SHORT_REF (1 << 1)
400 #define HEVC_FRAME_FLAG_LONG_REF (1 << 2)
401 #define HEVC_FRAME_FLAG_BUMPING (1 << 3)
402 
403 #define HEVC_SEQUENCE_COUNTER_MASK 0xff
404 #define HEVC_SEQUENCE_COUNTER_INVALID (HEVC_SEQUENCE_COUNTER_MASK + 1)
405 
406 typedef struct HEVCFrame {
410  int needs_fg; /* 1 if grain needs to be applied by the decoder */
411  MvField *tab_mvf; ///< RefStruct reference
413  RefPicListTab **rpl_tab; ///< RefStruct reference
415  int poc;
416 
417  RefPicListTab *rpl; ///< RefStruct reference
419 
420  void *hwaccel_picture_private; ///< RefStruct reference
421 
422  /**
423  * A sequence counter, so that old frames are output first
424  * after a POC reset
425  */
426  uint16_t sequence;
427 
428  /**
429  * A combination of HEVC_FRAME_FLAG_*
430  */
431  uint8_t flags;
432 } HEVCFrame;
433 
434 typedef struct HEVCLocalContext {
436 
438 
439  uint8_t first_qp_group;
440 
441  void *logctx;
442  const struct HEVCContext *parent;
443 
446 
447  /**
448  * This is a pointer to the common CABAC state.
449  * In case entropy_coding_sync_enabled_flag is set,
450  * the CABAC state after decoding the second CTU in a row is
451  * stored here and used to initialize the CABAC state before
452  * decoding the first CTU in the next row.
453  * This is the basis for WPP and in case slice-threading is used,
454  * the next row is decoded by another thread making this state
455  * shared between threads.
456  */
458 
459  int8_t qp_y;
460  int8_t curr_qp_y;
461 
462  int qPy_pred;
463 
465 
466  uint8_t ctb_left_flag;
467  uint8_t ctb_up_flag;
472  /* +7 is for subpixel interpolation, *2 for high bit depths */
474  /* The extended size between the new edge emu buffer is abused by SAO */
477 
478  int ct_depth;
482 
483 #define BOUNDARY_LEFT_SLICE (1 << 0)
484 #define BOUNDARY_LEFT_TILE (1 << 1)
485 #define BOUNDARY_UPPER_SLICE (1 << 2)
486 #define BOUNDARY_UPPER_TILE (1 << 3)
487  /* properties of the boundary of the current CTB for the purposes
488  * of the deblocking filter */
491 
492 typedef struct HEVCContext {
493  const AVClass *c; // needed by private avoptions
495 
498 
499  uint8_t threads_type;
500  uint8_t threads_number;
501 
502  int width;
503  int height;
504 
505  /** 1 if the independent slice segment header was successfully parsed */
507 
510  uint8_t *sao_pixel_buffer_h[3];
511  uint8_t *sao_pixel_buffer_v[3];
512 
515  struct AVMD5 *md5_ctx;
516 
519 
520  ///< candidate references for the current frame
522 
527  int temporal_id; ///< temporal_id_plus1 - 1
531  int poc;
532  int pocTid0;
533  int slice_idx; ///< number of the slice being currently decoded
534  int eos; ///< current packet contains an EOS/EOB NAL
535  int last_eos; ///< last packet contains an EOS/EOB NAL
536  int max_ra;
537  int bs_width;
539  int overlap;
540 
543 
549  int8_t *qp_y_tab;
550  uint8_t *horizontal_bs;
551  uint8_t *vertical_bs;
552 
554 
555  // CU
556  uint8_t *skip_flag;
557  uint8_t *tab_ct_depth;
558  // PU
559  uint8_t *tab_ipm;
560 
561  uint8_t *cbf_luma; // cbf_luma of colocated TU
562  uint8_t *is_pcm;
563 
564  // CTB-level flags affecting loop filter operation
566 
567  /** used on BE to byteswap the lines for checksumming */
568  uint8_t *checksum_buf;
570 
571  /**
572  * Sequence counters for decoded and output frames, so that old
573  * frames are output first after a POC reset
574  */
575  uint16_t seq_decode;
576  uint16_t seq_output;
577 
578  /** The target for the common_cabac_state of the local contexts. */
580 
583 
584  const uint8_t *data;
585 
587  // type of the first VCL NAL of the current frame
589 
590  int is_nalff; ///< this flag is != 0 if bitstream is encapsulated
591  ///< as a format defined in 14496-15
593 
594  int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4)
596 
598 
599  AVBufferRef *rpu_buf; ///< 0 or 1 Dolby Vision RPUs.
600  DOVIContext dovi_ctx; ///< Dolby Vision decoding context
601 } HEVCContext;
602 
603 /**
604  * Mark all frames in DPB as unused for reference.
605  */
607 
608 /**
609  * Drop all frames currently in DPB.
610  */
612 
614  int x0, int y0);
615 
616 /**
617  * Construct the reference picture sets for the current frame.
618  */
620 
621 /**
622  * Construct the reference picture list(s) for the current slice.
623  */
625 
626 void ff_hevc_save_states(HEVCLocalContext *lc, int ctb_addr_ts);
627 int ff_hevc_cabac_init(HEVCLocalContext *lc, int ctb_addr_ts);
636 int ff_hevc_skip_flag_decode(HEVCLocalContext *lc, int x0, int y0,
637  int x_cb, int y_cb);
640  int x0, int y0);
641 int ff_hevc_part_mode_decode(HEVCLocalContext *lc, int log2_cb_size);
649 int ff_hevc_inter_pred_idc_decode(HEVCLocalContext *lc, int nPbW, int nPbH);
650 int ff_hevc_ref_idx_lx_decode(HEVCLocalContext *lc, int num_ref_idx_lx);
653 int ff_hevc_split_transform_flag_decode(HEVCLocalContext *lc, int log2_trafo_size);
654 int ff_hevc_cbf_cb_cr_decode(HEVCLocalContext *lc, int trafo_depth);
655 int ff_hevc_cbf_luma_decode(HEVCLocalContext *lc, int trafo_depth);
658 
659 /**
660  * Get the number of candidate references for the current frame.
661  */
663 
664 int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc);
665 
667 {
668  switch (type) {
669  case HEVC_NAL_TRAIL_N:
670  case HEVC_NAL_TSA_N:
671  case HEVC_NAL_STSA_N:
672  case HEVC_NAL_RADL_N:
673  case HEVC_NAL_RASL_N:
674  case HEVC_NAL_VCL_N10:
675  case HEVC_NAL_VCL_N12:
676  case HEVC_NAL_VCL_N14:
677  return 1;
678  default: break;
679  }
680  return 0;
681 }
682 
683 /**
684  * Find next frame in output order and put a reference to it in frame.
685  * @return 1 if a frame was output, 0 otherwise
686  */
688 
690 
692 
693 void ff_hevc_set_neighbour_available(HEVCLocalContext *lc, int x0, int y0,
694  int nPbW, int nPbH);
695 void ff_hevc_luma_mv_merge_mode(HEVCLocalContext *lc, int x0, int y0,
696  int nPbW, int nPbH, int log2_cb_size,
697  int part_idx, int merge_idx, MvField *mv);
698 void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0,
699  int nPbW, int nPbH, int log2_cb_size,
700  int part_idx, int merge_idx,
701  MvField *mv, int mvp_lx_flag, int LX);
702 void ff_hevc_hls_filter(HEVCLocalContext *lc, int x, int y, int ctb_size);
703 void ff_hevc_hls_filters(HEVCLocalContext *lc, int x_ctb, int y_ctb, int ctb_size);
704 void ff_hevc_set_qPy(HEVCLocalContext *lc, int xBase, int yBase,
705  int log2_cb_size);
707  int log2_trafo_size);
712 void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0,
713  int log2_trafo_size, enum ScanType scan_idx,
714  int c_idx);
715 
716 void ff_hevc_hls_mvd_coding(HEVCLocalContext *lc, int x0, int y0, int log2_cb_size);
717 
718 extern const uint8_t ff_hevc_qpel_extra_before[4];
719 extern const uint8_t ff_hevc_qpel_extra_after[4];
720 extern const uint8_t ff_hevc_qpel_extra[4];
721 
722 #endif /* AVCODEC_HEVCDEC_H */
HEVCLocalContext::na
NeighbourAvailable na
Definition: hevcdec.h:481
HEVCContext::seq_decode
uint16_t seq_decode
Sequence counters for decoded and output frames, so that old frames are output first after a POC rese...
Definition: hevcdec.h:575
HEVCContext::temporal_id
int temporal_id
temporal_id_plus1 - 1
Definition: hevcdec.h:527
ff_hevc_cabac_init
int ff_hevc_cabac_init(HEVCLocalContext *lc, int ctb_addr_ts)
Definition: hevc_cabac.c:512
HEVC_NAL_RADL_N
@ HEVC_NAL_RADL_N
Definition: hevc.h:35
SliceHeader::beta_offset
int beta_offset
beta_offset_div2 * 2
Definition: hevcdec.h:304
HEVCContext::skip_flag
uint8_t * skip_flag
Definition: hevcdec.h:556
bswapdsp.h
DBParams
Definition: hevcdec.h:393
ff_hevc_get_ref_list
const RefPicList * ff_hevc_get_ref_list(const HEVCContext *s, const HEVCFrame *frame, int x0, int y0)
Definition: hevc_refs.c:56
HEVCContext::filter_slice_edges
uint8_t * filter_slice_edges
Definition: hevcdec.h:565
SAO_TYPE_IDX
@ SAO_TYPE_IDX
Definition: hevcdec.h:91
HEVCLocalContext
Definition: hevcdec.h:434
HEVCFrame::flags
uint8_t flags
A combination of HEVC_FRAME_FLAG_*.
Definition: hevcdec.h:431
SliceHeader::slice_act_cr_qp_offset
int slice_act_cr_qp_offset
Definition: hevcdec.h:300
HEVCFrame::tf
ThreadFrame tf
Definition: hevcdec.h:409
INTRA_ANGULAR_28
@ INTRA_ANGULAR_28
Definition: hevcdec.h:200
SPLIT_CODING_UNIT_FLAG
@ SPLIT_CODING_UNIT_FLAG
Definition: hevcdec.h:97
h2645_parse.h
SliceHeader::chroma_offset_l1
int16_t chroma_offset_l1[16][2]
Definition: hevcdec.h:329
LT_FOLL
@ LT_FOLL
Definition: hevcdec.h:85
HEVCContext::seq_output
uint16_t seq_output
Definition: hevcdec.h:576
SAO_EO_45D
@ SAO_EO_45D
Definition: hevcdec.h:220
cabac.h
HEVCSliceType
HEVCSliceType
Definition: hevc.h:95
HEVCContext::nuh_layer_id
int nuh_layer_id
Definition: hevcdec.h:595
INTRA_ANGULAR_29
@ INTRA_ANGULAR_29
Definition: hevcdec.h:201
MPM_IDX
@ MPM_IDX
Definition: hevcdec.h:105
ff_hevc_bump_frame
void ff_hevc_bump_frame(HEVCContext *s)
Definition: hevc_refs.c:248
PART_NxN
@ PART_NxN
Definition: hevcdec.h:145
mem_internal.h
INTRA_ANGULAR_30
@ INTRA_ANGULAR_30
Definition: hevcdec.h:202
SliceHeader::slice_act_y_qp_offset
int slice_act_y_qp_offset
Definition: hevcdec.h:298
INTRA_ANGULAR_34
@ INTRA_ANGULAR_34
Definition: hevcdec.h:206
INTRA_ANGULAR_27
@ INTRA_ANGULAR_27
Definition: hevcdec.h:199
SAO_APPLIED
@ SAO_APPLIED
Definition: hevcdec.h:213
SAO_BAND
@ SAO_BAND
Definition: hevcdec.h:211
SAO_BAND_POSITION
@ SAO_BAND_POSITION
Definition: hevcdec.h:93
INTRA_ANGULAR_2
@ INTRA_ANGULAR_2
Definition: hevcdec.h:174
HEVCContext::slice_initialized
uint8_t slice_initialized
1 if the independent slice segment header was successfully parsed
Definition: hevcdec.h:506
ff_hevc_res_scale_sign_flag
int ff_hevc_res_scale_sign_flag(HEVCLocalContext *lc, int idx)
Definition: hevc_cabac.c:919
HEVCLocalContext::ctb_up_flag
uint8_t ctb_up_flag
Definition: hevcdec.h:467
CodingUnit
Definition: hevcdec.h:334
HEVCFrame::needs_fg
int needs_fg
Definition: hevcdec.h:410
mv
static const int8_t mv[256][2]
Definition: 4xm.c:80
SliceHeader::num_entry_point_offsets
int num_entry_point_offsets
Definition: hevcdec.h:313
SAO_OFFSET_ABS
@ SAO_OFFSET_ABS
Definition: hevcdec.h:94
HEVC_NAL_STSA_N
@ HEVC_NAL_STSA_N
Definition: hevc.h:33
HEVCFrame::frame_grain
AVFrame * frame_grain
Definition: hevcdec.h:408
PART_2NxnU
@ PART_2NxnU
Definition: hevcdec.h:146
HEVCContext::md5_ctx
struct AVMD5 * md5_ctx
Definition: hevcdec.h:515
HEVCContext::deblock
DBParams * deblock
Definition: hevcdec.h:525
ff_hevc_flush_dpb
void ff_hevc_flush_dpb(HEVCContext *s)
Drop all frames currently in DPB.
Definition: hevc_refs.c:75
ff_hevc_part_mode_decode
int ff_hevc_part_mode_decode(HEVCLocalContext *lc, int log2_cb_size)
Definition: hevc_cabac.c:718
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:340
ff_hevc_hls_filter
void ff_hevc_hls_filter(HEVCLocalContext *lc, int x, int y, int ctb_size)
Definition: hevc_filter.c:851
ff_hevc_sao_type_idx_decode
int ff_hevc_sao_type_idx_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:576
HEVCFrame::tab_mvf
MvField * tab_mvf
RefStruct reference.
Definition: hevcdec.h:411
TransformUnit::cu_qp_delta
int cu_qp_delta
Definition: hevcdec.h:378
ScanType
ScanType
Definition: hevcdec.h:223
ff_hevc_intra_chroma_pred_mode_decode
int ff_hevc_intra_chroma_pred_mode_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:783
HEVC_NAL_TSA_N
@ HEVC_NAL_TSA_N
Definition: hevc.h:31
HEVCFrame::hwaccel_picture_private
void * hwaccel_picture_private
RefStruct reference.
Definition: hevcdec.h:420
NeighbourAvailable::cand_left
int cand_left
Definition: hevcdec.h:360
NeighbourAvailable::cand_up
int cand_up
Definition: hevcdec.h:361
ff_hevc_qpel_extra_before
const uint8_t ff_hevc_qpel_extra_before[4]
INTRA_DC
@ INTRA_DC
Definition: hevcdec.h:173
HEVCContext::collocated_ref
HEVCFrame * collocated_ref
Definition: hevcdec.h:529
HEVCContext::no_rasl_output_flag
int no_rasl_output_flag
Definition: hevcdec.h:542
LAST_SIGNIFICANT_COEFF_X_PREFIX
@ LAST_SIGNIFICANT_COEFF_X_PREFIX
Definition: hevcdec.h:125
NeighbourAvailable::cand_up_right
int cand_up_right
Definition: hevcdec.h:363
Mv::y
int16_t y
vertical component of motion vector
Definition: hevcdec.h:349
CU_CHROMA_QP_OFFSET_FLAG
@ CU_CHROMA_QP_OFFSET_FLAG
Definition: hevcdec.h:137
HEVCContext::checksum_buf_size
int checksum_buf_size
Definition: hevcdec.h:569
SAO_EDGE
@ SAO_EDGE
Definition: hevcdec.h:212
atomic_int
intptr_t atomic_int
Definition: stdatomic.h:55
SliceHeader::slice_temporal_mvp_enabled_flag
uint8_t slice_temporal_mvp_enabled_flag
Definition: hevcdec.h:280
ff_hevc_rem_intra_luma_pred_mode_decode
int ff_hevc_rem_intra_luma_pred_mode_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:773
TransformUnit::is_cu_qp_delta_coded
uint8_t is_cu_qp_delta_coded
Definition: hevcdec.h:386
HEVC_NAL_RASL_N
@ HEVC_NAL_RASL_N
Definition: hevc.h:37
MODE_INTRA
@ MODE_INTRA
Definition: hevcdec.h:154
HEVCContext::output_frame
AVFrame * output_frame
Definition: hevcdec.h:509
HEVCContext::sao_pixel_buffer_h
uint8_t * sao_pixel_buffer_h[3]
Definition: hevcdec.h:510
HEVCContext::data
const uint8_t * data
Definition: hevcdec.h:584
SliceHeader::slice_loop_filter_across_slices_enabled_flag
uint8_t slice_loop_filter_across_slices_enabled_flag
Definition: hevcdec.h:289
ff_hevc_sao_eo_class_decode
int ff_hevc_sao_eo_class_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:611
HEVCLocalContext::ctb_up_left_flag
uint8_t ctb_up_left_flag
Definition: hevcdec.h:469
HEVCContext::bdsp
BswapDSPContext bdsp
Definition: hevcdec.h:547
ff_hevc_cu_qp_delta_abs
int ff_hevc_cu_qp_delta_abs(HEVCLocalContext *lc)
Definition: hevc_cabac.c:644
DPB
Decoded Picture Buffer (DPB).
Definition: vaapi_h264.c:82
INTER_PRED_IDC
@ INTER_PRED_IDC
Definition: hevcdec.h:110
ff_hevc_ref_idx_lx_decode
int ff_hevc_ref_idx_lx_decode(HEVCLocalContext *lc, int num_ref_idx_lx)
Definition: hevc_cabac.c:820
HEVCContext::checksum_buf
uint8_t * checksum_buf
used on BE to byteswap the lines for checksumming
Definition: hevcdec.h:568
INTRA_ANGULAR_9
@ INTRA_ANGULAR_9
Definition: hevcdec.h:181
RefPicList
Definition: hevcdec.h:241
CBF_CB_CR
@ CBF_CB_CR
Definition: hevcdec.h:121
ff_hevc_output_frame
int ff_hevc_output_frame(HEVCContext *s, AVFrame *frame, int flush)
Find next frame in output order and put a reference to it in frame.
Definition: hevc_refs.c:180
PF_INTRA
@ PF_INTRA
Definition: hevcdec.h:165
INTRA_ANGULAR_10
@ INTRA_ANGULAR_10
Definition: hevcdec.h:182
COEFF_ABS_LEVEL_GREATER2_FLAG
@ COEFF_ABS_LEVEL_GREATER2_FLAG
Definition: hevcdec.h:132
ff_hevc_cbf_luma_decode
int ff_hevc_cbf_luma_decode(HEVCLocalContext *lc, int trafo_depth)
Definition: hevc_cabac.c:889
MODE_SKIP
@ MODE_SKIP
Definition: hevcdec.h:155
HEVCLocalContext::end_of_tiles_x
int end_of_tiles_x
Definition: hevcdec.h:470
CodingUnit::x
int x
Definition: hevcdec.h:335
CBF_LUMA
@ CBF_LUMA
Definition: hevcdec.h:120
SAOType
SAOType
Definition: hevcdec.h:209
PART_2Nx2N
@ PART_2Nx2N
Definition: hevcdec.h:142
ff_hevc_cbf_cb_cr_decode
int ff_hevc_cbf_cb_cr_decode(HEVCLocalContext *lc, int trafo_depth)
Definition: hevc_cabac.c:884
HEVCLocalContext::ctb_up_right_flag
uint8_t ctb_up_right_flag
Definition: hevcdec.h:468
HEVCLocalContext::common_cabac_state
HEVCCABACState * common_cabac_state
This is a pointer to the common CABAC state.
Definition: hevcdec.h:457
SAO_EO_135D
@ SAO_EO_135D
Definition: hevcdec.h:219
PRED_BI
@ PRED_BI
Definition: hevcdec.h:161
HEVCContext::frame
AVFrame * frame
Definition: hevcdec.h:508
ff_hevc_cu_qp_delta_sign_flag
int ff_hevc_cu_qp_delta_sign_flag(HEVCLocalContext *lc)
Definition: hevc_cabac.c:671
MVP_LX_FLAG
@ MVP_LX_FLAG
Definition: hevcdec.h:117
DOVIContext
Definition: dovi_rpu.h:31
ff_hevc_end_of_slice_flag_decode
int ff_hevc_end_of_slice_flag_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:618
INTRA_ANGULAR_3
@ INTRA_ANGULAR_3
Definition: hevcdec.h:175
PredictionUnit::intra_pred_mode_c
uint8_t intra_pred_mode_c[4]
Definition: hevcdec.h:373
PredictionUnit
Definition: hevcdec.h:367
COEFF_ABS_LEVEL_REMAINING
@ COEFF_ABS_LEVEL_REMAINING
Definition: hevcdec.h:133
HEVCContext::tab_mvf_pool
struct FFRefStructPool * tab_mvf_pool
Definition: hevcdec.h:517
InterPredIdc
InterPredIdc
Definition: hevcdec.h:158
MODE_INTER
@ MODE_INTER
Definition: hevcdec.h:153
GetBitContext
Definition: get_bits.h:108
SliceHeader::luma_log2_weight_denom
uint8_t luma_log2_weight_denom
Definition: hevcdec.h:317
HEVCLocalContext::pu
PredictionUnit pu
Definition: hevcdec.h:480
HEVCContext::is_decoded
int is_decoded
Definition: hevcdec.h:541
TransformUnit::res_scale_val
int res_scale_val
Definition: hevcdec.h:380
SliceHeader::short_term_ref_pic_set_size
int short_term_ref_pic_set_size
Definition: hevcdec.h:271
LOG2_RES_SCALE_ABS
@ LOG2_RES_SCALE_ABS
Definition: hevcdec.h:135
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
dovi_rpu.h
SliceHeader::long_term_ref_pic_set_size
int long_term_ref_pic_set_size
Definition: hevcdec.h:274
RefPicList::nb_refs
int nb_refs
Definition: hevcdec.h:245
HEVCContext::h274db
H274FilmGrainDatabase h274db
Definition: hevcdec.h:548
MERGE_IDX
@ MERGE_IDX
Definition: hevcdec.h:109
HEVCContext::bs_width
int bs_width
Definition: hevcdec.h:537
AVMD5
Definition: md5.c:42
ff_hevc_cu_chroma_qp_offset_idx
int ff_hevc_cu_chroma_qp_offset_idx(HEVCLocalContext *lc)
Definition: hevc_cabac.c:681
SliceHeader::slice_segment_addr
unsigned int slice_segment_addr
address (in raster order) of the first block in the current slice
Definition: hevcdec.h:256
HEVCContext::apply_defdispwin
int apply_defdispwin
Definition: hevcdec.h:592
SKIP_FLAG
@ SKIP_FLAG
Definition: hevcdec.h:99
ff_hevc_luma_mv_mvp_mode
void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv, int mvp_lx_flag, int LX)
Definition: hevc_mvs.c:583
TransformUnit::intra_pred_mode
int intra_pred_mode
Definition: hevcdec.h:383
hevcpred.h
SliceHeader::cabac_init_flag
uint8_t cabac_init_flag
Definition: hevcdec.h:287
DBParams::beta_offset
int beta_offset
Definition: hevcdec.h:394
HEVCLocalContext::curr_qp_y
int8_t curr_qp_y
Definition: hevcdec.h:460
DBParams::tc_offset
int tc_offset
Definition: hevcdec.h:395
INTRA_ANGULAR_23
@ INTRA_ANGULAR_23
Definition: hevcdec.h:195
HEVCContext::tab_ipm
uint8_t * tab_ipm
Definition: hevcdec.h:559
MVD_SIGN_FLAG
@ MVD_SIGN_FLAG
Definition: hevcdec.h:116
HEVCContext::max_ra
int max_ra
Definition: hevcdec.h:536
HEVC_MAX_REFS
@ HEVC_MAX_REFS
Definition: hevc.h:119
HEVCLocalContext::parent
const struct HEVCContext * parent
Definition: hevcdec.h:442
s
#define s(width, name)
Definition: cbs_vp9.c:198
MERGE_FLAG
@ MERGE_FLAG
Definition: hevcdec.h:108
NeighbourAvailable::cand_bottom_left
int cand_bottom_left
Definition: hevcdec.h:359
ff_hevc_save_states
void ff_hevc_save_states(HEVCLocalContext *lc, int ctb_addr_ts)
Definition: hevc_cabac.c:450
HEVCContext::c
const AVClass * c
Definition: hevcdec.h:493
HEVCContext::rps
RefPicList rps[5]
Definition: hevcdec.h:521
SAO_NOT_APPLIED
@ SAO_NOT_APPLIED
Definition: hevcdec.h:210
HEVCContext::last_eos
int last_eos
last packet contains an EOS/EOB NAL
Definition: hevcdec.h:535
PREV_INTRA_LUMA_PRED_FLAG
@ PREV_INTRA_LUMA_PRED_FLAG
Definition: hevcdec.h:104
HEVC_NAL_VCL_N14
@ HEVC_NAL_VCL_N14
Definition: hevc.h:43
SliceHeader::luma_offset_l1
int16_t luma_offset_l1[16]
Definition: hevcdec.h:328
INTRA_ANGULAR_14
@ INTRA_ANGULAR_14
Definition: hevcdec.h:186
HEVC_NAL_VCL_N12
@ HEVC_NAL_VCL_N12
Definition: hevc.h:41
HEVCContext::slice_idx
int slice_idx
number of the slice being currently decoded
Definition: hevcdec.h:533
ff_hevc_nal_is_nonref
static av_always_inline int ff_hevc_nal_is_nonref(enum HEVCNALUnitType type)
Definition: hevcdec.h:666
ff_hevc_set_new_ref
int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc)
Definition: hevc_refs.c:130
HEVCSEI
Definition: hevc_sei.h:81
ff_hevc_frame_rps
int ff_hevc_frame_rps(HEVCContext *s)
Construct the reference picture sets for the current frame.
Definition: hevc_refs.c:473
INTRA_ANGULAR_12
@ INTRA_ANGULAR_12
Definition: hevcdec.h:184
SliceHeader::slice_rps
ShortTermRPS slice_rps
Definition: hevcdec.h:272
ff_hevc_qpel_extra
const uint8_t ff_hevc_qpel_extra[4]
HEVCPredContext
Definition: hevcpred.h:31
HEVCFrame::rpl
RefPicListTab * rpl
RefStruct reference.
Definition: hevcdec.h:417
RPSType
RPSType
Definition: hevcdec.h:80
get_bits.h
ff_hevc_deblocking_boundary_strengths
void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, int log2_trafo_size)
Definition: hevc_filter.c:723
INTRA_ANGULAR_18
@ INTRA_ANGULAR_18
Definition: hevcdec.h:190
RefPicList::ref
struct HEVCFrame * ref[HEVC_MAX_REFS]
Definition: hevcdec.h:242
ABS_MVD_MINUS2
@ ABS_MVD_MINUS2
Definition: hevcdec.h:115
HEVCContext::height
int height
Definition: hevcdec.h:503
ff_hevc_hls_residual_coding
void ff_hevc_hls_residual_coding(HEVCLocalContext *lc, int x0, int y0, int log2_trafo_size, enum ScanType scan_idx, int c_idx)
Definition: hevc_cabac.c:1039
SliceHeader::size
int * size
Definition: hevcdec.h:312
FFRefStructPool
FFRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
Definition: refstruct.c:183
SliceHeader::collocated_list
uint8_t collocated_list
Definition: hevcdec.h:290
HEVCContext::ref
HEVCFrame * ref
Definition: hevcdec.h:528
SliceHeader::luma_offset_l0
int16_t luma_offset_l0[16]
Definition: hevcdec.h:325
NeighbourAvailable::cand_up_right_sap
int cand_up_right_sap
Definition: hevcdec.h:364
INTRA_ANGULAR_26
@ INTRA_ANGULAR_26
Definition: hevcdec.h:198
SliceHeader::chroma_weight_l1
int16_t chroma_weight_l1[16][2]
Definition: hevcdec.h:322
CodingUnit::max_trafo_depth
uint8_t max_trafo_depth
MaxTrafoDepth.
Definition: hevcdec.h:343
SliceHeader::slice_ctb_addr_rs
int slice_ctb_addr_rs
Definition: hevcdec.h:331
frame
static AVFrame * frame
Definition: demux_decode.c:54
HEVC_NAL_VCL_N10
@ HEVC_NAL_VCL_N10
Definition: hevc.h:39
HEVCContext::nal_unit_type
enum HEVCNALUnitType nal_unit_type
Definition: hevcdec.h:526
SliceHeader::pic_output_flag
uint8_t pic_output_flag
Definition: hevcdec.h:266
PART_MODE
@ PART_MODE
Definition: hevcdec.h:102
hevcdsp.h
threadframe.h
HEVCFrame::refPicList
RefPicList * refPicList
Definition: hevcdec.h:412
PredictionUnit::rem_intra_luma_pred_mode
int rem_intra_luma_pred_mode
Definition: hevcdec.h:369
INTRA_ANGULAR_11
@ INTRA_ANGULAR_11
Definition: hevcdec.h:183
HEVCContext::sei
HEVCSEI sei
Definition: hevcdec.h:514
PRED_MODE_FLAG
@ PRED_MODE_FLAG
Definition: hevcdec.h:101
HEVCContext::enable_parallel_tiles
int enable_parallel_tiles
Definition: hevcdec.h:581
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
INTRA_ANGULAR_15
@ INTRA_ANGULAR_15
Definition: hevcdec.h:187
HEVCCABACState::state
uint8_t state[HEVC_CONTEXTS]
Definition: hevcdec.h:230
HEVCContext::width
int width
Definition: hevcdec.h:502
INTRA_ANGULAR_22
@ INTRA_ANGULAR_22
Definition: hevcdec.h:194
HEVCLocalContext::tmp
int16_t tmp[MAX_PB_SIZE *MAX_PB_SIZE]
Definition: hevcdec.h:476
ff_hevc_merge_flag_decode
int ff_hevc_merge_flag_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:805
LongTermRPS::poc
int poc[32]
Definition: hevcdec.h:235
EXPLICIT_RDPCM_FLAG
@ EXPLICIT_RDPCM_FLAG
Definition: hevcdec.h:123
HEVCContext::qp_y_tab
int8_t * qp_y_tab
Definition: hevcdec.h:549
CodingUnit::cu_transquant_bypass_flag
uint8_t cu_transquant_bypass_flag
Definition: hevcdec.h:344
COEFF_ABS_LEVEL_GREATER1_FLAG
@ COEFF_ABS_LEVEL_GREATER1_FLAG
Definition: hevcdec.h:131
HEVCLocalContext::first_qp_group
uint8_t first_qp_group
Definition: hevcdec.h:439
HEVCContext::cbf_luma
uint8_t * cbf_luma
Definition: hevcdec.h:561
HEVCFrame::rpl_tab
RefPicListTab ** rpl_tab
RefStruct reference.
Definition: hevcdec.h:413
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts.c:367
HEVCContext::threads_type
uint8_t threads_type
Definition: hevcdec.h:499
LongTermRPS::poc_msb_present
uint8_t poc_msb_present[32]
Definition: hevcdec.h:236
ff_hevc_split_transform_flag_decode
int ff_hevc_split_transform_flag_decode(HEVCLocalContext *lc, int log2_trafo_size)
Definition: hevc_cabac.c:879
HEVCContext::film_grain_warning_shown
int film_grain_warning_shown
Definition: hevcdec.h:597
PART_Nx2N
@ PART_Nx2N
Definition: hevcdec.h:144
RefPicListTab
Definition: hevcdec.h:248
h274.h
HEVCContext::is_nalff
int is_nalff
this flag is != 0 if bitstream is encapsulated as a format defined in 14496-15
Definition: hevcdec.h:590
SliceHeader::nb_refs
unsigned int nb_refs[2]
Definition: hevcdec.h:282
Mv::x
int16_t x
horizontal component of motion vector
Definition: hevcdec.h:348
INTRA_ANGULAR_5
@ INTRA_ANGULAR_5
Definition: hevcdec.h:177
PF_BI
@ PF_BI
Definition: hevcdec.h:168
HEVCContext::poc
int poc
Definition: hevcdec.h:531
INTRA_ANGULAR_16
@ INTRA_ANGULAR_16
Definition: hevcdec.h:188
SCAN_HORIZ
@ SCAN_HORIZ
Definition: hevcdec.h:225
TransformUnit
Definition: hevcdec.h:377
HEVCLocalContext::edge_emu_buffer
uint8_t edge_emu_buffer[(MAX_PB_SIZE+7) *EDGE_EMU_BUFFER_STRIDE *2]
Definition: hevcdec.h:473
ff_hevc_sao_offset_abs_decode
int ff_hevc_sao_offset_abs_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:596
LongTermRPS::used
uint8_t used[32]
Definition: hevcdec.h:237
SliceHeader::colour_plane_id
uint8_t colour_plane_id
RPS coded in the slice header itself is stored here.
Definition: hevcdec.h:267
PART_nLx2N
@ PART_nLx2N
Definition: hevcdec.h:148
HEVCContext::nal_length_size
int nal_length_size
Number of bytes used for nal length (1, 2 or 4)
Definition: hevcdec.h:594
SliceHeader::dependent_slice_segment_flag
uint8_t dependent_slice_segment_flag
Definition: hevcdec.h:265
NO_RESIDUAL_DATA_FLAG
@ NO_RESIDUAL_DATA_FLAG
Definition: hevcdec.h:118
ff_hevc_luma_mv_merge_mode
void ff_hevc_luma_mv_merge_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv)
Definition: hevc_mvs.c:480
SliceHeader::slice_act_cb_qp_offset
int slice_act_cb_qp_offset
Definition: hevcdec.h:299
ST_FOLL
@ ST_FOLL
Definition: hevcdec.h:83
HEVCContext::bs_height
int bs_height
Definition: hevcdec.h:538
SliceHeader::first_slice_in_pic_flag
uint8_t first_slice_in_pic_flag
Definition: hevcdec.h:264
HEVCLocalContext::ctb_left_flag
uint8_t ctb_left_flag
Definition: hevcdec.h:466
H274FilmGrainDatabase
Definition: h274.h:34
ff_hevc_cu_transquant_bypass_flag_decode
int ff_hevc_cu_transquant_bypass_flag_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:623
HEVCContext::sao
SAOParams * sao
Definition: hevcdec.h:524
DECLARE_ALIGNED
#define DECLARE_ALIGNED(n, t, v)
Definition: mem_internal.h:87
RefPicList::isLongTerm
int isLongTerm[HEVC_MAX_REFS]
Definition: hevcdec.h:244
ff_hevc_skip_flag_decode
int ff_hevc_skip_flag_decode(HEVCLocalContext *lc, int x0, int y0, int x_cb, int y_cb)
Definition: hevc_cabac.c:628
INTRA_ANGULAR_17
@ INTRA_ANGULAR_17
Definition: hevcdec.h:189
SIGNIFICANT_COEFF_FLAG
@ SIGNIFICANT_COEFF_FLAG
Definition: hevcdec.h:130
SPLIT_TRANSFORM_FLAG
@ SPLIT_TRANSFORM_FLAG
Definition: hevcdec.h:119
ff_hevc_unref_frame
void ff_hevc_unref_frame(HEVCFrame *frame, int flags)
Definition: hevc_refs.c:33
ff_hevc_mpm_idx_decode
int ff_hevc_mpm_idx_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:765
INTRA_PLANAR
@ INTRA_PLANAR
Definition: hevcdec.h:172
HEVCLocalContext::cabac_state
uint8_t cabac_state[HEVC_CONTEXTS]
Definition: hevcdec.h:435
PART_2NxnD
@ PART_2NxnD
Definition: hevcdec.h:147
HEVCContext::tab_slice_address
int32_t * tab_slice_address
Definition: hevcdec.h:553
PartMode
PartMode
Definition: hevcdec.h:141
SCAN_VERT
@ SCAN_VERT
Definition: hevcdec.h:226
SyntaxElement
SyntaxElement
Definition: hevcdec.h:89
SliceHeader::collocated_ref_idx
unsigned int collocated_ref_idx
Definition: hevcdec.h:292
SliceHeader::entry_point_offset
unsigned * entry_point_offset
Definition: hevcdec.h:310
TransformUnit::chroma_mode_c
int chroma_mode_c
Definition: hevcdec.h:385
SliceHeader::short_term_ref_pic_set_sps_flag
int short_term_ref_pic_set_sps_flag
Definition: hevcdec.h:270
SliceHeader::no_output_of_prior_pics_flag
uint8_t no_output_of_prior_pics_flag
Definition: hevcdec.h:279
CU_QP_DELTA
@ CU_QP_DELTA
Definition: hevcdec.h:100
HEVCContext::pocTid0
int pocTid0
Definition: hevcdec.h:532
MvField
Definition: hevcdec.h:352
buffer.h
PF_L1
@ PF_L1
Definition: hevcdec.h:167
ABS_MVD_GREATER0_FLAG
@ ABS_MVD_GREATER0_FLAG
Definition: hevcdec.h:113
HEVCContext::tab_ct_depth
uint8_t * tab_ct_depth
Definition: hevcdec.h:557
HEVC_STAT_COEFFS
#define HEVC_STAT_COEFFS
Definition: hevcdec.h:53
HEVCDSPContext
Definition: hevcdsp.h:47
HEVCContext::dovi_ctx
DOVIContext dovi_ctx
Dolby Vision decoding context.
Definition: hevcdec.h:600
END_OF_SLICE_FLAG
@ END_OF_SLICE_FLAG
Definition: hevcdec.h:96
SliceHeader::chroma_weight_l0
int16_t chroma_weight_l0[16][2]
Definition: hevcdec.h:321
ff_hevc_no_residual_syntax_flag_decode
int ff_hevc_no_residual_syntax_flag_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:841
HEVCContext::horizontal_bs
uint8_t * horizontal_bs
Definition: hevcdec.h:550
SIGNIFICANT_COEFF_GROUP_FLAG
@ SIGNIFICANT_COEFF_GROUP_FLAG
Definition: hevcdec.h:129
HEVCContext::ps
HEVCParamSets ps
Definition: hevcdec.h:513
SAO_EO_CLASS
@ SAO_EO_CLASS
Definition: hevcdec.h:92
TransformUnit::cu_qp_offset_cb
int8_t cu_qp_offset_cb
Definition: hevcdec.h:388
SliceHeader::chroma_log2_weight_denom
int16_t chroma_log2_weight_denom
Definition: hevcdec.h:318
TRANSFORM_SKIP_FLAG
@ TRANSFORM_SKIP_FLAG
Definition: hevcdec.h:122
CU_TRANSQUANT_BYPASS_FLAG
@ CU_TRANSQUANT_BYPASS_FLAG
Definition: hevcdec.h:98
MvField::pred_flag
int8_t pred_flag
Definition: hevcdec.h:355
HEVCLocalContext::ct_depth
int ct_depth
Definition: hevcdec.h:478
INTRA_ANGULAR_7
@ INTRA_ANGULAR_7
Definition: hevcdec.h:179
LAST_SIGNIFICANT_COEFF_Y_SUFFIX
@ LAST_SIGNIFICANT_COEFF_Y_SUFFIX
Definition: hevcdec.h:128
COEFF_SIGN_FLAG
@ COEFF_SIGN_FLAG
Definition: hevcdec.h:134
PART_nRx2N
@ PART_nRx2N
Definition: hevcdec.h:149
SliceHeader::slice_cb_qp_offset
int slice_cb_qp_offset
Definition: hevcdec.h:295
SliceHeader
Definition: hevcdec.h:252
HEVCFrame::frame
AVFrame * frame
Definition: hevcdec.h:407
INTRA_ANGULAR_8
@ INTRA_ANGULAR_8
Definition: hevcdec.h:180
ff_hevc_inter_pred_idc_decode
int ff_hevc_inter_pred_idc_decode(HEVCLocalContext *lc, int nPbW, int nPbH)
Definition: hevc_cabac.c:810
HEVCContext::cabac
HEVCCABACState cabac
The target for the common_cabac_state of the local contexts.
Definition: hevcdec.h:579
HEVCContext::avctx
AVCodecContext * avctx
Definition: hevcdec.h:494
SliceHeader::slice_sample_adaptive_offset_flag
uint8_t slice_sample_adaptive_offset_flag[3]
Definition: hevcdec.h:284
hevc_ps.h
INTRA_ANGULAR_32
@ INTRA_ANGULAR_32
Definition: hevcdec.h:204
INTRA_ANGULAR_21
@ INTRA_ANGULAR_21
Definition: hevcdec.h:193
HEVCFrame
Definition: hevcdec.h:406
NeighbourAvailable::cand_up_left
int cand_up_left
Definition: hevcdec.h:362
INTRA_ANGULAR_6
@ INTRA_ANGULAR_6
Definition: hevcdec.h:178
ff_hevc_sao_merge_flag_decode
int ff_hevc_sao_merge_flag_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:571
ff_hevc_hls_filters
void ff_hevc_hls_filters(HEVCLocalContext *lc, int x_ctb, int y_ctb, int ctb_size)
Definition: hevc_filter.c:888
HEVCLocalContext::gb
GetBitContext gb
Definition: hevcdec.h:444
PCM_FLAG
@ PCM_FLAG
Definition: hevcdec.h:103
REM_INTRA_LUMA_PRED_MODE
@ REM_INTRA_LUMA_PRED_MODE
Definition: hevcdec.h:106
HEVCFrame::nb_rpl_elems
int nb_rpl_elems
Definition: hevcdec.h:418
MAX_PB_SIZE
#define MAX_PB_SIZE
Definition: hevcdsp.h:32
HEVCLocalContext::logctx
void * logctx
Definition: hevcdec.h:441
HEVCFrame::ctb_count
int ctb_count
Definition: hevcdec.h:414
SliceHeader::offset
int * offset
Definition: hevcdec.h:311
HEVCFrame::sequence
uint16_t sequence
A sequence counter, so that old frames are output first after a POC reset.
Definition: hevcdec.h:426
HEVCContext::pkt
H2645Packet pkt
Definition: hevcdec.h:586
SliceHeader::mvd_l1_zero_flag
uint8_t mvd_l1_zero_flag
Definition: hevcdec.h:285
av_always_inline
#define av_always_inline
Definition: attributes.h:49
PF_L0
@ PF_L0
Definition: hevcdec.h:166
REF_IDX_L0
@ REF_IDX_L0
Definition: hevcdec.h:111
EDGE_EMU_BUFFER_STRIDE
#define EDGE_EMU_BUFFER_STRIDE
Definition: hevcdec.h:67
INTRA_ANGULAR_19
@ INTRA_ANGULAR_19
Definition: hevcdec.h:191
ff_hevc_pred_mode_decode
int ff_hevc_pred_mode_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:692
HEVCLocalContext::qp_y
int8_t qp_y
Definition: hevcdec.h:459
ff_hevc_qpel_extra_after
const uint8_t ff_hevc_qpel_extra_after[4]
HEVCNALUnitType
HEVCNALUnitType
Table 7-1 – NAL unit type codes and NAL unit type classes in T-REC-H.265-201802.
Definition: hevc.h:28
SAO_EO_HORIZ
@ SAO_EO_HORIZ
Definition: hevcdec.h:217
SliceHeader::chroma_offset_l0
int16_t chroma_offset_l0[16][2]
Definition: hevcdec.h:326
SliceHeader::list_entry_lx
unsigned int list_entry_lx[2][32]
Definition: hevcdec.h:276
HEVCLocalContext::stat_coeff
uint8_t stat_coeff[HEVC_STAT_COEFFS]
Definition: hevcdec.h:437
HEVCFrame::poc
int poc
Definition: hevcdec.h:415
HEVCContext::HEVClcList
HEVCLocalContext ** HEVClcList
Definition: hevcdec.h:496
SAOEOClass
SAOEOClass
Definition: hevcdec.h:216
hevc.h
SAOParams
Definition: hevcdsp.h:34
SliceHeader::short_term_rps
const ShortTermRPS * short_term_rps
Definition: hevcdec.h:273
avcodec.h
SliceHeader::cu_chroma_qp_offset_enabled_flag
uint8_t cu_chroma_qp_offset_enabled_flag
Definition: hevcdec.h:302
HEVCContext::first_nal_type
enum HEVCNALUnitType first_nal_type
Definition: hevcdec.h:588
HEVCContext::overlap
int overlap
Definition: hevcdec.h:539
NeighbourAvailable
Definition: hevcdec.h:358
PRED_L1
@ PRED_L1
Definition: hevcdec.h:160
PredictionUnit::mvd
Mv mvd
Definition: hevcdec.h:371
IntraPredMode
IntraPredMode
Definition: hevcdec.h:171
ST_CURR_BEF
@ ST_CURR_BEF
Definition: hevcdec.h:81
SliceHeader::disable_deblocking_filter_flag
uint8_t disable_deblocking_filter_flag
slice_header_disable_deblocking_filter_flag
Definition: hevcdec.h:288
RES_SCALE_SIGN_FLAG
@ RES_SCALE_SIGN_FLAG
Definition: hevcdec.h:136
HEVCLocalContext::edge_emu_buffer2
uint8_t edge_emu_buffer2[(MAX_PB_SIZE+7) *EDGE_EMU_BUFFER_STRIDE *2]
Definition: hevcdec.h:475
HEVCContext::HEVClc
HEVCLocalContext * HEVClc
Definition: hevcdec.h:497
SliceHeader::max_num_merge_cand
uint8_t max_num_merge_cand
5 - 5_minus_max_num_merge_cand
Definition: hevcdec.h:307
SliceHeader::luma_weight_l0
int16_t luma_weight_l0[16]
Definition: hevcdec.h:320
ff_hevc_merge_idx_decode
int ff_hevc_merge_idx_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:794
HEVCLocalContext::boundary_flags
int boundary_flags
Definition: hevcdec.h:489
HEVC_NAL_TRAIL_N
@ HEVC_NAL_TRAIL_N
Definition: hevc.h:29
LongTermRPS
Definition: hevcdec.h:234
SliceHeader::slice_type
enum HEVCSliceType slice_type
Definition: hevcdec.h:260
LT_CURR
@ LT_CURR
Definition: hevcdec.h:84
AVCodecContext
main external API structure.
Definition: avcodec.h:445
HEVCContext::threads_number
uint8_t threads_number
Definition: hevcdec.h:500
INTRA_ANGULAR_25
@ INTRA_ANGULAR_25
Definition: hevcdec.h:197
ff_hevc_hls_mvd_coding
void ff_hevc_hls_mvd_coding(HEVCLocalContext *lc, int x0, int y0, int log2_cb_size)
Definition: hevc_cabac.c:1549
SliceHeader::slice_qp
int8_t slice_qp
Definition: hevcdec.h:315
ThreadFrame
Definition: threadframe.h:27
PredMode
PredMode
Definition: hevcdec.h:152
PredictionUnit::merge_flag
uint8_t merge_flag
Definition: hevcdec.h:372
NB_RPS_TYPE
@ NB_RPS_TYPE
Definition: hevcdec.h:86
SliceHeader::slice_cr_qp_offset
int slice_cr_qp_offset
Definition: hevcdec.h:296
HEVCContext
Definition: hevcdec.h:492
ff_hevc_prev_intra_luma_pred_flag_decode
int ff_hevc_prev_intra_luma_pred_flag_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:760
CodingUnit::pred_mode
enum PredMode pred_mode
PredMode.
Definition: hevcdec.h:338
HEVCContext::rpl_tab_pool
struct FFRefStructPool * rpl_tab_pool
candidate references for the current frame
Definition: hevcdec.h:518
SliceHeader::pic_order_cnt_lsb
int pic_order_cnt_lsb
Definition: hevcdec.h:262
REF_IDX_L1
@ REF_IDX_L1
Definition: hevcdec.h:112
HEVCContext::rpu_buf
AVBufferRef * rpu_buf
0 or 1 Dolby Vision RPUs.
Definition: hevcdec.h:599
HEVCLocalContext::qPy_pred
int qPy_pred
Definition: hevcdec.h:462
SCAN_DIAG
@ SCAN_DIAG
Definition: hevcdec.h:224
SliceHeader::rpl_modification_flag
uint8_t rpl_modification_flag[2]
Definition: hevcdec.h:278
ShortTermRPS
Definition: hevc_ps.h:71
SAO_EO_VERT
@ SAO_EO_VERT
Definition: hevcdec.h:218
ff_hevc_split_coding_unit_flag_decode
int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, int ct_depth, int x0, int y0)
Definition: hevc_cabac.c:697
ff_hevc_sao_offset_sign_decode
int ff_hevc_sao_offset_sign_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:606
RefPicList::list
int list[HEVC_MAX_REFS]
Definition: hevcdec.h:243
ABS_MVD_GREATER1_FLAG
@ ABS_MVD_GREATER1_FLAG
Definition: hevcdec.h:114
HEVCLocalContext::tu
TransformUnit tu
Definition: hevcdec.h:464
ff_hevc_log2_res_scale_abs
int ff_hevc_log2_res_scale_abs(HEVCLocalContext *lc, int idx)
Definition: hevc_cabac.c:909
VideoDSPContext
Definition: videodsp.h:40
CodingUnit::y
int y
Definition: hevcdec.h:336
HEVCContext::vdsp
VideoDSPContext vdsp
Definition: hevcdec.h:546
MvField::mv
Mv mv[2]
mvL0, vvL1
Definition: hevcdec.h:353
INTRA_ANGULAR_24
@ INTRA_ANGULAR_24
Definition: hevcdec.h:196
Mv
Definition: hevcdec.h:347
SAO_OFFSET_SIGN
@ SAO_OFFSET_SIGN
Definition: hevcdec.h:95
MvField::ref_idx
int8_t ref_idx[2]
refIdxL0, refIdxL1
Definition: hevcdec.h:354
PRED_L0
@ PRED_L0
Definition: hevcdec.h:159
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
HEVCCABACState::stat_coeff
uint8_t stat_coeff[HEVC_STAT_COEFFS]
Definition: hevcdec.h:231
INTRA_ANGULAR_31
@ INTRA_ANGULAR_31
Definition: hevcdec.h:203
ff_hevc_slice_rpl
int ff_hevc_slice_rpl(HEVCContext *s)
Construct the reference picture list(s) for the current slice.
Definition: hevc_refs.c:306
HEVCContext::eos
int eos
current packet contains an EOS/EOB NAL
Definition: hevcdec.h:534
ff_hevc_set_qPy
void ff_hevc_set_qPy(HEVCLocalContext *lc, int xBase, int yBase, int log2_cb_size)
Definition: hevc_filter.c:119
HEVCContext::vertical_bs
uint8_t * vertical_bs
Definition: hevcdec.h:551
ff_hevc_sao_band_position_decode
int ff_hevc_sao_band_position_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:586
ST_CURR_AFT
@ ST_CURR_AFT
Definition: hevcdec.h:82
CodingUnit::part_mode
enum PartMode part_mode
PartMode.
Definition: hevcdec.h:339
INTRA_ANGULAR_4
@ INTRA_ANGULAR_4
Definition: hevcdec.h:176
SliceHeader::tc_offset
int tc_offset
tc_offset_div2 * 2
Definition: hevcdec.h:305
LongTermRPS::nb_refs
uint8_t nb_refs
Definition: hevcdec.h:238
PredFlag
PredFlag
Definition: hevcdec.h:164
TransformUnit::cross_pf
uint8_t cross_pf
Definition: hevcdec.h:390
HEVCLocalContext::cu
CodingUnit cu
Definition: hevcdec.h:479
HEVCContext::sao_pixel_buffer_v
uint8_t * sao_pixel_buffer_v[3]
Definition: hevcdec.h:511
SliceHeader::pps_id
unsigned int pps_id
address (in raster order) of the first block in the current slice segment
Definition: hevcdec.h:253
videodsp.h
SliceHeader::luma_weight_l1
int16_t luma_weight_l1[16]
Definition: hevcdec.h:323
HEVCContext::sh
SliceHeader sh
Definition: hevcdec.h:523
ff_hevc_set_neighbour_available
void ff_hevc_set_neighbour_available(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH)
Definition: hevc_mvs.c:43
int32_t
int32_t
Definition: audioconvert.c:56
PredictionUnit::mpm_idx
int mpm_idx
Definition: hevcdec.h:368
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
LAST_SIGNIFICANT_COEFF_Y_PREFIX
@ LAST_SIGNIFICANT_COEFF_Y_PREFIX
Definition: hevcdec.h:126
CU_CHROMA_QP_OFFSET_IDX
@ CU_CHROMA_QP_OFFSET_IDX
Definition: hevcdec.h:138
HEVCContext::wpp_err
atomic_int wpp_err
Definition: hevcdec.h:582
INTRA_ANGULAR_33
@ INTRA_ANGULAR_33
Definition: hevcdec.h:205
ff_hevc_frame_nb_refs
int ff_hevc_frame_nb_refs(const HEVCContext *s)
Get the number of candidate references for the current frame.
Definition: hevc_refs.c:535
PredictionUnit::chroma_mode_c
uint8_t chroma_mode_c[4]
Definition: hevcdec.h:374
PredictionUnit::intra_pred_mode
uint8_t intra_pred_mode[4]
Definition: hevcdec.h:370
HEVCContext::hpc
HEVCPredContext hpc
Definition: hevcdec.h:544
BswapDSPContext
Definition: bswapdsp.h:24
TransformUnit::is_cu_chroma_qp_offset_coded
uint8_t is_cu_chroma_qp_offset_coded
Definition: hevcdec.h:387
ff_hevc_pcm_flag_decode
int ff_hevc_pcm_flag_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:755
SliceHeader::slice_qp_delta
int slice_qp_delta
Definition: hevcdec.h:294
SliceHeader::slice_addr
unsigned int slice_addr
Definition: hevcdec.h:258
SliceHeader::use_integer_mv_flag
uint8_t use_integer_mv_flag
Definition: hevcdec.h:308
HEVCCABACState
Definition: hevcdec.h:229
HEVCContext::is_pcm
uint8_t * is_pcm
Definition: hevcdec.h:562
TransformUnit::intra_pred_mode_c
int intra_pred_mode_c
Definition: hevcdec.h:384
HEVCContext::hevcdsp
HEVCDSPContext hevcdsp
Definition: hevcdec.h:545
INTRA_ANGULAR_20
@ INTRA_ANGULAR_20
Definition: hevcdec.h:192
INTRA_ANGULAR_13
@ INTRA_ANGULAR_13
Definition: hevcdec.h:185
HEVCLocalContext::end_of_tiles_y
int end_of_tiles_y
Definition: hevcdec.h:471
INTRA_CHROMA_PRED_MODE
@ INTRA_CHROMA_PRED_MODE
Definition: hevcdec.h:107
H2645Packet
Definition: h2645_parse.h:82
CodingUnit::intra_split_flag
uint8_t intra_split_flag
IntraSplitFlag.
Definition: hevcdec.h:342
hevc_sei.h
ff_hevc_mvp_lx_flag_decode
int ff_hevc_mvp_lx_flag_decode(HEVCLocalContext *lc)
Definition: hevc_cabac.c:836
ff_hevc_clear_refs
void ff_hevc_clear_refs(HEVCContext *s)
Mark all frames in DPB as unused for reference.
Definition: hevc_refs.c:66
LAST_SIGNIFICANT_COEFF_X_SUFFIX
@ LAST_SIGNIFICANT_COEFF_X_SUFFIX
Definition: hevcdec.h:127
CABACContext
Definition: cabac.h:41
PART_2NxN
@ PART_2NxN
Definition: hevcdec.h:143
SliceHeader::long_term_rps
LongTermRPS long_term_rps
Definition: hevcdec.h:275
EXPLICIT_RDPCM_DIR_FLAG
@ EXPLICIT_RDPCM_DIR_FLAG
Definition: hevcdec.h:124
ff_hevc_cu_chroma_qp_offset_flag
int ff_hevc_cu_chroma_qp_offset_flag(HEVCLocalContext *lc)
Definition: hevc_cabac.c:676
HEVCLocalContext::cc
CABACContext cc
Definition: hevcdec.h:445
TransformUnit::cu_qp_offset_cr
int8_t cu_qp_offset_cr
Definition: hevcdec.h:389
HEVCParamSets
Definition: hevc_ps.h:438
HEVC_CONTEXTS
#define HEVC_CONTEXTS
Definition: hevcdec.h:52
RefPicListTab::refPicList
RefPicList refPicList[2]
Definition: hevcdec.h:249
SAO_MERGE_FLAG
@ SAO_MERGE_FLAG
Definition: hevcdec.h:90