43#include "config_components.h"
60#define TL_ADD(t, s) do { \
61 av_assert0(l->nb_tabs < TAB_MAX); \
62 l->tabs[l->nb_tabs].tab = (void**)&fc->tab.t; \
63 l->tabs[l->nb_tabs].size = sizeof(*fc->tab.t) * (s); \
114 const int ctu_size =
sps ? (1 <<
sps->ctb_log2_size_y <<
sps->ctb_log2_size_y) : 0;
115 const int ctu_count =
pps ?
pps->ctb_count : 0;
116 const int changed =
fc->tab.sz.ctu_count != ctu_count ||
fc->tab.sz.ctu_size != ctu_size;
125 TL_ADD(slice_idx, ctu_count);
132 const int pic_size_in_min_cb =
pps ?
pps->min_cb_width *
pps->min_cb_height : 0;
133 const int changed =
fc->tab.sz.pic_size_in_min_cb != pic_size_in_min_cb;
140 TL_ADD(cb_width[
i], pic_size_in_min_cb);
146 const int pic_size_in_min_cb =
pps ?
pps->min_cb_width *
pps->min_cb_height : 0;
147 const int changed =
fc->tab.sz.pic_size_in_min_cb != pic_size_in_min_cb;
152 TL_ADD(ipm, pic_size_in_min_cb);
155 TL_ADD(cqt_depth[
i], pic_size_in_min_cb);
156 TL_ADD(cb_pos_x[
i], pic_size_in_min_cb);
157 TL_ADD(cb_pos_y[
i], pic_size_in_min_cb);
158 TL_ADD(cb_height[
i], pic_size_in_min_cb);
160 TL_ADD(cpm[
i], pic_size_in_min_cb);
161 TL_ADD(pcmf[
i], pic_size_in_min_cb);
170 const int pic_size_in_min_pu =
pps ?
pps->min_pu_width *
pps->min_pu_height : 0;
171 const int changed =
fc->tab.sz.pic_size_in_min_pu != pic_size_in_min_pu;
175 TL_ADD(iaf, pic_size_in_min_pu);
181 const int pic_size_in_min_pu =
pps ?
pps->min_pu_width *
pps->min_pu_height : 0;
182 const int changed =
fc->tab.sz.pic_size_in_min_pu != pic_size_in_min_pu;
186 TL_ADD(msf, pic_size_in_min_pu);
187 TL_ADD(mmi, pic_size_in_min_pu);
188 TL_ADD(mvf, pic_size_in_min_pu);
194 const int pic_size_in_min_tu =
pps ?
pps->min_tu_width *
pps->min_tu_height : 0;
195 const int changed =
fc->tab.sz.pic_size_in_min_tu != pic_size_in_min_tu;
199 TL_ADD(tu_joint_cbcr_residual_flag, pic_size_in_min_tu);
202 TL_ADD(tu_coded_flag[
i], pic_size_in_min_tu);
204 for (
int vertical = 0; vertical < 2; vertical++)
205 TL_ADD(bs[vertical][
i], pic_size_in_min_tu);
212 const int pic_size_in_min_tu =
pps ?
pps->min_tu_width *
pps->min_tu_height : 0;
213 const int changed =
fc->tab.sz.pic_size_in_min_tu != pic_size_in_min_tu;
218 TL_ADD(tb_width[
i], pic_size_in_min_tu);
219 TL_ADD(tb_height[
i], pic_size_in_min_tu);
222 for (
int vertical = 0; vertical < 2; vertical++) {
223 TL_ADD(max_len_p[vertical], pic_size_in_min_tu);
224 TL_ADD(max_len_q[vertical], pic_size_in_min_tu);
229 TL_ADD(qp[
i], pic_size_in_min_tu);
238 const int ctu_width =
pps ?
pps->ctb_width : 0;
239 const int ctu_height =
pps ?
pps->ctb_height : 0;
240 const int chroma_idc =
sps ?
sps->r->sps_chroma_format_idc : 0;
241 const int ps =
sps ?
sps->pixel_shift : 0;
243 const int changed =
fc->tab.sz.chroma_format_idc != chroma_idc ||
245 fc->tab.sz.ctu_width != ctu_width ||
fc->tab.sz.ctu_height != ctu_height ||
246 fc->tab.sz.pixel_shift != ps;
253 const int active = c_idx < c_end;
254 const int w = active ?
width >> (
sps ?
sps->hshift[c_idx] : 0) : 0;
255 const int h = active ?
height >> (
sps ?
sps->vshift[c_idx] : 0) : 0;
257 TL_ADD(sao_pixel_buffer_h[c_idx], (
w * 2 * ctu_height) << ps);
258 TL_ADD(sao_pixel_buffer_v[c_idx], (
h * 2 * ctu_width) << ps);
259 for (
int i = 0;
i < 2;
i++) {
260 TL_ADD(alf_pixel_buffer_h[c_idx][
i], (
w * border_pixels * ctu_height) << ps);
297 const int ctu_height =
pps ?
pps->ctb_height : 0;
298 const int ctu_size =
sps ?
sps->ctb_size_y : 0;
299 const int ps =
sps ?
sps->pixel_shift : 0;
300 const int chroma_idc =
sps ?
sps->r->sps_chroma_format_idc : 0;
301 const int has_ibc =
sps ?
sps->r->sps_ibc_enabled_flag : 0;
302 const int changed =
fc->tab.sz.chroma_format_idc != chroma_idc ||
303 fc->tab.sz.ctu_height != ctu_height ||
304 fc->tab.sz.ctu_size != ctu_size * ctu_size ||
305 fc->tab.sz.pixel_shift != ps;
312 const int hs =
sps ?
sps->hshift[
i] : 0;
313 const int vs =
sps ?
sps->vshift[
i] : 0;
314 TL_ADD(ibc_vir_buf[
i],
fc->tab.sz.ibc_buffer_width * ctu_size * ctu_height << ps >> hs >> vs);
351 for (
int i = 0;
i <
fc->tab.sz.ctu_count;
i++)
363 memset(&
fc->tab.sz, 0,
sizeof(
fc->tab.sz));
370 const int ctu_count =
pps->ctb_count;
371 const int pic_size_in_min_pu =
pps->min_pu_width *
pps->min_pu_height;
379 memset(
fc->tab.cus, 0,
sizeof(*
fc->tab.cus) * ctu_count);
381 memset(
fc->tab.slice_idx, -1,
sizeof(*
fc->tab.slice_idx) * ctu_count);
383 if (
fc->tab.sz.ctu_count != ctu_count) {
386 if (!
fc->rpl_tab_pool)
390 if (
fc->tab.sz.pic_size_in_min_pu != pic_size_in_min_pu) {
394 if (!
fc->tab_dmvr_mvf_pool)
398 fc->tab.sz.ctu_count =
pps->ctb_count;
399 fc->tab.sz.ctu_size = 1 <<
sps->ctb_log2_size_y <<
sps->ctb_log2_size_y;
400 fc->tab.sz.pic_size_in_min_cb =
pps->min_cb_width *
pps->min_cb_height;
401 fc->tab.sz.pic_size_in_min_pu = pic_size_in_min_pu;
402 fc->tab.sz.pic_size_in_min_tu =
pps->min_tu_width *
pps->min_tu_height;
403 fc->tab.sz.width =
pps->width;
404 fc->tab.sz.height =
pps->height;
405 fc->tab.sz.ctu_width =
pps->ctb_width;
406 fc->tab.sz.ctu_height =
pps->ctb_height;
407 fc->tab.sz.chroma_format_idc =
sps->r->sps_chroma_format_idc;
408 fc->tab.sz.pixel_shift =
sps->pixel_shift;
413 fc->tab.sz.ctu_count = 0;
425 return diff > 0 && (idx < 0 ||
diff < min_diff);
430 return diff < 0 && (idx < 0 || diff > max_diff);
439 const int poc =
fc->ref->poc;
445 if (find(idx,
diff, old_diff)) {
476 for (
int i = 0;
i <
fc->nb_slices_allocated;
i++) {
487 fc->nb_slices_allocated = 0;
494 const int size = (
fc->nb_slices_allocated + 1) * 3 / 2;
496 if (
fc->nb_slices <
fc->nb_slices_allocated)
504 for (
int i =
fc->nb_slices_allocated;
i <
size;
i++) {
506 if (!
fc->slices[
i]) {
507 fc->nb_slices_allocated =
i;
510 fc->slices[
i]->slice_idx =
i;
512 fc->nb_slices_allocated =
size;
518 const H2645NAL *
nal,
const int header_size,
const int ep_index)
522 if (ep_index < rsh->num_entry_points) {
526 while (skipped < nal->skipped_bytes &&
nal->skipped_bytes_pos[skipped] <= start + header_size) {
529 while (skipped < nal->skipped_bytes &&
nal->skipped_bytes_pos[skipped] <= end + header_size) {
564 for (
int c_idx =
LUMA; c_idx <=
CR; c_idx++)
580 if (sc->
nb_eps != nb_eps) {
600 for (
int j = ep->
ctu_start; j < ep->ctu_end; j++) {
614 const int size =
s->nb_fcs;
635 dst->needs_fg =
src->needs_fg;
645 src->hwaccel_picture_private);
646 dst->nb_rpl_elems =
src->nb_rpl_elems;
649 dst->ctb_count =
src->ctb_count;
651 dst->scaling_win =
src->scaling_win;
652 dst->ref_width =
src->ref_width;
653 dst->ref_height =
src->ref_height;
656 dst->sequence =
src->sequence;
687 if (!
fc->output_frame)
692 if (!
fc->DPB[j].frame)
696 if (!
fc->DPB[j].frame_grain)
715 if (
s->nb_frames &&
s->nb_fcs > 1) {
748 for (
int i = 0;
i <
frame->nb_units;
i++) {
764 NULL,
fc->ps.sps->bit_depth,
fc->ps.sps->bit_depth,
fc->ref->poc);
771 fc->ref->needs_fg = (
fc->sei.common.film_grain_characteristics &&
772 fc->sei.common.film_grain_characteristics->present ||
773 fc->sei.common.itut_t35.aom_film_grain.enable) &&
777 if (
fc->ref->needs_fg &&
778 (
fc->sei.common.film_grain_characteristics &&
779 fc->sei.common.film_grain_characteristics->present &&
781 fc->ref->frame->format) ||
784 "Unsupported film grain parameters. Ignoring film grain.\n");
785 fc->ref->needs_fg = 0;
788 if (
fc->ref->needs_fg) {
789 fc->ref->frame_grain->format =
fc->ref->frame->format;
790 fc->ref->frame_grain->width =
fc->ref->frame->width;
791 fc->ref->frame_grain->height =
fc->ref->frame->height;
811 s->poc_tid0 =
ph->poc;
857 if (is_first_slice) {
861 }
else if (
fc->ref) {
866 "Error constructing the reference lists for the current slice.\n");
883#define HWACCEL_MAX CONFIG_VVC_VAAPI_HWACCEL
887 switch (
sps->pix_fmt) {
889#if CONFIG_VVC_VAAPI_HWACCEL
894#if CONFIG_VVC_VAAPI_HWACCEL
900 *fmt++ =
sps->pix_fmt;
913 if (
c->sw_pix_fmt !=
sps->pix_fmt ||
c->coded_width !=
pps->width ||
c->coded_height !=
pps->height) {
914 c->coded_width =
pps->width;
915 c->coded_height =
pps->height;
916 c->sw_pix_fmt =
sps->pix_fmt;
922 c->width =
pps->width - ((
pps->r->pps_conf_win_left_offset +
pps->r->pps_conf_win_right_offset) <<
sps->hshift[
CHROMA]);
923 c->height =
pps->height - ((
pps->r->pps_conf_win_top_offset +
pps->r->pps_conf_win_bottom_offset) <<
sps->vshift[
CHROMA]);
950 const int is_first_slice = !
fc->nb_slices;
956 sc =
fc->slices[
fc->nb_slices];
959 s->vcl_unit_type =
nal->type;
960 if (is_first_slice) {
974 if (
s->avctx->hwaccel) {
975 if (is_first_slice) {
982 nal->raw_data,
nal->raw_size);
997 s->temporal_id =
nal->temporal_id;
999 if (
nal->nuh_layer_id > 0) {
1001 "Decoding of multilayer bitstreams");
1005 switch (unit->
type) {
1048 s->last_eos =
s->eos;
1052 ff_cbs_fragment_reset(
frame);
1053 ret = ff_cbs_read_packet(
s->cbc,
frame, avpkt);
1059 for (
int i = 0;
i <
frame->nb_units;
i++) {
1069 "Error parsing NAL unit #%d.\n",
i);
1087 if (
fc->ref->needs_fg) {
1090 switch (fgp->
type) {
1109 if (
sei->picture_hash.present) {
1116 "Verifying checksum for frame with decode_order %d: %s\n",
1117 (
int)
fc->decode_order, ret < 0 ?
"incorrect":
"correct");
1147 if (
s->avctx->hwaccel) {
1150 "Hardware accelerator failed to decode picture\n");
1164 if (
s->nb_delayed >=
s->nb_fcs ||
s->avctx->hwaccel) {
1174 while (
s->nb_delayed) {
1205 fc->decode_order =
s->nb_frames;
1211 if (!
fc->ft || !
fc->ref)
1226 while (
s->nb_delayed)
1235 s->ps.sps_id_used = 0;
1244 ff_cbs_fragment_free(&
s->current_frame);
1248 for (
int i = 0;
i <
s->nb_fcs;
i++)
1254 ff_cbs_close(&
s->cbc);
1264#define VVC_MAX_DELAYED_FRAMES 16
1281 ret = ff_cbs_read_extradata_from_codec(
s->cbc, &
s->current_frame, avctx);
1291 for (
int i = 0;
i <
s->nb_fcs;
i++) {
1298 if (thread_count == 1)
1326#if CONFIG_VVC_VAAPI_HWACCEL
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
const FFCodec ff_vvc_decoder
int ff_aom_apply_film_grain(AVFrame *out, const AVFrame *in, const AVFilmGrainParams *params)
AOM film grain synthesis.
static av_cold void close(AVCodecParserContext *s)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static void BS_FUNC skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
static av_always_inline void bytestream2_skipu(GetByteContext *g, unsigned int size)
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline int bytestream2_tell(const GetByteContext *g)
int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size)
#define i(width, name, range_min, range_max)
static int FUNC sei(CodedBitstreamContext *ctx, RWContext *rw, H264RawSEI *current)
static int FUNC sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
static int FUNC ph(CodedBitstreamContext *ctx, RWContext *rw, H266RawPH *current)
static int FUNC nal(CodedBitstreamContext *ctx, RWContext *rw, LCEVCRawNAL *current, int nal_unit_type)
#define FF_CODEC_CAP_EXPORTS_CROPPING
The decoder sets the cropping fields in the output frames manually.
#define FF_CODEC_DECODE_CB(func)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
#define AV_CEIL_RSHIFT(a, b)
void ff_vvc_ctu_free_cus(CodingUnit **cus)
#define ALF_BORDER_CHROMA
#define MAX_CONTROL_POINTS
static const uint16_t fc[]
int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
Select the (possibly hardware accelerated) pixel format.
#define AV_EF_CRCCHECK
Verify checksums embedded in the bitstream (could be of either encoded or decoded data,...
#define AV_EF_EXPLODE
abort decoding on minor error detection
int(* init)(AVBSFContext *ctx)
static int decode_slice(AVCodecContext *c, void *arg)
const AVFilmGrainParams * av_film_grain_params_select(const AVFrame *frame)
Select the most appropriate film grain parameters set for the frame, taking into account the frame's ...
@ AV_FILM_GRAIN_PARAMS_H274
The union is valid when interpreted as AVFilmGrainH274Params (codec.h274)
@ AV_FILM_GRAIN_PARAMS_AV1
The union is valid when interpreted as AVFilmGrainAOMParams (codec.aom)
@ AV_FILM_GRAIN_PARAMS_NONE
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_EXPORT_DATA_FILM_GRAIN
Decoding only.
#define AV_CODEC_FLAG_LOW_DELAY
Force low delay.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
int ff_h2645_sei_to_frame(AVFrame *frame, H2645SEI *sei, enum AVCodecID codec_id, AVCodecContext *avctx, const H2645VUI *vui, unsigned bit_depth_luma, unsigned bit_depth_chroma, int seed)
int ff_h274_hash_init(H274HashContext **ctx, const int type)
void ff_h274_hash_freep(H274HashContext **ctx)
int ff_h274_hash_verify(H274HashContext *c, const H274SEIPictureHash *hash, const AVFrame *frame, const int coded_width, const int coded_height)
int ff_h274_apply_film_grain(AVFrame *out_frame, const AVFrame *in_frame, const AVFilmGrainParams *params)
static int ff_h274_film_grain_params_supported(int model_id, enum AVPixelFormat pix_fmt)
Check whether ff_h274_apply_film_grain() supports the given parameter combination.
#define FF_HW_SIMPLE_CALL(avctx, function)
#define FF_HW_CALL(avctx, function,...)
#define HWACCEL_VAAPI(codec)
static int zero(InterplayACMContext *s, unsigned ind, unsigned col)
Multithreading API for decoders.
av_cold void ff_videodsp_init(VideoDSPContext *ctx, int bpc)
static atomic_int cpu_count
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
static int ff_thread_once(char *control, void(*routine)(void))
static enum AVPixelFormat pix_fmts[]
void av_log_once(void *avcl, int initial_level, int subsequent_level, int *state, const char *fmt,...)
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
#define AV_PIX_FMT_YUV420P10
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
const AVProfile ff_vvc_profiles[]
int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
AVRefStructPool * av_refstruct_pool_alloc(size_t size, unsigned flags)
Equivalent to av_refstruct_pool_alloc(size, flags, NULL, NULL, NULL, NULL, NULL)
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
void av_refstruct_replace(void *dstp, const void *src)
Ensure *dstp refers to the same object as src.
#define AV_REFSTRUCT_POOL_FLAG_ZERO_EVERY_TIME
If this flag is set, the entries will be zeroed before being returned to the user (after the init or ...
static void av_refstruct_pool_uninit(AVRefStructPool **poolp)
Mark the pool as being available for freeing.
static void deblock(const RV60Context *s, AVFrame *frame, int xpos, int ypos, int size, int dpos)
#define FF_ARRAY_ELEMS(a)
A reference to a data buffer.
main external API structure.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
int flags
AV_CODEC_FLAG_*.
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
This structure describes how to handle film grain synthesis in video for specific codecs.
enum AVFilmGrainParamsType type
Specifies the codec for which this structure is valid.
This structure describes decoded (raw) audio or video data.
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
This structure stores compressed data.
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
Coded bitstream fragment structure, combining one or more units.
CodedBitstreamH2645Context common
Coded bitstream unit structure.
void * content_ref
If content is reference counted, a RefStruct reference backing content.
CodedBitstreamUnitType type
Codec-specific type of this unit.
Palette pp[VVC_MAX_SAMPLE_ARRAYS]
VVCRefPic refs[VVC_MAX_REF_ENTRIES]
void * ref
RefStruct reference, backing slice data.
VVCFrame DPB[VVC_MAX_DPB_SIZE+1]
struct AVFrame * output_frame
const H266RawSliceHeader * r
RefStruct reference.
uint32_t entry_point_start_ctu[VVC_MAX_ENTRY_POINTS]
entry point start in ctu_addr
const uint32_t * ctb_addr_in_curr_slice
CtbAddrInCurrSlice.
uint32_t num_ctus_in_curr_slice
NumCtusInCurrSlice.
int8_t ref_idx_sym[2]
RefIdxSymL0, RefIdxSymL1.
void ff_vvc_frame_thread_free(VVCFrameContext *fc)
int ff_vvc_frame_thread_init(VVCFrameContext *fc)
av_cold FFExecutor * ff_vvc_executor_alloc(VVCContext *s, const int thread_count)
int ff_vvc_frame_wait(VVCContext *s, VVCFrameContext *fc)
int ff_vvc_frame_submit(VVCContext *s, VVCFrameContext *fc)
av_cold void ff_vvc_executor_free(FFExecutor **e)
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)
uint8_t ff_vvc_default_scale_m[64 *64]
static int slice_init_entry_points(SliceContext *sc, VVCFrameContext *fc, const H2645NAL *nal, const CodedBitstreamUnit *unit)
static void ibc_tl_init(TabList *l, VVCFrameContext *fc)
static av_cold int vvc_decode_init(AVCodecContext *avctx)
static int check_film_grain(VVCContext *s, VVCFrameContext *fc)
static int8_t smvd_find(const VVCFrameContext *fc, const SliceContext *sc, int lx, smvd_find_fxn find)
static int export_frame_params(VVCContext *s, const VVCFrameContext *fc)
static void tl_init(TabList *l, const int zero, const int realloc)
static void min_cb_nz_tl_init(TabList *l, VVCFrameContext *fc)
static void min_tu_nz_tl_init(TabList *l, VVCFrameContext *fc)
static void pic_arrays_free(VVCFrameContext *fc)
static int slices_realloc(VVCFrameContext *fc)
static void min_cb_tl_init(TabList *l, VVCFrameContext *fc)
static VVCFrameContext * get_frame_context(const VVCContext *s, const VVCFrameContext *fc, const int delta)
static int ref_frame(VVCFrame *dst, const VVCFrame *src)
static int tl_zero(TabList *l)
static av_cold int vvc_decode_free(AVCodecContext *avctx)
void(* tl_init_fn)(TabList *l, VVCFrameContext *fc)
static void msm_tl_init(TabList *l, VVCFrameContext *fc)
static enum AVPixelFormat get_format(AVCodecContext *avctx, const VVCSPS *sps)
static int pic_arrays_init(VVCContext *s, VVCFrameContext *fc)
static int min_positive(const int idx, const int diff, const int min_diff)
static void smvd_ref_idx(const VVCFrameContext *fc, SliceContext *sc)
static void ispmf_tl_init(TabList *l, VVCFrameContext *fc)
static int ep_init(EntryPoint *ep, const int ctu_addr, const int ctu_end, GetByteContext *gb, const int size)
static int tl_free(TabList *l)
static int submit_frame(VVCContext *s, VVCFrameContext *fc, AVFrame *output, int *got_output)
static av_cold void vvc_decode_flush(AVCodecContext *avctx)
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)
static void ctu_nz_tl_init(TabList *l, VVCFrameContext *fc)
static int wait_delayed_frame(VVCContext *s, AVFrame *output, int *got_output)
static int decode_nal_unit(VVCContext *s, VVCFrameContext *fc, AVBufferRef *buf_ref, const H2645NAL *nal, const CodedBitstreamUnit *unit)
static void eps_free(SliceContext *slice)
static void free_cus(VVCFrameContext *fc)
static int ep_init_cabac_decoder(EntryPoint *ep, GetByteContext *gb, const int size)
static av_cold void frame_context_free(VVCFrameContext *fc)
static int vvc_decode_frame(AVCodecContext *avctx, AVFrame *output, int *got_output, AVPacket *avpkt)
static int frame_context_setup(VVCFrameContext *fc, VVCContext *s)
static int get_ep_size(const H266RawSliceHeader *rsh, const GetByteContext *gb, const H2645NAL *nal, const int header_size, const int ep_index)
static void min_tu_tl_init(TabList *l, VVCFrameContext *fc)
static void min_pu_nz_tl_init(TabList *l, VVCFrameContext *fc)
static int max_negtive(const int idx, const int diff, const int max_diff)
static int frame_setup(VVCFrameContext *fc, VVCContext *s)
static void decode_prefix_sei(VVCFrameContext *fc, VVCContext *s)
static av_cold int frame_context_init(VVCFrameContext *fc, AVCodecContext *avctx)
int(* smvd_find_fxn)(const int idx, const int diff, const int old_diff)
static int frame_start(VVCContext *s, VVCFrameContext *fc, SliceContext *sc)
int ff_vvc_per_frame_init(VVCFrameContext *fc)
static void min_pu_tl_init(TabList *l, VVCFrameContext *fc)
static int decode_nal_units(VVCContext *s, VVCFrameContext *fc, AVPacket *avpkt)
static int tl_create(TabList *l)
static av_cold void init_default_scale_m(void)
static void pixel_buffer_nz_tl_init(TabList *l, VVCFrameContext *fc)
static int frame_end(VVCContext *s, VVCFrameContext *fc)
static int set_side_data(VVCContext *s, VVCFrameContext *fc)
static int decode_slice(VVCContext *s, VVCFrameContext *fc, AVBufferRef *buf_ref, const H2645NAL *nal, const CodedBitstreamUnit *unit)
static int frame_context_for_each_tl(VVCFrameContext *fc, int(*unary_fn)(TabList *l))
#define VVC_MAX_DELAYED_FRAMES
static int get_decoded_frame(VVCContext *s, AVFrame *output, int *got_output)
static void slices_free(VVCFrameContext *fc)
void ff_vvc_dsp_init(VVCDSPContext *vvcdsp, int bit_depth)
int ff_vvc_decode_aps(VVCParamSets *ps, const CodedBitstreamUnit *unit)
int ff_vvc_decode_frame_ps(struct VVCFrameContext *fc, struct VVCContext *s)
void ff_vvc_ps_uninit(VVCParamSets *ps)
void ff_vvc_frame_ps_free(VVCFrameParamSets *fps)
int ff_vvc_decode_sh(VVCSH *sh, const VVCFrameParamSets *fps, const CodedBitstreamUnit *unit)
#define GDR_SET_RECOVERED(s)
void ff_vvc_clear_refs(VVCFrameContext *fc)
int ff_vvc_frame_rpl(VVCContext *s, VVCFrameContext *fc, SliceContext *sc)
void ff_vvc_unref_frame(VVCFrameContext *fc, VVCFrame *frame, int flags)
void ff_vvc_bump_frame(VVCContext *s, VVCFrameContext *fc)
void ff_vvc_report_frame_finished(VVCFrame *frame)
int ff_vvc_output_frame(VVCContext *s, VVCFrameContext *fc, AVFrame *out, const int no_output_of_prior_pics_flag, int flush)
int ff_vvc_slice_rpl(VVCContext *s, VVCFrameContext *fc, SliceContext *sc)
int ff_vvc_set_new_ref(VVCContext *s, VVCFrameContext *fc, AVFrame **frame)
void ff_vvc_flush_dpb(VVCFrameContext *fc)
void ff_vvc_sei_reset(VVCSEI *s)
int ff_vvc_sei_decode(VVCSEI *s, const H266RawSEI *sei, const struct VVCFrameContext *fc)
int ff_vvc_sei_replace(VVCSEI *dst, const VVCSEI *src)