Opened 11 months ago

Closed 8 months ago

#11606 closed defect (fixed)

avcodec/dvbsubenc: Broken dvb_encode_rle8

Reported by: pbk Owned by:
Priority: normal Component: avcodec
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

The rle8 encoding (256 color table) is corrupted.

The end of 8-bit/pixel_code_string shall be 2 zeroes (not one):
Current code:

*q++ = 0x00;
*q++ = 0xf0;

Correct code:

*q++ = 0x00;
*q++ = 0x00;
*q++ = 0xf0;

Change History (4)

comment:1 by waider, 8 months ago

The current DVB SUB spec (https://www.etsi.org/deliver/etsi_en/300700_300799/300743/01.06.01_60/en_300743v010601p.pdf) on p62 in Table 44: 8-bit/pixel_code_string does indeed say

| 00000000 00000000 | end of 8-bit/pixel_code_string |

However the same spec on page 45 says

end_of_string_signal: A 7-bit field filled with '000 0000'. The presence of this field, i.e. next_bits(7) == '000 0000', signals the end of the 8-bit/pixel_code_string.

Do you have a reference for your quoted text ("The end of 8-bit/pixel_code_string shall be 2 zeroes") as I can't find it or anything quite like it in the above spec.

comment:2 by pbk, 8 months ago

Hi,
I think you are missing following line in the Table 26: 8-bits per pixel code string:

8-bit_zero 8 bslbf

So, the total zero bits are 16 (8 + 1 + 7).

When I was developing my own ffmpeg TS muxer with ability to convert ttml/sgml/vwtt to DVB, I couldn't figure out what the hell is wrong. Subtitle rendering in both VLC anf MPC-HC was completely messed.
After adding the missing zero byte to the end of the string, both players started to render the subtitles perfectly.

comment:4 by Marton Balint, 8 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.