aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-01 22:09:04 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-09 09:15:40 +0200
commitbfdf3470f79571e33d0e02ced0ed9d3b45125a49 (patch)
tree658fc259921cf6c1359474705404b5cf065336b0
parentf9be667452524f9e1ca9dd6e0f4e357a9b1cfaac (diff)
downloadffmpeg-bfdf3470f79571e33d0e02ced0ed9d3b45125a49.tar.gz
avcodec/huffyuvenc: Avoid unnecessary function call
av_pix_fmt_get_chroma_sub_sample() is superfluous if one already has an AVPixFmtDescriptor. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/huffyuvenc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index f903b1924a..9da344a666 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -230,9 +230,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2;
s->chroma = desc->nb_components > 2;
s->alpha = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
- av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt,
- &s->chroma_h_shift,
- &s->chroma_v_shift);
+ s->chroma_h_shift = desc->log2_chroma_w;
+ s->chroma_v_shift = desc->log2_chroma_h;
switch (avctx->pix_fmt) {
case AV_PIX_FMT_YUV420P: