[FFmpeg-cvslog] avcodec/flashsvenc: Remove unused z_stream

Andreas Rheinhardt git at videolan.org
Sat Sep 19 20:24:10 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Mon Sep 14 16:37:58 2020 +0200| [d1487659ee584d3b0521a894e9ea0f182edbd676] | committer: Andreas Rheinhardt

avcodec/flashsvenc: Remove unused z_stream

This encoder uses the compress2 utility function provided by zlib
instead of using a z_stream.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d1487659ee584d3b0521a894e9ea0f182edbd676
---

 libavcodec/flashsvenc.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c
index 4ac643c036..95ae988448 100644
--- a/libavcodec/flashsvenc.c
+++ b/libavcodec/flashsvenc.c
@@ -61,7 +61,6 @@ typedef struct FlashSVContext {
     int             block_width, block_height;
     uint8_t        *encbuffer;
     int             block_size;
-    z_stream        zstream;
     int             last_key_frame;
     uint8_t         tmpblock[3 * 256 * 256];
 } FlashSVContext;
@@ -92,8 +91,6 @@ static av_cold int flashsv_encode_end(AVCodecContext *avctx)
 {
     FlashSVContext *s = avctx->priv_data;
 
-    deflateEnd(&s->zstream);
-
     av_freep(&s->encbuffer);
     av_freep(&s->previous_frame);
 
@@ -112,9 +109,6 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
         return AVERROR_INVALIDDATA;
     }
 
-    // Needed if zlib unused or init aborted before deflateInit
-    memset(&s->zstream, 0, sizeof(z_stream));
-
     s->last_key_frame = 0;
 
     s->image_width  = avctx->width;
@@ -180,7 +174,6 @@ static int encode_bitstream(FlashSVContext *s, const AVFrame *p, uint8_t *buf,
                 ret = compress2(ptr + 2, &zsize, s->tmpblock,
                                 3 * cur_blk_width * cur_blk_height, 9);
 
-                //ret = deflateReset(&s->zstream);
                 if (ret != Z_OK)
                     av_log(s->avctx, AV_LOG_ERROR,
                            "error while compressing block %dx%d\n", i, j);



More information about the ffmpeg-cvslog mailing list