mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-20 13:57:00 +00:00
lavc/hevcdec: rename HEVCFrame.frame to just f
This is shorter, loses no information, and is consistent with other similar structs.
This commit is contained in:
parent
9226514ced
commit
db84c1c6ef
@ -156,7 +156,7 @@ static int d3d12va_hevc_end_frame(AVCodecContext *avctx)
|
||||
if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
|
||||
return -1;
|
||||
|
||||
return ff_d3d12va_common_end_frame(avctx, h->cur_frame->frame, &ctx_pic->pp, sizeof(ctx_pic->pp),
|
||||
return ff_d3d12va_common_end_frame(avctx, h->cur_frame->f, &ctx_pic->pp, sizeof(ctx_pic->pp),
|
||||
scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0, update_input_arguments);
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVACo
|
||||
}
|
||||
|
||||
if (frame) {
|
||||
fill_picture_entry(&pp->RefPicList[i], ff_dxva2_get_surface_index(avctx, ctx, frame->frame, 0), !!(frame->flags & HEVC_FRAME_FLAG_LONG_REF));
|
||||
fill_picture_entry(&pp->RefPicList[i], ff_dxva2_get_surface_index(avctx, ctx, frame->f, 0), !!(frame->flags & HEVC_FRAME_FLAG_LONG_REF));
|
||||
pp->PicOrderCntValList[i] = frame->poc;
|
||||
} else {
|
||||
pp->RefPicList[i].bPicEntry = 0xff;
|
||||
@ -178,7 +178,7 @@ void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVACo
|
||||
}
|
||||
}
|
||||
|
||||
fill_picture_entry(&pp->CurrPic, ff_dxva2_get_surface_index(avctx, ctx, current_picture->frame, 1), 0);
|
||||
fill_picture_entry(&pp->CurrPic, ff_dxva2_get_surface_index(avctx, ctx, current_picture->f, 1), 0);
|
||||
|
||||
#define DO_REF_LIST(ref_idx, ref_list) { \
|
||||
const RefPicList *rpl = &h->rps[ref_idx]; \
|
||||
@ -187,7 +187,7 @@ void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVACo
|
||||
while (!frame && j < rpl->nb_refs) \
|
||||
frame = rpl->ref[j++]; \
|
||||
if (frame && frame->flags & (HEVC_FRAME_FLAG_LONG_REF | HEVC_FRAME_FLAG_SHORT_REF)) \
|
||||
pp->ref_list[i] = get_refpic_index(pp, ff_dxva2_get_surface_index(avctx, ctx, frame->frame, 0)); \
|
||||
pp->ref_list[i] = get_refpic_index(pp, ff_dxva2_get_surface_index(avctx, ctx, frame->f, 0)); \
|
||||
else \
|
||||
pp->ref_list[i] = 0xff; \
|
||||
} \
|
||||
@ -415,7 +415,7 @@ static int dxva2_hevc_end_frame(AVCodecContext *avctx)
|
||||
if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
|
||||
return -1;
|
||||
|
||||
ret = ff_dxva2_common_end_frame(avctx, h->cur_frame->frame,
|
||||
ret = ff_dxva2_common_end_frame(avctx, h->cur_frame->f,
|
||||
&ctx_pic->pp, sizeof(ctx_pic->pp),
|
||||
scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0,
|
||||
commit_bitstream_and_slice_buffer);
|
||||
|
@ -79,7 +79,7 @@ static HEVCFrame *alloc_frame(HEVCContext *s)
|
||||
int i, j, ret;
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
|
||||
HEVCFrame *frame = &s->DPB[i];
|
||||
if (frame->frame)
|
||||
if (frame->f)
|
||||
continue;
|
||||
|
||||
ret = ff_progress_frame_get_buffer(s->avctx, &frame->tf,
|
||||
@ -104,10 +104,10 @@ static HEVCFrame *alloc_frame(HEVCContext *s)
|
||||
frame->rpl_tab[j] = frame->rpl;
|
||||
|
||||
if (s->sei.picture_timing.picture_struct == AV_PICTURE_STRUCTURE_TOP_FIELD)
|
||||
frame->frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
|
||||
frame->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
|
||||
if ((s->sei.picture_timing.picture_struct == AV_PICTURE_STRUCTURE_TOP_FIELD) ||
|
||||
(s->sei.picture_timing.picture_struct == AV_PICTURE_STRUCTURE_BOTTOM_FIELD))
|
||||
frame->frame->flags |= AV_FRAME_FLAG_INTERLACED;
|
||||
frame->f->flags |= AV_FRAME_FLAG_INTERLACED;
|
||||
|
||||
ret = ff_hwaccel_frame_priv_alloc(s->avctx, &frame->hwaccel_picture_private);
|
||||
if (ret < 0)
|
||||
@ -131,7 +131,7 @@ int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc)
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
|
||||
HEVCFrame *frame = &s->DPB[i];
|
||||
|
||||
if (frame->frame && frame->sequence == s->seq_decode &&
|
||||
if (frame->f && frame->sequence == s->seq_decode &&
|
||||
frame->poc == poc) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Duplicate POC in a sequence: %d.\n",
|
||||
poc);
|
||||
@ -143,7 +143,7 @@ int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc)
|
||||
if (!ref)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
*frame = ref->frame;
|
||||
*frame = ref->f;
|
||||
s->cur_frame = ref;
|
||||
s->collocated_ref = NULL;
|
||||
|
||||
@ -154,10 +154,10 @@ int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc)
|
||||
|
||||
ref->poc = poc;
|
||||
ref->sequence = s->seq_decode;
|
||||
ref->frame->crop_left = s->ps.sps->output_window.left_offset;
|
||||
ref->frame->crop_right = s->ps.sps->output_window.right_offset;
|
||||
ref->frame->crop_top = s->ps.sps->output_window.top_offset;
|
||||
ref->frame->crop_bottom = s->ps.sps->output_window.bottom_offset;
|
||||
ref->f->crop_left = s->ps.sps->output_window.left_offset;
|
||||
ref->f->crop_right = s->ps.sps->output_window.right_offset;
|
||||
ref->f->crop_top = s->ps.sps->output_window.top_offset;
|
||||
ref->f->crop_bottom = s->ps.sps->output_window.bottom_offset;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -212,7 +212,7 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
|
||||
if (nb_output) {
|
||||
HEVCFrame *frame = &s->DPB[min_idx];
|
||||
|
||||
ret = av_frame_ref(out, frame->needs_fg ? frame->frame_grain : frame->frame);
|
||||
ret = av_frame_ref(out, frame->needs_fg ? frame->frame_grain : frame->f);
|
||||
if (frame->flags & HEVC_FRAME_FLAG_BUMPING)
|
||||
ff_hevc_unref_frame(frame, HEVC_FRAME_FLAG_OUTPUT | HEVC_FRAME_FLAG_BUMPING);
|
||||
else
|
||||
@ -220,7 +220,7 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (frame->needs_fg && (ret = av_frame_copy_props(out, frame->frame)) < 0)
|
||||
if (frame->needs_fg && (ret = av_frame_copy_props(out, frame->f)) < 0)
|
||||
return ret;
|
||||
|
||||
if (!(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN))
|
||||
@ -390,7 +390,7 @@ static HEVCFrame *find_ref_idx(HEVCContext *s, int poc, uint8_t use_msb)
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
|
||||
HEVCFrame *ref = &s->DPB[i];
|
||||
if (ref->frame && ref->sequence == s->seq_decode) {
|
||||
if (ref->f && ref->sequence == s->seq_decode) {
|
||||
if ((ref->poc & mask) == poc && (use_msb || ref->poc != s->poc))
|
||||
return ref;
|
||||
}
|
||||
@ -419,13 +419,13 @@ static HEVCFrame *generate_missing_ref(HEVCContext *s, int poc)
|
||||
|
||||
if (!s->avctx->hwaccel) {
|
||||
if (!s->ps.sps->pixel_shift) {
|
||||
for (i = 0; frame->frame->data[i]; i++)
|
||||
memset(frame->frame->data[i], 1 << (s->ps.sps->bit_depth - 1),
|
||||
frame->frame->linesize[i] * AV_CEIL_RSHIFT(s->ps.sps->height, s->ps.sps->vshift[i]));
|
||||
for (i = 0; frame->f->data[i]; i++)
|
||||
memset(frame->f->data[i], 1 << (s->ps.sps->bit_depth - 1),
|
||||
frame->f->linesize[i] * AV_CEIL_RSHIFT(s->ps.sps->height, s->ps.sps->vshift[i]));
|
||||
} else {
|
||||
for (i = 0; frame->frame->data[i]; i++)
|
||||
for (i = 0; frame->f->data[i]; i++)
|
||||
for (y = 0; y < (s->ps.sps->height >> s->ps.sps->vshift[i]); y++) {
|
||||
uint8_t *dst = frame->frame->data[i] + y * frame->frame->linesize[i];
|
||||
uint8_t *dst = frame->f->data[i] + y * frame->f->linesize[i];
|
||||
AV_WN16(dst, 1 << (s->ps.sps->bit_depth - 1));
|
||||
av_memcpy_backptr(dst + 2, 2, 2*(s->ps.sps->width >> s->ps.sps->hshift[i]) - 2);
|
||||
}
|
||||
|
@ -1975,13 +1975,13 @@ static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0,
|
||||
|
||||
if (current_mv.pred_flag & PF_L0) {
|
||||
ref0 = refPicList[0].ref[current_mv.ref_idx[0]];
|
||||
if (!ref0 || !ref0->frame)
|
||||
if (!ref0 || !ref0->f)
|
||||
return;
|
||||
hevc_await_progress(s, ref0, ¤t_mv.mv[0], y0, nPbH);
|
||||
}
|
||||
if (current_mv.pred_flag & PF_L1) {
|
||||
ref1 = refPicList[1].ref[current_mv.ref_idx[1]];
|
||||
if (!ref1 || !ref1->frame)
|
||||
if (!ref1 || !ref1->f)
|
||||
return;
|
||||
hevc_await_progress(s, ref1, ¤t_mv.mv[1], y0, nPbH);
|
||||
}
|
||||
@ -1992,16 +1992,16 @@ static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0,
|
||||
int nPbW_c = nPbW >> s->ps.sps->hshift[1];
|
||||
int nPbH_c = nPbH >> s->ps.sps->vshift[1];
|
||||
|
||||
luma_mc_uni(lc, dst0, s->frame->linesize[0], ref0->frame,
|
||||
luma_mc_uni(lc, dst0, s->frame->linesize[0], ref0->f,
|
||||
¤t_mv.mv[0], x0, y0, nPbW, nPbH,
|
||||
s->sh.luma_weight_l0[current_mv.ref_idx[0]],
|
||||
s->sh.luma_offset_l0[current_mv.ref_idx[0]]);
|
||||
|
||||
if (s->ps.sps->chroma_format_idc) {
|
||||
chroma_mc_uni(lc, dst1, s->frame->linesize[1], ref0->frame->data[1], ref0->frame->linesize[1],
|
||||
chroma_mc_uni(lc, dst1, s->frame->linesize[1], ref0->f->data[1], ref0->f->linesize[1],
|
||||
0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0]);
|
||||
chroma_mc_uni(lc, dst2, s->frame->linesize[2], ref0->frame->data[2], ref0->frame->linesize[2],
|
||||
chroma_mc_uni(lc, dst2, s->frame->linesize[2], ref0->f->data[2], ref0->f->linesize[2],
|
||||
0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1]);
|
||||
}
|
||||
@ -2011,17 +2011,17 @@ static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0,
|
||||
int nPbW_c = nPbW >> s->ps.sps->hshift[1];
|
||||
int nPbH_c = nPbH >> s->ps.sps->vshift[1];
|
||||
|
||||
luma_mc_uni(lc, dst0, s->frame->linesize[0], ref1->frame,
|
||||
luma_mc_uni(lc, dst0, s->frame->linesize[0], ref1->f,
|
||||
¤t_mv.mv[1], x0, y0, nPbW, nPbH,
|
||||
s->sh.luma_weight_l1[current_mv.ref_idx[1]],
|
||||
s->sh.luma_offset_l1[current_mv.ref_idx[1]]);
|
||||
|
||||
if (s->ps.sps->chroma_format_idc) {
|
||||
chroma_mc_uni(lc, dst1, s->frame->linesize[1], ref1->frame->data[1], ref1->frame->linesize[1],
|
||||
chroma_mc_uni(lc, dst1, s->frame->linesize[1], ref1->f->data[1], ref1->f->linesize[1],
|
||||
1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0]);
|
||||
|
||||
chroma_mc_uni(lc, dst2, s->frame->linesize[2], ref1->frame->data[2], ref1->frame->linesize[2],
|
||||
chroma_mc_uni(lc, dst2, s->frame->linesize[2], ref1->f->data[2], ref1->f->linesize[2],
|
||||
1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1]);
|
||||
}
|
||||
@ -2031,15 +2031,15 @@ static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0,
|
||||
int nPbW_c = nPbW >> s->ps.sps->hshift[1];
|
||||
int nPbH_c = nPbH >> s->ps.sps->vshift[1];
|
||||
|
||||
luma_mc_bi(lc, dst0, s->frame->linesize[0], ref0->frame,
|
||||
luma_mc_bi(lc, dst0, s->frame->linesize[0], ref0->f,
|
||||
¤t_mv.mv[0], x0, y0, nPbW, nPbH,
|
||||
ref1->frame, ¤t_mv.mv[1], ¤t_mv);
|
||||
ref1->f, ¤t_mv.mv[1], ¤t_mv);
|
||||
|
||||
if (s->ps.sps->chroma_format_idc) {
|
||||
chroma_mc_bi(lc, dst1, s->frame->linesize[1], ref0->frame, ref1->frame,
|
||||
chroma_mc_bi(lc, dst1, s->frame->linesize[1], ref0->f, ref1->f,
|
||||
x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 0);
|
||||
|
||||
chroma_mc_bi(lc, dst2, s->frame->linesize[2], ref0->frame, ref1->frame,
|
||||
chroma_mc_bi(lc, dst2, s->frame->linesize[2], ref0->f, ref1->f,
|
||||
x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 1);
|
||||
}
|
||||
}
|
||||
@ -2780,7 +2780,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal)
|
||||
|
||||
static int set_side_data(HEVCContext *s)
|
||||
{
|
||||
AVFrame *out = s->cur_frame->frame;
|
||||
AVFrame *out = s->cur_frame->f;
|
||||
int ret;
|
||||
|
||||
// Decrement the mastering display and content light level flag when IRAP
|
||||
@ -2896,9 +2896,9 @@ static int hevc_frame_start(HEVCContext *s)
|
||||
}
|
||||
|
||||
if (IS_IRAP(s))
|
||||
s->cur_frame->frame->flags |= AV_FRAME_FLAG_KEY;
|
||||
s->cur_frame->f->flags |= AV_FRAME_FLAG_KEY;
|
||||
else
|
||||
s->cur_frame->frame->flags &= ~AV_FRAME_FLAG_KEY;
|
||||
s->cur_frame->f->flags &= ~AV_FRAME_FLAG_KEY;
|
||||
|
||||
s->cur_frame->needs_fg = (s->sei.common.film_grain_characteristics.present ||
|
||||
s->sei.common.aom_film_grain.enable) &&
|
||||
@ -2912,17 +2912,17 @@ static int hevc_frame_start(HEVCContext *s)
|
||||
if (s->cur_frame->needs_fg &&
|
||||
(s->sei.common.film_grain_characteristics.present &&
|
||||
!ff_h274_film_grain_params_supported(s->sei.common.film_grain_characteristics.model_id,
|
||||
s->cur_frame->frame->format) ||
|
||||
!av_film_grain_params_select(s->cur_frame->frame))) {
|
||||
s->cur_frame->f->format) ||
|
||||
!av_film_grain_params_select(s->cur_frame->f))) {
|
||||
av_log_once(s->avctx, AV_LOG_WARNING, AV_LOG_DEBUG, &s->film_grain_warning_shown,
|
||||
"Unsupported film grain parameters. Ignoring film grain.\n");
|
||||
s->cur_frame->needs_fg = 0;
|
||||
}
|
||||
|
||||
if (s->cur_frame->needs_fg) {
|
||||
s->cur_frame->frame_grain->format = s->cur_frame->frame->format;
|
||||
s->cur_frame->frame_grain->width = s->cur_frame->frame->width;
|
||||
s->cur_frame->frame_grain->height = s->cur_frame->frame->height;
|
||||
s->cur_frame->frame_grain->format = s->cur_frame->f->format;
|
||||
s->cur_frame->frame_grain->width = s->cur_frame->f->width;
|
||||
s->cur_frame->frame_grain->height = s->cur_frame->f->height;
|
||||
if ((ret = ff_thread_get_buffer(s->avctx, s->cur_frame->frame_grain, 0)) < 0)
|
||||
goto fail;
|
||||
}
|
||||
@ -2957,17 +2957,17 @@ static int hevc_frame_end(HEVCContext *s)
|
||||
|
||||
if (out->needs_fg) {
|
||||
av_assert0(out->frame_grain->buf[0]);
|
||||
fgp = av_film_grain_params_select(out->frame);
|
||||
fgp = av_film_grain_params_select(out->f);
|
||||
switch (fgp->type) {
|
||||
case AV_FILM_GRAIN_PARAMS_NONE:
|
||||
av_assert0(0);
|
||||
return AVERROR_BUG;
|
||||
case AV_FILM_GRAIN_PARAMS_H274:
|
||||
ret = ff_h274_apply_film_grain(out->frame_grain, out->frame,
|
||||
ret = ff_h274_apply_film_grain(out->frame_grain, out->f,
|
||||
&s->h274db, fgp);
|
||||
break;
|
||||
case AV_FILM_GRAIN_PARAMS_AV1:
|
||||
ret = ff_aom_apply_film_grain(out->frame_grain, out->frame, fgp);
|
||||
ret = ff_aom_apply_film_grain(out->frame_grain, out->f, fgp);
|
||||
break;
|
||||
}
|
||||
av_assert1(ret >= 0);
|
||||
@ -3400,7 +3400,7 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
||||
/* verify the SEI checksum */
|
||||
if (avctx->err_recognition & AV_EF_CRCCHECK && s->cur_frame && s->is_decoded &&
|
||||
s->sei.picture_hash.is_md5) {
|
||||
ret = verify_md5(s, s->cur_frame->frame);
|
||||
ret = verify_md5(s, s->cur_frame->f);
|
||||
if (ret < 0 && avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
ff_hevc_unref_frame(s->cur_frame, ~0);
|
||||
return ret;
|
||||
@ -3543,7 +3543,7 @@ static int hevc_update_thread_context(AVCodecContext *dst,
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
|
||||
ff_hevc_unref_frame(&s->DPB[i], ~0);
|
||||
if (s0->DPB[i].frame) {
|
||||
if (s0->DPB[i].f) {
|
||||
ret = hevc_ref_frame(&s->DPB[i], &s0->DPB[i]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@ -355,7 +355,7 @@ typedef struct DBParams {
|
||||
typedef struct HEVCFrame {
|
||||
union {
|
||||
struct {
|
||||
AVFrame *frame;
|
||||
AVFrame *f;
|
||||
};
|
||||
ProgressFrame tf;
|
||||
};
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
static void dpb_add(CUVIDHEVCPICPARAMS *pp, int idx, const HEVCFrame *src)
|
||||
{
|
||||
FrameDecodeData *fdd = (FrameDecodeData*)src->frame->private_ref->data;
|
||||
FrameDecodeData *fdd = (FrameDecodeData*)src->f->private_ref->data;
|
||||
const NVDECFrame *cf = fdd->hwaccel_priv;
|
||||
|
||||
pp->RefPicIdx[idx] = cf ? cf->idx : -1;
|
||||
@ -84,11 +84,11 @@ static int nvdec_hevc_start_frame(AVCodecContext *avctx,
|
||||
|
||||
int i, j, dpb_size, ret;
|
||||
|
||||
ret = ff_nvdec_start_frame(avctx, s->cur_frame->frame);
|
||||
ret = ff_nvdec_start_frame(avctx, s->cur_frame->f);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
fdd = (FrameDecodeData*)s->cur_frame->frame->private_ref->data;
|
||||
fdd = (FrameDecodeData*)s->cur_frame->f->private_ref->data;
|
||||
cf = (NVDECFrame*)fdd->hwaccel_priv;
|
||||
|
||||
*pp = (CUVIDPICPARAMS) {
|
||||
|
@ -53,39 +53,39 @@ static void init_vaapi_pic(VAPictureHEVC *va_pic)
|
||||
|
||||
static void fill_vaapi_pic(VAPictureHEVC *va_pic, const HEVCFrame *pic, int rps_type)
|
||||
{
|
||||
va_pic->picture_id = ff_vaapi_get_surface_id(pic->frame);
|
||||
va_pic->picture_id = ff_vaapi_get_surface_id(pic->f);
|
||||
va_pic->pic_order_cnt = pic->poc;
|
||||
va_pic->flags = rps_type;
|
||||
|
||||
if (pic->flags & HEVC_FRAME_FLAG_LONG_REF)
|
||||
va_pic->flags |= VA_PICTURE_HEVC_LONG_TERM_REFERENCE;
|
||||
|
||||
if (pic->frame->flags & AV_FRAME_FLAG_INTERLACED) {
|
||||
if (pic->f->flags & AV_FRAME_FLAG_INTERLACED) {
|
||||
va_pic->flags |= VA_PICTURE_HEVC_FIELD_PIC;
|
||||
|
||||
if (!(pic->frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST))
|
||||
if (!(pic->f->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST))
|
||||
va_pic->flags |= VA_PICTURE_HEVC_BOTTOM_FIELD;
|
||||
}
|
||||
}
|
||||
|
||||
static int find_frame_rps_type(const HEVCContext *h, const HEVCFrame *pic)
|
||||
{
|
||||
VASurfaceID pic_surf = ff_vaapi_get_surface_id(pic->frame);
|
||||
VASurfaceID pic_surf = ff_vaapi_get_surface_id(pic->f);
|
||||
const HEVCFrame *current_picture = h->cur_frame;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < h->rps[ST_CURR_BEF].nb_refs; i++) {
|
||||
if (pic_surf == ff_vaapi_get_surface_id(h->rps[ST_CURR_BEF].ref[i]->frame))
|
||||
if (pic_surf == ff_vaapi_get_surface_id(h->rps[ST_CURR_BEF].ref[i]->f))
|
||||
return VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE;
|
||||
}
|
||||
|
||||
for (i = 0; i < h->rps[ST_CURR_AFT].nb_refs; i++) {
|
||||
if (pic_surf == ff_vaapi_get_surface_id(h->rps[ST_CURR_AFT].ref[i]->frame))
|
||||
if (pic_surf == ff_vaapi_get_surface_id(h->rps[ST_CURR_AFT].ref[i]->f))
|
||||
return VA_PICTURE_HEVC_RPS_ST_CURR_AFTER;
|
||||
}
|
||||
|
||||
for (i = 0; i < h->rps[LT_CURR].nb_refs; i++) {
|
||||
if (pic_surf == ff_vaapi_get_surface_id(h->rps[LT_CURR].ref[i]->frame))
|
||||
if (pic_surf == ff_vaapi_get_surface_id(h->rps[LT_CURR].ref[i]->f))
|
||||
return VA_PICTURE_HEVC_RPS_LT_CURR;
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx,
|
||||
|
||||
VAPictureParameterBufferHEVC *pic_param = (VAPictureParameterBufferHEVC *)&pic->pic_param;
|
||||
|
||||
pic->pic.output_surface = ff_vaapi_get_surface_id(h->cur_frame->frame);
|
||||
pic->pic.output_surface = ff_vaapi_get_surface_id(h->cur_frame->f);
|
||||
|
||||
*pic_param = (VAPictureParameterBufferHEVC) {
|
||||
.pic_width_in_luma_samples = sps->width,
|
||||
@ -445,7 +445,7 @@ static uint8_t get_ref_pic_index(const HEVCContext *h, const HEVCFrame *frame)
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(pp->ReferenceFrames); i++) {
|
||||
VASurfaceID pid = pp->ReferenceFrames[i].picture_id;
|
||||
int poc = pp->ReferenceFrames[i].pic_order_cnt;
|
||||
if (pid != VA_INVALID_ID && pid == ff_vaapi_get_surface_id(frame->frame) && poc == frame->poc)
|
||||
if (pid != VA_INVALID_ID && pid == ff_vaapi_get_surface_id(frame->f) && poc == frame->poc)
|
||||
return i;
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ static int vdpau_hevc_start_frame(AVCodecContext *avctx,
|
||||
}
|
||||
/* Array of video reference surfaces.
|
||||
Set any unused positions to VDP_INVALID_HANDLE. */
|
||||
info->RefPics[j] = ff_vdpau_get_surface_id(frame->frame);
|
||||
info->RefPics[j] = ff_vdpau_get_surface_id(frame->f);
|
||||
/* Array of picture order counts. These correspond to positions
|
||||
in the RefPics array. */
|
||||
info->PicOrderCntVal[j] = frame->poc;
|
||||
@ -295,7 +295,7 @@ static int vdpau_hevc_start_frame(AVCodecContext *avctx,
|
||||
HEVCFrame *frame = h->rps[ST_CURR_BEF].ref[i];
|
||||
if (frame) {
|
||||
uint8_t found = 0;
|
||||
uintptr_t id = ff_vdpau_get_surface_id(frame->frame);
|
||||
uintptr_t id = ff_vdpau_get_surface_id(frame->f);
|
||||
for (size_t k = 0; k < 16; k++) {
|
||||
if (id == info->RefPics[k]) {
|
||||
info->RefPicSetStCurrBefore[j] = k;
|
||||
@ -318,7 +318,7 @@ static int vdpau_hevc_start_frame(AVCodecContext *avctx,
|
||||
HEVCFrame *frame = h->rps[ST_CURR_AFT].ref[i];
|
||||
if (frame) {
|
||||
uint8_t found = 0;
|
||||
uintptr_t id = ff_vdpau_get_surface_id(frame->frame);
|
||||
uintptr_t id = ff_vdpau_get_surface_id(frame->f);
|
||||
for (size_t k = 0; k < 16; k++) {
|
||||
if (id == info->RefPics[k]) {
|
||||
info->RefPicSetStCurrAfter[j] = k;
|
||||
@ -341,7 +341,7 @@ static int vdpau_hevc_start_frame(AVCodecContext *avctx,
|
||||
HEVCFrame *frame = h->rps[LT_CURR].ref[i];
|
||||
if (frame) {
|
||||
uint8_t found = 0;
|
||||
uintptr_t id = ff_vdpau_get_surface_id(frame->frame);
|
||||
uintptr_t id = ff_vdpau_get_surface_id(frame->f);
|
||||
for (size_t k = 0; k < 16; k++) {
|
||||
if (id == info->RefPics[k]) {
|
||||
info->RefPicSetLtCurr[j] = k;
|
||||
@ -423,7 +423,7 @@ static int vdpau_hevc_end_frame(AVCodecContext *avctx)
|
||||
struct vdpau_picture_context *pic_ctx = h->cur_frame->hwaccel_picture_private;
|
||||
int val;
|
||||
|
||||
val = ff_vdpau_common_end_frame(avctx, h->cur_frame->frame, pic_ctx);
|
||||
val = ff_vdpau_common_end_frame(avctx, h->cur_frame->f, pic_ctx);
|
||||
if (val < 0)
|
||||
return val;
|
||||
|
||||
|
@ -1075,7 +1075,7 @@ static int videotoolbox_hevc_decode_params(AVCodecContext *avctx,
|
||||
static int videotoolbox_hevc_end_frame(AVCodecContext *avctx)
|
||||
{
|
||||
HEVCContext *h = avctx->priv_data;
|
||||
AVFrame *frame = h->cur_frame->frame;
|
||||
AVFrame *frame = h->cur_frame->f;
|
||||
VTContext *vtctx = avctx->internal->hwaccel_priv_data;
|
||||
int ret;
|
||||
|
||||
|
@ -139,7 +139,7 @@ static int vk_hevc_fill_pict(AVCodecContext *avctx, HEVCFrame **ref_src,
|
||||
HEVCVulkanDecodePicture *hp = pic->hwaccel_picture_private;
|
||||
FFVulkanDecodePicture *vkpic = &hp->vp;
|
||||
|
||||
int err = ff_vk_decode_prepare_frame(dec, pic->frame, vkpic, is_current,
|
||||
int err = ff_vk_decode_prepare_frame(dec, pic->f, vkpic, is_current,
|
||||
dec->dedicated_dpb);
|
||||
if (err < 0)
|
||||
return err;
|
||||
@ -160,7 +160,7 @@ static int vk_hevc_fill_pict(AVCodecContext *avctx, HEVCFrame **ref_src,
|
||||
*ref = (VkVideoPictureResourceInfoKHR) {
|
||||
.sType = VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR,
|
||||
.codedOffset = (VkOffset2D){ 0, 0 },
|
||||
.codedExtent = (VkExtent2D){ pic->frame->width, pic->frame->height },
|
||||
.codedExtent = (VkExtent2D){ pic->f->width, pic->f->height },
|
||||
.baseArrayLayer = dec->layered_dpb ? pic_id : 0,
|
||||
.imageViewBinding = vkpic->img_view_ref,
|
||||
};
|
||||
@ -837,7 +837,7 @@ static int vk_hevc_start_frame(AVCodecContext *avctx,
|
||||
.dstPictureResource = (VkVideoPictureResourceInfoKHR) {
|
||||
.sType = VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR,
|
||||
.codedOffset = (VkOffset2D){ 0, 0 },
|
||||
.codedExtent = (VkExtent2D){ pic->frame->width, pic->frame->height },
|
||||
.codedExtent = (VkExtent2D){ pic->f->width, pic->f->height },
|
||||
.baseArrayLayer = 0,
|
||||
.imageViewBinding = vp->img_view_out,
|
||||
},
|
||||
@ -904,14 +904,14 @@ static int vk_hevc_end_frame(AVCodecContext *avctx)
|
||||
|
||||
for (int i = 0; i < vp->decode_info.referenceSlotCount; i++) {
|
||||
HEVCVulkanDecodePicture *rfhp = hp->ref_src[i]->hwaccel_picture_private;
|
||||
rav[i] = hp->ref_src[i]->frame;
|
||||
rav[i] = hp->ref_src[i]->f;
|
||||
rvp[i] = &rfhp->vp;
|
||||
}
|
||||
|
||||
av_log(avctx, AV_LOG_VERBOSE, "Decoding frame, %"SIZE_SPECIFIER" bytes, %i slices\n",
|
||||
vp->slices_size, hp->h265_pic_info.sliceSegmentCount);
|
||||
|
||||
return ff_vk_decode_frame(avctx, pic->frame, vp, rav, rvp);
|
||||
return ff_vk_decode_frame(avctx, pic->f, vp, rav, rvp);
|
||||
}
|
||||
|
||||
static void vk_hevc_free_frame_priv(FFRefStructOpaque _hwctx, void *data)
|
||||
|
Loading…
Reference in New Issue
Block a user