Hi! Trying to encode 256-colour subtitles to dvbsub currently fails in the "region" section, a hunk of Joolz' patch was not committed six years ago. Attached patch has two hunks: The forgotten hunk from the original patch and further up a fix that I created now (to be committed separately): The line separator from the ETSI DVB blue book was missing for rle8 encodings.
Please comment, Carl Eugen
From 06fd4904b6aa04c3ab8e056ef4f6be4a89093a1c Mon Sep 17 00:00:00 2001 From: JULIAN GARDNER <joo...@btinternet.com> Date: Tue, 24 Oct 2017 01:59:51 +0200 Subject: [PATCH] lavc/dvbsub: Allow 256 colour encoding. Fixes ticket #6769. --- libavcodec/dvbsub.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/dvbsub.c b/libavcodec/dvbsub.c index 3cdbade..8cce702 100644 --- a/libavcodec/dvbsub.c +++ b/libavcodec/dvbsub.c @@ -239,9 +239,9 @@ static void dvb_encode_rle8(uint8_t **pq, x += len; } /* end of line */ - // 00000000 00000000 end of 8-bit/pixel_code_string - *q++ = 0x00; + // 00000000 end of 8-bit/pixel_code_string *q++ = 0x00; + *q++ = 0xf0; bitmap += linesize; } *pq = q; @@ -342,6 +342,9 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s, } else if (h->rects[region_id]->nb_colors <= 16) { /* 4 bpp, standard encoding */ bpp_index = 1; + } else if (h->rects[region_id]->nb_colors <= 256) { + /* 8 bpp, standard encoding */ + bpp_index = 2; } else { return -1; } -- 1.7.10.4
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel