FFmpeg
|
#include <stdatomic.h>
#include "libavutil/buffer.h"
#include "libavutil/mem_internal.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/bswapdsp.h"
#include "libavcodec/cabac.h"
#include "libavcodec/dovi_rpu.h"
#include "libavcodec/get_bits.h"
#include "libavcodec/h2645_parse.h"
#include "libavcodec/h274.h"
#include "libavcodec/progressframe.h"
#include "libavcodec/videodsp.h"
#include "dsp.h"
#include "hevc.h"
#include "pred.h"
#include "ps.h"
#include "sei.h"
Go to the source code of this file.
Data Structures | |
struct | HEVCCABACState |
struct | LongTermRPS |
struct | RefPicList |
struct | RefPicListTab |
struct | SliceHeader |
struct | CodingUnit |
struct | Mv |
struct | MvField |
struct | NeighbourAvailable |
struct | PredictionUnit |
struct | TransformUnit |
struct | DBParams |
struct | HEVCFrame |
struct | HEVCLocalContext |
struct | HEVCLayerContext |
struct | HEVCContext |
Macros | |
#define | SHIFT_CTB_WPP 2 |
#define | MAX_TB_SIZE 32 |
#define | MAX_QP 51 |
#define | DEFAULT_INTRA_TC_OFFSET 2 |
#define | HEVC_CONTEXTS 199 |
#define | HEVC_STAT_COEFFS 4 |
#define | MRG_MAX_NUM_CANDS 5 |
#define | L0 0 |
#define | L1 1 |
#define | EPEL_EXTRA_BEFORE 1 |
#define | EPEL_EXTRA_AFTER 2 |
#define | EPEL_EXTRA 3 |
#define | QPEL_EXTRA_BEFORE 3 |
#define | QPEL_EXTRA_AFTER 4 |
#define | QPEL_EXTRA 7 |
#define | EDGE_EMU_BUFFER_STRIDE 80 |
#define | SAMPLE(tab, x, y) ((tab)[(y) * s->sps->width + (x)]) |
Value of the luma sample at position (x, y) in the 2D array tab. More... | |
#define | SAMPLE_CTB(tab, x, y) ((tab)[(y) * min_cb_width + (x)]) |
#define | IS_IDR(s) ((s)->nal_unit_type == HEVC_NAL_IDR_W_RADL || (s)->nal_unit_type == HEVC_NAL_IDR_N_LP) |
#define | IS_BLA(s) |
#define | IS_IRAP(s) ((s)->nal_unit_type >= HEVC_NAL_BLA_W_LP && (s)->nal_unit_type <= HEVC_NAL_RSV_IRAP_VCL23) |
#define | HEVC_FRAME_FLAG_OUTPUT (1 << 0) |
#define | HEVC_FRAME_FLAG_SHORT_REF (1 << 1) |
#define | HEVC_FRAME_FLAG_LONG_REF (1 << 2) |
#define | HEVC_FRAME_FLAG_UNAVAILABLE (1 << 3) |
#define | BOUNDARY_LEFT_SLICE (1 << 0) |
#define | BOUNDARY_LEFT_TILE (1 << 1) |
#define | BOUNDARY_UPPER_SLICE (1 << 2) |
#define | BOUNDARY_UPPER_TILE (1 << 3) |
Variables | |
const uint8_t | ff_hevc_qpel_extra_before [4] |
const uint8_t | ff_hevc_qpel_extra_after [4] |
const uint8_t | ff_hevc_qpel_extra [4] |
#define IS_IDR | ( | s | ) | ((s)->nal_unit_type == HEVC_NAL_IDR_W_RADL || (s)->nal_unit_type == HEVC_NAL_IDR_N_LP) |
#define IS_BLA | ( | s | ) |
#define IS_IRAP | ( | s | ) | ((s)->nal_unit_type >= HEVC_NAL_BLA_W_LP && (s)->nal_unit_type <= HEVC_NAL_RSV_IRAP_VCL23) |
enum RPSType |
enum PartMode |
enum PredMode |
enum InterPredIdc |
enum PredFlag |
enum IntraPredMode |
enum SAOType |
enum SAOEOClass |
void ff_hevc_clear_refs | ( | HEVCLayerContext * | l | ) |
Mark all frames in DPB as unused for reference.
Definition at line 64 of file refs.c.
Referenced by hevc_frame_start().
void ff_hevc_flush_dpb | ( | HEVCContext * | s | ) |
Drop all frames currently in DPB.
Definition at line 73 of file refs.c.
Referenced by hevc_decode_flush().
const RefPicList* ff_hevc_get_ref_list | ( | const HEVCFrame * | frame, |
int | x0, | ||
int | y0 | ||
) |
Definition at line 54 of file refs.c.
Referenced by ff_hevc_deblocking_boundary_strengths().
int ff_hevc_frame_rps | ( | HEVCContext * | s, |
HEVCLayerContext * | l | ||
) |
Construct the reference picture sets for the current frame.
Definition at line 479 of file refs.c.
Referenced by hevc_frame_start().
int ff_hevc_slice_rpl | ( | HEVCContext * | s | ) |
Construct the reference picture list(s) for the current slice.
Definition at line 302 of file refs.c.
Referenced by decode_slice_data().
void ff_hevc_save_states | ( | HEVCLocalContext * | lc, |
const HEVCPPS * | pps, | ||
int | ctb_addr_ts | ||
) |
Definition at line 402 of file cabac.c.
Referenced by hls_decode_entry(), and hls_decode_entry_wpp().
int ff_hevc_cabac_init | ( | HEVCLocalContext * | lc, |
const HEVCPPS * | pps, | ||
int | ctb_addr_ts, | ||
const uint8_t * | data, | ||
size_t | size, | ||
int | is_wpp | ||
) |
Definition at line 454 of file cabac.c.
Referenced by hls_decode_entry(), and hls_decode_entry_wpp().
int ff_hevc_sao_merge_flag_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 516 of file cabac.c.
Referenced by hls_sao_param().
int ff_hevc_sao_type_idx_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 521 of file cabac.c.
Referenced by hls_sao_param().
int ff_hevc_sao_band_position_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 531 of file cabac.c.
Referenced by hls_sao_param().
int ff_hevc_sao_offset_abs_decode | ( | HEVCLocalContext * | lc, |
int | bit_depth | ||
) |
Definition at line 541 of file cabac.c.
Referenced by hls_sao_param().
int ff_hevc_sao_offset_sign_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 551 of file cabac.c.
Referenced by hls_sao_param().
int ff_hevc_sao_eo_class_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 556 of file cabac.c.
Referenced by hls_sao_param().
int ff_hevc_end_of_slice_flag_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 563 of file cabac.c.
Referenced by hls_coding_quadtree().
int ff_hevc_cu_transquant_bypass_flag_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 568 of file cabac.c.
Referenced by hls_coding_unit().
int ff_hevc_skip_flag_decode | ( | HEVCLocalContext * | lc, |
uint8_t * | skip_flag, | ||
int | x0, | ||
int | y0, | ||
int | x_cb, | ||
int | y_cb, | ||
int | min_cb_width | ||
) |
Definition at line 573 of file cabac.c.
Referenced by hls_coding_unit().
int ff_hevc_pred_mode_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 634 of file cabac.c.
Referenced by hls_coding_unit().
int ff_hevc_split_coding_unit_flag_decode | ( | HEVCLocalContext * | lc, |
uint8_t * | tab_ct_depth, | ||
const HEVCSPS * | sps, | ||
int | ct_depth, | ||
int | x0, | ||
int | y0 | ||
) |
Definition at line 639 of file cabac.c.
Referenced by hls_coding_quadtree().
int ff_hevc_part_mode_decode | ( | HEVCLocalContext * | lc, |
const HEVCSPS * | sps, | ||
int | log2_cb_size | ||
) |
Definition at line 660 of file cabac.c.
Referenced by hls_coding_unit().
int ff_hevc_pcm_flag_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 697 of file cabac.c.
Referenced by hls_coding_unit().
int ff_hevc_prev_intra_luma_pred_flag_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 702 of file cabac.c.
Referenced by intra_prediction_unit().
int ff_hevc_mpm_idx_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 707 of file cabac.c.
Referenced by intra_prediction_unit().
int ff_hevc_rem_intra_luma_pred_mode_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 715 of file cabac.c.
Referenced by intra_prediction_unit().
int ff_hevc_intra_chroma_pred_mode_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 725 of file cabac.c.
Referenced by intra_prediction_unit().
int ff_hevc_merge_idx_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 736 of file cabac.c.
Referenced by hls_prediction_unit().
int ff_hevc_merge_flag_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 747 of file cabac.c.
Referenced by hls_prediction_unit().
int ff_hevc_inter_pred_idc_decode | ( | HEVCLocalContext * | lc, |
int | nPbW, | ||
int | nPbH | ||
) |
Definition at line 752 of file cabac.c.
Referenced by hevc_luma_mv_mvp_mode().
int ff_hevc_ref_idx_lx_decode | ( | HEVCLocalContext * | lc, |
int | num_ref_idx_lx | ||
) |
Definition at line 762 of file cabac.c.
Referenced by hevc_luma_mv_mvp_mode().
int ff_hevc_mvp_lx_flag_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 778 of file cabac.c.
Referenced by hevc_luma_mv_mvp_mode().
int ff_hevc_no_residual_syntax_flag_decode | ( | HEVCLocalContext * | lc | ) |
Definition at line 783 of file cabac.c.
Referenced by hls_coding_unit().
int ff_hevc_split_transform_flag_decode | ( | HEVCLocalContext * | lc, |
int | log2_trafo_size | ||
) |
Definition at line 821 of file cabac.c.
Referenced by hls_transform_tree().
int ff_hevc_cbf_cb_cr_decode | ( | HEVCLocalContext * | lc, |
int | trafo_depth | ||
) |
Definition at line 826 of file cabac.c.
Referenced by hls_transform_tree().
int ff_hevc_cbf_luma_decode | ( | HEVCLocalContext * | lc, |
int | trafo_depth | ||
) |
Definition at line 831 of file cabac.c.
Referenced by hls_transform_tree().
int ff_hevc_log2_res_scale_abs | ( | HEVCLocalContext * | lc, |
int | idx | ||
) |
Definition at line 851 of file cabac.c.
Referenced by hls_cross_component_pred().
int ff_hevc_res_scale_sign_flag | ( | HEVCLocalContext * | lc, |
int | idx | ||
) |
Definition at line 861 of file cabac.c.
Referenced by hls_cross_component_pred().
int ff_hevc_frame_nb_refs | ( | const SliceHeader * | sh, |
const HEVCPPS * | pps, | ||
unsigned | layer_idx | ||
) |
Get the number of candidate references for the current frame.
Definition at line 559 of file refs.c.
Referenced by hls_slice_header(), nvdec_hevc_start_frame(), and vdpau_hevc_start_frame().
int ff_hevc_set_new_ref | ( | HEVCContext * | s, |
HEVCLayerContext * | l, | ||
int | poc | ||
) |
Definition at line 175 of file refs.c.
Referenced by hevc_frame_start().
|
static |
Definition at line 647 of file hevcdec.h.
Referenced by decode_nal_units(), and ff_hevc_hls_filter().
int ff_hevc_output_frames | ( | HEVCContext * | s, |
unsigned | layers_active_decode, | ||
unsigned | layers_active_output, | ||
unsigned | max_output, | ||
unsigned | max_dpb, | ||
int | discard | ||
) |
Find frames in the DPB that are ready for output and either write them to the output FIFO or drop their output flag, depending on the value of discard.
max_output | maximum number of AUs with an output-pending frame in at least one layer that can be present in the DPB before output is triggered |
max_dpb | maximum number of any frames that can be present in the DPB for any layer before output is triggered |
Definition at line 226 of file refs.c.
Referenced by hevc_frame_start(), and hevc_receive_frame().
void ff_hevc_unref_frame | ( | HEVCFrame * | frame, |
int | flags | ||
) |
Definition at line 34 of file refs.c.
Referenced by alloc_frame(), ff_hevc_clear_refs(), ff_hevc_flush_dpb(), ff_hevc_frame_rps(), ff_hevc_output_frames(), hevc_decode_free(), hevc_frame_start(), hevc_ref_frame(), and unref_missing_refs().
void ff_hevc_set_neighbour_available | ( | HEVCLocalContext * | lc, |
int | x0, | ||
int | y0, | ||
int | nPbW, | ||
int | nPbH, | ||
int | log2_ctb_size | ||
) |
Definition at line 43 of file mvs.c.
Referenced by ff_hevc_luma_mv_merge_mode(), hevc_luma_mv_mvp_mode(), and hls_transform_unit().
void ff_hevc_luma_mv_merge_mode | ( | HEVCLocalContext * | lc, |
const HEVCPPS * | pps, | ||
int | x0, | ||
int | y0, | ||
int | nPbW, | ||
int | nPbH, | ||
int | log2_cb_size, | ||
int | part_idx, | ||
int | merge_idx, | ||
MvField * | mv | ||
) |
Definition at line 482 of file mvs.c.
Referenced by hls_prediction_unit().
void ff_hevc_luma_mv_mvp_mode | ( | HEVCLocalContext * | lc, |
const HEVCPPS * | pps, | ||
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 at line 589 of file mvs.c.
Referenced by hevc_luma_mv_mvp_mode().
void ff_hevc_hls_filter | ( | HEVCLocalContext * | lc, |
const HEVCLayerContext * | l, | ||
const HEVCPPS * | pps, | ||
int | x, | ||
int | y, | ||
int | ctb_size | ||
) |
Definition at line 872 of file filter.c.
Referenced by ff_hevc_hls_filters(), hls_decode_entry(), and hls_decode_entry_wpp().
void ff_hevc_hls_filters | ( | HEVCLocalContext * | lc, |
const HEVCLayerContext * | l, | ||
const HEVCPPS * | pps, | ||
int | x_ctb, | ||
int | y_ctb, | ||
int | ctb_size | ||
) |
Definition at line 912 of file filter.c.
Referenced by hls_decode_entry(), and hls_decode_entry_wpp().
void ff_hevc_set_qPy | ( | HEVCLocalContext * | lc, |
const HEVCLayerContext * | l, | ||
const HEVCPPS * | pps, | ||
int | xBase, | ||
int | yBase, | ||
int | log2_cb_size | ||
) |
Definition at line 122 of file filter.c.
Referenced by hls_coding_unit(), and hls_transform_unit().
void ff_hevc_deblocking_boundary_strengths | ( | HEVCLocalContext * | lc, |
const HEVCLayerContext * | l, | ||
const HEVCPPS * | pps, | ||
int | x0, | ||
int | y0, | ||
int | log2_trafo_size | ||
) |
Definition at line 742 of file filter.c.
Referenced by hls_coding_unit(), hls_pcm_sample(), and hls_transform_tree().
int ff_hevc_cu_qp_delta_sign_flag | ( | HEVCLocalContext * | lc | ) |
Definition at line 613 of file cabac.c.
Referenced by hls_transform_unit().
int ff_hevc_cu_qp_delta_abs | ( | HEVCLocalContext * | lc | ) |
Definition at line 586 of file cabac.c.
Referenced by hls_transform_unit().
int ff_hevc_cu_chroma_qp_offset_flag | ( | HEVCLocalContext * | lc | ) |
Definition at line 618 of file cabac.c.
Referenced by hls_transform_unit().
int ff_hevc_cu_chroma_qp_offset_idx | ( | HEVCLocalContext * | lc, |
int | chroma_qp_offset_list_len_minus1 | ||
) |
Definition at line 623 of file cabac.c.
Referenced by hls_transform_unit().
void ff_hevc_hls_residual_coding | ( | HEVCLocalContext * | lc, |
const HEVCPPS * | pps, | ||
int | x0, | ||
int | y0, | ||
int | log2_trafo_size, | ||
enum ScanType | scan_idx, | ||
int | c_idx | ||
) |
Definition at line 981 of file cabac.c.
Referenced by hls_transform_unit().
void ff_hevc_hls_mvd_coding | ( | HEVCLocalContext * | lc, |
int | x0, | ||
int | y0, | ||
int | log2_cb_size | ||
) |
Definition at line 1493 of file cabac.c.
Referenced by hevc_luma_mv_mvp_mode().
const uint8_t ff_hevc_qpel_extra_before[4] |
const uint8_t ff_hevc_qpel_extra_after[4] |
const uint8_t ff_hevc_qpel_extra[4] |