FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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/md5.h"
30 
31 #include "avcodec.h"
32 #include "bswapdsp.h"
33 #include "cabac.h"
34 #include "get_bits.h"
35 #include "hevcpred.h"
36 #include "h2645_parse.h"
37 #include "hevc.h"
38 #include "hevc_ps.h"
39 #include "hevcdsp.h"
40 #include "internal.h"
41 #include "thread.h"
42 #include "videodsp.h"
43 
44 #define MAX_NB_THREADS 16
45 #define SHIFT_CTB_WPP 2
46 
47 //TODO: check if this is really the maximum
48 #define MAX_TRANSFORM_DEPTH 5
49 
50 #define MAX_TB_SIZE 32
51 #define MAX_QP 51
52 #define DEFAULT_INTRA_TC_OFFSET 2
53 
54 #define HEVC_CONTEXTS 199
55 
56 #define MRG_MAX_NUM_CANDS 5
57 
58 #define L0 0
59 #define L1 1
60 
61 #define EPEL_EXTRA_BEFORE 1
62 #define EPEL_EXTRA_AFTER 2
63 #define EPEL_EXTRA 3
64 #define QPEL_EXTRA_BEFORE 3
65 #define QPEL_EXTRA_AFTER 4
66 #define QPEL_EXTRA 7
67 
68 #define EDGE_EMU_BUFFER_STRIDE 80
69 
70 /**
71  * Value of the luma sample at position (x, y) in the 2D array tab.
72  */
73 #define SAMPLE(tab, x, y) ((tab)[(y) * s->sps->width + (x)])
74 #define SAMPLE_CTB(tab, x, y) ((tab)[(y) * min_cb_width + (x)])
75 
76 #define IS_IDR(s) ((s)->nal_unit_type == HEVC_NAL_IDR_W_RADL || (s)->nal_unit_type == HEVC_NAL_IDR_N_LP)
77 #define IS_BLA(s) ((s)->nal_unit_type == HEVC_NAL_BLA_W_RADL || (s)->nal_unit_type == HEVC_NAL_BLA_W_LP || \
78  (s)->nal_unit_type == HEVC_NAL_BLA_N_LP)
79 #define IS_IRAP(s) ((s)->nal_unit_type >= 16 && (s)->nal_unit_type <= 23)
80 
81 enum RPSType {
88 };
89 
140 };
141 
142 enum PartMode {
146  PART_NxN = 3,
151 };
152 
153 enum PredMode {
157 };
158 
160  PRED_L0 = 0,
163 };
164 
165 enum PredFlag {
166  PF_INTRA = 0,
170 };
171 
208 };
209 
210 enum SAOType {
215 };
216 
222 };
223 
224 enum ScanType {
228 };
229 
230 typedef struct LongTermRPS {
231  int poc[32];
234 } LongTermRPS;
235 
236 typedef struct RefPicList {
240  int nb_refs;
241 } RefPicList;
242 
243 typedef struct RefPicListTab {
245 } RefPicListTab;
246 
247 typedef struct SliceHeader {
248  unsigned int pps_id;
249 
250  ///< address (in raster order) of the first block in the current slice segment
251  unsigned int slice_segment_addr;
252  ///< address (in raster order) of the first block in the current slice
253  unsigned int slice_addr;
254 
256 
258 
263 
264  ///< RPS coded in the slice header itself is stored here
271  unsigned int list_entry_lx[2][32];
272 
276 
277  unsigned int nb_refs[2];
278 
281 
283  uint8_t disable_deblocking_filter_flag; ///< slice_header_disable_deblocking_filter_flag
286 
287  unsigned int collocated_ref_idx;
288 
292 
294 
295  int beta_offset; ///< beta_offset_div2 * 2
296  int tc_offset; ///< tc_offset_div2 * 2
297 
298  unsigned int max_num_merge_cand; ///< 5 - 5_minus_max_num_merge_cand
299 
301  int * offset;
302  int * size;
304 
305  int8_t slice_qp;
306 
309 
310  int16_t luma_weight_l0[16];
311  int16_t chroma_weight_l0[16][2];
312  int16_t chroma_weight_l1[16][2];
313  int16_t luma_weight_l1[16];
314 
315  int16_t luma_offset_l0[16];
316  int16_t chroma_offset_l0[16][2];
317 
318  int16_t luma_offset_l1[16];
319  int16_t chroma_offset_l1[16][2];
320 
322 } SliceHeader;
323 
324 typedef struct CodingUnit {
325  int x;
326  int y;
327 
328  enum PredMode pred_mode; ///< PredMode
329  enum PartMode part_mode; ///< PartMode
330 
331  // Inferred parameters
332  uint8_t intra_split_flag; ///< IntraSplitFlag
333  uint8_t max_trafo_depth; ///< MaxTrafoDepth
335 } CodingUnit;
336 
337 typedef struct Mv {
338  int16_t x; ///< horizontal component of motion vector
339  int16_t y; ///< vertical component of motion vector
340 } Mv;
341 
342 typedef struct MvField {
344  int8_t ref_idx[2];
345  int8_t pred_flag;
346 } MvField;
347 
348 typedef struct NeighbourAvailable {
351  int cand_up;
356 
357 typedef struct PredictionUnit {
358  int mpm_idx;
366 
367 typedef struct TransformUnit {
369 
371 
372  // Inferred parameters;
381 } TransformUnit;
382 
383 typedef struct DBParams {
386 } DBParams;
387 
388 #define HEVC_FRAME_FLAG_OUTPUT (1 << 0)
389 #define HEVC_FRAME_FLAG_SHORT_REF (1 << 1)
390 #define HEVC_FRAME_FLAG_LONG_REF (1 << 2)
391 #define HEVC_FRAME_FLAG_BUMPING (1 << 3)
392 
393 typedef struct HEVCFrame {
400  int poc;
402 
404 
408 
411 
412  /**
413  * A sequence counter, so that old frames are output first
414  * after a POC reset
415  */
416  uint16_t sequence;
417 
418  /**
419  * A combination of HEVC_FRAME_FLAG_*
420  */
422 } HEVCFrame;
423 
424 typedef struct HEVCLocalContext {
426 
428 
430 
433 
434  int8_t qp_y;
435  int8_t curr_qp_y;
436 
437  int qPy_pred;
438 
440 
447  /* +7 is for subpixel interpolation, *2 for high bit depths */
449  /* The extended size between the new edge emu buffer is abused by SAO */
452 
453  int ct_depth;
457 
458 #define BOUNDARY_LEFT_SLICE (1 << 0)
459 #define BOUNDARY_LEFT_TILE (1 << 1)
460 #define BOUNDARY_UPPER_SLICE (1 << 2)
461 #define BOUNDARY_UPPER_TILE (1 << 3)
462  /* properties of the boundary of the current CTB for the purposes
463  * of the deblocking filter */
466 
467 typedef struct HEVCContext {
468  const AVClass *c; // needed by private avoptions
470 
472 
475 
478 
479  int width;
480  int height;
481 
483 
484  /** 1 if the independent slice segment header was successfully parsed */
486 
491 
493 
496 
497  ///< candidate references for the current frame
499 
504  int temporal_id; ///< temporal_id_plus1 - 1
507  int poc;
508  int pocTid0;
509  int slice_idx; ///< number of the slice being currently decoded
510  int eos; ///< current packet contains an EOS/EOB NAL
511  int last_eos; ///< last packet contains an EOS/EOB NAL
512  int max_ra;
513  int bs_width;
515 
518 
523  int8_t *qp_y_tab;
526 
528 
529  // CU
532  // PU
534 
535  uint8_t *cbf_luma; // cbf_luma of colocated TU
537 
538  // CTB-level flags affecting loop filter operation
540 
541  /** used on BE to byteswap the lines for checksumming */
544 
545  /**
546  * Sequence counters for decoded and output frames, so that old
547  * frames are output first after a POC reset
548  */
549  uint16_t seq_decode;
550  uint16_t seq_output;
551 
554 
555  const uint8_t *data;
556 
558  // type of the first VCL NAL of the current frame
560 
561  // for checking the frame checksums
562  struct AVMD5 *md5_ctx;
563  uint8_t md5[3][16];
565 
567  uint8_t is_nalff; ///< this flag is != 0 if bitstream is encapsulated
568  ///< as a format defined in 14496-15
570 
572 
573  int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4)
575 
576  /** frame packing arrangement variables */
581 
582  /** display orientation */
586 
588 
591 
592  /** mastering display */
594  uint16_t display_primaries[3][2];
595  uint16_t white_point[2];
598 
599 } HEVCContext;
600 
602 
603 /**
604  * Mark all frames in DPB as unused for reference.
605  */
607 
608 /**
609  * Drop all frames currently in DPB.
610  */
612 
613 /**
614  * Compute POC of the current frame and return it.
615  */
616 int ff_hevc_compute_poc(HEVCContext *s, int poc_lsb);
617 
619  int x0, int y0);
620 
621 /**
622  * Construct the reference picture sets for the current frame.
623  */
625 
626 /**
627  * Construct the reference picture list(s) for the current slice.
628  */
630 
631 void ff_hevc_save_states(HEVCContext *s, int ctb_addr_ts);
632 void ff_hevc_cabac_init(HEVCContext *s, int ctb_addr_ts);
641 int ff_hevc_skip_flag_decode(HEVCContext *s, int x0, int y0,
642  int x_cb, int y_cb);
645  int x0, int y0);
646 int ff_hevc_part_mode_decode(HEVCContext *s, int log2_cb_size);
654 int ff_hevc_inter_pred_idc_decode(HEVCContext *s, int nPbW, int nPbH);
655 int ff_hevc_ref_idx_lx_decode(HEVCContext *s, int num_ref_idx_lx);
658 int ff_hevc_split_transform_flag_decode(HEVCContext *s, int log2_trafo_size);
659 int ff_hevc_cbf_cb_cr_decode(HEVCContext *s, int trafo_depth);
660 int ff_hevc_cbf_luma_decode(HEVCContext *s, int trafo_depth);
663 
664 /**
665  * Get the number of candidate references for the current frame.
666  */
668 
669 int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc);
670 
671 /**
672  * Find next frame in output order and put a reference to it in frame.
673  * @return 1 if a frame was output, 0 otherwise
674  */
676 
678 
680 
681 void ff_hevc_set_neighbour_available(HEVCContext *s, int x0, int y0,
682  int nPbW, int nPbH);
683 void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0,
684  int nPbW, int nPbH, int log2_cb_size,
685  int part_idx, int merge_idx, MvField *mv);
686 void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0,
687  int nPbW, int nPbH, int log2_cb_size,
688  int part_idx, int merge_idx,
689  MvField *mv, int mvp_lx_flag, int LX);
690 void ff_hevc_set_qPy(HEVCContext *s, int xBase, int yBase,
691  int log2_cb_size);
693  int log2_trafo_size);
698 void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size);
699 void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size);
700 void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
701  int log2_trafo_size, enum ScanType scan_idx,
702  int c_idx);
703 
704 void ff_hevc_hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size);
705 
706 /**
707  * Reset SEI values that are stored on the Context.
708  * e.g. Caption data that was extracted during NAL
709  * parsing.
710  *
711  * @param s HEVCContext.
712  */
714 
715 extern const uint8_t ff_hevc_qpel_extra_before[4];
716 extern const uint8_t ff_hevc_qpel_extra_after[4];
717 extern const uint8_t ff_hevc_qpel_extra[4];
718 
719 #endif /* AVCODEC_HEVCDEC_H */
int8_t cu_qp_offset_cr
Definition: hevcdec.h:379
int frame_packing_arrangement_type
Definition: hevcdec.h:578
uint8_t ctb_up_flag
Definition: hevcdec.h:442
AVFrame * frame
Definition: hevcdec.h:394
int sei_frame_packing_present
frame packing arrangement variables
Definition: hevcdec.h:577
HEVCPredContext hpc
Definition: hevcdec.h:519
const char * s
Definition: avisynth_c.h:768
NeighbourAvailable na
Definition: hevcdec.h:456
int ff_hevc_slice_rpl(HEVCContext *s)
Construct the reference picture list(s) for the current slice.
Definition: hevc_refs.c:299
int pic_order_cnt_lsb
Definition: hevcdec.h:257
int short_term_ref_pic_set_sps_flag
Definition: hevcdec.h:265
int quincunx_subsampling
Definition: hevcdec.h:580
This structure describes decoded (raw) audio or video data.
Definition: frame.h:187
HEVCFrame * ref
Definition: hevcdec.h:505
#define HEVC_CONTEXTS
Definition: hevcdec.h:54
uint8_t is_cu_qp_delta_coded
Definition: hevcdec.h:376
int ff_hevc_inter_pred_idc_decode(HEVCContext *s, int nPbW, int nPbH)
Definition: hevc_cabac.c:786
static void flush(AVCodecContext *avctx)
int ff_hevc_sao_offset_sign_decode(HEVCContext *s)
Definition: hevc_cabac.c:585
void ff_hevc_set_qPy(HEVCContext *s, int xBase, int yBase, int log2_cb_size)
Definition: hevc_filter.c:121
int active_seq_parameter_set_id
Definition: hevcdec.h:571
VideoDSPContext vdsp
Definition: hevcdec.h:521
uint8_t edge_emu_buffer[(MAX_PB_SIZE+7)*EDGE_EMU_BUFFER_STRIDE *2]
Definition: hevcdec.h:448
const uint8_t ff_hevc_qpel_extra_before[4]
int content_interpretation_type
Definition: hevcdec.h:579
int ff_hevc_res_scale_sign_flag(HEVCContext *s, int idx)
Definition: hevc_cabac.c:894
int16_t x
horizontal component of motion vector
Definition: hevcdec.h:338
int ff_hevc_end_of_slice_flag_decode(HEVCContext *s)
Definition: hevc_cabac.c:597
void * hwaccel_picture_private
Definition: hevcdec.h:410
uint8_t * cabac_state
Definition: hevcdec.h:482
int sei_hflip
Definition: hevcdec.h:585
InterPredIdc
Definition: hevcdec.h:159
uint8_t nb_refs
Definition: hevcdec.h:233
MvField * tab_mvf
Definition: hevcdec.h:396
int bs_width
Definition: hevcdec.h:513
uint8_t intra_split_flag
IntraSplitFlag.
Definition: hevcdec.h:332
int rem_intra_luma_pred_mode
Definition: hevcdec.h:359
void ff_hevc_clear_refs(HEVCContext *s)
Mark all frames in DPB as unused for reference.
Definition: hevc_refs.c:66
unsigned int slice_addr
Definition: hevcdec.h:253
int ff_hevc_cbf_luma_decode(HEVCContext *s, int trafo_depth)
Definition: hevc_cabac.c:865
int tc_offset
Definition: hevcdec.h:385
PredictionUnit pu
Definition: hevcdec.h:455
int16_t chroma_offset_l1[16][2]
Definition: hevcdec.h:319
RefPicList refPicList[2]
Definition: hevcdec.h:244
HEVCParamSets ps
Definition: hevcdec.h:492
int nuh_layer_id
Definition: hevcdec.h:574
intptr_t atomic_int
Definition: stdatomic.h:55
uint8_t dependent_slice_segment_flag
Definition: hevcdec.h:260
int ff_hevc_cu_chroma_qp_offset_idx(HEVCContext *s)
Definition: hevc_cabac.c:659
CABACContext cc
Definition: hevcdec.h:432
ShortTermRPS slice_rps
Definition: hevcdec.h:267
int ff_hevc_mpm_idx_decode(HEVCContext *s)
Definition: hevc_cabac.c:741
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:549
HEVCNALUnitType
Table 7-3: NAL unit type codes.
Definition: hevc.h:27
uint8_t threads_type
Definition: hevcdec.h:476
uint32_t min_mastering_luminance
Definition: hevcdec.h:597
int max_ra
Definition: hevcdec.h:512
void ff_hevc_bump_frame(HEVCContext *s)
Definition: hevc_refs.c:241
const uint8_t * data
Definition: hevcdec.h:555
int8_t curr_qp_y
Definition: hevcdec.h:435
AVBufferPool * rpl_tab_pool
candidate references for the current frame
Definition: hevcdec.h:495
int nb_refs
Definition: hevcdec.h:240
unsigned int slice_segment_addr
address (in raster order) of the first block in the current slice
Definition: hevcdec.h:251
enum HEVCSliceType slice_type
Definition: hevcdec.h:255
int end_of_tiles_x
Definition: hevcdec.h:445
uint8_t
enum HEVCNALUnitType nal_unit_type
Definition: hevcdec.h:503
int ff_hevc_log2_res_scale_abs(HEVCContext *s, int idx)
Definition: hevc_cabac.c:885
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:171
uint8_t ctb_up_right_flag
Definition: hevcdec.h:443
LongTermRPS long_term_rps
Definition: hevcdec.h:270
int poc[32]
Definition: hevcdec.h:231
struct HEVCFrame * ref[HEVC_MAX_REFS]
Definition: hevcdec.h:237
Multithreading support functions.
void ff_hevc_save_states(HEVCContext *s, int ctb_addr_ts)
Definition: hevc_cabac.c:450
int num_entry_point_offsets
Definition: hevcdec.h:303
SAOType
Definition: hevcdec.h:210
AVFrame * output_frame
Definition: hevcdec.h:488
int apply_defdispwin
Definition: hevcdec.h:569
SAOParams * sao
Definition: hevcdec.h:501
AVCodecContext * avctx
Definition: hevcdec.h:469
int ff_hevc_part_mode_decode(HEVCContext *s, int log2_cb_size)
Definition: hevc_cabac.c:694
int ff_hevc_sao_band_position_decode(HEVCContext *s)
Definition: hevc_cabac.c:565
static AVFrame * frame
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
Definition: mem.h:104
BswapDSPContext bdsp
Definition: hevcdec.h:522
ThreadFrame tf
Definition: hevcdec.h:395
uint8_t first_slice_in_pic_flag
Definition: hevcdec.h:259
uint8_t ctb_up_left_flag
Definition: hevcdec.h:444
static int flags
Definition: log.c:57
uint8_t threads_number
Definition: hevcdec.h:477
uint8_t is_cu_chroma_qp_offset_coded
Definition: hevcdec.h:377
bitstream reader API header.
int8_t pred_flag
Definition: hevcdec.h:345
int8_t * qp_y_tab
Definition: hevcdec.h:523
int sei_anticlockwise_rotation
Definition: hevcdec.h:584
uint8_t pic_output_flag
Definition: hevcdec.h:261
uint8_t * tab_ct_depth
Definition: hevcdec.h:531
uint8_t cu_transquant_bypass_flag
Definition: hevcdec.h:334
int16_t tmp[MAX_PB_SIZE *MAX_PB_SIZE]
Definition: hevcdec.h:451
int ff_hevc_frame_rps(HEVCContext *s)
Construct the reference picture sets for the current frame.
Definition: hevc_refs.c:459
Definition: md5.c:40
int ff_hevc_rem_intra_luma_pred_mode_decode(HEVCContext *s)
Definition: hevc_cabac.c:749
RPSType
Definition: hevcdec.h:81
uint8_t used[32]
Definition: hevcdec.h:232
The buffer pool.
int temporal_id
temporal_id_plus1 - 1
Definition: hevcdec.h:504
uint8_t first_qp_group
Definition: hevcdec.h:429
HEVCDSPContext hevcdsp
Definition: hevcdec.h:520
int ff_hevc_cu_qp_delta_sign_flag(HEVCContext *s)
Definition: hevc_cabac.c:649
int ctb_count
Definition: hevcdec.h:399
uint8_t no_output_of_prior_pics_flag
Definition: hevcdec.h:274
HEVCLocalContext * HEVClcList[MAX_NB_THREADS]
Definition: hevcdec.h:473
int slice_idx
number of the slice being currently decoded
Definition: hevcdec.h:509
uint8_t intra_pred_mode[4]
Definition: hevcdec.h:360
uint8_t colour_plane_id
RPS coded in the slice header itself is stored here.
Definition: hevcdec.h:262
uint8_t cu_chroma_qp_offset_enabled_flag
Definition: hevcdec.h:293
uint8_t slice_initialized
1 if the independent slice segment header was successfully parsed
Definition: hevcdec.h:485
void ff_hevc_reset_sei(HEVCContext *s)
Reset SEI values that are stored on the Context.
Definition: hevc_sei.c:383
RefPicList * ff_hevc_get_ref_list(HEVCContext *s, HEVCFrame *frame, int x0, int y0)
Definition: hevc_refs.c:57
AVBufferRef * rpl_tab_buf
Definition: hevcdec.h:406
uint8_t rpl_modification_flag[2]
Definition: hevcdec.h:273
int * size
Definition: hevcdec.h:302
RefPicList * refPicList
Definition: hevcdec.h:397
int16_t luma_offset_l0[16]
Definition: hevcdec.h:315
int bs_height
Definition: hevcdec.h:514
uint16_t display_primaries[3][2]
Definition: hevcdec.h:594
int picture_struct
Definition: hevcdec.h:587
void ff_hevc_cabac_init(HEVCContext *s, int ctb_addr_ts)
Definition: hevc_cabac.c:504
uint8_t * sao_pixel_buffer_h[3]
Definition: hevcdec.h:489
int8_t cu_qp_offset_cb
Definition: hevcdec.h:378
int tc_offset
tc_offset_div2 * 2
Definition: hevcdec.h:296
const ShortTermRPS * short_term_rps
Definition: hevcdec.h:268
uint8_t merge_flag
Definition: hevcdec.h:362
struct AVMD5 * md5_ctx
Definition: hevcdec.h:562
unsigned * entry_point_offset
Definition: hevcdec.h:300
int8_t slice_qp
Definition: hevcdec.h:305
void ff_hevc_hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size)
Definition: hevc_cabac.c:1520
uint8_t edge_emu_buffer2[(MAX_PB_SIZE+7)*EDGE_EMU_BUFFER_STRIDE *2]
Definition: hevcdec.h:450
uint8_t max_trafo_depth
MaxTrafoDepth.
Definition: hevcdec.h:333
uint16_t sequence
A sequence counter, so that old frames are output first after a POC reset.
Definition: hevcdec.h:416
uint8_t slice_temporal_mvp_enabled_flag
Definition: hevcdec.h:275
Definition: hevcdec.h:168
uint8_t * vertical_bs
Definition: hevcdec.h:525
int chroma_mode_c
Definition: hevcdec.h:375
int16_t luma_weight_l0[16]
Definition: hevcdec.h:310
struct HEVCContext * sList[MAX_NB_THREADS]
Definition: hevcdec.h:471
int slice_qp_delta
Definition: hevcdec.h:289
int intra_pred_mode
Definition: hevcdec.h:373
int ff_hevc_split_transform_flag_decode(HEVCContext *s, int log2_trafo_size)
Definition: hevc_cabac.c:855
enum HEVCNALUnitType first_nal_type
Definition: hevcdec.h:559
AVBufferRef * tab_mvf_buf
Definition: hevcdec.h:405
void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv)
Definition: hevc_mvs.c:479
uint8_t chroma_mode_c[4]
Definition: hevcdec.h:364
int beta_offset
beta_offset_div2 * 2
Definition: hevcdec.h:295
int res_scale_val
Definition: hevcdec.h:370
Definition: hevcdec.h:169
uint8_t cabac_state[HEVC_CONTEXTS]
Definition: hevcdec.h:425
uint8_t * sao_pixel_buffer_v[3]
Definition: hevcdec.h:490
int slice_cr_qp_offset
Definition: hevcdec.h:291
int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc)
Definition: hevc_refs.c:135
uint8_t * tab_ipm
Definition: hevcdec.h:533
int ff_hevc_mvp_lx_flag_decode(HEVCContext *s)
Definition: hevc_cabac.c:812
int ff_hevc_sao_offset_abs_decode(HEVCContext *s)
Definition: hevc_cabac.c:575
const uint8_t ff_hevc_qpel_extra[4]
int32_t
PartMode
Definition: hevcdec.h:142
int ff_hevc_split_coding_unit_flag_decode(HEVCContext *s, int ct_depth, int x0, int y0)
Definition: hevc_cabac.c:675
SyntaxElement
Definition: hevcdec.h:90
int sei_mastering_display_info_present
mastering display
Definition: hevcdec.h:593
void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, 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:582
int intra_pred_mode_c
Definition: hevcdec.h:374
int ff_hevc_cu_chroma_qp_offset_flag(HEVCContext *s)
Definition: hevc_cabac.c:654
struct HEVCFrame * collocated_ref
Definition: hevcdec.h:401
int16_t chroma_weight_l0[16][2]
Definition: hevcdec.h:311
uint16_t seq_output
Definition: hevcdec.h:550
void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, int log2_trafo_size)
Definition: hevc_filter.c:714
int16_t luma_offset_l1[16]
Definition: hevcdec.h:318
int16_t chroma_offset_l0[16][2]
Definition: hevcdec.h:316
int ff_hevc_sao_eo_class_decode(HEVCContext *s)
Definition: hevc_cabac.c:590
uint32_t max_mastering_luminance
Definition: hevcdec.h:596
void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags)
Definition: hevc_refs.c:32
SAOEOClass
Definition: hevcdec.h:217
int ff_hevc_prev_intra_luma_pred_flag_decode(HEVCContext *s)
Definition: hevc_cabac.c:736
unsigned int pps_id
address (in raster order) of the first block in the current slice segment
Definition: hevcdec.h:248
int ff_hevc_merge_flag_decode(HEVCContext *s)
Definition: hevc_cabac.c:781
static const int8_t mv[256][2]
Definition: 4xm.c:77
IntraPredMode
Definition: hevcdec.h:172
RefPicListTab ** rpl_tab
Definition: hevcdec.h:398
int sei_display_orientation_present
display orientation
Definition: hevcdec.h:583
int slice_cb_qp_offset
Definition: hevcdec.h:290
void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size)
Definition: hevc_filter.c:842
int ff_hevc_frame_nb_refs(HEVCContext *s)
Get the number of candidate references for the current frame.
Definition: hevc_refs.c:542
int short_term_ref_pic_set_size
Definition: hevcdec.h:266
Libavcodec external API header.
int ff_hevc_cbf_cb_cr_decode(HEVCContext *s, int trafo_depth)
Definition: hevc_cabac.c:860
int ff_hevc_compute_poc(HEVCContext *s, int poc_lsb)
Compute POC of the current frame and return it.
Definition: hevc_refs.c:519
uint8_t is_nalff
this flag is != 0 if bitstream is encapsulated as a format defined in 14496-15
Definition: hevcdec.h:567
uint8_t md5[3][16]
Definition: hevcdec.h:563
PredMode
Definition: hevcdec.h:153
int long_term_ref_pic_set_size
Definition: hevcdec.h:269
main external API structure.
Definition: avcodec.h:1732
uint8_t is_md5
Definition: hevcdec.h:564
enum PredMode pred_mode
PredMode.
Definition: hevcdec.h:328
AVBufferRef * hwaccel_priv_buf
Definition: hevcdec.h:409
atomic_int wpp_err
Definition: hevcdec.h:553
int16_t y
vertical component of motion vector
Definition: hevcdec.h:339
uint8_t cross_pf
Definition: hevcdec.h:380
int height
Definition: hevcdec.h:480
#define EDGE_EMU_BUFFER_STRIDE
Definition: hevcdec.h:68
int ff_hevc_pred_mode_decode(HEVCContext *s)
Definition: hevc_cabac.c:670
TransformUnit tu
Definition: hevcdec.h:439
uint8_t ctb_left_flag
Definition: hevcdec.h:441
int cu_qp_delta
Definition: hevcdec.h:368
uint8_t * is_pcm
Definition: hevcdec.h:536
uint8_t * checksum_buf
used on BE to byteswap the lines for checksumming
Definition: hevcdec.h:542
uint8_t cabac_init_flag
Definition: hevcdec.h:282
Describe the class of an AVClass context structure.
Definition: log.h:67
uint8_t stat_coeff[4]
Definition: hevcdec.h:427
int ff_hevc_sao_type_idx_decode(HEVCContext *s)
Definition: hevc_cabac.c:555
int poc
Definition: hevcdec.h:400
AVFrame * frame
Definition: hevcdec.h:487
void ff_hevc_set_neighbour_available(HEVCContext *s, int x0, int y0, int nPbW, int nPbH)
Definition: hevc_mvs.c:42
int enable_parallel_tiles
Definition: hevcdec.h:552
unsigned int max_num_merge_cand
5 - 5_minus_max_num_merge_cand
Definition: hevcdec.h:298
int checksum_buf_size
Definition: hevcdec.h:543
int last_eos
last packet contains an EOS/EOB NAL
Definition: hevcdec.h:511
DBParams * deblock
Definition: hevcdec.h:502
GetBitContext gb
Definition: hevcdec.h:431
refcounted data buffer API
enum PartMode part_mode
PartMode.
Definition: hevcdec.h:329
int ff_hevc_no_residual_syntax_flag_decode(HEVCContext *s)
Definition: hevc_cabac.c:817
uint8_t intra_pred_mode_c[4]
Definition: hevcdec.h:363
Definition: hevcdec.h:167
Definition: hevcdec.h:337
HEVCWindow window
Definition: hevcdec.h:403
PredFlag
Definition: hevcdec.h:165
int ff_hevc_pcm_flag_decode(HEVCContext *s)
Definition: hevc_cabac.c:731
int16_t luma_weight_l1[16]
Definition: hevcdec.h:313
int16_t chroma_log2_weight_denom
Definition: hevcdec.h:308
int pocTid0
Definition: hevcdec.h:508
uint8_t flags
A combination of HEVC_FRAME_FLAG_*.
Definition: hevcdec.h:421
HEVCLocalContext * HEVClc
Definition: hevcdec.h:474
#define MAX_PB_SIZE
Definition: hevcdsp.h:30
int list[HEVC_MAX_REFS]
Definition: hevcdec.h:238
int ff_hevc_decode_nal_sei(HEVCContext *s)
Definition: hevc_sei.c:371
int ff_hevc_cu_qp_delta_abs(HEVCContext *s)
Definition: hevc_cabac.c:622
const uint8_t ff_hevc_qpel_extra_after[4]
int eos
current packet contains an EOS/EOB NAL
Definition: hevcdec.h:510
HEVCSliceType
Definition: hevc.h:55
int sei_vflip
Definition: hevcdec.h:585
A reference to a data buffer.
Definition: buffer.h:81
Mv mv[2]
Definition: hevcdec.h:343
int ff_hevc_sao_merge_flag_decode(HEVCContext *s)
Definition: hevc_cabac.c:550
uint8_t * skip_flag
Definition: hevcdec.h:530
int8_t ref_idx[2]
Definition: hevcdec.h:344
int ff_hevc_cu_transquant_bypass_flag_decode(HEVCContext *s)
Definition: hevc_cabac.c:602
common internal api header.
uint8_t * horizontal_bs
Definition: hevcdec.h:524
uint8_t * a53_caption
Definition: hevcdec.h:589
unsigned int nb_refs[2]
Definition: hevcdec.h:277
int32_t * tab_slice_address
Definition: hevcdec.h:527
uint8_t disable_deblocking_filter_flag
slice_header_disable_deblocking_filter_flag
Definition: hevcdec.h:283
const AVClass * c
Definition: hevcdec.h:468
uint8_t * filter_slice_edges
Definition: hevcdec.h:539
uint8_t collocated_list
Definition: hevcdec.h:285
int nal_length_size
Number of bytes used for nal length (1, 2 or 4)
Definition: hevcdec.h:573
int slice_ctb_addr_rs
Definition: hevcdec.h:321
AVBufferPool * tab_mvf_pool
Definition: hevcdec.h:494
Core video DSP helper functions.
uint16_t white_point[2]
Definition: hevcdec.h:595
int ff_hevc_merge_idx_decode(HEVCContext *s)
Definition: hevc_cabac.c:770
uint8_t slice_loop_filter_across_slices_enabled_flag
Definition: hevcdec.h:284
void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, int log2_trafo_size, enum ScanType scan_idx, int c_idx)
Definition: hevc_cabac.c:1010
void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size)
Definition: hevc_filter.c:867
RefPicList rps[5]
Definition: hevcdec.h:498
unsigned int collocated_ref_idx
Definition: hevcdec.h:287
Decoded Picture Buffer (DPB).
Definition: vaapi_h264.c:82
CodingUnit cu
Definition: hevcdec.h:454
int ff_hevc_skip_flag_decode(HEVCContext *s, int x0, int y0, int x_cb, int y_cb)
Definition: hevc_cabac.c:607
int beta_offset
Definition: hevcdec.h:384
unsigned int list_entry_lx[2][32]
Definition: hevcdec.h:271
uint8_t luma_log2_weight_denom
Definition: hevcdec.h:307
int16_t chroma_weight_l1[16][2]
Definition: hevcdec.h:312
H2645Packet pkt
Definition: hevcdec.h:557
int boundary_flags
Definition: hevcdec.h:464
Public header for MD5 hash function implementation.
uint8_t context_initialized
Definition: hevcdec.h:566
AVBufferRef * rpl_buf
Definition: hevcdec.h:407
int is_decoded
Definition: hevcdec.h:516
int ff_hevc_ref_idx_lx_decode(HEVCContext *s, int num_ref_idx_lx)
Definition: hevc_cabac.c:796
#define HEVC_MAX_REFS
Definition: hevc.h:71
uint8_t * cbf_luma
Definition: hevcdec.h:535
void ff_hevc_flush_dpb(HEVCContext *s)
Drop all frames currently in DPB.
Definition: hevc_refs.c:75
SliceHeader sh
Definition: hevcdec.h:500
int no_rasl_output_flag
Definition: hevcdec.h:517
ScanType
Definition: hevcdec.h:224
int width
Definition: hevcdec.h:479
int * offset
Definition: hevcdec.h:301
uint8_t mvd_l1_zero_flag
Definition: hevcdec.h:280
int a53_caption_size
Definition: hevcdec.h:590
int end_of_tiles_y
Definition: hevcdec.h:446
int ff_hevc_intra_chroma_pred_mode_decode(HEVCContext *s)
Definition: hevc_cabac.c:759
Context Adaptive Binary Arithmetic Coder.
uint8_t slice_sample_adaptive_offset_flag[3]
Definition: hevcdec.h:279
#define MAX_NB_THREADS
Definition: hevcdec.h:44
int isLongTerm[HEVC_MAX_REFS]
Definition: hevcdec.h:239