This file is raw output from pdftotext and may not be ideal for distribution. If you are a maintainer for Hackipedia, please sit down when you have time and clean this text version up. Source PDF: /mnt/main/jmc-storage/docs/SCTE/ANSI SCTE 027 Subtitling Methods for Broadcast Cable (2011).pdf Like all conversions the text below should be fully readable as UTF-8 unicode text. --------------------------------------------------------------- ENGINEERING COMMITTEE Digital Video Subcommittee AMERICAN NATIONAL STANDARD ANSI/SCTE 27 2011 SUBTITLING METHODS FOR BROADCAST CABLE NOTICE The Society of Cable Telecommunications Engineers (SCTE) Standards are intended to serve the public interest by providing specifications, test methods and procedures that promote uniformity of product, interchangeability and ultimately the long term reliability of broadband communications facilities. These documents shall not in any way preclude any member or nonmember of SCTE from manufacturing or selling products not conforming to such documents, nor shall the existence of such standards preclude their voluntary use by those other than SCTE members, whether used domestically or internationally. SCTE assumes no obligations or liability whatsoever to any party who may adopt the Standards. Such adopting party assumes all risks associated with adoption of these Standards or Recommended Practices, and accepts full responsibility for any damage and/or claims arising from the adoption of such Standards or Recommended Practices. Attention is called to the possibility that implementation of this standard may require use of subject matter covered by patent rights. By publication of this standard, no position is taken with respect to the existence or validity of any patent rights in connection therewith. SCTE shall not be responsible for identifying patents for which a license may be required or for conducting inquires into the legal validity or scope of those patents that are brought to its attention. Patent holders who believe that they hold patents which are essential to the implementation of this standard have been requested to provide information about those patents and any related licensing terms and conditions. Any such declarations made before or after publication of this document are available on the SCTE web site at http://www.scte.org. All Rights Reserved © Society of Cable Telecommunications Engineers, Inc. 2011 140 Philips Road Exton, PA 19341 TABLE OF CONTENTS i 1  Scope ....................................................................................................................................... 1  1.1  Purpose ............................................................................................................................. 1  1.2  Organization ...................................................................................................................... 1  2  Compliance notation................................................................................................................. 1  2.1  Terms, Acronyms and Abbreviations ................................................................................ 2  2.1.1  Terms ......................................................................................................................... 2  2.1.2  Acronyms and Abbreviations ..................................................................................... 2  2.2  Stream Type for Subtitling Messages ............................................................................... 3  2.3  Section and Data Structure Syntax Notation .................................................................... 3  3  References ............................................................................................................................... 3  3.1  Normative References ...................................................................................................... 3  3.2 Informative References ....................................................................................................... 4  4  Overview of Subtitle System Design ........................................................................................ 4  4.1  Bitmapped Subtitles .......................................................................................................... 4  4.2  Coordinate System............................................................................................................ 4  4.3  Bitmaps and Frames ......................................................................................................... 4  4.4  Outlines and Drop Shadows ............................................................................................. 5  4.5  Display Standards ............................................................................................................. 6  4.6  Decoder Processing Model ............................................................................................... 6  5  Subtitle Message Format ......................................................................................................... 7  5.1  Reserved Fields ................................................................................................................ 7  5.2  Protocol Extensibility ......................................................................................................... 7  5.3  Subtitle Transmission Format ........................................................................................... 8  5.4  Table ID Assignment ......................................................................................................... 9  5.5  Message Length.............................................................................................................. 10  5.6  Segmentation Option ...................................................................................................... 10  5.6.1  Overview .................................................................................................................. 10  5.6.2  Stuffing Descriptor ................................................................................................... 11  5.6.3  Segmentation Overlay ............................................................................................. 11  5.6.4  Example ................................................................................................................... 12  5.7  Protocol Version Field ..................................................................................................... 13  5.8  ISO 639 Languages ........................................................................................................ 13  5.9  Display Modes................................................................................................................. 14  5.10  Display Standards ....................................................................................................... 14  5.11  In-Cue Time ................................................................................................................. 14  5.12  Out-Cue Time .............................................................................................................. 15  5.13  Subtitle Format ............................................................................................................ 15  5.14  Subtitle Color ............................................................................................................... 16  5.15  Display Duration .......................................................................................................... 16  5.16  Block Length ................................................................................................................ 17  5.17  Bitmapped Subtitle ...................................................................................................... 17  5.17.1  Bitmap Colors .......................................................................................................... 18  5.17.2  Bitmap Position ........................................................................................................ 18  5.17.3  Frame Position ......................................................................................................... 19  5.17.4  Outline Thickness .................................................................................................... 19  5.17.5  Drop Shadow Definition ........................................................................................... 19  5.17.6  Compressed Bitmap ................................................................................................ 19  5.18  Error Protection and Detection .................................................................................... 22  ii LIST OF FIGURES Figure 4.1. Placement of Bitmaps and Frames ..................................................................................... 5  Figure 4.2. Example Drop Shadow ..................................................................................................... 5  Figure 4.3. Example Outline............................................................................................................... 6  Figure 4.4. Subtitle Decoder Processing Model.................................................................................... 6  Figure 5.1. Message Segmentation and Reassembly ........................................................................... 13  LIST OF TABLES Table 2.1 Example .......................................................................................................................... 3  Table 5.1. Subtitle Message Format ................................................................................................. 9  Table 5.2. Subtitle Message Format with message_body() Delineated ............................................ 10  Table 5.3. Stuffing Descriptor Format ........................................................................................... 11  Table 5.4. Display Standards ......................................................................................................... 14  Table 5.5. Subtitle Type ................................................................................................................. 16  Table 5.6. Color Vector Formatting ............................................................................................... 16  Table 5.7. Simple Bitmap Format .................................................................................................. 18  Table 5.9. Compressed Bitmap ...................................................................................................... 21  iii 1 SCOPE 1.1 Purpose This document defines a standard for a transmission protocol supporting multilingual subtitling services to augment video and audio within MPEG-2 multiplexes. 1.2 Organization The sections of this document are organized as follows: Section 1 — Presents the scope. Section 2 — Lists compliance notation and terms. Section 3 – Lists applicable documents Section 4 — Provides an overview of subtitling system design. Section 5 — Specifies the subtitle message format. 2 COMPLIANCE NOTATION “SHALL” This word or the adjective “REQUIRED” means that the item is an absolute requirement of this specification. “SHALL NOT” This phrase means that the item is an absolute prohibition of this specification. “SHOULD” This word or the adjective “RECOMMENDED” means that there may exist valid reasons in particular circumstances to ignore this item, but the full implications should be understood and the case carefully weighted before choosing a different course. “SHOULD This phrase means that there may exist valid reasons in NOT” particular circumstances when the listed behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label. “MAY” This word or the adjective “OPTIONAL” means that this item is truly optional. One vendor may choose to include the item because a particular marketplace requires it or because it enhances the product, for example; another vendor may omit the same item. 1 2.1 Terms, Acronyms and Abbreviations 2.1.1 Terms The following terms are used throughout this document: message: A sequence of bytes comprising a data structure defined in this Standard. All messages begin with the table_ID and end with the CRC_32 field. Messages are carried in non-PES streams; their starting points within a packet payload is indicated by the pointer_field mechanism defined in the ISO/IEC 13818- 1 Systems document. section: A message comprising a portion of an ISO/IEC 13818-1-defined table, such as the Program Association Table (PAT), Conditional Access Table (CAT), or Program Map Table (PMT). The term conforms to MPEG terminology, but since it applies primarily to the delivery of table structures, the more appropriate term "message" is used to refer to non-table oriented data structures such as, for example, the subtitle message. program element: A generic term for one of the elementary streams or other data streams that may be included in a program. program: A collection of program elements. Program elements may be elementary streams. Program elements need not have any defined time base; those that do have a common time base and are intended for synchronized presentation. The term "program" is also used in the context of a "television program" such as a scheduled daily news broadcast. The distinction between the two usages should be understood by context. service: ISO/IEC 13818-1 uses the term "program" to refer to a collection of program elements without regard to time. In this Standard, the term "service" is used in this same context to denote a collection of elementary components. Usage of the term service clarifies certain discussions which also involve the notion of the term program in its traditional meaning (in, for example, the statement "A video service carries a series of programs"). stream: An ordered series of bytes. The usual context for the term "stream" involves specification of a particular PID (such as the "Program Map PID stream"), in which case the term indicates a series of bytes extracted from the packet multiplex from packets with the indicated PID value. 2.1.2 Acronyms and Abbreviations The following acronyms and abbreviations are used within this specification: bslbf bit string, left bit first CRC Cyclic Redundancy Check IRD Integrated Receiver-Decoder ISO International Standards Organization MPEG Moving Picture Experts Group PCR Program Clock Reference PES Packetized Elementary Stream PID Packet Identifier PMT Program Map Table PTS Presentation Time Stamp rpchof remainder polynomial coefficients, highest order first TS Transport Stream uimsbf unsigned integer, most significant bit first 2 2.2 Stream Type for Subtitling Messages Stream type 0x82 shall be used for program subtitles defined in this Standard. 2.3 Section and Data Structure Syntax Notation This document contains symbolic references to syntactic elements. These references are typographically distinguished by the use of a different font (e.g., restricted), may contain the underscore character (e.g., sequence_end_code) and may consist of character strings that are not English words (e.g., dynrng). The formats of sections and data structures in this document are described using a C-like notational method employed in ISO/IEC 13818-1. An extension to this method is described below. Each data structure is described in a table format wherein the size in bits of each variable within that section is listed in a column labeled "Bits." The column adjacent to the bits column is labeled "Bytes" and indicates the size of the item in bytes. For convenience, several bits within a particular byte or multi-byte variable may be aggregated for the count. An example follows: Table 2.1 Example Syntax Bits Bytes Mnemonic / Description for_section(){ table_ID 8 1 uimsbf section_syntax_indicator 1 bslbf ... if (section_syntax_indicator) { ISO_reserved 2 (1) bslbf table_extension 16 (2) uimsbf } version_number 5 uimsbf current_next_indicator 1 bslbf {next, current} ... } In the byte count column, items that are conditional (because they are within a loop or conditional statement) are parenthesized. Nested parentheses are used if the loops or conditions are nested. 3 REFERENCES 3.1 Normative References 1. ISO/IEC 13818-1:2007 Information Technology — Generic coding of moving pictures and associated audio - Part 1: Systems. 2. ISO: “ISO 639.2, Code for the Representation of Names of Languages — Part 2: alpha-3 code,” as maintained by the ISO 639/Joint Advisory Committee (ISO 639/JAC), http://www.loc.gov/standards/iso639-2/iso639jac.html. 3 3.2 Informative References 3. EBU Tech. 3264-E, Specification of the EBU Subtitling Data Exchange Format, European Broadcasting Union, February 1991. 4 OVERVIEW OF SUBTITLE SYSTEM DESIGN This section provides an overview of systems concepts involved in this Standard. 4.1 Bitmapped Subtitles The transmission format for subtitles consists of one or more compressed bitmap images, along with optional rectangular backdrops for each. With the bitmap method, any language can be supported, as opposed to those supported within the memory of the Decoder and, the author of the subtitle stream has complete control over the appearance of the characters: the font (size and serif or sans-serif, for example), and kerning. In addition, characters and symbols which are not a part of any standard ROM-based character set can be transmitted and displayed, such as those characters in ideographic languages which represent proper names. 4.2 Coordinate System In the horizontal axis, the coordinate system used to locate characters and bitmaps for this Standard is based on the number of pixels available horizontally in the display grid for the target video format. Standard definition digital formats include modes up to 720 pixels horizontally, clocked at a 13.5 MHz rate; HDTV formats include modes with up to 1920 pixels horizontally. Vertical coordinates are specified by raster lines. For consistency, raster lines are counted after interlace; the counting method therefore does not correspond with the usual way of counting lines in interlaced NTSC. The target display format is defined in each subtitle message, and defines frame rate and the horizontal and vertical dimensions of the active display grid. The origin of the coordinate system is the upper left corner of the display grid, whose coordinates are given by (origin_H_coordinate, origin_V_coordinate) = (0, 0). 4.3 Bitmaps and Frames Bitmaps and frames are positioned on the display screen referenced to the same pixel-level coordinate system as described above (see Figure 4.1). Bitmaps are located on the display grid by the upper left pixel, whose coordinates are given by (bitmap_top_H_coordinate, bitmap_top_V_coordinate) = (BTH, BTV). The lower right corner of the bitmap is provided to define an enclosing rectangle prior to bitmap decompression. The enclosing rectangle may be used to compute memory requirements for the decompressed bitmap, or to define the screen area affected when the bitmap is to be erased. The lower right coordinates are given by (bitmap_bottom_H_coordinate, bitmap_bottom_V_coordinate) = (BBH, BBV). 4 Frames are located by the upper left corner and lower right corner: (frame_top_H_coordinate, frame_top_V_coordinate) = (FTH, FTV) and (frame_bottom_H_coordinate, frame_bottom_V_coordinate) = (FBH, FBV). There shall be FTH ≤ BTH, FTV ≤ BTV, FBH ≥ BBH, and FBV ≥ BBV. F TH B TH F TV B TV Yes, go. B BV F BV B BH F BH Figure 4.1. Placement of Bitmaps and Frames 4.4 Outlines and Drop Shadows The bitmapped subtitles can be specified with variable-thickness outlines or drop shadows, and/or frames. Figure 4.2 shows an example of a drop shadow. The following parameters are specified, as indicated in the figure. • Shadow right: Sr • Shadow bottom: Sb Figure 4.2. Example Drop Shadow Figure 4.3 shows an example of outlined text. For outlines the line thickness is specified. 5 Figure 4.3. Example Outline 4.5 Display Standards Subtitles are authored with a specific display standard in mind (NTSC vs. PAL, HDTV vs. SDTV, etc.). The display standard used influences choices regarding text placement on the display grid. The targeted display standard is indicated in each subtitle message, given as the size of the display grid horizontally and vertically. Note that in some instances it may be possible to process a subtitle stream intended for one display standard on video of another. For example, it may be practical to define a service containing both an HDTV component and an SDTV component (dual carriage of video), but with just one subtitle stream. The stream would be formatted for NTSC display, to cover both cases. In this example, the NTSC version represents the least common denominator between the two formats. It is the responsibility of the HDTV Decoder to scale the vertical position based on vertical resolution, and adjust positions horizontally, as appropriate, in order to accommodate the foreign-format subtitle. For horizontal placement of bitmap or text objects, the 720 NTSC pixels would be centered within the HDTV display region. The actual sizes of bitmaps and frames shall not be required to be scaled except by a factor of two (line doubling). Specification of specific requirements for support of foreign-format subtitles are outside the scope of this Standard. 4.6 Decoder Processing Model The subtitle processing model reflects processing required in the Decoder of subtitle messages. The model can be used to establish constraints which can be used to verify the validity of subtitle streams prepared in accordance with this Standard. Figure 4.4 diagrams the model. 32 kbps 128 kbps 128 kbps MPEG-2 TS carrying subtitle rendered messages Transport Depacketization Input Decompression Display PID subtitles Buffer and Buffer and Queue Filtering (512 bytes) Desegmentation (16 Kbytes) Rendering (80 Kbytes) Figure 4.4. Subtitle Decoder Processing Model 6 MPEG-2 Transport Stream packets come into the model at the left, and are filtered by PID. Packets whose PID matches the target value flow into the 512 byte transport buffer. These buffered packets are removed at a rate of 32 kbps (kilobits/second) for depacketization and desegmentation, and the result is stored in the input buffer as the data input to the subtitling application. In the case of segmented subtitle messages (see descriptions in Section 4.6), only completely reassembled messages should be kept for subsequent processing. Incomplete messages shall be discarded. Subsequent processing of each reassembled message includes decompression, rendering, and queuing for display at the specified in-cue time. In order to define the input buffer and display queue sizes, maximum data sizes for uncompressed and rendered subtitles are defined. Although derived from the NTSC display standard, the same maxima are also assumed for other display standards. The Title Safe Area on a standard NTSC screen is 80% of the screen. The normal subtitle region can be up to 120 lines within the title safe area. The 120 lines may be divided into groups of contiguous lines corresponding to disjoint sub-regions. Therefore, for monochrome bitmaps a maximum sized subtitle region is 576 x 120 = 69120 bits = 8640 bytes. The size of the input buffer is 16 Kbytes, which can hold at least three largest compressed subtitles if the compression ratio is no worse than 2. Data stored in the input buffer is removed and processed at a rate of 128 kbps. This Standard assumes that each displayed pixel is a 4-bit colored pixel. Consequently, the size of a rendered subtitle is up to 4 times the displayed screen size and the size of a subtitle being processed can be as large as 5 (4 for the rendered subtitle plus 1 for the original decompressed bitmap) times the screen size, a total of at least 8640 x 9 bytes. In addition to the queuing function, the display queue can also be used as a work space for data decompression and subtitle building. The queue size is specified to be 80 Kbytes to permit two largest subtitles to co-reside in the queue, one already rendered and the other still being built. Data is entered into the display queue at 128 kbps, same as the removal rate from the input buffer. Each rendered subtitle is removed instantaneously from the display queue for on-screen display. 5 SUBTITLE MESSAGE FORMAT 5.1 Reserved Fields reserved — Fields in this Standard marked "reserved" shall not be assigned by the user, but shall be available for use by future versions of this Standard. Decoders shall disregard reserved fields for which no definition exists that is known to that unit. Fields marked "reserved" shall be set to a value of zero until such time as they are defined and supported. ISO_reserved — Fields in this Standard marked "ISO_reserved" are reserved under ISO/IEC 13818-1 and hence shall not be assigned by the user. 5.2 Protocol Extensibility The protocol defined in this Standard is designed to be extensible in the following ways: reserved Fields: Fields in this Standard marked "reserved" are reserved for future use by a revision of this Standard, or by issuance of another standard which builds upon this one. 7 user Private Descriptors: Certain descriptor tag values are designated "user private." User private descriptors may be placed in areas of this protocol designated as "descriptors()." If the owner of the private descriptor is not the owner of the PID in which the descriptor appears, the private descriptor shall be preceded by an ISO/IEC 13818-1 registration_descriptor(). 5.3 Subtitle Transmission Format The subtitle_message() defines subtitle bitmaps associated with a service. Timing for the display of subtitle text is given as a Presentation Time Stamp (PTS) referenced to the program's program clock (PCR). Subtitles are composed bitmaps, displayed on-screen at a defined "in-cue" time for a specified number of frames, and positioned on the screen at a position defined according to the coordinate systems defined in Section 3.2. Cumulative display is possible, meaning that a certain line of text or rectangular bitmap image may be displayed without erasing previously displayed subtitles. The out-cue time may be derived by adding the display_duration to the display_in_PTS time (converted to frames). If a line of text is defined in cumulative mode, that entire line is erased and redrawn with the new text, without affecting any other text that might be displayed. The subtitle transmission format defines, on a pixel-by-pixel basis, a variable number of rectangular areas on the display grid. In the simple bitmapped method, the transmitted image is monochrome (just as are bits from a ROM-based font). The receiver is responsible for rendering the bits with the specified coloring and background (border format and thickness, character and border color, etc.). A subtitling system component at the uplink, downlink, or broadcast center is responsible for accepting subtitle data in a standard format, such as the format defined in Reference [3], and converting it to the message format described here. Table 5.1 describes the format of the subtitle message. The table_ID and section_length fields are defined within Reference [1]. 8 Table 5.1. Subtitle Message Format Syntax Bits Bytes Mnemonic / Description subtitle_message(){ table_ID 8 1 uimsbf (value 0xC6) zero 2 2 bslbf ISO reserved 2 bslbf section_length 12 uimsbf zero 1 1 bslbf {false} segmentation_overlay_included 1 bslbf {false, true} protocol_version 6 uimsbf if (segmentation_overlay_included) { table_extension 16 (2) uimsbf last_segment_number 12 (3) uimsbf range 0-4095 segment_number 12 uimsbf range 0-4095 } ISO_639_language_code 24 3 uimsbf per Reference [2] pre_clear_display 1 1 bslbf {no, yes} immediate 1 bslbf {no, yes} reserved 1 bslbf display_standard 5 uimsbf {_720_480_30, _720_576_25, _1280_720_60, _1920_1080_60, reserved1..N} display_in_PTS 32 4 uimsbf subtitle_type 4 2 uimsbf {reserved1, simple_bitmap, reserved2..N} reserved 1 bslbf display_duration 11 uimsbf units: frames; maximum: 2000 block_length 16 2 uimsbf (B) if (subtitle_type==simple_bitmap) { simple_bitmap() B*8 (B) } else { reserved() B*8 (B) } for (i=0; i