Summary of the invention
Technical problem to be solved by this invention is: improve the treatment effeciency of digital caption data in television terminal equipment.
The present invention solves the problems of the technologies described above the technical scheme that is adopted to be:
A kind of method that improves television terminal device digital caption data processing efficiency may further comprise the steps:
A, television terminal equipment receive and filter out subtitle data stream from the TV signal transport stream;
B, when television terminal equipment is decoded to subtitle data stream, with former frame captions view data, captions character data and positional information are set to the reference frame information of back one frame captions, when the present frame caption data arrives, at first by comparison to present frame and reference frame captions character data, judge the degree of association between present frame and the reference frame, and will directly copy on the correct position of present frame with the consecutive identical captions view data of present frame in the reference frame captions image, and then calculate and draw the present frame residual image, thereby obtain complete captions image of present frame and demonstration;
C, repeating step B finish until subtitle data stream.
Described method, wherein: the caption object data that the described television terminal equipment of steps A receives from the TV signal transport stream in the caption data are the data that encapsulate with textual form.
Described method, wherein: initial/end coordinate data that described subtitle position information shows for the captions character, described step B may further comprise the steps:
B1, by the level of adjacent two frames in the described subtitle data stream or the changes in coordinates of vertical direction, determine the direction of motion of subtitle data stream;
B2, initial/end coordinate data that former frame captions view data, captions character data and character show reference frame information for back one frame captions is set, and judges whether present frame has reference frame; If there is not reference frame, directly calculate and draw present frame captions image, reference frame is arranged, then change step B3 over to;
B3, calculate the degree of association between present frame and the reference frame, if the two degree of association is zero, directly calculate and draw present frame captions image, if the two degree of association then changes step B4 over to greater than zero according to the captions character data of reference frame;
B4, calculate the position of associated images piece in present frame in the reference frame, and the captions view data of associated images piece is directly copied on the present frame tram;
B5, calculating are also drawn the residual image that present frame does not have drafting, obtain the complete captions image of present frame;
B6, the complete captions image of demonstration present frame, and note initial/end coordinate data that present frame captions view data, captions character data and character show, as the reference frame of back one frame captions.
Described method, wherein: the degree of association between described present frame and the reference frame represents that the amount of consecutive identical image block in its two frame accounts for the ratio of current frame image data volume, when the degree of association greater than zero the time, the image block that has consecutive identical information between present frame and the reference frame, when the degree of association is zero, there is not the image block of consecutive identical information between present frame and the reference frame.
Beneficial effect of the present invention is: the present invention is because when decoding to the caption object data, adopted the method for forward reference caption frame view data, reduce the decode time of every frame captions significantly, solved television terminal equipment decoding many bottleneck difficult problems consuming time; And because the caption object data encapsulate with text mode in the subtitle data stream that television terminal equipment receives, compare the encapsulation of caption object The data image mode, for identical captions business, then reduced the data volume (in subtitle data stream caption object data account for most ratios) of captions business in transport stream significantly, made the process of television terminal equipment caption data in reception, filter transport stream rapider and timely.Above measure has improved the treatment effeciency of caption data in television terminal equipment widely, makes television terminal equipment such as set-top box use a spot of system resource also can realize facile motion captions business function, and method of the present invention meets the captions standard simultaneously.
Embodiment
With embodiment the present invention is described in further detail with reference to the accompanying drawings below:
Broadcasting by captions broadcasting system in the front-end server of caption data undertaken, and the captions front end system that meets DVB Subtitle standard usually can both be selected with image or text mode encapsulation caption object data.Television terminal equipment (as set-top box) at first will receive, filter out target captions business datum from the TV signal transport stream, and the captions business data flow mainly comprises page data, area data, color data, caption object data, and the caption object data are resolved and decodes according to DVB Subtitle standard.According to DVB Subtitle standard, the picture of each captions business carries out absolute coding, broadcasts for unit frame by frame on time series, before and after saying from captions picture data angle is what it doesn't matter between the frame, does not have dependence, and this and common video data are distinguishing.Therefore in set-top box, can on OSD, show according to each frame caption data of receiving generation captions picture image of decoding naturally.Because generally may include a plurality of character display, literal in every frame captions, after set-top box is received these characters, lteral data, also need by calling captions picture reduction that character library forms these characters, literal, be drawn in the internal memory, and then give OSD and show.Obviously whenever finish such frame captions view data and handle, need a large amount of computing of experience, consume more system resources, take the most of the time in the captions processing procedure.We can say that the speed of caption object data decode generation caption frame image has directly reflected the ability of set-top box processes captions business, is the place of the bottleneck of processing caption data in the set-top box.Therefore, how reducing the caption object data decode and generate operand in the caption frame view data process, is to improve caption data treatment effeciency core problem the most in television terminal equipment.In order to have improved the treatment effeciency of caption data in television terminal equipment, the present invention has adopted following technological means:
The first, the digital caption front-end server encapsulates the caption object The data textual form in the current captions business; Set-top box receives subtitle data stream, and passes through the caption object data of decoding text type, generates the every frame image data of captions and goes up demonstration at OSD (On Screen Display).This had both met DVB Subtitle standard-required, and the broadcasting system of general subtitle server end supports that all caption object encapsulates with text mode.The caption object data encapsulate, broadcast under the condition with text mode in the caption data, for the captions business that equates, the data volume of captions business can reduce significantly in transport stream, so, reduced the burden that captions receive, filter in the set-top box widely, the set-top box end also carries out the reception and the identification of text subtitle object data easily simultaneously, this process is simple, speed is also very fast, lay a good foundation for improving the processing speed of caption data in set-top box, a spot of device resource just can be met the demands.
The second, in to the caption data that obtains, the caption object data of textual form are carried out in the process of decoding processing, the present invention fully analyze, utilize the gradual change that shows on the characteristics of roll titles operation and continuity that the captions business shows in time and the change in location, progressive, gradually move back rule with isometry, frame existed similitude and correlation before and after these factors caused captions.On this analysis result basis, invented the processing method of " forward reference caption frame view data ", in the hope of significantly reducing the amount of calculation that generates every frame captions view data, reach the purpose that improves motion processing caption data efficient in the terminal.Demonstrated a motion captions rolling process simply from left to right among Fig. 2,, only selected four characters and the step-length that the standard Chinese character width is the captions motion for the ease of demonstration.Though actual conditions are more many than this complexity, also satisfy the shown rule of Fig. 2.From Fig. 2, can find out significantly between the frame of captions front and back good similitude is arranged, there are many continuous images pieces can be multiplexing in subsequent frame in the former frame captions image, just will calculate these reusable consecutive image BOB(beginning of block)/end position and positions in next frame.When arriving frame 2 as frame among Fig. 21, only need three character pictures (captions are drilled) of having decoded in the frame 1 be mapped in the image area of frame 2, a character of new decoding (showing) is just much of that again, and this has lacked many amounts of calculation than four characters of brand-new decoding (captions demonstration).And do not have a gap that character is big like this between two frames before and after in the actual conditions, have only tens of a character/several, i.e. the skew of several pixels and difference are so need the new image of drawing still less between the frame of front and back.Can see also that simultaneously consecutive identical image block is along with the variation of variation position in the viewing area of time also has tangible relevance, all be with etc. the motion of step-length when losing (frame data occur except) in the viewing area, up to all withdrawing from the viewing area.
The principle of " forward reference caption frame view data " method is fully to analyze on the basis of roll titles operation characteristic, utilize the similitude and the relevance of identical image piece on time and space of view data in the motion captions image sequence, initial/end coordinate data that record present frame captions view data, captions character data and character show make present frame captions view data become the basis that generates next frame captions image as the reference frame information of frame captions subsequently.When the next frame caption data arrives, the first relatively similitude of it and previous frame (reference frame) captions, calculate the degree of association between the two, the described degree of association is the ratio that the amount of consecutive identical image block in two frames of front and back accounts for the current frame image data volume, the quantity that has consecutive identical captions character before and after expressing in two frames, the consecutive identical order of representing that then captions character and character occur is identical.Whether have in the degree of association sign reference frame image can directly multiplexing image block.When the degree of association greater than zero the time, the image block of consecutive identical information is arranged between present frame and the reference frame, when the degree of association is zero or when very little, do not have between present frame and the reference frame or the image block of seldom consecutive identical information.Because each frame captions image in each frame captions character association, so at an easy rate the calculating between the two dimensional image of complexity has been converted to the character comparison of one dimension.Subsequently part identical with this frame in the view data of previous frame captions is directly copied to present frame, handle the picture material that current caption frame increases newly or reduces again, make in the decoding of present frame only calculate, decoding and draw the captions image block part of changing unit, thereby finish the decoding of current caption frame image.Present frame as the basis of drawing the next frame captions, goes round and begins again like this and carries out the decoding of caption frame more then.Under such decode procedure, because multiplexing most possibly captions video data block of having decoded in the reference frame, current caption frame needs the image block of new decoding, drafting to reduce, thereby the operand that generates present frame captions image is significantly reduced, reach and reduce every needed time of frame caption decoding significantly, the processing method of " forward reference caption frame view data " becomes an important ring that improves processing caption data efficient.
Below with reference to Fig. 3, be described in detail the concrete steps of the inventive method:
1, television terminal equipment receives and filters out subtitle data stream from the TV signal transport stream, and the caption object data are the data with the textual form encapsulation in the described caption data;
2,, determine the direction of motion of subtitle data stream by the level of adjacent two frames in the subtitle data stream or the changes in coordinates of vertical direction.Captions for horizontal movement, just determine that by the changes in coordinates of obtaining the horizontal direction of adjacent two frames in the subtitle data stream caption stream is to move from left to right, still motion from right to left, but special processing wanted from the last frame of last samsara to first frame (also being consecutive frame from the time) of current samsara; Same captions to moving up and down can be determined the concrete direction of motion by the changes in coordinates of vertical direction;
3, the reference frame information of the origin coordinates data of former frame captions view data, captions character data and character demonstration for back one frame captions is set, and the present frame caption data that terminal receives judged whether it exists the reference frame of relevant information with it, and first frame that generally only receives does not have reference frame; If there is not reference frame, directly calculate and draw present frame captions image, reference frame is arranged, then change step 4 over to;
4, calculate the degree of association between present frame and the reference frame according to the captions character data of reference frame, promptly the amount of consecutive identical image block accounts for the ratio of current frame image data volume in two frames; If the two degree of association is zero, the image block that does not have consecutive identical information between present frame and the reference frame is described, directly calculates and draw present frame captions image, if the two degree of association is greater than zero, the image block that has consecutive identical information between present frame and the reference frame is described, then changes step 5 this moment over to;
5, calculate the initial/end coordinate of associated images piece in the reference frame and the position in present frame thereof, the captions view data with the associated images piece that calculates directly copies on the present frame tram then;
6, calculate and draw the residual image that present frame is not completed, obtain the complete captions image of present frame;
7, after obtaining present frame captions image, just give demonstration and go to handle.Simultaneity factor is noted information, view data and the positional information (from start to finish only can write down the information of a frame captions image in the system) of present frame captions, so that as the reference frame of next frame captions;
8, repeating step 3-7 finishes until subtitle data stream.
Need to prove that because the characteristic of motion captions, front and back two frames have the very high degree of association under the normal condition, may duplicate most of image block from reference frame at every turn, only need to draw a caption information that newly adds on a small quantity and get final product.If the present frame captions do not have reference frame, when perhaps the degree of association between it and the reference frame is zero (this situation usually occurs in the caption stream Data Receiving, filters to have in a large number and lose), current caption frame needs to draw fully, and the chance of down this situation generation is considerably less in the normal process process.The calculating of the degree of association between present frame described in the step 4 and the reference frame, come down to compare the ratio of the same section of previous frame captions character and present frame character, be prior art, and calculate the position of associated images piece in present frame in the reference frame in the step 5, also be fairly simple calculating, for those skilled in the art know, do not repeat them here.
Because adopted above scheme, the inventive method has the following advantages:
1, increased substantially the decoding efficiency of digital caption object
Every frame captions image frame because the technical method of the technical program employing neoteric " caption frame image forward reference " is decoded, relatively in the normal processes every frame captions image frame by the drafting of decoding one by one of current text captions character, reduce the decode time of every frame captions significantly, thereby solved caption data object decoding many bottleneck difficult problems consuming time in the set-top box.
2, integral body has improved the treatment effeciency of digital caption data in set-top box
The caption object data encapsulate with text mode in the technical scheme requirement caption data of the present invention, encapsulate with respect to caption object The data image mode, for identical captions business, reduce the data volume of captions business in transport stream significantly, thereby caused the process of set-top box caption data in reception, filter transport stream rapider, timely.Add that decode procedure subsequently has efficient raising significantly again, caption data overall treatment efficiency in set-top box is greatly improved and optimizes like this.
3, strengthen the function of set-top box, expanded its application
Because method integral body of the present invention has improved the efficient of processing caption data in the set-top box, makes it can more, better comprise the multinomial service application of captions business.Particularly for the set-top box of low and middle-grade hardware configuration, usually be difficult to realize the mobile captions business of those rapid movements, owing to adopt this technological invention, also can realize relatively more smooth captions business, thereby the digital caption business is widely used in set-top box users colony.
4, meet the captions standard, promoted the application of standard
Because the method among the present invention is the performance optimization of carrying out under the framework of the processing caption data principle of DVB Subtitle prescribed by standard, employed data member is all from the subtitle data stream of conformance with standard defined in the method, do not increase privately owned data member in the data flow of broadcasting, the principle of processing caption data overall process conformance with standard defined.The caption object data of defined all obtain embodying in application with image and text dual mode in the standard.Therefore, the present invention has fully used every data member of defined in the DVB Subtitle standard, has strengthened the range of application of standard.
Specific embodiments of the present invention, selection with the DVB Subtitle caption system of Skyworth numeral Shenzhen company as the front-end server system, (the captions front end system that other is any to meet DVB Subtitle standard all can), providing the word subtitle data stream that comprises the text mode caption object by it to transmission network be the prerequisite that set-top box prepares to receive data.The carrier on probation that the present embodiment selects for use ST 5518 or ST5516 platform to realize as technology, concrete software and hardware configuration is as follows:
Hardware platform: ST 5518 set-top box platforms, CPU frequency 80MHZ, internal memory 8M, 4MFALSH;
Software platform: ST 5518 set-top box software solutions, integrated business modules such as EPG, data broadcasting, DVB browser, stock browse queries, digital caption.
The technology of the present invention directly applies in the set-top box on the software systems, is not limited to condition and environment that above embodiment is selected.And technical solution of the present invention is not limited to uses this algorithm to handle the digital caption data in set-top box, for any type of television terminal equipment, when the data flow of DVB Subtitle captions standard is satisfied in processing, every caption data object data is with the caption data of text encapsulation, and its decode procedure all can adopt the present technique method to improve the treatment effeciency of caption data.
Should be understood that above-mentioned description at specific embodiment is comparatively detailed, can not therefore be interpreted as the restriction to scope of patent protection of the present invention, scope of patent protection of the present invention should be as the criterion with claims.