From ff10772ec5fd0d641515f48d8b92f098abb37945 Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 22:15:05 +0100 Subject: [PATCH 01/15] feat(subtitle): VobSub and DVB subtitle decoders, returning the PGS decoder's display sets --- internal/testdata/dvbsub.mkv | Bin 0 -> 52913 bytes internal/testdata/dvbsub_set13.png | Bin 0 -> 6674 bytes internal/testdata/vobsub.mkv | Bin 0 -> 126848 bytes internal/testdata/vobsub_cue0.png | Bin 0 -> 3601 bytes mkv/subtitle/bitmap.go | 60 +++ mkv/subtitle/bitmap_samples_test.go | 243 ++++++++++ mkv/subtitle/dvbsub.go | 686 ++++++++++++++++++++++++++++ mkv/subtitle/dvbsub_test.go | 542 ++++++++++++++++++++++ mkv/subtitle/parse_fuzz_test.go | 58 +++ mkv/subtitle/pgs.go | 4 + mkv/subtitle/vobsub.go | 305 +++++++++++++ mkv/subtitle/vobsub_test.go | 292 ++++++++++++ 12 files changed, 2190 insertions(+) create mode 100644 internal/testdata/dvbsub.mkv create mode 100644 internal/testdata/dvbsub_set13.png create mode 100644 internal/testdata/vobsub.mkv create mode 100644 internal/testdata/vobsub_cue0.png create mode 100644 mkv/subtitle/bitmap.go create mode 100644 mkv/subtitle/bitmap_samples_test.go create mode 100644 mkv/subtitle/dvbsub.go create mode 100644 mkv/subtitle/dvbsub_test.go create mode 100644 mkv/subtitle/vobsub.go create mode 100644 mkv/subtitle/vobsub_test.go diff --git a/internal/testdata/dvbsub.mkv b/internal/testdata/dvbsub.mkv new file mode 100644 index 0000000000000000000000000000000000000000..d9d2e3ebfb6c15a1071915a4ad6db3b4fb718848 GIT binary patch literal 52913 zcmb__3wT^-dFISGiFJV)OQn!HbBcIr9ipbvJ)pEfUIOox(m&| z@ArNGIsci9EZO9VN9X+Kod5in@Bc3E_x;~_?%r?Sbyqk)n-0H+e`~W>g-^`(gpKAe zzj^xTuO9oQH-`%-Iz5}YcK@j(=@kF_%zqhp?SG%X@7}q$tbO`*uf6B(`#&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Hcad>ZhuK8Onr(F&}~M z^7!KTqQ$;3yq-mfBvfL#H~*?{FkJXzU__gqFSzCl`a4`l-X-x7coja-1sSAik(S8?3>exO*Tfsgr&lR)&Xwv z=EE+HwcWg74=swR5*qccs$L2$D;-!ZUqscJ3dp!s9_Q$CavE8sN-xivx&COyoxfWA zx7^8uEj;wC)JcSnYvN3h*t+_@t|-1{|5T)GQS>#OUdFt>WA#~?`Do<67(teH4|~55 z66b1BMn3b=A1X^5Sf8qvFze{?TKrs;u1c!1JK@3O3)~lv^b-2pbsj%NRa{~XF7%Q) zyLdK(?U3)32(N+x|5R!6;DR-^;y&mFZ+^DH>|cZ;B68NO5wlE?wH}w_qTQW{Ceq&V zBYu#49T3hp^?OmMmoTaptc1-5>FkSZlf?9=LwsVB?96B}NIQYdlp!`+Cqz-X{sA>! n)>EIGP!#O;=l{Q6a~3QzPi;PFvC$6uw%9qHzieN5E-?9D<-7LN literal 0 HcmV?d00001 diff --git a/mkv/subtitle/bitmap.go b/mkv/subtitle/bitmap.go new file mode 100644 index 00000000..0bfba992 --- /dev/null +++ b/mkv/subtitle/bitmap.go @@ -0,0 +1,60 @@ +package subtitle + +// bitmap.go - what the bitmap subtitle decoders (PGS, VobSub, DVB) hand back: pictures and where they sit on the +// subtitle plane, in one shape whatever the codec. + +import "image" + +// BitmapDisplaySet is one decoded display set of any bitmap subtitle codec: the type PGSDisplaySet names, which the +// VobSub and DVB decoders return as well. +type BitmapDisplaySet = PGSDisplaySet + +// BitmapObject is one picture of a BitmapDisplaySet: the type PGSObject names. +type BitmapObject = PGSObject + +// trimTransparent cuts a picture down to the rectangle its visible pixels cover, and says where that rectangle +// starts in the original; nil when no pixel is visible. +func trimTransparent(img *image.NRGBA) (*image.NRGBA, image.Point) { + w, h := img.Rect.Dx(), img.Rect.Dy() + rowVisible := func(y int) bool { + row := img.Pix[y*img.Stride : y*img.Stride+4*w] + for i := 3; i < len(row); i += 4 { + if row[i] != 0 { + return true + } + } + return false + } + top, bottom := 0, h + for top < h && !rowVisible(top) { + top++ + } + if top == h { + return nil, image.Point{} + } + for !rowVisible(bottom - 1) { + bottom-- + } + left, right := w, 0 + for y := top; y < bottom; y++ { + row := img.Pix[y*img.Stride : y*img.Stride+4*w] + for x := 0; x < left; x++ { + if row[4*x+3] != 0 { + left = x + } + } + for x := w - 1; x >= right; x-- { + if row[4*x+3] != 0 { + right = x + 1 + } + } + } + if top == 0 && left == 0 && bottom == h && right == w { + return img, image.Point{} + } + out := image.NewNRGBA(image.Rect(0, 0, right-left, bottom-top)) + for y := top; y < bottom; y++ { + copy(out.Pix[(y-top)*out.Stride:(y-top+1)*out.Stride], img.Pix[y*img.Stride+4*left:]) + } + return out, image.Pt(left, top) +} diff --git a/mkv/subtitle/bitmap_samples_test.go b/mkv/subtitle/bitmap_samples_test.go new file mode 100644 index 00000000..885fef8f --- /dev/null +++ b/mkv/subtitle/bitmap_samples_test.go @@ -0,0 +1,243 @@ +package subtitle_test + +// Real tracks: a DVD's VobSub and a broadcast's DVB subtitles, each remuxed to Matroska with its packets untouched. +// The golden pictures are the mainstream decoder's rendering of one display set on the whole subtitle plane. + +import ( + "context" + "image" + "image/png" + "io" + "os" + "testing" + + "github.com/gravity-zero/mkvgo/mkv" + "github.com/gravity-zero/mkvgo/mkv/reader" + "github.com/gravity-zero/mkvgo/mkv/subtitle" +) + +const ( + vobsubSample = "../../internal/testdata/vobsub.mkv" + dvbsubSample = "../../internal/testdata/dvbsub.mkv" +) + +// sampleTrack reads the one track of a sample and all its blocks. +func sampleTrack(tb testing.TB, path string) (*mkv.Track, []mkv.Block) { + tb.Helper() + c, err := reader.Open(context.Background(), path) + if err != nil { + tb.Fatal(err) + } + f, err := os.Open(path) + if err != nil { + tb.Fatal(err) + } + defer f.Close() + br, err := reader.NewBlockReader(f, c.Info.TimecodeScale) + if err != nil { + tb.Fatal(err) + } + var blocks []mkv.Block + for { + b, err := br.Next() + if err == io.EOF { + return &c.Tracks[0], blocks + } + if err != nil { + tb.Fatal(err) + } + b.Data = append([]byte(nil), b.Data...) + blocks = append(blocks, b) + } +} + +// planeDiff counts the pixels of the subtitle plane where a display set and the golden rendering differ; two fully +// transparent pixels are the same whatever colour they carry. +func planeDiff(tb testing.TB, ds subtitle.BitmapDisplaySet, golden string) int { + tb.Helper() + f, err := os.Open(golden) + if err != nil { + tb.Fatal(err) + } + defer f.Close() + decoded, err := png.Decode(f) + if err != nil { + tb.Fatal(err) + } + ref, ok := decoded.(*image.NRGBA) + if !ok || ref.Bounds().Dx() != ds.ScreenW || ref.Bounds().Dy() != ds.ScreenH { + tb.Fatalf("%s is a %T of %v, want an NRGBA of the %dx%d plane", golden, decoded, decoded.Bounds().Size(), ds.ScreenW, ds.ScreenH) + } + plane := image.NewNRGBA(ref.Bounds()) + for _, o := range ds.Objects { + b := o.Image.Bounds() + for y := 0; y < b.Dy(); y++ { + src := o.Image.Pix[y*o.Image.Stride : y*o.Image.Stride+4*b.Dx()] + copy(plane.Pix[plane.PixOffset(o.X, o.Y+y):], src) + } + } + diff := 0 + for i := 0; i < len(ref.Pix); i += 4 { + if ref.Pix[i+3] == 0 && plane.Pix[i+3] == 0 { + continue + } + if [4]byte(ref.Pix[i:i+4]) != [4]byte(plane.Pix[i:i+4]) { + diff++ + } + } + return diff +} + +type sampleCue struct { + timeMs, durMs int64 + x, y, w, h int +} + +func TestVobSubDecoder_RealTrack(t *testing.T) { + track, blocks := sampleTrack(t, vobsubSample) + if track.Codec != "vobsub" || len(blocks) != 46 { + t.Fatalf("sample holds a %q track of %d blocks, want vobsub and 46", track.Codec, len(blocks)) + } + d, err := subtitle.NewVobSubDecoder(track.CodecPrivate) + if err != nil { + t.Fatal(err) + } + var cues []sampleCue + var first subtitle.BitmapDisplaySet + for i, b := range blocks { + sets, err := d.Decode(b.Data) + if err != nil { + t.Fatalf("block %d at %d ms: %v", i, b.Timecode, err) + } + for _, ds := range sets { + if ds.ScreenW != 720 || ds.ScreenH != 480 || len(ds.Objects) != 1 || ds.Objects[0].Forced || ds.Delay != 0 { + t.Fatalf("block %d: plane %dx%d, %d objects, delay %v; want one unforced picture on 720x480, undelayed", i, ds.ScreenW, ds.ScreenH, len(ds.Objects), ds.Delay) + } + if len(cues) == 0 { + first = ds + } + o := ds.Objects[0] + cues = append(cues, sampleCue{b.Timecode, ds.Duration.Milliseconds(), o.X, o.Y, o.Image.Bounds().Dx(), o.Image.Bounds().Dy()}) + } + } + // Three of the 46 blocks hold the first part of a unit the muxer cut in two. + if len(cues) != 43 { + t.Fatalf("got %d cues, want 43", len(cues)) + } + for i, want := range map[int]sampleCue{ + 0: {132499, 4960, 259, 379, 200, 24}, + 1: {147355, 4733, 259, 76, 203, 63}, + 4: {185919, 2696, 234, 340, 250, 63}, // a unit over two blocks + 42: {359834, 1262, 232, 379, 254, 24}, + } { + if cues[i] != want { + t.Errorf("cue %d = %+v, want %+v", i, cues[i], want) + } + } + if n := planeDiff(t, first, "../../internal/testdata/vobsub_cue0.png"); n != 0 { + t.Errorf("the first cue differs from its golden rendering on %d pixels", n) + } +} + +func TestDVBSubDecoder_RealTrack(t *testing.T) { + track, blocks := sampleTrack(t, dvbsubSample) + if track.Codec != "dvbsub" || len(blocks) != 46 { + t.Fatalf("sample holds a %q track of %d blocks, want dvbsub and 46", track.Codec, len(blocks)) + } + d, err := subtitle.NewDVBSubDecoder(track.CodecPrivate) + if err != nil { + t.Fatal(err) + } + type shown struct { + timeMs int64 + objects []sampleCue + } + var sets []shown + var golden subtitle.BitmapDisplaySet + for i, b := range blocks { + got, err := d.Decode(b.Data) + if err != nil { + t.Fatalf("block %d at %d ms: %v", i, b.Timecode, err) + } + if len(got) != 1 || got[0].ScreenW != 720 || got[0].ScreenH != 576 || got[0].Delay != 0 || got[0].Duration != 0 { + t.Fatalf("block %d: %d sets; want one, untimed, on 720x576", i, len(got)) + } + s := shown{timeMs: b.Timecode} + for _, o := range got[0].Objects { + s.objects = append(s.objects, sampleCue{x: o.X, y: o.Y, w: o.Image.Bounds().Dx(), h: o.Image.Bounds().Dy()}) + } + sets = append(sets, s) + if i == 13 { + golden = got[0] + } + } + // The screen is empty for the first seven display sets and the last three; the 36 between each show a picture. + for i, s := range sets { + if clear := i < 7 || i > 42; clear != (len(s.objects) == 0) { + t.Errorf("set %d at %d ms shows %d objects", i, s.timeMs, len(s.objects)) + } + } + for i, want := range map[int]shown{ + 7: {15600, []sampleCue{{x: 78, y: 416, w: 88, h: 36}}}, + 12: {17400, []sampleCue{{x: 78, y: 416, w: 406, h: 36}}}, // the line, word after word + 13: {17760, []sampleCue{{x: 78, y: 380, w: 406, h: 36}, {x: 78, y: 416, w: 148, h: 36}}}, + 42: {29360, []sampleCue{{x: 78, y: 380, w: 460, h: 36}, {x: 78, y: 416, w: 178, h: 36}}}, + 43: {31040, nil}, + } { + got := sets[i] + if got.timeMs != want.timeMs || len(got.objects) != len(want.objects) { + t.Errorf("set %d = %+v, want %+v", i, got, want) + continue + } + for k := range want.objects { + if got.objects[k] != want.objects[k] { + t.Errorf("set %d object %d = %+v, want %+v", i, k, got.objects[k], want.objects[k]) + } + } + } + if n := planeDiff(t, golden, "../../internal/testdata/dvbsub_set13.png"); n != 0 { + t.Errorf("display set 13 differs from its golden rendering on %d pixels", n) + } +} + +// decodeTrack is what a benchmark iteration does: a fresh decoder over every block of the track. +func decodeTrack(b *testing.B, blocks []mkv.Block, decode func([]byte) ([]subtitle.BitmapDisplaySet, error)) { + for _, blk := range blocks { + if _, err := decode(blk.Data); err != nil { + b.Fatal(err) + } + } +} + +func trackBytes(blocks []mkv.Block) (n int64) { + for _, b := range blocks { + n += int64(len(b.Data)) + } + return n +} + +func BenchmarkVobSubTrack(b *testing.B) { + track, blocks := sampleTrack(b, vobsubSample) + b.SetBytes(trackBytes(blocks)) + b.ReportAllocs() + for b.Loop() { + d, err := subtitle.NewVobSubDecoder(track.CodecPrivate) + if err != nil { + b.Fatal(err) + } + decodeTrack(b, blocks, d.Decode) + } +} + +func BenchmarkDVBSubTrack(b *testing.B) { + track, blocks := sampleTrack(b, dvbsubSample) + b.SetBytes(trackBytes(blocks)) + b.ReportAllocs() + for b.Loop() { + d, err := subtitle.NewDVBSubDecoder(track.CodecPrivate) + if err != nil { + b.Fatal(err) + } + decodeTrack(b, blocks, d.Decode) + } +} diff --git a/mkv/subtitle/dvbsub.go b/mkv/subtitle/dvbsub.go new file mode 100644 index 00000000..d358689a --- /dev/null +++ b/mkv/subtitle/dvbsub.go @@ -0,0 +1,686 @@ +package subtitle + +// dvbsub.go - a decoder for DVB subtitles (S_DVBSUB, ETSI EN 300 743), the bitmap subtitles of broadcast captures. +// A Matroska block holds the segments of one display set: a page composition listing the regions on screen, and the +// region compositions, colour tables (CLUT) and objects that changed. An object is a run-length picture drawn into +// every region that lists it; a region is a rectangle of 2, 4 or 8-bit pixels read through its CLUT. +// +// State spans blocks: within an epoch a display set carries only what changed, so regions, their pixels and the +// CLUTs are kept until a page composition declares a mode change or an acquisition point. Blocks are fed in file +// order; a region the read never saw defined is left out, not invented. +// +// Written from the specification, not ported: mkvgo is MIT and links no third-party subtitle decoder. + +import ( + "encoding/binary" + "fmt" + "image" +) + +const dvbSync = 0x0f // the first byte of every segment + +// Segment types. +const ( + dvbSegPage = 0x10 + dvbSegRegion = 0x11 + dvbSegCLUT = 0x12 + dvbSegObject = 0x13 + dvbSegDisplay = 0x14 + dvbSegEnd = 0x80 +) + +// Pixel-data sub-block types of an object. +const ( + dvbData2Bit = 0x10 + dvbData4Bit = 0x11 + dvbData8Bit = 0x12 + dvbMap2To4 = 0x20 + dvbMap2To8 = 0x21 + dvbMap4To8 = 0x22 + dvbDataEndRow = 0xf0 +) + +const ( + // dvbMaxDim is the widest and tallest display the format defines, and so the bound on a region. + dvbMaxDim = 4096 + // dvbMaxEpochBytes bounds what an epoch's regions hold together: they live until the next mode change. + dvbMaxEpochBytes = 16 << 20 + // dvbMaxBlockPixels bounds the work of one block, counted in pixels filled, drawn and handed back. + dvbMaxBlockPixels = 4 * dvbMaxDim * dvbMaxDim + // dvbObjectRefBytes is what one object reference of a region counts for in dvbMaxEpochBytes. + dvbObjectRefBytes = 24 +) + +// dvbCLUT is one CLUT family: the colours of 2, 4 and 8-bit pixels, straight RGBA. +type dvbCLUT struct { + c4 [4][4]uint8 + c16 [16][4]uint8 + c256 [256][4]uint8 +} + +var dvbDefaultCLUT = newDVBDefaultCLUT() + +// newDVBDefaultCLUT builds the contents every CLUT has before a definition changes them (clause 10). +func newDVBDefaultCLUT() *dvbCLUT { + bit := func(i, mask, v int) uint8 { + if i&mask != 0 { + return uint8(v) + } + return 0 + } + c := &dvbCLUT{} + c.c4 = [4][4]uint8{{}, {255, 255, 255, 255}, {0, 0, 0, 255}, {127, 127, 127, 255}} + for i := 1; i < 16; i++ { + v := 255 + if i&8 != 0 { + v = 127 + } + c.c16[i] = [4]uint8{bit(i, 1, v), bit(i, 2, v), bit(i, 4, v), 255} + } + for i := 1; i < 256; i++ { + rgb := func(low, high, base int) [3]uint8 { + return [3]uint8{ + uint8(base) + bit(i, 0x01, low) + bit(i, 0x10, high), + uint8(base) + bit(i, 0x02, low) + bit(i, 0x20, high), + uint8(base) + bit(i, 0x04, low) + bit(i, 0x40, high), + } + } + var p [3]uint8 + a := uint8(255) + switch { + case i&0x88 == 0 && i&0x70 == 0: + p, a = rgb(255, 0, 0), 63 + case i&0x88 == 0: + p = rgb(85, 170, 0) + case i&0x88 == 0x08: + p, a = rgb(85, 170, 0), 127 + case i&0x88 == 0x80: + p = rgb(43, 85, 127) + default: + p = rgb(43, 85, 0) + } + c.c256[i] = [4]uint8{p[0], p[1], p[2], a} + } + return c +} + +type dvbObjectRef struct { + id uint16 + x, y int +} + +// dvbRegion is a region's pixels, as CLUT entries, and the objects that draw into it. +type dvbRegion struct { + w, h, depth int + clut uint8 + pix []byte + objects []dvbObjectRef +} + +type dvbPlacement struct { + region uint8 + x, y int +} + +// DVBSubDecoder decodes a DVB subtitle track block by block, carrying epoch state forward. +type DVBSubDecoder struct { + pages [2]uint16 // composition and ancillary page + anyPage bool + screenW, screenH int // 0 until a display definition says otherwise + winX, winY int + regions map[uint8]*dvbRegion + cluts map[uint8]*dvbCLUT + page []dvbPlacement + held int // what the epoch's regions hold (dvbMaxEpochBytes) + budget int // what the block being decoded may still fill and draw (dvbMaxBlockPixels) +} + +// NewDVBSubDecoder reads the composition and ancillary page IDs from the track's CodecPrivate, the segments of +// other pages being another service's; with no CodecPrivate every page is decoded. +func NewDVBSubDecoder(codecPrivate []byte) (*DVBSubDecoder, error) { + d := &DVBSubDecoder{} + switch { + case len(codecPrivate) == 0: + d.anyPage = true + case len(codecPrivate) >= 4: + d.pages = [2]uint16{binary.BigEndian.Uint16(codecPrivate), binary.BigEndian.Uint16(codecPrivate[2:])} + default: + return nil, fmt.Errorf("DVB subtitle: the track's CodecPrivate holds %d byte(s), the two page IDs take 4", len(codecPrivate)) + } + return d, nil +} + +// Reset drops the epoch: call it when the read skips blocks, so a display set cannot draw on another part's regions. +func (d *DVBSubDecoder) Reset() { + d.regions, d.cluts, d.page, d.held = nil, nil, nil, 0 + d.screenW, d.screenH, d.winX, d.winY = 0, 0, 0, 0 +} + +// Decode decodes one Matroska block into the display sets it completes, almost always one: a set's objects are the +// regions on screen, each cut down to its visible pixels, and a set with none clears the screen. +// +// A block of a track stored compressed (mkv.Track.Compression) is decoded first: mkv.Track.DecodePayload. +func (d *DVBSubDecoder) Decode(block []byte) ([]BitmapDisplaySet, error) { + var out []BitmapDisplaySet + d.budget = dvbMaxBlockPixels + composed := false // a page composition is waiting for the end of its display set + emit := func() error { + ds, err := d.compose() + out = append(out, ds) + composed = false + return err + } + + b := block + if len(b) >= 2 && b[0] == 0x20 && b[1] == 0x00 { // the PES data field's own header, when a muxer kept it + b = b[2:] + } + for len(b) > 0 && b[0] != 0xff { + if b[0] != dvbSync { + return nil, fmt.Errorf("DVB subtitle: byte %#02x where a segment starts with %#02x", b[0], dvbSync) + } + if len(b) < 6 { + return nil, fmt.Errorf("DVB subtitle: %d trailing byte(s) where a segment header needs 6", len(b)) + } + typ, page, size := b[1], binary.BigEndian.Uint16(b[2:]), int(binary.BigEndian.Uint16(b[4:])) + if size > len(b)-6 { + return nil, fmt.Errorf("DVB subtitle: a %#02x segment declares %d bytes, %d remain in the block", typ, size, len(b)-6) + } + p := b[6 : 6+size] + b = b[6+size:] + if !d.anyPage && page != d.pages[0] && page != d.pages[1] { + continue + } + var err error + switch typ { + case dvbSegPage: + if composed { // the display set before this one left out its end segment + err = emit() + } + if err == nil { + err = d.parsePage(p) + composed = err == nil + } + case dvbSegRegion: + err = d.parseRegion(p) + case dvbSegCLUT: + err = d.parseCLUT(p) + case dvbSegObject: + err = d.parseObject(p) + case dvbSegDisplay: + err = d.parseDisplay(p) + case dvbSegEnd: + if composed { + err = emit() + } + } + if err != nil { + return nil, err + } + } + if composed { + if err := emit(); err != nil { + return nil, err + } + } + return out, nil +} + +// spend takes n pixels of work from the block's budget. +func (d *DVBSubDecoder) spend(n int) error { + if d.budget -= n; d.budget < 0 { + return fmt.Errorf("DVB subtitle: the block fills and draws more than %d pixels", dvbMaxBlockPixels) + } + return nil +} + +func (d *DVBSubDecoder) parseDisplay(p []byte) error { + if len(p) < 5 { + return fmt.Errorf("DVB subtitle: a display definition segment needs 5 bytes, got %d", len(p)) + } + d.screenW = int(binary.BigEndian.Uint16(p[1:])) + 1 + d.screenH = int(binary.BigEndian.Uint16(p[3:])) + 1 + d.winX, d.winY = 0, 0 + if p[0]&0x08 != 0 { + if len(p) < 13 { + return fmt.Errorf("DVB subtitle: a display definition segment declares a window and holds %d of its 13 bytes", len(p)) + } + d.winX, d.winY = int(binary.BigEndian.Uint16(p[5:])), int(binary.BigEndian.Uint16(p[9:])) + } + return nil +} + +// parsePage replaces the list of regions on screen; a mode change or an acquisition point starts a new epoch. +func (d *DVBSubDecoder) parsePage(p []byte) error { + const head, entry = 2, 6 + if len(p) < head || (len(p)-head)%entry != 0 { + return fmt.Errorf("DVB subtitle: a page composition segment holds %d bytes, not %d plus %d a region", len(p), head, entry) + } + if state := p[1] >> 2 & 3; state == 1 || state == 2 { + d.regions, d.cluts, d.held = nil, nil, 0 + } + d.page = d.page[:0] + for e := p[head:]; len(e) > 0; e = e[entry:] { + d.page = append(d.page, dvbPlacement{region: e[0], x: int(binary.BigEndian.Uint16(e[2:])), y: int(binary.BigEndian.Uint16(e[4:]))}) + } + return nil +} + +// parseRegion defines or updates a region: its size and depth, its fill, and the objects that draw into it. +func (d *DVBSubDecoder) parseRegion(p []byte) error { + const head = 10 + if len(p) < head { + return fmt.Errorf("DVB subtitle: a region composition segment needs %d bytes, got %d", head, len(p)) + } + id, fill := p[0], p[1]&0x08 != 0 + w, h := int(binary.BigEndian.Uint16(p[2:])), int(binary.BigEndian.Uint16(p[4:])) + if w < 1 || h < 1 || w > dvbMaxDim || h > dvbMaxDim { + return fmt.Errorf("DVB subtitle: region %d is %dx%d, outside 1..%d", id, w, h, dvbMaxDim) + } + var depth int + var background byte + switch p[6] >> 2 & 7 { + case 1: + depth, background = 2, p[9]>>2&3 + case 2: + depth, background = 4, p[9]>>4 + case 3: + depth, background = 8, p[8] + default: + return fmt.Errorf("DVB subtitle: region %d declares pixel depth code %d, not 2, 4 or 8 bits", id, p[6]>>2&7) + } + var refs []dvbObjectRef + for e := p[head:]; len(e) > 0; { + if len(e) < 6 { + return fmt.Errorf("DVB subtitle: region %d ends on %d byte(s) of an object reference of 6", id, len(e)) + } + kind := e[2] >> 6 + ref := dvbObjectRef{id: binary.BigEndian.Uint16(e), x: int(binary.BigEndian.Uint16(e[2:]) & 0xfff), y: int(binary.BigEndian.Uint16(e[4:]) & 0xfff)} + e = e[6:] + if kind == 1 || kind == 2 { // a character object carries its two colours and no picture + if len(e) < 2 { + return fmt.Errorf("DVB subtitle: region %d ends inside a character object reference", id) + } + e = e[2:] + continue + } + refs = append(refs, ref) + } + + r := d.regions[id] + held := d.held + dvbObjectRefBytes*len(refs) + if r != nil { + held -= dvbObjectRefBytes * len(r.objects) + } + fresh := r == nil || r.w != w || r.h != h || r.depth != depth + if fresh { + held += w * h + if r != nil { + held -= len(r.pix) + } + } + if held > dvbMaxEpochBytes { + return fmt.Errorf("DVB subtitle: region %d brings the regions held since the last mode change to %d bytes (limit %d)", id, held, dvbMaxEpochBytes) + } + if fresh || fill { + if err := d.spend(w * h); err != nil { + return err + } + } + if fresh { + r = &dvbRegion{w: w, h: h, depth: depth, pix: make([]byte, w*h)} + if d.regions == nil { + d.regions = make(map[uint8]*dvbRegion, 2) + } + d.regions[id] = r + } + d.held = held + r.clut, r.objects = p[7], refs + if fill && (!fresh || background != 0) { + for i := range r.pix { + r.pix[i] = background + } + } + return nil +} + +// parseCLUT updates the entries a CLUT definition carries; the others keep their contents. +func (d *DVBSubDecoder) parseCLUT(p []byte) error { + if len(p) < 2 { + return fmt.Errorf("DVB subtitle: a CLUT definition segment needs 2 bytes, got %d", len(p)) + } + c := d.cluts[p[0]] + if c == nil { + c = new(dvbCLUT) + *c = *dvbDefaultCLUT + if d.cluts == nil { + d.cluts = make(map[uint8]*dvbCLUT, 1) + } + d.cluts[p[0]] = c + } + for e := p[2:]; len(e) > 0; { + n := 4 + if len(e) >= 2 && e[1]&1 != 0 { + n = 6 + } + if len(e) < n { + return fmt.Errorf("DVB subtitle: CLUT %d ends on %d byte(s) of an entry of %d", p[0], len(e), n) + } + entry, flags := int(e[0]), e[1] + v := binary.BigEndian.Uint16(e[2:]) // 6 bits of Y, 4 of Cr, 4 of Cb, 2 of T: the most significant ones + y, cr, cb, t := uint8(v>>10)<<2, uint8(v>>6&0xf)<<4, uint8(v>>2&0xf)<<4, uint8(v&3)<<6 + if n == 6 { + y, cr, cb, t = e[2], e[3], e[4], e[5] + } + e = e[n:] + var col [4]uint8 // Y 0 is the format's fully transparent colour + if y != 0 { + r, g, b := ycrcbToRGB(y, cr, cb) + col = [4]uint8{r, g, b, 255 - t} + } + if flags&0x80 != 0 && entry < len(c.c4) { + c.c4[entry] = col + } + if flags&0x40 != 0 && entry < len(c.c16) { + c.c16[entry] = col + } + if flags&0x20 != 0 { + c.c256[entry] = col + } + } + return nil +} + +// parseObject draws an object's two fields into every region that lists it. Only pixel objects are drawn. +func (d *DVBSubDecoder) parseObject(p []byte) error { + if len(p) < 3 { + return fmt.Errorf("DVB subtitle: an object data segment needs 3 bytes, got %d", len(p)) + } + id := binary.BigEndian.Uint16(p) + if p[2]>>2&3 != 0 { + return nil + } + if len(p) < 7 { + return fmt.Errorf("DVB subtitle: object %d declares no field lengths", id) + } + topLen, bottomLen := int(binary.BigEndian.Uint16(p[3:])), int(binary.BigEndian.Uint16(p[5:])) + if topLen+bottomLen > len(p)-7 { + return fmt.Errorf("DVB subtitle: object %d declares %d bytes of fields, its segment holds %d", id, topLen+bottomLen, len(p)-7) + } + top, bottom := p[7:7+topLen], p[7+topLen:7+topLen+bottomLen] + if bottomLen == 0 { + bottom = top + } + for _, r := range d.regions { + if err := d.spend(len(r.objects)); err != nil { + return err + } + for _, ref := range r.objects { + if ref.id != id { + continue + } + pen := dvbPen{d: d, r: r, skipOne: p[2]&2 != 0} + if err := pen.field(top, ref.x, ref.y); err != nil { + return fmt.Errorf("DVB subtitle: object %d: %w", id, err) + } + if err := pen.field(bottom, ref.x, ref.y+1); err != nil { + return fmt.Errorf("DVB subtitle: object %d: %w", id, err) + } + } + } + return nil +} + +// dvbPen draws one object into one region. +type dvbPen struct { + d *DVBSubDecoder + r *dvbRegion + skipOne bool // pixel code 1 leaves the region's pixel as it is + x, y int + table []byte // what the codes of the string being read map to, nil for the codes themselves + err error +} + +// run writes n pixels of one code at the pen, clipped to the region, and moves the pen. +func (p *dvbPen) run(code byte, n int) { + if p.err != nil { + return + } + if p.err = p.d.spend(n); p.err != nil { + return + } + x0, x1 := p.x, min(p.x+n, p.r.w) + p.x += n + if p.skipOne && code == 1 || p.y >= p.r.h || x0 >= x1 { + return + } + if p.table != nil { + code = p.table[code] + } + row := p.r.pix[p.y*p.r.w+x0 : p.y*p.r.w+x1] + for i := range row { + row[i] = code + } +} + +// field draws one field's pixel-data sub-blocks: every other line of the object, from x, y. +func (p *dvbPen) field(data []byte, x, y int) error { + map2to4 := [4]byte{0x0, 0x7, 0x8, 0xf} + map2to8 := [4]byte{0x00, 0x77, 0x88, 0xff} + var map4to8 [16]byte + for i := range map4to8 { + map4to8[i] = byte(i) * 0x11 + } + if p.err = p.d.spend(8 * len(data)); p.err != nil { // reading a bit counts as drawing a pixel + return p.err + } + p.x, p.y = x, y + depth := p.r.depth + for len(data) > 0 && p.err == nil { + typ := data[0] + data = data[1:] + tableLen := 0 + switch typ { + case dvbData2Bit: + p.table = nil + if depth == 8 { + p.table = map2to8[:] + } else if depth == 4 { + p.table = map2to4[:] + } + data = data[p.string2(data):] + case dvbData4Bit: + if depth < 4 { + return fmt.Errorf("a 4-bit pixel string in a %d-bit region", depth) + } + p.table = nil + if depth == 8 { + p.table = map4to8[:] + } + data = data[p.string4(data):] + case dvbData8Bit: + if depth < 8 { + return fmt.Errorf("an 8-bit pixel string in a %d-bit region", depth) + } + p.table = nil + data = data[p.string8(data):] + case dvbMap2To4: + tableLen = 2 + case dvbMap2To8: + tableLen = 4 + case dvbMap4To8: + tableLen = 16 + case dvbDataEndRow: + p.x, p.y = x, p.y+2 + default: + return fmt.Errorf("a pixel-data block of type %#02x, which the format does not define", typ) + } + if tableLen == 0 { + continue + } + if len(data) < tableLen { + return fmt.Errorf("a map table of %d bytes, %d remain", tableLen, len(data)) + } + switch typ { + case dvbMap2To4: + map2to4 = [4]byte{data[0] >> 4, data[0] & 0xf, data[1] >> 4, data[1] & 0xf} + case dvbMap2To8: + copy(map2to8[:], data) + case dvbMap4To8: + copy(map4to8[:], data) + } + data = data[tableLen:] + } + return p.err +} + +// dvbBits reads a pixel code string bit by bit; past its end it reads zeros, which every string ends on. +type dvbBits struct { + data []byte + pos int +} + +func (b *dvbBits) take(n int) int { + v := 0 + for ; n > 0; n-- { + v <<= 1 + if b.pos>>3 < len(b.data) { + v |= int(b.data[b.pos>>3]>>(7-b.pos&7)) & 1 + } + b.pos++ + } + return v +} + +// used is how many whole bytes the string took, the stuffing bits that end it included. +func (b *dvbBits) used() int { return min((b.pos+7)>>3, len(b.data)) } + +// string2 draws a 2-bit/pixel code string and returns the bytes it took (clause 7.2.5.2). +func (p *dvbPen) string2(data []byte) int { + b := dvbBits{data: data} + for p.err == nil { + if v := b.take(2); v != 0 { + p.run(byte(v), 1) + continue + } + if b.take(1) == 1 { + n := b.take(3) + 3 + p.run(byte(b.take(2)), n) + continue + } + if b.take(1) == 1 { + p.run(0, 1) + continue + } + switch b.take(2) { + case 0: + return b.used() + case 1: + p.run(0, 2) + case 2: + n := b.take(4) + 12 + p.run(byte(b.take(2)), n) + case 3: + n := b.take(8) + 29 + p.run(byte(b.take(2)), n) + } + } + return b.used() +} + +// string4 draws a 4-bit/pixel code string and returns the bytes it took. +func (p *dvbPen) string4(data []byte) int { + b := dvbBits{data: data} + for p.err == nil { + if v := b.take(4); v != 0 { + p.run(byte(v), 1) + continue + } + if b.take(1) == 0 { + n := b.take(3) + if n == 0 { + return b.used() + } + p.run(0, n+2) + continue + } + if b.take(1) == 0 { + n := b.take(2) + 4 + p.run(byte(b.take(4)), n) + continue + } + switch b.take(2) { + case 0: + p.run(0, 1) + case 1: + p.run(0, 2) + case 2: + n := b.take(4) + 9 + p.run(byte(b.take(4)), n) + case 3: + n := b.take(8) + 25 + p.run(byte(b.take(4)), n) + } + } + return b.used() +} + +// string8 draws an 8-bit/pixel code string and returns the bytes it took. +func (p *dvbPen) string8(data []byte) int { + b := dvbBits{data: data} + for p.err == nil { + if v := b.take(8); v != 0 { + p.run(byte(v), 1) + continue + } + long, n := b.take(1), b.take(7) + if long == 1 { + p.run(byte(b.take(8)), n) + } else if n == 0 { + return b.used() + } else { + p.run(0, n) + } + } + return b.used() +} + +// compose turns the page into a display set: each region on screen, read through its CLUT, where the page puts it. +func (d *DVBSubDecoder) compose() (BitmapDisplaySet, error) { + ds := BitmapDisplaySet{ScreenW: d.screenW, ScreenH: d.screenH} + if ds.ScreenW == 0 { // no display definition: the format's standard-definition plane + ds.ScreenW, ds.ScreenH = 720, 576 + } + for _, pl := range d.page { + r := d.regions[pl.region] + if r == nil { + if err := d.spend(1); err != nil { + return ds, err + } + continue + } + if err := d.spend(r.w * r.h); err != nil { + return ds, err + } + clut := d.cluts[r.clut] + if clut == nil { + clut = dvbDefaultCLUT + } + colours := clut.c256[:] + if r.depth == 4 { + colours = clut.c16[:] + } else if r.depth == 2 { + colours = clut.c4[:] + } + img := image.NewNRGBA(image.Rect(0, 0, r.w, r.h)) + for i, v := range r.pix { + if c := colours[int(v)&(len(colours)-1)]; c[3] != 0 { + copy(img.Pix[4*i:4*i+4], c[:]) + } + } + if img, at := trimTransparent(img); img != nil { + ds.Objects = append(ds.Objects, BitmapObject{X: d.winX + pl.x + at.X, Y: d.winY + pl.y + at.Y, Image: img}) + } + } + return ds, nil +} diff --git a/mkv/subtitle/dvbsub_test.go b/mkv/subtitle/dvbsub_test.go new file mode 100644 index 00000000..5658f384 --- /dev/null +++ b/mkv/subtitle/dvbsub_test.go @@ -0,0 +1,542 @@ +package subtitle + +import ( + "bytes" + "strings" + "testing" +) + +// --- synthetic DVB builders: segments byte by byte, so the tests pin the wire format --- + +const dvbTestPage, dvbTestAncillary = 0x0001, 0x0152 + +var dvbTestPrivate = []byte{0x00, 0x01, 0x01, 0x52, 0x10} + +func dvbSeg(typ byte, page uint16, p []byte) []byte { + return append([]byte{dvbSync, typ, byte(page >> 8), byte(page), byte(len(p) >> 8), byte(len(p))}, p...) +} + +// dvbPCS is a page composition: state 0 normal case, 1 acquisition point, 2 mode change. +func dvbPCS(state byte, at ...dvbPlacement) []byte { + p := []byte{15, state << 2} + for _, a := range at { + p = append(p, a.region, 0, byte(a.x>>8), byte(a.x), byte(a.y>>8), byte(a.y)) + } + return dvbSeg(dvbSegPage, dvbTestPage, p) +} + +// dvbRCS is a region composition; depthCode is 1, 2 or 3 for 2, 4 or 8 bits. +func dvbRCS(id byte, fill bool, w, h int, depthCode, clut, background byte, refs ...dvbObjectRef) []byte { + flags := byte(0) + if fill { + flags = 0x08 + } + p := []byte{id, flags, byte(w >> 8), byte(w), byte(h >> 8), byte(h), depthCode<<5 | depthCode<<2, clut, background, background<<4 | background&3<<2} + for _, r := range refs { + p = append(p, byte(r.id>>8), byte(r.id), byte(r.x>>8)&0xf, byte(r.x), byte(r.y>>8)&0xf, byte(r.y)) + } + return dvbSeg(dvbSegRegion, dvbTestPage, p) +} + +// dvbCDS is a CLUT definition; an entry is its ID, its flags, then Y, Cr, Cb, T in full range. +func dvbCDS(id byte, entries ...[6]byte) []byte { + p := []byte{id, 0} + for _, e := range entries { + p = append(p, e[:]...) + } + return dvbSeg(dvbSegCLUT, dvbTestPage, p) +} + +func dvbODS(id uint16, nonModifying bool, top, bottom []byte) []byte { + flags := byte(0) + if nonModifying { + flags = 2 + } + p := []byte{byte(id >> 8), byte(id), flags, byte(len(top) >> 8), byte(len(top)), byte(len(bottom) >> 8), byte(len(bottom))} + return dvbSeg(dvbSegObject, dvbTestPage, append(append(p, top...), bottom...)) +} + +// dvbGrow appends bytes to a segment's payload and declares them in its length. +func dvbGrow(seg []byte, more ...byte) []byte { + out := append(append([]byte(nil), seg...), more...) + out[4], out[5] = byte((len(out)-6)>>8), byte(len(out)-6) + return out +} + +func dvbEDS() []byte { return dvbSeg(dvbSegEnd, dvbTestPage, nil) } + +// dvbBitString packs a string of 0s and 1s, spaces ignored, into bytes, zero-padded. +func dvbBitString(s string) []byte { + s = strings.ReplaceAll(s, " ", "") + out := make([]byte, (len(s)+7)/8) + for i, c := range s { + if c == '1' { + out[i/8] |= 0x80 >> (i % 8) + } + } + return out +} + +// 4-bit entries of CLUT 0: 1 white, 2 blue, 3 white at half transparency. +var dvbTestCLUT = dvbCDS(0, [6]byte{1, 0x41, 235, 128, 128, 0}, [6]byte{2, 0x41, 82, 90, 240, 0}, [6]byte{3, 0x41, 235, 128, 128, 0x80}) + +// A 4x2 object in 4-bit strings: codes 1, 1, 2, 3 on the top line, a run of four 2s on the bottom one. +var ( + dvbTop4x2 = []byte{dvbData4Bit, 0x11, 0x23, 0x00, dvbDataEndRow} + dvbBottom4x2 = []byte{dvbData4Bit, 0x08, 0x20, 0x00, dvbDataEndRow} +) + +func dvbShow4x2() []byte { + return concat( + dvbPCS(2, dvbPlacement{region: 0, x: 100, y: 500}), + dvbRCS(0, true, 4, 2, 2, 0, 0, dvbObjectRef{id: 7}), + dvbTestCLUT, + dvbODS(7, false, dvbTop4x2, dvbBottom4x2), + dvbEDS(), + ) +} + +func newDVBSub(t *testing.T) *DVBSubDecoder { + t.Helper() + d, err := NewDVBSubDecoder(dvbTestPrivate) + if err != nil { + t.Fatal(err) + } + return d +} + +func decodeOneDVB(t *testing.T, d *DVBSubDecoder, block []byte) BitmapDisplaySet { + t.Helper() + sets, err := d.Decode(block) + if err != nil { + t.Fatal(err) + } + if len(sets) != 1 { + t.Fatalf("got %d display sets, want 1", len(sets)) + } + return sets[0] +} + +// --- tests --- + +func TestDVBSubDecoder_ShowThenClear(t *testing.T) { + d := newDVBSub(t) + ds := decodeOneDVB(t, d, dvbShow4x2()) + if ds.ScreenW != 720 || ds.ScreenH != 576 { + t.Errorf("plane %dx%d, want the 720x576 of a stream without display definition", ds.ScreenW, ds.ScreenH) + } + if len(ds.Objects) != 1 { + t.Fatalf("got %d objects, want 1", len(ds.Objects)) + } + o := ds.Objects[0] + if o.X != 100 || o.Y != 500 || o.Forced { + t.Errorf("object at %d,%d forced=%v, want 100,500 not forced", o.X, o.Y, o.Forced) + } + if b := o.Image.Bounds(); b.Dx() != 4 || b.Dy() != 2 { + t.Fatalf("image %dx%d, want 4x2", b.Dx(), b.Dy()) + } + br, bg, bb := ycrcbToRGB(82, 90, 240) + white, blue, half := [4]uint8{255, 255, 255, 255}, [4]uint8{br, bg, bb, 255}, [4]uint8{255, 255, 255, 127} + want := [2][4][4]uint8{{white, white, blue, half}, {blue, blue, blue, blue}} + for y := range want { + for x := range want[y] { + if got := nrgbaAt(t, o.Image, x, y); got != want[y][x] { + t.Errorf("pixel %d,%d = %v, want %v", x, y, got, want[y][x]) + } + } + } + if ds := decodeOneDVB(t, d, concat(dvbPCS(0), dvbEDS())); !ds.Clear() { + t.Errorf("a page with no region gave %d objects, want a clear", len(ds.Objects)) + } +} + +// Within an epoch a display set sends only what changed: the region keeps the pixels of the blocks before. +func TestDVBSubDecoder_NormalCaseKeepsTheRegion(t *testing.T) { + d := newDVBSub(t) + at := dvbPlacement{region: 0, x: 10, y: 20} + decodeOneDVB(t, d, concat(dvbPCS(2, at), dvbRCS(0, true, 12, 2, 2, 0, 0, dvbObjectRef{id: 7}), dvbTestCLUT, + dvbODS(7, false, dvbTop4x2, dvbBottom4x2), dvbEDS())) + ds := decodeOneDVB(t, d, concat(dvbPCS(0, at), dvbRCS(0, false, 12, 2, 2, 0, 0, dvbObjectRef{id: 8, x: 8}), + dvbODS(8, false, dvbTop4x2, dvbBottom4x2), dvbEDS())) + if len(ds.Objects) != 1 || ds.Objects[0].Image.Bounds().Dx() != 12 { + t.Fatalf("got %d objects, the first %v wide; want one of 12, both words", len(ds.Objects), ds.Objects[0].Image.Bounds().Dx()) + } + img := ds.Objects[0].Image + if nrgbaAt(t, img, 0, 0)[3] == 0 || nrgbaAt(t, img, 8, 0)[3] == 0 || nrgbaAt(t, img, 5, 0)[3] != 0 { + t.Errorf("the region lost the first object, or the second, or the gap between them is painted") + } + // A page that only lists the region again shows it as it is. + if ds := decodeOneDVB(t, d, concat(dvbPCS(0, at), dvbEDS())); len(ds.Objects) != 1 { + t.Errorf("a page listing a kept region gave %d objects, want 1", len(ds.Objects)) + } +} + +func TestDVBSubDecoder_ModeChangeAndResetStartAnEpoch(t *testing.T) { + at := dvbPlacement{region: 0, x: 10, y: 20} + for name, forget := range map[string]func(d *DVBSubDecoder) []byte{ + "mode change": func(*DVBSubDecoder) []byte { return dvbPCS(2, at) }, + "acquisition point": func(*DVBSubDecoder) []byte { return dvbPCS(1, at) }, + "Reset": func(d *DVBSubDecoder) []byte { d.Reset(); return dvbPCS(0, at) }, + } { + d := newDVBSub(t) + decodeOneDVB(t, d, dvbShow4x2()) + if ds := decodeOneDVB(t, d, concat(forget(d), dvbEDS())); !ds.Clear() { + t.Errorf("%s: a region of the epoch before is still shown", name) + } + if d.held != 0 { + t.Errorf("%s: %d bytes still counted as held", name, d.held) + } + } +} + +func TestDVBSubDecoder_BottomFieldAbsentRepeatsTheTop(t *testing.T) { + ds := decodeOneDVB(t, newDVBSub(t), concat(dvbPCS(2, dvbPlacement{}), dvbRCS(0, true, 4, 2, 2, 0, 0, dvbObjectRef{id: 7}), + dvbTestCLUT, dvbODS(7, false, dvbTop4x2, nil), dvbEDS())) + img := ds.Objects[0].Image + for x := 0; x < 4; x++ { + if nrgbaAt(t, img, x, 0) != nrgbaAt(t, img, x, 1) { + t.Errorf("column %d: the bottom line is not the top one", x) + } + } +} + +func TestDVBSubDecoder_InvisibleRegionIsNoObject(t *testing.T) { + ds := decodeOneDVB(t, newDVBSub(t), concat(dvbPCS(2, dvbPlacement{}), dvbRCS(0, true, 64, 8, 2, 0, 0), dvbEDS())) + if !ds.Clear() { + t.Errorf("a region filled with the transparent entry gave %d objects, want a clear", len(ds.Objects)) + } +} + +func TestDVBSubDecoder_RegionTrimmedToItsVisiblePixels(t *testing.T) { + ds := decodeOneDVB(t, newDVBSub(t), concat(dvbPCS(2, dvbPlacement{x: 50, y: 60}), + dvbRCS(0, true, 40, 10, 2, 0, 0, dvbObjectRef{id: 7, x: 20, y: 4}), dvbTestCLUT, dvbODS(7, false, dvbTop4x2, dvbBottom4x2), dvbEDS())) + o := ds.Objects[0] + if o.X != 70 || o.Y != 64 || o.Image.Bounds().Dx() != 4 || o.Image.Bounds().Dy() != 2 { + t.Errorf("object at %d,%d of %v, want 70,64 of 4x2", o.X, o.Y, o.Image.Bounds().Size()) + } +} + +func TestDVBSubDecoder_UndefinedRegionIsSkipped(t *testing.T) { + ds := decodeOneDVB(t, newDVBSub(t), concat(dvbPCS(0, dvbPlacement{region: 9}), dvbEDS())) + if !ds.Clear() { + t.Errorf("a region never defined gave %d objects", len(ds.Objects)) + } +} + +func TestDVBSubDecoder_DisplayDefinition(t *testing.T) { + dds := func(p ...byte) []byte { return dvbSeg(dvbSegDisplay, dvbTestPage, p) } + body := concat(dvbPCS(2, dvbPlacement{x: 100, y: 500}), dvbRCS(0, true, 4, 2, 2, 0, 0, dvbObjectRef{id: 7}), dvbTestCLUT, + dvbODS(7, false, dvbTop4x2, dvbBottom4x2), dvbEDS()) + d := newDVBSub(t) + ds := decodeOneDVB(t, d, concat(dds(0x00, 0x07, 0x7f, 0x04, 0x37), body)) + if ds.ScreenW != 1920 || ds.ScreenH != 1080 || ds.Objects[0].X != 100 { + t.Errorf("plane %dx%d, object at x %d; want 1920x1080 and 100", ds.ScreenW, ds.ScreenH, ds.Objects[0].X) + } + // The definition holds for the display sets that follow, and a window shifts what the page places. + if ds := decodeOneDVB(t, d, body); ds.ScreenW != 1920 { + t.Errorf("plane width %d on the next display set, want 1920", ds.ScreenW) + } + ds = decodeOneDVB(t, d, concat(dds(0x08, 0x07, 0x7f, 0x04, 0x37, 0x00, 0x40, 0x07, 0x3f, 0x00, 0x20, 0x04, 0x17), body)) + if o := ds.Objects[0]; o.X != 164 || o.Y != 532 { + t.Errorf("object at %d,%d inside a window at 64,32; want 164,532", o.X, o.Y) + } +} + +func TestDVBSubDecoder_OtherPagesAreAnotherService(t *testing.T) { + foreign := dvbSeg(dvbSegPage, 0x0099, []byte{15, 2 << 2}) + d := newDVBSub(t) + if sets, err := d.Decode(concat(foreign, dvbSeg(dvbSegEnd, 0x0099, nil))); err != nil || len(sets) != 0 { + t.Errorf("another page's display set gave %d sets, err %v", len(sets), err) + } + // The ancillary page's CLUT and objects serve the composition page. + clut := append([]byte(nil), dvbTestCLUT...) + clut[2], clut[3] = byte(dvbTestAncillary>>8), byte(dvbTestAncillary&0xff) + ds := decodeOneDVB(t, d, concat(dvbPCS(2, dvbPlacement{}), dvbRCS(0, true, 4, 2, 2, 0, 0, dvbObjectRef{id: 7}), clut, + dvbODS(7, false, dvbTop4x2, dvbBottom4x2), dvbEDS())) + if got := nrgbaAt(t, ds.Objects[0].Image, 0, 0); got != [4]uint8{255, 255, 255, 255} { + t.Errorf("pixel = %v, want the white of the ancillary page's CLUT", got) + } + all, err := NewDVBSubDecoder(nil) + if err != nil { + t.Fatal(err) + } + if sets, _ := all.Decode(concat(foreign, dvbSeg(dvbSegEnd, 0x0099, nil))); len(sets) != 1 { + t.Errorf("without CodecPrivate a page gave %d sets, want 1", len(sets)) + } +} + +func TestNewDVBSubDecoder_ShortCodecPrivate(t *testing.T) { + if _, err := NewDVBSubDecoder([]byte{0, 1, 0}); err == nil || !strings.Contains(err.Error(), "the two page IDs take 4") { + t.Errorf("err = %v, want a refusal naming the page IDs", err) + } +} + +func TestDVBSubDecoder_DisplaySetBoundaries(t *testing.T) { + show := dvbShow4x2() + noEnd := show[:len(show)-len(dvbEDS())] + for name, tc := range map[string]struct { + block []byte + sets int + }{ + "no end segment": {noEnd, 1}, + "two sets": {concat(show, dvbPCS(0), dvbEDS()), 2}, + "two sets, no end segments": {concat(noEnd, dvbPCS(0)), 2}, + "PES header and end marker": {concat([]byte{0x20, 0x00}, show, []byte{0xff}), 1}, + "end without composition": {dvbEDS(), 0}, + "segments of unknown types": {concat(dvbSeg(0x15, dvbTestPage, []byte{1, 2, 3}), show), 1}, + } { + sets, err := newDVBSub(t).Decode(tc.block) + if err != nil || len(sets) != tc.sets { + t.Errorf("%s: %d sets, err %v; want %d", name, len(sets), err, tc.sets) + } + } +} + +// dvbDraw draws one field into the top line of a fresh region and returns that line's CLUT entries. +func dvbDraw(t *testing.T, depth, w int, nonModifying bool, fill byte, data []byte) ([]byte, error) { + t.Helper() + r := &dvbRegion{w: w, h: 2, depth: depth, pix: bytes.Repeat([]byte{fill}, 2*w)} + pen := dvbPen{d: &DVBSubDecoder{budget: 1 << 20}, r: r, skipOne: nonModifying} + err := pen.field(data, 0, 0) + return r.pix[:w], err +} + +func dvbRuns(pairs ...int) []byte { + var out []byte + for i := 0; i < len(pairs); i += 2 { + out = append(out, bytes.Repeat([]byte{byte(pairs[i])}, pairs[i+1])...) + } + return out +} + +func TestDVBSub_PixelCodeStrings(t *testing.T) { + for _, tc := range []struct { + name string + depth int + data []byte + want []byte + }{ + {"2-bit", 2, + concat([]byte{dvbData2Bit}, dvbBitString("01 10 11 0001 000001 00 1 010 11 0000 10 0011 10 0000 11 00000001 01 000000")), + dvbRuns(1, 1, 2, 1, 3, 1, 0, 1, 0, 2, 3, 5, 2, 15, 1, 30)}, + {"4-bit", 4, + concat([]byte{dvbData4Bit}, dvbBitString("0001 1111 0000 1100 0000 1101 0000 0 011 0000 10 01 0111 0000 1110 0010 0101 0000 1111 00000011 1001 0000 0000")), + dvbRuns(1, 1, 15, 1, 0, 1, 0, 2, 0, 5, 7, 5, 5, 11, 9, 28)}, + {"8-bit", 8, + []byte{dvbData8Bit, 0x41, 0x00, 0x05, 0x00, 0x83, 0x99, 0x00, 0x00}, + dvbRuns(0x41, 1, 0, 5, 0x99, 3)}, + {"two strings on one line", 4, + []byte{dvbData4Bit, 0x12, 0x00, dvbData4Bit, 0x34, 0x00}, + []byte{1, 2, 3, 4}}, + {"2-bit codes in a 4-bit region", 4, + concat([]byte{dvbData2Bit}, dvbBitString("01 10 11 000000")), + []byte{0x7, 0x8, 0xf}}, + {"2-bit codes through a sent 2-to-4 table", 4, + concat([]byte{dvbMap2To4, 0x12, 0x34, dvbData2Bit}, dvbBitString("01 10 11 000000")), + []byte{2, 3, 4}}, + {"2-bit codes in an 8-bit region", 8, + concat([]byte{dvbData2Bit}, dvbBitString("01 10 11 000000")), + []byte{0x77, 0x88, 0xff}}, + {"2-bit codes through a sent 2-to-8 table", 8, + concat([]byte{dvbMap2To8, 9, 10, 11, 12, dvbData2Bit}, dvbBitString("01 10 11 000000")), + []byte{10, 11, 12}}, + {"4-bit codes in an 8-bit region", 8, + []byte{dvbData4Bit, 0x1f, 0x00}, + []byte{0x11, 0xff}}, + {"4-bit codes through a sent 4-to-8 table", 8, + concat([]byte{dvbMap4To8}, bytes.Repeat([]byte{0x42}, 16), []byte{dvbData4Bit, 0x1f, 0x00}), + []byte{0x42, 0x42}}, + {"a string cut short ends there", 4, + []byte{dvbData4Bit, 0x12}, + []byte{1, 2}}, + } { + t.Run(tc.name, func(t *testing.T) { + got, err := dvbDraw(t, tc.depth, len(tc.want), false, 0, tc.data) + if err != nil { + t.Fatal(err) + } + if !bytes.Equal(got, tc.want) { + t.Errorf("line %v\nwant %v", got, tc.want) + } + }) + } +} + +func TestDVBSub_NonModifyingColourAndClipping(t *testing.T) { + got, err := dvbDraw(t, 4, 3, true, 9, []byte{dvbData4Bit, 0x12, 0x10, 0x00}) + if err != nil || !bytes.Equal(got, []byte{9, 2, 9}) { + t.Errorf("line %v, err %v; want code 1 to leave the region's 9", got, err) + } + // A run past the region's edge stops at it, and lines below the region are not drawn. + data := concat([]byte{dvbData4Bit}, dvbBitString("0000 1111 11111111 0011 0000 0000"), []byte{dvbDataEndRow, dvbData4Bit, 0x55, 0x00, dvbDataEndRow, dvbData4Bit, 0x66, 0x00}) + got, err = dvbDraw(t, 4, 5, false, 0, data) + if err != nil || !bytes.Equal(got, []byte{3, 3, 3, 3, 3}) { + t.Errorf("line %v, err %v; want the run clipped to the 5 pixels of the region", got, err) + } +} + +func TestDVBSub_PixelDataRefusals(t *testing.T) { + for name, tc := range map[string]struct { + depth int + data []byte + want string + }{ + "4-bit string in a 2-bit region": {2, []byte{dvbData4Bit, 0x10, 0x00}, "a 4-bit pixel string in a 2-bit region"}, + "8-bit string in a 4-bit region": {4, []byte{dvbData8Bit, 0x10, 0x00, 0x00}, "an 8-bit pixel string in a 4-bit region"}, + "undefined block type": {4, []byte{0x33}, "type 0x33"}, + "map table cut short": {8, []byte{dvbMap4To8, 1, 2, 3}, "a map table of 16 bytes, 3 remain"}, + } { + if _, err := dvbDraw(t, tc.depth, 4, false, 0, tc.data); err == nil || !strings.Contains(err.Error(), tc.want) { + t.Errorf("%s: err = %v, want one naming %q", name, err, tc.want) + } + } +} + +func TestDVBSub_CLUT(t *testing.T) { + d := newDVBSub(t) + // Entry 5 of the 16-entry table in reduced range, entry 6 of all three tables, entry 7 with Y 0. + reduced := dvbSeg(dvbSegCLUT, dvbTestPage, []byte{3, 0, 5, 0x40, 0xeb<<2&0xfc | 0x02, 0x00<<6 | 0x08<<2 | 0x01}) + full := dvbCDS(3, [6]byte{6, 0xe1, 235, 128, 128, 0x40}, [6]byte{7, 0x41, 0, 128, 128, 0}) + if _, err := d.Decode(concat(reduced, full)); err != nil { + t.Fatal(err) + } + c := d.cluts[3] + r, g, b := ycrcbToRGB(0xeb<<2&0xfc, 0x80, 0x80) + if c.c16[5] != [4]uint8{r, g, b, 255 - 0x40} { + t.Errorf("reduced-range entry = %v, want %v", c.c16[5], [4]uint8{r, g, b, 255 - 0x40}) + } + if want := [4]uint8{255, 255, 255, 255 - 0x40}; c.c16[6] != want || c.c256[6] != want { + t.Errorf("entry 6 = %v and %v, want %v in both tables", c.c16[6], c.c256[6], want) + } + if c.c4[2] != dvbDefaultCLUT.c4[2] { + t.Errorf("entry 6 of a 4-entry table changed entry %v", c.c4) + } + if c.c16[7] != [4]uint8{} { + t.Errorf("an entry of Y 0 = %v, want fully transparent", c.c16[7]) + } + if c.c16[1] != dvbDefaultCLUT.c16[1] { + t.Errorf("an entry the definition did not carry lost its default") + } +} + +// The defaults of clause 10, one entry of each of its cases. +func TestDVBSub_DefaultCLUT(t *testing.T) { + c := dvbDefaultCLUT + for name, tc := range map[string]struct{ got, want [4]uint8 }{ + "4: transparent": {c.c4[0], [4]uint8{}}, + "4: white": {c.c4[1], [4]uint8{255, 255, 255, 255}}, + "4: black": {c.c4[2], [4]uint8{0, 0, 0, 255}}, + "4: grey": {c.c4[3], [4]uint8{127, 127, 127, 255}}, + "16: transparent": {c.c16[0], [4]uint8{}}, + "16: red": {c.c16[1], [4]uint8{255, 0, 0, 255}}, + "16: white": {c.c16[7], [4]uint8{255, 255, 255, 255}}, + "16: black": {c.c16[8], [4]uint8{0, 0, 0, 255}}, + "16: half blue": {c.c16[12], [4]uint8{0, 0, 127, 255}}, + "256: transparent": {c.c256[0], [4]uint8{}}, + "256: red at 75 %": {c.c256[1], [4]uint8{255, 0, 0, 63}}, + "256: full red": {c.c256[0x11], [4]uint8{255, 0, 0, 255}}, + "256: two thirds of green": {c.c256[0x20], [4]uint8{0, 170, 0, 255}}, + "256: half transparent": {c.c256[0x4c], [4]uint8{0, 0, 255, 127}}, + "256: light": {c.c256[0x91], [4]uint8{255, 127, 127, 255}}, + "256: dark": {c.c256[0x99], [4]uint8{128, 0, 0, 255}}, + } { + if tc.got != tc.want { + t.Errorf("%s = %v, want %v", name, tc.got, tc.want) + } + } +} + +func TestDVBSubDecoder_Malformed(t *testing.T) { + seg := func(typ byte, p ...byte) []byte { return dvbSeg(typ, dvbTestPage, p) } + for name, tc := range map[string]struct { + block []byte + want string + }{ + "not a segment": {[]byte{0x47, 0x10, 0, 1, 0, 0}, "where a segment starts"}, + "short header": {[]byte{dvbSync, 0x10, 0}, "a segment header needs 6"}, + "segment past the block": {[]byte{dvbSync, 0x10, 0, 1, 0, 9, 0}, "declares 9 bytes"}, + "page cut short": {seg(dvbSegPage, 15), "page composition segment holds 1 bytes"}, + "page with half a region": {seg(dvbSegPage, 15, 0, 1, 0, 0), "page composition segment holds 5 bytes"}, + "region cut short": {seg(dvbSegRegion, 0, 0, 0, 4), "region composition segment needs 10"}, + "region of no width": {dvbRCS(0, true, 0, 2, 2, 0, 0), "outside 1..4096"}, + "region too tall": {dvbRCS(0, true, 4, 5000, 2, 0, 0), "outside 1..4096"}, + "region of no depth": {dvbRCS(0, true, 4, 2, 0, 0, 0), "pixel depth code 0"}, + "half an object ref": {dvbGrow(dvbRCS(0, true, 4, 2, 2, 0, 0), 1, 2, 3), "of an object reference of 6"}, + "CLUT cut short": {seg(dvbSegCLUT, 0), "CLUT definition segment needs 2"}, + "CLUT entry cut short": {seg(dvbSegCLUT, 0, 0, 1, 0x41, 235, 128), "of an entry of 6"}, + "object cut short": {seg(dvbSegObject, 0, 7), "object data segment needs 3"}, + "object without lengths": {seg(dvbSegObject, 0, 7, 0, 0, 5), "declares no field lengths"}, + "object fields too long": {seg(dvbSegObject, 0, 7, 0, 0, 5, 0, 5, 1, 2, 3), "declares 10 bytes of fields"}, + "display cut short": {seg(dvbSegDisplay, 0, 7, 0x7f), "display definition segment needs 5"}, + "display window missing": {seg(dvbSegDisplay, 8, 7, 0x7f, 4, 0x37, 0, 0), "declares a window"}, + "bad object data": {concat(dvbPCS(2), dvbRCS(0, true, 4, 2, 1, 0, 0, dvbObjectRef{id: 7}), dvbODS(7, false, dvbTop4x2, nil)), + "object 7: a 4-bit pixel string in a 2-bit region"}, + } { + sets, err := newDVBSub(t).Decode(tc.block) + if err == nil || !strings.Contains(err.Error(), tc.want) { + t.Errorf("%s: %d sets, err = %v, want one naming %q", name, len(sets), err, tc.want) + } + } +} + +// Objects that are not pictures (characters, a coding the format added later) are passed over. +func TestDVBSubDecoder_NonPixelObjectsIgnored(t *testing.T) { + chars := dvbSeg(dvbSegObject, dvbTestPage, []byte{0, 7, 1 << 2, 1, 0, 0x41}) + region := dvbGrow(dvbRCS(0, true, 4, 2, 2, 0, 0), 0, 7, 0x40, 0, 0, 0, 1, 2) // a character object reference, two bytes longer + ds := decodeOneDVB(t, newDVBSub(t), concat(dvbPCS(2, dvbPlacement{}), region, chars, dvbEDS())) + if !ds.Clear() { + t.Errorf("a character object drew %d objects", len(ds.Objects)) + } +} + +// A few bytes naming a full-size region to fill again and again are stopped by the block's budget. +func TestDVBSubBlockPixelsBounded(t *testing.T) { + fill := dvbRCS(0, true, dvbMaxDim, dvbMaxDim, 3, 0, 1) + d := newDVBSub(t) + if _, err := d.Decode(concat(fill, fill, fill, fill)); err != nil { + t.Fatalf("four fills of a full-size region: %v", err) + } + _, err := d.Decode(concat(fill, fill, fill, fill, fill)) + if err == nil || !strings.Contains(err.Error(), "fills and draws more than") { + t.Fatalf("err = %v, want the block's pixel bound", err) + } + if _, err := d.Decode(fill); err != nil { + t.Errorf("the block after a refused one: %v", err) + } +} + +func TestDVBSubEpochRegionsBounded(t *testing.T) { + d := newDVBSub(t) + if _, err := d.Decode(dvbRCS(0, false, dvbMaxDim, dvbMaxDim, 3, 0, 0)); err != nil { + t.Fatal(err) + } + _, err := d.Decode(dvbRCS(1, false, 64, 64, 3, 0, 0)) + if err == nil || !strings.Contains(err.Error(), "brings the regions held since the last mode change") { + t.Fatalf("err = %v, want the epoch bound", err) + } + // Defining the first region again, smaller, gives its bytes back. + if _, err := d.Decode(concat(dvbRCS(0, false, 64, 64, 3, 0, 0), dvbRCS(1, false, 64, 64, 3, 0, 0))); err != nil { + t.Fatalf("after shrinking region 0: %v", err) + } + if d.held != 2*64*64 { + t.Errorf("held = %d, want %d", d.held, 2*64*64) + } +} + +// An object a region lists thousands of times costs its data each time, and the block's budget counts it. +func TestDVBSubObjectListedManyTimesBounded(t *testing.T) { + refs := make([]dvbObjectRef, 10000) + for i := range refs { + refs[i].id = 7 + } + long := concat([]byte{dvbData4Bit}, dvbBitString("0000 1111 11111111 0001 0000 0000"), []byte{dvbDataEndRow}) + top := bytes.Repeat(long, 200) + block := concat(dvbPCS(2, dvbPlacement{}), dvbRCS(0, true, 64, 64, 2, 0, 0, refs...)) + for i := 0; i < 8; i++ { + block = append(block, dvbODS(7, false, top, nil)...) + } + _, err := newDVBSub(t).Decode(block) + if err == nil || !strings.Contains(err.Error(), "fills and draws more than") { + t.Fatalf("err = %v, want the block's pixel bound", err) + } +} diff --git a/mkv/subtitle/parse_fuzz_test.go b/mkv/subtitle/parse_fuzz_test.go index d74eb5c6..79b49ba9 100644 --- a/mkv/subtitle/parse_fuzz_test.go +++ b/mkv/subtitle/parse_fuzz_test.go @@ -57,3 +57,61 @@ func FuzzPGSDecode(f *testing.F) { }) }) } + +// FuzzVobSubDecode: any bytes handed to a VobSub decoder, in one block or split in two, give display sets or an +// error, never a panic, within the input's time budget. +func FuzzVobSubDecode(f *testing.F) { + f.Add(vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)}, spuSeq{date: 300, cmds: []byte{spuStop}}), 7) + f.Add(vobsubSPU(nil, nil, spuSeq{date: 45, cmds: []byte{spuStop}}), 0) + f.Add([]byte{0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04}, 0) + f.Fuzz(func(t *testing.T, data []byte, cut int) { + costguard.Fuzz(t, len(data), func() { + d, err := NewVobSubDecoder([]byte(vobsubIdx)) + if err != nil { + t.Fatal(err) + } + if cut > 0 && cut < len(data) { + _, _ = d.Decode(data[:cut]) + _, _ = d.Decode(data[cut:]) + return + } + _, _ = d.Decode(data) + }) + }) +} + +// FuzzVobSubHeader: any CodecPrivate gives a decoder or an error, never a panic. +func FuzzVobSubHeader(f *testing.F) { + f.Add([]byte(vobsubIdx)) + f.Add([]byte("size: 0x0\npalette: ,\n")) + f.Fuzz(func(t *testing.T, data []byte) { + costguard.Fuzz(t, len(data), func() { _, _ = NewVobSubDecoder(data) }) + }) +} + +// FuzzDVBSubDecode: any bytes handed to a DVB subtitle decoder, in one block or split in two, with or without the +// page filter, give display sets or an error, never a panic, within the input's time budget. +func FuzzDVBSubDecode(f *testing.F) { + f.Add(dvbShow4x2(), 0, true) + f.Add(concat(dvbShow4x2(), dvbPCS(0), dvbEDS()), len(dvbShow4x2()), false) + f.Add(concat(dvbPCS(2, dvbPlacement{}), dvbRCS(0, true, 720, 36, 3, 0, 1, dvbObjectRef{id: 1}), + dvbODS(1, true, []byte{dvbMap2To8, 1, 2, 3, 4, dvbData2Bit, 0x6c, 0x00, dvbDataEndRow, dvbData8Bit, 0x41, 0x00, 0x00}, nil)), 9, true) + f.Fuzz(func(t *testing.T, data []byte, cut int, filter bool) { + costguard.Fuzz(t, len(data), func() { + var private []byte + if filter { + private = dvbTestPrivate + } + d, err := NewDVBSubDecoder(private) + if err != nil { + t.Fatal(err) + } + if cut > 0 && cut < len(data) { + _, _ = d.Decode(data[:cut]) + _, _ = d.Decode(data[cut:]) + return + } + _, _ = d.Decode(data) + }) + }) +} diff --git a/mkv/subtitle/pgs.go b/mkv/subtitle/pgs.go index 9fe81fb8..e46b1dac 100644 --- a/mkv/subtitle/pgs.go +++ b/mkv/subtitle/pgs.go @@ -27,6 +27,7 @@ import ( "fmt" "image" "image/color" + "time" ) // Segment types, from the display set's segment header (type, 16-bit size). @@ -90,6 +91,9 @@ type PGSObject struct { type PGSDisplaySet struct { ScreenW, ScreenH int // the subtitle plane the positions are expressed in Objects []PGSObject + // Delay is how long after the block's time the set takes effect, and Duration how long its pictures then stay + // on screen; zero when the stream says neither (PGS and DVB never do, VobSub does). + Delay, Duration time.Duration } // Clear reports whether this display set empties the screen rather than filling diff --git a/mkv/subtitle/vobsub.go b/mkv/subtitle/vobsub.go new file mode 100644 index 00000000..51bfde0d --- /dev/null +++ b/mkv/subtitle/vobsub.go @@ -0,0 +1,305 @@ +package subtitle + +// vobsub.go - a decoder for DVD subpictures (S_VOBSUB), the bitmap subtitles of DVD rips. A Matroska block holds +// one subpicture unit: a four-colour picture, run-length coded as two interlaced fields, and the control sequences +// that give its colours, its place on the plane and when it is shown and removed. The sixteen colours the picture +// picks from and the plane's size are in the track's CodecPrivate, the text header of a .idx file. +// +// A subpicture stands alone: the only thing the decoder holds between blocks is the start of a unit that a muxer +// spread over several of them. +// +// Written from the format description, not ported: mkvgo is MIT and links no third-party subtitle decoder. + +import ( + "bytes" + "encoding/binary" + "fmt" + "image" + "strconv" + "strings" + "time" +) + +// Commands of a subpicture control sequence. +const ( + spuForcedStart = 0x00 // show, even with subtitles off + spuStart = 0x01 + spuStop = 0x02 + spuColours = 0x03 // the palette entry of each of the four pixel values + spuContrast = 0x04 // the opacity of each, 0..15 + spuArea = 0x05 + spuOffsets = 0x06 // where each field's data starts + spuChange = 0x07 // colour and contrast changes within the picture, not applied + spuEnd = 0xff +) + +// vobsubMaxDim is the widest and tallest area the 12-bit coordinates can name: the bound on what one block decodes. +const vobsubMaxDim = 4096 + +// VobSubDecoder decodes a VobSub track block by block. +type VobSubDecoder struct { + screenW, screenH int + palette [16][3]uint8 + pending []byte // a unit whose first blocks hold less than it declares, at most 64 KiB +} + +// Reset drops a unit left incomplete: call it when the read skips blocks, so the next one is not taken for its rest. +func (d *VobSubDecoder) Reset() { d.pending = nil } + +// NewVobSubDecoder reads the plane size and the palette from the track's CodecPrivate. +func NewVobSubDecoder(codecPrivate []byte) (*VobSubDecoder, error) { + d := &VobSubDecoder{} + var sized, coloured bool + for _, line := range strings.Split(string(bytes.TrimRight(codecPrivate, "\x00")), "\n") { + key, val, ok := strings.Cut(strings.TrimSpace(line), ":") + if !ok || strings.HasPrefix(key, "#") { + continue + } + val = strings.TrimSpace(val) + switch strings.ToLower(strings.TrimSpace(key)) { + case "size": + ws, hs, _ := strings.Cut(strings.ToLower(val), "x") + w, errW := strconv.Atoi(strings.TrimSpace(ws)) + h, errH := strconv.Atoi(strings.TrimSpace(hs)) + if errW != nil || errH != nil || w <= 0 || h <= 0 || w > vobsubMaxDim || h > vobsubMaxDim { + return nil, fmt.Errorf("VobSub: the CodecPrivate's size %q is not a width x height within 1..%d", val, vobsubMaxDim) + } + d.screenW, d.screenH, sized = w, h, true + case "palette": + cols := strings.Split(val, ",") + if len(cols) != len(d.palette) { + return nil, fmt.Errorf("VobSub: the CodecPrivate's palette holds %d colours, a subpicture picks from %d", len(cols), len(d.palette)) + } + for i, c := range cols { + rgb, err := strconv.ParseUint(strings.TrimSpace(c), 16, 24) + if err != nil { + return nil, fmt.Errorf("VobSub: the CodecPrivate's palette entry %d, %q, is not an RRGGBB colour", i, strings.TrimSpace(c)) + } + d.palette[i] = [3]uint8{uint8(rgb >> 16), uint8(rgb >> 8), uint8(rgb)} + } + coloured = true + } + } + if !sized || !coloured { + return nil, fmt.Errorf("VobSub: the track's CodecPrivate lacks the size: or palette: line of a .idx header, without which its pictures have no colours") + } + return d, nil +} + +// spuState is what the control sequences of one subpicture say. +type spuState struct { + colour, alpha [4]uint8 // per pixel value 0..3 + x1, y1, x2, y2 int + offset [2]int + hasArea bool + hasOffsets bool + started bool + forced bool + stopped bool + locked bool // the picture is on screen and visible: later sequences no longer restyle it + startAt int + stopAt int +} + +func (s *spuState) visible() bool { return s.alpha != [4]uint8{} } + +// Decode decodes one Matroska block, a whole subpicture unit: one display set holding its picture, cut down to its +// visible pixels, with the Delay before it shows and the Duration its stop command gives it, or an empty set for a +// unit that shows nothing. A unit spread over several blocks gives nothing until the block that completes it; its +// time is the first block's. +// +// A block of a track stored compressed (mkv.Track.Compression) is decoded first: mkv.Track.DecodePayload. +func (d *VobSubDecoder) Decode(block []byte) ([]BitmapDisplaySet, error) { + if len(d.pending) > 0 { + block = append(d.pending, block...) + d.pending = nil + } + if len(block) < 4 { + return nil, fmt.Errorf("VobSub: a subpicture needs 4 bytes of header, the block holds %d", len(block)) + } + size := int(binary.BigEndian.Uint16(block[0:2])) + ctrl := int(binary.BigEndian.Uint16(block[2:4])) + if ctrl < 4 || ctrl+4 > size { + return nil, fmt.Errorf("VobSub: the subpicture places its control sequences at byte %d of %d", ctrl, size) + } + if size > len(block) { + d.pending = append([]byte(nil), block...) + return nil, nil + } + spu := block[:size] + st := spuState{colour: [4]uint8{0, 1, 2, 3}, alpha: [4]uint8{0, 15, 15, 15}} + if err := st.read(spu, ctrl); err != nil { + return nil, err + } + + ds := BitmapDisplaySet{ScreenW: d.screenW, ScreenH: d.screenH} + if !st.started { + if !st.stopped { + return nil, nil + } + ds.Delay = spuDate(st.stopAt) + return []BitmapDisplaySet{ds}, nil + } + if !st.hasArea || !st.hasOffsets { + return nil, fmt.Errorf("VobSub: the subpicture starts a display without naming its area and its data") + } + img, err := d.picture(spu[:ctrl], &st) + if err != nil { + return nil, err + } + ds.Delay = spuDate(st.startAt) + if st.stopped && st.stopAt > st.startAt { + ds.Duration = spuDate(st.stopAt - st.startAt) + } + if img, at := trimTransparent(img); img != nil { + ds.Objects = []BitmapObject{{X: st.x1 + at.X, Y: st.y1 + at.Y, Forced: st.forced, Image: img}} + } + return []BitmapDisplaySet{ds}, nil +} + +// spuDate converts a control sequence's date, in units of 1024 ticks of the 90 kHz clock. +func spuDate(units int) time.Duration { + return time.Duration(units) * 1024 * time.Second / 90000 +} + +// read walks the chain of control sequences from ctrl, each naming the next; the last names itself. +func (s *spuState) read(spu []byte, ctrl int) error { + for pos := ctrl; ; { + if pos+4 > len(spu) { + return fmt.Errorf("VobSub: a control sequence at byte %d runs past the subpicture's %d bytes", pos, len(spu)) + } + date := int(binary.BigEndian.Uint16(spu[pos:])) + next := int(binary.BigEndian.Uint16(spu[pos+2:])) + if err := s.commands(spu, pos+4, date); err != nil { + return err + } + if s.started && s.visible() { + s.locked = true + } + if next == pos { + return nil + } + if next < pos+4 { + return fmt.Errorf("VobSub: the control sequence at byte %d names byte %d as the next one, which is not after it", pos, next) + } + pos = next + } +} + +// commands applies one control sequence. An unknown command ends it: its length is not known. +func (s *spuState) commands(spu []byte, p, date int) error { + need := func(n int) error { + if p+n > len(spu) { + return fmt.Errorf("VobSub: command %#02x at byte %d needs %d more byte(s), the subpicture ends first", spu[p-1], p-1, n) + } + return nil + } + for p < len(spu) { + cmd := spu[p] + p++ + switch cmd { + case spuForcedStart, spuStart: + if !s.started { + s.started, s.forced, s.startAt = true, cmd == spuForcedStart, date + } + case spuStop: + if !s.stopped { + s.stopped, s.stopAt = true, date + } + case spuColours, spuContrast: + if err := need(2); err != nil { + return err + } + v := [4]uint8{spu[p+1] & 0xf, spu[p+1] >> 4, spu[p] & 0xf, spu[p] >> 4} + if !s.locked && cmd == spuColours { + s.colour = v + } else if !s.locked { + s.alpha = v + } + p += 2 + case spuArea: + if err := need(6); err != nil { + return err + } + if !s.locked { + s.x1 = int(spu[p])<<4 | int(spu[p+1])>>4 + s.x2 = int(spu[p+1]&0xf)<<8 | int(spu[p+2]) + s.y1 = int(spu[p+3])<<4 | int(spu[p+4])>>4 + s.y2 = int(spu[p+4]&0xf)<<8 | int(spu[p+5]) + s.hasArea = true + } + p += 6 + case spuOffsets: + if err := need(4); err != nil { + return err + } + if !s.locked { + s.offset = [2]int{int(binary.BigEndian.Uint16(spu[p:])), int(binary.BigEndian.Uint16(spu[p+2:]))} + s.hasOffsets = true + } + p += 4 + case spuChange: + if err := need(2); err != nil { + return err + } + n := int(binary.BigEndian.Uint16(spu[p:])) + if n < 2 || p+n > len(spu) { + return fmt.Errorf("VobSub: a colour change command at byte %d declares %d bytes, %d remain", p-1, n, len(spu)-p) + } + p += n + default: // spuEnd, or a command this decoder does not know + return nil + } + } + return nil +} + +// picture expands the two fields into one image: the even lines from the first, the odd lines from the second. +func (d *VobSubDecoder) picture(data []byte, s *spuState) (*image.NRGBA, error) { + w, h := s.x2-s.x1+1, s.y2-s.y1+1 + if w <= 0 || h <= 0 { + return nil, fmt.Errorf("VobSub: the subpicture's area runs from %d,%d to %d,%d, which holds no pixel", s.x1, s.y1, s.x2, s.y2) + } + for _, off := range s.offset { + if off < 4 || off >= len(data) { + return nil, fmt.Errorf("VobSub: the subpicture places a field's data at byte %d, outside the %d bytes of picture data", off, len(data)) + } + } + var rgba [4][4]uint8 + for v := range rgba { + c := d.palette[s.colour[v]] + rgba[v] = [4]uint8{c[0], c[1], c[2], s.alpha[v] * 17} + } + img := image.NewNRGBA(image.Rect(0, 0, w, h)) + nib := [2]int{s.offset[0] * 2, s.offset[1] * 2} // each field's read position, in nibbles + for y := 0; y < h; y++ { + pos := nib[y&1] + for x := 0; x < w; { + code := 0 + for n := 0; n < 4; n++ { + if pos>>1 >= len(data) { + return nil, fmt.Errorf("VobSub: the picture's data ends on line %d of %d", y, h) + } + code = code<<4 | int(data[pos>>1]>>(4*(1-pos&1)))&0xf + pos++ + if code >= 4<<(2*n) { + break + } + } + run := code >> 2 + if run == 0 || run > w-x { // a zero run fills the rest of the line + run = w - x + } + if c := rgba[code&3]; c[3] != 0 { + off := img.PixOffset(x, y) + for i := 0; i < run; i++ { + copy(img.Pix[off:off+4], c[:]) + off += 4 + } + } + x += run + } + nib[y&1] = (pos + 1) &^ 1 // a line ends on a byte boundary + } + return img, nil +} diff --git a/mkv/subtitle/vobsub_test.go b/mkv/subtitle/vobsub_test.go new file mode 100644 index 00000000..108a3a8e --- /dev/null +++ b/mkv/subtitle/vobsub_test.go @@ -0,0 +1,292 @@ +package subtitle + +import ( + "strings" + "testing" + "time" +) + +const vobsubIdx = "# VobSub index file, v7\nsize: 720x576\npalette: 000000, ff0000, 00ff00, 0000ff, ffffff, 101010, 202020, 303030, 404040, 505050, 606060, 707070, 808080, 909090, a0a0a0, b0b0b0\nforced subs: OFF\n" + +type spuSeq struct { + date int + cmds []byte +} + +// vobsubSPU assembles a subpicture unit: the two fields' data at bytes 4 and 4+len(top), then the chained sequences. +func vobsubSPU(top, bottom []byte, seqs ...spuSeq) []byte { + ctrl := 4 + len(top) + len(bottom) + out := []byte{0, 0, byte(ctrl >> 8), byte(ctrl)} + out = append(append(out, top...), bottom...) + for i, s := range seqs { + next := len(out) // the last sequence names itself + if i < len(seqs)-1 { + next += 4 + len(s.cmds) + 1 + } + out = append(out, byte(s.date>>8), byte(s.date), byte(next>>8), byte(next)) + out = append(append(out, s.cmds...), spuEnd) + } + out[0], out[1] = byte(len(out)>>8), byte(len(out)) + return out +} + +func spuArea4x2(x, y int) []byte { + x2, y2 := x+3, y+1 + return []byte{spuArea, byte(x >> 4), byte(x<<4) | byte(x2>>8), byte(x2), byte(y >> 4), byte(y<<4) | byte(y2>>8), byte(y2)} +} + +// Top line: two pixels of value 1, one of 2, one of 3. Bottom line: value 2 to the end of the line. +var ( + spuTop4x2 = []byte{0x96, 0x70} + spuBottom4x2 = []byte{0x00, 0x02} +) + +// spuShow4x2 is the usual first sequence: values 0..3 take palette entries 0, 1, 2, 4, value 0 transparent. +func spuShow4x2(start byte) []byte { + cmds := []byte{start, spuColours, 0x42, 0x10, spuContrast, 0xff, 0xf0} + cmds = append(cmds, spuArea4x2(100, 400)...) + return append(cmds, spuOffsets, 0, 4, 0, 6) +} + +func newVobSub(t *testing.T) *VobSubDecoder { + t.Helper() + d, err := NewVobSubDecoder([]byte(vobsubIdx)) + if err != nil { + t.Fatal(err) + } + return d +} + +func decodeOneVobSub(t *testing.T, block []byte) BitmapDisplaySet { + t.Helper() + sets, err := newVobSub(t).Decode(block) + if err != nil { + t.Fatal(err) + } + if len(sets) != 1 { + t.Fatalf("got %d display sets, want 1", len(sets)) + } + return sets[0] +} + +func TestVobSubDecoder_Picture(t *testing.T) { + block := vobsubSPU(spuTop4x2, spuBottom4x2, + spuSeq{date: 0, cmds: spuShow4x2(spuStart)}, + spuSeq{date: 300, cmds: []byte{spuStop}}) + ds := decodeOneVobSub(t, block) + if ds.ScreenW != 720 || ds.ScreenH != 576 { + t.Errorf("plane %dx%d, want 720x576", ds.ScreenW, ds.ScreenH) + } + if ds.Delay != 0 || ds.Duration != 300*1024*time.Second/90000 { + t.Errorf("delay %v duration %v, want 0 and %v", ds.Delay, ds.Duration, 300*1024*time.Second/90000) + } + if len(ds.Objects) != 1 { + t.Fatalf("got %d objects, want 1", len(ds.Objects)) + } + o := ds.Objects[0] + if o.X != 100 || o.Y != 400 || o.Forced { + t.Errorf("object at %d,%d forced=%v, want 100,400 not forced", o.X, o.Y, o.Forced) + } + if b := o.Image.Bounds(); b.Dx() != 4 || b.Dy() != 2 { + t.Fatalf("image %dx%d, want 4x2", b.Dx(), b.Dy()) + } + red, green, white := [4]uint8{255, 0, 0, 255}, [4]uint8{0, 255, 0, 255}, [4]uint8{255, 255, 255, 255} + want := [2][4][4]uint8{{red, red, green, white}, {green, green, green, green}} + for y := range want { + for x := range want[y] { + if got := nrgbaAt(t, o.Image, x, y); got != want[y][x] { + t.Errorf("pixel %d,%d = %v, want %v", x, y, got, want[y][x]) + } + } + } +} + +func TestVobSubDecoder_TransparentAndPartialAlpha(t *testing.T) { + cmds := []byte{spuStart, spuColours, 0x42, 0x13, spuContrast, 0x08, 0xf0} + cmds = append(cmds, spuArea4x2(0, 0)...) + cmds = append(cmds, spuOffsets, 0, 4, 0, 6) + // Top line: value 0 twice, value 1, value 2. + ds := decodeOneVobSub(t, vobsubSPU([]byte{0x85, 0x60}, spuBottom4x2, spuSeq{cmds: cmds})) + img := ds.Objects[0].Image + if got := nrgbaAt(t, img, 0, 0); got != [4]uint8{} { + t.Errorf("a pixel of contrast 0 = %v, want untouched", got) + } + if got := nrgbaAt(t, img, 2, 0); got != [4]uint8{255, 0, 0, 255} { + t.Errorf("pixel value 1 = %v, want opaque red", got) + } + if got := nrgbaAt(t, img, 3, 0); got != [4]uint8{0, 255, 0, 8 * 17} { + t.Errorf("pixel value 2 = %v, want green at alpha %d", got, 8*17) + } +} + +func TestVobSubDecoder_ForcedStartAndDelay(t *testing.T) { + ds := decodeOneVobSub(t, vobsubSPU(spuTop4x2, spuBottom4x2, + spuSeq{date: 90, cmds: spuShow4x2(spuForcedStart)}, + spuSeq{date: 180, cmds: []byte{spuStop}})) + if !ds.Objects[0].Forced { + t.Error("a forced start display gave a picture that is not Forced") + } + if want := 90 * 1024 * time.Second / 90000; ds.Delay != want || ds.Duration != want { + t.Errorf("delay %v duration %v, want %v each", ds.Delay, ds.Duration, want) + } +} + +func TestVobSubDecoder_NoStopLeavesTheDurationOpen(t *testing.T) { + ds := decodeOneVobSub(t, vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)})) + if ds.Duration != 0 || ds.Clear() { + t.Errorf("duration %v clear=%v, want an open-ended picture", ds.Duration, ds.Clear()) + } +} + +func TestVobSubDecoder_StopOnlyClears(t *testing.T) { + ds := decodeOneVobSub(t, vobsubSPU(nil, nil, spuSeq{date: 45, cmds: []byte{spuStop}})) + if !ds.Clear() || ds.Delay != 45*1024*time.Second/90000 { + t.Errorf("clear=%v delay=%v, want an empty set delayed by the stop date", ds.Clear(), ds.Delay) + } + if ds.ScreenW != 720 || ds.ScreenH != 576 { + t.Errorf("plane %dx%d, want 720x576", ds.ScreenW, ds.ScreenH) + } +} + +func TestVobSubDecoder_NothingToShowOrRemove(t *testing.T) { + sets, err := newVobSub(t).Decode(vobsubSPU(nil, nil, spuSeq{cmds: []byte{spuColours, 0x42, 0x10}})) + if err != nil || len(sets) != 0 { + t.Errorf("got %d sets, err %v; want none", len(sets), err) + } +} + +// A picture that starts fully transparent takes the contrast a later sequence gives it; one that is visible keeps its own. +func TestVobSubDecoder_FadeIn(t *testing.T) { + first := spuShow4x2(spuStart) + first[5], first[6] = 0, 0 + ds := decodeOneVobSub(t, vobsubSPU(spuTop4x2, spuBottom4x2, + spuSeq{cmds: first}, + spuSeq{date: 10, cmds: []byte{spuContrast, 0xff, 0xf0}}, + spuSeq{date: 20, cmds: []byte{spuContrast, 0x11, 0x10}})) + if got := nrgbaAt(t, ds.Objects[0].Image, 0, 0); got != [4]uint8{255, 0, 0, 255} { + t.Errorf("pixel = %v, want the first visible contrast, opaque red", got) + } +} + +func TestVobSubDecoder_RunLengthForms(t *testing.T) { + area := func(w int) []byte { + x2 := w - 1 + return []byte{spuArea, 0, byte(x2 >> 8), byte(x2), 0, 0, 0} + } + for _, tc := range []struct { + name string + w int + data []byte + runs []int // lengths of the alternating runs of values 1 and 2 + }{ + {"one nibble", 4, []byte{0xd6}, []int{3, 1}}, + {"two nibbles", 16, []byte{0x3d, 0x60}, []int{15, 1}}, + {"three nibbles", 64, []byte{0x0f, 0xd6}, []int{63, 1}}, + {"four nibbles", 256, []byte{0x03, 0xfd, 0x60}, []int{255, 1}}, + {"to the end of the line", 300, []byte{0x96, 0x00, 0x01}, []int{2, 1, 297}}, + {"a run past the line stops at its end", 3, []byte{0x3d}, []int{3}}, + } { + t.Run(tc.name, func(t *testing.T) { + cmds := append([]byte{spuStart, spuColours, 0x42, 0x10}, area(tc.w)...) + cmds = append(cmds, spuOffsets, 0, 4, 0, 4) + ds := decodeOneVobSub(t, vobsubSPU(tc.data, nil, spuSeq{cmds: cmds})) + img, x := ds.Objects[0].Image, 0 + for i, n := range tc.runs { + want := [4]uint8{255, 0, 0, 255} + if tc.name != "to the end of the line" && i%2 == 1 || tc.name == "to the end of the line" && i == 1 { + want = [4]uint8{0, 255, 0, 255} + } + for ; n > 0; n, x = n-1, x+1 { + if got := nrgbaAt(t, img, x, 0); got != want { + t.Fatalf("pixel %d = %v, want %v", x, got, want) + } + } + } + if x != tc.w { + t.Fatalf("the runs cover %d pixels of %d", x, tc.w) + } + }) + } +} + +func TestNewVobSubDecoder_Refusals(t *testing.T) { + for name, tc := range map[string]struct{ idx, want string }{ + "empty": {"", "lacks the size: or palette: line"}, + "no palette": {"size: 720x576\n", "lacks the size: or palette: line"}, + "no size": {"palette: 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f\n", "lacks the size: or palette: line"}, + "short palette": {"size: 720x576\npalette: 000000, ffffff\n", "holds 2 colours"}, + "bad colour": {"size: 720x576\npalette: zz,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f\n", "not an RRGGBB colour"}, + "bad size": {"size: 720\npalette: 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f\n", "not a width x height"}, + "oversized plane": {"size: 70000x576\npalette: 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f\n", "not a width x height"}, + } { + if _, err := NewVobSubDecoder([]byte(tc.idx)); err == nil || !strings.Contains(err.Error(), tc.want) { + t.Errorf("%s: err = %v, want one naming %q", name, err, tc.want) + } + } +} + +func TestNewVobSubDecoder_ToleratesTheHeaderAsMuxersWriteIt(t *testing.T) { + d, err := NewVobSubDecoder([]byte("\r\n# comment: x\r\nSize: 720 x 480\r\nPalette: 0d00ee,ee450d,101010,ebebeb,0ce60b,ec14ed,ebff0b,0d637e,a1a1a1,c5c5c5,0e640c,89db89,0e0089,a2bdd4,ebcf0b,7e127e\r\n\x00\x00")) + if err != nil { + t.Fatal(err) + } + if d.screenW != 720 || d.screenH != 480 || d.palette[1] != [3]uint8{0xee, 0x45, 0x0d} { + t.Errorf("read %dx%d, palette[1] %v", d.screenW, d.screenH, d.palette[1]) + } +} + +func TestVobSubDecoder_Malformed(t *testing.T) { + good := vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)}) + mut := func(f func(b []byte) []byte) []byte { return f(append([]byte(nil), good...)) } + show := func(cmds ...byte) []byte { return vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: cmds}) } + for name, tc := range map[string]struct { + block []byte + want string + }{ + "short header": {[]byte{0, 4, 0}, "needs 4 bytes of header"}, + "control before data": {mut(func(b []byte) []byte { b[2], b[3] = 0, 2; return b }), "places its control sequences"}, + "control at the end": {mut(func(b []byte) []byte { b[2], b[3] = b[0], b[1]; return b }), "places its control sequences"}, + "backward chain": {mut(func(b []byte) []byte { b[10], b[11] = 0, 4; return b }), "is not after it"}, + "truncated command": {show(spuStart, spuArea, 0, 0), "needs 6 more byte(s)"}, + "no area": {show(spuStart, spuOffsets, 0, 4, 0, 6), "without naming its area"}, + "no offsets": {show(append([]byte{spuStart}, spuArea4x2(0, 0)...)...), "without naming its area"}, + "inverted area": {show(spuStart, spuArea, 0x00, 0x40, 0x00, 0, 0, 1, spuOffsets, 0, 4, 0, 6), "holds no pixel"}, + "field outside": {show(append(append([]byte{spuStart}, spuArea4x2(0, 0)...), spuOffsets, 0, 4, 0, 200)...), "outside the"}, + "bad change length": {show(spuChange, 0, 1), "colour change command"}, + "data ends early": {vobsubSPU([]byte{0x96, 0x70}, nil, spuSeq{cmds: append(append([]byte{spuStart}, spuArea4x2(0, 0)...), spuOffsets, 0, 4, 0, 5)}), + "data ends on line"}, + } { + sets, err := newVobSub(t).Decode(tc.block) + if err == nil || !strings.Contains(err.Error(), tc.want) { + t.Errorf("%s: %d sets, err = %v, want one naming %q", name, len(sets), err, tc.want) + } + } +} + +func TestVobSubDecoder_SkipsWhatItDoesNotApply(t *testing.T) { + cmds := append([]byte{spuChange, 0, 4, 0xaa, 0xbb}, spuShow4x2(spuStart)...) + ds := decodeOneVobSub(t, append(vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: cmds}), 0, 0, 0)) + if len(ds.Objects) != 1 { + t.Fatalf("a colour change command or bytes after the unit lost the picture") + } +} + +// A unit a muxer spread over two blocks comes out with the second; Reset forgets the first. +func TestVobSubDecoder_UnitOverTwoBlocks(t *testing.T) { + block := vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)}) + d := newVobSub(t) + if sets, err := d.Decode(block[:7]); err != nil || len(sets) != 0 { + t.Fatalf("the first part gave %d sets, err %v; want nothing yet", len(sets), err) + } + sets, err := d.Decode(block[7:]) + if err != nil || len(sets) != 1 || len(sets[0].Objects) != 1 { + t.Fatalf("the second part gave %d sets, err %v; want the picture", len(sets), err) + } + if _, err := d.Decode(block[:7]); err != nil { + t.Fatal(err) + } + d.Reset() + if sets, err := d.Decode(block); err != nil || len(sets) != 1 { + t.Fatalf("after Reset a whole unit gave %d sets, err %v; want its picture", len(sets), err) + } +} From 7f62f6e5c29ea11e3bcddc062a69d158264a9ad2 Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 22:15:06 +0100 Subject: [PATCH 02/15] docs(library): the VobSub and DVB bitmap subtitle decoders --- docs/library.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/docs/library.md b/docs/library.md index e6d5e5ca..d22c88e0 100644 --- a/docs/library.md +++ b/docs/library.md @@ -11,7 +11,7 @@ task-first starting point (CLI and Go side by side). | `mkv/reader` | `github.com/gravity-zero/mkvgo/mkv/reader` | Parse MKV files into `Container` | | `mkv/writer` | `github.com/gravity-zero/mkvgo/mkv/writer` | Write `Container` to MKV bytes | | `mkv/ops` | `github.com/gravity-zero/mkvgo/mkv/ops` | High-level operations | -| `mkv/subtitle` | `github.com/gravity-zero/mkvgo/mkv/subtitle` | SRT/ASS parsing | +| `mkv/subtitle` | `github.com/gravity-zero/mkvgo/mkv/subtitle` | SRT/ASS parsing, PGS/VobSub/DVB bitmap decoding | | `matroska` | `github.com/gravity-zero/mkvgo/matroska` | Facade -- re-exports everything | | `ebml` | `github.com/gravity-zero/mkvgo/ebml` | Low-level EBML codec | @@ -1909,6 +1909,58 @@ consumer's decision, not an extractor's. CLI: `mkvgo extract-subtitle -format pgs -o

