Go to the documentation of this file.
46 frame->nb_rpl_elems = 0;
57 int x_cb = x0 >>
sps->log2_ctb_size;
58 int y_cb = y0 >>
sps->log2_ctb_size;
59 int pic_width_cb =
sps->ctb_width;
60 int ctb_addr_ts =
ref->pps->ctb_addr_rs_to_ts[y_cb * pic_width_cb + x_cb];
61 return &
ref->rpl_tab[ctb_addr_ts]->refPicList[0];
85 const int view_id =
vps->view_id[
s->cur_layer];
97 if (
s->sei.common.lcevc.info) {
106 if (
vps->nb_layers > 1 || view_id) {
109 &
frame->f->nb_side_data,
114 *(
int*)sd->
data = view_id;
141 frame->nb_rpl_elems =
s->pkt.nb_nals;
151 for (j = 0; j <
frame->ctb_count; j++)
197 s->collocated_ref =
NULL;
199 ref->base_layer_frame = (l != &
s->layers[0] &&
s->layers[0].cur_frame) ?
200 s->layers[0].cur_frame -
s->layers[0].DPB : -1;
202 if (
s->sh.pic_output_flag)
227 unsigned layers_active_decode,
unsigned layers_active_output,
228 unsigned max_output,
unsigned max_dpb,
int discard)
233 int min_poc = INT_MAX;
235 int min_idx,
ret = 0;
240 if (!(layers_active_decode & (1 << layer)))
248 if (!(
frame->base_layer_frame >= 0 &&
251 if (min_layer < 0 || frame->poc < min_poc) {
252 min_poc =
frame->poc;
257 nb_dpb[layer] += !!
frame->flags;
261 if (nb_output > max_output ||
263 (nb_dpb[0] > max_dpb || nb_dpb[1] > max_dpb))) {
266 int output = !discard && (layers_active_output & (1 << min_layer));
269 f->pkt_dts =
s->pkt_dts;
277 output ?
"Output" :
"Discarded", min_layer,
frame->poc);
287 int ctb_count =
frame->ctb_count;
288 int ctb_addr_ts =
s->pps->ctb_addr_rs_to_ts[
s->sh.slice_segment_addr];
291 if (
s->slice_idx >=
frame->nb_rpl_elems)
294 for (
i = ctb_addr_ts;
i < ctb_count;
i++)
317 !
s->pps->pps_curr_pic_ref_enabled_flag) {
322 for (list_idx = 0; list_idx < nb_list; list_idx++) {
324 RefPicList *rpl = &
s->cur_frame->refPicList[list_idx];
371 rpl->
ref[
i] = rpl_tmp.
ref[idx];
376 memcpy(rpl, &rpl_tmp,
sizeof(*rpl));
381 if (
s->pps->pps_curr_pic_ref_enabled_flag &&
397 int poc, uint8_t use_msb)
405 if ((
ref->poc &
mask) == poc && (use_msb ||
ref->poc !=
s->poc))
412 "Could not find ref with POC %d\n", poc);
431 if (!
s->avctx->hwaccel) {
458 int poc,
int ref_flag, uint8_t use_msb)
492 if (
frame ==
s->cur_frame)
509 if (!(short_rps->
used & (1 <<
i)))
511 else if (i < short_rps->num_negative_pics)
524 int poc = long_rps->
poc[
i];
535 if (
s->sh.inter_layer_pred) {
580 av_assert0(
pps->sps->vps->num_direct_ref_layers[layer_idx] < 2);
584 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.
int ff_container_fifo_write(ContainerFifo *cf, void *obj)
Write the contents of obj to the FIFO.
@ AV_STEREO3D_VIEW_LEFT
Frame contains only the left view.
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
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 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.
@ AV_STEREO3D_FRAMESEQUENCE
Views are alternated temporally.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
struct FFRefStructPool * rpl_tab_pool
static void unref_missing_refs(HEVCLayerContext *l)
#define FF_ARRAY_ELEMS(a)
const void * ff_refstruct_ref_c(const void *obj)
Analog of ff_refstruct_ref(), but for constant objects.
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 FFRefStructPool * 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]
static void * ff_refstruct_allocz(size_t size)
Equivalent to ff_refstruct_alloc_ext(size, 0, NULL, NULL)
static int FUNC() vps(CodedBitstreamContext *ctx, RWContext *rw, H265RawVPS *current)
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.
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_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.
#define i(width, name, range_min, range_max)
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.
#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)
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)
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.
#define flags(name, subs,...)
#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,...
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.
void ff_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
void * ff_refstruct_pool_get(FFRefStructPool *pool)
Get an object from the pool, reusing an old one from the pool when available.