aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hevc_refs.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-10-12 16:52:49 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-10-22 22:09:59 +0200
commit315c956cbd14f021e49dac7fc0b906fad1672aad (patch)
treee16e4f55eeb57cc9c2afcf3f16a48c91d473cb08 /libavcodec/hevc_refs.c
parent86ed68420d3b60439d0b7767c53d0fdc1deb7277 (diff)
downloadffmpeg-315c956cbd14f021e49dac7fc0b906fad1672aad.tar.gz
avcodec/pthread_frame: Remove ff_thread_release_buffer()
It is unnecessary since the removal of non-thread-safe callbacks in e0786a8eeb9e7c8feb057e83f284491f0a87e463. Since then, the AVCodecContext has only been used as logcontext. Removing ff_thread_release_buffer() allowed to remove AVCodecContext* parameters from several other functions (not only unref functions, but also e.g. ff_h264_ref_picture() which calls ff_h264_unref_picture() on error). Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/hevc_refs.c')
-rw-r--r--libavcodec/hevc_refs.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c
index ae464e8e6d..793514e5d8 100644
--- a/libavcodec/hevc_refs.c
+++ b/libavcodec/hevc_refs.c
@@ -30,7 +30,7 @@
#include "refstruct.h"
#include "threadframe.h"
-void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags)
+void ff_hevc_unref_frame(HEVCFrame *frame, int flags)
{
/* frame->frame can be NULL if context init failed */
if (!frame->frame || !frame->frame->buf[0])
@@ -38,8 +38,8 @@ void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags)
frame->flags &= ~flags;
if (!frame->flags) {
- ff_thread_release_ext_buffer(s->avctx, &frame->tf);
- ff_thread_release_buffer(s->avctx, frame->frame_grain);
+ ff_thread_release_ext_buffer(&frame->tf);
+ av_frame_unref(frame->frame_grain);
frame->needs_fg = 0;
av_buffer_unref(&frame->tab_mvf_buf);
@@ -71,7 +71,7 @@ void ff_hevc_clear_refs(HEVCContext *s)
{
int i;
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++)
- ff_hevc_unref_frame(s, &s->DPB[i],
+ ff_hevc_unref_frame(&s->DPB[i],
HEVC_FRAME_FLAG_SHORT_REF |
HEVC_FRAME_FLAG_LONG_REF);
}
@@ -80,7 +80,7 @@ void ff_hevc_flush_dpb(HEVCContext *s)
{
int i;
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++)
- ff_hevc_unref_frame(s, &s->DPB[i], ~0);
+ ff_hevc_unref_frame(&s->DPB[i], ~0);
}
static HEVCFrame *alloc_frame(HEVCContext *s)
@@ -126,7 +126,7 @@ static HEVCFrame *alloc_frame(HEVCContext *s)
return frame;
fail:
- ff_hevc_unref_frame(s, frame, ~0);
+ ff_hevc_unref_frame(frame, ~0);
return NULL;
}
av_log(s->avctx, AV_LOG_ERROR, "Error allocating frame, DPB full.\n");
@@ -177,7 +177,7 @@ static void unref_missing_refs(HEVCContext *s)
for (int i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
HEVCFrame *frame = &s->DPB[i];
if (frame->sequence == HEVC_SEQUENCE_COUNTER_INVALID) {
- ff_hevc_unref_frame(s, frame, ~0);
+ ff_hevc_unref_frame(frame, ~0);
}
}
}
@@ -191,7 +191,7 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
if ((frame->flags & mask) == HEVC_FRAME_FLAG_OUTPUT &&
frame->sequence != s->seq_decode) {
if (s->sh.no_output_of_prior_pics_flag == 1)
- ff_hevc_unref_frame(s, frame, HEVC_FRAME_FLAG_OUTPUT);
+ ff_hevc_unref_frame(frame, HEVC_FRAME_FLAG_OUTPUT);
else
frame->flags |= HEVC_FRAME_FLAG_BUMPING;
}
@@ -224,9 +224,9 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
ret = av_frame_ref(out, frame->needs_fg ? frame->frame_grain : frame->frame);
if (frame->flags & HEVC_FRAME_FLAG_BUMPING)
- ff_hevc_unref_frame(s, frame, HEVC_FRAME_FLAG_OUTPUT | HEVC_FRAME_FLAG_BUMPING);
+ ff_hevc_unref_frame(frame, HEVC_FRAME_FLAG_OUTPUT | HEVC_FRAME_FLAG_BUMPING);
else
- ff_hevc_unref_frame(s, frame, HEVC_FRAME_FLAG_OUTPUT);
+ ff_hevc_unref_frame(frame, HEVC_FRAME_FLAG_OUTPUT);
if (ret < 0)
return ret;
@@ -532,7 +532,7 @@ int ff_hevc_frame_rps(HEVCContext *s)
fail:
/* release any frames that are now unused */
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++)
- ff_hevc_unref_frame(s, &s->DPB[i], 0);
+ ff_hevc_unref_frame(&s->DPB[i], 0);
return ret;
}