History

lavc/hevcdec: rename HEVCContext.ref to cur_frame

Since it stores a pointer to the current frame.

Anton Khirnov committed 2 years ago

Commit 92265141 parent 7ad940014 files · +138 −138Browse files

Unified · Split

14 files
  1. libavcodec/d3d12va_hevc.c +5 −5
  2. libavcodec/dxva2_hevc.c +6 −6
  3. libavcodec/hevc_filter.c +17 −17
  4. libavcodec/hevc_mvs.c +10 −10
  5. libavcodec/hevc_refs.c +9 −9
  6. libavcodec/hevcdec.c +34 −34
  7. libavcodec/hevcdec.h +1 −1
  8. libavcodec/hevcpred_template.c +1 −1
  9. libavcodec/mips/hevcpred_msa.c +34 −34
  10. libavcodec/nvdec_hevc.c +3 −3
  11. libavcodec/vaapi_hevc.c +9 −9
  12. libavcodec/vdpau_hevc.c +5 −5
  13. libavcodec/videotoolbox.c +1 −1
  14. libavcodec/vulkan_hevc.c +3 −3
libavcodec/d3d12va_hevc.c+5−5
@@ -53,7 +53,7 @@ static int d3d12va_hevc_start_frame(AVCodecContext *avctx, av_unused const uint8 · 52 unmodified lines
5353 {
5454 const HEVCContext *h = avctx->priv_data;
5555 D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
56− HEVCDecodePictureContext *ctx_pic = h->ref->hwaccel_picture_private;
56+ HEVCDecodePictureContext *ctx_pic = h->cur_frame->hwaccel_picture_private;
5757
5858 if (!ctx)
5959 return -1;
@@ -76,7 +76,7 @@ static int d3d12va_hevc_start_frame(AVCodecContext *avctx, av_unused const uint8 · 16 unmodified lines
7676 static int d3d12va_hevc_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
7777 {
7878 const HEVCContext *h = avctx->priv_data;
79− const HEVCFrame *current_picture = h->ref;
79+ const HEVCFrame *current_picture = h->cur_frame;
8080 HEVCDecodePictureContext *ctx_pic = current_picture->hwaccel_picture_private;
8181 unsigned position;
8282
@@ -99,7 +99,7 @@ static int d3d12va_hevc_decode_slice(AVCodecContext *avctx, const uint8_t *buffe · 16 unmodified lines
9999 static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
100100 {
101101 const HEVCContext *h = avctx->priv_data;
102− const HEVCFrame *current_picture = h->ref;
102+ const HEVCFrame *current_picture = h->cur_frame;
103103 HEVCDecodePictureContext *ctx_pic = current_picture->hwaccel_picture_private;
104104
105105 int i;
@@ -149,14 +149,14 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU · 43 unmodified lines
149149 static int d3d12va_hevc_end_frame(AVCodecContext *avctx)
150150 {
151151 HEVCContext *h = avctx->priv_data;
152− HEVCDecodePictureContext *ctx_pic = h->ref->hwaccel_picture_private;
152+ HEVCDecodePictureContext *ctx_pic = h->cur_frame->hwaccel_picture_private;
153153
154154 int scale = ctx_pic->pp.dwCodingParamToolFlags & 1;
155155
156156 if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
157157 return -1;
158158
159− return ff_d3d12va_common_end_frame(avctx, h->ref->frame, &ctx_pic->pp, sizeof(ctx_pic->pp),
159+ return ff_d3d12va_common_end_frame(avctx, h->cur_frame->frame, &ctx_pic->pp, sizeof(ctx_pic->pp),
160160 scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0, update_input_arguments);
161161 }
162162
libavcodec/dxva2_hevc.c+6−6
@@ -61,7 +61,7 @@ void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVACo · 60 unmodified lines
6161 DXVA_PicParams_HEVC *pp)
6262 {
6363 const HEVCContext *h = avctx->priv_data;
64− const HEVCFrame *current_picture = h->ref;
64+ const HEVCFrame *current_picture = h->cur_frame;
6565 const HEVCSPS *sps = h->ps.sps;
6666 const HEVCPPS *pps = h->ps.pps;
6767 int i, j;
@@ -245,7 +245,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, · 177 unmodified lines
245245 {
246246 const HEVCContext *h = avctx->priv_data;
247247 AVDXVAContext *ctx = DXVA_CONTEXT(avctx);
248− const HEVCFrame *current_picture = h->ref;
248+ const HEVCFrame *current_picture = h->cur_frame;
249249 struct hevc_dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;
250250 DXVA_Slice_HEVC_Short *slice = NULL;
251251 void *dxva_data_ptr;
@@ -364,7 +364,7 @@ static int dxva2_hevc_start_frame(AVCodecContext *avctx, · 112 unmodified lines
364364 {
365365 const HEVCContext *h = avctx->priv_data;
366366 AVDXVAContext *ctx = DXVA_CONTEXT(avctx);
367− struct hevc_dxva2_picture_context *ctx_pic = h->ref->hwaccel_picture_private;
367+ struct hevc_dxva2_picture_context *ctx_pic = h->cur_frame->hwaccel_picture_private;
368368
369369 if (!DXVA_CONTEXT_VALID(avctx, ctx))
370370 return -1;
@@ -387,7 +387,7 @@ static int dxva2_hevc_decode_slice(AVCodecContext *avctx, · 16 unmodified lines
387387 uint32_t size)
388388 {
389389 const HEVCContext *h = avctx->priv_data;
390− const HEVCFrame *current_picture = h->ref;
390+ const HEVCFrame *current_picture = h->cur_frame;
391391 struct hevc_dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;
392392 unsigned position;
393393
@@ -408,14 +408,14 @@ static int dxva2_hevc_decode_slice(AVCodecContext *avctx, · 14 unmodified lines
408408 static int dxva2_hevc_end_frame(AVCodecContext *avctx)
409409 {
410410 HEVCContext *h = avctx->priv_data;
411− struct hevc_dxva2_picture_context *ctx_pic = h->ref->hwaccel_picture_private;
411+ struct hevc_dxva2_picture_context *ctx_pic = h->cur_frame->hwaccel_picture_private;
412412 int scale = ctx_pic->pp.dwCodingParamToolFlags & 1;
413413 int ret;
414414
415415 if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
416416 return -1;
417417
418− ret = ff_dxva2_common_end_frame(avctx, h->ref->frame,
418+ ret = ff_dxva2_common_end_frame(avctx, h->cur_frame->frame,
419419 &ctx_pic->pp, sizeof(ctx_pic->pp),
420420 scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0,
421421 commit_bitstream_and_slice_buffer);
libavcodec/hevc_filter.c+17−17
@@ -661,8 +661,8 @@ static int boundary_strength(const HEVCContext *s, const MvField *curr, const Mv · 660 unmodified lines
661661 {
662662 if (curr->pred_flag == PF_BI && neigh->pred_flag == PF_BI) {
663663 // same L0 and L1
664− if (s->ref->refPicList[0].list[curr->ref_idx[0]] == neigh_refPicList[0].list[neigh->ref_idx[0]] &&
665− s->ref->refPicList[0].list[curr->ref_idx[0]] == s->ref->refPicList[1].list[curr->ref_idx[1]] &&
664+ if (s->cur_frame->refPicList[0].list[curr->ref_idx[0]] == neigh_refPicList[0].list[neigh->ref_idx[0]] &&
665+ s->cur_frame->refPicList[0].list[curr->ref_idx[0]] == s->cur_frame->refPicList[1].list[curr->ref_idx[1]] &&
666666 neigh_refPicList[0].list[neigh->ref_idx[0]] == neigh_refPicList[1].list[neigh->ref_idx[1]]) {
667667 if ((FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 ||
668668 FFABS(neigh->mv[1].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 4) &&
@@ -671,15 +671,15 @@ static int boundary_strength(const HEVCContext *s, const MvField *curr, const Mv · 2 unmodified lines
671671 return 1;
672672 else
673673 return 0;
674− } else if (neigh_refPicList[0].list[neigh->ref_idx[0]] == s->ref->refPicList[0].list[curr->ref_idx[0]] &&
675− neigh_refPicList[1].list[neigh->ref_idx[1]] == s->ref->refPicList[1].list[curr->ref_idx[1]]) {
674+ } else if (neigh_refPicList[0].list[neigh->ref_idx[0]] == s->cur_frame->refPicList[0].list[curr->ref_idx[0]] &&
675+ neigh_refPicList[1].list[neigh->ref_idx[1]] == s->cur_frame->refPicList[1].list[curr->ref_idx[1]]) {
676676 if (FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 ||
677677 FFABS(neigh->mv[1].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 4)
678678 return 1;
679679 else
680680 return 0;
681− } else if (neigh_refPicList[1].list[neigh->ref_idx[1]] == s->ref->refPicList[0].list[curr->ref_idx[0]] &&
682− neigh_refPicList[0].list[neigh->ref_idx[0]] == s->ref->refPicList[1].list[curr->ref_idx[1]]) {
681+ } else if (neigh_refPicList[1].list[neigh->ref_idx[1]] == s->cur_frame->refPicList[0].list[curr->ref_idx[0]] &&
682+ neigh_refPicList[0].list[neigh->ref_idx[0]] == s->cur_frame->refPicList[1].list[curr->ref_idx[1]]) {
683683 if (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 4 ||
684684 FFABS(neigh->mv[0].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[1].y) >= 4)
685685 return 1;
@@ -694,10 +694,10 @@ static int boundary_strength(const HEVCContext *s, const MvField *curr, const Mv · 8 unmodified lines
694694
695695 if (curr->pred_flag & 1) {
696696 A = curr->mv[0];
697− ref_A = s->ref->refPicList[0].list[curr->ref_idx[0]];
697+ ref_A = s->cur_frame->refPicList[0].list[curr->ref_idx[0]];
698698 } else {
699699 A = curr->mv[1];
700− ref_A = s->ref->refPicList[1].list[curr->ref_idx[1]];
700+ ref_A = s->cur_frame->refPicList[1].list[curr->ref_idx[1]];
701701 }
702702
703703 if (neigh->pred_flag & 1) {
@@ -724,7 +724,7 @@ void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, · 20 unmodified lines
724724 int log2_trafo_size)
725725 {
726726 const HEVCContext *s = lc->parent;
727− const MvField *tab_mvf = s->ref->tab_mvf;
727+ const MvField *tab_mvf = s->cur_frame->tab_mvf;
728728 int log2_min_pu_size = s->ps.sps->log2_min_pu_size;
729729 int log2_min_tu_size = s->ps.sps->log2_min_tb_size;
730730 int min_pu_width = s->ps.sps->min_pu_width;
@@ -746,8 +746,8 @@ void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, · 15 unmodified lines
746746
747747 if (boundary_upper) {
748748 const RefPicList *rpl_top = (lc->boundary_flags & BOUNDARY_UPPER_SLICE) ?
749− ff_hevc_get_ref_list(s, s->ref, x0, y0 - 1) :
750− s->ref->refPicList;
749+ ff_hevc_get_ref_list(s, s->cur_frame, x0, y0 - 1) :
750+ s->cur_frame->refPicList;
751751 int yp_pu = (y0 - 1) >> log2_min_pu_size;
752752 int yq_pu = y0 >> log2_min_pu_size;
753753 int yp_tu = (y0 - 1) >> log2_min_tu_size;
@@ -784,8 +784,8 @@ void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, · 30 unmodified lines
784784
785785 if (boundary_left) {
786786 const RefPicList *rpl_left = (lc->boundary_flags & BOUNDARY_LEFT_SLICE) ?
787− ff_hevc_get_ref_list(s, s->ref, x0 - 1, y0) :
788− s->ref->refPicList;
787+ ff_hevc_get_ref_list(s, s->cur_frame, x0 - 1, y0) :
788+ s->cur_frame->refPicList;
789789 int xp_pu = (x0 - 1) >> log2_min_pu_size;
790790 int xq_pu = x0 >> log2_min_pu_size;
791791 int xp_tu = (x0 - 1) >> log2_min_tu_size;
@@ -810,7 +810,7 @@ void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, · 18 unmodified lines
810810 }
811811
812812 if (log2_trafo_size > log2_min_pu_size && !is_intra) {
813− const RefPicList *rpl = s->ref->refPicList;
813+ const RefPicList *rpl = s->cur_frame->refPicList;
814814
815815 // bs for TU internal horizontal PU boundaries
816816 for (j = 8; j < (1 << log2_trafo_size); j += 8) {
@@ -874,15 +874,15 @@ void ff_hevc_hls_filter(HEVCLocalContext *lc, int x, int y, int ctb_size) · 57 unmodified lines
874874 if (y && x_end) {
875875 sao_filter_CTB(lc, s, x, y - ctb_size);
876876 if (s->threads_type & FF_THREAD_FRAME )
877− ff_progress_frame_report(&s->ref->tf, y);
877+ ff_progress_frame_report(&s->cur_frame->tf, y);
878878 }
879879 if (x_end && y_end) {
880880 sao_filter_CTB(lc, s, x , y);
881881 if (s->threads_type & FF_THREAD_FRAME )
882− ff_progress_frame_report(&s->ref->tf, y + ctb_size);
882+ ff_progress_frame_report(&s->cur_frame->tf, y + ctb_size);
883883 }
884884 } else if (s->threads_type & FF_THREAD_FRAME && x_end)
885− ff_progress_frame_report(&s->ref->tf, y + ctb_size - 4);
885+ ff_progress_frame_report(&s->cur_frame->tf, y + ctb_size - 4);
886886 }
887887
888888 void ff_hevc_hls_filters(HEVCLocalContext *lc, int x_ctb, int y_ctb, int ctb_size)
libavcodec/hevc_mvs.c+10−10
@@ -165,7 +165,7 @@ static int derive_temporal_colocated_mvs(const HEVCContext *s, MvField temp_col, · 164 unmodified lines
165165 int refIdxLx, Mv *mvLXCol, int X,
166166 int colPic, const RefPicList *refPicList_col)
167167 {
168− const RefPicList *refPicList = s->ref->refPicList;
168+ const RefPicList *refPicList = s->cur_frame->refPicList;
169169
170170 if (temp_col.pred_flag == PF_INTRA)
171171 return 0;
@@ -291,8 +291,8 @@ static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCCont · 119 unmodified lines
291291 int merge_idx,
292292 struct MvField mergecandlist[])
293293 {
294− const RefPicList *refPicList = s->ref->refPicList;
295− const MvField *tab_mvf = s->ref->tab_mvf;
294+ const RefPicList *refPicList = s->cur_frame->refPicList;
295+ const MvField *tab_mvf = s->cur_frame->tab_mvf;
296296
297297 const int min_pu_width = s->ps.sps->min_pu_width;
298298
@@ -514,8 +514,8 @@ static av_always_inline void dist_scale(const HEVCContext *s, Mv *mv, · 215 unmodified lines
514514 int min_pu_width, int x, int y,
515515 int elist, int ref_idx_curr, int ref_idx)
516516 {
517− const RefPicList *refPicList = s->ref->refPicList;
518− const MvField *tab_mvf = s->ref->tab_mvf;
517+ const RefPicList *refPicList = s->cur_frame->refPicList;
518+ const MvField *tab_mvf = s->cur_frame->tab_mvf;
519519 int ref_pic_elist = refPicList[elist].list[TAB_MVF(x, y).ref_idx[elist]];
520520 int ref_pic_curr = refPicList[ref_idx_curr].list[ref_idx];
521521
@@ -530,10 +530,10 @@ static av_always_inline void dist_scale(const HEVCContext *s, Mv *mv, · 8 unmodified lines
530530 static int mv_mp_mode_mx(const HEVCContext *s, int x, int y, int pred_flag_index,
531531 Mv *mv, int ref_idx_curr, int ref_idx)
532532 {
533− const MvField *tab_mvf = s->ref->tab_mvf;
533+ const MvField *tab_mvf = s->cur_frame->tab_mvf;
534534 int min_pu_width = s->ps.sps->min_pu_width;
535535
536− const RefPicList *refPicList = s->ref->refPicList;
536+ const RefPicList *refPicList = s->cur_frame->refPicList;
537537
538538 if (((TAB_MVF(x, y).pred_flag) & (1 << pred_flag_index)) &&
539539 refPicList[pred_flag_index].list[TAB_MVF(x, y).ref_idx[pred_flag_index]] == refPicList[ref_idx_curr].list[ref_idx]) {
@@ -546,10 +546,10 @@ static int mv_mp_mode_mx(const HEVCContext *s, int x, int y, int pred_flag_index · 6 unmodified lines
546546 static int mv_mp_mode_mx_lt(const HEVCContext *s, int x, int y, int pred_flag_index,
547547 Mv *mv, int ref_idx_curr, int ref_idx)
548548 {
549− const MvField *tab_mvf = s->ref->tab_mvf;
549+ const MvField *tab_mvf = s->cur_frame->tab_mvf;
550550 int min_pu_width = s->ps.sps->min_pu_width;
551551
552− const RefPicList *refPicList = s->ref->refPicList;
552+ const RefPicList *refPicList = s->cur_frame->refPicList;
553553
554554 if ((TAB_MVF(x, y).pred_flag) & (1 << pred_flag_index)) {
555555 int currIsLongTerm = refPicList[ref_idx_curr].isLongTerm[ref_idx];
@@ -586,7 +586,7 @@ void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, · 30 unmodified lines
586586 int mvp_lx_flag, int LX)
587587 {
588588 const HEVCContext *const s = lc->parent;
589− const MvField *const tab_mvf = s->ref->tab_mvf;
589+ const MvField *const tab_mvf = s->cur_frame->tab_mvf;
590590 int isScaledFlag_L0 = 0;
591591 int availableFlagLXA0 = 1;
592592 int availableFlagLXB0 = 1;
libavcodec/hevc_refs.c+9−9
@@ -144,7 +144,7 @@ int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc) · 143 unmodified lines
144144 return AVERROR(ENOMEM);
145145
146146 *frame = ref->frame;
147− s->ref = ref;
147+ s->cur_frame = ref;
148148 s->collocated_ref = NULL;
149149
150150 if (s->sh.pic_output_flag)
@@ -282,7 +282,7 @@ void ff_hevc_bump_frame(HEVCContext *s) · 131 unmodified lines
282282
283283 static int init_slice_rpl(HEVCContext *s)
284284 {
285− HEVCFrame *frame = s->ref;
285+ HEVCFrame *frame = s->cur_frame;
286286 int ctb_count = frame->ctb_count;
287287 int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_segment_addr];
288288 int i;
@@ -318,7 +318,7 @@ int ff_hevc_slice_rpl(HEVCContext *s) · 29 unmodified lines
318318
319319 for (list_idx = 0; list_idx < nb_list; list_idx++) {
320320 RefPicList rpl_tmp = { { 0 } };
321− RefPicList *rpl = &s->ref->refPicList[list_idx];
321+ RefPicList *rpl = &s->cur_frame->refPicList[list_idx];
322322
323323 /* The order of the elements is
324324 * ST_CURR_BEF - ST_CURR_AFT - LT_CURR for the L0 and
@@ -340,8 +340,8 @@ int ff_hevc_slice_rpl(HEVCContext *s) · 15 unmodified lines
340340 }
341341 // Construct RefPicList0, RefPicList1 (8-8, 8-10)
342342 if (s->ps.pps->pps_curr_pic_ref_enabled_flag && rpl_tmp.nb_refs < HEVC_MAX_REFS) {
343− rpl_tmp.list[rpl_tmp.nb_refs] = s->ref->poc;
344− rpl_tmp.ref[rpl_tmp.nb_refs] = s->ref;
343+ rpl_tmp.list[rpl_tmp.nb_refs] = s->cur_frame->poc;
344+ rpl_tmp.ref[rpl_tmp.nb_refs] = s->cur_frame;
345345 rpl_tmp.isLongTerm[rpl_tmp.nb_refs] = 1;
346346 rpl_tmp.nb_refs++;
347347 }
@@ -371,8 +371,8 @@ int ff_hevc_slice_rpl(HEVCContext *s) · 23 unmodified lines
371371 if (s->ps.pps->pps_curr_pic_ref_enabled_flag &&
372372 !sh->rpl_modification_flag[list_idx] &&
373373 rpl_tmp.nb_refs > sh->nb_refs[L0]) {
374− rpl->list[sh->nb_refs[L0] - 1] = s->ref->poc;
375− rpl->ref[sh->nb_refs[L0] - 1] = s->ref;
374+ rpl->list[sh->nb_refs[L0] - 1] = s->cur_frame->poc;
375+ rpl->ref[sh->nb_refs[L0] - 1] = s->cur_frame;
376376 }
377377
378378 if (sh->collocated_list == list_idx &&
@@ -448,7 +448,7 @@ static int add_candidate_ref(HEVCContext *s, RefPicList *list, · 69 unmodified lines
448448 {
449449 HEVCFrame *ref = find_ref_idx(s, poc, use_msb);
450450
451− if (ref == s->ref || list->nb_refs >= HEVC_MAX_REFS)
451+ if (ref == s->cur_frame || list->nb_refs >= HEVC_MAX_REFS)
452452 return AVERROR_INVALIDDATA;
453453
454454 if (!ref) {
@@ -483,7 +483,7 @@ int ff_hevc_frame_rps(HEVCContext *s) · 28 unmodified lines
483483 for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
484484 HEVCFrame *frame = &s->DPB[i];
485485
486− if (frame == s->ref)
486+ if (frame == s->cur_frame)
487487 continue;
488488
489489 mark_ref(frame, 0);
libavcodec/hevcdec.c+34−34
@@ -600,7 +600,7 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) · 599 unmodified lines
600600
601601 // Coded parameters
602602 sh->first_slice_in_pic_flag = get_bits1(gb);
603− if (s->ref && sh->first_slice_in_pic_flag) {
603+ if (s->cur_frame && sh->first_slice_in_pic_flag) {
604604 av_log(s->avctx, AV_LOG_ERROR, "Two slices reporting being the first in the same frame.\n");
605605 return 1; // This slice will be skipped later, do not corrupt state
606606 }
@@ -1935,8 +1935,8 @@ static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0, · 1328 unmodified lines
19351935
19361936 int min_pu_width = s->ps.sps->min_pu_width;
19371937
1938− MvField *tab_mvf = s->ref->tab_mvf;
1939− const RefPicList *refPicList = s->ref->refPicList;
1938+ MvField *tab_mvf = s->cur_frame->tab_mvf;
1939+ const RefPicList *refPicList = s->cur_frame->refPicList;
19401940 const HEVCFrame *ref0 = NULL, *ref1 = NULL;
19411941 uint8_t *dst0 = POS(0, x0, y0);
19421942 uint8_t *dst1 = POS(1, x0, y0);
@@ -2066,7 +2066,7 @@ static int luma_intra_pred_mode(HEVCLocalContext *lc, int x0, int y0, int pu_siz · 123 unmodified lines
20662066
20672067 int y_ctb = (y0 >> (s->ps.sps->log2_ctb_size)) << (s->ps.sps->log2_ctb_size);
20682068
2069− MvField *tab_mvf = s->ref->tab_mvf;
2069+ MvField *tab_mvf = s->cur_frame->tab_mvf;
20702070 int intra_pred_mode;
20712071 int candidate[3];
20722072 int i, j;
@@ -2221,7 +2221,7 @@ static void intra_prediction_unit_default_value(HEVCLocalContext *lc, · 148 unmodified lines
22212221 int pb_size = 1 << log2_cb_size;
22222222 int size_in_pus = pb_size >> s->ps.sps->log2_min_pu_size;
22232223 int min_pu_width = s->ps.sps->min_pu_width;
2224− MvField *tab_mvf = s->ref->tab_mvf;
2224+ MvField *tab_mvf = s->cur_frame->tab_mvf;
22252225 int x_pu = x0 >> s->ps.sps->log2_min_pu_size;
22262226 int y_pu = y0 >> s->ps.sps->log2_min_pu_size;
22272227 int j, k;
@@ -2780,7 +2780,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) · 552 unmodified lines
27802780
27812781 static int set_side_data(HEVCContext *s)
27822782 {
2783− AVFrame *out = s->ref->frame;
2783+ AVFrame *out = s->cur_frame->frame;
27842784 int ret;
27852785
27862786 // Decrement the mastering display and content light level flag when IRAP
@@ -2797,7 +2797,7 @@ static int set_side_data(HEVCContext *s) · 10 unmodified lines
27972797 ret = ff_h2645_sei_to_frame(out, &s->sei.common, AV_CODEC_ID_HEVC, s->avctx,
27982798 &s->ps.sps->vui.common,
27992799 s->ps.sps->bit_depth, s->ps.sps->bit_depth_chroma,
2800− s->ref->poc /* no poc_offset in HEVC */);
2800+ s->cur_frame->poc /* no poc_offset in HEVC */);
28012801 if (ret < 0)
28022802 return ret;
28032803
@@ -2896,12 +2896,12 @@ static int hevc_frame_start(HEVCContext *s) · 92 unmodified lines
28962896 }
28972897
28982898 if (IS_IRAP(s))
2899− s->ref->frame->flags |= AV_FRAME_FLAG_KEY;
2899+ s->cur_frame->frame->flags |= AV_FRAME_FLAG_KEY;
29002900 else
2901− s->ref->frame->flags &= ~AV_FRAME_FLAG_KEY;
2901+ s->cur_frame->frame->flags &= ~AV_FRAME_FLAG_KEY;
29022902
2903− s->ref->needs_fg = (s->sei.common.film_grain_characteristics.present ||
2904− s->sei.common.aom_film_grain.enable) &&
2903+ s->cur_frame->needs_fg = (s->sei.common.film_grain_characteristics.present ||
2904+ s->sei.common.aom_film_grain.enable) &&
29052905 !(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) &&
29062906 !s->avctx->hwaccel;
29072907
@@ -2909,21 +2909,21 @@ static int hevc_frame_start(HEVCContext *s) · 1 unmodified line
29092909 if (ret < 0)
29102910 goto fail;
29112911
2912− if (s->ref->needs_fg &&
2912+ if (s->cur_frame->needs_fg &&
29132913 (s->sei.common.film_grain_characteristics.present &&
29142914 !ff_h274_film_grain_params_supported(s->sei.common.film_grain_characteristics.model_id,
2915− s->ref->frame->format)
2916− || !av_film_grain_params_select(s->ref->frame))) {
2915+ s->cur_frame->frame->format) ||
2916+ !av_film_grain_params_select(s->cur_frame->frame))) {
29172917 av_log_once(s->avctx, AV_LOG_WARNING, AV_LOG_DEBUG, &s->film_grain_warning_shown,
29182918 "Unsupported film grain parameters. Ignoring film grain.\n");
2919− s->ref->needs_fg = 0;
2919+ s->cur_frame->needs_fg = 0;
29202920 }
29212921
2922− if (s->ref->needs_fg) {
2923− s->ref->frame_grain->format = s->ref->frame->format;
2924− s->ref->frame_grain->width = s->ref->frame->width;
2925− s->ref->frame_grain->height = s->ref->frame->height;
2926− if ((ret = ff_thread_get_buffer(s->avctx, s->ref->frame_grain, 0)) < 0)
2922+ if (s->cur_frame->needs_fg) {
2923+ s->cur_frame->frame_grain->format = s->cur_frame->frame->format;
2924+ s->cur_frame->frame_grain->width = s->cur_frame->frame->width;
2925+ s->cur_frame->frame_grain->height = s->cur_frame->frame->height;
2926+ if ((ret = ff_thread_get_buffer(s->avctx, s->cur_frame->frame_grain, 0)) < 0)
29272927 goto fail;
29282928 }
29292929
@@ -2943,15 +2943,15 @@ static int hevc_frame_start(HEVCContext *s) · 13 unmodified lines
29432943 return 0;
29442944
29452945 fail:
2946− if (s->ref)
2947− ff_hevc_unref_frame(s->ref, ~0);
2948− s->ref = s->collocated_ref = NULL;
2946+ if (s->cur_frame)
2947+ ff_hevc_unref_frame(s->cur_frame, ~0);
2948+ s->cur_frame = s->collocated_ref = NULL;
29492949 return ret;
29502950 }
29512951
29522952 static int hevc_frame_end(HEVCContext *s)
29532953 {
2954− HEVCFrame *out = s->ref;
2954+ HEVCFrame *out = s->cur_frame;
29552955 const AVFilmGrainParams *fgp;
29562956 av_unused int ret;
29572957
@@ -3086,7 +3086,7 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) · 128 unmodified lines
30863086 ret = hevc_frame_start(s);
30873087 if (ret < 0)
30883088 return ret;
3089− } else if (!s->ref) {
3089+ } else if (!s->cur_frame) {
30903090 av_log(s->avctx, AV_LOG_ERROR, "First slice in a frame missing.\n");
30913091 goto fail;
30923092 }
@@ -3169,7 +3169,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) · 76 unmodified lines
31693169 int i, ret = 0;
31703170 int eos_at_start = 1;
31713171
3172− s->ref = s->collocated_ref = NULL;
3172+ s->cur_frame = s->collocated_ref = NULL;
31733173 s->last_eos = s->eos;
31743174 s->eos = 0;
31753175 s->overlap = 0;
@@ -3248,8 +3248,8 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) · 72 unmodified lines
32483248 }
32493249
32503250 fail:
3251− if (s->ref && s->threads_type == FF_THREAD_FRAME)
3252− ff_progress_frame_report(&s->ref->tf, INT_MAX);
3251+ if (s->cur_frame && s->threads_type == FF_THREAD_FRAME)
3252+ ff_progress_frame_report(&s->cur_frame->tf, INT_MAX);
32533253
32543254 return ret;
32553255 }
@@ -3384,25 +3384,25 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 128 unmodified lines
33843384 old, s->dovi_ctx.cfg.dv_profile);
33853385 }
33863386
3387− s->ref = s->collocated_ref = NULL;
3387+ s->cur_frame = s->collocated_ref = NULL;
33883388 ret = decode_nal_units(s, avpkt->data, avpkt->size);
33893389 if (ret < 0)
33903390 return ret;
33913391
33923392 if (avctx->hwaccel) {
3393− if (s->ref && (ret = FF_HW_SIMPLE_CALL(avctx, end_frame)) < 0) {
3393+ if (s->cur_frame && (ret = FF_HW_SIMPLE_CALL(avctx, end_frame)) < 0) {
33943394 av_log(avctx, AV_LOG_ERROR,
33953395 "hardware accelerator failed to decode picture\n");
3396− ff_hevc_unref_frame(s->ref, ~0);
3396+ ff_hevc_unref_frame(s->cur_frame, ~0);
33973397 return ret;
33983398 }
33993399 } else {
34003400 /* verify the SEI checksum */
3401− if (avctx->err_recognition & AV_EF_CRCCHECK && s->ref && s->is_decoded &&
3401+ if (avctx->err_recognition & AV_EF_CRCCHECK && s->cur_frame && s->is_decoded &&
34023402 s->sei.picture_hash.is_md5) {
3403− ret = verify_md5(s, s->ref->frame);
3403+ ret = verify_md5(s, s->cur_frame->frame);
34043404 if (ret < 0 && avctx->err_recognition & AV_EF_EXPLODE) {
3405− ff_hevc_unref_frame(s->ref, ~0);
3405+ ff_hevc_unref_frame(s->cur_frame, ~0);
34063406 return ret;
34073407 }
34083408 }
libavcodec/hevcdec.h+1−1
@@ -481,7 +481,7 @@ typedef struct HEVCContext { · 480 unmodified lines
481481 DBParams *deblock;
482482 enum HEVCNALUnitType nal_unit_type;
483483 int temporal_id; ///< temporal_id_plus1 - 1
484− HEVCFrame *ref;
484+ HEVCFrame *cur_frame;
485485 HEVCFrame *collocated_ref;
486486 HEVCFrame DPB[32];
487487 int poc;
libavcodec/hevcpred_template.c+1−1
@@ -33,7 +33,7 @@ static av_always_inline void FUNC(intra_pred)(HEVCLocalContext *lc, int x0, int · 32 unmodified lines
3333 #define PU(x) \
3434 ((x) >> s->ps.sps->log2_min_pu_size)
3535 #define MVF(x, y) \
36− (s->ref->tab_mvf[(x) + (y) * min_pu_width])
36+ (s->cur_frame->tab_mvf[(x) + (y) * min_pu_width])
3737 #define MVF_PU(x, y) \
3838 MVF(PU(x0 + ((x) * (1 << hshift))), PU(y0 + ((y) * (1 << vshift))))
3939 #define IS_INTRA(x, y) \
libavcodec/mips/hevcpred_msa.c+34−34
@@ -1980,7 +1980,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 1979 unmodified lines
19801980 cand_bottom_left = 0;
19811981 for (i = 0; i < max; i += 2)
19821982 cand_bottom_left |=
1983− ((s->ref->tab_mvf[(x_left_pu) +
1983+ ((s->cur_frame->tab_mvf[(x_left_pu) +
19841984 (y_bottom_pu +
19851985 i) * min_pu_width]).pred_flag ==
19861986 PF_INTRA);
@@ -1996,7 +1996,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 9 unmodified lines
19961996 cand_left = 0;
19971997 for (i = 0; i < max; i += 2)
19981998 cand_left |=
1999− ((s->ref->tab_mvf[(x_left_pu) +
1999+ ((s->cur_frame->tab_mvf[(x_left_pu) +
20002000 (y_left_pu +
20012001 i) * min_pu_width]).pred_flag ==
20022002 PF_INTRA);
@@ -2005,7 +2005,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 2 unmodified lines
20052005 int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
20062006 int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
20072007 cand_up_left =
2008− (s->ref->tab_mvf[(x_left_pu) +
2008+ (s->cur_frame->tab_mvf[(x_left_pu) +
20092009 (y_top_pu) * min_pu_width]).pred_flag ==
20102010 PF_INTRA;
20112011 }
@@ -2020,7 +2020,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 8 unmodified lines
20202020 cand_up = 0;
20212021 for (i = 0; i < max; i += 2)
20222022 cand_up |=
2023− ((s->ref->tab_mvf[(x_top_pu + i) +
2023+ ((s->cur_frame->tab_mvf[(x_top_pu + i) +
20242024 (y_top_pu) *
20252025 min_pu_width]).pred_flag == PF_INTRA);
20262026 }
@@ -2036,7 +2036,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 9 unmodified lines
20362036 cand_up_right = 0;
20372037 for (i = 0; i < max; i += 2)
20382038 cand_up_right |=
2039− ((s->ref->tab_mvf[(x_right_pu + i) +
2039+ ((s->cur_frame->tab_mvf[(x_right_pu + i) +
20402040 (y_top_pu) *
20412041 min_pu_width]).pred_flag == PF_INTRA);
20422042 }
@@ -2107,7 +2107,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 64 unmodified lines
21072107 if (cand_bottom_left || cand_left || cand_up_left) {
21082108 while (j > -1
21092109 &&
2110− !((s->ref->tab_mvf[(((x0 +
2110+ !((s->cur_frame->tab_mvf[(((x0 +
21112111 ((-1) << hshift)) >> s->ps.sps->
21122112 log2_min_pu_size)) + (((y0 +
21132113 ((j) <<
@@ -2118,7 +2118,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 4 unmodified lines
21182118 PF_INTRA))
21192119 j--;
21202120 if (!
2121− ((s->ref->tab_mvf[(((x0 +
2121+ ((s->cur_frame->tab_mvf[(((x0 +
21222122 ((-1) << hshift)) >> s->ps.sps->
21232123 log2_min_pu_size)) + (((y0 + ((j)
21242124 <<
@@ -2129,7 +2129,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 4 unmodified lines
21292129 j = 0;
21302130 while (j < size_max_x
21312131 &&
2132− !((s->ref->tab_mvf[(((x0 +
2132+ !((s->cur_frame->tab_mvf[(((x0 +
21332133 ((j) << hshift)) >> s->ps.sps->
21342134 log2_min_pu_size)) + (((y0 +
21352135 ((-1) <<
@@ -2142,7 +2142,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 6 unmodified lines
21422142 j++;
21432143 for (i = j; i > (j) - (j + 1); i--)
21442144 if (!
2145− ((s->ref->tab_mvf[(((x0 +
2145+ ((s->cur_frame->tab_mvf[(((x0 +
21462146 ((i -
21472147 1) << hshift)) >> s->ps.sps->
21482148 log2_min_pu_size)) + (((y0 +
@@ -2160,7 +2160,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 11 unmodified lines
21602160 j = 0;
21612161 while (j < size_max_x
21622162 &&
2163− !((s->ref->tab_mvf[(((x0 +
2163+ !((s->cur_frame->tab_mvf[(((x0 +
21642164 ((j) << hshift)) >> s->ps.sps->
21652165 log2_min_pu_size)) + (((y0 + ((-1)
21662166 <<
@@ -2174,7 +2174,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 7 unmodified lines
21742174 if (x0 > 0) {
21752175 for (i = j; i > (j) - (j + 1); i--)
21762176 if (!
2177− ((s->ref->tab_mvf[(((x0 +
2177+ ((s->cur_frame->tab_mvf[(((x0 +
21782178 ((i -
21792179 1) << hshift)) >>
21802180 s->ps.sps->log2_min_pu_size))
@@ -2189,7 +2189,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 8 unmodified lines
21892189 } else {
21902190 for (i = j; i > (j) - (j); i--)
21912191 if (!
2192− ((s->ref->tab_mvf[(((x0 +
2192+ ((s->cur_frame->tab_mvf[(((x0 +
21932193 ((i -
21942194 1) << hshift)) >>
21952195 s->ps.sps->log2_min_pu_size))
@@ -2210,7 +2210,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 14 unmodified lines
22102210 a = ((left[-1]) * 0x01010101U);
22112211 for (i = 0; i < (0) + (size_max_y); i += 4)
22122212 if (!
2213− ((s->ref->tab_mvf[(((x0 +
2213+ ((s->cur_frame->tab_mvf[(((x0 +
22142214 ((-1) << hshift)) >> s->ps.sps->
22152215 log2_min_pu_size)) + (((y0 +
22162216 ((i) <<
@@ -2239,7 +2239,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 22 unmodified lines
22392239 for (i = (size_max_y - 1);
22402240 i > (size_max_y - 1) - (size_max_y); i -= 4)
22412241 if (!
2242− ((s->ref->tab_mvf[(((x0 +
2242+ ((s->cur_frame->tab_mvf[(((x0 +
22432243 ((-1) << hshift)) >> s->ps.sps->
22442244 log2_min_pu_size)) + (((y0 +
22452245 ((i -
@@ -2253,7 +2253,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 7 unmodified lines
22532253 else
22542254 a = ((left[i - 3]) * 0x01010101U);
22552255 if (!
2256− ((s->ref->tab_mvf[(((x0 +
2256+ ((s->cur_frame->tab_mvf[(((x0 +
22572257 ((-1) << hshift)) >> s->ps.sps->
22582258 log2_min_pu_size)) + (((y0 + ((-1)
22592259 <<
@@ -2273,7 +2273,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 13 unmodified lines
22732273 for (i = (size_max_y - 1);
22742274 i > (size_max_y - 1) - (size_max_y); i -= 4)
22752275 if (!
2276− ((s->ref->tab_mvf[(((x0 +
2276+ ((s->cur_frame->tab_mvf[(((x0 +
22772277 ((-1) << hshift)) >> s->ps.sps->
22782278 log2_min_pu_size)) + (((y0 +
22792279 ((i -
@@ -2292,7 +2292,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 12 unmodified lines
22922292 a = ((left[-1]) * 0x01010101U);
22932293 for (i = 0; i < (0) + (size_max_x); i += 4)
22942294 if (!
2295− ((s->ref->tab_mvf[(((x0 +
2295+ ((s->cur_frame->tab_mvf[(((x0 +
22962296 ((i) << hshift)) >> s->ps.sps->
22972297 log2_min_pu_size)) + (((y0 + ((-1)
22982298 <<
@@ -2497,7 +2497,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 198 unmodified lines
24972497 cand_bottom_left = 0;
24982498 for (i = 0; i < max; i += 2)
24992499 cand_bottom_left |=
2500− ((s->ref->tab_mvf[(x_left_pu) +
2500+ ((s->cur_frame->tab_mvf[(x_left_pu) +
25012501 (y_bottom_pu +
25022502 i) * min_pu_width]).pred_flag ==
25032503 PF_INTRA);
@@ -2513,7 +2513,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 9 unmodified lines
25132513 cand_left = 0;
25142514 for (i = 0; i < max; i += 2)
25152515 cand_left |=
2516− ((s->ref->tab_mvf[(x_left_pu) +
2516+ ((s->cur_frame->tab_mvf[(x_left_pu) +
25172517 (y_left_pu +
25182518 i) * min_pu_width]).pred_flag ==
25192519 PF_INTRA);
@@ -2522,7 +2522,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 2 unmodified lines
25222522 int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
25232523 int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
25242524 cand_up_left =
2525− (s->ref->tab_mvf[(x_left_pu) +
2525+ (s->cur_frame->tab_mvf[(x_left_pu) +
25262526 (y_top_pu) * min_pu_width]).pred_flag ==
25272527 PF_INTRA;
25282528 }
@@ -2537,7 +2537,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 8 unmodified lines
25372537 cand_up = 0;
25382538 for (i = 0; i < max; i += 2)
25392539 cand_up |=
2540− ((s->ref->tab_mvf[(x_top_pu + i) +
2540+ ((s->cur_frame->tab_mvf[(x_top_pu + i) +
25412541 (y_top_pu) *
25422542 min_pu_width]).pred_flag == PF_INTRA);
25432543 }
@@ -2553,7 +2553,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 9 unmodified lines
25532553 cand_up_right = 0;
25542554 for (i = 0; i < max; i += 2)
25552555 cand_up_right |=
2556− ((s->ref->tab_mvf[(x_right_pu + i) +
2556+ ((s->cur_frame->tab_mvf[(x_right_pu + i) +
25572557 (y_top_pu) *
25582558 min_pu_width]).pred_flag == PF_INTRA);
25592559 }
@@ -2622,7 +2622,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 62 unmodified lines
26222622 if (cand_bottom_left || cand_left || cand_up_left) {
26232623 while (j > -1
26242624 &&
2625− !((s->ref->tab_mvf[(((x0 +
2625+ !((s->cur_frame->tab_mvf[(((x0 +
26262626 ((-1) << hshift)) >> s->ps.sps->
26272627 log2_min_pu_size)) + (((y0 +
26282628 ((j) <<
@@ -2633,7 +2633,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 4 unmodified lines
26332633 PF_INTRA))
26342634 j--;
26352635 if (!
2636− ((s->ref->tab_mvf[(((x0 +
2636+ ((s->cur_frame->tab_mvf[(((x0 +
26372637 ((-1) << hshift)) >> s->ps.sps->
26382638 log2_min_pu_size)) + (((y0 + ((j)
26392639 <<
@@ -2644,7 +2644,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 4 unmodified lines
26442644 j = 0;
26452645 while (j < size_max_x
26462646 &&
2647− !((s->ref->tab_mvf[(((x0 +
2647+ !((s->cur_frame->tab_mvf[(((x0 +
26482648 ((j) << hshift)) >> s->ps.sps->
26492649 log2_min_pu_size)) + (((y0 +
26502650 ((-1) <<
@@ -2657,7 +2657,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 6 unmodified lines
26572657 j++;
26582658 for (i = j; i > (j) - (j + 1); i--)
26592659 if (!
2660− ((s->ref->tab_mvf[(((x0 +
2660+ ((s->cur_frame->tab_mvf[(((x0 +
26612661 ((i -
26622662 1) << hshift)) >> s->ps.sps->
26632663 log2_min_pu_size)) + (((y0 +
@@ -2675,7 +2675,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 11 unmodified lines
26752675 j = 0;
26762676 while (j < size_max_x
26772677 &&
2678− !((s->ref->tab_mvf[(((x0 +
2678+ !((s->cur_frame->tab_mvf[(((x0 +
26792679 ((j) << hshift)) >> s->ps.sps->
26802680 log2_min_pu_size)) + (((y0 + ((-1)
26812681 <<
@@ -2689,7 +2689,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 7 unmodified lines
26892689 if (x0 > 0) {
26902690 for (i = j; i > (j) - (j + 1); i--)
26912691 if (!
2692− ((s->ref->tab_mvf[(((x0 +
2692+ ((s->cur_frame->tab_mvf[(((x0 +
26932693 ((i -
26942694 1) << hshift)) >>
26952695 s->ps.sps->log2_min_pu_size))
@@ -2704,7 +2704,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 8 unmodified lines
27042704 } else {
27052705 for (i = j; i > (j) - (j); i--)
27062706 if (!
2707− ((s->ref->tab_mvf[(((x0 +
2707+ ((s->cur_frame->tab_mvf[(((x0 +
27082708 ((i -
27092709 1) << hshift)) >>
27102710 s->ps.sps->log2_min_pu_size))
@@ -2725,7 +2725,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 14 unmodified lines
27252725 a = ((left[-1]) * 0x01010101U);
27262726 for (i = 0; i < (0) + (size_max_y); i += 4)
27272727 if (!
2728− ((s->ref->tab_mvf[(((x0 +
2728+ ((s->cur_frame->tab_mvf[(((x0 +
27292729 ((-1) << hshift)) >> s->ps.sps->
27302730 log2_min_pu_size)) + (((y0 +
27312731 ((i) <<
@@ -2753,7 +2753,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 21 unmodified lines
27532753 for (i = (size_max_y - 1);
27542754 i > (size_max_y - 1) - (size_max_y); i -= 4)
27552755 if (!
2756− ((s->ref->tab_mvf[(((x0 +
2756+ ((s->cur_frame->tab_mvf[(((x0 +
27572757 ((-1) << hshift)) >> s->ps.sps->
27582758 log2_min_pu_size)) + (((y0 +
27592759 ((i -
@@ -2767,7 +2767,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 7 unmodified lines
27672767 else
27682768 a = ((left[i - 3]) * 0x01010101U);
27692769 if (!
2770− ((s->ref->tab_mvf[(((x0 +
2770+ ((s->cur_frame->tab_mvf[(((x0 +
27712771 ((-1) << hshift)) >> s->ps.sps->
27722772 log2_min_pu_size)) + (((y0 + ((-1)
27732773 <<
@@ -2787,7 +2787,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 13 unmodified lines
27872787 for (i = (size_max_y - 1);
27882788 i > (size_max_y - 1) - (size_max_y); i -= 4)
27892789 if (!
2790− ((s->ref->tab_mvf[(((x0 +
2790+ ((s->cur_frame->tab_mvf[(((x0 +
27912791 ((-1) << hshift)) >> s->ps.sps->
27922792 log2_min_pu_size)) + (((y0 +
27932793 ((i -
@@ -2806,7 +2806,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 12 unmodified lines
28062806 a = ((left[-1]) * 0x01010101U);
28072807 for (i = 0; i < (0) + (size_max_x); i += 4)
28082808 if (!
2809− ((s->ref->tab_mvf[(((x0 +
2809+ ((s->cur_frame->tab_mvf[(((x0 +
28102810 ((i) << hshift)) >> s->ps.sps->
28112811 log2_min_pu_size)) + (((y0 + ((-1)
28122812 <<
libavcodec/nvdec_hevc.c+3−3
@@ -84,11 +84,11 @@ static int nvdec_hevc_start_frame(AVCodecContext *avctx, · 83 unmodified lines
8484
8585 int i, j, dpb_size, ret;
8686
87− ret = ff_nvdec_start_frame(avctx, s->ref->frame);
87+ ret = ff_nvdec_start_frame(avctx, s->cur_frame->frame);
8888 if (ret < 0)
8989 return ret;
9090
91− fdd = (FrameDecodeData*)s->ref->frame->private_ref->data;
91+ fdd = (FrameDecodeData*)s->cur_frame->frame->private_ref->data;
9292 cf = (NVDECFrame*)fdd->hwaccel_priv;
9393
9494 *pp = (CUVIDPICPARAMS) {
@@ -191,7 +191,7 @@ static int nvdec_hevc_start_frame(AVCodecContext *avctx, · 96 unmodified lines
191191 .NumPocStCurrBefore = s->rps[ST_CURR_BEF].nb_refs,
192192 .NumPocStCurrAfter = s->rps[ST_CURR_AFT].nb_refs,
193193 .NumPocLtCurr = s->rps[LT_CURR].nb_refs,
194− .CurrPicOrderCntVal = s->ref->poc,
194+ .CurrPicOrderCntVal = s->cur_frame->poc,
195195 },
196196 };
197197
libavcodec/vaapi_hevc.c+9−9
@@ -71,7 +71,7 @@ static void fill_vaapi_pic(VAPictureHEVC *va_pic, const HEVCFrame *pic, int rps_ · 70 unmodified lines
7171 static int find_frame_rps_type(const HEVCContext *h, const HEVCFrame *pic)
7272 {
7373 VASurfaceID pic_surf = ff_vaapi_get_surface_id(pic->frame);
74− const HEVCFrame *current_picture = h->ref;
74+ const HEVCFrame *current_picture = h->cur_frame;
7575 int i;
7676
7777 for (i = 0; i < h->rps[ST_CURR_BEF].nb_refs; i++) {
@@ -97,7 +97,7 @@ static int find_frame_rps_type(const HEVCContext *h, const HEVCFrame *pic) · 19 unmodified lines
9797
9898 static void fill_vaapi_reference_frames(const HEVCContext *h, VAPictureParameterBufferHEVC *pp)
9999 {
100− const HEVCFrame *current_picture = h->ref;
100+ const HEVCFrame *current_picture = h->cur_frame;
101101 int i, j, rps_type;
102102
103103 for (i = 0, j = 0; i < FF_ARRAY_ELEMS(pp->ReferenceFrames); i++) {
@@ -124,7 +124,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, · 20 unmodified lines
124124 av_unused uint32_t size)
125125 {
126126 const HEVCContext *h = avctx->priv_data;
127− VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private;
127+ VAAPIDecodePictureHEVC *pic = h->cur_frame->hwaccel_picture_private;
128128 const HEVCSPS *sps = h->ps.sps;
129129 const HEVCPPS *pps = h->ps.pps;
130130
@@ -137,7 +137,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, · 6 unmodified lines
137137
138138 VAPictureParameterBufferHEVC *pic_param = (VAPictureParameterBufferHEVC *)&pic->pic_param;
139139
140− pic->pic.output_surface = ff_vaapi_get_surface_id(h->ref->frame);
140+ pic->pic.output_surface = ff_vaapi_get_surface_id(h->cur_frame->frame);
141141
142142 *pic_param = (VAPictureParameterBufferHEVC) {
143143 .pic_width_in_luma_samples = sps->width,
@@ -206,7 +206,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, · 62 unmodified lines
206206 },
207207 };
208208
209− fill_vaapi_pic(&pic_param->CurrPic, h->ref, 0);
209+ fill_vaapi_pic(&pic_param->CurrPic, h->cur_frame, 0);
210210 fill_vaapi_reference_frames(h, pic_param);
211211
212212 if (pps->tiles_enabled_flag) {
@@ -343,7 +343,7 @@ fail: · 130 unmodified lines
343343 static int vaapi_hevc_end_frame(AVCodecContext *avctx)
344344 {
345345 const HEVCContext *h = avctx->priv_data;
346− VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private;
346+ VAAPIDecodePictureHEVC *pic = h->cur_frame->hwaccel_picture_private;
347347 VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param;
348348 int ret;
349349
@@ -435,7 +435,7 @@ static void fill_pred_weight_table(AVCodecContext *avctx, · 85 unmodified lines
435435
436436 static uint8_t get_ref_pic_index(const HEVCContext *h, const HEVCFrame *frame)
437437 {
438− VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private;
438+ VAAPIDecodePictureHEVC *pic = h->cur_frame->hwaccel_picture_private;
439439 VAPictureParameterBufferHEVC *pp = (VAPictureParameterBufferHEVC *)&pic->pic_param;
440440 uint8_t i;
441441
@@ -458,7 +458,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, · 16 unmodified lines
458458 {
459459 const HEVCContext *h = avctx->priv_data;
460460 const SliceHeader *sh = &h->sh;
461− VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private;
461+ VAAPIDecodePictureHEVC *pic = h->cur_frame->hwaccel_picture_private;
462462 VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param;
463463
464464 int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ?
@@ -515,7 +515,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, · 50 unmodified lines
515515 memset(last_slice_param->RefPicList, 0xFF, sizeof(last_slice_param->RefPicList));
516516
517517 for (list_idx = 0; list_idx < nb_list; list_idx++) {
518− RefPicList *rpl = &h->ref->refPicList[list_idx];
518+ RefPicList *rpl = &h->cur_frame->refPicList[list_idx];
519519
520520 for (i = 0; i < rpl->nb_refs; i++)
521521 last_slice_param->RefPicList[list_idx][i] = get_ref_pic_index(h, rpl->ref[i]);
libavcodec/vdpau_hevc.c+5−5
@@ -35,7 +35,7 @@ static int vdpau_hevc_start_frame(AVCodecContext *avctx, · 34 unmodified lines
3535 const uint8_t *buffer, uint32_t size)
3636 {
3737 HEVCContext *h = avctx->priv_data;
38− HEVCFrame *pic = h->ref;
38+ HEVCFrame *pic = h->cur_frame;
3939 struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
4040
4141 VdpPictureInfoHEVC *info = &pic_ctx->info.hevc;
@@ -238,7 +238,7 @@ static int vdpau_hevc_start_frame(AVCodecContext *avctx, · 196 unmodified lines
238238 }
239239 for (size_t i = 0, j = 0; i < FF_ARRAY_ELEMS(h->DPB); i++) {
240240 const HEVCFrame *frame = &h->DPB[i];
241− if (frame != h->ref && (frame->flags & (HEVC_FRAME_FLAG_LONG_REF |
241+ if (frame != h->cur_frame && (frame->flags & (HEVC_FRAME_FLAG_LONG_REF |
242242 HEVC_FRAME_FLAG_SHORT_REF))) {
243243 if (j > 15) {
244244 av_log(avctx, AV_LOG_WARNING,
@@ -403,7 +403,7 @@ static int vdpau_hevc_decode_slice(AVCodecContext *avctx, · 158 unmodified lines
403403 const uint8_t *buffer, uint32_t size)
404404 {
405405 HEVCContext *h = avctx->priv_data;
406− struct vdpau_picture_context *pic_ctx = h->ref->hwaccel_picture_private;
406+ struct vdpau_picture_context *pic_ctx = h->cur_frame->hwaccel_picture_private;
407407 int val;
408408
409409 val = ff_vdpau_add_buffer(pic_ctx, start_code_prefix, 3);
@@ -420,10 +420,10 @@ static int vdpau_hevc_decode_slice(AVCodecContext *avctx, · 10 unmodified lines
420420 static int vdpau_hevc_end_frame(AVCodecContext *avctx)
421421 {
422422 HEVCContext *h = avctx->priv_data;
423− struct vdpau_picture_context *pic_ctx = h->ref->hwaccel_picture_private;
423+ struct vdpau_picture_context *pic_ctx = h->cur_frame->hwaccel_picture_private;
424424 int val;
425425
426− val = ff_vdpau_common_end_frame(avctx, h->ref->frame, pic_ctx);
426+ val = ff_vdpau_common_end_frame(avctx, h->cur_frame->frame, pic_ctx);
427427 if (val < 0)
428428 return val;
429429
libavcodec/videotoolbox.c+1−1
@@ -1075,7 +1075,7 @@ static int videotoolbox_hevc_decode_params(AVCodecContext *avctx, · 1074 unmodified lines
10751075 static int videotoolbox_hevc_end_frame(AVCodecContext *avctx)
10761076 {
10771077 HEVCContext *h = avctx->priv_data;
1078− AVFrame *frame = h->ref->frame;
1078+ AVFrame *frame = h->cur_frame->frame;
10791079 VTContext *vtctx = avctx->internal->hwaccel_priv_data;
10801080 int ret;
10811081
libavcodec/vulkan_hevc.c+3−3
@@ -731,7 +731,7 @@ static int vk_hevc_start_frame(AVCodecContext *avctx, · 730 unmodified lines
731731 {
732732 int err;
733733 HEVCContext *h = avctx->priv_data;
734− HEVCFrame *pic = h->ref;
734+ HEVCFrame *pic = h->cur_frame;
735735 FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data;
736736 HEVCVulkanDecodePicture *hp = pic->hwaccel_picture_private;
737737 FFVulkanDecodePicture *vp = &hp->vp;
@@ -851,7 +851,7 @@ static int vk_hevc_decode_slice(AVCodecContext *avctx, · 113 unmodified lines
851851 uint32_t size)
852852 {
853853 const HEVCContext *h = avctx->priv_data;
854− HEVCVulkanDecodePicture *hp = h->ref->hwaccel_picture_private;
854+ HEVCVulkanDecodePicture *hp = h->cur_frame->hwaccel_picture_private;
855855 FFVulkanDecodePicture *vp = &hp->vp;
856856
857857 int err = ff_vk_decode_add_slice(avctx, vp, data, size, 1,
@@ -867,7 +867,7 @@ static int vk_hevc_end_frame(AVCodecContext *avctx) · 9 unmodified lines
867867 {
868868 const HEVCContext *h = avctx->priv_data;
869869 FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data;
870− HEVCFrame *pic = h->ref;
870+ HEVCFrame *pic = h->cur_frame;
871871 HEVCVulkanDecodePicture *hp = pic->hwaccel_picture_private;
872872 FFVulkanDecodePicture *vp = &hp->vp;
873873 FFVulkanDecodePicture *rvp[HEVC_MAX_REFS] = { 0 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t