WO2006114021A1 - Synchronous caption generating method and device that can be used in portable device - Google Patents

Synchronous caption generating method and device that can be used in portable device Download PDF

Info

Publication number
WO2006114021A1
WO2006114021A1 PCT/CN2005/000581 CN2005000581W WO2006114021A1 WO 2006114021 A1 WO2006114021 A1 WO 2006114021A1 CN 2005000581 W CN2005000581 W CN 2005000581W WO 2006114021 A1 WO2006114021 A1 WO 2006114021A1
Authority
WO
WIPO (PCT)
Prior art keywords
subtitle
clock signal
time
data item
caption
Prior art date
Application number
PCT/CN2005/000581
Other languages
French (fr)
Chinese (zh)
Inventor
Hongjun Chai
Qiwei Hu
Zhengde Cao
Original Assignee
Beijing Digital Chaotex Information Technology Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Digital Chaotex Information Technology Ltd. filed Critical Beijing Digital Chaotex Information Technology Ltd.
Priority to PCT/CN2005/000581 priority Critical patent/WO2006114021A1/en
Publication of WO2006114021A1 publication Critical patent/WO2006114021A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/44Receiver circuitry for the reception of television signals according to analogue transmission standards
    • H04N5/445Receiver circuitry for the reception of television signals according to analogue transmission standards for displaying additional information
    • H04N5/44504Circuit details of the additional information generator, e.g. details of the character or graphics signal generator, overlay mixing circuits
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • H04N21/43074Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen of additional data with content streams on the same device, e.g. of EPG data or interactive icon with a TV program
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/414Specialised client platforms, e.g. receiver in car or embedded in a mobile appliance
    • H04N21/41407Specialised client platforms, e.g. receiver in car or embedded in a mobile appliance embedded in a portable device, e.g. video client on a mobile phone, PDA, laptop
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles

