History

avcodec/j2kenc: Replace RGB24 special case by generic test

This fixes RGB48 with libavcodec as decoder

Michael Niedermayer committed 3 years ago

Commit ad4d6471 parent 7fb70d21 file · +2 −1Browse files

Unified · Split

libavcodec/j2kenc.c+2−1
@@ -1530,6 +1530,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 1529 unmodified lines
1530 int tileno, ret;1530 int tileno, ret;
1531 Jpeg2000EncoderContext *s = avctx->priv_data;1531 Jpeg2000EncoderContext *s = avctx->priv_data;
1532 uint8_t *chunkstart, *jp2cstart, *jp2hstart;1532 uint8_t *chunkstart, *jp2cstart, *jp2hstart;
1533 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
1533 1534
1534 if ((ret = ff_alloc_packet(avctx, pkt, avctx->width*avctx->height*9 + AV_INPUT_BUFFER_MIN_SIZE)) < 0)1535 if ((ret = ff_alloc_packet(avctx, pkt, avctx->width*avctx->height*9 + AV_INPUT_BUFFER_MIN_SIZE)) < 0)
1535 return ret;1536 return ret;
@@ -1586,7 +1587,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 50 unmodified lines
1586 bytestream_put_byte(&s->buf, 1);1587 bytestream_put_byte(&s->buf, 1);
1587 bytestream_put_byte(&s->buf, 0);1588 bytestream_put_byte(&s->buf, 0);
1588 bytestream_put_byte(&s->buf, 0);1589 bytestream_put_byte(&s->buf, 0);
1589 if (avctx->pix_fmt == AV_PIX_FMT_RGB24 || avctx->pix_fmt == AV_PIX_FMT_PAL8) {1590 if ((desc->flags & AV_PIX_FMT_FLAG_RGB) || avctx->pix_fmt == AV_PIX_FMT_PAL8) {
1590 bytestream_put_be32(&s->buf, 16);1591 bytestream_put_be32(&s->buf, 16);
1591 } else if (s->ncomponents == 1) {1592 } else if (s->ncomponents == 1) {
1592 bytestream_put_be32(&s->buf, 17);1593 bytestream_put_be32(&s->buf, 17);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t