[FFmpeg-cvslog] avcodec/j2kenc: Replace BGR48 / GRAY16 test by test for number of bits

Michael Niedermayer git at videolan.org
Mon Oct 30 02:09:09 EET 2023


ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Thu Mar 30 18:50:26 2023 +0200| [4c07c4d29aae017584ea2a4273901c4799ea5b75] | committer: Michael Niedermayer

avcodec/j2kenc: Replace BGR48 / GRAY16 test by test for number of bits

BGR48 is not supported and this was probably meant to be RGB48 so this fixes
RGB48 a bit

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 7fb70d27a26bb4072edf68857636fa4343ee24a3)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4c07c4d29aae017584ea2a4273901c4799ea5b75
---

 libavcodec/j2kenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index fbb2f991ca..b37820278d 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);



More information about the ffmpeg-cvslog mailing list