| 798 | } |
| 799 | |
| 800 | static int frame_start(VVCContext *s, VVCFrameContext *fc, SliceContext *sc) |
| 801 | { |
| 802 | const VVCPH *ph = &fc->ps.ph; |
| 803 | const H266RawSliceHeader *rsh = sc->sh.r; |
| 804 | int ret; |
| 805 | |
| 806 | // 8.3.1 Decoding process for picture order count |
| 807 | if (!s->temporal_id && !ph->r->ph_non_ref_pic_flag && !(IS_RASL(s) || IS_RADL(s))) |
| 808 | s->poc_tid0 = ph->poc; |
| 809 | |
| 810 | decode_prefix_sei(fc, s); |
| 811 | |
| 812 | if ((ret = ff_vvc_set_new_ref(s, fc, &fc->frame)) < 0) |
| 813 | goto fail; |
| 814 | |
| 815 | ret = set_side_data(s, fc); |
| 816 | if (ret < 0) |
| 817 | goto fail; |
| 818 | |
| 819 | ret = check_film_grain(s, fc); |
| 820 | if (ret < 0) |
| 821 | goto fail; |
| 822 | |
| 823 | if (!IS_IDR(s)) |
| 824 | ff_vvc_bump_frame(s, fc); |
| 825 | |
| 826 | av_frame_unref(fc->output_frame); |
| 827 | |
| 828 | if ((ret = ff_vvc_output_frame(s, fc, fc->output_frame,rsh->sh_no_output_of_prior_pics_flag, 0)) < 0) |
| 829 | goto fail; |
| 830 | |
| 831 | if ((ret = ff_vvc_frame_rpl(s, fc, sc)) < 0) |
| 832 | goto fail; |
| 833 | |
| 834 | if ((ret = ff_vvc_frame_thread_init(fc)) < 0) |
| 835 | goto fail; |
| 836 | return 0; |
| 837 | fail: |
| 838 | if (fc->ref) |
| 839 | ff_vvc_unref_frame(fc, fc->ref, ~0); |
| 840 | fc->ref = NULL; |
| 841 | return ret; |
| 842 | } |
| 843 | |
| 844 | static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, |
| 845 | const CodedBitstreamUnit *unit, const int is_first_slice) |
no test coverage detected