Definitions

  • the present invention relates to a synchronized subtitle generating method and apparatus, and more particularly to a synchronized subtitle generating method and apparatus for portable devices such as mobile phones, personal digital assistants (PDAs) and the like.
  • Background technique
  • synchronous subtitles An important part of entertainment and educational multimedia content such as karaoke and MTV is the subtitles that are played simultaneously with the music being played.
  • the basic feature of synchronous subtitles is that the color of the displayed text is automatically changed sequentially at a specific time with music or image playback, thereby achieving the purpose of prompting the end user with the lyrics and the singing rhythm.
  • Embedded image subtitles that is, superimposing subtitles on the original image during the production of the media content, and performing overall recording or compression encoding on the new composite image.
  • the subtitles have been fixed in the image as part of the projection screen.
  • Such methods are typically used in analog videotapes, VCD systems, and broadband network video content.
  • the advantage of this method is that no additional storage device and decoding playback device are required to process the subtitles, thereby simplifying the organization of the stored data and the structure of the player, and reducing the cost of the playback device. Its limitations are also obvious: After the production is completed, you can no longer freely change the color, position, display style, etc.
  • This method uses a separate dynamic image to store and display subtitles, so subtitles are not directly integrated into the main screen.
  • the main screen and the specified subtitles are synchronized according to the time code, and the subtitles are superimposed on the appropriate position of the main screen (generally directly below the main screen).
  • the advantages of such a method are: the main picture can correspond to a plurality of subtitles, and the user selects different subtitles for superposition according to usage preferences or language habits, and the user can even select to superimpose and display multiple subtitles simultaneously in the picture; the subtitle position can be based on the user. Preferences or player settings for later adjustments.
  • the color, display style, and the like of the subtitle are still not adjustable, the storage of the subtitle occupies a relatively large amount of additional storage space, and a separate decoding process is required to decompress and display the subtitle.
  • This method is mainly used in the currently popular MPEG4 format compressed video media, in addition to supporting the SUB subtitle mode of a general DVD system, and also supports subtitle data recorded in a plain text format.
  • the subtitle data format is relatively simple and consists of multiple subtitle items. Each subtitle item contains a serial number, start time, end time, and subtitle text. The subtitle item allows more than one line of subtitle text.
  • the advantage of this method is that the subtitles are stored in plain text, which facilitates the later editing and modification, and saves storage space compared with the image mode. Meanwhile, the separation of text subtitles allows the user to specify the position, color, font of the subtitle display during playback. Style and more.
  • the subtitles of this format are closely related to the encoding of the text, and cannot support subtitles mixed in multiple languages.
  • this method is generally only used for subtitle display of movies or ordinary video programs, and cannot be applied to karaoke programs.
  • the special captioning machine after the main display decoding device outputs the display signal of the main screen, uses an independent caption display device or unit, superimposes the caption on the display signal and outputs it to the final display screen.
  • the dedicated subtitle generator makes it easy to synthesize subtitles with different content screens, and can achieve a variety of rich display effects, such as subtitle scrolling, fades, text variants, and more.
  • the cost of the captioning machine is high, the flexibility is small, and the upgrade is difficult, and it is almost impossible to apply to the current mobile device.
  • a method for generating a synchronized subtitle including the steps of: generating a clock signal; and searching for caption data to be displayed at a corresponding current time according to timing information represented by the clock signal; Determining a subtitle color change state at a current time according to timing information represented by the clock signal; outputting a subtitle based on the color change state and the searched caption data; and superimposing the main picture and the subtitle into a final picture.
  • the subtitle data is divided into a plurality of subtitle data items, each subtitle data item including subtitle information displayed during a period of time, and a start time and an end time at which the subtitle data is to be displayed.
  • the desired subtitle data item is determined in the step of finding subtitle data by judging which time period between the start time and the end time of the current data item.
  • the subtitle data items are sequentially stored in the order of play, and the steps of searching for subtitle data are searched one by one according to the order in which the subtitle data items are played, or are searched according to the dichotomy.
  • the subtitle data item also includes one or more placeholders corresponding to the length of time the character is displayed before or after each character to be displayed.
  • the step of determining the color change state determines a character to be color-changed by the caption based on the number of characters included in each caption data item, the start and end time of the caption data item, and the current time.
  • the current subtitle data item is divided into two parts by the determined character that is changing color, and is displayed in different colors or patterns, respectively.
  • a synchronous caption generating device including: a clock signal generating device for generating a clock signal; and a searching device, configured to search for a corresponding current time according to timing information of the clock signal a caption data display device, configured to determine a caption color change state at a current time according to timing information of the clock signal, and output a caption according to the color change state and the searched caption data; and a synthesizing device, configured to The picture and the subtitle are superimposed to form a final picture.
  • the synchronized subtitle generating method and the device for implementing the same according to the present invention are easy to implement, have very low requirements on the storage capacity and processing capability of the system, and are currently suitable for subtitle display methods for portable device processing.
  • FIG. 1 is a block diagram showing the internal structure of a portable device according to a caption generating apparatus according to the present invention
  • FIG. 2 is a flow chart showing the workflow of the caption generating device according to the present invention
  • FIG. 3 is a view showing the use of the binary search method to find a caption data item corresponding to a certain moment in the searching step of FIG. 2, according to an embodiment of the present invention
  • FIG. 4 is a flow chart showing a subtitle display and color change process according to an embodiment of the present invention.
  • FIG. 5 is a block diagram showing the structure of a caption generating apparatus according to an embodiment of the present invention.
  • Fig. 1 shows a block diagram of an internal structure of a portable device according to a caption generating apparatus according to the present invention.
  • a mobile terminal 10 as a portable device includes a user input device 101, a system timer 102, a media playback device 103, an audiovisual decoder 104, a sound device 105, a caption generator 106, and a graphic and character output device. Interface 107.
  • the user can control the operation of the media playback device 103 by inputting various control commands (e.g., stop playback, pause playback, resume playback, and shuffle commands, etc.) through the user input device 101.
  • the media playback device 103 also transmits the command to the subtitle generator 106 in accordance with an instruction from the user input device 101 to operate in synchronization with the media playback device 103.
  • the system timer 102 generates a clock signal that is simultaneously supplied to the media playback device 103 and the subtitle generator 106 for timing and synchronization.
  • the media playback device 103 supplies the encoded image and sound data to the image sound decoder 104 for decoding processing in accordance with a user instruction.
  • the sound signal generated by the decoding by the image sound decoder 104 is supplied to the sound device 105, and the generated image signal is supplied to the graphic and character output device interface 107.
  • the subtitle generator 106 generates subtitle information to be currently displayed based on an instruction from the media playback device 103 and a clock signal from the system timer 102, and outputs to the graphics and character output device interface 107, wherein the subtitle information includes the text of the currently displayed subtitle Information on the discoloration of information and subtitles.
  • the graphic and character output device interface 107 synthesizes the main image from the image sound decoder 104 and the subtitle information from the subtitle generator 106 into a final output composite image, and displays it.
  • the same screen can display multiple lines of subtitles, and at the same time handle the discoloration of at least one line of subtitles;
  • rhythm of the subtitle display conforms to the beat of the corresponding music, and the length of the character discoloration interval should be an integer multiple of a basic beat;
  • the synchronization error of subtitle display is generally allowed to be within plus or minus 1/10 seconds.
  • the caption data is stored in a separate data unit in the portable device independent of the picture content.
  • the storage of subtitle data involves the following data elements: '
  • each line of lyrics is stored as a data item.
  • subtitle text is adopted.
  • UTF-16 (16-bit Unicode encoding)
  • UTF-8 8-bit Unicode encoding
  • UTF-16 when recording plain English text, use UTF-8 encoding; when recording Chinese or Chinese-English mixed text, use UTF-16 encoding.
  • Subtitle start time and end time associated with the data item of the caption text body In order to save storage space, the time is the relative time of time 0 point when playing from the corresponding music.
  • the specific implementation of the present invention can expand the use of other related data, such as the color of the text border, the display effect of the text, and the like.
  • the method of the present invention comprises the steps of: initializing the caption generator 106 while the music corresponding to the caption starts playing.
  • the caption generator 106 accepts and analyzes subtitle data, separates each subtitle data item, initializes the system timer 102, and initializes a character generator (not shown).
  • character generators are typically composed of a font library, a coded information table, a dot matrix renderer, and corresponding interfaces.
  • the system timer 102 generates a uniform clock signal having an interval of less than 1 / 10 seconds after initialization (step S201). On some types of portable devices, this limit can be relaxed appropriately, but should not be greater than the maximum caption synchronization error allowed by the media content.
  • Each clock signal of the clock is input to the subtitle generator 106, driving the drawing and color changing operations of the subtitles at the current time.
  • the subtitle generator 106 After receiving the clock signal, the subtitle generator 106 searches for the subtitle data item that should currently be displayed based on the time from the start of the music playback to the current elapsed time (step S202). Assumed sound The time reading of the music playback start time is t0, the current time reading is tx, and the start time of the subtitle data item is ts, and the end time is te, then a subtitle data item should be found to satisfy the condition ts (tx-t0) Te. Under normal conditions, subtitle data items that satisfy this condition are unique. In order to simplify the operation in the mobile device, the caption generator 106 can select the first caption data item that matches this condition, ignoring other items.
  • the storage order of the subtitles may be set to be consistent with the order in which the subtitles are displayed, and the order numbers starting from 0 are sequentially given to all the data items, and then the following search may be taken.
  • the serial number of the currently played data item is recorded each time it is processed, and the recording sequence number is 0 when initializing.
  • the next clock signal arrives, it is judged whether the data item corresponding to the current record number meets the condition. If the condition is not met, the order determines whether the first item and the second item of data are eligible until the end of the sequence of data items. In this way, when the subtitle data itself is normal, the clock signal can meet the requirements to minimize the number of searches, and the playback process is simplified, and the system resources are less occupied.
  • the caption generator 106 is required to enable random location playback of the content in conjunction with the home screen playback device; i.e., the user can choose to implement the content at any desired location that is not predictable.
  • the subtitle data items have been sorted in chronological order, we can quickly find the data items that meet the requirements in an improved binary search.
  • the specific implementation is shown in the search process shown in Figure 3.
  • the time complexity required for this lookup is log2N, where N is the total number of data items. Using this method, when there are 1000 subtitle data items in the system (this is a large number, the total number of subtitle data items of common karaoke content does not exceed 100, including all repeated paragraphs), the number of seeks required No more than 10.
  • the color change of the subtitle color at the current time is determined according to the current time indicated by the clock signal (step S203).
  • the subtitle generator 106 divides the subtitle text into two groups according to this number, and the character generator or the graphic device transmitted to the system respectively performs character output.
  • the above method is only applicable to the case where the file in the subtitle is discolored at a uniform speed.
  • the body characters in the subtitles change color at an uneven speed, but still match the music beat.
  • a placeholder character is introduced, and characters that are not commonly used in the subtitle body, such as a wavy line ( ⁇ ), are generally used.
  • the placeholder character may be selected according to the implementation. Placeholder characters participate in the calculation of the total number of characters and the number of color-changing words, but are filtered out when the output is displayed. Practice has shown that the rational use of placeholder characters can simulate the discoloration rhythm of various subtitles.
  • the relative duration of the character's pronunciation is determined by the number of subsequent placeholder characters. If the length of a character's pronunciation is three times the basic rhythm, two placeholder characters are required after this character. The rest of the situation is like this.
  • the subtitle generator 106 outputs the subtitle having the determined color change state (step S204). Finally, the main picture and the subtitle are superimposed to form a final picture (step S205).
  • This process can be invoked by calling a character generator provided by the portable device system itself, or a graphical output device.
  • the output process of the subtitle uses the color specified in the data item. In most cases, the text of the text contained in each caption data item is output on one line. It can also be automatically wrapped at the appropriate character width based on the font size provided by the portable device and the width of the displayable area.
  • the caption generator 106 can display one or more data before or after the current caption data item in the appropriate location, depending on the content needs or user selection, or the player's request.
  • Figure 3 illustrates the use of a dichotomy in the lookup step of Figure 2, in accordance with one embodiment of the present invention.
  • the search method finds a detailed flowchart of the subtitle data item corresponding to a certain moment.
  • step S301 initialization is performed in step S301, and two parameters 1 and h are defined, where 1 represents the lower limit of the search range, and h represents the upper limit of the search range such that 1 is equal to 0 and h is equal to the end caption data item.
  • Serial number Note that, as described above, the serial number of the subtitle data item is consecutively numbered in the chronological order in which the subtitle data item is to be displayed.
  • step S302 a sequence number is obtained by calculating (1+h) 12 and taking a subtitle data item corresponding to the sequence number.
  • step S303 since each subtitle data item includes a start time and an end time for displaying the subtitle data item, it can be determined according to the start time and the end time whether the current time tx is within the time range of the subtitle data item. . If it is within the time range of the item, the current subtitle data item is the item that should be displayed currently to be searched, thereby executing step S31 1, ending the current search process and exiting. If it is not within the time range of the item, step S304 is performed to determine whether the current time tx is less than the start time of the item.
  • Step S307 and step S308 both proceed to step S309 to determine whether 1 is less than 11. If the result of the determination is "YES", it indicates that the subtitle data item that should be currently played has not been found, and the process returns to step S302 to continue the above-described search process, otherwise the value of 1 is taken as the currently displayed subtitle data item.
  • a method for finding a current subtitle data item by a dichotomy is described in detail above, by which a desired subtitle data item can be quickly found, reducing computational complexity, and It occupies less hardware resources and is suitable for portable devices.
  • the present invention may be practiced with a variety of conventional methods of simplification, which are included within the scope of the invention as defined by the appended claims.
  • FIG. 4 a caption display and color change process in accordance with one embodiment of the present invention.
  • Figure The flow of 4 is performed after the flow of FIG. 3, and the caption data item currently to be displayed has been found before the flow of FIG. 4 is executed.
  • step S401 is executed to determine the number of characters currently discolored according to the timing information according to the method described above, thereby distinguishing the character to be discolored and the normal character not discolored in the current subtitle data item.
  • step S402 the character to be changed is stored in the color-changing character buffer
  • step S405 is executed to store the normal character that is not discolored in the normal character buffer.
  • the placeholder characters are respectively filtered out from the above two buffers, and the placeholder characters are added in advance to match the beat of the caption display as described above, so as to calculate the discoloration of the captions. Position, the placeholder character is not actually displayed.
  • Steps S403 and S406 may also be performed while filling the corresponding character buffer, that is, steps S402 and S405.
  • Steps S404 and S407 are respectively performed to calculate the position of the text output, and the step can be implemented by a method known in the art.
  • step S408 the characters in the color-changing character buffer and the normal character buffer and the calculated position information are respectively output to the character output device, and the character output device outputs the color in different colors or manners according to the received information. Characters and normal characters. As the music or picture is played, or as time progresses, the number of color-changing characters changes. Therefore, in continuous display, the effect of color change in the karaoke can be obtained.
  • the method of processing the character discoloration described above with reference to Fig. 4 may also have other variations, for example, the placeholder character may be replaced with a time weighting value for each subtitle character.
  • Each subtitle character to be displayed may correspond to a weighting value indicating the time at which the subtitle character is to be displayed. This also makes it possible to obtain subtitle character information that is currently changing color in a manner similar to that described above. Therefore, in addition to the flow shown in Fig. 4, there are many different ways to implement the process of subtitle discoloration.
  • the fields of the caption data are arranged as follows:
  • the start time and end time of the subtitle display Use 32-bit or 16-bit binary integers Storage, if 32-bit integer storage is used, the time unit is 1880 or 1/1024 seconds; if 16-bit integer storage is used, the time unit is recommended to be 1/100 second, which can be applied to a length of 10 minutes and 55 seconds.
  • the music meets the length requirements of most karaoke music requirements.
  • the normal display color of the subtitles and the color after the color change can generally be stored using 24-bit RGB values, 8-bit system-defined palette entry values, 16-bit or 8-bit RGB values, depending on the system.
  • the two fields may be selectively stored or not stored due to the fixed display color, or the display color of the subtitles being customized by the later system.
  • Subtitle body text Unicode encoding (UTF-16 or UTF-8), a string ending with a number 0.
  • UTF-16 or UTF-8 Unicode encoding
  • a string ending with a number 0.
  • an 8-bit or 16-bit string length field can be added before the string, which requires some extra storage space.
  • the data field of fixed length of each data item is preferably arranged in front of the data item, and the variable length field (such as the subtitle body) appears behind the data item, so that the serial number of the data item is facilitated.
  • the order of these data fields can be exchanged and new new data fields can be introduced.
  • multibyte data fields need to be aligned on a 2-byte boundary or a 4-byte boundary.
  • the subtitle data can be separately compressed and stored using a certain compression method, or compressed and stored integrally with the main picture data.
  • the caption generator 106 needs to call the corresponding device or interface to decompress the data before processing the caption data.
  • the subtitle generator 106 can use a separate clock timer or share a certain clock signal with other components of the portable device system. In this case, the portable device system or the home screen player should pass the clock signal to the caption generator 106 as soon as possible, if possible.
  • the subtitle generator 106 displays the subtitles after the main screen is processed, so that the characters are always visibly displayed on the upper layer of the main screen.
  • the caption generator 106 acts as a component of the animation player and receives some time during the animation rendering process. To the clock signal, the display of such subtitles may be obscured by certain parts of the animation.
  • the caption generator 106 can support the pause and resume play functions of the play as needed. After the user chooses to pause the content playback, the other components of the system issue a pause signal to the caption generator 106. The system can turn off the clock signal to the caption generator 106, at which point the system should provide a separate clock count; or the system can continue to send a clock signal to the caption generator 106, which is clocked by the caption generator 106. The caption generator 106 internally sets a pause flag after receiving the pause signal, and thereafter does not process the clock signal until the recovery signal is received.
  • the system issues a resume playback signal to the subtitle generator 106.
  • the subtitle generator 106 receives this signal, clears the internal pause flag, and continues processing and displaying the subtitle as the next clock signal arrives. In this process, attention should be paid to the processing of the time t0 at which the music starts to play. Assuming that the pause time is tp and the recovery time is tr, then the t0 value is modified to t0+tr-tp. Otherwise, if the waiting time of the pause period is not deducted, the subtitles will be out of sync when the playback resumes.
  • the caption generator 106 can support random play as needed.
  • the user can choose to start playing from any location that is not previously predicted by the content.
  • the main screen and the content player should retrieve the time from the music playing device to the subtitle generator 106 at the time specified by the beginning of the music at the specified playback position.
  • the subtitle generator 106 calculates the start time to of the playback according to the current time, the input target time, and stores it, and then searches for the subtitle data item corresponding to the target time and displays it.
  • the system can define the actual display location of the subtitles as desired.
  • the display position can define a reference point coordinate (pixel numerical coordinate or proportional coordinate of the display area) and define an alignment relationship of the outer rectangle of the subtitle display relative to the reference coordinate.
  • the subtitle generator 106 automatically calculates and adjusts the display position to achieve the center alignment effect.
  • the system can also define other subtitle display positioning methods.
  • the movement of the subtitles can be pre-stored as needed for production, or calculated by a time-dependent function.
  • the caption generator 106 Based on the basic display mode, the caption generator 106 based on the present invention can expand other character display effects, such as hollow text, edge color enhancement, shadow, rotation, fade, etc., when the system resource permits. These effects do not change the basic subtitle display and text color rhythm control principles.
  • Fig. 5 shows a schematic structural view of a caption generating device 50 according to an embodiment of the present invention.
  • the main difference between the caption generating device 50 shown in the figure and the caption generator 106 shown in FIG. 1 is that the caption generating device 50 shown in FIG. 5 further includes a clock signal generating device 501 corresponding to FIG.
  • the system timer 102 and also includes a synthesizing device 505 for overlaying the subtitles with the main picture, which corresponds to the graphics and character output device interface 107 of FIG. Since the above two devices are included, the structure of the caption generating device shown in Fig. 5 is more independent and complete. As shown in Fig.
  • the subtitle generating apparatus includes a clock signal generating means 501, a looking means 502, a subtitle memory 503, a color change state determining means 504, and a synthesizing means 505.
  • the clock signal generating means 501 generates a clock signal and supplies it to the finding means 502 and the color changing state determining means 504.
  • the finding means 502 searches the caption memory 503 for the caption data item which should be displayed at the current time based on the clock signal from the clock signal generating means 501, and supplies the found caption data item to the color changing state determining means 504.
  • the color change state determining means 504 is divided into color-changing characters and normal characters based on the clock signal from the clock signal generating means 501 and the caption data item from the search means 502, and will be displayed in different colors, respectively.
  • the caption data item after the color change state is determined is supplied to the synthesizing device 505.
  • the synthesizing means 505 simultaneously receives the main picture to be displayed from the present, and superimposes the subtitle which determines the discoloration state on the main picture, thereby outputting the synthesized picture and displaying it.
  • the subtitle generating device shown in FIG. 5 can also have other variations, such as the word in FIG.
  • the screen memory 503 can be included in the lookup device 502, and the clock signal generated by the clock signal generating device 501 can also be provided externally by the caption generating device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Graphics (AREA)
  • General Engineering & Computer Science (AREA)
  • Studio Circuits (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

A synchronous caption generating method is disclosed. The method including the following steps: generating the clock signal; looking up the caption data to be displayed on current time according to the timing information represented by the clock signal; determining the color changing state of the caption on current time according to the timing information represented by the clock signal; outputting the caption on the basis of the color changing state and the caption data; synthesizing the final image by superimposing the caption on the main image. The invention also discloses a device for implementing the above synchronous caption generating method. The method and device in the invention can be applied in displaying karaoke caption on a portable device, and involve the advantages of possessing less storage space and processing resources, simple structure and being easy to maintain.

Description

用于便携式设备的同步字幕生成方法和设备 技术领域  Synchronous caption generation method and device for portable device
本发明涉及同步字幕生成方法和设备, 特别涉及用于便携式设 备, 如移动电话、 个人数字助理(PDA )等便携式设备的同步字幕生 成方法和设备。 背景技术  The present invention relates to a synchronized subtitle generating method and apparatus, and more particularly to a synchronized subtitle generating method and apparatus for portable devices such as mobile phones, personal digital assistants (PDAs) and the like. Background technique
卡拉 OK、 MTV等娱乐和教育类多媒体内容的一个重要组成部分 是与播放的音乐同步放映的字幕, 我们把这种字幕称为同步字幕。 同 步字幕的基本特征是随音乐或图像播放在特定时刻顺序地自动改变 显示文字的颜色, 以此达到向最终用户提示歌词和演唱节奏的目的。  An important part of entertainment and educational multimedia content such as karaoke and MTV is the subtitles that are played simultaneously with the music being played. We refer to this subtitle as synchronized subtitles. The basic feature of synchronous subtitles is that the color of the displayed text is automatically changed sequentially at a specific time with music or image playback, thereby achieving the purpose of prompting the end user with the lyrics and the singing rhythm.
随着移动电话, PDA 等便携式设备在人们日常生活中的快速普 及, 产生了在这些设备上展示各种多媒体内容的需求, 而卡拉 OK, MTV 等节目是其中很常见的一种。 由于受电池容量, 使用时间, 携 带体积等条件的限制, 移动设备都具有内存小, 处理能力低, 显示屏 幕小的共同特点, 为多媒体内容的播放和字幕显示带来新的挑战。  With the rapid adoption of portable devices such as mobile phones and PDAs in people's daily lives, there is a demand for displaying various multimedia contents on these devices, and programs such as karaoke and MTV are very common. Due to the limitations of battery capacity, usage time, and carrying capacity, mobile devices have the characteristics of small memory, low processing power, and small display screen, which brings new challenges for multimedia content playback and subtitle display.
目前常见的字幕显示方式有以下几种:  Currently common subtitles are displayed in the following ways:
1 ) 嵌入式图像字幕, 即在媒体内容的制作过程中将字幕叠加在 原始图像上, 对新的合成画面进行整体录制或压缩编码。 在这种方法 中, 字幕已经作为放映画面的一部分被固定在图像中。 此类方法一般 应用在模拟录像带, VCD 系统和宽带网络视频内容中。 这种方法的 优点是: 不需要额外的存储装置和解码播放装置去处理字幕, 因而简 化了存储数据的组织方式和播放器的结构, 降低了播放装置的成本。 它的局限性也是显而易见的: 在制作完成后, 不能再自由改变字幕的 颜色, 位置, 显示风格等, 并且此方法只适用于由动态画面组成的流 式媒体, 而流媒体相对占用较大的存储空间。 这样, 造成整个卡拉 OK系统必须确保有较大的存储空间, 或足够大的带宽以储存和传输 视频内容 1) Embedded image subtitles, that is, superimposing subtitles on the original image during the production of the media content, and performing overall recording or compression encoding on the new composite image. In this method, the subtitles have been fixed in the image as part of the projection screen. Such methods are typically used in analog videotapes, VCD systems, and broadband network video content. The advantage of this method is that no additional storage device and decoding playback device are required to process the subtitles, thereby simplifying the organization of the stored data and the structure of the player, and reducing the cost of the playback device. Its limitations are also obvious: After the production is completed, you can no longer freely change the color, position, display style, etc. of the subtitles, and this method is only applicable to streaming media composed of dynamic pictures, while streaming media is relatively large. storage. In this way, the entire karaoke system must ensure that there is a large storage space, or a large enough bandwidth for storage and transmission. Video content
2 )分离式图像字幕, 目前主要应用于 DVD系统中。 此方法用独 立的动态图像存储和显示字幕, 因此字幕并不是直接融合在主画面中 的。 播放器在播放时, 按照时间码同步主画面和指定的字幕, 将字幕 叠加在主画面的适当位置显示(一般是主画面的正下方) 。 此类方法 的优点是: 主画面可以对应多个字幕, 由用户按使用偏好或语言习惯 等选择不同的字幕进行叠加, 用户甚至可以选择在画面中同时叠加显 示多个字幕; 字幕位置可以根据用户偏好或播放器的设置进行后期的 调整。但是在这种方法中, 字幕的颜色,显示风格等仍然是不可调的, 字幕的存储占用了相对较多的额外存储空间, 并且需要单独的解码过 程对字幕进行解压缩和显示。  2) Separate image subtitles, currently mainly used in DVD systems. This method uses a separate dynamic image to store and display subtitles, so subtitles are not directly integrated into the main screen. When the player is playing, the main screen and the specified subtitles are synchronized according to the time code, and the subtitles are superimposed on the appropriate position of the main screen (generally directly below the main screen). The advantages of such a method are: the main picture can correspond to a plurality of subtitles, and the user selects different subtitles for superposition according to usage preferences or language habits, and the user can even select to superimpose and display multiple subtitles simultaneously in the picture; the subtitle position can be based on the user. Preferences or player settings for later adjustments. However, in this method, the color, display style, and the like of the subtitle are still not adjustable, the storage of the subtitle occupies a relatively large amount of additional storage space, and a separate decoding process is required to decompress and display the subtitle.
3 )分离式的文本字幕。 这种方法主要使用于目前流行的 MPEG4 格式的压缩视频媒体中, 除了支持一般 DVD系统的 SUB字幕方式, 还支持使用纯文本格式记录的字幕数据。 字幕数据格式相对简单, 由 多个字幕项组成。 每个字幕项包含一个序号, 起始时间, 结束时间, 以及字幕正文等, 字幕项允许包含一行以上的字幕正文。 这种方式的 优点是, 采用纯文本方式存储字幕, 方便了后期的编辑修改, 相对使 用图像方式更节省存储空间; 同时, 分离文本字幕允许用户在播放时 指定字幕显示的位置, 颜色, 字体, 风格等。 但是, 这种格式的字幕 和文本的编码方式密切相关, 不能支持多种语言混合的字幕。 另外, 由于缺乏对文字显示节奏的控制能力, 这种方法一般只用于给电影或 普通视频节目等搭配的字幕显示中, 还不能应用于卡拉 OK节目中。  3) Separate text subtitles. This method is mainly used in the currently popular MPEG4 format compressed video media, in addition to supporting the SUB subtitle mode of a general DVD system, and also supports subtitle data recorded in a plain text format. The subtitle data format is relatively simple and consists of multiple subtitle items. Each subtitle item contains a serial number, start time, end time, and subtitle text. The subtitle item allows more than one line of subtitle text. The advantage of this method is that the subtitles are stored in plain text, which facilitates the later editing and modification, and saves storage space compared with the image mode. Meanwhile, the separation of text subtitles allows the user to specify the position, color, font of the subtitle display during playback. Style and more. However, the subtitles of this format are closely related to the encoding of the text, and cannot support subtitles mixed in multiple languages. In addition, due to the lack of control over the rhythm of the text display, this method is generally only used for subtitle display of movies or ordinary video programs, and cannot be applied to karaoke programs.
4 ) 专用字幕机, 在主显示解码装置输出主画面的显示信号后, 采用独立的字幕显示装置或单元, 在显示信号上叠加字幕再输出到最 终的显示屏幕。 多用于早期的专用设备上。 使用专用的字幕发生器可 以方便地和不同的内容画面合成字幕, 并可以实现多种丰富的显示效 果, 如字幕滚动, 淡入淡出, 文字变型等。 但是字幕机投入的成本高, 灵活性小, 升级困难, 几乎不可能应用在目前的移动设备上。  4) The special captioning machine, after the main display decoding device outputs the display signal of the main screen, uses an independent caption display device or unit, superimposes the caption on the display signal and outputs it to the final display screen. Mostly used on early special equipment. The dedicated subtitle generator makes it easy to synthesize subtitles with different content screens, and can achieve a variety of rich display effects, such as subtitle scrolling, fades, text variants, and more. However, the cost of the captioning machine is high, the flexibility is small, and the upgrade is difficult, and it is almost impossible to apply to the current mobile device.
如上所述, 目前使用的各种同步字幕显示装置的原理都不适用于 移动电话、 PDA等便携式设备。使用以上的方法之一在便携式设备上 进行字幕的显示, 都具有占用系统资源过大, 数据效率低, 缺乏灵活 性的缺点。 当在目前使用的移动多媒体内容, 特别是在使用彩信, 手 机矢量动画等数据量较小的内容载体时, 迫切需要一种与之对应的, 存储效率高, 处理简单灵活的字幕处理单元。 As described above, the principles of various synchronized subtitle display devices currently in use are not applicable to Portable devices such as mobile phones and PDAs. Using one of the above methods to display subtitles on a portable device has the disadvantage of occupying excessive system resources, low data efficiency, and lack of flexibility. When the mobile multimedia content currently used, especially when using a content carrier with a small amount of data such as MMS, mobile phone vector animation, etc., there is an urgent need for a subtitle processing unit corresponding to high storage efficiency and simple and flexible processing.
本发明的目的即是提供这样一种适用于便携式设备的同步字幕 生成方法和设备。 发明内容  SUMMARY OF THE INVENTION It is an object of the present invention to provide such a synchronized subtitle generating method and apparatus suitable for use in a portable device. Summary of the invention
为了实现上述目的, 根据本发明的一个方面, 提供一种同步字幕 生成方法, 其中包括以下步骤: 产生时钟信号; 根据所述时钟信号所 表示的计时信息查找对应的当前时刻要显示的字幕数据; 根据所述时 钟信号所表示的计时信息确定当前时刻的字幕变色状态; 基于该变色 状态和所查找的字幕数据输出字幕; 以及将主画面和所述字幕叠加合 成最终画面。  In order to achieve the above object, in accordance with an aspect of the present invention, a method for generating a synchronized subtitle is provided, including the steps of: generating a clock signal; and searching for caption data to be displayed at a corresponding current time according to timing information represented by the clock signal; Determining a subtitle color change state at a current time according to timing information represented by the clock signal; outputting a subtitle based on the color change state and the searched caption data; and superimposing the main picture and the subtitle into a final picture.
将所述字幕数据分为多个字幕数据项,每个字幕数据项包含在一 段时间内显示的字幕信息, 以及将显示该字幕数据的起始时间和结束 时间。  The subtitle data is divided into a plurality of subtitle data items, each subtitle data item including subtitle information displayed during a period of time, and a start time and an end time at which the subtitle data is to be displayed.
在所述查找字幕数据的步骤中通过判断当前时刻落在哪一个字 幕数据项的起始时间和结束时间之间的时间段内而确定所需的字幕 数据项。  The desired subtitle data item is determined in the step of finding subtitle data by judging which time period between the start time and the end time of the current data item.
所述字幕数据项按照播放的先后次序顺序存储, 所述查找字幕数 据的步骤按照字幕数据项播放的先后次序逐一查找, 或者按照二分法 来查找。  The subtitle data items are sequentially stored in the order of play, and the steps of searching for subtitle data are searched one by one according to the order in which the subtitle data items are played, or are searched according to the dichotomy.
所述字幕数据项在每个要显示的字符之前或之后还包括与字符 显示的时间长度相对应的一个或多个占位符。  The subtitle data item also includes one or more placeholders corresponding to the length of time the character is displayed before or after each character to be displayed.
所述确定变色状态的步骤根据每个字幕数据项包含的字符数、 该 字幕数据项的起始和结束时间、 以及当前时刻来确定要正在进行字幕 变色的字符。 由所确定的正在变色的字符把当前字幕数据项分为两个部分, 分 别用不同的颜色或式样来显示。 The step of determining the color change state determines a character to be color-changed by the caption based on the number of characters included in each caption data item, the start and end time of the caption data item, and the current time. The current subtitle data item is divided into two parts by the determined character that is changing color, and is displayed in different colors or patterns, respectively.
在暂停画面的播放时, 暂停产生所述时钟信号, 并且在恢复画面 的播放时恢复该时钟信号。  When the playback of the screen is suspended, the generation of the clock signal is suspended, and the clock signal is restored upon playback of the resume picture.
根据本发明另一个方面, 还提供一种同步字幕生成设备, 包括以 下装置: 用于产生时钟信号的时钟信号产生装置; 查找装置, 用于根 据所述时钟信号的计时信息查找对应的当前时刻应显示的字幕数据; 变色状态确定装置, 用于根据所述时钟信号的计时信息确定当前时刻 的字幕变色状态, 并且根据该变色状态和所查找的字幕数据输出字 幕; 以及合成装置, 用于将主画面和所述字幕叠加合成最终画面。  According to another aspect of the present invention, a synchronous caption generating device is provided, including: a clock signal generating device for generating a clock signal; and a searching device, configured to search for a corresponding current time according to timing information of the clock signal a caption data display device, configured to determine a caption color change state at a current time according to timing information of the clock signal, and output a caption according to the color change state and the searched caption data; and a synthesizing device, configured to The picture and the subtitle are superimposed to form a final picture.
根据本发明的同步字幕生成方法和实现该方法的设备易于实现, 对系统的存储容量和处理能力的要求非常低, 是目前适合便携式设备 处理采用的字幕显示方法。  The synchronized subtitle generating method and the device for implementing the same according to the present invention are easy to implement, have very low requirements on the storage capacity and processing capability of the system, and are currently suitable for subtitle display methods for portable device processing.
通过以下结合附图的说明及权利要求书的内容, 并且随着对本发 明的更全面了解, 本发明的其他目的和效果将变得更加清楚和易于理 解。 附图说明  Other objects and effects of the present invention will become more apparent from the following description of the appended claims. DRAWINGS
下面将参考附图来描述本发明的优选实施方式, 其中:  Preferred embodiments of the present invention will now be described with reference to the accompanying drawings, in which:
图 1是根据包含根据本发明的字幕生成设备的便携式设备的内部 结构框图;  1 is a block diagram showing the internal structure of a portable device according to a caption generating apparatus according to the present invention;
图 2示出根据本发明的字幕生成设备的工作流程的流程图; 图 3示出根据本发明一个实施例, 在图 2的查找步骤中使用二分 查找方法查找某一时刻对应的字幕数据项的流程图;  2 is a flow chart showing the workflow of the caption generating device according to the present invention; FIG. 3 is a view showing the use of the binary search method to find a caption data item corresponding to a certain moment in the searching step of FIG. 2, according to an embodiment of the present invention; Flow chart
图 4 示出根据本发明一个实施例的字幕显示和变色过程的流程 图; 以及  4 is a flow chart showing a subtitle display and color change process according to an embodiment of the present invention;
图 5示出根据本发明一个实施例的字幕生成设备的结构示意图。 具体实施方式 图 1示出根据包含根据本发明的字幕生成设备的便携式设备的内 部结构框图。 如图 1 中所示, 作为便携式设备的移动终端 10包括用 户输入设备 101、 系统定时器 102、媒体播放设备 103、 图像声音解码 器 104、 声音设备 105、 字幕发生器 106以及图形和字符输出设备接 口 107。 FIG. 5 is a block diagram showing the structure of a caption generating apparatus according to an embodiment of the present invention. detailed description Fig. 1 shows a block diagram of an internal structure of a portable device according to a caption generating apparatus according to the present invention. As shown in FIG. 1, a mobile terminal 10 as a portable device includes a user input device 101, a system timer 102, a media playback device 103, an audiovisual decoder 104, a sound device 105, a caption generator 106, and a graphic and character output device. Interface 107.
用户可以通过用户输入设备 101输入各种控制指令(例如, 停止 播放、 暂停播放、 恢复播放和随机播放指令等等)来控制媒体播放设 备 103的操作。媒体播放设备 103根据用户输入设备 101的指令进行 工作的同时把该指令也传送到字幕发生器 106, 使其与媒体播放设备 103 同步地工作。 系统定时器 102产生同时提供到媒体播放设备 103 和字幕发生器 106的时钟信号, 用于定时和同步。 媒体播放设备 103 根据用户指令把编码的图像和声音数据提供到 ,图像声音解码器 104进 行解码处理。 由图像声音解码器 104解码后产生的声音信号被提供到 声音设备 105, 并且所产生的图像信号提供到图形和字符输出设备接 口 107。 字幕发生器 106基于来自媒体播放设备 103的指令和来自系 统定时器 102的时钟信号产生当前要显示的字幕信息, 并且输出到图 形和字符输出设备接口 107, 其中该字幕信息包括当前显示字幕的文 字信息和字幕的变色情况信息。 图形和字符输出设备接口 107把来自 图像声音解码器 104的主图像和来自字幕发生器 106的字幕信息合成 为最终的输出的合成图像, 并且显示出来。  The user can control the operation of the media playback device 103 by inputting various control commands (e.g., stop playback, pause playback, resume playback, and shuffle commands, etc.) through the user input device 101. The media playback device 103 also transmits the command to the subtitle generator 106 in accordance with an instruction from the user input device 101 to operate in synchronization with the media playback device 103. The system timer 102 generates a clock signal that is simultaneously supplied to the media playback device 103 and the subtitle generator 106 for timing and synchronization. The media playback device 103 supplies the encoded image and sound data to the image sound decoder 104 for decoding processing in accordance with a user instruction. The sound signal generated by the decoding by the image sound decoder 104 is supplied to the sound device 105, and the generated image signal is supplied to the graphic and character output device interface 107. The subtitle generator 106 generates subtitle information to be currently displayed based on an instruction from the media playback device 103 and a clock signal from the system timer 102, and outputs to the graphics and character output device interface 107, wherein the subtitle information includes the text of the currently displayed subtitle Information on the discoloration of information and subtitles. The graphic and character output device interface 107 synthesizes the main image from the image sound decoder 104 and the subtitle information from the subtitle generator 106 into a final output composite image, and displays it.
在大多数场合, 所显示的同步字幕满足如下要求:  In most cases, the displayed synchronized subtitles meet the following requirements:
1 ) 同屏幕可以显示多行字幕, 并且同一时间处理至少一行字幕 的变色;  1) The same screen can display multiple lines of subtitles, and at the same time handle the discoloration of at least one line of subtitles;
2 ) 字幕显示的节奏符合对应音乐的节拍, 字符变色的时间间隔 长度应该是一个基本节拍的整数倍;  2) The rhythm of the subtitle display conforms to the beat of the corresponding music, and the length of the character discoloration interval should be an integer multiple of a basic beat;
3 ) 由于人本身视觉和听觉识别能力的限制, 以及便携式设备的 处理能力的限制, 字幕显示的同步误差一般允许在正负 1/10秒之内。  3) Due to the limitation of human visual and auditory recognition capabilities and the processing power of portable devices, the synchronization error of subtitle display is generally allowed to be within plus or minus 1/10 seconds.
在本发明中, 字幕数据在便携式设备中独立于画面内容, 以单独 的数据单元储存。 为了处理满足以上条件的卡拉 OK字幕, 本发明中 字幕数据的储存涉及以下数据元素: 'In the present invention, the caption data is stored in a separate data unit in the portable device independent of the picture content. In order to process karaoke subtitles satisfying the above conditions, in the present invention The storage of subtitle data involves the following data elements: '
1 ) 字幕文本正文 1) Subtitle text body
在本发明中以卡拉 OK歌词为例, 每一行歌词为一个数据项进行 存储。 为了便于便携式设备处理和兼容多种语言编码, 字幕文本采用 In the present invention, taking the karaoke lyrics as an example, each line of lyrics is stored as a data item. In order to facilitate portable device processing and compatibility with multi-language encoding, subtitle text is adopted.
Unicode形式存储。 根据便携式设备的处理能力和需要显示的字幕语 言特性, 可以选择使用 UTF-16 ( 16位 Unicode编码) , 或 UTF-8 ( 8 位 Unicode编码) 。 例如, 在记录纯英文文本时, 使用 UTF-8编码; 在记录中文或中英文混合文本时, 使用 UTF-16编码。 Unicode form storage. Depending on the processing power of the portable device and the subtitle language characteristics that need to be displayed, you can choose to use UTF-16 (16-bit Unicode encoding), or UTF-8 (8-bit Unicode encoding). For example, when recording plain English text, use UTF-8 encoding; when recording Chinese or Chinese-English mixed text, use UTF-16 encoding.
2 ) 与字幕文本正文的数据项相关联的字幕起始时间和结束时间 为了节约存储空间, 该时间是从对应的音乐开始播放时为时间 0 点的相对时间。  2) Subtitle start time and end time associated with the data item of the caption text body In order to save storage space, the time is the relative time of time 0 point when playing from the corresponding music.
3 ) 与字幕文本正文的数据项相关联的字幕的缺省颜色  3) The default color of the subtitle associated with the data item of the caption text body
其中包括字幕未变色前的颜色和变色后的颜色。 本发明的具体实 现方案可以扩充使用其他相关数据, 如文字边框的颜色, 文字的显示 效果等。  This includes the color before the subtitle is not discolored and the color after the discoloration. The specific implementation of the present invention can expand the use of other related data, such as the color of the text border, the display effect of the text, and the like.
下面参照图 2描述根据本发明的方法的流程图。  A flow chart of a method in accordance with the present invention is described below with reference to FIG.
为了实现基本的字幕显示功能, 本发明的方法包含以下步骤: 在字幕对应的音乐开始播放的同时, 初始化字幕发生器 106。 字 幕发生器 106接受并分析字幕数据、 分离各个字幕数据项、 初始化系 统定时器 102、 初始化字符发生器(未示出)。 在目前的移动设备中, 字符发生器一般是由字库、 编码信息表、 点阵渲染器和相应的接口组 成。  In order to implement the basic caption display function, the method of the present invention comprises the steps of: initializing the caption generator 106 while the music corresponding to the caption starts playing. The caption generator 106 accepts and analyzes subtitle data, separates each subtitle data item, initializes the system timer 102, and initializes a character generator (not shown). In current mobile devices, character generators are typically composed of a font library, a coded information table, a dot matrix renderer, and corresponding interfaces.
系统定时器 102在初始化后产生间隔小于 1 / 10秒的均匀的时钟信 号 (步骤 S201 ) 。 在某些类型的便携式设备上, 这个限制可以适当 放宽, 但不应大于媒体内容允许的最大字幕同步误差。 时钟的每个时 钟信号均输入到字幕发生器 106中, 驱动对当前时刻的字幕的绘制和 变色操作。  The system timer 102 generates a uniform clock signal having an interval of less than 1 / 10 seconds after initialization (step S201). On some types of portable devices, this limit can be relaxed appropriately, but should not be greater than the maximum caption synchronization error allowed by the media content. Each clock signal of the clock is input to the subtitle generator 106, driving the drawing and color changing operations of the subtitles at the current time.
字幕发生器 106接收到时钟信号后,根据从音乐播放开始到当前 逝去的时间查找当前应该显示的字幕数据项 (步骤 S202 ) 。 假定音 乐播放开始时刻的时间读数为 t0, 当前时刻的时间读数为 tx, 而字幕 数据项中的起始时间为 ts, 结束时间为 te, 则应找到一个字幕数据项 满足条件 ts (tx-t0) te。 在正常状态下, 满足此条件的字幕数据项 是唯一的。 在移动设备中为了简化操作, 字幕发生器 106可以选择匹 配此条件的第一个字幕数据项, 忽略其他项目。 After receiving the clock signal, the subtitle generator 106 searches for the subtitle data item that should currently be displayed based on the time from the start of the music playback to the current elapsed time (step S202). Assumed sound The time reading of the music playback start time is t0, the current time reading is tx, and the start time of the subtitle data item is ts, and the end time is te, then a subtitle data item should be found to satisfy the condition ts (tx-t0) Te. Under normal conditions, subtitle data items that satisfy this condition are unique. In order to simplify the operation in the mobile device, the caption generator 106 can select the first caption data item that matches this condition, ignoring other items.
为了在多个字幕数据项中提高查找效率, 可以把字幕的存储顺序 设置为与字幕显示的先后顺序相一致, 对所有数据项按顺序给出从 0 开始的顺序编号, 然后可以采取以下的查找策略:  In order to improve the search efficiency in a plurality of subtitle data items, the storage order of the subtitles may be set to be consistent with the order in which the subtitles are displayed, and the order numbers starting from 0 are sequentially given to all the data items, and then the following search may be taken. Strategy:
在顺序播放的情况下, 每次处理时记录当前播放的数据项的序 号, 初始化时记录序号为 0。 在下个时钟信号到达时, 判断目前记录 序号对应的数据项是否符合条件。 如果不满足条件, 顺序判断其后第 一项、 第二项 数据项是否符合条件, 直到数据项序列的末尾。 这种方式在字幕数据本身正常, 时钟信号符合要求时可以最大程度减 少查找次数, 并且简化播放流程, 对系统资源的占用较少。  In the case of sequential playback, the serial number of the currently played data item is recorded each time it is processed, and the recording sequence number is 0 when initializing. When the next clock signal arrives, it is judged whether the data item corresponding to the current record number meets the condition. If the condition is not met, the order determines whether the first item and the second item of data are eligible until the end of the sequence of data items. In this way, when the subtitle data itself is normal, the clock signal can meet the requirements to minimize the number of searches, and the playback process is simplified, and the system resources are less occupied.
在另一个优选实施例中,要求字幕发生器 106能够配合主画面播 放设备实现内容的随机位置播放; 即用户可以选择实现不能预知的任 意位置开始播放内容。 在此情况下, 由于字幕数据项已经按时间顺序 排序, 我们可以按一种改进的二分搜索方式迅速查找符合要求的数据 项。 具体实现方式见图 3所示的查找流程。 此查找所需的时间复杂度 为 log2N,其中 N是数据项的总数目。使用此方法,当系统中存在 1000 个字幕数据项的情况下 (这是很大的数目, 一般常见的卡拉 OK内容 的字幕数据项总数不超过 100, 包括所有反复段落) , 所需的查找次 数不超过 10。  In another preferred embodiment, the caption generator 106 is required to enable random location playback of the content in conjunction with the home screen playback device; i.e., the user can choose to implement the content at any desired location that is not predictable. In this case, since the subtitle data items have been sorted in chronological order, we can quickly find the data items that meet the requirements in an improved binary search. The specific implementation is shown in the search process shown in Figure 3. The time complexity required for this lookup is log2N, where N is the total number of data items. Using this method, when there are 1000 subtitle data items in the system (this is a large number, the total number of subtitle data items of common karaoke content does not exceed 100, including all repeated paragraphs), the number of seeks required No more than 10.
接着,根据时钟信号所表示的当前时刻确定当前时刻的字幕变色 状态去定字幕的变色 (步骤 S203 ) 。 在一般情况下, 可以在字幕正 文中逐字判断文字是否变色, 然后每个字符分别输出。 但是, 这种方 法的效率较低, 会造成便携式设备系统中大量数据传递和接口调用。 本发明中, 字幕发生器 106根据每个数据项正文字符的数目, 以及该 数据项的起始和结束时间进行字幕变色处理。 如果该数据项的起始和 结束时间差为 d = te - ts, 而字幕的正文字符数目为 n, 当前时刻为 tx, 则在当前时刻, 字幕正文中已经变色的字符数目为: Next, the color change of the subtitle color at the current time is determined according to the current time indicated by the clock signal (step S203). In general, it is possible to judge whether the characters are discolored or not in the subtitle body text, and then output each character separately. However, this method is less efficient and can result in large amounts of data transfer and interface calls in portable device systems. In the present invention, the subtitle generator 106 performs caption color changing processing in accordance with the number of text characters of each data item and the start and end times of the data items. If the start and end of the data item The end time difference is d = te - ts, and the number of body characters of the subtitle is n, and the current time is tx. At the current moment, the number of characters that have changed color in the subtitle body is:
r = n * (tx - ts) / d  r = n * (tx - ts) / d
尚未变色的字符数目为: n - r  The number of characters that have not changed color is: n - r
字幕发生器 106按此数目将字幕正文分为前后两组,传送给系统 的字符发生器或图形设备分别进行字符输出。  The subtitle generator 106 divides the subtitle text into two groups according to this number, and the character generator or the graphic device transmitted to the system respectively performs character output.
以上方式仅适用于字幕中文件以均匀速度变色的情况。在很多情 况下, 字幕中的正文字符以不均匀的速度改变颜色, 但是仍符合音乐 节拍。 此时, 在存储字幕正文是引入一个占位字符, 一般采用字幕正 文中不常用的字符如波浪线( ~ ) , 在不同的实现方案中该占位字符 可以根据实施情况任选。 占位字符参与字符总数统计和变色字数计 算, 但是在显示输出时被过滤掉。 实践表明, 合理使用占位字符可以 模拟各种字幕的变色节奏。 由于在字幕发生器 106显示字幕时, 正文 中每个字符变色的时刻即为该字符的发音时刻, 则该字符发音的相对 时长由其后的占位字符的数目决定。 如果一个字符的发音时长是基本 节奏的三倍, 则在此字符后要求两个占位字符存在。 其余情况依此类 推。  The above method is only applicable to the case where the file in the subtitle is discolored at a uniform speed. In many cases, the body characters in the subtitles change color at an uneven speed, but still match the music beat. At this time, in storing the subtitle text, a placeholder character is introduced, and characters that are not commonly used in the subtitle body, such as a wavy line (~), are generally used. In different implementation schemes, the placeholder character may be selected according to the implementation. Placeholder characters participate in the calculation of the total number of characters and the number of color-changing words, but are filtered out when the output is displayed. Practice has shown that the rational use of placeholder characters can simulate the discoloration rhythm of various subtitles. Since the time at which each character in the body changes color is the pronunciation time of the character when the caption generator 106 displays the caption, the relative duration of the character's pronunciation is determined by the number of subsequent placeholder characters. If the length of a character's pronunciation is three times the basic rhythm, two placeholder characters are required after this character. The rest of the situation is like this.
接着, 字幕发生器 106在确定当前要显示的字幕数据项以及字幕 的变色状态之后, 输出具有所确定的变色状态的字幕(步骤 S204 ) 。 最后, 将主画面与字幕叠加合成最终画面 (步骤 S205 ) 。 此过程可 以调用便携式设备系统本身提供的字符发生器, 或图形输出设备来实 现。 字幕的输出过程使用数据项中指定的颜色。 在大多数情况下, 每 个字幕数据项包含的正文文本输出在一行上。 也可以根据便携式设备 提供的字体大小和可显示区域的宽度进行计算后在适 字符宽度自 动换行。  Next, after determining the subtitle data item to be displayed and the discoloration state of the subtitle, the subtitle generator 106 outputs the subtitle having the determined color change state (step S204). Finally, the main picture and the subtitle are superimposed to form a final picture (step S205). This process can be invoked by calling a character generator provided by the portable device system itself, or a graphical output device. The output process of the subtitle uses the color specified in the data item. In most cases, the text of the text contained in each caption data item is output on one line. It can also be automatically wrapped at the appropriate character width based on the font size provided by the portable device and the width of the displayable area.
在另一个优选实施例中, 字幕发生器 106可以根据内容需要或用 户选择, 或播放器的要求在适当位置显示当前字幕数据项之前或之后 的一项或多项数据。  In another preferred embodiment, the caption generator 106 can display one or more data before or after the current caption data item in the appropriate location, depending on the content needs or user selection, or the player's request.
图 3示出根据本发明一个实施例, 在图 2的查找步驟中使用二分 查找方法查找某一时刻对应的字幕数据项的详细流程图。 Figure 3 illustrates the use of a dichotomy in the lookup step of Figure 2, in accordance with one embodiment of the present invention. The search method finds a detailed flowchart of the subtitle data item corresponding to a certain moment.
如图 3中所示, 在步骤 S301执行初始化, 定义两个参数 1和 h, 其中 1表示查找范围的下限, 而 h表示查找范围的上限, 使得 1等于 0和并且 h等于末尾字幕数据项的序号。 请注意, 如上文所述, 字幕 数据项的序号按照将显示该字幕数据项的时间次序连续编号。在步骤 S302 , 通过计算 (1+h ) 12 取整得到一个序号, 取与该序号对应的字 幕数据项目。 接着执行步骤 S303 , 由于每个字幕数据项目都包含显 示该字幕数据项目的起始时间和结束时间, 因此可以根据该起始时间 和结束时间判断当前时间 tx是否在该字幕数据项目的时间范围内。如 果在该项目的时间范围内, 则当前字幕数据项目就是所要查找的当前 应当显示的项目, 从而执行步骤 S31 1, 结束当前查找过程并退出。 如果不在该项目的时间范围内, 则执行步骤 S304, 判断当前时间 tx 是否小于该项目的起始时间。 如果判断为 "是" , 则执行步骤 S307 , 调整查找范围的下限, 即 l=(l+h)/2+l并取整, 这样可以把查找范围为 原来的一半。 如果在步骤 S304的判断为 "否" , 则执行步骤 S305, 判断 tx是否大于该项目的结束时间。 如果步骤 S305 的判断结果为 "是" , 则执行步骤 S308 , 调整查找范围的上限, 即 h=(l+h)/2并取 整。 如果在步骤 S305的判断为 "否" , 则执行步骤 S306 , 表明数据 错误, 并且退出该查找流程。 步骤 S307和步骤 S308都进行到步骤 S309 , 判断 1是否小于 11。 如果判断结果为 "是" , 则表明还没有找 到当前应当播放的字幕数据项目, 并且返回到步骤 S302继续执行上 述查找过程, 否则把 1的取值的作为当前显示的字幕数据项目。  As shown in FIG. 3, initialization is performed in step S301, and two parameters 1 and h are defined, where 1 represents the lower limit of the search range, and h represents the upper limit of the search range such that 1 is equal to 0 and h is equal to the end caption data item. Serial number. Note that, as described above, the serial number of the subtitle data item is consecutively numbered in the chronological order in which the subtitle data item is to be displayed. In step S302, a sequence number is obtained by calculating (1+h) 12 and taking a subtitle data item corresponding to the sequence number. Next, in step S303, since each subtitle data item includes a start time and an end time for displaying the subtitle data item, it can be determined according to the start time and the end time whether the current time tx is within the time range of the subtitle data item. . If it is within the time range of the item, the current subtitle data item is the item that should be displayed currently to be searched, thereby executing step S31 1, ending the current search process and exiting. If it is not within the time range of the item, step S304 is performed to determine whether the current time tx is less than the start time of the item. If the determination is "Yes", step S307 is executed to adjust the lower limit of the search range, that is, l=(l+h)/2+l and rounded up, so that the search range is half of the original range. If the decision at step S304 is "NO", step S305 is performed to determine whether tx is greater than the end time of the item. If the answer of step S305 is "YES", step S308 is performed to adjust the upper limit of the search range, that is, h = (l + h) / 2 and round. If the decision at step S305 is "NO", step S306 is performed to indicate that the data is erroneous, and the search flow is exited. Step S307 and step S308 both proceed to step S309 to determine whether 1 is less than 11. If the result of the determination is "YES", it indicates that the subtitle data item that should be currently played has not been found, and the process returns to step S302 to continue the above-described search process, otherwise the value of 1 is taken as the currently displayed subtitle data item.
上文详细地描述了^ ^艮据本发明一个实施例的二分法查找当前字 幕数据项目的一种方法, 通过该方法可以快速地找到所需的字幕数据 项目, 减小计算的复杂度, 并且占用较少的硬件资源, 适合于便携设 备采用。 但是, 本领域的普通技术人员应当知道还可以采用各种常用 的查找方法来实现本发明的目的, 而这些查找方法都包含在由权利要 求书所定义的本发明的范围内。  A method for finding a current subtitle data item by a dichotomy according to an embodiment of the present invention is described in detail above, by which a desired subtitle data item can be quickly found, reducing computational complexity, and It occupies less hardware resources and is suitable for portable devices. However, it will be understood by those of ordinary skill in the art that the present invention may be practiced with a variety of conventional methods of simplification, which are included within the scope of the invention as defined by the appended claims.
下面参照图 4根据本发明一个实施例的字幕显示和变色过程。 图 4的流程在图 3的流程之后执行, 在执行图 4的流程之前已经找到当 前要显示的字幕数据项目。 Referring now to Figure 4, a caption display and color change process in accordance with one embodiment of the present invention. Figure The flow of 4 is performed after the flow of FIG. 3, and the caption data item currently to be displayed has been found before the flow of FIG. 4 is executed.
首先执行步骤 S401 , 按照上文所述的方法根据计时信息来确定 当前变色的字符个数, 从而在当前的字幕数据项目中区分出要变色的 字符和未变色的正常字符。 接着, 执行步骤 S402, 把要变色的字符 存储在变色字符缓冲区中, 并且执行步骤 S405 , 把未变色的正常字 符存储在正常字符緩沖区中。在随后的步骤 S403和步骤 S406中分别 从上述的两个緩沖区中滤除占位字符, 该占位字符如上文所述是为了 配合字幕显示的节拍而预先添加, 以便于计算字幕发生变色的位置, 该占位字符并不实际显示出来。步骤 S403和 S406也可以在填充对应 的字符緩冲区, 即步骤 S402、 S405的同时合并进行。 分别执行步骤 S404和步骤 S407, 计算文字输出的位置, 该步骤可以用本领域所公 知的方法来实现。 接着执行步骤 S408 , 分别把变色字符緩冲区和正 常字符緩冲区中的字符以及所计算的位置信息输出到字符输出设备, 该字符输出设备根据所接收的信息分别以不同颜色或方式输出变色 字符和正常字符。 随着音乐或画面的播放, 或者随着时间的进行, 变 色字符的个数发生变化。 因此在连续显示时, 可以获得卡拉 OK中字 幕变色的效果。  First, step S401 is executed to determine the number of characters currently discolored according to the timing information according to the method described above, thereby distinguishing the character to be discolored and the normal character not discolored in the current subtitle data item. Next, in step S402, the character to be changed is stored in the color-changing character buffer, and step S405 is executed to store the normal character that is not discolored in the normal character buffer. In the subsequent steps S403 and S406, the placeholder characters are respectively filtered out from the above two buffers, and the placeholder characters are added in advance to match the beat of the caption display as described above, so as to calculate the discoloration of the captions. Position, the placeholder character is not actually displayed. Steps S403 and S406 may also be performed while filling the corresponding character buffer, that is, steps S402 and S405. Steps S404 and S407 are respectively performed to calculate the position of the text output, and the step can be implemented by a method known in the art. Then, in step S408, the characters in the color-changing character buffer and the normal character buffer and the calculated position information are respectively output to the character output device, and the character output device outputs the color in different colors or manners according to the received information. Characters and normal characters. As the music or picture is played, or as time progresses, the number of color-changing characters changes. Therefore, in continuous display, the effect of color change in the karaoke can be obtained.
上文参照图 4 描述的字符变色的处理方法也可以有其他变型方 式, 例如占位字符可以用对每个字幕字符的时间加权值来代替。 每个 要显示的字幕字符可以对应一个加权值, 该加权值的大小表示该字幕 字符要显示的时间。这样也可以用类似于上文所述的方式来获得当前 正在变色的字幕字符信息。 因此, 除了图 4所示的流程之外, 还可以 有许多不同的方法来实现字幕变色的过程。  The method of processing the character discoloration described above with reference to Fig. 4 may also have other variations, for example, the placeholder character may be replaced with a time weighting value for each subtitle character. Each subtitle character to be displayed may correspond to a weighting value indicating the time at which the subtitle character is to be displayed. This also makes it possible to obtain subtitle character information that is currently changing color in a manner similar to that described above. Therefore, in addition to the flow shown in Fig. 4, there are many different ways to implement the process of subtitle discoloration.
下面具体说明可以在本发明中采用的字幕数据的内容和数据结 构。  The content and data structure of the caption data which can be employed in the present invention will be specifically described below.
根据目前普遍的便携式设备的系统结构, 字幕数据的字段安排如 下:  According to the system structure of the currently popular portable device, the fields of the caption data are arranged as follows:
字幕显示的起始时间和结束时间。 采用 32位或 16位二进制整数 存储, 如果采用 32位整数存储, 则时间单位为 1八 000或 1/1024秒; 如果采用 16位整数存储, 则时间单位推荐为 1/100秒,可以适用于长 度在 10分 55秒之内的音乐, 满足大部分的卡拉 OK音乐要求的长度 条件。 The start time and end time of the subtitle display. Use 32-bit or 16-bit binary integers Storage, if 32-bit integer storage is used, the time unit is 1880 or 1/1024 seconds; if 16-bit integer storage is used, the time unit is recommended to be 1/100 second, which can be applied to a length of 10 minutes and 55 seconds. The music meets the length requirements of most karaoke music requirements.
字幕的正常显示颜色和变色后的颜色, 一般可以使用 24位 RGB 值, 8位系统定义的调色板入口值, 16位或 8位 RGB值存储, 按系 统具体情况而定。 在某些实现方式中, 由于采用固定的显示颜色, 或 字幕的显示颜色由后期系统定制, 可以选择性存储或不存储这两个字 段。  The normal display color of the subtitles and the color after the color change can generally be stored using 24-bit RGB values, 8-bit system-defined palette entry values, 16-bit or 8-bit RGB values, depending on the system. In some implementations, the two fields may be selectively stored or not stored due to the fixed display color, or the display color of the subtitles being customized by the later system.
字幕正文文本, Unicode编码 (UTF-16或 UTF-8 ) , 以数字 0结 尾的字符串。在某些实施方式中为了加快解析速度可以在字符串前加 上一个 8位或 16位的字符串长度字段, 这种方式需要一些额外的存 储空间。  Subtitle body text, Unicode encoding (UTF-16 or UTF-8), a string ending with a number 0. In some embodiments, in order to speed up the parsing, an 8-bit or 16-bit string length field can be added before the string, which requires some extra storage space.
从数据解析的效率出发,每个数据项固定长度的数据字段最好安 排在数据项的前面出现, 而可变长度的字段(如字幕正文)在数据项 的后面出现, 这样便于数据项的序号指定和管理查找。 当然在不同的 实施方案中, 这些数据字段的顺序是可以交换并引入新的额外数据字 段的。 在某些便携式设备中, 多字节的数据字段需要在 2字节边界或 4字节边界对齐。  From the efficiency of data parsing, the data field of fixed length of each data item is preferably arranged in front of the data item, and the variable length field (such as the subtitle body) appears behind the data item, so that the serial number of the data item is facilitated. Specify and manage lookups. Of course, in different implementations, the order of these data fields can be exchanged and new new data fields can be introduced. In some portable devices, multibyte data fields need to be aligned on a 2-byte boundary or a 4-byte boundary.
为了进一步节约存储空间, 字幕数据可以使用某种压缩方式单独 压缩存储, 或和主画面数据整体压缩存储。 这样字幕发生器 106在处 理字幕数据之前需要调用相应的装置或接口对数据解压缩。  In order to further save storage space, the subtitle data can be separately compressed and stored using a certain compression method, or compressed and stored integrally with the main picture data. Thus, the caption generator 106 needs to call the corresponding device or interface to decompress the data before processing the caption data.
字幕发生器 106可以使用单独的时钟定时器, 或与便携式设备系 统的其他组件一起共用某个时钟信号。 在此便携式设备系统或主画面 播放器应在条件允许的情况下尽可能按时将时钟信号传递到字幕发 生器 106中。 一般地, 字幕发生器 106在主画面处理完毕后进行字幕 的显示, 这样字符总是可见地显示在主画面的上层。 在某些特殊的实 施方式中, 例如(但不限于)在一些矢量动画播放器中, 字幕发生器 106作为动画播放器的一个组件, 在动画渲染过程中的某个时间接收 到时钟信号, 这样字幕的显示可能被动画的某些部分所遮盖。 The subtitle generator 106 can use a separate clock timer or share a certain clock signal with other components of the portable device system. In this case, the portable device system or the home screen player should pass the clock signal to the caption generator 106 as soon as possible, if possible. Generally, the subtitle generator 106 displays the subtitles after the main screen is processed, so that the characters are always visibly displayed on the upper layer of the main screen. In some particular implementations, such as, but not limited to, in some vector animation players, the caption generator 106 acts as a component of the animation player and receives some time during the animation rendering process. To the clock signal, the display of such subtitles may be obscured by certain parts of the animation.
在下文中将描述根据本发明的字幕生成方法和设备对暂停和恢 复播放以及随机播放功能的实现方式。  The implementation of the pause and resume play and random play functions of the caption generation method and apparatus according to the present invention will hereinafter be described.
在本发明的一个实施例中, 字幕发生器 106可以根据需要支持播 放的暂停和恢复播放功能。 用户选择暂停内容播放后, 系统其他组件 向字幕发生器 106发出暂停信号。 系统可以关闭通向字幕发生器 106 的时钟信号, 此时系统应提供单独的时钟计数; 或者系统可以继续向 字幕发生器 106发送时钟信号, 由字幕发生器 106完成时钟计数。 字 幕发生器 106在接收到暂停信号后在内部设置暂停标记, 此后到收到 恢复信号前, 如杲接收到时钟信号均不处理。  In one embodiment of the invention, the caption generator 106 can support the pause and resume play functions of the play as needed. After the user chooses to pause the content playback, the other components of the system issue a pause signal to the caption generator 106. The system can turn off the clock signal to the caption generator 106, at which point the system should provide a separate clock count; or the system can continue to send a clock signal to the caption generator 106, which is clocked by the caption generator 106. The caption generator 106 internally sets a pause flag after receiving the pause signal, and thereafter does not process the clock signal until the recovery signal is received.
在用户恢复画面播放后, 系统向字幕发生器 106发出恢复播放信 号。 字幕发生器 106接收到此信号, 清除内部的暂停标记, 在下一个 时钟信号到达时继续对字幕的处理和显示。 在此过程中需要注意对音 乐开始播放的时刻 t0的处理。 假设暂停时刻为 tp, 恢复时刻为 tr, 则 修改 t0值为 t0+tr-tp。 否则如果不扣除暂停时期的等待时间, 恢复播 放时会出现字幕不同步的现象。  After the user resumes the playback of the screen, the system issues a resume playback signal to the subtitle generator 106. The subtitle generator 106 receives this signal, clears the internal pause flag, and continues processing and displaying the subtitle as the next clock signal arrives. In this process, attention should be paid to the processing of the time t0 at which the music starts to play. Assuming that the pause time is tp and the recovery time is tr, then the t0 value is modified to t0+tr-tp. Otherwise, if the waiting time of the pause period is not deducted, the subtitles will be out of sync when the playback resumes.
在本发明的另一个实施例中, 字幕发生器 106可以根据需要支持 随机播放。 用户可以选择从内容的事先未预知的任意位置开始播放。 在这种情况下, 主画面和内容播放器应该从音乐播放设备中取得音乐 在指定播放位置的, 从音乐开头计算的时间, 将此时间输入到字幕发 生器 106中。 字幕发生器 106按当前时刻, 输入的目标时间计算出播 放的起始时刻 to 并储存, 然后查找目标时间对应的字幕数据项并显 示。  In another embodiment of the invention, the caption generator 106 can support random play as needed. The user can choose to start playing from any location that is not previously predicted by the content. In this case, the main screen and the content player should retrieve the time from the music playing device to the subtitle generator 106 at the time specified by the beginning of the music at the specified playback position. The subtitle generator 106 calculates the start time to of the playback according to the current time, the input target time, and stores it, and then searches for the subtitle data item corresponding to the target time and displays it.
在本发明的一些实施例中, 系统可以根据需要定义字幕的实际显 示位置。 显示位置可以定义一个参考点坐标(显示区域的像素数值坐 标或比例坐标) , 并定义字幕显示的外包矩形相对于此参考坐标的对 齐关系。 一般情况下有 9种对齐方式可以使用: 左上对齐,左中对齐, 左下对齐, 中上对齐, 中心对齐, 中下对齐, 右上对齐, 右中对齐, 右下对齐。 例如, 可以定义歌词在屏幕的正中下方 4/5处按中心对齐 显示。字幕在显示时,不论正文的显示宽度如何变化,字幕发生器 106 都会自动计算并调整显示位置, 达到中心对齐的效果。 系统也可以定 义其他的字幕显示定位方式。 In some embodiments of the invention, the system can define the actual display location of the subtitles as desired. The display position can define a reference point coordinate (pixel numerical coordinate or proportional coordinate of the display area) and define an alignment relationship of the outer rectangle of the subtitle display relative to the reference coordinate. In general, there are 9 kinds of alignments that can be used: top left alignment, left center alignment, bottom left alignment, upper middle alignment, center alignment, bottom alignment, top right alignment, right center alignment, right bottom alignment. For example, you can define the lyrics to be centered at 4/5 below the center of the screen. Display. When the subtitle is displayed, regardless of how the display width of the text changes, the subtitle generator 106 automatically calculates and adjusts the display position to achieve the center alignment effect. The system can also define other subtitle display positioning methods.
如果显示位置随时间在每个时钟信号到达时变化, 则可以实现字 幕移动的效果。 字幕的移动轨迹可以按制作需要预先储存, 或通过一 个时间相关的函数计算得到。  If the display position changes with time as each clock signal arrives, the effect of the word shift can be achieved. The movement of the subtitles can be pre-stored as needed for production, or calculated by a time-dependent function.
在基本的显示方式基础上, 基于本发明的字幕发生器 106在系统 资源许可的情况下可以扩展其他字符显示效果, 如空心文字, 边缘颜 色增强, 阴影, 旋转, 淡入淡出等效果。 这些效果不改变基本的字幕 显示和文字变色节奏控制原理。  Based on the basic display mode, the caption generator 106 based on the present invention can expand other character display effects, such as hollow text, edge color enhancement, shadow, rotation, fade, etc., when the system resource permits. These effects do not change the basic subtitle display and text color rhythm control principles.
图 5示出根据本发明一个实施例的字幕生成设备 50的结构示意 图。 该图中所示的字幕生成设备 50与图 1 中所示的字幕发生器 106 之间的主要区别在于图 5所示的字幕生成设备 50还包括时钟信号产 生装置 501 , 其对应于图 1 中的系统定时器 102, 并且还包括用于把 字幕与主画面相重叠的合成装置 505 , 其对应于图 1 中的图形和字符 输出设备接口 107。 由于包含上述两个装置, 图 5的所示的字幕生成 设备的结构更加独立和完整。 如图 5中所示, 该字幕生成设备包括时 钟信号产生装置 501、 查找装置 502、 字幕存储器 503、 变色状态确定 装置 504和合成装置 505。所述时钟信号产生装置 501产生时钟信号, 并且提供到查找装置 502和变色状态确定装置 504。 查找装置 502根 据来自时钟信号产生装置 501的时钟信号从字幕存储器 503中查找当 前时刻应当显示的字幕数据项目, 并且把找到的字幕数据项目提供到 变色状态确定装置 504。 该变色状态确定装置 504根据来自时钟信号 产生装置 501的时钟信号和来自查找装置 502的字幕数据项目分为变 色的字符和正常的字符, 并将分别用不同的颜色来显示。 该确定变色 状态后的字幕数据项目被提供到合成装置 505。 该合成装置 505同时 接收来自当前要显示的主画面, 并且把确定变色状态的字幕叠加在该 主画面上, 从而输出合成图像, 并显示出来。  Fig. 5 shows a schematic structural view of a caption generating device 50 according to an embodiment of the present invention. The main difference between the caption generating device 50 shown in the figure and the caption generator 106 shown in FIG. 1 is that the caption generating device 50 shown in FIG. 5 further includes a clock signal generating device 501 corresponding to FIG. The system timer 102, and also includes a synthesizing device 505 for overlaying the subtitles with the main picture, which corresponds to the graphics and character output device interface 107 of FIG. Since the above two devices are included, the structure of the caption generating device shown in Fig. 5 is more independent and complete. As shown in Fig. 5, the subtitle generating apparatus includes a clock signal generating means 501, a looking means 502, a subtitle memory 503, a color change state determining means 504, and a synthesizing means 505. The clock signal generating means 501 generates a clock signal and supplies it to the finding means 502 and the color changing state determining means 504. The finding means 502 searches the caption memory 503 for the caption data item which should be displayed at the current time based on the clock signal from the clock signal generating means 501, and supplies the found caption data item to the color changing state determining means 504. The color change state determining means 504 is divided into color-changing characters and normal characters based on the clock signal from the clock signal generating means 501 and the caption data item from the search means 502, and will be displayed in different colors, respectively. The caption data item after the color change state is determined is supplied to the synthesizing device 505. The synthesizing means 505 simultaneously receives the main picture to be displayed from the present, and superimposes the subtitle which determines the discoloration state on the main picture, thereby outputting the synthesized picture and displaying it.
图 5所示的字幕生成设备也可以有其他变型, 例如在图 5中的字 幕存储器 503可以被包含在查找装置 502中, 时钟信号产生装置 501 所产生的时钟信号也可以由该字幕生成设备的外部提供。 The subtitle generating device shown in FIG. 5 can also have other variations, such as the word in FIG. The screen memory 503 can be included in the lookup device 502, and the clock signal generated by the clock signal generating device 501 can also be provided externally by the caption generating device.
上文已经参照附图详细地描述根据本发明的字幕生成方法和设 备, 但是本领域的普通技术人员应当知道不脱离本发明的构思和范围 可以做出许多其它改变和改型。 应当理解, 本发明不限于特定的实施 方式, 本发明的范围由所附权利要求限定。  The subtitle generating method and apparatus according to the present invention have been described in detail above with reference to the accompanying drawings, but those skilled in the art will recognize that many other changes and modifications can be made without departing from the spirit and scope of the invention. It is to be understood that the invention is not limited to the specific embodiment, and the scope of the invention is defined by the appended claims.

