CN102799572B - A kind of text code mode and text code device - Google Patents

A kind of text code mode and text code device Download PDF

Info

Publication number
CN102799572B
CN102799572B CN201210263115.0A CN201210263115A CN102799572B CN 102799572 B CN102799572 B CN 102799572B CN 201210263115 A CN201210263115 A CN 201210263115A CN 102799572 B CN102799572 B CN 102799572B
Authority
CN
China
Prior art keywords
text
text code
video
success rate
highest
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201210263115.0A
Other languages
Chinese (zh)
Other versions
CN102799572A (en
Inventor
邹鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wanxing Polytron Technologies Inc
Original Assignee
SHENZHEN WONDERSHARE INFORMATION TECHNOLOGY Co 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 SHENZHEN WONDERSHARE INFORMATION TECHNOLOGY Co Ltd filed Critical SHENZHEN WONDERSHARE INFORMATION TECHNOLOGY Co Ltd
Priority to CN201210263115.0A priority Critical patent/CN102799572B/en
Publication of CN102799572A publication Critical patent/CN102799572A/en
Application granted granted Critical
Publication of CN102799572B publication Critical patent/CN102799572B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a kind of text code method and text code device, a kind of described text code method, comprising: adopt at least two kinds of default text code modes to carry out precoding to the text of video respectively; Choose a kind of text code mode that success rate in pre-encoding results is the highest; The highest text code mode of described success rate is adopted to carry out text code to the text of described video.Implement text code method provided by the invention and text code device, first adopt at least two kinds of text code modes to carry out precoding to the text of video, then select the coded system that in coding result, success rate is the highest to carry out text code to the text of video.So, improve the success rate of the text of video being carried out to text code.

Description

A kind of text code mode and text code device
Technical field
The present invention relates to a kind of coding techniques, particularly relate to a kind of text code mode and text code device.
Background technology
Video coding technique refers to by specific compress technique, the file transform of certain video format is become the mode of another kind of video format file.In current video streaming of paramount importance encoding and decoding standard have International Telecommunication Association H.261, H.263, the M-JPEG of motor rest motion picture expert group version and the MPEG series standard of Motion Picture Experts Group of International Organization for standardization, the QuickTime etc. also having the RealVideo of Real-Networks, WMV and the Apple company of Microsoft be widely used on the internet in addition.
Video containing captions being carried out in the process of encoding and decoding, needing the text to comprising captions to encode, but often do not know that using which kind of coded system to carry out text code is just applicable to.User a kind of or acquiescence of Stochastic choice can only choose a kind of coded system and carries out text code, and such text code mode, chance of success is very low.
Summary of the invention
For solving the problems of the technologies described above, the invention provides a kind of text code method and text code device, the success rate that the text of video is encoded can be improved.
The invention provides a kind of text code method, comprising:
At least two kinds of default text code modes are adopted to carry out precoding to the text of video respectively;
Choose a kind of text code mode that success rate in pre-encoding results is the highest;
The highest text code mode of described success rate is adopted to carry out text code to the text of described video;
Wherein, the text code mode that the described success rate of described employing is the highest carries out text code to described video, comprising:
Judge to adopt the highest text code mode of described success rate to the coding progress of the precoding that the text of described video carries out;
If described precoding progress is the coding carried out the whole text of described video, then adopt the pre-encoding results that text code mode that described success rate is the highest is corresponding;
If the coding that described precoding progress is carried out the text of X% before described video, then the text of the highest text code mode of described success rate to rear (100-X) % of described video is adopted to encode; X is positive number; Or adopt the whole text of the highest text code mode of described success rate to described video to carry out output encoder result after recompile.
Wherein, described default text code mode comprises: comprise double-byte encodings transformat UTF8, double-byte encodings transformat UTF16 or Chinese Internal Code Specification GBK.
Wherein, the described text to video carries out text code and comprises and carry out text code to the captioned test of video or parameter text.
Correspondingly, the present invention also provides a kind of text code device, comprising:
Precoding module, carries out precoding to the text of video respectively for adopting at least two kinds of default text code modes;
Coding mode selection module, a kind of text code mode that in the pre-encoding results that at least two kinds of default text code modes adopted for choosing described precoding module obtain, success rate is the highest;
Coding module, carries out text code for adopting the highest text code mode of the success rate of described coding mode selection model choice to the text of described video;
Judge module, for judging the coding progress of described precoding module to the precoding that the text of described video carries out;
If the precoding progress of described precoding module is the coding carried out the whole text of described video, then described coding module directly exports the pre-encoding results of described precoding module;
If the coding that the precoding progress of described precoding module is carried out the text of X% before described video, then described coding module adopts the text of the highest text code mode of described success rate to rear (100-X) % of described video to encode; X is positive number; Or described coding module adopts the whole text of the highest text code mode of described success rate to described video to carry out output encoder result after recompile.
Wherein, described device also comprises:
Coded system presetting module, for presetting at least two kinds of text code modes, described default text code mode comprises: comprise double-byte encodings transformat UTF8, double-byte encodings transformat UTF16 or Chinese Internal Code Specification GBK.
Wherein, described precoding module and coding module carry out text code to the text of video and comprise and carry out text code to the captioned test of video or parameter text.
Implement text code method provided by the invention and text code device, first adopt at least two kinds of text code modes to carry out precoding to the text of video, then select the coded system that in coding result, success rate is the highest to carry out text code to the text of video.So, improve the success rate of the text of video being carried out to text code.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of a kind of text code embodiment of the method one provided by the invention;
Fig. 2 is the schematic flow sheet of a kind of text code embodiment of the method two provided by the invention;
Fig. 3 is the structural representation of a kind of text code device embodiment one provided by the invention;
Fig. 4 is the structural representation of a kind of text code device embodiment two provided by the invention;
Fig. 5 is the structural representation of a kind of text code device embodiment three provided by the invention.
Embodiment
For solving the problems of the technologies described above, the invention provides a kind of text code method and text code device, the success rate that the text of video is encoded can be improved.
See Fig. 1, it is the schematic flow sheet of a kind of text code embodiment of the method one provided by the invention.
The text code method that the present embodiment one provides, comprising:
Step 100, adopts at least two kinds of default text code modes to carry out precoding to the text of video respectively;
Step 101, chooses a kind of text code mode that success rate in pre-encoding results is the highest;
Step 102, adopts the highest text code mode of described success rate to carry out text code to the text of described video.
Text code method provided by the invention, at least two kinds of default text code modes are adopted to carry out precoding to the text of video respectively, then a kind of text code mode being chosen to power the highest carries out text code to the text of video, improves the success rate of the text of video being carried out to text code.
It should be noted that, described default text code mode comprises: comprise double-byte encodings transformat UTF8, double-byte encodings transformat UTF16 or Chinese Internal Code Specification GBK.
Wherein, UTF8(Unicode Translation Format 8) be UNICODE(ten thousand country code) the elongated character code of one, created in 1992 by Ken Thompson.UTF8 1 to 6 byte code UNICODE characters.Being used in can same page display simplified Chinese character traditional font and other Languages on webpage.UTF8 coding can by mask bit and shifting function fast reading and writing.During character string comparison strcmp () and wcscmp () return results identical, therefore make sequence become and be more prone to.
UTF16(Unicode Translation Format 16) be UNICODE(ten thousand country code) another occupation mode.
UTF16 is compared with UTF8, difference is that its most of character all stores with the byte of regular length (2 byte), but UTF16 cannot be compatible with ASCII(American Standard Code for Information Interchange, ASCII(American Standard Code for information interchange)) coding.That give tacit consent in c# is exactly UTF16, so be adopt the modes such as byte, stream to go process when process c# character string.
It should be noted that in addition, a video has multiple text message, such as captioned test or parameter text, then the described text to video carries out text code and comprises and carry out text code to the captioned test of video or parameter text.
See Fig. 2, it is the schematic flow sheet of a kind of text code embodiment of the method two provided by the invention.
The present embodiment two will describe in text code method provided by the invention the implementation procedure adopting the highest text code mode of described success rate described video to be carried out to text code, comprising:
Step 200, judges to adopt the highest text code mode of described success rate to the coding progress of the precoding that the text of described video carries out;
Step 201, if described precoding progress is the coding carried out the whole text of described video, then directly exports the pre-encoding results that the highest text code mode of employing success rate is corresponding;
Step 202, if the coding that described precoding progress is carried out the text of X% before described video, then adopts the text of the highest text code mode of described success rate to rear (100-X) % of described video to encode; X is positive number.
Step 203, if the coding that described precoding progress is carried out the text of X% before described video, adopts the whole text of the highest text code mode of described success rate to described video to carry out output encoder result after recompile.
Particularly, to carry out text code to the captioned test of video, UTF8 is adopted to carry out precoding success 15 captions; UTF16 is adopted to carry out precoding success 10 captions; GBK is adopted to carry out precoding success 5 captions; So choose the text code mode of UTF8 as this video; If the progress of precoding is encoded to the whole captioned test of video, then directly export this 15 captions; If precoding progress is 20 to 20%(and X value before video) captioned test carry out precoding, the captioned test so adopting UTF8 to continue rear 80% is encoded, and exports together with the captions of 15 before; Or adopt UTF8 again to encode to whole captioned test, output edit result.
See Fig. 3, it is the structural representation of a kind of text code device embodiment one provided by the invention.
A kind of text code device that the embodiment of the present invention one provides, comprising:
Precoding module 10, carries out precoding to the text of video respectively for adopting at least two kinds of default text code modes;
Coding mode selection module 11, a kind of text code mode that in the pre-encoding results that at least two kinds of default text code modes adopted for choosing described precoding module obtain, success rate is the highest;
Coding module 12, carries out text code for adopting the highest text code mode of the success rate of described coding mode selection model choice to the text of described video.
Wherein, the text of described precoding module 10 and coding module 12 pairs of videos carries out text code and comprises and carry out text code to the captioned test of video or parameter text.
Text code device provided by the invention, at least two kinds of default text code modes are adopted to carry out precoding to the text of video respectively, then a kind of text code mode being chosen to power the highest carries out text code to the text of video, improves the success rate of the text of video being carried out to text code.
See Fig. 4, it is the structural representation of a kind of text code device embodiment two provided by the invention.
A kind of text code device that the embodiment of the present invention two provides, except comprising the modules of embodiment one, also comprises:
Coded system presetting module 13, for presetting at least two kinds of text code modes, described default text code mode comprises: comprise double-byte encodings transformat UTF8, double-byte encodings transformat UTF16 or Chinese Internal Code Specification GBK.
See Fig. 5, it is the structural representation of a kind of text code device embodiment three provided by the invention.
A kind of text code device that the embodiment of the present invention three provides, except comprising the modules of embodiment two, also comprises:
Judge module 14, for judging the coding progress of described precoding module 10 to the precoding that the text of described video carries out;
If the precoding progress of described precoding module 10 is the codings carried out the whole text of described video, then described coding module 12 directly exports the pre-encoding results of described precoding module 10;
If the coding that the precoding progress of described precoding module 10 is carried out the text of X% before described video, then output encoder result after described coding module 12 adopts the text of the highest text code mode of described success rate to rear (100-X) % of described video to encode; X is positive number;
Or described coding module 12 adopts the whole text of the highest text code mode of described success rate to described video to carry out output encoder result after recompile.
Implement text code method provided by the invention and text code device, first adopt at least two kinds of text code modes to carry out precoding to the text of video, then select the coded system that in coding result, success rate is the highest to carry out text code to the text of video.So, improve the success rate of the text of video being carried out to text code.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.
Above content is in conjunction with concrete preferred implementation further description made for the present invention, can not assert that specific embodiment of the invention is confined to these explanations.For general technical staff of the technical field of the invention, without departing from the inventive concept of the premise, some simple deduction or replace can also be made, all should be considered as belonging to protection scope of the present invention.

Claims (6)

1. a text code method, is characterized in that, comprising:
At least two kinds of default text code modes are adopted to carry out precoding to the text of video respectively;
Choose a kind of text code mode that success rate in pre-encoding results is the highest;
The highest text code mode of described success rate is adopted to carry out text code to the text of described video;
Wherein, the text code mode that the described success rate of described employing is the highest carries out text code to the text of described video, comprising:
Judge the precoding progress adopting the highest text code mode of described success rate to carry out the text of described video;
If described precoding progress is the coding carried out the whole text of described video, then export the pre-encoding results that the highest text code mode of the described success rate of employing is corresponding;
If the coding that described precoding progress is carried out the text of X% before described video, then output encoder result after adopting the text of the highest text code mode of described success rate to rear (100-X) % of described video to encode; X is positive number; Or adopt the whole text of the highest text code mode of described success rate to described video to carry out output encoder result after recompile.
2. text code method as claimed in claim 1, it is characterized in that, described default text code mode comprises: double-byte encodings transformat UTF8, double-byte encodings transformat UTF16 or Chinese Internal Code Specification GBK.
3. text code method as claimed in claim 1 or 2, is characterized in that, the described text to video carries out text code and comprises and carry out text code to the captioned test of video or parameter text.
4. a text code device, is characterized in that, comprising:
Precoding module, carries out precoding to the text of video respectively for adopting at least two kinds of default text code modes;
Coding mode selection module, a kind of text code mode that in the pre-encoding results that at least two kinds of default text code modes adopted for choosing described precoding module obtain, success rate is the highest;
Coding module, carries out text code for adopting the highest text code mode of the success rate of described coding mode selection model choice to the text of described video;
Described coding module is also for judging the precoding progress that described precoding module adopts the highest text code mode of described success rate and carries out the text of described video; If described precoding progress is the coding carried out the whole text of described video, then directly export the pre-encoding results that the highest text code mode of the described success rate of employing is corresponding; If the coding that described precoding progress is carried out the text of X% before described video, then output encoder result after adopting the text of the highest text code mode of described success rate to rear (100-X) % of described video to encode; X is positive number; Or adopt the whole text of the highest text code mode of described success rate to described video to carry out output encoder result after recompile.
5. text code device as claimed in claim 4, it is characterized in that, described default text code mode comprises: double-byte encodings transformat UTF8, double-byte encodings transformat UTF16 or Chinese Internal Code Specification GBK.
6. the text code device as described in claim 4 or 5, is characterized in that, described precoding module and coding module carry out text code to the text of video and comprise and carry out text code to the captioned test of video or parameter text.
CN201210263115.0A 2012-07-27 2012-07-27 A kind of text code mode and text code device Active CN102799572B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210263115.0A CN102799572B (en) 2012-07-27 2012-07-27 A kind of text code mode and text code device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210263115.0A CN102799572B (en) 2012-07-27 2012-07-27 A kind of text code mode and text code device

Publications (2)

Publication Number Publication Date
CN102799572A CN102799572A (en) 2012-11-28
CN102799572B true CN102799572B (en) 2015-09-09

Family

ID=47198685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210263115.0A Active CN102799572B (en) 2012-07-27 2012-07-27 A kind of text code mode and text code device

Country Status (1)

Country Link
CN (1) CN102799572B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105760364B (en) * 2016-02-22 2018-09-04 深圳市茁壮网络股份有限公司 A kind of character set detection method and device
CN105847931B (en) * 2016-03-28 2019-08-27 深圳Tcl新技术有限公司 Caption presentation method and device
CN108108267B (en) * 2016-11-25 2021-06-22 北京国双科技有限公司 Data recovery method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6115077A (en) * 1995-08-04 2000-09-05 Sony Corporation Apparatus and method for encoding and decoding digital video data operable to remove noise from subtitle date included therewith
CN1599463A (en) * 1998-03-10 2005-03-23 索尼公司 Transcoding system using encoding history information
CN101452723A (en) * 2008-10-16 2009-06-10 北京光线传媒有限公司 Media file playing method, playing system and media player

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100425066C (en) * 2005-09-23 2008-10-08 逐点半导体(上海)有限公司 Image compression method
CN101222641B (en) * 2007-01-11 2011-08-24 华为技术有限公司 Infra-frame prediction encoding and decoding method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6115077A (en) * 1995-08-04 2000-09-05 Sony Corporation Apparatus and method for encoding and decoding digital video data operable to remove noise from subtitle date included therewith
CN1599463A (en) * 1998-03-10 2005-03-23 索尼公司 Transcoding system using encoding history information
CN101452723A (en) * 2008-10-16 2009-06-10 北京光线传媒有限公司 Media file playing method, playing system and media player

Also Published As

Publication number Publication date
CN102799572A (en) 2012-11-28

Similar Documents

Publication Publication Date Title
CN105450232A (en) Encoding method, decoding method, encoding device and decoding device
CN104123364A (en) Method and device for transmitting and receiving data through mobile terminal
CN101526963A (en) Method for identifying web page coding, device and terminal equipment
CN102799572B (en) A kind of text code mode and text code device
CN103400173A (en) Generating method and reading method of two-dimensional code containing private information
CN101008940B (en) Method and device for automatic processing font missing
CN104424010B (en) A kind of text document mess code detection and restorative procedure and system
JP5476346B2 (en) Method for encoding and decoding data in matrix code symbols
EP2442256B1 (en) Method of encoding and decoding text on a matrix code symbol
CN109871520B (en) Binary data encoding and decoding method suitable for HTTP content embedding
CN104331400A (en) Mongolian code conversion method and device
CN103605730A (en) XML (extensible markup language) compressing method and device based on flexible-length identification codes
US20130024765A1 (en) Processing rich text data for storing as legacy data records in a data storage system
CN105653506B (en) It is a kind of based on character code conversion GPU in text-processing method and device
CN100511236C (en) Web page coding language automatic identification method and device for embedded type browser
CN103595415A (en) Coding method, decoding method, coding system and decoding system
CN101771846B (en) Caption correcting method and electronic equipment
US9235610B2 (en) Short string compression
US20120151330A1 (en) Method and apparatus for encoding and decoding xml documents using path code
CN105095268A (en) Method and apparatus for accessing structured data
CN103092859B (en) A kind of method and device obtaining music file information
CN103488618B (en) Text message transfer approach and system, text message display packing and system
CN103491414B (en) Method and device for processing character and set top box
CN100594492C (en) Embedded character base process method of network system
CN103092922A (en) Post-coding automatic decoding method aiming at uniform resource locator (URL) comprising special characters

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent for invention or patent application
CB02 Change of applicant information

Address after: 518057 Guangdong city of Shenzhen province Nanshan District Gao Xin Road, room 9 building on the north side of block A901 No. 006 TCL Industry Research Institute building A A Building 8 floor

Applicant after: Shenzhen Wondershare Information Technology Co., Ltd.

Address before: 518057 Guangdong city of Shenzhen province Nanshan District Gao Xin Road Building A block 8 Building TCL

Applicant before: Shenzhen Wondershare Software Co., Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: SHENZHEN WONDERSHARE SOFTWARE CO., LTD. TO: SHENZHEN WONDERSHARE INFORMATION TECHNOLOGY CO., LTD.

C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 850000 Tibet autonomous region, Lhasa City, New District, west of the East Ring Road, 1-4 road to the north, south of 1-3 Road, Liu Dong building, east of the 8 unit 6, floor 2, No.

Patentee after: Wanxing Polytron Technologies Inc

Address before: 518057 Guangdong city of Shenzhen province Nanshan District Gao Xin Road, room 9 building on the north side of block A901 No. 006 TCL Industry Research Institute building A A Building 8 floor

Patentee before: Shenzhen Wondershare Information Technology Co., Ltd.