aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/snow.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-25 18:57:47 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-09-28 00:17:47 +0200
commit00ba78cd6fb8fb7cbd20a36e840ddde3eda0dca0 (patch)
treec207cc176373a500d6f8b0716963868d8545eb52 /libavcodec/snow.c
parent418332e01ce99d43f218504e4e4e1b4ea89c9a49 (diff)
downloadffmpeg-00ba78cd6fb8fb7cbd20a36e840ddde3eda0dca0.tar.gz
avcodec/snow: Move decoder parts out of ff_snow_common_init_after_header
They are not common. Furthermore, this file is pulled in when linking checkasm and up until now, the calls to ff_get_buffer() and av_codec_is_decoder() caused all of libavcodec to be pulled in as well. Besides being bad size-wise this also has the downside that it pulls in avpriv_(cga|vga16)_font from libavutil which are marked as being imported from another library when building libavcodec as a DLL; this breaks checkasm because it links both lavc and lavu statically. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r--libavcodec/snow.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 09f2d60f47..90197976fb 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -21,7 +21,6 @@
#include "libavutil/log.h"
#include "libavutil/thread.h"
#include "avcodec.h"
-#include "decode.h"
#include "snow_dwt.h"
#include "snow.h"
#include "snowdata.h"
@@ -476,27 +475,15 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){
int ff_snow_common_init_after_header(AVCodecContext *avctx) {
SnowContext *s = avctx->priv_data;
int plane_index, level, orientation;
- int ret, emu_buf_size;
if(!s->scratchbuf) {
- if (av_codec_is_decoder(avctx->codec)) {
- if ((ret = ff_get_buffer(s->avctx, s->mconly_picture,
- AV_GET_BUFFER_FLAG_REF)) < 0)
- return ret;
- }
-
+ int emu_buf_size;
emu_buf_size = FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256) * (2 * MB_SIZE + HTAPS_MAX - 1);
if (!FF_ALLOCZ_TYPED_ARRAY(s->scratchbuf, FFMAX(s->mconly_picture->linesize[0], 2*avctx->width+256) * 7 * MB_SIZE) ||
!FF_ALLOCZ_TYPED_ARRAY(s->emu_edge_buffer, emu_buf_size))
return AVERROR(ENOMEM);
}
- if (av_codec_is_decoder(avctx->codec) &&
- s->mconly_picture->format != avctx->pix_fmt) {
- av_log(avctx, AV_LOG_ERROR, "pixel format changed\n");
- return AVERROR_INVALIDDATA;
- }
-
for(plane_index=0; plane_index < s->nb_planes; plane_index++){
int w= s->avctx->width;
int h= s->avctx->height;