Claims

1. 一种同步字幕生成方法, 包括以下步骤: A method for generating a synchronized subtitle, comprising the following steps:
产生时钟信号;  Generating a clock signal;
根据所述时钟信号所表示的计时信息查找对应的当前时刻要显 示的字幕数据;  And searching for the caption data to be displayed at the current moment according to the timing information represented by the clock signal;
根据所述时钟信号所表示的计时信息确定当前时刻的字幕变色 状态;  Determining a color change state of the subtitle at the current time according to the timing information represented by the clock signal;
基于该变色状态和所查找的字幕数据输出字幕; 以及  Outputting subtitles based on the color change state and the subtitle data found;
将主画面和所述字幕叠加合成最终画面。  The main picture and the subtitle are superimposed to form a final picture.
2. 根据权利要求 1 所述的同步字幕生成方法, 其中将所述字幕 数据分为多个字幕数据项, 每个字幕数据项包含在一段时间内显示的 字幕信息, 以及将显示该字幕数据的起始时间和结束时间。  2. The synchronized subtitle generating method according to claim 1, wherein the subtitle data is divided into a plurality of subtitle data items, each subtitle data item includes subtitle information displayed over a period of time, and the subtitle data is to be displayed. Start time and end time.
3. 根据权利要求 2所述的同步字幕生成方法, 其中在所述查找 字幕数据的步骤中通过判断当前时刻落在哪一个字幕数据项的起始 时间和结束时间之间的时间段内而确定所需的字幕数据项。  3. The synchronized subtitle generating method according to claim 2, wherein in the step of searching for subtitle data, it is determined by determining a time period between a start time and an end time of which subtitle data item the current time point falls The required subtitle data item.
4. 根据权利要求 3所述的同步字幕生成方法, 其中所述字幕数 据项按照播放的先后次序顺序存储, 所述查找字幕数据的步骤按照字 幕数据项播放的先后次序逐一查找, 或者按照二分法来查找。  4. The synchronized subtitle generating method according to claim 3, wherein the subtitle data items are sequentially stored in a play order, and the step of searching for subtitle data is searched one by one according to a sequence in which the subtitle data items are played, or according to a dichotomy Come find it.
5. 根据权利要求 2所述的同步字幕生成方法, 其中所述字幕数 据项在每个要显示的字符之前或之后还包括与该字符显示的时间长 度相对应的一个或多个占位符。  The synchronized subtitle generating method according to claim 2, wherein the subtitle data item further includes one or more placeholders corresponding to the time length of the character display before or after each character to be displayed.
6. 根据权利要求 2或 5所述的同步字幕生成方法, 其中所述确 定变色状态的步骤根据每个字幕数据项包舍的字符数、该字幕数据项 的起始和结束时间、 以及当前时刻来确定要正在进行字幕变色的字  The synchronized subtitle generating method according to claim 2 or 5, wherein the step of determining a discoloration state is based on a number of characters of each subtitle data item, a start and end time of the subtitle data item, and a current time To determine the word to be subtitled
7. 根据权利要求 6所述的同步字幕生成方法, 其中由所确定的 正在变色的字符把当前字幕数据项分为两个部分, 分别用不同的颜色 或式样来显示。 7. The synchronized subtitle generating method according to claim 6, wherein the current subtitle data item is divided into two parts by the determined character that is changing color, respectively, using different colors Or style to display.
8. 根据权利要求 1 所述的同步字幕生成方法, 其中在暂停画面 的播放时, 暂停产生所述时钟信号, 并且在恢复画面的播放时恢复该 时钟信号。 '  8. The synchronized subtitle generating method according to claim 1, wherein the clock signal is paused when the playback of the screen is paused, and the clock signal is restored when the playback of the screen is resumed. '
9. 一种同步字幕生成设备, 包括以下装置:  9. A synchronized subtitle generating device, comprising the following devices:
用于产生时钟信号的时钟信号产生装置;  a clock signal generating device for generating a clock signal;
查找装置, 用于根据所述时钟信号的计时信息查找对应的当前时 刻应显示的字幕数据;  a searching device, configured to search, according to the timing information of the clock signal, the caption data that should be displayed at the current moment;
变色状态确定装置, 用于根据所述时钟信号的计时信息确定当前 时刻的字幕变色状态, 并且根据该变色状态和所查找的字幕数据输出 字幕; 以及  a color change state determining means, configured to determine a color change state of the subtitle at the current time according to the timing information of the clock signal, and output the subtitle according to the color change state and the searched caption data;
合成装置, 用于将主画面和所述字幕叠加合成最终画面。  a synthesizing device, configured to superimpose the main picture and the subtitle into a final picture.
10. 根据权利要求 9所述的同步字幕生成设备, 其中将所述字幕 数据分为多个字幕数据项, 每个字幕数据项包含在一段时间内显示的 字幕信息以及将显示该字幕数据的起始时间和结束时间。  10. The synchronized subtitle generating apparatus according to claim 9, wherein the subtitle data is divided into a plurality of subtitle data items, each subtitle data item including subtitle information displayed over a period of time and a subtitle data to be displayed Start time and end time.
1 1. 根据权利要求 10所述的同步字幕生成设备, 其中所述查找 装置通过判断当前时刻落在哪一个字幕数据项的起始肘间和结束时 间之间的时间段内而确定所需的字幕数据项。  1 1. The synchronized subtitle generating apparatus according to claim 10, wherein said searching means determines the required time by judging which time period between the start elbow and the end time of the caption data item of the current time point Subtitle data item.
12. 根据权利要求 1 1 所述的同步字幕生成设备, 其中所述字幕 数据项按照播放的先后次序顺序存储, 所述查找装置按照字幕数据项 播放的先后次序逐一查找, 或者按照二分法来查找。  12. The synchronized subtitle generating device according to claim 1, wherein the subtitle data items are sequentially stored in a play order, and the searching device searches one by one according to a sequence in which the subtitle data items are played, or searches according to a binary method. .
13. 根据权利要求 10所述的同步字幕生成设备, 其中所述字幕 数据项在每个要显示的字符之前或之后还包括与字符显示的时间长 度相对应的一个或多个占位符。  13. The synchronized subtitle generating apparatus according to claim 10, wherein the subtitle data item further includes one or more placeholders corresponding to the time length of the character display before or after each character to be displayed.
14. 根据权利要求 10或 13所述的同步字幕生成设备, 其中所述 变色状态确定装置根据每个字幕数据项包含的字符数、该字幕数据项 的起始和结束时间、 以及当前时刻来确定要正在进行字幕变色的字 付  The synchronized subtitle generating apparatus according to claim 10 or 13, wherein the discoloration state determining means determines the number of characters included in each subtitle data item, the start and end time of the subtitle data item, and the current time. To pay for the subtitle color change
15. 根据权利要求 14所述的同步字幕生成设备, 其中由所确定 的正在变色的字符把当前字幕数据项分为两个部分, 分别用不同的颜 色或式样来显示。 15. The synchronized subtitle generating device according to claim 14, wherein The character that is changing color divides the current subtitle data item into two parts, which are respectively displayed in different colors or styles.
16. 根据权利要求 9所述的同步字幕生成设备, 其中在暂停画面 的播放时, 所述时钟信号产生装置暂停产生所述时钟信号, 并且在恢 复画面的播放时恢复该时钟信号。  16. The synchronized subtitle generating apparatus according to claim 9, wherein the clock signal generating means suspends the generation of the clock signal when the playback of the picture is paused, and restores the clock signal upon playback of the resume picture.
PCT/CN2005/000581 2005-04-27 2005-04-27 Synchronous caption generating method and device that can be used in portable device WO2006114021A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2005/000581 WO2006114021A1 (en) 2005-04-27 2005-04-27 Synchronous caption generating method and device that can be used in portable device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2005/000581 WO2006114021A1 (en) 2005-04-27 2005-04-27 Synchronous caption generating method and device that can be used in portable device

