summaryrefslogtreecommitdiff
path: root/libavcodec/huffyuv.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-01 22:30:21 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-09 09:15:40 +0200
commit2415f5158bfbce1c974554e29772a9df76940ad9 (patch)
treec7fa194aab49f37af023fee6ec5e5bb802a88bb1 /libavcodec/huffyuv.c
parentbfdf3470f79571e33d0e02ced0ed9d3b45125a49 (diff)
downloadffmpeg-2415f5158bfbce1c974554e29772a9df76940ad9.tar.gz
avcodec/huffyuv: Use AVCodecContext.(width|height) directly
These parameters are easily accessible whereever they are accessed, so using copies from HYuvContext is unnecessary. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/huffyuv.c')
-rw-r--r--libavcodec/huffyuv.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c
index 471bfa1bb9..4a5bd53998 100644
--- a/libavcodec/huffyuv.c
+++ b/libavcodec/huffyuv.c
@@ -55,12 +55,12 @@ int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int
return 0;
}
-av_cold int ff_huffyuv_alloc_temp(HYuvContext *s)
+av_cold int ff_huffyuv_alloc_temp(HYuvContext *s, int width)
{
int i;
for (i=0; i<3; i++) {
- s->temp[i]= av_malloc(4*s->width + 16);
+ s->temp[i] = av_malloc(4 * width + 16);
if (!s->temp[i])
return AVERROR(ENOMEM);
s->temp16[i] = (uint16_t*)s->temp[i];
@@ -75,11 +75,6 @@ av_cold void ff_huffyuv_common_init(AVCodecContext *avctx)
s->flags = avctx->flags;
ff_bswapdsp_init(&s->bdsp);
-
- s->width = avctx->width;
- s->height = avctx->height;
-
- av_assert1(s->width > 0 && s->height > 0);
}
av_cold void ff_huffyuv_common_end(HYuvContext *s)