Browse Source

avcodec/snow: Remove ff_snow_release_buffer()

Pointless after 7e41f95dce6390f39a5134a25213828ed65fac6b.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Andreas Rheinhardt 3 days ago
parent
commit
74412bd108
4 changed files with 4 additions and 14 deletions
  1. 2 11
      libavcodec/snow.c
  2. 0 1
      libavcodec/snow.h
  3. 1 1
      libavcodec/snowdec.c
  4. 1 1
      libavcodec/snowenc.c

+ 2 - 11
libavcodec/snow.c

@@ -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;

+ 0 - 1
libavcodec/snow.h

@@ -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);

+ 1 - 1
libavcodec/snowdec.c

@@ -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);

+ 1 - 1
libavcodec/snowenc.c

@@ -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;