37 frame->
flags &= ~flags;
173 int min_poc = INT_MAX;
181 if (frame->
poc < min_poc) {
182 min_poc = frame->
poc;
208 for (i = 0; i < 3; i++) {
216 "Output frame with POC %d.\n", frame->
poc);
239 for (i = ctb_addr_ts; i < ctb_count; i++)
265 for (list_idx = 0; list_idx < nb_list; list_idx++) {
291 for (i = 0; i < sh->
nb_refs[list_idx]; i++) {
300 rpl->
ref[i] = rpl_tmp.
ref[idx];
305 memcpy(rpl, &rpl_tmp,
sizeof(*rpl));
325 if ((ref->
poc & LtMask) == poc)
333 if (ref->
poc == poc || (ref->
poc & LtMask) == poc)
339 "Could not find ref with POC %d\n", poc);
360 for (i = 0; frame->
frame->
buf[i]; i++)
384 int poc,
int ref_flag)
435 if (!short_rps->
used[i])
437 else if (i < short_rps->num_negative_pics)
448 for (i = 0; i < long_rps->
nb_refs; i++) {
449 int poc = long_rps->
poc[i];
468 int prev_poc_lsb = s->
pocTid0 % max_poc_lsb;
469 int prev_poc_msb = s->
pocTid0 - prev_poc_lsb;
472 if (poc_lsb < prev_poc_lsb && prev_poc_lsb - poc_lsb >= max_poc_lsb / 2)
473 poc_msb = prev_poc_msb + max_poc_lsb;
474 else if (poc_lsb > prev_poc_lsb && poc_lsb - prev_poc_lsb > max_poc_lsb / 2)
475 poc_msb = prev_poc_msb - max_poc_lsb;
477 poc_msb = prev_poc_msb;
485 return poc_msb + poc_lsb;
497 ret += !!rps->
used[i];
499 ret += !!rps->
used[i];
503 for (i = 0; i < long_rps->
nb_refs; i++)
504 ret += !!long_rps->
used[i];
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc)
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
void * hwaccel_picture_private
void ff_hevc_flush_dpb(HEVCContext *s)
Drop all frames currently in DPB.
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
int ff_hevc_frame_rps(HEVCContext *s)
Construct the reference picture sets for the current frame.
#define FF_ARRAY_ELEMS(a)
static HEVCFrame * find_ref_idx(HEVCContext *s, int poc)
struct HEVCFrame * ref[MAX_REFS]
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
uint16_t seq_decode
Sequence counters for decoded and output frames, so that old frames are output first after a POC rese...
static HEVCFrame * alloc_frame(HEVCContext *s)
AVBufferPool * rpl_tab_pool
candidate references for the current frame
struct AVHWAccel * hwaccel
Hardware accelerator in use.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags)
unsigned int num_negative_pics
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Multithreading support functions.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
int ff_hevc_slice_rpl(HEVCContext *s)
Construct the reference picture list(s) for the current slice.
#define HEVC_FRAME_FLAG_LONG_REF
int slice_idx
number of the slice being currently decoded
static void mark_ref(HEVCFrame *frame, int flag)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned int log2_max_poc_lsb
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
Wrapper around release_buffer() frame-for multithreaded codecs.
AVBufferRef * rpl_tab_buf
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
unsigned int log2_ctb_size
simple assert() macros that are a bit more flexible than ISO C assert().
uint16_t sequence
A sequence counter, so that old frames are output first after a POC reset.
int ff_hevc_compute_poc(HEVCContext *s, int poc_lsb)
Compute POC of the current frame and return it.
AVBufferRef * tab_mvf_buf
int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
Find next frame in output order and put a reference to it in frame.
#define HEVC_FRAME_FLAG_SHORT_REF
void ff_thread_report_progress(ThreadFrame *f, int n, int field)
Notify later decoding threads when part of their reference picture is ready.
struct HEVCFrame * collocated_ref
static int add_candidate_ref(HEVCContext *s, RefPicList *list, int poc, int ref_flag)
static int init_slice_rpl(HEVCContext *s)
static HEVCFrame * generate_missing_ref(HEVCContext *s, int poc)
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
#define HEVC_FRAME_FLAG_OUTPUT
void ff_hevc_clear_refs(HEVCContext *s)
Mark all frames in DPB as unused for reference.
int * ctb_addr_rs_to_ts
CtbAddrRSToTS.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
AVBufferRef * hwaccel_priv_buf
uint8_t * data
The data buffer.
AVBufferRef * av_buffer_allocz(int size)
Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.
#define AVERROR_BUG
Bug detected, please report the issue.
enum NALUnitType nal_unit_type
uint8_t flags
A combination of HEVC_FRAME_FLAG_*.
int size
Size of data in bytes.
RefPicList * ff_hevc_get_ref_list(HEVCContext *s, HEVCFrame *ref, int x0, int y0)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
static av_cold void flush(AVCodecContext *avctx)
Flush (reset) the frame ID after seeking.
AVBufferPool * tab_mvf_pool
int frame_priv_data_size
Size of per-frame hardware accelerator private data.
int ff_hevc_frame_nb_refs(HEVCContext *s)
Get the number of candidate references for the current frame.
struct HEVCSPS::@21 temporal_layer[MAX_SUB_LAYERS]
AVBufferRef * av_buffer_pool_get(AVBufferPool *pool)
Allocate a new AVBuffer, reusing an old buffer from the pool when available.
int depth
Number of bits in the component.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.