Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -683,16 +683,15 @@ static void av1_frame_unref(AV1Frame *f) · 682 unmodified lines | ||
| 683 | 683 | f->coded_lossless = 0; |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | −static void av1_frame_ref(AVCodecContext *avctx, AV1Frame *dst, const AV1Frame *src) | |
| 686 | +static void av1_frame_replace(AV1Frame *dst, const AV1Frame *src) | |
| 687 | 687 | { |
| 688 | + av_assert1(dst != src); | |
| 689 | + | |
| 688 | 690 | ff_refstruct_replace(&dst->header_ref, src->header_ref); |
| 689 | 691 | |
| 690 | 692 | dst->raw_frame_header = src->raw_frame_header; |
| 691 | 693 | |
| 692 | − if (!src->f) | |
| 693 | − return; | |
| 694 | − | |
| 695 | − ff_progress_frame_ref(&dst->pf, &src->pf); | |
| 694 | + ff_progress_frame_replace(&dst->pf, &src->pf); | |
| 696 | 695 | |
| 697 | 696 | ff_refstruct_replace(&dst->hwaccel_picture_private, |
| 698 | 697 | src->hwaccel_picture_private); |
| @@ -1191,10 +1190,8 @@ static void update_reference_list(AVCodecContext *avctx) · 492 unmodified lines | ||
| 1191 | 1190 | const AV1RawFrameHeader *header = s->raw_frame_header; |
| 1192 | 1191 | |
| 1193 | 1192 | for (int i = 0; i < AV1_NUM_REF_FRAMES; i++) { |
| 1194 | − if (header->refresh_frame_flags & (1 << i)) { | |
| 1195 | − av1_frame_unref(&s->ref[i]); | |
| 1196 | − av1_frame_ref(avctx, &s->ref[i], &s->cur_frame); | |
| 1197 | − } | |
| 1193 | + if (header->refresh_frame_flags & (1 << i)) | |
| 1194 | + av1_frame_replace(&s->ref[i], &s->cur_frame); | |
| 1198 | 1195 | } |
| 1199 | 1196 | } |
| 1200 | 1197 | |
| @@ -1324,10 +1321,8 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) · 123 unmodified lines | ||
| 1324 | 1321 | s->raw_frame_header = &obu->obu.frame_header; |
| 1325 | 1322 | |
| 1326 | 1323 | if (s->raw_frame_header->show_existing_frame) { |
| 1327 | − av1_frame_unref(&s->cur_frame); | |
| 1328 | − | |
| 1329 | − av1_frame_ref(avctx, &s->cur_frame, | |
| 1330 | − &s->ref[s->raw_frame_header->frame_to_show_map_idx]); | |
| 1324 | + av1_frame_replace(&s->cur_frame, | |
| 1325 | + &s->ref[s->raw_frame_header->frame_to_show_map_idx]); | |
| 1331 | 1326 | |
| 1332 | 1327 | update_reference_list(avctx); |
| 1333 | 1328 | |