diff mbox series

[FFmpeg-devel,06/11] avcodec/j2kenc: Replace BGR48 / GRAY16 test by test for number of bits

Message ID 20230330180106.11275-6-michael@niedermayer.cc
State Accepted
Commit 7fb70d27a26bb4072edf68857636fa4343ee24a3
Headers show
Series [FFmpeg-devel,01/11] avcodec/j2kenc: fix 5/3 DWT identifer | expand

Checks

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

Commit Message

Michael Niedermayer March 30, 2023, 6:01 p.m. UTC
BGR48 is not supported and this was probably meant to be RGB48 so this fixes
RGB48 a bit

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/j2kenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index c3a7a264dc0..d837b8b949e 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -1542,7 +1542,7 @@  static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     s->lambda = s->picture->quality * LAMBDA_SCALE;
 
-    if (avctx->pix_fmt == AV_PIX_FMT_BGR48 || avctx->pix_fmt == AV_PIX_FMT_GRAY16)
+    if (s->cbps[0] > 8)
         copy_frame_16(s);
     else
         copy_frame_8(s);