You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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>
This commit is contained in:
@@ -68,15 +68,6 @@ av_cold int ff_huffyuv_alloc_temp(HYuvContext *s, int width)
|
|||||||
return 0;
|
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)
|
av_cold void ff_huffyuv_common_end(HYuvContext *s)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@@ -93,7 +93,6 @@ typedef struct HYuvContext {
|
|||||||
int non_determ; // non-deterministic, multi-threaded encoder allowed
|
int non_determ; // non-deterministic, multi-threaded encoder allowed
|
||||||
} HYuvContext;
|
} HYuvContext;
|
||||||
|
|
||||||
void ff_huffyuv_common_init(AVCodecContext *s);
|
|
||||||
void ff_huffyuv_common_end(HYuvContext *s);
|
void ff_huffyuv_common_end(HYuvContext *s);
|
||||||
int ff_huffyuv_alloc_temp(HYuvContext *s, int width);
|
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);
|
int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, int n);
|
||||||
|
@@ -300,6 +300,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
s->flags = avctx->flags;
|
||||||
|
|
||||||
|
ff_bswapdsp_init(&s->bdsp);
|
||||||
ff_huffyuvdsp_init(&s->hdsp, avctx->pix_fmt);
|
ff_huffyuvdsp_init(&s->hdsp, avctx->pix_fmt);
|
||||||
ff_llviddsp_init(&s->llviddsp);
|
ff_llviddsp_init(&s->llviddsp);
|
||||||
memset(s->vlc, 0, 4 * sizeof(VLC));
|
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) {
|
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");
|
av_log(avctx, AV_LOG_ERROR, "width must be even for this colorspace\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
@@ -210,7 +210,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
|||||||
const AVPixFmtDescriptor *desc;
|
const AVPixFmtDescriptor *desc;
|
||||||
|
|
||||||
s->avctx = avctx;
|
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_huffyuvencdsp_init(&s->hencdsp, avctx->pix_fmt);
|
||||||
ff_llvidencdsp_init(&s->llvidencdsp);
|
ff_llvidencdsp_init(&s->llvidencdsp);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user