1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/snow: Remove ff_snow_release_buffer()

Pointless after 7e41f95dce.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-03-09 04:52:50 +01:00
parent b0af322654
commit 74412bd108
4 changed files with 4 additions and 14 deletions

View File

@ -511,27 +511,18 @@ int ff_snow_common_init_after_header(AVCodecContext *avctx) {
return 0;
}
void ff_snow_release_buffer(AVCodecContext *avctx)
{
SnowContext *s = avctx->priv_data;
if(s->last_picture[s->max_ref_frames-1]->data[0]){
av_frame_unref(s->last_picture[s->max_ref_frames-1]);
}
}
int ff_snow_frames_prepare(SnowContext *s)
{
AVFrame *tmp;
ff_snow_release_buffer(s->avctx);
tmp= s->last_picture[s->max_ref_frames-1];
for (int i = s->max_ref_frames - 1; i > 0; i--)
s->last_picture[i] = s->last_picture[i-1];
s->last_picture[0] = s->current_picture;
s->current_picture = tmp;
av_frame_unref(s->current_picture);
if(s->keyframe){
s->ref_frames= 0;
s->current_picture->flags |= AV_FRAME_FLAG_KEY;

View File

@ -181,7 +181,6 @@ extern int ff_scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES];
int ff_snow_common_init(AVCodecContext *avctx);
int ff_snow_common_init_after_header(AVCodecContext *avctx);
void ff_snow_common_end(SnowContext *s);
void ff_snow_release_buffer(AVCodecContext *avctx);
void ff_snow_reset_contexts(SnowContext *s);
int ff_snow_alloc_blocks(SnowContext *s);
int ff_snow_frames_prepare(SnowContext *s);

View File

@ -781,7 +781,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
emms_c();
ff_snow_release_buffer(avctx);
av_frame_unref(s->last_picture[s->max_ref_frames - 1]);
if(!(s->avctx->debug&2048))
res = av_frame_ref(picture, s->current_picture);

View File

@ -2039,7 +2039,7 @@ redo_frame:
update_last_header_values(s);
ff_snow_release_buffer(avctx);
av_frame_unref(s->last_picture[s->max_ref_frames - 1]);
s->current_picture->pict_type = pic->pict_type;
s->current_picture->quality = pic->quality;