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
53{53{
54 const HEVCContext *h = avctx->priv_data;54 const HEVCContext *h = avctx->priv_data;
55 D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);55 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;
57 57
58 if (!ctx)58 if (!ctx)
59 return -1;59 return -1;
@@ -76,7 +76,7 @@ static int d3d12va_hevc_start_frame(AVCodecContext *avctx, av_unused const uint8 · 16 unmodified lines
76static int d3d12va_hevc_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)76static int d3d12va_hevc_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
77{77{
78 const HEVCContext *h = avctx->priv_data;78 const HEVCContext *h = avctx->priv_data;
79 const HEVCFrame *current_picture = h->ref;79 const HEVCFrame *current_picture = h->cur_frame;
80 HEVCDecodePictureContext *ctx_pic = current_picture->hwaccel_picture_private;80 HEVCDecodePictureContext *ctx_pic = current_picture->hwaccel_picture_private;
81 unsigned position;81 unsigned position;
82 82
@@ -99,7 +99,7 @@ static int d3d12va_hevc_decode_slice(AVCodecContext *avctx, const uint8_t *buffe · 16 unmodified lines
99static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)99static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *input_args, ID3D12Resource *buffer)
100{100{
101 const HEVCContext *h = avctx->priv_data;101 const HEVCContext *h = avctx->priv_data;
102 const HEVCFrame *current_picture = h->ref;102 const HEVCFrame *current_picture = h->cur_frame;
103 HEVCDecodePictureContext *ctx_pic = current_picture->hwaccel_picture_private;103 HEVCDecodePictureContext *ctx_pic = current_picture->hwaccel_picture_private;
104 104
105 int i;105 int i;
@@ -149,14 +149,14 @@ static int update_input_arguments(AVCodecContext *avctx, D3D12_VIDEO_DECODE_INPU · 43 unmodified lines
149static int d3d12va_hevc_end_frame(AVCodecContext *avctx)149static int d3d12va_hevc_end_frame(AVCodecContext *avctx)
150{150{
151 HEVCContext *h = avctx->priv_data;151 HEVCContext *h = avctx->priv_data;
152 HEVCDecodePictureContext *ctx_pic = h->ref->hwaccel_picture_private;152 HEVCDecodePictureContext *ctx_pic = h->cur_frame->hwaccel_picture_private;
153 153
154 int scale = ctx_pic->pp.dwCodingParamToolFlags & 1;154 int scale = ctx_pic->pp.dwCodingParamToolFlags & 1;
155 155
156 if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)156 if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
157 return -1;157 return -1;
158 158
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),
160 scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0, update_input_arguments);160 scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0, update_input_arguments);
161}161}
162 162
libavcodec/dxva2_hevc.c+6−6
@@ -61,7 +61,7 @@ void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVACo · 60 unmodified lines
61 DXVA_PicParams_HEVC *pp)61 DXVA_PicParams_HEVC *pp)
62{62{
63 const HEVCContext *h = avctx->priv_data;63 const HEVCContext *h = avctx->priv_data;
64 const HEVCFrame *current_picture = h->ref;64 const HEVCFrame *current_picture = h->cur_frame;
65 const HEVCSPS *sps = h->ps.sps;65 const HEVCSPS *sps = h->ps.sps;
66 const HEVCPPS *pps = h->ps.pps;66 const HEVCPPS *pps = h->ps.pps;
67 int i, j;67 int i, j;
@@ -245,7 +245,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, · 177 unmodified lines
245{245{
246 const HEVCContext *h = avctx->priv_data;246 const HEVCContext *h = avctx->priv_data;
247 AVDXVAContext *ctx = DXVA_CONTEXT(avctx);247 AVDXVAContext *ctx = DXVA_CONTEXT(avctx);
248 const HEVCFrame *current_picture = h->ref;248 const HEVCFrame *current_picture = h->cur_frame;
249 struct hevc_dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;249 struct hevc_dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;
250 DXVA_Slice_HEVC_Short *slice = NULL;250 DXVA_Slice_HEVC_Short *slice = NULL;
251 void *dxva_data_ptr;251 void *dxva_data_ptr;
@@ -364,7 +364,7 @@ static int dxva2_hevc_start_frame(AVCodecContext *avctx, · 112 unmodified lines
364{364{
365 const HEVCContext *h = avctx->priv_data;365 const HEVCContext *h = avctx->priv_data;
366 AVDXVAContext *ctx = DXVA_CONTEXT(avctx);366 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;
368 368
369 if (!DXVA_CONTEXT_VALID(avctx, ctx))369 if (!DXVA_CONTEXT_VALID(avctx, ctx))
370 return -1;370 return -1;
@@ -387,7 +387,7 @@ static int dxva2_hevc_decode_slice(AVCodecContext *avctx, · 16 unmodified lines
387 uint32_t size)387 uint32_t size)
388{388{
389 const HEVCContext *h = avctx->priv_data;389 const HEVCContext *h = avctx->priv_data;
390 const HEVCFrame *current_picture = h->ref;390 const HEVCFrame *current_picture = h->cur_frame;
391 struct hevc_dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;391 struct hevc_dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;
392 unsigned position;392 unsigned position;
393 393
@@ -408,14 +408,14 @@ static int dxva2_hevc_decode_slice(AVCodecContext *avctx, · 14 unmodified lines
408static int dxva2_hevc_end_frame(AVCodecContext *avctx)408static int dxva2_hevc_end_frame(AVCodecContext *avctx)
409{409{
410 HEVCContext *h = avctx->priv_data;410 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;
412 int scale = ctx_pic->pp.dwCodingParamToolFlags & 1;412 int scale = ctx_pic->pp.dwCodingParamToolFlags & 1;
413 int ret;413 int ret;
414 414
415 if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)415 if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
416 return -1;416 return -1;
417 417
418 ret = ff_dxva2_common_end_frame(avctx, h->ref->frame,418 ret = ff_dxva2_common_end_frame(avctx, h->cur_frame->frame,
419 &ctx_pic->pp, sizeof(ctx_pic->pp),419 &ctx_pic->pp, sizeof(ctx_pic->pp),
420 scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0,420 scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0,
421 commit_bitstream_and_slice_buffer);421 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
661{661{
662 if (curr->pred_flag == PF_BI && neigh->pred_flag == PF_BI) {662 if (curr->pred_flag == PF_BI && neigh->pred_flag == PF_BI) {
663 // same L0 and L1663 // same L0 and L1
664 if (s->ref->refPicList[0].list[curr->ref_idx[0]] == neigh_refPicList[0].list[neigh->ref_idx[0]] &&664 if (s->cur_frame->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]] &&665 s->cur_frame->refPicList[0].list[curr->ref_idx[0]] == s->cur_frame->refPicList[1].list[curr->ref_idx[1]] &&
666 neigh_refPicList[0].list[neigh->ref_idx[0]] == neigh_refPicList[1].list[neigh->ref_idx[1]]) {666 neigh_refPicList[0].list[neigh->ref_idx[0]] == neigh_refPicList[1].list[neigh->ref_idx[1]]) {
667 if ((FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 ||667 if ((FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 ||
668 FFABS(neigh->mv[1].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 4) &&668 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
671 return 1;671 return 1;
672 else672 else
673 return 0;673 return 0;
674 } else if (neigh_refPicList[0].list[neigh->ref_idx[0]] == s->ref->refPicList[0].list[curr->ref_idx[0]] &&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->ref->refPicList[1].list[curr->ref_idx[1]]) {675 neigh_refPicList[1].list[neigh->ref_idx[1]] == s->cur_frame->refPicList[1].list[curr->ref_idx[1]]) {
676 if (FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 ||676 if (FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 ||
677 FFABS(neigh->mv[1].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 4)677 FFABS(neigh->mv[1].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 4)
678 return 1;678 return 1;
679 else679 else
680 return 0;680 return 0;
681 } else if (neigh_refPicList[1].list[neigh->ref_idx[1]] == s->ref->refPicList[0].list[curr->ref_idx[0]] &&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->ref->refPicList[1].list[curr->ref_idx[1]]) {682 neigh_refPicList[0].list[neigh->ref_idx[0]] == s->cur_frame->refPicList[1].list[curr->ref_idx[1]]) {
683 if (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 4 ||683 if (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 4 ||
684 FFABS(neigh->mv[0].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[1].y) >= 4)684 FFABS(neigh->mv[0].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[1].y) >= 4)
685 return 1;685 return 1;
@@ -694,10 +694,10 @@ static int boundary_strength(const HEVCContext *s, const MvField *curr, const Mv · 8 unmodified lines
694 694
695 if (curr->pred_flag & 1) {695 if (curr->pred_flag & 1) {
696 A = curr->mv[0];696 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]];
698 } else {698 } else {
699 A = curr->mv[1];699 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]];
701 }701 }
702 702
703 if (neigh->pred_flag & 1) {703 if (neigh->pred_flag & 1) {
@@ -724,7 +724,7 @@ void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, · 20 unmodified lines
724 int log2_trafo_size)724 int log2_trafo_size)
725{725{
726 const HEVCContext *s = lc->parent;726 const HEVCContext *s = lc->parent;
727 const MvField *tab_mvf = s->ref->tab_mvf;727 const MvField *tab_mvf = s->cur_frame->tab_mvf;
728 int log2_min_pu_size = s->ps.sps->log2_min_pu_size;728 int log2_min_pu_size = s->ps.sps->log2_min_pu_size;
729 int log2_min_tu_size = s->ps.sps->log2_min_tb_size;729 int log2_min_tu_size = s->ps.sps->log2_min_tb_size;
730 int min_pu_width = s->ps.sps->min_pu_width;730 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
746 746
747 if (boundary_upper) {747 if (boundary_upper) {
748 const RefPicList *rpl_top = (lc->boundary_flags & BOUNDARY_UPPER_SLICE) ?748 const RefPicList *rpl_top = (lc->boundary_flags & BOUNDARY_UPPER_SLICE) ?
749 ff_hevc_get_ref_list(s, s->ref, x0, y0 - 1) :749 ff_hevc_get_ref_list(s, s->cur_frame, x0, y0 - 1) :
750 s->ref->refPicList;750 s->cur_frame->refPicList;
751 int yp_pu = (y0 - 1) >> log2_min_pu_size;751 int yp_pu = (y0 - 1) >> log2_min_pu_size;
752 int yq_pu = y0 >> log2_min_pu_size;752 int yq_pu = y0 >> log2_min_pu_size;
753 int yp_tu = (y0 - 1) >> log2_min_tu_size;753 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
784 784
785 if (boundary_left) {785 if (boundary_left) {
786 const RefPicList *rpl_left = (lc->boundary_flags & BOUNDARY_LEFT_SLICE) ?786 const RefPicList *rpl_left = (lc->boundary_flags & BOUNDARY_LEFT_SLICE) ?
787 ff_hevc_get_ref_list(s, s->ref, x0 - 1, y0) :787 ff_hevc_get_ref_list(s, s->cur_frame, x0 - 1, y0) :
788 s->ref->refPicList;788 s->cur_frame->refPicList;
789 int xp_pu = (x0 - 1) >> log2_min_pu_size;789 int xp_pu = (x0 - 1) >> log2_min_pu_size;
790 int xq_pu = x0 >> log2_min_pu_size;790 int xq_pu = x0 >> log2_min_pu_size;
791 int xp_tu = (x0 - 1) >> log2_min_tu_size;791 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
810 }810 }
811 811
812 if (log2_trafo_size > log2_min_pu_size && !is_intra) {812 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;
814 814
815 // bs for TU internal horizontal PU boundaries815 // bs for TU internal horizontal PU boundaries
816 for (j = 8; j < (1 << log2_trafo_size); j += 8) {816 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
874 if (y && x_end) {874 if (y && x_end) {
875 sao_filter_CTB(lc, s, x, y - ctb_size);875 sao_filter_CTB(lc, s, x, y - ctb_size);
876 if (s->threads_type & FF_THREAD_FRAME )876 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);
878 }878 }
879 if (x_end && y_end) {879 if (x_end && y_end) {
880 sao_filter_CTB(lc, s, x , y);880 sao_filter_CTB(lc, s, x , y);
881 if (s->threads_type & FF_THREAD_FRAME )881 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);
883 }883 }
884 } else if (s->threads_type & FF_THREAD_FRAME && x_end)884 } 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);
886}886}
887 887
888void ff_hevc_hls_filters(HEVCLocalContext *lc, int x_ctb, int y_ctb, int ctb_size)888void 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
165 int refIdxLx, Mv *mvLXCol, int X,165 int refIdxLx, Mv *mvLXCol, int X,
166 int colPic, const RefPicList *refPicList_col)166 int colPic, const RefPicList *refPicList_col)
167{167{
168 const RefPicList *refPicList = s->ref->refPicList;168 const RefPicList *refPicList = s->cur_frame->refPicList;
169 169
170 if (temp_col.pred_flag == PF_INTRA)170 if (temp_col.pred_flag == PF_INTRA)
171 return 0;171 return 0;
@@ -291,8 +291,8 @@ static void derive_spatial_merge_candidates(HEVCLocalContext *lc, const HEVCCont · 119 unmodified lines
291 int merge_idx,291 int merge_idx,
292 struct MvField mergecandlist[])292 struct MvField mergecandlist[])
293{293{
294 const RefPicList *refPicList = s->ref->refPicList;294 const RefPicList *refPicList = s->cur_frame->refPicList;
295 const MvField *tab_mvf = s->ref->tab_mvf;295 const MvField *tab_mvf = s->cur_frame->tab_mvf;
296 296
297 const int min_pu_width = s->ps.sps->min_pu_width;297 const int min_pu_width = s->ps.sps->min_pu_width;
298 298
@@ -514,8 +514,8 @@ static av_always_inline void dist_scale(const HEVCContext *s, Mv *mv, · 215 unmodified lines
514 int min_pu_width, int x, int y,514 int min_pu_width, int x, int y,
515 int elist, int ref_idx_curr, int ref_idx)515 int elist, int ref_idx_curr, int ref_idx)
516{516{
517 const RefPicList *refPicList = s->ref->refPicList;517 const RefPicList *refPicList = s->cur_frame->refPicList;
518 const MvField *tab_mvf = s->ref->tab_mvf;518 const MvField *tab_mvf = s->cur_frame->tab_mvf;
519 int ref_pic_elist = refPicList[elist].list[TAB_MVF(x, y).ref_idx[elist]];519 int ref_pic_elist = refPicList[elist].list[TAB_MVF(x, y).ref_idx[elist]];
520 int ref_pic_curr = refPicList[ref_idx_curr].list[ref_idx];520 int ref_pic_curr = refPicList[ref_idx_curr].list[ref_idx];
521 521
@@ -530,10 +530,10 @@ static av_always_inline void dist_scale(const HEVCContext *s, Mv *mv, · 8 unmodified lines
530static int mv_mp_mode_mx(const HEVCContext *s, int x, int y, int pred_flag_index,530static int mv_mp_mode_mx(const HEVCContext *s, int x, int y, int pred_flag_index,
531 Mv *mv, int ref_idx_curr, int ref_idx)531 Mv *mv, int ref_idx_curr, int ref_idx)
532{532{
533 const MvField *tab_mvf = s->ref->tab_mvf;533 const MvField *tab_mvf = s->cur_frame->tab_mvf;
534 int min_pu_width = s->ps.sps->min_pu_width;534 int min_pu_width = s->ps.sps->min_pu_width;
535 535
536 const RefPicList *refPicList = s->ref->refPicList;536 const RefPicList *refPicList = s->cur_frame->refPicList;
537 537
538 if (((TAB_MVF(x, y).pred_flag) & (1 << pred_flag_index)) &&538 if (((TAB_MVF(x, y).pred_flag) & (1 << pred_flag_index)) &&
539 refPicList[pred_flag_index].list[TAB_MVF(x, y).ref_idx[pred_flag_index]] == refPicList[ref_idx_curr].list[ref_idx]) {539 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
546static int mv_mp_mode_mx_lt(const HEVCContext *s, int x, int y, int pred_flag_index,546static int mv_mp_mode_mx_lt(const HEVCContext *s, int x, int y, int pred_flag_index,
547 Mv *mv, int ref_idx_curr, int ref_idx)547 Mv *mv, int ref_idx_curr, int ref_idx)
548{548{
549 const MvField *tab_mvf = s->ref->tab_mvf;549 const MvField *tab_mvf = s->cur_frame->tab_mvf;
550 int min_pu_width = s->ps.sps->min_pu_width;550 int min_pu_width = s->ps.sps->min_pu_width;
551 551
552 const RefPicList *refPicList = s->ref->refPicList;552 const RefPicList *refPicList = s->cur_frame->refPicList;
553 553
554 if ((TAB_MVF(x, y).pred_flag) & (1 << pred_flag_index)) {554 if ((TAB_MVF(x, y).pred_flag) & (1 << pred_flag_index)) {
555 int currIsLongTerm = refPicList[ref_idx_curr].isLongTerm[ref_idx];555 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
586 int mvp_lx_flag, int LX)586 int mvp_lx_flag, int LX)
587{587{
588 const HEVCContext *const s = lc->parent;588 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;
590 int isScaledFlag_L0 = 0;590 int isScaledFlag_L0 = 0;
591 int availableFlagLXA0 = 1;591 int availableFlagLXA0 = 1;
592 int availableFlagLXB0 = 1;592 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
144 return AVERROR(ENOMEM);144 return AVERROR(ENOMEM);
145 145
146 *frame = ref->frame;146 *frame = ref->frame;
147 s->ref = ref;147 s->cur_frame = ref;
148 s->collocated_ref = NULL;148 s->collocated_ref = NULL;
149 149
150 if (s->sh.pic_output_flag)150 if (s->sh.pic_output_flag)
@@ -282,7 +282,7 @@ void ff_hevc_bump_frame(HEVCContext *s) · 131 unmodified lines
282 282
283static int init_slice_rpl(HEVCContext *s)283static int init_slice_rpl(HEVCContext *s)
284{284{
285 HEVCFrame *frame = s->ref;285 HEVCFrame *frame = s->cur_frame;
286 int ctb_count = frame->ctb_count;286 int ctb_count = frame->ctb_count;
287 int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_segment_addr];287 int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_segment_addr];
288 int i;288 int i;
@@ -318,7 +318,7 @@ int ff_hevc_slice_rpl(HEVCContext *s) · 29 unmodified lines
318 318
319 for (list_idx = 0; list_idx < nb_list; list_idx++) {319 for (list_idx = 0; list_idx < nb_list; list_idx++) {
320 RefPicList rpl_tmp = { { 0 } };320 RefPicList rpl_tmp = { { 0 } };
321 RefPicList *rpl = &s->ref->refPicList[list_idx];321 RefPicList *rpl = &s->cur_frame->refPicList[list_idx];
322 322
323 /* The order of the elements is323 /* The order of the elements is
324 * ST_CURR_BEF - ST_CURR_AFT - LT_CURR for the L0 and324 * 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
340 }340 }
341 // Construct RefPicList0, RefPicList1 (8-8, 8-10)341 // Construct RefPicList0, RefPicList1 (8-8, 8-10)
342 if (s->ps.pps->pps_curr_pic_ref_enabled_flag && rpl_tmp.nb_refs < HEVC_MAX_REFS) {342 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;343 rpl_tmp.list[rpl_tmp.nb_refs] = s->cur_frame->poc;
344 rpl_tmp.ref[rpl_tmp.nb_refs] = s->ref;344 rpl_tmp.ref[rpl_tmp.nb_refs] = s->cur_frame;
345 rpl_tmp.isLongTerm[rpl_tmp.nb_refs] = 1;345 rpl_tmp.isLongTerm[rpl_tmp.nb_refs] = 1;
346 rpl_tmp.nb_refs++;346 rpl_tmp.nb_refs++;
347 }347 }
@@ -371,8 +371,8 @@ int ff_hevc_slice_rpl(HEVCContext *s) · 23 unmodified lines
371 if (s->ps.pps->pps_curr_pic_ref_enabled_flag &&371 if (s->ps.pps->pps_curr_pic_ref_enabled_flag &&
372 !sh->rpl_modification_flag[list_idx] &&372 !sh->rpl_modification_flag[list_idx] &&
373 rpl_tmp.nb_refs > sh->nb_refs[L0]) {373 rpl_tmp.nb_refs > sh->nb_refs[L0]) {
374 rpl->list[sh->nb_refs[L0] - 1] = s->ref->poc;374 rpl->list[sh->nb_refs[L0] - 1] = s->cur_frame->poc;
375 rpl->ref[sh->nb_refs[L0] - 1] = s->ref;375 rpl->ref[sh->nb_refs[L0] - 1] = s->cur_frame;
376 }376 }
377 377
378 if (sh->collocated_list == list_idx &&378 if (sh->collocated_list == list_idx &&
@@ -448,7 +448,7 @@ static int add_candidate_ref(HEVCContext *s, RefPicList *list, · 69 unmodified lines
448{448{
449 HEVCFrame *ref = find_ref_idx(s, poc, use_msb);449 HEVCFrame *ref = find_ref_idx(s, poc, use_msb);
450 450
451 if (ref == s->ref || list->nb_refs >= HEVC_MAX_REFS)451 if (ref == s->cur_frame || list->nb_refs >= HEVC_MAX_REFS)
452 return AVERROR_INVALIDDATA;452 return AVERROR_INVALIDDATA;
453 453
454 if (!ref) {454 if (!ref) {
@@ -483,7 +483,7 @@ int ff_hevc_frame_rps(HEVCContext *s) · 28 unmodified lines
483 for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {483 for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
484 HEVCFrame *frame = &s->DPB[i];484 HEVCFrame *frame = &s->DPB[i];
485 485
486 if (frame == s->ref)486 if (frame == s->cur_frame)
487 continue;487 continue;
488 488
489 mark_ref(frame, 0);489 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
600 600
601 // Coded parameters601 // Coded parameters
602 sh->first_slice_in_pic_flag = get_bits1(gb);602 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) {
604 av_log(s->avctx, AV_LOG_ERROR, "Two slices reporting being the first in the same frame.\n");604 av_log(s->avctx, AV_LOG_ERROR, "Two slices reporting being the first in the same frame.\n");
605 return 1; // This slice will be skipped later, do not corrupt state605 return 1; // This slice will be skipped later, do not corrupt state
606 }606 }
@@ -1935,8 +1935,8 @@ static void hls_prediction_unit(HEVCLocalContext *lc, int x0, int y0, · 1328 unmodified lines
1935 1935
1936 int min_pu_width = s->ps.sps->min_pu_width;1936 int min_pu_width = s->ps.sps->min_pu_width;
1937 1937
1938 MvField *tab_mvf = s->ref->tab_mvf;1938 MvField *tab_mvf = s->cur_frame->tab_mvf;
1939 const RefPicList *refPicList = s->ref->refPicList;1939 const RefPicList *refPicList = s->cur_frame->refPicList;
1940 const HEVCFrame *ref0 = NULL, *ref1 = NULL;1940 const HEVCFrame *ref0 = NULL, *ref1 = NULL;
1941 uint8_t *dst0 = POS(0, x0, y0);1941 uint8_t *dst0 = POS(0, x0, y0);
1942 uint8_t *dst1 = POS(1, x0, y0);1942 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
2066 2066
2067 int y_ctb = (y0 >> (s->ps.sps->log2_ctb_size)) << (s->ps.sps->log2_ctb_size);2067 int y_ctb = (y0 >> (s->ps.sps->log2_ctb_size)) << (s->ps.sps->log2_ctb_size);
2068 2068
2069 MvField *tab_mvf = s->ref->tab_mvf;2069 MvField *tab_mvf = s->cur_frame->tab_mvf;
2070 int intra_pred_mode;2070 int intra_pred_mode;
2071 int candidate[3];2071 int candidate[3];
2072 int i, j;2072 int i, j;
@@ -2221,7 +2221,7 @@ static void intra_prediction_unit_default_value(HEVCLocalContext *lc, · 148 unmodified lines
2221 int pb_size = 1 << log2_cb_size;2221 int pb_size = 1 << log2_cb_size;
2222 int size_in_pus = pb_size >> s->ps.sps->log2_min_pu_size;2222 int size_in_pus = pb_size >> s->ps.sps->log2_min_pu_size;
2223 int min_pu_width = s->ps.sps->min_pu_width;2223 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;
2225 int x_pu = x0 >> s->ps.sps->log2_min_pu_size;2225 int x_pu = x0 >> s->ps.sps->log2_min_pu_size;
2226 int y_pu = y0 >> s->ps.sps->log2_min_pu_size;2226 int y_pu = y0 >> s->ps.sps->log2_min_pu_size;
2227 int j, k;2227 int j, k;
@@ -2780,7 +2780,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) · 552 unmodified lines
2780 2780
2781static int set_side_data(HEVCContext *s)2781static int set_side_data(HEVCContext *s)
2782{2782{
2783 AVFrame *out = s->ref->frame;2783 AVFrame *out = s->cur_frame->frame;
2784 int ret;2784 int ret;
2785 2785
2786 // Decrement the mastering display and content light level flag when IRAP2786 // 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
2797 ret = ff_h2645_sei_to_frame(out, &s->sei.common, AV_CODEC_ID_HEVC, s->avctx,2797 ret = ff_h2645_sei_to_frame(out, &s->sei.common, AV_CODEC_ID_HEVC, s->avctx,
2798 &s->ps.sps->vui.common,2798 &s->ps.sps->vui.common,
2799 s->ps.sps->bit_depth, s->ps.sps->bit_depth_chroma,2799 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 */);
2801 if (ret < 0)2801 if (ret < 0)
2802 return ret;2802 return ret;
2803 2803
@@ -2896,12 +2896,12 @@ static int hevc_frame_start(HEVCContext *s) · 92 unmodified lines
2896 }2896 }
2897 2897
2898 if (IS_IRAP(s))2898 if (IS_IRAP(s))
2899 s->ref->frame->flags |= AV_FRAME_FLAG_KEY;2899 s->cur_frame->frame->flags |= AV_FRAME_FLAG_KEY;
2900 else2900 else
2901 s->ref->frame->flags &= ~AV_FRAME_FLAG_KEY;2901 s->cur_frame->frame->flags &= ~AV_FRAME_FLAG_KEY;
2902 2902
2903 s->ref->needs_fg = (s->sei.common.film_grain_characteristics.present ||2903 s->cur_frame->needs_fg = (s->sei.common.film_grain_characteristics.present ||
2904 s->sei.common.aom_film_grain.enable) &&2904 s->sei.common.aom_film_grain.enable) &&
2905 !(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) &&2905 !(s->avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) &&
2906 !s->avctx->hwaccel;2906 !s->avctx->hwaccel;
2907 2907
@@ -2909,21 +2909,21 @@ static int hevc_frame_start(HEVCContext *s) · 1 unmodified line
2909 if (ret < 0)2909 if (ret < 0)
2910 goto fail;2910 goto fail;
2911 2911
2912 if (s->ref->needs_fg &&2912 if (s->cur_frame->needs_fg &&
2913 (s->sei.common.film_grain_characteristics.present &&2913 (s->sei.common.film_grain_characteristics.present &&
2914 !ff_h274_film_grain_params_supported(s->sei.common.film_grain_characteristics.model_id,2914 !ff_h274_film_grain_params_supported(s->sei.common.film_grain_characteristics.model_id,
2915 s->ref->frame->format)2915 s->cur_frame->frame->format) ||
2916 || !av_film_grain_params_select(s->ref->frame))) {2916 !av_film_grain_params_select(s->cur_frame->frame))) {
2917 av_log_once(s->avctx, AV_LOG_WARNING, AV_LOG_DEBUG, &s->film_grain_warning_shown,2917 av_log_once(s->avctx, AV_LOG_WARNING, AV_LOG_DEBUG, &s->film_grain_warning_shown,
2918 "Unsupported film grain parameters. Ignoring film grain.\n");2918 "Unsupported film grain parameters. Ignoring film grain.\n");
2919 s->ref->needs_fg = 0;2919 s->cur_frame->needs_fg = 0;
2920 }2920 }
2921 2921
2922 if (s->ref->needs_fg) {2922 if (s->cur_frame->needs_fg) {
2923 s->ref->frame_grain->format = s->ref->frame->format;2923 s->cur_frame->frame_grain->format = s->cur_frame->frame->format;
2924 s->ref->frame_grain->width = s->ref->frame->width;2924 s->cur_frame->frame_grain->width = s->cur_frame->frame->width;
2925 s->ref->frame_grain->height = s->ref->frame->height;2925 s->cur_frame->frame_grain->height = s->cur_frame->frame->height;
2926 if ((ret = ff_thread_get_buffer(s->avctx, s->ref->frame_grain, 0)) < 0)2926 if ((ret = ff_thread_get_buffer(s->avctx, s->cur_frame->frame_grain, 0)) < 0)
2927 goto fail;2927 goto fail;
2928 }2928 }
2929 2929
@@ -2943,15 +2943,15 @@ static int hevc_frame_start(HEVCContext *s) · 13 unmodified lines
2943 return 0;2943 return 0;
2944 2944
2945fail:2945fail:
2946 if (s->ref)2946 if (s->cur_frame)
2947 ff_hevc_unref_frame(s->ref, ~0);2947 ff_hevc_unref_frame(s->cur_frame, ~0);
2948 s->ref = s->collocated_ref = NULL;2948 s->cur_frame = s->collocated_ref = NULL;
2949 return ret;2949 return ret;
2950}2950}
2951 2951
2952static int hevc_frame_end(HEVCContext *s)2952static int hevc_frame_end(HEVCContext *s)
2953{2953{
2954 HEVCFrame *out = s->ref;2954 HEVCFrame *out = s->cur_frame;
2955 const AVFilmGrainParams *fgp;2955 const AVFilmGrainParams *fgp;
2956 av_unused int ret;2956 av_unused int ret;
2957 2957
@@ -3086,7 +3086,7 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) · 128 unmodified lines
3086 ret = hevc_frame_start(s);3086 ret = hevc_frame_start(s);
3087 if (ret < 0)3087 if (ret < 0)
3088 return ret;3088 return ret;
3089 } else if (!s->ref) {3089 } else if (!s->cur_frame) {
3090 av_log(s->avctx, AV_LOG_ERROR, "First slice in a frame missing.\n");3090 av_log(s->avctx, AV_LOG_ERROR, "First slice in a frame missing.\n");
3091 goto fail;3091 goto fail;
3092 }3092 }
@@ -3169,7 +3169,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) · 76 unmodified lines
3169 int i, ret = 0;3169 int i, ret = 0;
3170 int eos_at_start = 1;3170 int eos_at_start = 1;
3171 3171
3172 s->ref = s->collocated_ref = NULL;3172 s->cur_frame = s->collocated_ref = NULL;
3173 s->last_eos = s->eos;3173 s->last_eos = s->eos;
3174 s->eos = 0;3174 s->eos = 0;
3175 s->overlap = 0;3175 s->overlap = 0;
@@ -3248,8 +3248,8 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) · 72 unmodified lines
3248 }3248 }
3249 3249
3250fail:3250fail:
3251 if (s->ref && s->threads_type == FF_THREAD_FRAME)3251 if (s->cur_frame && s->threads_type == FF_THREAD_FRAME)
3252 ff_progress_frame_report(&s->ref->tf, INT_MAX);3252 ff_progress_frame_report(&s->cur_frame->tf, INT_MAX);
3253 3253
3254 return ret;3254 return ret;
3255}3255}
@@ -3384,25 +3384,25 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 128 unmodified lines
3384 old, s->dovi_ctx.cfg.dv_profile);3384 old, s->dovi_ctx.cfg.dv_profile);
3385 }3385 }
3386 3386
3387 s->ref = s->collocated_ref = NULL;3387 s->cur_frame = s->collocated_ref = NULL;
3388 ret = decode_nal_units(s, avpkt->data, avpkt->size);3388 ret = decode_nal_units(s, avpkt->data, avpkt->size);
3389 if (ret < 0)3389 if (ret < 0)
3390 return ret;3390 return ret;
3391 3391
3392 if (avctx->hwaccel) {3392 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) {
3394 av_log(avctx, AV_LOG_ERROR,3394 av_log(avctx, AV_LOG_ERROR,
3395 "hardware accelerator failed to decode picture\n");3395 "hardware accelerator failed to decode picture\n");
3396 ff_hevc_unref_frame(s->ref, ~0);3396 ff_hevc_unref_frame(s->cur_frame, ~0);
3397 return ret;3397 return ret;
3398 }3398 }
3399 } else {3399 } else {
3400 /* verify the SEI checksum */3400 /* 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 &&
3402 s->sei.picture_hash.is_md5) {3402 s->sei.picture_hash.is_md5) {
3403 ret = verify_md5(s, s->ref->frame);3403 ret = verify_md5(s, s->cur_frame->frame);
3404 if (ret < 0 && avctx->err_recognition & AV_EF_EXPLODE) {3404 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);
3406 return ret;3406 return ret;
3407 }3407 }
3408 }3408 }
libavcodec/hevcdec.h+1−1
@@ -481,7 +481,7 @@ typedef struct HEVCContext { · 480 unmodified lines
481 DBParams *deblock;481 DBParams *deblock;
482 enum HEVCNALUnitType nal_unit_type;482 enum HEVCNALUnitType nal_unit_type;
483 int temporal_id; ///< temporal_id_plus1 - 1483 int temporal_id; ///< temporal_id_plus1 - 1
484 HEVCFrame *ref;484 HEVCFrame *cur_frame;
485 HEVCFrame *collocated_ref;485 HEVCFrame *collocated_ref;
486 HEVCFrame DPB[32];486 HEVCFrame DPB[32];
487 int poc;487 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
33#define PU(x) \33#define PU(x) \
34 ((x) >> s->ps.sps->log2_min_pu_size)34 ((x) >> s->ps.sps->log2_min_pu_size)
35#define MVF(x, y) \35#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])
37#define MVF_PU(x, y) \37#define MVF_PU(x, y) \
38 MVF(PU(x0 + ((x) * (1 << hshift))), PU(y0 + ((y) * (1 << vshift))))38 MVF(PU(x0 + ((x) * (1 << hshift))), PU(y0 + ((y) * (1 << vshift))))
39#define IS_INTRA(x, y) \39#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
1980 cand_bottom_left = 0;1980 cand_bottom_left = 0;
1981 for (i = 0; i < max; i += 2)1981 for (i = 0; i < max; i += 2)
1982 cand_bottom_left |=1982 cand_bottom_left |=
1983 ((s->ref->tab_mvf[(x_left_pu) +1983 ((s->cur_frame->tab_mvf[(x_left_pu) +
1984 (y_bottom_pu +1984 (y_bottom_pu +
1985 i) * min_pu_width]).pred_flag ==1985 i) * min_pu_width]).pred_flag ==
1986 PF_INTRA);1986 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
1996 cand_left = 0;1996 cand_left = 0;
1997 for (i = 0; i < max; i += 2)1997 for (i = 0; i < max; i += 2)
1998 cand_left |=1998 cand_left |=
1999 ((s->ref->tab_mvf[(x_left_pu) +1999 ((s->cur_frame->tab_mvf[(x_left_pu) +
2000 (y_left_pu +2000 (y_left_pu +
2001 i) * min_pu_width]).pred_flag ==2001 i) * min_pu_width]).pred_flag ==
2002 PF_INTRA);2002 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
2005 int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);2005 int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
2006 int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);2006 int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
2007 cand_up_left =2007 cand_up_left =
2008 (s->ref->tab_mvf[(x_left_pu) +2008 (s->cur_frame->tab_mvf[(x_left_pu) +
2009 (y_top_pu) * min_pu_width]).pred_flag ==2009 (y_top_pu) * min_pu_width]).pred_flag ==
2010 PF_INTRA;2010 PF_INTRA;
2011 }2011 }
@@ -2020,7 +2020,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 8 unmodified lines
2020 cand_up = 0;2020 cand_up = 0;
2021 for (i = 0; i < max; i += 2)2021 for (i = 0; i < max; i += 2)
2022 cand_up |=2022 cand_up |=
2023 ((s->ref->tab_mvf[(x_top_pu + i) +2023 ((s->cur_frame->tab_mvf[(x_top_pu + i) +
2024 (y_top_pu) *2024 (y_top_pu) *
2025 min_pu_width]).pred_flag == PF_INTRA);2025 min_pu_width]).pred_flag == PF_INTRA);
2026 }2026 }
@@ -2036,7 +2036,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 9 unmodified lines
2036 cand_up_right = 0;2036 cand_up_right = 0;
2037 for (i = 0; i < max; i += 2)2037 for (i = 0; i < max; i += 2)
2038 cand_up_right |=2038 cand_up_right |=
2039 ((s->ref->tab_mvf[(x_right_pu + i) +2039 ((s->cur_frame->tab_mvf[(x_right_pu + i) +
2040 (y_top_pu) *2040 (y_top_pu) *
2041 min_pu_width]).pred_flag == PF_INTRA);2041 min_pu_width]).pred_flag == PF_INTRA);
2042 }2042 }
@@ -2107,7 +2107,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 64 unmodified lines
2107 if (cand_bottom_left || cand_left || cand_up_left) {2107 if (cand_bottom_left || cand_left || cand_up_left) {
2108 while (j > -12108 while (j > -1
2109 &&2109 &&
2110 !((s->ref->tab_mvf[(((x0 +2110 !((s->cur_frame->tab_mvf[(((x0 +
2111 ((-1) << hshift)) >> s->ps.sps->2111 ((-1) << hshift)) >> s->ps.sps->
2112 log2_min_pu_size)) + (((y0 +2112 log2_min_pu_size)) + (((y0 +
2113 ((j) <<2113 ((j) <<
@@ -2118,7 +2118,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 4 unmodified lines
2118 PF_INTRA))2118 PF_INTRA))
2119 j--;2119 j--;
2120 if (!2120 if (!
2121 ((s->ref->tab_mvf[(((x0 +2121 ((s->cur_frame->tab_mvf[(((x0 +
2122 ((-1) << hshift)) >> s->ps.sps->2122 ((-1) << hshift)) >> s->ps.sps->
2123 log2_min_pu_size)) + (((y0 + ((j)2123 log2_min_pu_size)) + (((y0 + ((j)
2124 <<2124 <<
@@ -2129,7 +2129,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 4 unmodified lines
2129 j = 0;2129 j = 0;
2130 while (j < size_max_x2130 while (j < size_max_x
2131 &&2131 &&
2132 !((s->ref->tab_mvf[(((x0 +2132 !((s->cur_frame->tab_mvf[(((x0 +
2133 ((j) << hshift)) >> s->ps.sps->2133 ((j) << hshift)) >> s->ps.sps->
2134 log2_min_pu_size)) + (((y0 +2134 log2_min_pu_size)) + (((y0 +
2135 ((-1) <<2135 ((-1) <<
@@ -2142,7 +2142,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 6 unmodified lines
2142 j++;2142 j++;
2143 for (i = j; i > (j) - (j + 1); i--)2143 for (i = j; i > (j) - (j + 1); i--)
2144 if (!2144 if (!
2145 ((s->ref->tab_mvf[(((x0 +2145 ((s->cur_frame->tab_mvf[(((x0 +
2146 ((i -2146 ((i -
2147 1) << hshift)) >> s->ps.sps->2147 1) << hshift)) >> s->ps.sps->
2148 log2_min_pu_size)) + (((y0 +2148 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
2160 j = 0;2160 j = 0;
2161 while (j < size_max_x2161 while (j < size_max_x
2162 &&2162 &&
2163 !((s->ref->tab_mvf[(((x0 +2163 !((s->cur_frame->tab_mvf[(((x0 +
2164 ((j) << hshift)) >> s->ps.sps->2164 ((j) << hshift)) >> s->ps.sps->
2165 log2_min_pu_size)) + (((y0 + ((-1)2165 log2_min_pu_size)) + (((y0 + ((-1)
2166 <<2166 <<
@@ -2174,7 +2174,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 7 unmodified lines
2174 if (x0 > 0) {2174 if (x0 > 0) {
2175 for (i = j; i > (j) - (j + 1); i--)2175 for (i = j; i > (j) - (j + 1); i--)
2176 if (!2176 if (!
2177 ((s->ref->tab_mvf[(((x0 +2177 ((s->cur_frame->tab_mvf[(((x0 +
2178 ((i -2178 ((i -
2179 1) << hshift)) >>2179 1) << hshift)) >>
2180 s->ps.sps->log2_min_pu_size))2180 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
2189 } else {2189 } else {
2190 for (i = j; i > (j) - (j); i--)2190 for (i = j; i > (j) - (j); i--)
2191 if (!2191 if (!
2192 ((s->ref->tab_mvf[(((x0 +2192 ((s->cur_frame->tab_mvf[(((x0 +
2193 ((i -2193 ((i -
2194 1) << hshift)) >>2194 1) << hshift)) >>
2195 s->ps.sps->log2_min_pu_size))2195 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
2210 a = ((left[-1]) * 0x01010101U);2210 a = ((left[-1]) * 0x01010101U);
2211 for (i = 0; i < (0) + (size_max_y); i += 4)2211 for (i = 0; i < (0) + (size_max_y); i += 4)
2212 if (!2212 if (!
2213 ((s->ref->tab_mvf[(((x0 +2213 ((s->cur_frame->tab_mvf[(((x0 +
2214 ((-1) << hshift)) >> s->ps.sps->2214 ((-1) << hshift)) >> s->ps.sps->
2215 log2_min_pu_size)) + (((y0 +2215 log2_min_pu_size)) + (((y0 +
2216 ((i) <<2216 ((i) <<
@@ -2239,7 +2239,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 22 unmodified lines
2239 for (i = (size_max_y - 1);2239 for (i = (size_max_y - 1);
2240 i > (size_max_y - 1) - (size_max_y); i -= 4)2240 i > (size_max_y - 1) - (size_max_y); i -= 4)
2241 if (!2241 if (!
2242 ((s->ref->tab_mvf[(((x0 +2242 ((s->cur_frame->tab_mvf[(((x0 +
2243 ((-1) << hshift)) >> s->ps.sps->2243 ((-1) << hshift)) >> s->ps.sps->
2244 log2_min_pu_size)) + (((y0 +2244 log2_min_pu_size)) + (((y0 +
2245 ((i -2245 ((i -
@@ -2253,7 +2253,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 7 unmodified lines
2253 else2253 else
2254 a = ((left[i - 3]) * 0x01010101U);2254 a = ((left[i - 3]) * 0x01010101U);
2255 if (!2255 if (!
2256 ((s->ref->tab_mvf[(((x0 +2256 ((s->cur_frame->tab_mvf[(((x0 +
2257 ((-1) << hshift)) >> s->ps.sps->2257 ((-1) << hshift)) >> s->ps.sps->
2258 log2_min_pu_size)) + (((y0 + ((-1)2258 log2_min_pu_size)) + (((y0 + ((-1)
2259 <<2259 <<
@@ -2273,7 +2273,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 13 unmodified lines
2273 for (i = (size_max_y - 1);2273 for (i = (size_max_y - 1);
2274 i > (size_max_y - 1) - (size_max_y); i -= 4)2274 i > (size_max_y - 1) - (size_max_y); i -= 4)
2275 if (!2275 if (!
2276 ((s->ref->tab_mvf[(((x0 +2276 ((s->cur_frame->tab_mvf[(((x0 +
2277 ((-1) << hshift)) >> s->ps.sps->2277 ((-1) << hshift)) >> s->ps.sps->
2278 log2_min_pu_size)) + (((y0 +2278 log2_min_pu_size)) + (((y0 +
2279 ((i -2279 ((i -
@@ -2292,7 +2292,7 @@ void ff_intra_pred_8_16x16_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 12 unmodified lines
2292 a = ((left[-1]) * 0x01010101U);2292 a = ((left[-1]) * 0x01010101U);
2293 for (i = 0; i < (0) + (size_max_x); i += 4)2293 for (i = 0; i < (0) + (size_max_x); i += 4)
2294 if (!2294 if (!
2295 ((s->ref->tab_mvf[(((x0 +2295 ((s->cur_frame->tab_mvf[(((x0 +
2296 ((i) << hshift)) >> s->ps.sps->2296 ((i) << hshift)) >> s->ps.sps->
2297 log2_min_pu_size)) + (((y0 + ((-1)2297 log2_min_pu_size)) + (((y0 + ((-1)
2298 <<2298 <<
@@ -2497,7 +2497,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 198 unmodified lines
2497 cand_bottom_left = 0;2497 cand_bottom_left = 0;
2498 for (i = 0; i < max; i += 2)2498 for (i = 0; i < max; i += 2)
2499 cand_bottom_left |=2499 cand_bottom_left |=
2500 ((s->ref->tab_mvf[(x_left_pu) +2500 ((s->cur_frame->tab_mvf[(x_left_pu) +
2501 (y_bottom_pu +2501 (y_bottom_pu +
2502 i) * min_pu_width]).pred_flag ==2502 i) * min_pu_width]).pred_flag ==
2503 PF_INTRA);2503 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
2513 cand_left = 0;2513 cand_left = 0;
2514 for (i = 0; i < max; i += 2)2514 for (i = 0; i < max; i += 2)
2515 cand_left |=2515 cand_left |=
2516 ((s->ref->tab_mvf[(x_left_pu) +2516 ((s->cur_frame->tab_mvf[(x_left_pu) +
2517 (y_left_pu +2517 (y_left_pu +
2518 i) * min_pu_width]).pred_flag ==2518 i) * min_pu_width]).pred_flag ==
2519 PF_INTRA);2519 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
2522 int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);2522 int x_left_pu = ((x0 - 1) >> s->ps.sps->log2_min_pu_size);
2523 int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);2523 int y_top_pu = ((y0 - 1) >> s->ps.sps->log2_min_pu_size);
2524 cand_up_left =2524 cand_up_left =
2525 (s->ref->tab_mvf[(x_left_pu) +2525 (s->cur_frame->tab_mvf[(x_left_pu) +
2526 (y_top_pu) * min_pu_width]).pred_flag ==2526 (y_top_pu) * min_pu_width]).pred_flag ==
2527 PF_INTRA;2527 PF_INTRA;
2528 }2528 }
@@ -2537,7 +2537,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 8 unmodified lines
2537 cand_up = 0;2537 cand_up = 0;
2538 for (i = 0; i < max; i += 2)2538 for (i = 0; i < max; i += 2)
2539 cand_up |=2539 cand_up |=
2540 ((s->ref->tab_mvf[(x_top_pu + i) +2540 ((s->cur_frame->tab_mvf[(x_top_pu + i) +
2541 (y_top_pu) *2541 (y_top_pu) *
2542 min_pu_width]).pred_flag == PF_INTRA);2542 min_pu_width]).pred_flag == PF_INTRA);
2543 }2543 }
@@ -2553,7 +2553,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 9 unmodified lines
2553 cand_up_right = 0;2553 cand_up_right = 0;
2554 for (i = 0; i < max; i += 2)2554 for (i = 0; i < max; i += 2)
2555 cand_up_right |=2555 cand_up_right |=
2556 ((s->ref->tab_mvf[(x_right_pu + i) +2556 ((s->cur_frame->tab_mvf[(x_right_pu + i) +
2557 (y_top_pu) *2557 (y_top_pu) *
2558 min_pu_width]).pred_flag == PF_INTRA);2558 min_pu_width]).pred_flag == PF_INTRA);
2559 }2559 }
@@ -2622,7 +2622,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 62 unmodified lines
2622 if (cand_bottom_left || cand_left || cand_up_left) {2622 if (cand_bottom_left || cand_left || cand_up_left) {
2623 while (j > -12623 while (j > -1
2624 &&2624 &&
2625 !((s->ref->tab_mvf[(((x0 +2625 !((s->cur_frame->tab_mvf[(((x0 +
2626 ((-1) << hshift)) >> s->ps.sps->2626 ((-1) << hshift)) >> s->ps.sps->
2627 log2_min_pu_size)) + (((y0 +2627 log2_min_pu_size)) + (((y0 +
2628 ((j) <<2628 ((j) <<
@@ -2633,7 +2633,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 4 unmodified lines
2633 PF_INTRA))2633 PF_INTRA))
2634 j--;2634 j--;
2635 if (!2635 if (!
2636 ((s->ref->tab_mvf[(((x0 +2636 ((s->cur_frame->tab_mvf[(((x0 +
2637 ((-1) << hshift)) >> s->ps.sps->2637 ((-1) << hshift)) >> s->ps.sps->
2638 log2_min_pu_size)) + (((y0 + ((j)2638 log2_min_pu_size)) + (((y0 + ((j)
2639 <<2639 <<
@@ -2644,7 +2644,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 4 unmodified lines
2644 j = 0;2644 j = 0;
2645 while (j < size_max_x2645 while (j < size_max_x
2646 &&2646 &&
2647 !((s->ref->tab_mvf[(((x0 +2647 !((s->cur_frame->tab_mvf[(((x0 +
2648 ((j) << hshift)) >> s->ps.sps->2648 ((j) << hshift)) >> s->ps.sps->
2649 log2_min_pu_size)) + (((y0 +2649 log2_min_pu_size)) + (((y0 +
2650 ((-1) <<2650 ((-1) <<
@@ -2657,7 +2657,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 6 unmodified lines
2657 j++;2657 j++;
2658 for (i = j; i > (j) - (j + 1); i--)2658 for (i = j; i > (j) - (j + 1); i--)
2659 if (!2659 if (!
2660 ((s->ref->tab_mvf[(((x0 +2660 ((s->cur_frame->tab_mvf[(((x0 +
2661 ((i -2661 ((i -
2662 1) << hshift)) >> s->ps.sps->2662 1) << hshift)) >> s->ps.sps->
2663 log2_min_pu_size)) + (((y0 +2663 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
2675 j = 0;2675 j = 0;
2676 while (j < size_max_x2676 while (j < size_max_x
2677 &&2677 &&
2678 !((s->ref->tab_mvf[(((x0 +2678 !((s->cur_frame->tab_mvf[(((x0 +
2679 ((j) << hshift)) >> s->ps.sps->2679 ((j) << hshift)) >> s->ps.sps->
2680 log2_min_pu_size)) + (((y0 + ((-1)2680 log2_min_pu_size)) + (((y0 + ((-1)
2681 <<2681 <<
@@ -2689,7 +2689,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 7 unmodified lines
2689 if (x0 > 0) {2689 if (x0 > 0) {
2690 for (i = j; i > (j) - (j + 1); i--)2690 for (i = j; i > (j) - (j + 1); i--)
2691 if (!2691 if (!
2692 ((s->ref->tab_mvf[(((x0 +2692 ((s->cur_frame->tab_mvf[(((x0 +
2693 ((i -2693 ((i -
2694 1) << hshift)) >>2694 1) << hshift)) >>
2695 s->ps.sps->log2_min_pu_size))2695 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
2704 } else {2704 } else {
2705 for (i = j; i > (j) - (j); i--)2705 for (i = j; i > (j) - (j); i--)
2706 if (!2706 if (!
2707 ((s->ref->tab_mvf[(((x0 +2707 ((s->cur_frame->tab_mvf[(((x0 +
2708 ((i -2708 ((i -
2709 1) << hshift)) >>2709 1) << hshift)) >>
2710 s->ps.sps->log2_min_pu_size))2710 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
2725 a = ((left[-1]) * 0x01010101U);2725 a = ((left[-1]) * 0x01010101U);
2726 for (i = 0; i < (0) + (size_max_y); i += 4)2726 for (i = 0; i < (0) + (size_max_y); i += 4)
2727 if (!2727 if (!
2728 ((s->ref->tab_mvf[(((x0 +2728 ((s->cur_frame->tab_mvf[(((x0 +
2729 ((-1) << hshift)) >> s->ps.sps->2729 ((-1) << hshift)) >> s->ps.sps->
2730 log2_min_pu_size)) + (((y0 +2730 log2_min_pu_size)) + (((y0 +
2731 ((i) <<2731 ((i) <<
@@ -2753,7 +2753,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 21 unmodified lines
2753 for (i = (size_max_y - 1);2753 for (i = (size_max_y - 1);
2754 i > (size_max_y - 1) - (size_max_y); i -= 4)2754 i > (size_max_y - 1) - (size_max_y); i -= 4)
2755 if (!2755 if (!
2756 ((s->ref->tab_mvf[(((x0 +2756 ((s->cur_frame->tab_mvf[(((x0 +
2757 ((-1) << hshift)) >> s->ps.sps->2757 ((-1) << hshift)) >> s->ps.sps->
2758 log2_min_pu_size)) + (((y0 +2758 log2_min_pu_size)) + (((y0 +
2759 ((i -2759 ((i -
@@ -2767,7 +2767,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 7 unmodified lines
2767 else2767 else
2768 a = ((left[i - 3]) * 0x01010101U);2768 a = ((left[i - 3]) * 0x01010101U);
2769 if (!2769 if (!
2770 ((s->ref->tab_mvf[(((x0 +2770 ((s->cur_frame->tab_mvf[(((x0 +
2771 ((-1) << hshift)) >> s->ps.sps->2771 ((-1) << hshift)) >> s->ps.sps->
2772 log2_min_pu_size)) + (((y0 + ((-1)2772 log2_min_pu_size)) + (((y0 + ((-1)
2773 <<2773 <<
@@ -2787,7 +2787,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 13 unmodified lines
2787 for (i = (size_max_y - 1);2787 for (i = (size_max_y - 1);
2788 i > (size_max_y - 1) - (size_max_y); i -= 4)2788 i > (size_max_y - 1) - (size_max_y); i -= 4)
2789 if (!2789 if (!
2790 ((s->ref->tab_mvf[(((x0 +2790 ((s->cur_frame->tab_mvf[(((x0 +
2791 ((-1) << hshift)) >> s->ps.sps->2791 ((-1) << hshift)) >> s->ps.sps->
2792 log2_min_pu_size)) + (((y0 +2792 log2_min_pu_size)) + (((y0 +
2793 ((i -2793 ((i -
@@ -2806,7 +2806,7 @@ void ff_intra_pred_8_32x32_msa(HEVCLocalContext *lc, int x0, int y0, int c_idx) · 12 unmodified lines
2806 a = ((left[-1]) * 0x01010101U);2806 a = ((left[-1]) * 0x01010101U);
2807 for (i = 0; i < (0) + (size_max_x); i += 4)2807 for (i = 0; i < (0) + (size_max_x); i += 4)
2808 if (!2808 if (!
2809 ((s->ref->tab_mvf[(((x0 +2809 ((s->cur_frame->tab_mvf[(((x0 +
2810 ((i) << hshift)) >> s->ps.sps->2810 ((i) << hshift)) >> s->ps.sps->
2811 log2_min_pu_size)) + (((y0 + ((-1)2811 log2_min_pu_size)) + (((y0 + ((-1)
2812 <<2812 <<
libavcodec/nvdec_hevc.c+3−3
@@ -84,11 +84,11 @@ static int nvdec_hevc_start_frame(AVCodecContext *avctx, · 83 unmodified lines
84 84
85 int i, j, dpb_size, ret;85 int i, j, dpb_size, ret;
86 86
87 ret = ff_nvdec_start_frame(avctx, s->ref->frame);87 ret = ff_nvdec_start_frame(avctx, s->cur_frame->frame);
88 if (ret < 0)88 if (ret < 0)
89 return ret;89 return ret;
90 90
91 fdd = (FrameDecodeData*)s->ref->frame->private_ref->data;91 fdd = (FrameDecodeData*)s->cur_frame->frame->private_ref->data;
92 cf = (NVDECFrame*)fdd->hwaccel_priv;92 cf = (NVDECFrame*)fdd->hwaccel_priv;
93 93
94 *pp = (CUVIDPICPARAMS) {94 *pp = (CUVIDPICPARAMS) {
@@ -191,7 +191,7 @@ static int nvdec_hevc_start_frame(AVCodecContext *avctx, · 96 unmodified lines
191 .NumPocStCurrBefore = s->rps[ST_CURR_BEF].nb_refs,191 .NumPocStCurrBefore = s->rps[ST_CURR_BEF].nb_refs,
192 .NumPocStCurrAfter = s->rps[ST_CURR_AFT].nb_refs,192 .NumPocStCurrAfter = s->rps[ST_CURR_AFT].nb_refs,
193 .NumPocLtCurr = s->rps[LT_CURR].nb_refs,193 .NumPocLtCurr = s->rps[LT_CURR].nb_refs,
194 .CurrPicOrderCntVal = s->ref->poc,194 .CurrPicOrderCntVal = s->cur_frame->poc,
195 },195 },
196 };196 };
197 197
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
71static int find_frame_rps_type(const HEVCContext *h, const HEVCFrame *pic)71static int find_frame_rps_type(const HEVCContext *h, const HEVCFrame *pic)
72{72{
73 VASurfaceID pic_surf = ff_vaapi_get_surface_id(pic->frame);73 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;
75 int i;75 int i;
76 76
77 for (i = 0; i < h->rps[ST_CURR_BEF].nb_refs; i++) {77 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
97 97
98static void fill_vaapi_reference_frames(const HEVCContext *h, VAPictureParameterBufferHEVC *pp)98static void fill_vaapi_reference_frames(const HEVCContext *h, VAPictureParameterBufferHEVC *pp)
99{99{
100 const HEVCFrame *current_picture = h->ref;100 const HEVCFrame *current_picture = h->cur_frame;
101 int i, j, rps_type;101 int i, j, rps_type;
102 102
103 for (i = 0, j = 0; i < FF_ARRAY_ELEMS(pp->ReferenceFrames); i++) {103 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
124 av_unused uint32_t size)124 av_unused uint32_t size)
125{125{
126 const HEVCContext *h = avctx->priv_data;126 const HEVCContext *h = avctx->priv_data;
127 VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private;127 VAAPIDecodePictureHEVC *pic = h->cur_frame->hwaccel_picture_private;
128 const HEVCSPS *sps = h->ps.sps;128 const HEVCSPS *sps = h->ps.sps;
129 const HEVCPPS *pps = h->ps.pps;129 const HEVCPPS *pps = h->ps.pps;
130 130
@@ -137,7 +137,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, · 6 unmodified lines
137 137
138 VAPictureParameterBufferHEVC *pic_param = (VAPictureParameterBufferHEVC *)&pic->pic_param;138 VAPictureParameterBufferHEVC *pic_param = (VAPictureParameterBufferHEVC *)&pic->pic_param;
139 139
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);
141 141
142 *pic_param = (VAPictureParameterBufferHEVC) {142 *pic_param = (VAPictureParameterBufferHEVC) {
143 .pic_width_in_luma_samples = sps->width,143 .pic_width_in_luma_samples = sps->width,
@@ -206,7 +206,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx, · 62 unmodified lines
206 },206 },
207 };207 };
208 208
209 fill_vaapi_pic(&pic_param->CurrPic, h->ref, 0);209 fill_vaapi_pic(&pic_param->CurrPic, h->cur_frame, 0);
210 fill_vaapi_reference_frames(h, pic_param);210 fill_vaapi_reference_frames(h, pic_param);
211 211
212 if (pps->tiles_enabled_flag) {212 if (pps->tiles_enabled_flag) {
@@ -343,7 +343,7 @@ fail: · 130 unmodified lines
343static int vaapi_hevc_end_frame(AVCodecContext *avctx)343static int vaapi_hevc_end_frame(AVCodecContext *avctx)
344{344{
345 const HEVCContext *h = avctx->priv_data;345 const HEVCContext *h = avctx->priv_data;
346 VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private;346 VAAPIDecodePictureHEVC *pic = h->cur_frame->hwaccel_picture_private;
347 VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param;347 VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param;
348 int ret;348 int ret;
349 349
@@ -435,7 +435,7 @@ static void fill_pred_weight_table(AVCodecContext *avctx, · 85 unmodified lines
435 435
436static uint8_t get_ref_pic_index(const HEVCContext *h, const HEVCFrame *frame)436static uint8_t get_ref_pic_index(const HEVCContext *h, const HEVCFrame *frame)
437{437{
438 VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private;438 VAAPIDecodePictureHEVC *pic = h->cur_frame->hwaccel_picture_private;
439 VAPictureParameterBufferHEVC *pp = (VAPictureParameterBufferHEVC *)&pic->pic_param;439 VAPictureParameterBufferHEVC *pp = (VAPictureParameterBufferHEVC *)&pic->pic_param;
440 uint8_t i;440 uint8_t i;
441 441
@@ -458,7 +458,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, · 16 unmodified lines
458{458{
459 const HEVCContext *h = avctx->priv_data;459 const HEVCContext *h = avctx->priv_data;
460 const SliceHeader *sh = &h->sh;460 const SliceHeader *sh = &h->sh;
461 VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private;461 VAAPIDecodePictureHEVC *pic = h->cur_frame->hwaccel_picture_private;
462 VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param;462 VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param;
463 463
464 int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ?464 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
515 memset(last_slice_param->RefPicList, 0xFF, sizeof(last_slice_param->RefPicList));515 memset(last_slice_param->RefPicList, 0xFF, sizeof(last_slice_param->RefPicList));
516 516
517 for (list_idx = 0; list_idx < nb_list; list_idx++) {517 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];
519 519
520 for (i = 0; i < rpl->nb_refs; i++)520 for (i = 0; i < rpl->nb_refs; i++)
521 last_slice_param->RefPicList[list_idx][i] = get_ref_pic_index(h, rpl->ref[i]);521 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
35 const uint8_t *buffer, uint32_t size)35 const uint8_t *buffer, uint32_t size)
36{36{
37 HEVCContext *h = avctx->priv_data;37 HEVCContext *h = avctx->priv_data;
38 HEVCFrame *pic = h->ref;38 HEVCFrame *pic = h->cur_frame;
39 struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;39 struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
40 40
41 VdpPictureInfoHEVC *info = &pic_ctx->info.hevc;41 VdpPictureInfoHEVC *info = &pic_ctx->info.hevc;
@@ -238,7 +238,7 @@ static int vdpau_hevc_start_frame(AVCodecContext *avctx, · 196 unmodified lines
238 }238 }
239 for (size_t i = 0, j = 0; i < FF_ARRAY_ELEMS(h->DPB); i++) {239 for (size_t i = 0, j = 0; i < FF_ARRAY_ELEMS(h->DPB); i++) {
240 const HEVCFrame *frame = &h->DPB[i];240 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 |
242 HEVC_FRAME_FLAG_SHORT_REF))) {242 HEVC_FRAME_FLAG_SHORT_REF))) {
243 if (j > 15) {243 if (j > 15) {
244 av_log(avctx, AV_LOG_WARNING,244 av_log(avctx, AV_LOG_WARNING,
@@ -403,7 +403,7 @@ static int vdpau_hevc_decode_slice(AVCodecContext *avctx, · 158 unmodified lines
403 const uint8_t *buffer, uint32_t size)403 const uint8_t *buffer, uint32_t size)
404{404{
405 HEVCContext *h = avctx->priv_data;405 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;
407 int val;407 int val;
408 408
409 val = ff_vdpau_add_buffer(pic_ctx, start_code_prefix, 3);409 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
420static int vdpau_hevc_end_frame(AVCodecContext *avctx)420static int vdpau_hevc_end_frame(AVCodecContext *avctx)
421{421{
422 HEVCContext *h = avctx->priv_data;422 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;
424 int val;424 int val;
425 425
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);
427 if (val < 0)427 if (val < 0)
428 return val;428 return val;
429 429
libavcodec/videotoolbox.c+1−1
@@ -1075,7 +1075,7 @@ static int videotoolbox_hevc_decode_params(AVCodecContext *avctx, · 1074 unmodified lines
1075static int videotoolbox_hevc_end_frame(AVCodecContext *avctx)1075static int videotoolbox_hevc_end_frame(AVCodecContext *avctx)
1076{1076{
1077 HEVCContext *h = avctx->priv_data;1077 HEVCContext *h = avctx->priv_data;
1078 AVFrame *frame = h->ref->frame;1078 AVFrame *frame = h->cur_frame->frame;
1079 VTContext *vtctx = avctx->internal->hwaccel_priv_data;1079 VTContext *vtctx = avctx->internal->hwaccel_priv_data;
1080 int ret;1080 int ret;
1081 1081
libavcodec/vulkan_hevc.c+3−3
@@ -731,7 +731,7 @@ static int vk_hevc_start_frame(AVCodecContext *avctx, · 730 unmodified lines
731{731{
732 int err;732 int err;
733 HEVCContext *h = avctx->priv_data;733 HEVCContext *h = avctx->priv_data;
734 HEVCFrame *pic = h->ref;734 HEVCFrame *pic = h->cur_frame;
735 FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data;735 FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data;
736 HEVCVulkanDecodePicture *hp = pic->hwaccel_picture_private;736 HEVCVulkanDecodePicture *hp = pic->hwaccel_picture_private;
737 FFVulkanDecodePicture *vp = &hp->vp;737 FFVulkanDecodePicture *vp = &hp->vp;
@@ -851,7 +851,7 @@ static int vk_hevc_decode_slice(AVCodecContext *avctx, · 113 unmodified lines
851 uint32_t size)851 uint32_t size)
852{852{
853 const HEVCContext *h = avctx->priv_data;853 const HEVCContext *h = avctx->priv_data;
854 HEVCVulkanDecodePicture *hp = h->ref->hwaccel_picture_private;854 HEVCVulkanDecodePicture *hp = h->cur_frame->hwaccel_picture_private;
855 FFVulkanDecodePicture *vp = &hp->vp;855 FFVulkanDecodePicture *vp = &hp->vp;
856 856
857 int err = ff_vk_decode_add_slice(avctx, vp, data, size, 1,857 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
867{867{
868 const HEVCContext *h = avctx->priv_data;868 const HEVCContext *h = avctx->priv_data;
869 FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data;869 FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data;
870 HEVCFrame *pic = h->ref;870 HEVCFrame *pic = h->cur_frame;
871 HEVCVulkanDecodePicture *hp = pic->hwaccel_picture_private;871 HEVCVulkanDecodePicture *hp = pic->hwaccel_picture_private;
872 FFVulkanDecodePicture *vp = &hp->vp;872 FFVulkanDecodePicture *vp = &hp->vp;
873 FFVulkanDecodePicture *rvp[HEVC_MAX_REFS] = { 0 };873 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