Publications (1)

Publication Number Publication Date
WO2006114021A1 true WO2006114021A1 (en) 2006-11-02

Family

ID=37214415

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2005/000581 WO2006114021A1 (en) 2005-04-27 2005-04-27 Synchronous caption generating method and device that can be used in portable device

Country Status (1)

Country Link
WO (1) WO2006114021A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110895457A (en) * 2018-09-13 2020-03-20 浙江宇视科技有限公司 Character display method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5089899A (en) * 1989-06-29 1992-02-18 Pioneer Electronic Corporation Recording medium playing apparatus which permits changes in the display position of a reproduced image
JPH10282971A (en) * 1997-04-01 1998-10-23 Daiichi Kosho:Kk Method for instructing singing timing in lyrics display system of karaoke device
CN1489369A (en) * 2003-08-11 2004-04-14 安凯(广州)软件技术有限公司 Karaoke making method and playing method for wireless network and wireless hand-held device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5089899A (en) * 1989-06-29 1992-02-18 Pioneer Electronic Corporation Recording medium playing apparatus which permits changes in the display position of a reproduced image
JPH10282971A (en) * 1997-04-01 1998-10-23 Daiichi Kosho:Kk Method for instructing singing timing in lyrics display system of karaoke device
CN1489369A (en) * 2003-08-11 2004-04-14 安凯(广州)软件技术有限公司 Karaoke making method and playing method for wireless network and wireless hand-held device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110895457A (en) * 2018-09-13 2020-03-20 浙江宇视科技有限公司 Character display method and device and electronic equipment
CN110895457B (en) * 2018-09-13 2024-02-02 浙江宇视科技有限公司 Character display method and device and electronic equipment