` writes one PNG per cue plus a `cues.json` manifest, driven by the streaming form. +### Bitmap subtitles: VobSub and DVB + +DVD rips carry `S_VOBSUB` and broadcast captures `S_DVBSUB`: pictures again, +in two more codecs. `subtitle.VobSubDecoder` and `subtitle.DVBSubDecoder` are +block-level decoders with the shape of `subtitle.PGSDecoder`: built from the +track's CodecPrivate, fed the track's blocks in file order, `Reset` when the +read skips blocks. Both return `[]subtitle.BitmapDisplaySet`, which is the +type `PGSDisplaySet` names, so one consumer serves the three codecs: pictures +in straight-alpha `*image.NRGBA`, each with its position on the subtitle +plane (`ScreenW`/`ScreenH`), and a set with no object where the screen clears. + +```go +dec, err := subtitle.NewVobSubDecoder(track.CodecPrivate) // or NewDVBSubDecoder +for each block of the track { + data, err := track.DecodePayload(block.Data) // a track stored compressed + sets, err := dec.Decode(data) + for _, ds := range sets { + start := blockTime + ds.Delay + // ds.Objects: X, Y, Forced, Image; none = the screen clears at start + } +} +``` + +What differs from PGS: + +- **VobSub** reads its 16 colours and its plane size from the CodecPrivate (the + header of a `.idx` file); a track without them is refused, its pictures + having no colours. A block is one subpicture unit and gives one set, which + carries its own timing: `Delay` before the picture shows and `Duration` + until its stop command, zero when the unit has none (the block's duration or + the next block then ends it). `Forced` is the unit's forced-display command. + A unit a muxer spread over several blocks comes out with the block that + completes it; its time is the first block's. Colour and contrast changes + within a picture (command `0x07`) are not applied. +- **DVB** keeps regions, their pixels and the colour tables between blocks: a + display set sends only what changed, until a page composition declares a + mode change or an acquisition point. A set's objects are the regions on + screen, one picture each. The CodecPrivate names the service's composition + and ancillary pages, the segments of other pages being ignored; without one + every page is decoded. 2, 4 and 8-bit pixels, map tables, the default colour + tables and the display definition (plane size, window) are read; character + objects are not drawn. `Forced`, `Delay` and `Duration` are never set. +- Both cut each picture down to its visible pixels, `X`, `Y` moving with the + cut, and leave a picture with no visible pixel out of its set: a region that + was only erased reads as a clear. + +Both bound what a block can cost, as the PGS decoder does: a picture or a +region is at most 4096 pixels a side, a DVB block fills and draws at most four +such planes, an epoch's regions hold at most 16 MiB; past a bound, as on any +malformed block, `Decode` returns an error and the next block is decoded +normally. + --- ## Editing MP4/MOV natively From 1a8dbe45fba31e65cac7b0870f5344f099be82bb Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 22:15:09 +0100 Subject: [PATCH 03/15] docs(changelog): the VobSub and DVB subtitle decoders under Unreleased --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4115b522..10166967 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,17 @@ its series' file in [changelog/](changelog/) when a newer one ships. ## [Unreleased] +### Added + +- `subtitle.VobSubDecoder` and `subtitle.DVBSubDecoder` decode the bitmap + subtitles of DVD rips (`S_VOBSUB`) and of broadcast captures (`S_DVBSUB`) + block by block, as `subtitle.PGSDecoder` does PGS. Both return the PGS + decoder's display sets (`subtitle.BitmapDisplaySet`, the same type): each + picture in straight-alpha NRGBA with its position on the subtitle plane, an + empty set where the screen clears. +- `subtitle.PGSDisplaySet` gains `Delay` and `Duration`, which a VobSub unit's + start and stop commands set; they stay zero for PGS and DVB. + ## [0.66.2] - 2026-11-10 ### Security From f835299a011693d5b64f665b881afc471fd77d0a Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 22:28:19 +0100 Subject: [PATCH 04/15] feat(subtitle): readers for the bitmap subtitles beside a video, a VobSub .idx/.sub pair and a PGS .sup --- internal/testdata/pgs_sub.sup | Bin 0 -> 49382 bytes internal/testdata/pgs_sub_set0.png | Bin 0 -> 34099 bytes internal/testdata/vobsub.idx | 62 +++++++ internal/testdata/vobsub.sub | Bin 0 -> 178176 bytes mkv/subtitle/bitmap_samples_test.go | 107 ++++++++++++ mkv/subtitle/parse_fuzz_test.go | 33 ++++ mkv/subtitle/pgsfile.go | 61 +++++++ mkv/subtitle/sidecar_test.go | 259 ++++++++++++++++++++++++++++ mkv/subtitle/vobsubfile.go | 229 ++++++++++++++++++++++++ 9 files changed, 751 insertions(+) create mode 100644 internal/testdata/pgs_sub.sup create mode 100644 internal/testdata/pgs_sub_set0.png create mode 100644 internal/testdata/vobsub.idx create mode 100644 internal/testdata/vobsub.sub create mode 100644 mkv/subtitle/pgsfile.go create mode 100644 mkv/subtitle/sidecar_test.go create mode 100644 mkv/subtitle/vobsubfile.go diff --git a/internal/testdata/pgs_sub.sup b/internal/testdata/pgs_sub.sup new file mode 100644 index 0000000000000000000000000000000000000000..1f60bd1a0220c38ec13807e343846f05ba9c5158 GIT binary patch literal 49382 zcmeI5*^jN+dDhpS=Xt8yQxB(Y$HqpGNQg*r_im?c$4;!6DZ;>&AyJfo6d}0>w_~?* zPSqKEo=3Mkj@@b+WCyEbiGXv1#0BCn04a*Z1w!J6KLCEu^M2pnRdr6Cb9{q@w9myp zRlB}#eQUkr^A2l$U;ScAv!5pZP1B z$1lzJ_~3w#|8>a6znk;%-xhrQ=OrIkR(!m^=HoHVwD1$nb@H{h`236XwU@P&^vETC z+kAU491REQ;a?sP2B|+7jML_ad^O>hF~2=`vkh4O!AZ)<7Ek2|w#FT`e3;(?io?x-=T5i!Aih+^GkVrt5{-AeEL}Q?BX`W>y{e{vy9E z(`cNoYt$G0$jt`>k%g5W&iJ1h|NX)GaL$#*N`=oEobkk0P`BFa_nZ7bPrm})UMxVW z5lmgjgo>j7Abm!nHBEnOm43w2s#8euY@yWd_3G)FLZjDfm-zi)Hcg$WR?Cw&zkSH9 z<#xBB8A8#bSXt}!do_MvrRt1di|t;g8c*mWbLqXp9A0mJGoH5jdq{-l95jM3*EE;U zBHrWFk}wa(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i6@r;#WN#ran}wL|2uzyff;`At&=HHmI%9!H2sD5H?z z?~42*Wid#}{+?Kd%#lY$q&C0LucZm01};@$$L3$~Ma5{IU;f|(ME}dD;+LnHBI{{O?PWMU=zSIK0XXrA1^N=7Mo%=!LRGQwrC`S6=z zr?sttBHjK~GD=VFUnP_8H{ZWXX8$UgY$whBRWcyC{i|dM?DnscAzi9CV*e@``nc6a zwttljxt9H_WcII;AwNJWMM+SF{YoNk{G|5@0QuWO2$PaCDyg8N#!)PMb0_(Ln&@m0#)zY zze+|8Pbv*i6;PM_{#7#jSIJP$-M>l(b)a^)f0Yc?a&U;6ZuhT}*}qE0ZbITfsg<^z zeE+A!_z{UPmGFXZIt7O;(k{`IXf0c}o2Ag1F z8)%#jwttljL}Bkao87$8QX2|YOQQE<|0|Z6r@sn{h>HbwR z`&Y^AUnNsuAMpNFGNZJAl}y%|v452eHMIS!Wb{Uw{i|g5uaa5tu8;kzWcII;`G5B+ Gng0uh_w8o@ literal 0 HcmV?d00001 diff --git a/internal/testdata/pgs_sub_set0.png b/internal/testdata/pgs_sub_set0.png new file mode 100644 index 0000000000000000000000000000000000000000..77ac5e0da5f5e03228e1a21c956eae5e000d45f7 GIT binary patch literal 34099 zcmeFZ=T}qP7d0Hff=Ce*q$46CQbl@IktRy-RRshIJ<>}+1f(|+=}o$X5+Jkyg7gx4 z=%EJ)5LyTU0uT4z=l37H@AJv?PsB} z;Cdhca7B{*+T}m%qrVj|Pd8jtjX{^^e-0AB7w@~5KW+ikUOw0JO5d7#eghy(+1g6K zW_j?Ml44Qg`FRT2f7d>1o1^}31X!RUWBhM;uMP0etuK$S!ht0JjqX#v{cjLR{`azf zkoXJ8zkK-1kbhzL8#4dG@K+rEh2gI_{0GBdari3^e`DcqECBwl3xC%Iz~3C{UlRO{ zg}<@z|1cJWMP^n1=LP)L;lFMM;Qt}_{_^cF-~Qk7t!o}`)T3i=3)s08^;CGURg#QL z<(|tGvaOex*|9Yy~ ze{c8?B!4mdj~IVx^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nXuCJ4(7Z<*QyN<3m4p`>ak^a&yRs=n3ojFkd71bKG!%a-lS zBNcR#GnNtDUw6{H^7ac{d(Fq=vY2AF{*9z(!-wY|owqgg$Wk@Hv%e1KsnnC=at|$Q z>PE-e%9}}$M)F*oO6|P>bs|P6|AmwSgX{z&=-R}GJ2(aBWo_VD#>5x&Ehw~)z8A{k zky#g@!?n1&N};2C^AaZtNd18|n8z2DHZgVVb=|+wRpu5cYw}@80?{_%1S>b;%yN=j z06#7|x?unOAw(1>Vp}M)G%PzH5N{KiScYYuKGp>BhVD;Fr&*BfS$$@A==SbHm96ox-_i!2t-|{&B{KsaxnI zkHkR{^Jhb}yYWBTGG%gumbZuFRwWvGR+V_@YtE*3*Wel#D(BdxK_kg7x|3lwg`|1u z?31!o*Dq?@6)ay{oQcuI*K(MSu~{I>+a6g z6dSC!xM&-t<1U8OE93I>yZy5GnLo0v_tR5ozHen)3m5;=+0y*sYy6qvRNi5| zQQBFLvoiBg=tKY#ig)Q?Np4k{e={ahUy;8MdqD&C)CJ}=WnjeEm9rodOR^>CxYoRo zA-Ke`ZHO1%s`P8Ue5Q{aj8j4${WtJW_LSI5-`5cwfG)p;|H+$vP4<1pDa;Ui8;fS;)$hVpNd%MV3`)-S7!^Ux@|AuTx<3Sgz z{bSo{XZO4o^AE(g>CW^MjQni$_(0Li7FMFbMIKlJuH7U}+ z5M&8fBc)-(&7;9KmParn<%ig|xxq{f1e+R2LenJQ37n+_T4Q7g+-ZFFhSs6nwG_#EojrpO*A@suRF=`4V{(tp&-R zT3W!py@r!E+#+w%u_ TJxo~szL1`lk!H2JL*)MeBU68( literal 0 HcmV?d00001 diff --git a/internal/testdata/vobsub.idx b/internal/testdata/vobsub.idx new file mode 100644 index 00000000..c663f290 --- /dev/null +++ b/internal/testdata/vobsub.idx @@ -0,0 +1,62 @@ +# VobSub index file, v7 (do not modify this line!) +# +# Generated by MPlayer dev-SVN-r25315 +# See for more information about MPlayer +# See for more information about Vobsub +# +size: 720x480 +palette: 0d00ee, ee450d, 101010, ebebeb, 0ce60b, ec14ed, ebff0b, 0d637e, a1a1a1, c5c5c5, 0e640c, 89db89, 0e0089, a2bdd4, ebcf0b, 7e127e +# ON: displays only forced subtitles, OFF: shows everything +forced subs: OFF + +# Language index in use +langidx: 0 + +id: en, index: 0 +timestamp: 00:02:12:499, filepos: 000000000 +timestamp: 00:02:27:355, filepos: 000001000 +timestamp: 00:03:00:797, filepos: 000002000 +timestamp: 00:03:03:433, filepos: 000003000 +timestamp: 00:03:05:919, filepos: 000004800 +timestamp: 00:03:05:910, filepos: 000005000 +timestamp: 00:03:08:663, filepos: 000005800 +timestamp: 00:03:10:014, filepos: 000006800 +timestamp: 00:03:19:724, filepos: 000007800 +timestamp: 00:03:21:175, filepos: 000008800 +timestamp: 00:03:22:819, filepos: 000009000 +timestamp: 00:03:24:762, filepos: 00000a000 +timestamp: 00:03:26:806, filepos: 00000b000 +timestamp: 00:03:28:716, filepos: 00000c000 +timestamp: 00:03:30:051, filepos: 00000d000 +timestamp: 00:03:31:644, filepos: 00000e000 +timestamp: 00:03:34:380, filepos: 00000f800 +timestamp: 00:03:37:225, filepos: 000011000 +timestamp: 00:03:39:652, filepos: 000012000 +timestamp: 00:03:43:531, filepos: 000012800 +timestamp: 00:03:47:510, filepos: 000013800 +timestamp: 00:03:50:872, filepos: 000015000 +timestamp: 00:03:53:124, filepos: 000016000 +timestamp: 00:03:57:303, filepos: 000017800 +timestamp: 00:04:00:106, filepos: 000019000 +timestamp: 00:04:33:556, filepos: 00001a000 +timestamp: 00:04:55:445, filepos: 00001b000 +timestamp: 00:05:00:049, filepos: 00001b800 +timestamp: 00:05:02:018, filepos: 00001c800 +timestamp: 00:05:02:035, filepos: 00001d000 +timestamp: 00:05:04:203, filepos: 00001d800 +timestamp: 00:05:05:947, filepos: 00001e800 +timestamp: 00:05:07:957, filepos: 00001f800 +timestamp: 00:05:21:295, filepos: 000020800 +timestamp: 00:05:23:356, filepos: 000021800 +timestamp: 00:05:24:640, filepos: 000022800 +timestamp: 00:05:27:193, filepos: 000023800 +timestamp: 00:05:28:369, filepos: 000024800 +timestamp: 00:05:28:361, filepos: 000025000 +timestamp: 00:05:29:946, filepos: 000025800 +timestamp: 00:05:31:230, filepos: 000026000 +timestamp: 00:05:32:924, filepos: 000027000 +timestamp: 00:05:42:600, filepos: 000028000 +timestamp: 00:05:46:771, filepos: 000028800 +timestamp: 00:05:57:640, filepos: 000029800 +timestamp: 00:05:59:834, filepos: 00002a800 +timestamp: 00:06:05:248, filepos: 00002b800 diff --git a/internal/testdata/vobsub.sub b/internal/testdata/vobsub.sub new file mode 100644 index 0000000000000000000000000000000000000000..56b38234cdfc2bd3456b81da44a49d5c551ced5c GIT binary patch literal 178176 zcmeFa4^W)vo##nIE#xtd{bLcM=QeZ9kao3cWEH_z1ib?BEdlS7XzcSf$w$y z>G!+&+Wq}MFDZ%mW!tFM9FEktM-X-W%h~SP(N`%@{P(xG0%bQkx3({r#7=Z>431v= z{`Kz9cHj4<<r z_eGOE6EW95e|EECtl!~*csW;$Vj#}nU8(tz>1j9HRCOk;*=f36bh;;1eL8ZC<+dt^ z2N;W2B@r5MokUW#4Ye$&U*)09SNg_>-2xrW9HeG!;DPi&Jd)aEeKcNKV2pn0N2cE7 zN{e|kRja0Bz1{lLn2Fkq+mrFeXj^o5v^;xHGSK^2G|c~3duIE)C;t}rX|b!nu@xx0 zVXydje|y93WV|`pKRY#hF4z~C>h9H!ce`aK`1nFSXK%xf#gLusgN>O3?qE0gAi(ya z&ea!pw8r|PBkc8#)TZbrZhgL;y{G*b8~A)yP{HloFh%M!Q4X+nV{@wdR3@6t_BAA8 zc5~GUABbzC+9~8%bwBB9wNGC?8RD8AXXdwYWPF(LYmwB#0?m5I);s0Nx%mYOB{|fG z4)A-LA@Or)97u9(g2AsWJ{0OZFvMLSD!e(-^MVHy;yv>-K2VsNZO@&kApp=Ek2Dtd zpZPHuz~!5+JRpq`&*YBap6RKcg_wg0(*vhr=t1rSg)} zizO}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W1AFdZ<|Q67R@c&RZO9uIkJBo7@Nji z0QdZT#MHzMDgeICMG8x6T)AP$_tQ6us>p41HUuv1C^o^6PK0}&r}?4&*nz$Z4yW5g z;^>D=pO-2k79bYWl&ZUOyT8 zpo^aR@vwpWNLVA4n+RBDqF@Ukk7&8wL<2ppSlaR3Ly^th-|bKjX8%Aat4Kn+e2hCf9?7ITYFywgr^1BH0+9J^ zxHAAec@`Lv^yYYKi_$t;rG}9k_z7V3G#9G`qm_3$ld)42brE=fkad7GJoY-Pmq^1Yfu_ z#}3wpO?@Jku-RC^92W>Lq9(p<*0{Suig_t;F)$&uU;Yo?ID!116C}|zHisZKj>dp#Q=op#IEN%rDJel2 z97IYRBlo)>ePSw%lC%;$H8mht0Npw&^_{>4lnD7my z!d*aGF#R`ag};~WML(H(aY1$B^Pg0mIKH6%@a!V`!<~z(4L|(~U2$=qC{$K;d&wWH fxahMP-a&|&Pv6^O3&jyAjzDn)iX-qV9fAKJ20-Og literal 0 HcmV?d00001 diff --git a/mkv/subtitle/bitmap_samples_test.go b/mkv/subtitle/bitmap_samples_test.go index 885fef8f..244593ca 100644 --- a/mkv/subtitle/bitmap_samples_test.go +++ b/mkv/subtitle/bitmap_samples_test.go @@ -4,6 +4,7 @@ package subtitle_test // The golden pictures are the mainstream decoder's rendering of one display set on the whole subtitle plane. import ( + "bytes" "context" "image" "image/png" @@ -200,6 +201,112 @@ func TestDVBSubDecoder_RealTrack(t *testing.T) { } } +// The .idx/.sub pair the VobSub sample was muxed from gives the same units at the same times as the Matroska. +func TestVobSubIndex_RealPair(t *testing.T) { + _, blocks := sampleTrack(t, vobsubSample) + type unit struct { + timeMs int64 + data []byte + } + var want []unit // a unit the muxer cut in two is the two blocks, at the time of the first + for _, b := range blocks { + if n := len(want); n > 0 && len(want[n-1].data) < int(want[n-1].data[0])<<8|int(want[n-1].data[1]) { + want[n-1].data = append(want[n-1].data, b.Data...) + continue + } + want = append(want, unit{b.Timecode, b.Data}) + } + + idx, err := os.Open("../../internal/testdata/vobsub.idx") + if err != nil { + t.Fatal(err) + } + defer idx.Close() + ix, err := subtitle.ParseVobSubIndex(idx) + if err != nil { + t.Fatal(err) + } + if len(ix.Streams) != 1 || ix.Streams[0].Language != "en" || ix.Streams[0].Index != 0 || len(ix.Streams[0].Entries) != 47 { + t.Fatalf("index = %d streams, the first %q with %d entries; want one, en, 47", len(ix.Streams), ix.Streams[0].Language, len(ix.Streams[0].Entries)) + } + sub, err := os.Open("../../internal/testdata/vobsub.sub") + if err != nil { + t.Fatal(err) + } + defer sub.Close() + d, err := subtitle.NewVobSubDecoder(ix.Header) + if err != nil { + t.Fatal(err) + } + var got []unit + var first subtitle.BitmapDisplaySet + err = ix.ForEachUnit(sub, 0, func(timeMs int64, data []byte) error { + sets, err := d.Decode(data) + if err != nil || len(sets) != 1 { + t.Errorf("unit at %d ms: %d sets, err %v", timeMs, len(sets), err) + } else if len(got) == 0 { + first = sets[0] + } + got = append(got, unit{timeMs, append([]byte(nil), data...)}) + return nil + }) + if err != nil { + t.Fatal(err) + } + // 47 entries: three are the second packet of a unit, the last sits at the end of the .sub. + if len(got) != 43 || len(want) != 43 { + t.Fatalf("the pair gives %d units, the Matroska %d; want 43 each", len(got), len(want)) + } + for i := range want { + if got[i].timeMs != want[i].timeMs || !bytes.Equal(got[i].data, want[i].data) { + t.Errorf("unit %d: %d ms and %d bytes from the pair, %d ms and %d bytes from the Matroska", i, got[i].timeMs, len(got[i].data), want[i].timeMs, len(want[i].data)) + } + } + if n := planeDiff(t, first, "../../internal/testdata/vobsub_cue0.png"); n != 0 { + t.Errorf("the first unit differs from its golden rendering on %d pixels", n) + } +} + +// A real .sup: one whole display set, then one the file stops in the middle of. +func TestForEachSUPDisplaySet_RealFile(t *testing.T) { + f, err := os.Open("../../internal/testdata/pgs_sub.sup") + if err != nil { + t.Fatal(err) + } + defer f.Close() + d := subtitle.NewPGSDecoder() + var times []int64 + var first subtitle.BitmapDisplaySet + err = subtitle.ForEachSUPDisplaySet(f, func(timeMs int64, set []byte) error { + sets, err := d.Decode(set) + if err != nil || len(sets) != 1 { + t.Errorf("display set at %d ms: %d sets, err %v", timeMs, len(sets), err) + } else if len(times) == 0 { + first = sets[0] + } + times = append(times, timeMs) + return nil + }) + if err != nil { + t.Fatal(err) + } + if len(times) != 2 || times[0] != 67 || times[1] != 401 { + t.Fatalf("display sets at %v ms, want 67 and 401", times) + } + if first.ScreenW != 1920 || first.ScreenH != 1080 || len(first.Objects) != 2 { + t.Fatalf("first set: plane %dx%d, %d objects; want 1920x1080 and 2", first.ScreenW, first.ScreenH, len(first.Objects)) + } + for i, want := range []sampleCue{{x: 383, y: 956, w: 1156, h: 67}, {x: 100, y: 958, w: 123, h: 63}} { + o := first.Objects[i] + if got := (sampleCue{x: o.X, y: o.Y, w: o.Image.Bounds().Dx(), h: o.Image.Bounds().Dy()}); got != want { + t.Errorf("object %d = %+v, want %+v", i, got, want) + } + } + if n := planeDiff(t, first, "../../internal/testdata/pgs_sub_set0.png"); n != 0 { + t.Errorf("the first display set differs from its golden rendering on %d pixels", n) + } +} + // decodeTrack is what a benchmark iteration does: a fresh decoder over every block of the track. func decodeTrack(b *testing.B, blocks []mkv.Block, decode func([]byte) ([]subtitle.BitmapDisplaySet, error)) { for _, blk := range blocks { diff --git a/mkv/subtitle/parse_fuzz_test.go b/mkv/subtitle/parse_fuzz_test.go index 79b49ba9..1d087c9b 100644 --- a/mkv/subtitle/parse_fuzz_test.go +++ b/mkv/subtitle/parse_fuzz_test.go @@ -115,3 +115,36 @@ func FuzzDVBSubDecode(f *testing.F) { }) }) } + +// FuzzVobSubFiles: any .idx and any .sub give units or an error, never a panic, within the input's time budget. +func FuzzVobSubFiles(f *testing.F) { + unit := vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)}) + f.Add([]byte(vobsubIdxFile), concat(subPack(0x20, true, unit[:9]), subPadding(5), subPack(0x20, false, unit[9:]))) + f.Add([]byte("id: en, index: 0\ntimestamp: 00:00:00:000, filepos: 0\n"), []byte{0, 0, 1, 0xbd, 0, 4, 0x80, 0, 0, 0x20}) + f.Fuzz(func(t *testing.T, idx, sub []byte) { + costguard.Fuzz(t, len(idx)+len(sub), func() { + ix, err := ParseVobSubIndex(bytes.NewReader(idx)) + if err != nil { + return + } + for i := range ix.Streams { + _ = ix.ForEachUnit(bytes.NewReader(sub), i, func(int64, []byte) error { return nil }) + } + }) + }) +} + +// FuzzSUPFile: any bytes read as a .sup give display sets or an error, never a panic. +func FuzzSUPFile(f *testing.F) { + f.Add(supFile(concat(pgsPCS(1920, 1080, pgsEpochStart, 0), pgsEND()), pgsPCS(1920, 1080, 0, 0))) + f.Add([]byte("PG")) + f.Fuzz(func(t *testing.T, data []byte) { + costguard.Fuzz(t, len(data), func() { + d := NewPGSDecoder() + _ = ForEachSUPDisplaySet(bytes.NewReader(data), func(_ int64, set []byte) error { + _, _ = d.Decode(set) + return nil + }) + }) + }) +} diff --git a/mkv/subtitle/pgsfile.go b/mkv/subtitle/pgsfile.go new file mode 100644 index 00000000..a1d54b86 --- /dev/null +++ b/mkv/subtitle/pgsfile.go @@ -0,0 +1,61 @@ +package subtitle + +// pgsfile.go - PGS as the .sup file that sits beside a video: the segments of the stream one after another, each +// behind "PG" and its presentation and decoding times on the 90 kHz clock. + +import ( + "bufio" + "encoding/binary" + "errors" + "fmt" + "io" +) + +// supMaxDisplaySet bounds the segments gathered for one display set: what an epoch's objects may hold. +const supMaxDisplaySet = pgsMaxEpochBytes + +// ForEachSUPDisplaySet reads a .sup file and calls fn with each display set: its time, the presentation time of its +// composition segment, and its segments as a Matroska block holds them, which is what PGSDecoder.Decode takes. A +// file cut short inside a segment gives the display sets ahead of it, then an error; one that ends between two +// segments gives its last display set as it stands, without its end segment. An error from fn stops the read and is +// returned as is. +func ForEachSUPDisplaySet(r io.Reader, fn func(timeMs int64, displaySet []byte) error) error { + br := bufio.NewReader(r) + var set []byte + var timeMs int64 + timed := false + for n := 0; ; n++ { + var head [13]byte + if _, err := io.ReadFull(br, head[:]); err != nil { + if !errors.Is(err, io.EOF) { + return fmt.Errorf("PGS file: segment %d is cut short in its header: %w", n, err) + } + if len(set) == 0 { + return nil + } + return fn(timeMs, set) // a last display set without its end segment + } + if head[0] != 'P' || head[1] != 'G' { + return fmt.Errorf("PGS file: segment %d starts with %q, not \"PG\": the file is not a .sup", n, head[:2]) + } + typ, size := head[10], int(binary.BigEndian.Uint16(head[11:13])) + if len(set)+3+size > supMaxDisplaySet { + return fmt.Errorf("PGS file: the display set at %d ms holds more than %d bytes", timeMs, supMaxDisplaySet) + } + set = append(set, head[10:13]...) + set = append(set, make([]byte, size)...) + if _, err := io.ReadFull(br, set[len(set)-size:]); err != nil { + return fmt.Errorf("PGS file: segment %d is cut short in its %d bytes: %w", n, size, err) + } + if typ == pgsSegPCS || !timed { + timeMs, timed = int64(binary.BigEndian.Uint32(head[2:6]))/90, true + } + if typ != pgsSegEND { + continue + } + if err := fn(timeMs, set); err != nil { + return err + } + set, timed = nil, false + } +} diff --git a/mkv/subtitle/sidecar_test.go b/mkv/subtitle/sidecar_test.go new file mode 100644 index 00000000..244fddc2 --- /dev/null +++ b/mkv/subtitle/sidecar_test.go @@ -0,0 +1,259 @@ +package subtitle + +import ( + "bytes" + "errors" + "io" + "strings" + "testing" +) + +const vobsubIdxFile = vobsubIdx + `langidx: 0 +time offset: 100 + +id: en, index: 0 +alt: English +timestamp: 00:00:01:000, filepos: 000000000 +timestamp: 00:00:01:010, filepos: 000000800 +delay: 00:00:10:000 +timestamp: 01:02:03:004, filepos: 00000a000 + +id: fr, index: 1 +timestamp: 00:00:05:500, filepos: 000001000 +delay: -00:00:00:500 +timestamp: 00:00:07:000, filepos: 000002000 +` + +func TestParseVobSubIndex(t *testing.T) { + ix, err := ParseVobSubIndex(strings.NewReader(vobsubIdxFile)) + if err != nil { + t.Fatal(err) + } + if _, err := NewVobSubDecoder(ix.Header); err != nil { + t.Errorf("the header does not make a decoder: %v", err) + } + if strings.Contains(string(ix.Header), "timestamp") || !strings.Contains(string(ix.Header), "langidx: 0") { + t.Errorf("header = %q, want every line ahead of the first stream and none after", ix.Header) + } + want := []VobSubStream{ + {Language: "en", Name: "English", Index: 0, Entries: []VobSubEntry{{1100, 0}, {1110, 0x800}, {3723104 + 10000, 0xa000}}}, + {Language: "fr", Index: 1, Entries: []VobSubEntry{{5600, 0x1000}, {6600, 0x2000}}}, + } + if len(ix.Streams) != len(want) { + t.Fatalf("got %d streams, want %d", len(ix.Streams), len(want)) + } + for i, w := range want { + g := ix.Streams[i] + if g.Language != w.Language || g.Name != w.Name || g.Index != w.Index || len(g.Entries) != len(w.Entries) { + t.Errorf("stream %d = %+v, want %+v", i, g, w) + continue + } + for k := range w.Entries { + if g.Entries[k] != w.Entries[k] { + t.Errorf("stream %d entry %d = %+v, want %+v", i, k, g.Entries[k], w.Entries[k]) + } + } + } +} + +func TestParseVobSubIndex_Refusals(t *testing.T) { + for name, tc := range map[string]struct{ idx, want string }{ + "no stream": {vobsubIdx, "names no stream"}, + "bad stream": {"id: en, index: x\n", "does not name a stream"}, + "stream past 31": {"id: en, index: 32\n", "does not name a stream"}, + "orphan timestamp": {"timestamp: 00:00:01:000, filepos: 0\n", "ahead of any"}, + "bad time": {"id: en, index: 0\ntimestamp: 00:00:01, filepos: 0\n", "is not \"timestamp:"}, + "bad position": {"id: en, index: 0\ntimestamp: 00:00:01:000, filepos: zz\n", "is not \"timestamp:"}, + "bad delay": {"id: en, index: 0\ndelay: soon\n", "is not HH:MM:SS:mmm"}, + "endless line": {"id: en, index: 0\n" + strings.Repeat("x", vobsubMaxIndexLine+1), "token too long"}, + } { + if _, err := ParseVobSubIndex(strings.NewReader(tc.idx)); err == nil || !strings.Contains(err.Error(), tc.want) { + t.Errorf("%s: err = %v, want one naming %q", name, err, tc.want) + } + } +} + +// subPack is one pack of a .sub: a pack header, then a private-stream packet carrying payload for a substream. +func subPack(substream byte, pts bool, payload []byte) []byte { + head := []byte{0x80, 0x00, 0x00} + if pts { + head = []byte{0x80, 0x80, 0x05, 0x21, 0x00, 0x01, 0x00, 0x01} + } + pes := append(append(head, substream), payload...) + out := []byte{0, 0, 1, 0xba, 0x44, 0, 4, 0, 4, 1, 1, 0x89, 0xc3, 0xf8} + return append(append(out, 0, 0, 1, 0xbd, byte(len(pes)>>8), byte(len(pes))), pes...) +} + +func subPadding(n int) []byte { + return append([]byte{0, 0, 1, 0xbe, byte(n >> 8), byte(n)}, bytes.Repeat([]byte{0xff}, n)...) +} + +// A unit over two packs, the other language's pack and padding between them; the index also lists the second pack. +func TestVobSubIndex_ForEachUnit(t *testing.T) { + en := vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)}, spuSeq{date: 300, cmds: []byte{spuStop}}) + fr := vobsubSPU(nil, nil, spuSeq{date: 45, cmds: []byte{spuStop}}) + first := subPack(0x20, true, en[:9]) + other := subPack(0x21, true, fr) + pad := subPadding(5) + second := subPack(0x20, false, en[9:]) + third := subPack(0x20, true, en) + sub := concat(first, other, pad, second, third) + at := func(parts ...[]byte) int64 { return int64(len(concat(parts...))) } + ix := &VobSubIndex{Streams: []VobSubStream{ + {Language: "en", Index: 0, Entries: []VobSubEntry{{1000, 0}, {1000, at(first, other, pad)}, {5000, at(first, other, pad, second)}}}, + {Language: "fr", Index: 1, Entries: []VobSubEntry{{2000, at(first)}}}, + }} + type got struct { + timeMs int64 + unit []byte + } + read := func(stream int) (out []got) { + t.Helper() + err := ix.ForEachUnit(bytes.NewReader(sub), stream, func(timeMs int64, unit []byte) error { + out = append(out, got{timeMs, unit}) + return nil + }) + if err != nil { + t.Fatal(err) + } + return out + } + units := read(0) + if len(units) != 2 || units[0].timeMs != 1000 || units[1].timeMs != 5000 || !bytes.Equal(units[0].unit, en) || !bytes.Equal(units[1].unit, en) { + t.Fatalf("stream 0 gave %d units (%+v), want the unit at 1000 ms and the one at 5000 ms", len(units), units) + } + if units := read(1); len(units) != 1 || units[0].timeMs != 2000 || !bytes.Equal(units[0].unit, fr) { + t.Fatalf("stream 1 gave %+v, want its one unit", units) + } + sets, err := newVobSub(t).Decode(units[0].unit) + if err != nil || len(sets) != 1 || len(sets[0].Objects) != 1 { + t.Errorf("the unit read from the .sub decodes to %d sets, err %v", len(sets), err) + } + stop := errors.New("stop") + if err := ix.ForEachUnit(bytes.NewReader(sub), 0, func(int64, []byte) error { return stop }); err != stop { + t.Errorf("err = %v, want the callback's own", err) + } +} + +// An index entry at the end of the .sub, which some tools write last, is no unit and no error. +func TestVobSubIndex_ForEachUnit_EntryPastTheEnd(t *testing.T) { + unit := vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)}) + sub := subPack(0x20, true, unit) + ix := &VobSubIndex{Streams: []VobSubStream{{Entries: []VobSubEntry{{1000, 0}, {2000, int64(len(sub))}, {3000, 1 << 20}}}}} + n := 0 + err := ix.ForEachUnit(bytes.NewReader(sub), 0, func(int64, []byte) error { n++; return nil }) + if err != nil || n != 1 { + t.Errorf("%d units, err %v; want the one unit the .sub holds", n, err) + } +} + +func TestVobSubIndex_ForEachUnit_Refusals(t *testing.T) { + unit := vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)}) + one := func(pos int64) *VobSubIndex { + return &VobSubIndex{Streams: []VobSubStream{{Index: 0, Entries: []VobSubEntry{{1000, pos}}}}} + } + mpeg1 := subPack(0x20, true, unit) + mpeg1[4] = 0x21 + for name, tc := range map[string]struct { + sub []byte + ix *VobSubIndex + stream int + want string + }{ + "no such stream": {nil, one(0), 3, "stream 3 of an index of 1"}, + "not a packet": {[]byte("RIFF....WAVE"), one(0), 0, "does not start an MPEG packet"}, + "MPEG-1 pack": {mpeg1, one(0), 0, "not an MPEG-2 program stream pack"}, + "unit cut short": {subPack(0x20, true, unit[:9]), one(0), 0, "the file ends 9 bytes into a unit of"}, + "packet cut short": {subPack(0x20, true, unit)[:30], one(0), 0, "cut short"}, + "program end": {concat(subPack(0x20, true, unit[:9]), []byte{0, 0, 1, 0xb9, 0, 0}), one(0), 0, "the stream ends 9 bytes into a unit"}, + "empty packet": {[]byte{0, 0, 1, 0xbd, 0, 3, 0x80, 0, 0}, one(0), 0, "holds no payload"}, + "unit of no size": {subPack(0x20, true, []byte{0, 2, 0, 0}), one(0), 0, "the unit declares 2 bytes"}, + "only another language": {bytes.Repeat(subPack(0x21, true, unit), 1), one(0), 0, "no packet at byte"}, + } { + err := tc.ix.ForEachUnit(bytes.NewReader(tc.sub), tc.stream, func(int64, []byte) error { return nil }) + if err == nil || !strings.Contains(err.Error(), tc.want) { + t.Errorf("%s: err = %v, want one naming %q", name, err, tc.want) + } + } +} + +// supFile wraps display set segments as a .sup holds them, every segment of a set at the set's time. +func supFile(sets ...[]byte) []byte { + var out []byte + for i, set := range sets { + pts := uint32(i+1) * 90000 + for len(set) > 0 { + n := 3 + int(set[1])<<8 + int(set[2]) + out = append(out, 'P', 'G', byte(pts>>24), byte(pts>>16), byte(pts>>8), byte(pts), 0, 0, 0, 0) + out = append(out, set[:n]...) + set = set[n:] + } + } + return out +} + +func TestForEachSUPDisplaySet(t *testing.T) { + show := concat(pgsPCS(1920, 1080, pgsEpochStart, 0, synthObject{id: 1, x: 10, y: 20}), pgsWDS(10, 20, 4, 2), + pgsPDS(0, palWhite, palBlue), pgsODS(1, 4, 2, rle4x2), pgsEND()) + clear := concat(pgsPCS(1920, 1080, 0, 0), pgsEND()) + noEnd := clear[:len(clear)-len(pgsEND())] + type got struct { + timeMs int64 + set []byte + } + read := func(file []byte) (out []got, err error) { + err = ForEachSUPDisplaySet(bytes.NewReader(file), func(timeMs int64, set []byte) error { + out = append(out, got{timeMs, append([]byte(nil), set...)}) + return nil + }) + return out, err + } + sets, err := read(supFile(show, clear, noEnd)) + if err != nil { + t.Fatal(err) + } + if len(sets) != 3 || sets[0].timeMs != 1000 || sets[1].timeMs != 2000 || sets[2].timeMs != 3000 { + t.Fatalf("got %d sets (%v), want three at 1, 2 and 3 s", len(sets), sets) + } + if !bytes.Equal(sets[0].set, show) || !bytes.Equal(sets[1].set, clear) || !bytes.Equal(sets[2].set, noEnd) { + t.Errorf("a display set is not the segments the file holds for it") + } + d := NewPGSDecoder() + if ds, err := d.Decode(sets[0].set); err != nil || len(ds) != 1 || len(ds[0].Objects) != 1 { + t.Errorf("the first set decodes to %d sets, err %v", len(ds), err) + } + + file := supFile(show, clear) + for name, tc := range map[string]struct { + file []byte + sets int + want string + }{ + "cut in a header": {file[:len(file)-len(clear)-20+5], 1, "is cut short in its header"}, + "cut in a segment": {file[:len(supFile(show))+15], 1, "is cut short in its"}, + "not a .sup": {[]byte("1\n00:00:01,000 --> 00:00:02,000\nHello\n"), 0, "the file is not a .sup"}, + } { + sets, err := read(tc.file) + if err == nil || !strings.Contains(err.Error(), tc.want) || len(sets) != tc.sets { + t.Errorf("%s: %d sets, err = %v; want %d sets and an error naming %q", name, len(sets), err, tc.sets, tc.want) + } + } + if sets, err := read(nil); err != nil || len(sets) != 0 { + t.Errorf("an empty file: %d sets, err %v", len(sets), err) + } + stop := io.ErrClosedPipe + if err := ForEachSUPDisplaySet(bytes.NewReader(file), func(int64, []byte) error { return stop }); err != stop { + t.Errorf("err = %v, want the callback's own", err) + } +} + +func TestForEachSUPDisplaySet_Bounded(t *testing.T) { + seg := pgsSegment(pgsSegODS, make([]byte, 65535)) + var sets [][]byte + big := bytes.Repeat(seg, supMaxDisplaySet/len(seg)+1) + sets = append(sets, big) + err := ForEachSUPDisplaySet(bytes.NewReader(supFile(sets...)), func(int64, []byte) error { return nil }) + if err == nil || !strings.Contains(err.Error(), "holds more than") { + t.Errorf("err = %v, want the display set bound", err) + } +} diff --git a/mkv/subtitle/vobsubfile.go b/mkv/subtitle/vobsubfile.go new file mode 100644 index 00000000..26583ea1 --- /dev/null +++ b/mkv/subtitle/vobsubfile.go @@ -0,0 +1,229 @@ +package subtitle + +// vobsubfile.go - VobSub as the two files that sit beside a video: the .idx, a text file holding the header a +// VobSubDecoder takes and, per language, the time and the position of each subpicture; and the .sub, an MPEG +// program stream whose private-stream packets carry the subpicture units, a unit over as many packets as it needs. + +import ( + "bufio" + "encoding/binary" + "errors" + "fmt" + "io" + "strconv" + "strings" +) + +const ( + // vobsubMaxIndexLine bounds one line of a .idx; the palette line, the longest, is under 200 bytes. + vobsubMaxIndexLine = 64 << 10 + // vobsubMaxUnitScan bounds the bytes of the .sub read for one unit: its 64 KiB at most, in 2 KiB packs + // interleaved with those of the other languages. + vobsubMaxUnitScan = 4 << 20 +) + +// VobSubIndex is a parsed .idx file. +type VobSubIndex struct { + // Header is the part of the file ahead of the first language: what NewVobSubDecoder takes. + Header []byte + Streams []VobSubStream +} + +// VobSubStream is one language of a .idx/.sub pair. +type VobSubStream struct { + Language string // the id: of the stream, as written ("en", "fr") + Name string // its alt: line, when it has one + // Index is the stream's number in the .sub, the low bits of its packets' substream ID. + Index int + Entries []VobSubEntry +} + +// VobSubEntry places one subpicture: when it is shown and where its first packet starts in the .sub. +type VobSubEntry struct { + TimeMs int64 + Pos int64 +} + +// ParseVobSubIndex reads a .idx file. An entry's time has the stream's delay: lines and the header's +// time offset: applied. +func ParseVobSubIndex(r io.Reader) (*VobSubIndex, error) { + ix := &VobSubIndex{} + sc := bufio.NewScanner(r) + sc.Buffer(make([]byte, 0, 4096), vobsubMaxIndexLine) + var offsetMs, delayMs int64 + var cur *VobSubStream + for n := 1; sc.Scan(); n++ { + line := strings.TrimSpace(sc.Text()) + key, val, ok := strings.Cut(line, ":") + key, val = strings.ToLower(strings.TrimSpace(key)), strings.TrimSpace(val) + if !ok || strings.HasPrefix(line, "#") { + key = "" + } + switch key { + case "id": + lang, rest, _ := strings.Cut(val, ",") + _, num, _ := strings.Cut(rest, ":") + index, err := strconv.Atoi(strings.TrimSpace(num)) + if err != nil || index < 0 || index > 31 { + return nil, fmt.Errorf("VobSub index, line %d: %q does not name a stream as \"id: xx, index: 0..31\"", n, line) + } + ix.Streams = append(ix.Streams, VobSubStream{Language: strings.TrimSpace(lang), Index: index}) + cur, delayMs = &ix.Streams[len(ix.Streams)-1], 0 + continue + case "time offset": + if cur == nil { + offsetMs, _ = strconv.ParseInt(val, 10, 64) + } + case "alt": + if cur != nil { + cur.Name = val + continue + } + case "delay": + if cur != nil { + d, ok := parseVobSubTime(val) + if !ok { + return nil, fmt.Errorf("VobSub index, line %d: delay %q is not HH:MM:SS:mmm", n, val) + } + delayMs += d + continue + } + case "timestamp": + if cur == nil { + return nil, fmt.Errorf("VobSub index, line %d: a timestamp ahead of any \"id:\" line", n) + } + ts, rest, _ := strings.Cut(val, ",") + _, hex, _ := strings.Cut(rest, ":") + t, okT := parseVobSubTime(strings.TrimSpace(ts)) + pos, err := strconv.ParseInt(strings.TrimSpace(hex), 16, 64) + if !okT || err != nil || pos < 0 { + return nil, fmt.Errorf("VobSub index, line %d: %q is not \"timestamp: HH:MM:SS:mmm, filepos: hex\"", n, line) + } + cur.Entries = append(cur.Entries, VobSubEntry{TimeMs: t + delayMs + offsetMs, Pos: pos}) + continue + } + if cur == nil { + ix.Header = append(append(ix.Header, line...), '\n') + } + } + if err := sc.Err(); err != nil { + return nil, fmt.Errorf("VobSub index: %w", err) + } + if len(ix.Streams) == 0 { + return nil, fmt.Errorf("VobSub index: the file names no stream (no \"id:\" line): it is not a .idx") + } + return ix, nil +} + +// parseVobSubTime reads [-]HH:MM:SS:mmm as milliseconds. +func parseVobSubTime(s string) (int64, bool) { + neg := strings.HasPrefix(s, "-") + parts := strings.Split(strings.TrimPrefix(s, "-"), ":") + if len(parts) != 4 { + return 0, false + } + var ms int64 + for i, scale := range [4]int64{3600000, 60000, 1000, 1} { + v, err := strconv.ParseInt(strings.TrimSpace(parts[i]), 10, 32) + if err != nil || v < 0 { + return 0, false + } + ms += v * scale + } + if neg { + ms = -ms + } + return ms, true +} + +// ForEachUnit reads from the .sub every subpicture unit of one stream of the index, in the index's order, and +// calls fn with its time and its bytes: what VobSubDecoder.Decode takes as a block. An entry placed at or past the +// end of the .sub is passed over; a unit the .sub holds in part is an error. An error from fn stops the read and is +// returned as is. +func (ix *VobSubIndex) ForEachUnit(sub io.ReaderAt, stream int, fn func(timeMs int64, unit []byte) error) error { + if stream < 0 || stream >= len(ix.Streams) { + return fmt.Errorf("VobSub: stream %d of an index of %d", stream, len(ix.Streams)) + } + s := &ix.Streams[stream] + end := int64(-1) + for _, e := range s.Entries { + if e.Pos < end { // an index entry for a later packet of the unit before + continue + } + unit, next, err := readVobSubUnit(sub, e.Pos, byte(0x20+s.Index)) + if err == errVobSubPastEnd { + continue + } + if err != nil { + return fmt.Errorf("VobSub: the unit at %d ms (byte %d of the .sub): %w", e.TimeMs, e.Pos, err) + } + end = next + if err := fn(e.TimeMs, unit); err != nil { + return err + } + } + return nil +} + +// errVobSubPastEnd is an index entry placed at or past the end of the .sub, as some tools write a last one. +var errVobSubPastEnd = errors.New("the entry is past the end of the .sub") + +// readVobSubUnit gathers the unit that starts in the pack at pos from the packets of one substream, and returns it +// with the position after its last packet. +func readVobSubUnit(sub io.ReaderAt, pos int64, substream byte) ([]byte, int64, error) { + var unit []byte + want := -1 + var head [14]byte + for start := pos; pos-start < vobsubMaxUnitScan; { + if n, err := sub.ReadAt(head[:6], pos); err != nil { + if n == 0 && pos == start && errors.Is(err, io.EOF) { + return nil, 0, errVobSubPastEnd + } + if errors.Is(err, io.EOF) && want >= 0 { + return nil, 0, fmt.Errorf("the file ends %d bytes into a unit of %d", len(unit), want) + } + return nil, 0, fmt.Errorf("no packet at byte %d: %w", pos, err) + } + if head[0] != 0 || head[1] != 0 || head[2] != 1 { + return nil, 0, fmt.Errorf("byte %d does not start an MPEG packet", pos) + } + switch code := head[3]; { + case code == 0xba: // pack header: 14 bytes and the stuffing its last byte counts + if _, err := sub.ReadAt(head[:], pos); err != nil { + return nil, 0, fmt.Errorf("a pack header cut short at byte %d: %w", pos, err) + } + if head[4]>>6 != 1 { + return nil, 0, fmt.Errorf("the pack at byte %d is not an MPEG-2 program stream pack", pos) + } + pos += 14 + int64(head[13]&7) + case code == 0xb9: // program end + return nil, 0, fmt.Errorf("the stream ends %d bytes into a unit of %d", len(unit), want) + case code == 0xbd: // private stream 1: the subpictures + size := int(binary.BigEndian.Uint16(head[4:6])) + pkt := make([]byte, size) + if _, err := sub.ReadAt(pkt, pos+6); err != nil { + return nil, 0, fmt.Errorf("a packet of %d bytes cut short at byte %d: %w", size, pos, err) + } + pos += 6 + int64(size) + if size < 4 || 3+int(pkt[2]) >= size { + return nil, 0, fmt.Errorf("a packet of %d bytes holds no payload", size) + } + if pkt[3+int(pkt[2])] != substream { + continue // another language + } + unit = append(unit, pkt[4+int(pkt[2]):]...) + if want < 0 && len(unit) >= 2 { + want = int(binary.BigEndian.Uint16(unit)) + if want < 4 { + return nil, 0, fmt.Errorf("the unit declares %d bytes", want) + } + } + if want >= 0 && len(unit) >= want { + return unit[:want], pos, nil + } + default: // system header, padding, any other stream + pos += 6 + int64(binary.BigEndian.Uint16(head[4:6])) + } + } + return nil, 0, fmt.Errorf("the unit is not complete within %d bytes of the .sub", vobsubMaxUnitScan) +} From 4bafbaad612e86852934e19e48ffde2def1cfbba Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 22:28:21 +0100 Subject: [PATCH 05/15] docs(library): the .idx/.sub and .sup readers --- docs/library.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/library.md b/docs/library.md index d22c88e0..b34b0732 100644 --- a/docs/library.md +++ b/docs/library.md @@ -1961,6 +1961,38 @@ such planes, an epoch's regions hold at most 16 MiB; past a bound, as on any malformed block, `Decode` returns an error and the next block is decoded normally. +### Bitmap subtitles beside the video: .idx/.sub and .sup + +The same pictures also travel as files of their own: VobSub as a `.idx` and +a `.sub`, PGS as a `.sup`. Two readers turn them into what the decoders take, +one unit or display set at a time, so a whole file is never held. + +```go +ix, err := subtitle.ParseVobSubIndex(idxFile) // the .idx: header, languages, times +dec, err := subtitle.NewVobSubDecoder(ix.Header) +err = ix.ForEachUnit(subFile, 0, func(timeMs int64, unit []byte) error { + sets, err := dec.Decode(unit) // as for a Matroska block + return err +}) + +pgs := subtitle.NewPGSDecoder() +err = subtitle.ForEachSUPDisplaySet(supFile, func(timeMs int64, set []byte) error { + sets, err := pgs.Decode(set) + return err +}) +``` + +`VobSubIndex.Streams` lists the languages of the pair (`Language`, `Name`, +`Index`) and, for each, the time and the position of every subpicture, the +`delay:` and `time offset:` lines applied. `ForEachUnit` reads the `.sub` (an +MPEG-2 program stream, through an `io.ReaderAt`) and gathers each unit from +the packets of its language; an index entry that points into the unit before +it, or at the end of the `.sub`, is passed over, and a unit the `.sub` holds +only in part is an error. `ForEachSUPDisplaySet` gives each display set at the +presentation time of its composition segment; a file cut inside a segment gives +the sets ahead of it, then an error, and one that ends between two segments +gives its last set as it stands. + --- ## Editing MP4/MOV natively From 5010649b78421cb6ea737d09dd4cfb2c9abb5299 Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 22:28:23 +0100 Subject: [PATCH 06/15] docs(changelog): the .idx/.sub and .sup readers under Unreleased --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10166967..4a54d1d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ its series' file in [changelog/](changelog/) when a newer one ships. decoder's display sets (`subtitle.BitmapDisplaySet`, the same type): each picture in straight-alpha NRGBA with its position on the subtitle plane, an empty set where the screen clears. +- `subtitle.ParseVobSubIndex` with `VobSubIndex.ForEachUnit`, and + `subtitle.ForEachSUPDisplaySet`, read the bitmap subtitles that sit beside a + video: a VobSub `.idx`/`.sub` pair and a PGS `.sup`, one unit or display set + at a time, each with its time, in the form the decoders take. - `subtitle.PGSDisplaySet` gains `Delay` and `Duration`, which a VobSub unit's start and stop commands set; they stay zero for PGS and DVB. From 2ffd34ec0daa528e3f8a121db5fe0bcf5ea84313 Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 22:29:36 +0100 Subject: [PATCH 07/15] style(subtitle): tagged switches where the bitmap decoders compared one value --- mkv/subtitle/dvbsub.go | 13 ++++++++----- mkv/subtitle/vobsubfile.go | 8 ++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/mkv/subtitle/dvbsub.go b/mkv/subtitle/dvbsub.go index d358689a..5c5e5bc0 100644 --- a/mkv/subtitle/dvbsub.go +++ b/mkv/subtitle/dvbsub.go @@ -482,11 +482,13 @@ func (p *dvbPen) field(data []byte, x, y int) error { tableLen := 0 switch typ { case dvbData2Bit: - p.table = nil - if depth == 8 { + switch depth { + case 8: p.table = map2to8[:] - } else if depth == 4 { + case 4: p.table = map2to4[:] + default: + p.table = nil } data = data[p.string2(data):] case dvbData4Bit: @@ -667,9 +669,10 @@ func (d *DVBSubDecoder) compose() (BitmapDisplaySet, error) { clut = dvbDefaultCLUT } colours := clut.c256[:] - if r.depth == 4 { + switch r.depth { + case 4: colours = clut.c16[:] - } else if r.depth == 2 { + case 2: colours = clut.c4[:] } img := image.NewNRGBA(image.Rect(0, 0, r.w, r.h)) diff --git a/mkv/subtitle/vobsubfile.go b/mkv/subtitle/vobsubfile.go index 26583ea1..46fa4c1a 100644 --- a/mkv/subtitle/vobsubfile.go +++ b/mkv/subtitle/vobsubfile.go @@ -187,8 +187,8 @@ func readVobSubUnit(sub io.ReaderAt, pos int64, substream byte) ([]byte, int64, if head[0] != 0 || head[1] != 0 || head[2] != 1 { return nil, 0, fmt.Errorf("byte %d does not start an MPEG packet", pos) } - switch code := head[3]; { - case code == 0xba: // pack header: 14 bytes and the stuffing its last byte counts + switch head[3] { + case 0xba: // pack header: 14 bytes and the stuffing its last byte counts if _, err := sub.ReadAt(head[:], pos); err != nil { return nil, 0, fmt.Errorf("a pack header cut short at byte %d: %w", pos, err) } @@ -196,9 +196,9 @@ func readVobSubUnit(sub io.ReaderAt, pos int64, substream byte) ([]byte, int64, return nil, 0, fmt.Errorf("the pack at byte %d is not an MPEG-2 program stream pack", pos) } pos += 14 + int64(head[13]&7) - case code == 0xb9: // program end + case 0xb9: // program end return nil, 0, fmt.Errorf("the stream ends %d bytes into a unit of %d", len(unit), want) - case code == 0xbd: // private stream 1: the subpictures + case 0xbd: // private stream 1: the subpictures size := int(binary.BigEndian.Uint16(head[4:6])) pkt := make([]byte, size) if _, err := sub.ReadAt(pkt, pos+6); err != nil { From 414df0ca369f09193c074e7fa1636925b0e11430 Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 23:22:26 +0100 Subject: [PATCH 08/15] fix(subtitle): the DVB decoder reads a region once per display set, keeps the sets ahead of an error, passes over junk and gives the page's time-out --- mkv/subtitle/bitmap_samples_test.go | 15 ++-- mkv/subtitle/dvbsub.go | 133 +++++++++++++++++----------- mkv/subtitle/dvbsub_test.go | 123 +++++++++++++++++++++---- mkv/subtitle/parse_fuzz_test.go | 5 +- mkv/subtitle/pgs.go | 5 +- 5 files changed, 195 insertions(+), 86 deletions(-) diff --git a/mkv/subtitle/bitmap_samples_test.go b/mkv/subtitle/bitmap_samples_test.go index 244593ca..cb7ca6d2 100644 --- a/mkv/subtitle/bitmap_samples_test.go +++ b/mkv/subtitle/bitmap_samples_test.go @@ -11,6 +11,7 @@ import ( "io" "os" "testing" + "time" "github.com/gravity-zero/mkvgo/mkv" "github.com/gravity-zero/mkvgo/mkv/reader" @@ -145,10 +146,7 @@ func TestDVBSubDecoder_RealTrack(t *testing.T) { if track.Codec != "dvbsub" || len(blocks) != 46 { t.Fatalf("sample holds a %q track of %d blocks, want dvbsub and 46", track.Codec, len(blocks)) } - d, err := subtitle.NewDVBSubDecoder(track.CodecPrivate) - if err != nil { - t.Fatal(err) - } + d := subtitle.NewDVBSubDecoder(track.CodecPrivate) type shown struct { timeMs int64 objects []sampleCue @@ -160,8 +158,8 @@ func TestDVBSubDecoder_RealTrack(t *testing.T) { if err != nil { t.Fatalf("block %d at %d ms: %v", i, b.Timecode, err) } - if len(got) != 1 || got[0].ScreenW != 720 || got[0].ScreenH != 576 || got[0].Delay != 0 || got[0].Duration != 0 { - t.Fatalf("block %d: %d sets; want one, untimed, on 720x576", i, len(got)) + if len(got) != 1 || got[0].ScreenW != 720 || got[0].ScreenH != 576 || got[0].Delay != 0 || got[0].Duration != 0 || got[0].Timeout != 15*time.Second { + t.Fatalf("block %d: %d sets; want one on 720x576, with no time of its own but the page's 15 s time-out", i, len(got)) } s := shown{timeMs: b.Timecode} for _, o := range got[0].Objects { @@ -341,10 +339,7 @@ func BenchmarkDVBSubTrack(b *testing.B) { b.SetBytes(trackBytes(blocks)) b.ReportAllocs() for b.Loop() { - d, err := subtitle.NewDVBSubDecoder(track.CodecPrivate) - if err != nil { - b.Fatal(err) - } + d := subtitle.NewDVBSubDecoder(track.CodecPrivate) decodeTrack(b, blocks, d.Decode) } } diff --git a/mkv/subtitle/dvbsub.go b/mkv/subtitle/dvbsub.go index 5c5e5bc0..ded5eb69 100644 --- a/mkv/subtitle/dvbsub.go +++ b/mkv/subtitle/dvbsub.go @@ -15,6 +15,7 @@ import ( "encoding/binary" "fmt" "image" + "time" ) const dvbSync = 0x0f // the first byte of every segment @@ -131,33 +132,31 @@ type DVBSubDecoder struct { regions map[uint8]*dvbRegion cluts map[uint8]*dvbCLUT page []dvbPlacement - held int // what the epoch's regions hold (dvbMaxEpochBytes) - budget int // what the block being decoded may still fill and draw (dvbMaxBlockPixels) + timeout time.Duration // the page's time-out + held int // what the epoch's regions hold (dvbMaxEpochBytes) + budget int // what the block being decoded may still fill and draw (dvbMaxBlockPixels) } // NewDVBSubDecoder reads the composition and ancillary page IDs from the track's CodecPrivate, the segments of -// other pages being another service's; with no CodecPrivate every page is decoded. -func NewDVBSubDecoder(codecPrivate []byte) (*DVBSubDecoder, error) { - d := &DVBSubDecoder{} - switch { - case len(codecPrivate) == 0: - d.anyPage = true - case len(codecPrivate) >= 4: - d.pages = [2]uint16{binary.BigEndian.Uint16(codecPrivate), binary.BigEndian.Uint16(codecPrivate[2:])} - default: - return nil, fmt.Errorf("DVB subtitle: the track's CodecPrivate holds %d byte(s), the two page IDs take 4", len(codecPrivate)) +// other pages being another service's; with a CodecPrivate too short to hold them every page is decoded. +func NewDVBSubDecoder(codecPrivate []byte) *DVBSubDecoder { + if len(codecPrivate) < 4 { + return &DVBSubDecoder{anyPage: true} } - return d, nil + return &DVBSubDecoder{pages: [2]uint16{binary.BigEndian.Uint16(codecPrivate), binary.BigEndian.Uint16(codecPrivate[2:])}} } // Reset drops the epoch: call it when the read skips blocks, so a display set cannot draw on another part's regions. func (d *DVBSubDecoder) Reset() { - d.regions, d.cluts, d.page, d.held = nil, nil, nil, 0 + d.regions, d.cluts, d.page, d.held, d.timeout = nil, nil, nil, 0, 0 d.screenW, d.screenH, d.winX, d.winY = 0, 0, 0, 0 } // Decode decodes one Matroska block into the display sets it completes, almost always one: a set's objects are the -// regions on screen, each cut down to its visible pixels, and a set with none clears the screen. +// regions on screen, each cut down to its visible pixels, and a set with none clears the screen; its Timeout is the +// page's, the end of a set being the next one. Bytes that are no +// segment end the block. A segment that cannot be read is an error, returned with the sets completed ahead of it +// and the one being composed, which show the state the decoder is left in. // // A block of a track stored compressed (mkv.Track.Compression) is decoded first: mkv.Track.DecodePayload. func (d *DVBSubDecoder) Decode(block []byte) ([]BitmapDisplaySet, error) { @@ -165,26 +164,31 @@ func (d *DVBSubDecoder) Decode(block []byte) ([]BitmapDisplaySet, error) { d.budget = dvbMaxBlockPixels composed := false // a page composition is waiting for the end of its display set emit := func() error { - ds, err := d.compose() - out = append(out, ds) composed = false + ds, err := d.compose() + if err == nil { + out = append(out, ds) + } return err } + fail := func(err error) ([]BitmapDisplaySet, error) { + if composed { + _ = emit() + } + return out, err + } b := block if len(b) >= 2 && b[0] == 0x20 && b[1] == 0x00 { // the PES data field's own header, when a muxer kept it b = b[2:] } - for len(b) > 0 && b[0] != 0xff { - if b[0] != dvbSync { - return nil, fmt.Errorf("DVB subtitle: byte %#02x where a segment starts with %#02x", b[0], dvbSync) - } + for len(b) > 0 && b[0] == dvbSync { if len(b) < 6 { - return nil, fmt.Errorf("DVB subtitle: %d trailing byte(s) where a segment header needs 6", len(b)) + return fail(fmt.Errorf("DVB subtitle: %d trailing byte(s) where a segment header needs 6", len(b))) } typ, page, size := b[1], binary.BigEndian.Uint16(b[2:]), int(binary.BigEndian.Uint16(b[4:])) if size > len(b)-6 { - return nil, fmt.Errorf("DVB subtitle: a %#02x segment declares %d bytes, %d remain in the block", typ, size, len(b)-6) + return fail(fmt.Errorf("DVB subtitle: a %#02x segment declares %d bytes, %d remain in the block", typ, size, len(b)-6)) } p := b[6 : 6+size] b = b[6+size:] @@ -215,12 +219,12 @@ func (d *DVBSubDecoder) Decode(block []byte) ([]BitmapDisplaySet, error) { } } if err != nil { - return nil, err + return fail(err) } } if composed { if err := emit(); err != nil { - return nil, err + return out, err } } return out, nil @@ -259,7 +263,7 @@ func (d *DVBSubDecoder) parsePage(p []byte) error { if state := p[1] >> 2 & 3; state == 1 || state == 2 { d.regions, d.cluts, d.held = nil, nil, 0 } - d.page = d.page[:0] + d.page, d.timeout = d.page[:0], time.Duration(p[0])*time.Second for e := p[head:]; len(e) > 0; e = e[entry:] { d.page = append(d.page, dvbPlacement{region: e[0], x: int(binary.BigEndian.Uint16(e[2:])), y: int(binary.BigEndian.Uint16(e[4:]))}) } @@ -514,8 +518,8 @@ func (p *dvbPen) field(data []byte, x, y int) error { tableLen = 16 case dvbDataEndRow: p.x, p.y = x, p.y+2 - default: - return fmt.Errorf("a pixel-data block of type %#02x, which the format does not define", typ) + default: // a type the format does not define: its length is not known, the field ends here + return p.err } if tableLen == 0 { continue @@ -648,42 +652,63 @@ func (p *dvbPen) string8(data []byte) int { } // compose turns the page into a display set: each region on screen, read through its CLUT, where the page puts it. +// A region the page places several times is read once, its placements sharing the picture. func (d *DVBSubDecoder) compose() (BitmapDisplaySet, error) { - ds := BitmapDisplaySet{ScreenW: d.screenW, ScreenH: d.screenH} + ds := BitmapDisplaySet{ScreenW: d.screenW, ScreenH: d.screenH, Timeout: d.timeout} if ds.ScreenW == 0 { // no display definition: the format's standard-definition plane ds.ScreenW, ds.ScreenH = 720, 576 } + type picture struct { + img *image.NRGBA // nil when the region shows nothing + at image.Point + } + var seen map[uint8]picture for _, pl := range d.page { - r := d.regions[pl.region] - if r == nil { - if err := d.spend(1); err != nil { + pic, ok := seen[pl.region] + if !ok { + r := d.regions[pl.region] + if r == nil { + if err := d.spend(1); err != nil { + return ds, err + } + continue + } + if err := d.spend(r.w * r.h); err != nil { return ds, err } - continue - } - if err := d.spend(r.w * r.h); err != nil { - return ds, err - } - clut := d.cluts[r.clut] - if clut == nil { - clut = dvbDefaultCLUT - } - colours := clut.c256[:] - switch r.depth { - case 4: - colours = clut.c16[:] - case 2: - colours = clut.c4[:] - } - img := image.NewNRGBA(image.Rect(0, 0, r.w, r.h)) - for i, v := range r.pix { - if c := colours[int(v)&(len(colours)-1)]; c[3] != 0 { - copy(img.Pix[4*i:4*i+4], c[:]) + pic.img, pic.at = trimTransparent(d.render(r)) + if seen == nil { + seen = make(map[uint8]picture, len(d.page)) } + seen[pl.region] = pic + } else if err := d.spend(1); err != nil { + return ds, err } - if img, at := trimTransparent(img); img != nil { - ds.Objects = append(ds.Objects, BitmapObject{X: d.winX + pl.x + at.X, Y: d.winY + pl.y + at.Y, Image: img}) + if pic.img != nil { + ds.Objects = append(ds.Objects, BitmapObject{X: d.winX + pl.x + pic.at.X, Y: d.winY + pl.y + pic.at.Y, Image: pic.img}) } } return ds, nil } + +// render reads a region's pixels through its CLUT, or the default one when the epoch defined none of that ID. +func (d *DVBSubDecoder) render(r *dvbRegion) *image.NRGBA { + clut := d.cluts[r.clut] + if clut == nil { + clut = dvbDefaultCLUT + } + colours := clut.c256[:] + switch r.depth { + case 4: + colours = clut.c16[:] + case 2: + colours = clut.c4[:] + } + img := image.NewNRGBA(image.Rect(0, 0, r.w, r.h)) + for i, v := range r.pix { + if c := colours[int(v)&(len(colours)-1)]; c[3] != 0 { + copy(img.Pix[4*i:4*i+4], c[:]) + } + } + return img +} diff --git a/mkv/subtitle/dvbsub_test.go b/mkv/subtitle/dvbsub_test.go index 5658f384..724579ea 100644 --- a/mkv/subtitle/dvbsub_test.go +++ b/mkv/subtitle/dvbsub_test.go @@ -2,8 +2,10 @@ package subtitle import ( "bytes" + "runtime" "strings" "testing" + "time" ) // --- synthetic DVB builders: segments byte by byte, so the tests pin the wire format --- @@ -98,11 +100,7 @@ func dvbShow4x2() []byte { func newDVBSub(t *testing.T) *DVBSubDecoder { t.Helper() - d, err := NewDVBSubDecoder(dvbTestPrivate) - if err != nil { - t.Fatal(err) - } - return d + return NewDVBSubDecoder(dvbTestPrivate) } func decodeOneDVB(t *testing.T, d *DVBSubDecoder, block []byte) BitmapDisplaySet { @@ -256,21 +254,12 @@ func TestDVBSubDecoder_OtherPagesAreAnotherService(t *testing.T) { if got := nrgbaAt(t, ds.Objects[0].Image, 0, 0); got != [4]uint8{255, 255, 255, 255} { t.Errorf("pixel = %v, want the white of the ancillary page's CLUT", got) } - all, err := NewDVBSubDecoder(nil) - if err != nil { - t.Fatal(err) - } + all := NewDVBSubDecoder(nil) if sets, _ := all.Decode(concat(foreign, dvbSeg(dvbSegEnd, 0x0099, nil))); len(sets) != 1 { t.Errorf("without CodecPrivate a page gave %d sets, want 1", len(sets)) } } -func TestNewDVBSubDecoder_ShortCodecPrivate(t *testing.T) { - if _, err := NewDVBSubDecoder([]byte{0, 1, 0}); err == nil || !strings.Contains(err.Error(), "the two page IDs take 4") { - t.Errorf("err = %v, want a refusal naming the page IDs", err) - } -} - func TestDVBSubDecoder_DisplaySetBoundaries(t *testing.T) { show := dvbShow4x2() noEnd := show[:len(show)-len(dvbEDS())] @@ -383,7 +372,6 @@ func TestDVBSub_PixelDataRefusals(t *testing.T) { }{ "4-bit string in a 2-bit region": {2, []byte{dvbData4Bit, 0x10, 0x00}, "a 4-bit pixel string in a 2-bit region"}, "8-bit string in a 4-bit region": {4, []byte{dvbData8Bit, 0x10, 0x00, 0x00}, "an 8-bit pixel string in a 4-bit region"}, - "undefined block type": {4, []byte{0x33}, "type 0x33"}, "map table cut short": {8, []byte{dvbMap4To8, 1, 2, 3}, "a map table of 16 bytes, 3 remain"}, } { if _, err := dvbDraw(t, tc.depth, 4, false, 0, tc.data); err == nil || !strings.Contains(err.Error(), tc.want) { @@ -452,7 +440,6 @@ func TestDVBSubDecoder_Malformed(t *testing.T) { block []byte want string }{ - "not a segment": {[]byte{0x47, 0x10, 0, 1, 0, 0}, "where a segment starts"}, "short header": {[]byte{dvbSync, 0x10, 0}, "a segment header needs 6"}, "segment past the block": {[]byte{dvbSync, 0x10, 0, 1, 0, 9, 0}, "declares 9 bytes"}, "page cut short": {seg(dvbSegPage, 15), "page composition segment holds 1 bytes"}, @@ -540,3 +527,105 @@ func TestDVBSubObjectListedManyTimesBounded(t *testing.T) { t.Fatalf("err = %v, want the block's pixel bound", err) } } + +// A page may place one region many times: it is read through its CLUT once per display set, the placements sharing +// the picture. 32 placements of a 1024x1024 region each made a picture of 4 MiB. +func TestDVBSubRegionRenderedOncePerDisplaySet(t *testing.T) { + at := make([]dvbPlacement, 32) + for i := range at { + at[i] = dvbPlacement{region: 0, x: i, y: 2 * i} + } + block := concat(dvbPCS(2, at...), dvbRCS(0, true, 1024, 1024, 3, 0, 1), dvbEDS()) + var before, after runtime.MemStats + runtime.GC() + runtime.ReadMemStats(&before) + sets, err := newDVBSub(t).Decode(block) + runtime.ReadMemStats(&after) + if err != nil { + t.Fatal(err) + } + if len(sets) != 1 || len(sets[0].Objects) != 32 { + t.Fatalf("%d display sets, want one placing the region 32 times", len(sets)) + } + for i, o := range sets[0].Objects { + if o.X != i || o.Y != 2*i || o.Image != sets[0].Objects[0].Image { + t.Fatalf("placement %d at %d,%d with its own picture; want %d,%d sharing the first", i, o.X, o.Y, i, 2*i) + } + } + if alloc := after.TotalAlloc - before.TotalAlloc; alloc > 12<<20 { + t.Errorf("32 placements of one 1024x1024 region allocated %d MiB, want the region and one picture, 5 MiB", alloc>>20) + } +} + +// The budget counts a region once per display set too: 8 placements of a full-size region are one picture. +func TestDVBSubPlacementsOfOneRegionCostOnePicture(t *testing.T) { + at := make([]dvbPlacement, 8) + block := concat(dvbPCS(2, at...), dvbRCS(0, true, dvbMaxDim, dvbMaxDim, 3, 0, 1), dvbEDS()) + if _, err := newDVBSub(t).Decode(block); err != nil { + t.Fatalf("8 placements of one region: %v", err) + } +} + +func TestNewDVBSubDecoder_ShortCodecPrivateDecodesEveryPage(t *testing.T) { + for n := 1; n <= 3; n++ { + d := NewDVBSubDecoder(make([]byte, n)) + if sets, err := d.Decode(concat(dvbSeg(dvbSegPage, 0x0099, []byte{15, 2 << 2}), dvbSeg(dvbSegEnd, 0x0099, nil))); err != nil || len(sets) != 1 { + t.Errorf("%d byte(s): a page gave %d sets, err %v; want it decoded", n, len(sets), err) + } + } +} + +// Bytes that are no segment end the block: the display set composed ahead of them is given, without an error. +func TestDVBSubDecoder_JunkAfterTheSegments(t *testing.T) { + show := dvbShow4x2() + noEnd := show[:len(show)-len(dvbEDS())] + for name, block := range map[string][]byte{ + "after the end segment": concat(show, []byte{0x47, 0x1f, 0xff, 0x10}), + "in place of it": concat(noEnd, []byte{0x00, 0x00}), + } { + sets, err := newDVBSub(t).Decode(block) + if err != nil || len(sets) != 1 || len(sets[0].Objects) != 1 { + t.Errorf("%s: %d sets, err %v; want the display set", name, len(sets), err) + } + } +} + +// A pixel-data block of a type the format does not define ends its field: what was drawn ahead of it stays. +func TestDVBSubDecoder_UnknownPixelDataEndsTheField(t *testing.T) { + top := concat(dvbTop4x2, []byte{0x33, 0x01, 0x02}) + ds := decodeOneDVB(t, newDVBSub(t), concat(dvbPCS(2, dvbPlacement{}), dvbRCS(0, true, 4, 2, 2, 0, 0, dvbObjectRef{id: 7}), + dvbTestCLUT, dvbODS(7, false, top, dvbBottom4x2), dvbEDS())) + if len(ds.Objects) != 1 || ds.Objects[0].Image.Bounds().Dy() != 2 { + t.Fatalf("%d objects; want the picture, both lines drawn", len(ds.Objects)) + } +} + +// A block refused part-way gives back, with the error, the display sets it had completed and the one it was composing. +func TestDVBSubDecoder_ErrorKeepsTheSetsAheadOfIt(t *testing.T) { + bad := dvbSeg(dvbSegRegion, dvbTestPage, []byte{0, 0, 0, 4}) + d := newDVBSub(t) + sets, err := d.Decode(concat(dvbShow4x2(), dvbPCS(0, dvbPlacement{x: 100, y: 500}), bad, dvbEDS())) + if err == nil || !strings.Contains(err.Error(), "region composition segment needs") { + t.Fatalf("err = %v, want the region's", err) + } + if len(sets) != 2 || len(sets[0].Objects) != 1 || len(sets[1].Objects) != 1 { + t.Fatalf("%d sets with the error; want the completed one and the one being composed", len(sets)) + } + // The next block starts from the state the error left, which is the one the sets showed. + if ds := decodeOneDVB(t, d, concat(dvbPCS(0, dvbPlacement{x: 100, y: 500}), dvbEDS())); len(ds.Objects) != 1 { + t.Errorf("the block after the error shows %d objects, want the region still held", len(ds.Objects)) + } +} + +// The page's time-out is given as it is, a bound on how long the set stays without a successor, not its duration. +func TestDVBSubDecoder_Timeout(t *testing.T) { + d := newDVBSub(t) + ds := decodeOneDVB(t, d, dvbShow4x2()) + if ds.Timeout != 15*time.Second || ds.Duration != 0 || ds.Delay != 0 { + t.Errorf("timeout %v duration %v delay %v; want the page's 15 s and no duration", ds.Timeout, ds.Duration, ds.Delay) + } + short := dvbSeg(dvbSegPage, dvbTestPage, []byte{3, 0}) + if ds := decodeOneDVB(t, d, concat(short, dvbEDS())); ds.Timeout != 3*time.Second { + t.Errorf("timeout %v after a page of 3 s", ds.Timeout) + } +} diff --git a/mkv/subtitle/parse_fuzz_test.go b/mkv/subtitle/parse_fuzz_test.go index 1d087c9b..1cf6b5bf 100644 --- a/mkv/subtitle/parse_fuzz_test.go +++ b/mkv/subtitle/parse_fuzz_test.go @@ -102,10 +102,7 @@ func FuzzDVBSubDecode(f *testing.F) { if filter { private = dvbTestPrivate } - d, err := NewDVBSubDecoder(private) - if err != nil { - t.Fatal(err) - } + d := NewDVBSubDecoder(private) if cut > 0 && cut < len(data) { _, _ = d.Decode(data[:cut]) _, _ = d.Decode(data[cut:]) diff --git a/mkv/subtitle/pgs.go b/mkv/subtitle/pgs.go index e46b1dac..ba49ec8d 100644 --- a/mkv/subtitle/pgs.go +++ b/mkv/subtitle/pgs.go @@ -92,8 +92,11 @@ type PGSDisplaySet struct { ScreenW, ScreenH int // the subtitle plane the positions are expressed in Objects []PGSObject // Delay is how long after the block's time the set takes effect, and Duration how long its pictures then stay - // on screen; zero when the stream says neither (PGS and DVB never do, VobSub does). + // on screen: a VobSub unit's start and stop commands. Zero when the stream says neither, as PGS and DVB never do. Delay, Duration time.Duration + // Timeout is how long the set may stay on screen when nothing replaces or clears it: a DVB page's time-out, a + // bound of whole seconds, not a duration. Zero for PGS and VobSub. + Timeout time.Duration } // Clear reports whether this display set empties the screen rather than filling From fc67ed106ad886d6382527b1c83d84511eed015c Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 23:22:28 +0100 Subject: [PATCH 09/15] fix(subtitle): a whole VobSub unit never completes an incomplete one, a stop at the start shows nothing, Pending tells a unit waits for its rest --- mkv/subtitle/vobsub.go | 28 ++++++++++++++++++++---- mkv/subtitle/vobsub_test.go | 43 +++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 4 deletions(-) diff --git a/mkv/subtitle/vobsub.go b/mkv/subtitle/vobsub.go index 51bfde0d..f44b8b44 100644 --- a/mkv/subtitle/vobsub.go +++ b/mkv/subtitle/vobsub.go @@ -46,6 +46,10 @@ type VobSubDecoder struct { // Reset drops a unit left incomplete: call it when the read skips blocks, so the next one is not taken for its rest. func (d *VobSubDecoder) Reset() { d.pending = nil } +// Pending reports whether the last block started a unit that the next blocks complete: the time of the display set +// they will give is that block's. +func (d *VobSubDecoder) Pending() bool { return len(d.pending) > 0 } + // NewVobSubDecoder reads the plane size and the palette from the track's CodecPrivate. func NewVobSubDecoder(codecPrivate []byte) (*VobSubDecoder, error) { d := &VobSubDecoder{} @@ -104,14 +108,17 @@ type spuState struct { func (s *spuState) visible() bool { return s.alpha != [4]uint8{} } // Decode decodes one Matroska block, a whole subpicture unit: one display set holding its picture, cut down to its -// visible pixels, with the Delay before it shows and the Duration its stop command gives it, or an empty set for a -// unit that shows nothing. A unit spread over several blocks gives nothing until the block that completes it; its -// time is the first block's. +// visible pixels, with the Delay before it shows and the Duration its stop command gives it (zero when it has +// none), or an empty set for a unit that shows nothing. A unit spread over several blocks gives nothing until the +// block that completes it, and its time is the first block's: Pending says so after each block. A block that is a +// whole unit of its own never completes the one before, which is dropped. // // A block of a track stored compressed (mkv.Track.Compression) is decoded first: mkv.Track.DecodePayload. func (d *VobSubDecoder) Decode(block []byte) ([]BitmapDisplaySet, error) { if len(d.pending) > 0 { - block = append(d.pending, block...) + if !wholeSPU(block) { // a block that is a unit of its own does not complete the one before + block = append(d.pending, block...) + } d.pending = nil } if len(block) < 4 { @@ -140,6 +147,10 @@ func (d *VobSubDecoder) Decode(block []byte) ([]BitmapDisplaySet, error) { ds.Delay = spuDate(st.stopAt) return []BitmapDisplaySet{ds}, nil } + if st.stopped && st.stopAt == st.startAt { // shown and removed at once: nothing is seen + ds.Delay = spuDate(st.startAt) + return []BitmapDisplaySet{ds}, nil + } if !st.hasArea || !st.hasOffsets { return nil, fmt.Errorf("VobSub: the subpicture starts a display without naming its area and its data") } @@ -157,6 +168,15 @@ func (d *VobSubDecoder) Decode(block []byte) ([]BitmapDisplaySet, error) { return []BitmapDisplaySet{ds}, nil } +// wholeSPU reports a block that holds exactly the unit its header declares, control sequences inside it. +func wholeSPU(block []byte) bool { + if len(block) < 8 { + return false + } + size, ctrl := int(binary.BigEndian.Uint16(block[0:2])), int(binary.BigEndian.Uint16(block[2:4])) + return size == len(block) && ctrl >= 4 && ctrl+4 <= size +} + // spuDate converts a control sequence's date, in units of 1024 ticks of the 90 kHz clock. func spuDate(units int) time.Duration { return time.Duration(units) * 1024 * time.Second / 90000 diff --git a/mkv/subtitle/vobsub_test.go b/mkv/subtitle/vobsub_test.go index 108a3a8e..71ce67ed 100644 --- a/mkv/subtitle/vobsub_test.go +++ b/mkv/subtitle/vobsub_test.go @@ -290,3 +290,46 @@ func TestVobSubDecoder_UnitOverTwoBlocks(t *testing.T) { t.Fatalf("after Reset a whole unit gave %d sets, err %v; want its picture", len(sets), err) } } + +// A block that declares more than it holds is not completed by a block that is a whole unit of its own. +func TestVobSubDecoder_WholeUnitAfterAnIncompleteOne(t *testing.T) { + unit := vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)}, spuSeq{date: 300, cmds: []byte{spuStop}}) + damaged := append([]byte(nil), unit...) + damaged[0] = 0x40 // declares 16 KiB and more + d := newVobSub(t) + if sets, err := d.Decode(damaged); err != nil || len(sets) != 0 { + t.Fatalf("the damaged block gave %d sets, err %v; want nothing yet", len(sets), err) + } + for i := 0; i < 3; i++ { + sets, err := d.Decode(unit) + if err != nil || len(sets) != 1 || len(sets[0].Objects) != 1 { + t.Fatalf("whole unit %d after the damaged block: %d sets, err %v; want its picture", i, len(sets), err) + } + } + if d.Pending() { + t.Error("the damaged block's bytes are still held") + } +} + +// Pending tells a caller the block it just fed started a unit, whose time is that block's. +func TestVobSubDecoder_Pending(t *testing.T) { + unit := vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)}) + d := newVobSub(t) + if d.Pending() { + t.Fatal("a new decoder holds a unit") + } + if _, err := d.Decode(unit[:7]); err != nil || !d.Pending() { + t.Fatalf("after the first part: pending=%v, err %v", d.Pending(), err) + } + if sets, err := d.Decode(unit[7:]); err != nil || len(sets) != 1 || d.Pending() { + t.Fatalf("after the second part: %d sets, pending=%v, err %v", len(sets), d.Pending(), err) + } +} + +// A stop at the date of the start shows nothing: an empty set, not a picture without an end. +func TestVobSubDecoder_StopAtTheStartShowsNothing(t *testing.T) { + ds := decodeOneVobSub(t, vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{date: 20, cmds: append(spuShow4x2(spuStart), spuStop)})) + if !ds.Clear() || ds.Delay != 20*1024*time.Second/90000 || ds.Duration != 0 { + t.Errorf("clear=%v delay=%v duration=%v; want an empty set at the unit's date", ds.Clear(), ds.Delay, ds.Duration) + } +} From 78c4f456c5abfdaa7f14388842a23f0b75f5e1ce Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 23:22:30 +0100 Subject: [PATCH 10/15] fix(subtitle): the .sub reader takes the last bytes a ReaderAt returns along with io.EOF --- mkv/subtitle/sidecar_test.go | 27 +++++++++++++++++++++++++++ mkv/subtitle/vobsubfile.go | 15 ++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/mkv/subtitle/sidecar_test.go b/mkv/subtitle/sidecar_test.go index 244fddc2..b4821b5a 100644 --- a/mkv/subtitle/sidecar_test.go +++ b/mkv/subtitle/sidecar_test.go @@ -257,3 +257,30 @@ func TestForEachSUPDisplaySet_Bounded(t *testing.T) { t.Errorf("err = %v, want the display set bound", err) } } + +// eofReaderAt returns io.EOF together with the last bytes of the file, as io.ReaderAt allows. + +// eofReaderAt returns io.EOF together with the last bytes of the file, as io.ReaderAt allows. +type eofReaderAt struct{ data []byte } + +func (r eofReaderAt) ReadAt(p []byte, off int64) (int, error) { + if off >= int64(len(r.data)) { + return 0, io.EOF + } + n := copy(p, r.data[off:]) + if off+int64(n) == int64(len(r.data)) { + return n, io.EOF + } + return n, nil +} + +func TestVobSubIndex_ForEachUnit_ReaderAtEOFWithTheLastBytes(t *testing.T) { + unit := vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)}) + sub := subPack(0x20, true, unit) + ix := &VobSubIndex{Streams: []VobSubStream{{Entries: []VobSubEntry{{1000, 0}}}}} + var got []byte + err := ix.ForEachUnit(eofReaderAt{sub}, 0, func(_ int64, u []byte) error { got = u; return nil }) + if err != nil || !bytes.Equal(got, unit) { + t.Errorf("err %v, %d bytes; want the unit that ends the file", err, len(got)) + } +} diff --git a/mkv/subtitle/vobsubfile.go b/mkv/subtitle/vobsubfile.go index 46fa4c1a..f3702f44 100644 --- a/mkv/subtitle/vobsubfile.go +++ b/mkv/subtitle/vobsubfile.go @@ -175,7 +175,7 @@ func readVobSubUnit(sub io.ReaderAt, pos int64, substream byte) ([]byte, int64, want := -1 var head [14]byte for start := pos; pos-start < vobsubMaxUnitScan; { - if n, err := sub.ReadAt(head[:6], pos); err != nil { + if n, err := readFullAt(sub, head[:6], pos); err != nil { if n == 0 && pos == start && errors.Is(err, io.EOF) { return nil, 0, errVobSubPastEnd } @@ -189,7 +189,7 @@ func readVobSubUnit(sub io.ReaderAt, pos int64, substream byte) ([]byte, int64, } switch head[3] { case 0xba: // pack header: 14 bytes and the stuffing its last byte counts - if _, err := sub.ReadAt(head[:], pos); err != nil { + if _, err := readFullAt(sub, head[:], pos); err != nil { return nil, 0, fmt.Errorf("a pack header cut short at byte %d: %w", pos, err) } if head[4]>>6 != 1 { @@ -201,7 +201,7 @@ func readVobSubUnit(sub io.ReaderAt, pos int64, substream byte) ([]byte, int64, case 0xbd: // private stream 1: the subpictures size := int(binary.BigEndian.Uint16(head[4:6])) pkt := make([]byte, size) - if _, err := sub.ReadAt(pkt, pos+6); err != nil { + if _, err := readFullAt(sub, pkt, pos+6); err != nil { return nil, 0, fmt.Errorf("a packet of %d bytes cut short at byte %d: %w", size, pos, err) } pos += 6 + int64(size) @@ -227,3 +227,12 @@ func readVobSubUnit(sub io.ReaderAt, pos int64, substream byte) ([]byte, int64, } return nil, 0, fmt.Errorf("the unit is not complete within %d bytes of the .sub", vobsubMaxUnitScan) } + +// readFullAt is ReadAt without the io.EOF a reader may return along with the last bytes of its file. +func readFullAt(r io.ReaderAt, p []byte, off int64) (int, error) { + n, err := r.ReadAt(p, off) + if n == len(p) { + return n, nil + } + return n, err +} From 6e5fee65fc78c9dd3484035e52c6c4320085ac56 Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 23:22:32 +0100 Subject: [PATCH 11/15] docs(library): the time of a VobSub unit over several blocks, the DVB time-out and what each decoder tolerates --- docs/library.md | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/docs/library.md b/docs/library.md index b34b0732..c0b9810d 100644 --- a/docs/library.md +++ b/docs/library.md @@ -1921,12 +1921,16 @@ in straight-alpha `*image.NRGBA`, each with its position on the subtitle plane (`ScreenW`/`ScreenH`), and a set with no object where the screen clears. ```go -dec, err := subtitle.NewVobSubDecoder(track.CodecPrivate) // or NewDVBSubDecoder +dec, err := subtitle.NewVobSubDecoder(track.CodecPrivate) // or dec := subtitle.NewDVBSubDecoder(track.CodecPrivate) +var unitTime int64 for each block of the track { + if !dec.Pending() { // VobSub: a unit over several blocks keeps the time of its first + unitTime = block.Timecode + } data, err := track.DecodePayload(block.Data) // a track stored compressed sets, err := dec.Decode(data) for _, ds := range sets { - start := blockTime + ds.Delay + start := unitTime + ds.Delay.Milliseconds() // ds.Objects: X, Y, Forced, Image; none = the screen clears at start } } @@ -1941,16 +1945,23 @@ What differs from PGS: until its stop command, zero when the unit has none (the block's duration or the next block then ends it). `Forced` is the unit's forced-display command. A unit a muxer spread over several blocks comes out with the block that - completes it; its time is the first block's. Colour and contrast changes + completes it, and its time is the first block's: `Pending` reports, after + each block, that a unit is waiting for its rest. A block that is a whole + unit of its own never completes the one before, which is dropped. A stop at + the date of the start gives an empty set. Colour and contrast changes within a picture (command `0x07`) are not applied. - **DVB** keeps regions, their pixels and the colour tables between blocks: a display set sends only what changed, until a page composition declares a mode change or an acquisition point. A set's objects are the regions on - screen, one picture each. The CodecPrivate names the service's composition - and ancillary pages, the segments of other pages being ignored; without one - every page is decoded. 2, 4 and 8-bit pixels, map tables, the default colour - tables and the display definition (plane size, window) are read; character - objects are not drawn. `Forced`, `Delay` and `Duration` are never set. + screen, one picture each; a region the page places several times is read + once, its placements sharing the picture. The CodecPrivate names the + service's composition and ancillary pages, the segments of other pages being + ignored; with one too short to name them every page is decoded. 2, 4 and + 8-bit pixels, map tables, the default colour tables and the display + definition (plane size, window) are read; character objects are not drawn. + `Forced`, `Delay` and `Duration` are never set: a set ends where the next + one begins. `Timeout` is the page's time-out, whole seconds after which a + set nothing replaced leaves the screen: a bound, not a duration. - Both cut each picture down to its visible pixels, `X`, `Y` moving with the cut, and leave a picture with no visible pixel out of its set: a region that was only erased reads as a clear. @@ -1959,7 +1970,10 @@ Both bound what a block can cost, as the PGS decoder does: a picture or a region is at most 4096 pixels a side, a DVB block fills and draws at most four such planes, an epoch's regions hold at most 16 MiB; past a bound, as on any malformed block, `Decode` returns an error and the next block is decoded -normally. +normally. A DVB block refused part-way returns, with the error, the sets it +completed ahead of it and the one it was composing; bytes that are no segment, +or a pixel-data block of an undefined type, end what they are in without an +error. ### Bitmap subtitles beside the video: .idx/.sub and .sup From c566d15aa2acc51426f43ad60d71dc1dfab59b4c Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Mon, 16 Nov 2026 23:22:34 +0100 Subject: [PATCH 12/15] docs(changelog): PGSDisplaySet.Timeout under Unreleased --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a54d1d5..9a169124 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,8 @@ its series' file in [changelog/](changelog/) when a newer one ships. video: a VobSub `.idx`/`.sub` pair and a PGS `.sup`, one unit or display set at a time, each with its time, in the form the decoders take. - `subtitle.PGSDisplaySet` gains `Delay` and `Duration`, which a VobSub unit's - start and stop commands set; they stay zero for PGS and DVB. + start and stop commands set, and `Timeout`, a DVB page's time-out; each is + zero where the codec has no such thing. ## [0.66.2] - 2026-11-10 From f2f376e61e9044e081ac2e1bcab5bb52cbfae409 Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Tue, 17 Nov 2026 08:11:27 +0100 Subject: [PATCH 13/15] fix(subtitle): VobSubDecoder.Continues tells ahead of Decode whether a block starts a unit, where Pending dated a unit that dropped the one before by the dropped block --- mkv/subtitle/bitmap_samples_test.go | 9 ++++-- mkv/subtitle/vobsub.go | 20 +++++++------- mkv/subtitle/vobsub_test.go | 43 +++++++++++++++++++++-------- 3 files changed, 49 insertions(+), 23 deletions(-) diff --git a/mkv/subtitle/bitmap_samples_test.go b/mkv/subtitle/bitmap_samples_test.go index cb7ca6d2..2be54758 100644 --- a/mkv/subtitle/bitmap_samples_test.go +++ b/mkv/subtitle/bitmap_samples_test.go @@ -106,7 +106,11 @@ func TestVobSubDecoder_RealTrack(t *testing.T) { } var cues []sampleCue var first subtitle.BitmapDisplaySet + var unitTime int64 for i, b := range blocks { + if !d.Continues(b.Data) { + unitTime = b.Timecode + } sets, err := d.Decode(b.Data) if err != nil { t.Fatalf("block %d at %d ms: %v", i, b.Timecode, err) @@ -119,7 +123,7 @@ func TestVobSubDecoder_RealTrack(t *testing.T) { first = ds } o := ds.Objects[0] - cues = append(cues, sampleCue{b.Timecode, ds.Duration.Milliseconds(), o.X, o.Y, o.Image.Bounds().Dx(), o.Image.Bounds().Dy()}) + cues = append(cues, sampleCue{unitTime, ds.Duration.Milliseconds(), o.X, o.Y, o.Image.Bounds().Dx(), o.Image.Bounds().Dy()}) } } // Three of the 46 blocks hold the first part of a unit the muxer cut in two. @@ -129,7 +133,8 @@ func TestVobSubDecoder_RealTrack(t *testing.T) { for i, want := range map[int]sampleCue{ 0: {132499, 4960, 259, 379, 200, 24}, 1: {147355, 4733, 259, 76, 203, 63}, - 4: {185919, 2696, 234, 340, 250, 63}, // a unit over two blocks + 4: {185919, 2696, 234, 340, 250, 63}, // a unit over two blocks of one time + 27: {302018, 1524, 236, 379, 247, 30}, // a unit over two blocks, the second at 302035 ms 42: {359834, 1262, 232, 379, 254, 24}, } { if cues[i] != want { diff --git a/mkv/subtitle/vobsub.go b/mkv/subtitle/vobsub.go index f44b8b44..1c1dcce0 100644 --- a/mkv/subtitle/vobsub.go +++ b/mkv/subtitle/vobsub.go @@ -46,9 +46,11 @@ type VobSubDecoder struct { // Reset drops a unit left incomplete: call it when the read skips blocks, so the next one is not taken for its rest. func (d *VobSubDecoder) Reset() { d.pending = nil } -// Pending reports whether the last block started a unit that the next blocks complete: the time of the display set -// they will give is that block's. -func (d *VobSubDecoder) Pending() bool { return len(d.pending) > 0 } +// Continues reports whether Decode will take block as the rest of the unit the blocks before it started, rather +// than as the start of a unit: a caller asks it ahead of each Decode, a unit's time being that of its first block. +func (d *VobSubDecoder) Continues(block []byte) bool { + return len(d.pending) > 0 && !wholeSPU(block) +} // NewVobSubDecoder reads the plane size and the palette from the track's CodecPrivate. func NewVobSubDecoder(codecPrivate []byte) (*VobSubDecoder, error) { @@ -110,17 +112,15 @@ func (s *spuState) visible() bool { return s.alpha != [4]uint8{} } // Decode decodes one Matroska block, a whole subpicture unit: one display set holding its picture, cut down to its // visible pixels, with the Delay before it shows and the Duration its stop command gives it (zero when it has // none), or an empty set for a unit that shows nothing. A unit spread over several blocks gives nothing until the -// block that completes it, and its time is the first block's: Pending says so after each block. A block that is a -// whole unit of its own never completes the one before, which is dropped. +// block that completes it, and its time is the first block's: Continues tells, ahead of Decode, whether a block +// starts a unit. A block that is a whole unit of its own never completes the one before, which is dropped. // // A block of a track stored compressed (mkv.Track.Compression) is decoded first: mkv.Track.DecodePayload. func (d *VobSubDecoder) Decode(block []byte) ([]BitmapDisplaySet, error) { - if len(d.pending) > 0 { - if !wholeSPU(block) { // a block that is a unit of its own does not complete the one before - block = append(d.pending, block...) - } - d.pending = nil + if d.Continues(block) { + block = append(d.pending, block...) } + d.pending = nil // a block that is a unit of its own does not complete the one before, which is dropped if len(block) < 4 { return nil, fmt.Errorf("VobSub: a subpicture needs 4 bytes of header, the block holds %d", len(block)) } diff --git a/mkv/subtitle/vobsub_test.go b/mkv/subtitle/vobsub_test.go index 71ce67ed..d2a210fe 100644 --- a/mkv/subtitle/vobsub_test.go +++ b/mkv/subtitle/vobsub_test.go @@ -306,23 +306,44 @@ func TestVobSubDecoder_WholeUnitAfterAnIncompleteOne(t *testing.T) { t.Fatalf("whole unit %d after the damaged block: %d sets, err %v; want its picture", i, len(sets), err) } } - if d.Pending() { + if d.Continues(unit[7:]) { t.Error("the damaged block's bytes are still held") } } -// Pending tells a caller the block it just fed started a unit, whose time is that block's. -func TestVobSubDecoder_Pending(t *testing.T) { +// A unit takes the time of the block that starts it: the first of the blocks it is spread over, and the block +// itself when it drops an incomplete unit ahead of it. +func TestVobSubDecoder_ContinuesDatesTheUnit(t *testing.T) { unit := vobsubSPU(spuTop4x2, spuBottom4x2, spuSeq{cmds: spuShow4x2(spuStart)}) + damaged := append([]byte(nil), unit...) + damaged[0] = 0x40 // declares 16 KiB and more d := newVobSub(t) - if d.Pending() { - t.Fatal("a new decoder holds a unit") - } - if _, err := d.Decode(unit[:7]); err != nil || !d.Pending() { - t.Fatalf("after the first part: pending=%v, err %v", d.Pending(), err) - } - if sets, err := d.Decode(unit[7:]); err != nil || len(sets) != 1 || d.Pending() { - t.Fatalf("after the second part: %d sets, pending=%v, err %v", len(sets), d.Pending(), err) + if d.Continues(unit) || d.Continues(unit[:7]) { + t.Fatal("a new decoder takes a block as the rest of a unit") + } + var unitTime int64 + for i, b := range []struct { + timeMs int64 + data []byte + sets int + wantTime int64 + }{ + {1000, damaged, 0, 0}, + {132499, unit, 1, 132499}, // a whole unit: the damaged one is dropped, and its time with it + {200000, unit[:7], 0, 0}, + {200017, unit[7:], 1, 200000}, // the rest of a unit: the time of its first block + {300000, unit, 1, 300000}, + } { + if !d.Continues(b.data) { + unitTime = b.timeMs + } + sets, err := d.Decode(b.data) + if err != nil || len(sets) != b.sets { + t.Fatalf("block %d at %d ms: %d sets, err %v; want %d", i, b.timeMs, len(sets), err, b.sets) + } + if len(sets) == 1 && unitTime != b.wantTime { + t.Errorf("block %d: its unit is dated %d ms, want %d", i, unitTime, b.wantTime) + } } } From da9023091d726045bde718e1a465a6f8a00605e0 Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Tue, 17 Nov 2026 08:11:29 +0100 Subject: [PATCH 14/15] docs(subtitle): a DVB region placed several times shares its image, and the library example reads each decoder with its own calls --- docs/library.md | 24 ++++++++++++++++++------ mkv/subtitle/dvbsub.go | 3 ++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/docs/library.md b/docs/library.md index c0b9810d..5050fb1e 100644 --- a/docs/library.md +++ b/docs/library.md @@ -1921,19 +1921,30 @@ in straight-alpha `*image.NRGBA`, each with its position on the subtitle plane (`ScreenW`/`ScreenH`), and a set with no object where the screen clears. ```go -dec, err := subtitle.NewVobSubDecoder(track.CodecPrivate) // or dec := subtitle.NewDVBSubDecoder(track.CodecPrivate) +// VobSub: a unit is one block, or several when a muxer cut it; it is dated by the block that starts it. +dec, err := subtitle.NewVobSubDecoder(track.CodecPrivate) var unitTime int64 for each block of the track { - if !dec.Pending() { // VobSub: a unit over several blocks keeps the time of its first + data, err := track.DecodePayload(block.Data) // a track stored compressed + if !dec.Continues(data) { unitTime = block.Timecode } - data, err := track.DecodePayload(block.Data) // a track stored compressed sets, err := dec.Decode(data) for _, ds := range sets { start := unitTime + ds.Delay.Milliseconds() // ds.Objects: X, Y, Forced, Image; none = the screen clears at start } } + +// DVB: a block is a display set, shown at the block's time. +dvb := subtitle.NewDVBSubDecoder(track.CodecPrivate) +for each block of the track { + data, err := track.DecodePayload(block.Data) + sets, err := dvb.Decode(data) + for _, ds := range sets { + // ds.Objects at block.Timecode; none = the screen clears + } +} ``` What differs from PGS: @@ -1945,9 +1956,10 @@ What differs from PGS: until its stop command, zero when the unit has none (the block's duration or the next block then ends it). `Forced` is the unit's forced-display command. A unit a muxer spread over several blocks comes out with the block that - completes it, and its time is the first block's: `Pending` reports, after - each block, that a unit is waiting for its rest. A block that is a whole - unit of its own never completes the one before, which is dropped. A stop at + completes it, and its time is the first block's: `Continues`, asked ahead + of each `Decode`, tells whether the block is the rest of a unit or starts + one. A block that is a whole unit of its own never completes the one before, + which is dropped, and so starts one. A stop at the date of the start gives an empty set. Colour and contrast changes within a picture (command `0x07`) are not applied. - **DVB** keeps regions, their pixels and the colour tables between blocks: a diff --git a/mkv/subtitle/dvbsub.go b/mkv/subtitle/dvbsub.go index ded5eb69..1755e220 100644 --- a/mkv/subtitle/dvbsub.go +++ b/mkv/subtitle/dvbsub.go @@ -154,7 +154,8 @@ func (d *DVBSubDecoder) Reset() { // Decode decodes one Matroska block into the display sets it completes, almost always one: a set's objects are the // regions on screen, each cut down to its visible pixels, and a set with none clears the screen; its Timeout is the -// page's, the end of a set being the next one. Bytes that are no +// page's, the end of a set being the next one. The images are freshly allocated and owned by the caller; a region +// a page places more than once shares one image between its placements. Bytes that are no // segment end the block. A segment that cannot be read is an error, returned with the sets completed ahead of it // and the one being composed, which show the state the decoder is left in. // From 873f8c05e7065cfea919899354d420e716bb53fa Mon Sep 17 00:00:00 2001 From: gravity-zero Date: Tue, 17 Nov 2026 08:36:53 +0100 Subject: [PATCH 15/15] docs(changelog): 0.67.0 dated 2026-11-17, 0.66.2 archived in changelog/0.60-0.69.md --- CHANGELOG.md | 35 ++--------------------------------- changelog/0.60-0.69.md | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a169124..82dffe5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ its series' file in [changelog/](changelog/) when a newer one ships. ## [Unreleased] +## [0.67.0] - 2026-11-17 + ### Added - `subtitle.VobSubDecoder` and `subtitle.DVBSubDecoder` decode the bitmap @@ -24,36 +26,3 @@ its series' file in [changelog/](changelog/) when a newer one ships. - `subtitle.PGSDisplaySet` gains `Delay` and `Duration`, which a VobSub unit's start and stop commands set, and `Timeout`, a DVB page's time-out; each is zero where the codec has no such thing. - -## [0.66.2] - 2026-11-10 - -### Security - -- `serve`, `PlanHLS`: a Matroska whose Segment declares more bytes than the - file holds (a forged size, a file cut short) no longer has a subtitle - request ask the kernel to read ahead over the declared size, one call per - chunk, with the rendition locked meanwhile (since 0.66.0). -- `edit-inplace`: a Tags, Chapters or Attachments element after the clusters - that declares more bytes than the file holds is voided up to the end of the - file; the edit wrote its declared size, from one allocation of that size. -- `demux`: an empty ALAC packet is refused by name (`--raw` keeps the stored - payloads); a few bytes of laced empty packets held 2 KiB of packet table - each (since 0.66.0). - -### Fixed - -- `edit-inplace`: a second edit of a file whose Info or Tracks an earlier - edit had moved to the end of the Segment replaces them. It appended a - second copy behind the first, which a full read kept returning: the edit - reported success and was not seen (since 0.66.0). A file edited twice by - 0.66.0 or 0.66.1 is repaired by `mkvgo edit` (full rewrite). -- `to-hls`, `serve` and the other HLS commands: an encrypted text subtitle - track is refused by name, or dropped with its reason under - `--skip-unsupported`, as `to-mp4` does; since 0.66.0 it was listed as a - WebVTT rendition built from its undecrypted bytes. -- `serve` on a remote source with a subtitle index: the scan asks for each - block it reads again, not for the whole minute of media ahead in one request - (since 0.66.0). -- Every command names `--strict`, `--skip-unsupported`, `--synthesize-index` - and `--no-iframes` in its refusals; all but `demux`, `to-mp4`, `from-mp4` - and `to-hls` printed the library's `Options` field names. diff --git a/changelog/0.60-0.69.md b/changelog/0.60-0.69.md index 72a32c26..be5a53ea 100644 --- a/changelog/0.60-0.69.md +++ b/changelog/0.60-0.69.md @@ -2,6 +2,39 @@ Archived entries of mkvgo 0.60.x to 0.69.x, as they were published; a version moves here once a newer one ships. The current versions are in [CHANGELOG.md](../CHANGELOG.md). +## [0.66.2] - 2026-11-10 + +### Security + +- `serve`, `PlanHLS`: a Matroska whose Segment declares more bytes than the + file holds (a forged size, a file cut short) no longer has a subtitle + request ask the kernel to read ahead over the declared size, one call per + chunk, with the rendition locked meanwhile (since 0.66.0). +- `edit-inplace`: a Tags, Chapters or Attachments element after the clusters + that declares more bytes than the file holds is voided up to the end of the + file; the edit wrote its declared size, from one allocation of that size. +- `demux`: an empty ALAC packet is refused by name (`--raw` keeps the stored + payloads); a few bytes of laced empty packets held 2 KiB of packet table + each (since 0.66.0). + +### Fixed + +- `edit-inplace`: a second edit of a file whose Info or Tracks an earlier + edit had moved to the end of the Segment replaces them. It appended a + second copy behind the first, which a full read kept returning: the edit + reported success and was not seen (since 0.66.0). A file edited twice by + 0.66.0 or 0.66.1 is repaired by `mkvgo edit` (full rewrite). +- `to-hls`, `serve` and the other HLS commands: an encrypted text subtitle + track is refused by name, or dropped with its reason under + `--skip-unsupported`, as `to-mp4` does; since 0.66.0 it was listed as a + WebVTT rendition built from its undecrypted bytes. +- `serve` on a remote source with a subtitle index: the scan asks for each + block it reads again, not for the whole minute of media ahead in one request + (since 0.66.0). +- Every command names `--strict`, `--skip-unsupported`, `--synthesize-index` + and `--no-iframes` in its refusals; all but `demux`, `to-mp4`, `from-mp4` + and `to-hls` printed the library's `Options` field names. + ## [0.66.1] - 2026-11-08 ### Fixed