diff mbox series

[FFmpeg-devel,10/14] avcodec/huffyuvenc: Avoid unnecessary function call

Message ID GV1P250MB0737089657222A822DF1152C8F589@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit bfdf3470f79571e33d0e02ced0ed9d3b45125a49
Headers show
Series [FFmpeg-devel,01/14] avcodec/ylc: Remove inclusion of huffyuvdsp.h | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 2, 2022, 12:06 a.m. UTC
av_pix_fmt_get_chroma_sub_sample() is superfluous if one
already has an AVPixFmtDescriptor.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/huffyuvenc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

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: