summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-01 22:36:34 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-09 09:15:40 +0200
commit83a8b9fac7b03a3a9c703e2a0641ab2cc35efaae (patch)
tree16b502bba0e7682c2202565dc01d2fd2862de984
parent2415f5158bfbce1c974554e29772a9df76940ad9 (diff)
avcodec/huffyuv: Inline ff_huffyuv_common_init() in its callers
This is in preparation for splitting HYuvContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/huffyuv.c9
-rw-r--r--libavcodec/huffyuv.h1
-rw-r--r--libavcodec/huffyuvdec.c5
-rw-r--r--libavcodec/huffyuvenc.c4
4 files changed, 6 insertions, 13 deletions
diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c
index 4a5bd53998..23a2bb2537 100644
--- a/libavcodec/huffyuv.c
+++ b/libavcodec/huffyuv.c
@@ -68,15 +68,6 @@ av_cold int ff_huffyuv_alloc_temp(HYuvContext *s, int width)
return 0;
}
-av_cold void ff_huffyuv_common_init(AVCodecContext *avctx)
-{
- HYuvContext *s = avctx->priv_data;
-
- s->flags = avctx->flags;
-
- ff_bswapdsp_init(&s->bdsp);
-}
-
av_cold void ff_huffyuv_common_end(HYuvContext *s)
{
int i;
diff --git a/libavcodec/huffyuv.h b/libavcodec/huffyuv.h
index 92e390ad78..823a091809 100644
--- a/libavcodec/huffyuv.h
+++ b/libavcodec/huffyuv.h
@@ -93,7 +93,6 @@ typedef struct HYuvContext {
int non_determ; // non-deterministic, multi-threaded encoder allowed
} HYuvContext;
-void ff_huffyuv_common_init(AVCodecContext *s);
void ff_huffyuv_common_end(HYuvContext *s);
int ff_huffyuv_alloc_temp(HYuvContext *s, int width);
int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int n);
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 89db3db65a..093070e348 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -300,6 +300,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
if (ret < 0)
return ret;
+ s->flags = avctx->flags;
+
+ ff_bswapdsp_init(&s->bdsp);
ff_huffyuvdsp_init(&s->hdsp, avctx->pix_fmt);
ff_llviddsp_init(&s->llviddsp);
memset(s->vlc, 0, 4 * sizeof(VLC));
@@ -545,8 +548,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
}
- ff_huffyuv_common_init(avctx);
-
if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P || avctx->pix_fmt == AV_PIX_FMT_YUV420P) && avctx->width & 1) {
av_log(avctx, AV_LOG_ERROR, "width must be even for this colorspace\n");
return AVERROR_INVALIDDATA;
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index 0e9b24c8db..5293d32d2b 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -210,7 +210,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
const AVPixFmtDescriptor *desc;
s->avctx = avctx;
- ff_huffyuv_common_init(avctx);
+ s->flags = avctx->flags;
+
+ ff_bswapdsp_init(&s->bdsp);
ff_huffyuvencdsp_init(&s->hencdsp, avctx->pix_fmt);
ff_llvidencdsp_init(&s->llvidencdsp);