Go to the documentation of this file.
48 frame->nb_rpl_elems = 0;
59 int x_cb = x0 >>
sps->log2_ctb_size;
60 int y_cb = y0 >>
sps->log2_ctb_size;
61 int pic_width_cb =
sps->ctb_width;
62 int ctb_addr_ts =
ref->pps->ctb_addr_rs_to_ts[y_cb * pic_width_cb + x_cb];
63 return &
ref->rpl_tab[ctb_addr_ts]->refPicList[0];
87 uintptr_t
data = (uintptr_t)
alpha->data[0];
92 uintptr_t buf_begin = (uintptr_t)buf->
data;
94 if (
data >= buf_begin && data < buf_begin + buf->
size) {
112 const int view_id =
vps->view_id[
s->cur_layer];
124 if (
s->sei.common.lcevc.info) {
136 &
frame->f->nb_side_data,
141 *(
int*)sd->
data = view_id;
168 frame->nb_rpl_elems =
s->pkt.nb_nals;
178 for (j = 0; j <
frame->ctb_count; j++)
232 s->collocated_ref =
NULL;
234 ref->base_layer_frame = (l != &
s->layers[0] &&
s->layers[0].cur_frame) ?
235 s->layers[0].cur_frame -
s->layers[0].DPB : -1;
237 no_output = !
IS_IRAP(
s) && (
s->poc <
s->recovery_poc) &&
240 if (
s->sh.pic_output_flag && !no_output)
265 unsigned layers_active_decode,
unsigned layers_active_output,
266 unsigned max_output,
unsigned max_dpb,
int discard)
271 int min_poc = INT_MAX;
273 int min_idx,
ret = 0;
278 if (!(layers_active_decode & (1 << layer)))
286 if (!(
frame->base_layer_frame >= 0 &&
289 if (min_layer < 0 || frame->poc < min_poc) {
290 min_poc =
frame->poc;
295 nb_dpb[layer] += !!
frame->flags;
299 if (nb_output > max_output ||
301 (nb_dpb[0] > max_dpb || nb_dpb[1] > max_dpb))) {
304 int output = !discard && (layers_active_output & (1 << min_layer));
309 f->pkt_dts =
s->pkt_dts;
317 output ?
"Output" :
"Discarded", min_layer,
frame->poc);
327 int ctb_count =
frame->ctb_count;
328 int ctb_addr_ts =
s->pps->ctb_addr_rs_to_ts[
s->sh.slice_segment_addr];
331 if (
s->slice_idx >=
frame->nb_rpl_elems)
334 for (
i = ctb_addr_ts;
i < ctb_count;
i++)
357 !
s->pps->pps_curr_pic_ref_enabled_flag) {
362 for (list_idx = 0; list_idx < nb_list; list_idx++) {
364 RefPicList *rpl = &
s->cur_frame->refPicList[list_idx];
411 rpl->
ref[
i] = rpl_tmp.
ref[idx];
416 memcpy(rpl, &rpl_tmp,
sizeof(*rpl));
421 if (
s->pps->pps_curr_pic_ref_enabled_flag &&
437 int poc, uint8_t use_msb)
445 if ((
ref->poc &
mask) == poc && (use_msb ||
ref->poc !=
s->poc))
452 "Could not find ref with POC %d\n", poc);
471 if (!
s->avctx->hwaccel) {
498 int poc,
int ref_flag, uint8_t use_msb)
510 if (ref_corrupt && !recovering) {
546 if (
frame ==
s->cur_frame)
563 if (!(short_rps->
used & (1 <<
i)))
565 else if (i < short_rps->num_negative_pics)
578 int poc = long_rps->
poc[
i];
589 if (
s->sh.inter_layer_pred) {
634 av_assert0(
pps->sps->vps->num_direct_ref_layers[layer_idx] < 2);
638 if (
pps->pps_curr_pic_ref_enabled_flag)
void ff_progress_frame_report(ProgressFrame *f, int n)
Notify later decoding threads when part of their reference frame is ready.
void ff_hevc_flush_dpb(HEVCContext *s)
Drop all frames currently in DPB.
@ AV_CONTAINER_FIFO_FLAG_REF
Signal to av_container_fifo_write() that it should make a new reference to data in src rather than co...
@ AV_STEREO3D_VIEW_LEFT
Frame contains only the left view.
int av_container_fifo_write(AVContainerFifo *cf, void *obj, unsigned flags)
Write the contents of obj to the FIFO.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
unsigned int bottom_offset
uint8_t num_negative_pics
#define HEVC_VPS_MAX_LAYERS
uint8_t * data
The data buffer.
#define HEVC_IS_RECOVERING(s)
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
This structure describes decoded (raw) audio or video data.
int ff_progress_frame_get_buffer(AVCodecContext *avctx, ProgressFrame *f, int flags)
This function sets up the ProgressFrame, i.e.
int ff_hevc_frame_rps(HEVCContext *s, HEVCLayerContext *l)
Construct the reference picture sets for the current frame.
@ AV_STEREO3D_VIEW_RIGHT
Frame contains only the right view.
@ AV_STEREO3D_VIEW_UNSPEC
Content is unspecified.
#define AV_FRAME_FLAG_TOP_FIELD_FIRST
A flag to mark frames where the top field is displayed first if the content is interlaced.
static HEVCFrame * find_ref_idx(HEVCContext *s, HEVCLayerContext *l, int poc, uint8_t use_msb)
#define AV_CODEC_FLAG_OUTPUT_CORRUPT
Output even those frames that might be corrupted.
#define HEVC_FRAME_FLAG_LONG_REF
static void mark_ref(HEVCFrame *frame, int flag)
unsigned int log2_max_poc_lsb
int ff_frame_new_side_data_from_buf(const AVCodecContext *avctx, AVFrame *frame, enum AVFrameSideDataType type, AVBufferRef **buf)
Similar to ff_frame_new_side_data, but using an existing buffer ref.
static void * av_refstruct_allocz(size_t size)
Equivalent to av_refstruct_alloc_ext(size, 0, NULL, NULL)
@ AV_STEREO3D_FRAMESEQUENCE
Views are alternated temporally.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void unref_missing_refs(HEVCLayerContext *l)
#define FF_ARRAY_ELEMS(a)
int ff_hevc_is_alpha_video(const HEVCContext *s)
void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
Overlapping memcpy() implementation.
int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private)
Allocate a hwaccel frame private data if the provided avctx uses a hwaccel method that needs it.
#define AV_CEIL_RSHIFT(a, b)
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void ff_progress_frame_unref(ProgressFrame *f)
Give up a reference to the underlying frame contained in a ProgressFrame and reset the ProgressFrame,...
#define HEVC_FRAME_FLAG_SHORT_REF
int ff_hevc_slice_rpl(HEVCContext *s)
Construct the reference picture list(s) for the current slice.
struct HEVCFrame * ref[HEVC_MAX_REFS]
struct AVRefStructPool * tab_mvf_pool
@ AV_PICTURE_STRUCTURE_BOTTOM_FIELD
coded as bottom field
@ AV_PICTURE_STRUCTURE_TOP_FIELD
coded as top field
static HEVCFrame * generate_missing_ref(HEVCContext *s, HEVCLayerContext *l, int poc)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining list
uint8_t poc_msb_present[32]
void * av_refstruct_pool_get(AVRefStructPool *pool)
Get an object from the pool, reusing an old one from the pool when available.
static int FUNC() vps(CodedBitstreamContext *ctx, RWContext *rw, H265RawVPS *current)
AVBufferRef * av_frame_get_plane_buffer(const AVFrame *frame, int plane)
Get the buffer reference a given data plane is stored in.
int ff_hevc_set_new_ref(HEVCContext *s, HEVCLayerContext *l, int poc)
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 the...
void ff_hevc_unref_frame(HEVCFrame *frame, int flags)
static int add_candidate_ref(HEVCContext *s, HEVCLayerContext *l, RefPicList *list, int poc, int ref_flag, uint8_t use_msb)
const HEVCVPS * vps
RefStruct reference.
int ff_progress_frame_alloc(AVCodecContext *avctx, ProgressFrame *f)
This function allocates ProgressFrame.f May be called before ff_progress_frame_get_buffer() in the ca...
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
uint16_t right_view_id[32]
uint16_t left_view_id[32]
@ AV_FRAME_DATA_LCEVC
Raw LCEVC payload data, as a uint8_t array, with NAL emulation bytes intact.
static int replace_alpha_plane(AVFrame *alpha, AVFrame *base)
void ff_hevc_clear_refs(HEVCLayerContext *l)
Mark all frames in DPB as unused for reference.
#define HEVC_FRAME_FLAG_OUTPUT
#define HEVC_FRAME_FLAG_CORRUPT
#define HEVC_FRAME_FLAG_UNAVAILABLE
@ AV_FRAME_DATA_VIEW_ID
This side data must be associated with a video frame.
#define FF_THREAD_FRAME
Decode more than one frame at once.
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
#define i(width, name, range_min, range_max)
#define AV_CODEC_FLAG2_SHOW_ALL
Show all frames before the first keyframe.
#define AV_FRAME_FLAG_CORRUPT
The frame data may be corrupted, e.g.
static int init_slice_rpl(HEVCContext *s)
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
int av_buffer_replace(AVBufferRef **pdst, const AVBufferRef *src)
Ensure dst refers to the same data as src.
#define AV_FRAME_FLAG_INTERLACED
A flag to mark frames whose content is interlaced.
const RefPicList * ff_hevc_get_ref_list(const HEVCFrame *ref, int x0, int y0)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
enum AVStereo3DType type
How views are packed within the video.
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
const void * av_refstruct_ref_c(const void *obj)
Analog of av_refstruct_ref(), but for constant objects.
AVFrameSideData * av_frame_side_data_new(AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type, size_t size, unsigned int flags)
Add new side data entry to an array.
static int ref[MAX_W *MAX_W]
unsigned int right_offset
static HEVCFrame * alloc_frame(HEVCContext *s, HEVCLayerContext *l)
A reference to a data buffer.
AVStereo3D * av_stereo3d_create_side_data(AVFrame *frame)
Allocate a complete AVFrameSideData and add it to the frame.
Structure to hold side data for an AVFrame.
enum AVStereo3DView view
Determines which views are packed.
static const int16_t alpha[]
#define flags(name, subs,...)
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Stereo 3D type: this structure describes how two videos are packed within a single video surface,...
struct AVRefStructPool * rpl_tab_pool
int isLongTerm[HEVC_MAX_REFS]
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.