FFmpeg
4.0
|
#include <stdatomic.h>
#include "libavutil/buffer.h"
#include "libavutil/md5.h"
#include "avcodec.h"
#include "bswapdsp.h"
#include "cabac.h"
#include "get_bits.h"
#include "hevcpred.h"
#include "h2645_parse.h"
#include "hevc.h"
#include "hevc_ps.h"
#include "hevc_sei.h"
#include "hevcdsp.h"
#include "internal.h"
#include "thread.h"
#include "videodsp.h"
Go to the source code of this file.
Data Structures | |
struct | RefPicList |
struct | RefPicListTab |
struct | CodingUnit |
struct | Mv |
struct | MvField |
struct | NeighbourAvailable |
struct | PredictionUnit |
struct | TransformUnit |
struct | DBParams |
struct | HEVCFrame |
struct | HEVCLocalContext |
struct | HEVCContext |
Macros | |
#define | MAX_NB_THREADS 16 |
#define | SHIFT_CTB_WPP 2 |
#define | MAX_TRANSFORM_DEPTH 5 |
#define | MAX_TB_SIZE 32 |
#define | MAX_QP 51 |
#define | DEFAULT_INTRA_TC_OFFSET 2 |
#define | HEVC_CONTEXTS 199 |
#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 >= 16 && (s)->nal_unit_type <= 23) |
#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_BUMPING (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 SHIFT_CTB_WPP 2 |
Definition at line 46 of file hevcdec.h.
Referenced by hls_decode_entry_wpp().
#define MAX_TB_SIZE 32 |
Definition at line 51 of file hevcdec.h.
Referenced by intra_pred(), and pred_angular().
#define MAX_QP 51 |
Definition at line 52 of file hevcdec.h.
Referenced by deblocking_filter_CTB().
#define DEFAULT_INTRA_TC_OFFSET 2 |
Definition at line 53 of file hevcdec.h.
Referenced by chroma_tc().
#define HEVC_CONTEXTS 199 |
Definition at line 55 of file hevcdec.h.
Referenced by cabac_init_state(), ff_hevc_save_states(), hevc_init_context(), and load_states().
#define MRG_MAX_NUM_CANDS 5 |
Definition at line 57 of file hevcdec.h.
Referenced by ff_hevc_luma_mv_merge_mode().
#define L0 0 |
Definition at line 59 of file hevcdec.h.
Referenced by fill_pred_weight_table(), hevc_luma_mv_mvp_mode(), hls_slice_header(), pred_weight_table(), and vaapi_hevc_decode_slice().
#define L1 1 |
Definition at line 60 of file hevcdec.h.
Referenced by derive_temporal_colocated_mvs(), fill_pred_weight_table(), hevc_luma_mv_mvp_mode(), hls_slice_header(), pred_weight_table(), and vaapi_hevc_decode_slice().
#define EPEL_EXTRA_BEFORE 1 |
Definition at line 62 of file hevcdec.h.
Referenced by chroma_mc_bi(), chroma_mc_uni(), put_hevc_epel_bi_hv(), put_hevc_epel_bi_w_hv(), put_hevc_epel_hv(), put_hevc_epel_uni_hv(), and put_hevc_epel_uni_w_hv().
#define EPEL_EXTRA_AFTER 2 |
Definition at line 63 of file hevcdec.h.
Referenced by chroma_mc_bi(), and chroma_mc_uni().
#define EPEL_EXTRA 3 |
Definition at line 64 of file hevcdec.h.
Referenced by chroma_mc_bi(), chroma_mc_uni(), put_hevc_epel_bi_hv(), put_hevc_epel_bi_w_hv(), put_hevc_epel_hv(), put_hevc_epel_uni_hv(), and put_hevc_epel_uni_w_hv().
#define QPEL_EXTRA_BEFORE 3 |
Definition at line 65 of file hevcdec.h.
Referenced by luma_mc_bi(), luma_mc_uni(), put_hevc_qpel_bi_hv(), put_hevc_qpel_bi_w_hv(), put_hevc_qpel_hv(), put_hevc_qpel_uni_hv(), and put_hevc_qpel_uni_w_hv().
#define QPEL_EXTRA_AFTER 4 |
Definition at line 66 of file hevcdec.h.
Referenced by luma_mc_bi(), and luma_mc_uni().
#define QPEL_EXTRA 7 |
Definition at line 67 of file hevcdec.h.
Referenced by luma_mc_bi(), luma_mc_uni(), put_hevc_qpel_bi_hv(), put_hevc_qpel_bi_w_hv(), put_hevc_qpel_hv(), put_hevc_qpel_uni_hv(), and put_hevc_qpel_uni_w_hv().
#define EDGE_EMU_BUFFER_STRIDE 80 |
Definition at line 69 of file hevcdec.h.
Referenced by chroma_mc_bi(), chroma_mc_uni(), luma_mc_bi(), and luma_mc_uni().
Definition at line 75 of file hevcdec.h.
Referenced by ff_hevc_skip_flag_decode(), hls_coding_unit(), and hls_prediction_unit().
#define IS_IDR | ( | s | ) | ((s)->nal_unit_type == HEVC_NAL_IDR_W_RADL || (s)->nal_unit_type == HEVC_NAL_IDR_N_LP) |
Definition at line 77 of file hevcdec.h.
Referenced by decode_nal_unit(), ff_hevc_hls_filter(), fill_picture_parameters(), hevc_frame_start(), hls_slice_header(), nvdec_hevc_start_frame(), vaapi_hevc_start_frame(), and vdpau_hevc_start_frame().
#define IS_BLA | ( | s | ) |
Definition at line 78 of file hevcdec.h.
Referenced by decode_nal_unit(), find_ref_idx(), hevc_frame_start(), and hls_slice_header().
Definition at line 80 of file hevcdec.h.
Referenced by fill_picture_parameters(), hevc_frame_start(), hls_slice_header(), nvdec_hevc_start_frame(), set_side_data(), vaapi_hevc_start_frame(), and vdpau_hevc_start_frame().
#define HEVC_FRAME_FLAG_OUTPUT (1 << 0) |
Definition at line 306 of file hevcdec.h.
Referenced by ff_hevc_bump_frame(), ff_hevc_output_frame(), and ff_hevc_set_new_ref().
#define HEVC_FRAME_FLAG_SHORT_REF (1 << 1) |
Definition at line 307 of file hevcdec.h.
Referenced by ff_hevc_clear_refs(), ff_hevc_frame_rps(), ff_hevc_set_new_ref(), fill_picture_parameters(), fill_vaapi_reference_frames(), mark_ref(), nvdec_hevc_start_frame(), and vdpau_hevc_start_frame().
#define HEVC_FRAME_FLAG_LONG_REF (1 << 2) |
Definition at line 308 of file hevcdec.h.
Referenced by dpb_add(), ff_hevc_clear_refs(), ff_hevc_frame_rps(), fill_picture_parameters(), fill_vaapi_pic(), fill_vaapi_reference_frames(), mark_ref(), nvdec_hevc_start_frame(), and vdpau_hevc_start_frame().
#define HEVC_FRAME_FLAG_BUMPING (1 << 3) |
Definition at line 309 of file hevcdec.h.
Referenced by ff_hevc_bump_frame(), and ff_hevc_output_frame().
#define BOUNDARY_LEFT_SLICE (1 << 0) |
Definition at line 374 of file hevcdec.h.
Referenced by ff_hevc_deblocking_boundary_strengths(), and hls_decode_neighbour().
#define BOUNDARY_LEFT_TILE (1 << 1) |
Definition at line 375 of file hevcdec.h.
Referenced by ff_hevc_deblocking_boundary_strengths(), and hls_decode_neighbour().
#define BOUNDARY_UPPER_SLICE (1 << 2) |
Definition at line 376 of file hevcdec.h.
Referenced by ff_hevc_deblocking_boundary_strengths(), and hls_decode_neighbour().
#define BOUNDARY_UPPER_TILE (1 << 3) |
Definition at line 377 of file hevcdec.h.
Referenced by ff_hevc_deblocking_boundary_strengths(), and hls_decode_neighbour().
enum RPSType |
enum SyntaxElement |
enum PartMode |
enum InterPredIdc |
enum IntraPredMode |
enum SAOType |
enum SAOEOClass |
void ff_hevc_clear_refs | ( | HEVCContext * | s | ) |
Mark all frames in DPB as unused for reference.
Definition at line 66 of file hevc_refs.c.
Referenced by hls_slice_header().
void ff_hevc_flush_dpb | ( | HEVCContext * | s | ) |
Drop all frames currently in DPB.
Definition at line 75 of file hevc_refs.c.
Referenced by hevc_decode_flush().
RefPicList* ff_hevc_get_ref_list | ( | HEVCContext * | s, |
HEVCFrame * | frame, | ||
int | x0, | ||
int | y0 | ||
) |
Definition at line 57 of file hevc_refs.c.
Referenced by ff_hevc_deblocking_boundary_strengths().
int ff_hevc_frame_rps | ( | HEVCContext * | s | ) |
Construct the reference picture sets for the current frame.
Definition at line 454 of file hevc_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 294 of file hevc_refs.c.
Referenced by decode_nal_unit().
void ff_hevc_save_states | ( | HEVCContext * | s, |
int | ctb_addr_ts | ||
) |
Definition at line 450 of file hevc_cabac.c.
Referenced by hls_decode_entry(), and hls_decode_entry_wpp().
int ff_hevc_cabac_init | ( | HEVCContext * | s, |
int | ctb_addr_ts | ||
) |
Definition at line 504 of file hevc_cabac.c.
Referenced by hls_decode_entry(), and hls_decode_entry_wpp().
int ff_hevc_sao_merge_flag_decode | ( | HEVCContext * | s | ) |
Definition at line 561 of file hevc_cabac.c.
Referenced by hls_sao_param().
int ff_hevc_sao_type_idx_decode | ( | HEVCContext * | s | ) |
Definition at line 566 of file hevc_cabac.c.
Referenced by hls_sao_param().
int ff_hevc_sao_band_position_decode | ( | HEVCContext * | s | ) |
Definition at line 576 of file hevc_cabac.c.
Referenced by hls_sao_param().
int ff_hevc_sao_offset_abs_decode | ( | HEVCContext * | s | ) |
Definition at line 586 of file hevc_cabac.c.
Referenced by hls_sao_param().
int ff_hevc_sao_offset_sign_decode | ( | HEVCContext * | s | ) |
Definition at line 596 of file hevc_cabac.c.
Referenced by hls_sao_param().
int ff_hevc_sao_eo_class_decode | ( | HEVCContext * | s | ) |
Definition at line 601 of file hevc_cabac.c.
Referenced by hls_sao_param().
int ff_hevc_end_of_slice_flag_decode | ( | HEVCContext * | s | ) |
Definition at line 608 of file hevc_cabac.c.
Referenced by hls_coding_quadtree().
int ff_hevc_cu_transquant_bypass_flag_decode | ( | HEVCContext * | s | ) |
Definition at line 613 of file hevc_cabac.c.
Referenced by hls_coding_unit().
Definition at line 618 of file hevc_cabac.c.
Referenced by hls_coding_unit().
int ff_hevc_pred_mode_decode | ( | HEVCContext * | s | ) |
Definition at line 681 of file hevc_cabac.c.
Referenced by hls_coding_unit().
int ff_hevc_split_coding_unit_flag_decode | ( | HEVCContext * | s, |
int | ct_depth, | ||
int | x0, | ||
int | y0 | ||
) |
Definition at line 686 of file hevc_cabac.c.
Referenced by hls_coding_quadtree().
int ff_hevc_part_mode_decode | ( | HEVCContext * | s, |
int | log2_cb_size | ||
) |
Definition at line 705 of file hevc_cabac.c.
Referenced by hls_coding_unit().
int ff_hevc_pcm_flag_decode | ( | HEVCContext * | s | ) |
Definition at line 742 of file hevc_cabac.c.
Referenced by hls_coding_unit().
int ff_hevc_prev_intra_luma_pred_flag_decode | ( | HEVCContext * | s | ) |
Definition at line 747 of file hevc_cabac.c.
Referenced by intra_prediction_unit().
int ff_hevc_mpm_idx_decode | ( | HEVCContext * | s | ) |
Definition at line 752 of file hevc_cabac.c.
Referenced by intra_prediction_unit().
int ff_hevc_rem_intra_luma_pred_mode_decode | ( | HEVCContext * | s | ) |
Definition at line 760 of file hevc_cabac.c.
Referenced by intra_prediction_unit().
int ff_hevc_intra_chroma_pred_mode_decode | ( | HEVCContext * | s | ) |
Definition at line 770 of file hevc_cabac.c.
Referenced by intra_prediction_unit().
int ff_hevc_merge_idx_decode | ( | HEVCContext * | s | ) |
Definition at line 781 of file hevc_cabac.c.
Referenced by hls_prediction_unit().
int ff_hevc_merge_flag_decode | ( | HEVCContext * | s | ) |
Definition at line 792 of file hevc_cabac.c.
Referenced by hls_prediction_unit().
int ff_hevc_inter_pred_idc_decode | ( | HEVCContext * | s, |
int | nPbW, | ||
int | nPbH | ||
) |
Definition at line 797 of file hevc_cabac.c.
Referenced by hevc_luma_mv_mvp_mode().
int ff_hevc_ref_idx_lx_decode | ( | HEVCContext * | s, |
int | num_ref_idx_lx | ||
) |
Definition at line 807 of file hevc_cabac.c.
Referenced by hevc_luma_mv_mvp_mode().
int ff_hevc_mvp_lx_flag_decode | ( | HEVCContext * | s | ) |
Definition at line 823 of file hevc_cabac.c.
Referenced by hevc_luma_mv_mvp_mode().
int ff_hevc_no_residual_syntax_flag_decode | ( | HEVCContext * | s | ) |
Definition at line 828 of file hevc_cabac.c.
Referenced by hls_coding_unit().
int ff_hevc_split_transform_flag_decode | ( | HEVCContext * | s, |
int | log2_trafo_size | ||
) |
Definition at line 866 of file hevc_cabac.c.
Referenced by hls_transform_tree().
int ff_hevc_cbf_cb_cr_decode | ( | HEVCContext * | s, |
int | trafo_depth | ||
) |
Definition at line 871 of file hevc_cabac.c.
Referenced by hls_transform_tree().
int ff_hevc_cbf_luma_decode | ( | HEVCContext * | s, |
int | trafo_depth | ||
) |
Definition at line 876 of file hevc_cabac.c.
Referenced by hls_transform_tree().
int ff_hevc_log2_res_scale_abs | ( | HEVCContext * | s, |
int | idx | ||
) |
Definition at line 896 of file hevc_cabac.c.
Referenced by hls_cross_component_pred().
int ff_hevc_res_scale_sign_flag | ( | HEVCContext * | s, |
int | idx | ||
) |
Definition at line 905 of file hevc_cabac.c.
Referenced by hls_cross_component_pred().
int ff_hevc_frame_nb_refs | ( | HEVCContext * | s | ) |
Get the number of candidate references for the current frame.
Definition at line 514 of file hevc_refs.c.
Referenced by hls_slice_header(), and vdpau_hevc_start_frame().
int ff_hevc_set_new_ref | ( | HEVCContext * | s, |
AVFrame ** | frame, | ||
int | poc | ||
) |
Definition at line 135 of file hevc_refs.c.
Referenced by hevc_frame_start().
|
static |
Definition at line 551 of file hevcdec.h.
Referenced by decode_nal_units(), and ff_hevc_hls_filter().
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 at line 174 of file hevc_refs.c.
Referenced by ff_hevc_nal_is_nonref(), hevc_decode_frame(), and hevc_frame_start().
void ff_hevc_bump_frame | ( | HEVCContext * | s | ) |
Definition at line 236 of file hevc_refs.c.
Referenced by ff_hevc_nal_is_nonref(), and hevc_frame_start().
void ff_hevc_unref_frame | ( | HEVCContext * | s, |
HEVCFrame * | frame, | ||
int | flags | ||
) |
Definition at line 32 of file hevc_refs.c.
Referenced by alloc_frame(), ff_hevc_clear_refs(), ff_hevc_flush_dpb(), ff_hevc_frame_rps(), ff_hevc_nal_is_nonref(), ff_hevc_output_frame(), hevc_decode_frame(), hevc_decode_free(), hevc_frame_start(), hevc_ref_frame(), and hevc_update_thread_context().
Definition at line 42 of file hevc_mvs.c.
Referenced by ff_hevc_luma_mv_merge_mode(), ff_hevc_nal_is_nonref(), hevc_luma_mv_mvp_mode(), and hls_transform_unit().
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 at line 479 of file hevc_mvs.c.
Referenced by ff_hevc_nal_is_nonref(), and hls_prediction_unit().
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 at line 582 of file hevc_mvs.c.
Referenced by ff_hevc_nal_is_nonref(), and hevc_luma_mv_mvp_mode().
void ff_hevc_set_qPy | ( | HEVCContext * | s, |
int | xBase, | ||
int | yBase, | ||
int | log2_cb_size | ||
) |
Definition at line 121 of file hevc_filter.c.
Referenced by ff_hevc_nal_is_nonref(), hls_coding_unit(), and hls_transform_unit().
void ff_hevc_deblocking_boundary_strengths | ( | HEVCContext * | s, |
int | x0, | ||
int | y0, | ||
int | log2_trafo_size | ||
) |
Definition at line 714 of file hevc_filter.c.
Referenced by ff_hevc_nal_is_nonref(), hls_coding_unit(), hls_pcm_sample(), and hls_transform_tree().
int ff_hevc_cu_qp_delta_sign_flag | ( | HEVCContext * | s | ) |
Definition at line 660 of file hevc_cabac.c.
Referenced by ff_hevc_nal_is_nonref(), and hls_transform_unit().
int ff_hevc_cu_qp_delta_abs | ( | HEVCContext * | s | ) |
Definition at line 633 of file hevc_cabac.c.
Referenced by ff_hevc_nal_is_nonref(), and hls_transform_unit().
int ff_hevc_cu_chroma_qp_offset_flag | ( | HEVCContext * | s | ) |
Definition at line 665 of file hevc_cabac.c.
Referenced by ff_hevc_nal_is_nonref(), and hls_transform_unit().
int ff_hevc_cu_chroma_qp_offset_idx | ( | HEVCContext * | s | ) |
Definition at line 670 of file hevc_cabac.c.
Referenced by ff_hevc_nal_is_nonref(), and hls_transform_unit().
void ff_hevc_hls_filter | ( | HEVCContext * | s, |
int | x, | ||
int | y, | ||
int | ctb_size | ||
) |
Definition at line 842 of file hevc_filter.c.
Referenced by ff_hevc_hls_filters(), ff_hevc_nal_is_nonref(), hls_decode_entry(), and hls_decode_entry_wpp().
void ff_hevc_hls_filters | ( | HEVCContext * | s, |
int | x_ctb, | ||
int | y_ctb, | ||
int | ctb_size | ||
) |
Definition at line 878 of file hevc_filter.c.
Referenced by ff_hevc_nal_is_nonref(), hls_decode_entry(), and hls_decode_entry_wpp().
void ff_hevc_hls_residual_coding | ( | HEVCContext * | s, |
int | x0, | ||
int | y0, | ||
int | log2_trafo_size, | ||
enum ScanType | scan_idx, | ||
int | c_idx | ||
) |
Definition at line 1024 of file hevc_cabac.c.
Referenced by ff_hevc_nal_is_nonref(), and hls_transform_unit().
void ff_hevc_hls_mvd_coding | ( | HEVCContext * | s, |
int | x0, | ||
int | y0, | ||
int | log2_cb_size | ||
) |
Definition at line 1534 of file hevc_cabac.c.
Referenced by ff_hevc_nal_is_nonref(), and hevc_luma_mv_mvp_mode().
const uint8_t ff_hevc_qpel_extra_before[4] |
Referenced by ff_hevc_nal_is_nonref().
const uint8_t ff_hevc_qpel_extra_after[4] |
Referenced by ff_hevc_nal_is_nonref().
const uint8_t ff_hevc_qpel_extra[4] |
Referenced by ff_hevc_nal_is_nonref().