Similar Documents

Publication Publication Date Title
US10434420B2 (en) Music game software and input device utilizing a video player
CA2772021C (en) Storage medium having interactive graphic stream and apparatus for reproducing the same
KR102319456B1 (en) Method for reproduing contents and electronic device performing the same
US20060210245A1 (en) Apparatus and method for simultaneously utilizing audio visual data
CN103165152B (en) Method and device for playing multi-media file
US20050180462A1 (en) Apparatus and method for reproducing ancillary data in synchronization with an audio signal
KR20070091962A (en) Method for offerring naration of data channel dmb using animation and recording media implementing the same
CA2495871C (en) Information storage medium containing interactive graphics stream for change of av data reproducing state, and reproducing method and apparatus thereof
CN110505511A (en) It is a kind of to play the method, apparatus of video, system in webpage and calculate equipment
TW200529202A (en) Storage medium recording text-based subtitle stream, reproducing apparatus and reproducing method for reproducing text-based subtitle stream recorded on the storage medium
KR102319462B1 (en) Method for controlling playback of media contents and electronic device performing the same
KR101577012B1 (en) Method of composing multimedia data and video player for playing moving pictures in an android operating system
CN107864393A (en) The method and device that video is shown with captioning synchronization
US6249640B1 (en) System and method for rapidly decoding sub-pictures in a DVD player
JP5310808B2 (en) Subtitled video playback device and subtitled video playback program
WO2006114021A1 (en) Synchronous caption generating method and device that can be used in portable device
JP2006270139A (en) Data reproducer and data reproducing method and system
JP2013126184A (en) Content playback device, control method therefor, control program, and content display control device
CN115119030A (en) Subtitle processing method and device
JP2010217898A (en) Caption display method
WO2021235525A1 (en) Content playback program and content playback device
KR20090049672A (en) Mobile contents playing device with play point selection function by selecting script and method for the same
US20090060454A1 (en) Playback apparatus, playback method, and format
KR20120039999A (en) Multimedia player and method for setting subtitles thereof
JP2004226701A (en) Marking apparatus and method, and data outputting apparatus and method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
NENP Non-entry into the national phase

Ref country code: DE

WWW Wipo information: withdrawn in national office

Country of ref document: DE

NENP Non-entry into the national phase

Ref country code: RU

WWW Wipo information: withdrawn in national office

Country of ref document: RU

122 Ep: pct application non-entry in european phase

Ref document number: 05743404

Country of ref document: EP

Kind code of ref document: A1