技术领域technical field
本发明与多媒体信号处理技术相关,并且尤其与数字音视频编解码技术标准(audio video coding standard,AVS)中的解压缩技术相关。The present invention is related to the multimedia signal processing technology, and especially related to the decompression technology in the digital audio and video coding standard (audio video coding standard, AVS).
背景技术Background technique
随着通讯技术的进步,数字电视广播渐趋成熟、普及。除了经由电缆线路传送外,数字电视信号也可透过基站或人造卫星等设备以无线信号的型态被传递。为了兼顾提升画面品质和降低传输数据量的需求,传送端通常会将待传递的影像及声音信号编码、压缩。相对应地,接收端必须正确地将收到的信号解码、解压缩,始能还原影音信号。With the advancement of communication technology, digital TV broadcasting is becoming more and more mature and popular. In addition to transmission via cable lines, digital TV signals can also be transmitted in the form of wireless signals through equipment such as base stations or artificial satellites. In order to meet the requirements of improving picture quality and reducing the amount of transmitted data, the transmitting end usually encodes and compresses the video and audio signals to be transmitted. Correspondingly, the receiving end must correctly decode and decompress the received signal before it can restore the video and audio signal.
目前通行于中国大陆的数字音视频编解码技术标准(AVS)采用高级熵编码(advanced entropy coding,AEC)来处理影音数据,其实施方式可参考第7,808,406号美国专利及AVS工作小组提供的技术文件。如本发明所属技术领域中具有通常知识者所知,AVS接收端的二元算术编码引擎(binary arithmetic coding engine)所执行的二元算术解码为一递回程序,其输入称为偏移值(offset)。藉由找出该偏移值与一区间值(range)的大小相对关系,可判断目前待解码的符号为一较大机率符号(most probable symbol,MPS)或一较小机率符号(least probable symbol,LPS)。由于在二元算数编码中的待解符号仅有1和0两种可能性;两种可能性中出现机率大于0.5者为较大机率符号,另一者则为较小机率符号。The digital audio and video codec standard (AVS) currently prevailing in mainland China uses advanced entropy coding (AEC) to process audio and video data. For its implementation, please refer to US Patent No. 7,808,406 and the technical documents provided by the AVS Working Group . As known to those skilled in the art to which the present invention belongs, the binary arithmetic decoding performed by the binary arithmetic coding engine (binary arithmetic coding engine) at the receiving end of the AVS is a recursive program, and its input is called an offset value (offset ). By finding out the relative relationship between the offset value and a range value (range), it can be judged that the symbol to be decoded is a most probable symbol (MPS) or a least probable symbol (least probable symbol) ,LPS). Because there are only two possibilities of 1 and 0 for the symbols to be solved in the binary arithmetic coding; the one with the probability of occurrence greater than 0.5 in the two possibilities is a symbol with a higher probability, and the other is a symbol with a lower probability.
与区间值相关的两个主要变数为区间值位移量和区间值有效量,与偏移值相关的两个主要变数则是偏移值位移量和偏移值有效量。实务上,算术编码引擎每次能处理的数据长度有限。现行AVS技术文件规定,算术编码引擎应将区间值位移量和区间值有效量的长度分别设定为二进位制的八位元。另一方面,偏移值位移量和偏移值有效量的长度应分别被设定为二进位制的三十二位元与九位元。The two main variables related to the interval value are the interval value displacement and the effective amount of the interval value, and the two main variables related to the offset value are the offset value displacement and the effective amount of the offset value. In practice, the length of data that the arithmetic coding engine can process each time is limited. The current AVS technical document stipulates that the arithmetic coding engine should set the length of the displacement amount of the interval value and the length of the effective amount of the interval value as octets of the binary system, respectively. On the other hand, the length of the offset value shift amount and the offset value effective amount should be set as 32 bits and 9 bits in binary system, respectively.
AVS接收端的算术编码引擎首先会进行一偏移值初始化程序,其传统流程绘示于图1。步骤S101为将偏移值位移量设定为零,步骤S102则是读取九个位元的音视频数据做为偏移值有效量。接着,步骤103和步骤104代表偏移值预读程序,其中步骤S103为判断是否"偏移值有效量小于256"。偏移值有效量小于256表示偏移值有效量中的最高有效位元(第九位元)为二进制零。若步骤S103的判断结果为是,步骤S104被执行,亦即将偏移值有效量左移一个位元并读取一后续位元。相对应地,偏移值位移量被加1。随后,步骤S103会被重新执行。若步骤S103的判断结果为否,步骤S103~S104所代表的偏移值预读程序会被停止。随后,步骤S105为撷取该偏移值有效量的后八个位元,做为新的偏移值有效量。步骤S104所决定的偏移值位移量以及步骤S105所决定的偏移值有效量,共同构成随后解码程序采用的初始偏移值。The arithmetic coding engine of the AVS receiving end will first perform an offset value initialization procedure, and its traditional flow is shown in FIG. 1 . Step S101 is to set the displacement value of the offset value to zero, and step S102 is to read nine bits of audio and video data as the effective value of the offset value. Next, step 103 and step 104 represent the offset value pre-reading procedure, wherein step S103 is to judge whether "the effective amount of the offset value is less than 256". An effective offset value less than 256 indicates that the most significant bit (ninth bit) in the effective offset value is a binary zero. If the judgment result of step S103 is yes, step S104 is executed, that is, the effective amount of the offset value is shifted to the left by one bit and a subsequent bit is read. Correspondingly, the displacement of the offset value is increased by 1. Subsequently, step S103 will be re-executed. If the judgment result of step S103 is negative, the offset value pre-reading process represented by steps S103-S104 will be stopped. Subsequently, step S105 is to extract the last eight bits of the effective amount of the offset value as a new effective amount of the offset value. The offset displacement determined in step S104 and the effective offset determined in step S105 together constitute an initial offset used in subsequent decoding procedures.
传统AVS接收端的算术编码引擎所进行的主要解码程序如图2(A)~图2(B)所示。步骤S201的功能在于读取前一次解码程序最后更新的上下文模型,据此得知本次解码程序中的较大机率符号是二进制零或二进制一,并得知该较大机率符号的出现机率。步骤S202的功能则是根据旧区间值和较大机率符号的出现机率更新区间值位移量、区间值有效量,并决定一判断旗帜的内容为二进制零或二进制一,其详细流程被绘示为图3中的子步骤S202A~S202G。The main decoding procedures performed by the arithmetic coding engine of the traditional AVS receiving end are shown in Fig. 2(A) ~ Fig. 2(B). The function of step S201 is to read the last updated context model of the previous decoding process, and learn from this that the symbol with higher probability in this decoding process is binary zero or binary one, and obtain the occurrence probability of the symbol with higher probability. The function of step S202 is to update the displacement of the interval value and the effective amount of the interval value according to the occurrence probability of the old interval value and the larger probability symbol, and determine whether the content of a judgment flag is binary zero or binary one. The detailed process is shown as Sub-steps S202A-S202G in FIG. 3 .
步骤S203为整个解码流程中的主要判断步骤,亦即判断目前的待解码符号为一较大机率符号或一较小机率符号。步骤S203可被拆解为包含以下三个判断式:(1)区间值位移量是否大于偏移值位移量,(2)区间值位移量是否等于偏移值位移量,以及(3)偏移值有效量是否大于或等于区间值有效量。若判断式(1)的判断结果为是,或者判断式(2)与判断式(3)的判断结果皆为是,则判定待解码符号为一较小机率符号的步骤S204会被执行。相对地,若第一个判断式的判断结果为否,且后两个判断式的判断结果中有任一个判断结果为否,则判定待解码符号为一较大机率符号的步骤S291会被执行。Step S203 is the main determination step in the whole decoding process, that is, it is determined whether the current symbol to be decoded is a higher probability symbol or a lower probability symbol. Step S203 can be disassembled to include the following three judgments: (1) whether the interval value displacement is greater than the offset value displacement, (2) whether the interval value displacement is equal to the offset value displacement, and (3) the offset Whether the value effective amount is greater than or equal to the interval value effective amount. If the judgment result of the judgment formula (1) is yes, or the judgment results of the judgment formulas (2) and (3) are both yes, then the step S204 of judging that the symbol to be decoded is a symbol with a lower probability will be executed. Relatively, if the judgment result of the first judgment formula is No, and any one of the judgment results of the last two judgment formulas is No, then the step S291 of judging that the symbol to be decoded is a symbol with a higher probability will be executed .
步骤S204之后的步骤S205~S213是一连串的参数更新流程,只有在待解码符号被判定为较小机率符号的情况下才会执行。更具体地说,步骤S205~S207根据判断旗帜的状态决定如何更新一较小机率符号区间值。步骤S208~S210根据区间值位移量与偏移值位移量的关系,决定如何更新偏移值有效量。步骤S211~S213则是根据较小机率符号区间值,决定如何更新偏移值有效量与区间值有效量。Steps S205-S213 following step S204 are a series of parameter update procedures, which are only executed when the symbol to be decoded is determined to be a symbol with a relatively low probability. More specifically, steps S205-S207 determine how to update a smaller probability symbol interval value according to the state of the judgment flag. Steps S208-S210 determine how to update the effective offset value according to the relationship between the interval value displacement and the offset value displacement. Steps S211-S213 are to determine how to update the effective amount of the offset value and the effective amount of the interval value according to the interval value of the symbol with a small probability.
步骤S214~S218的主要功能在于预读后续偏移值,供下一次的符号判断程序使用。步骤S214将区间值位移量重新设定为零。步骤S215将偏移值位移量重新设定为零。步骤S216~S218则是与图1中的步骤S103~S105相同,亦即选择性地自音视频数据中读取后续位元做为做为偏移值有效量,并根据实际读取的位元数量来设定偏移值位移量。最后,步骤S219为更新上下文模型并回传解码结果。如图2(A)所示,在判定待解码符号为一较大机率符号的步骤S291之后,步骤S292也是更新上下文模型并回传解码结果。The main function of steps S214-S218 is to pre-read subsequent offset values for use in the next sign judgment procedure. Step S214 resets the interval value displacement to zero. Step S215 resets the displacement of the offset value to zero. Steps S216-S218 are the same as steps S103-S105 in FIG. 1, that is, selectively read subsequent bits from the audio and video data as an effective amount of offset value, and according to the actually read bits Amount to set the offset value displacement. Finally, step S219 is to update the context model and return the decoding result. As shown in FIG. 2(A), after the step S291 of determining that the symbol to be decoded is a relatively high probability symbol, step S292 also updates the context model and returns the decoding result.
在上述解码程序中,与预读后续偏移值相关的步骤存在有瑕疵,说明如下。In the above decoding procedure, there are flaws in the steps related to pre-reading subsequent offset values, which are explained as follows.
在图2(A)呈现的步骤S203中,偏移值位移量和区间值位移量会被互相比较。如先前所述,偏移值位移量的长度是三十二位元,而区间值位移量的长度是八位元。因此,偏移值位移量最大可达二的三十二次方减一,但区间值位移量最大仅可达二的八次方减一(也就是二百五十五)。实务上,在偏移值位移量未超过二百五十四的情况下,区间值位移量恒得以透过步骤S202E逐步追上偏移值位移量,使偏移值有效量和区间值有效量的比较基础保持一致。In step S203 shown in FIG. 2(A), the offset value displacement and the interval value displacement are compared with each other. As mentioned earlier, the length of the offset value displacement is 32 bits, and the length of the interval value displacement is 8 bits. Therefore, the maximum displacement of the offset value can reach the thirty-second power of two minus one, but the maximum displacement of the interval value can only reach the eighth power of two minus one (that is, two hundred and fifty-five). In practice, when the displacement of the offset value does not exceed 254, the displacement of the interval value can gradually catch up with the displacement of the offset value through step S202E, so that the effective amount of the offset value and the effective amount of the interval value The basis of comparison remains the same.
目前已知接收端的算术编码引擎接收到的音视频数据中有可能连续出现多于二百五十四个二进制零,造成预读步骤S216~S217被重复执行超过二百五十四次,进而使得偏移值位移量被累加至高于二百五十四。然而,在上述解码流程中,唯有当步骤S203的判断结果为是(亦即判定待解码符号为较小机率符号)时,将偏移值位移量重新归零的步骤(S215)才会被执行。实务上,一旦发生偏移值位移量被累加至高于二百五十四的情况,步骤S203的判断结果将恒为否,使整个解码流程崩溃,输出错误的解码结果。It is currently known that the audio and video data received by the arithmetic coding engine at the receiving end may continuously appear more than 254 binary zeros, causing the pre-reading steps S216-S217 to be repeated for more than 254 times, thereby causing Offset displacements are accumulated above two hundred and fifty-four. However, in the above-mentioned decoding process, only when the determination result of step S203 is yes (that is, it is determined that the symbol to be decoded is a symbol with a small probability), the step of resetting the offset displacement to zero (S215) will be performed. implement. In practice, once the accumulated offset displacement is higher than 254, the judgment result of step S203 will always be negative, causing the entire decoding process to collapse and outputting wrong decoding results.
同样的情况也可能会出现在图1呈现的偏移值初始化程序。比较图1和图2(B)可看出,预读步骤S103~S105与预读步骤S216~S218完全相同。也就是说,偏移值位移量也有可能在初始化程序中就被累加至高于二百五十四,造成上述解码流程崩溃的问题。The same situation may also arise in the offset value initializer presented in Figure 1. Comparing FIG. 1 and FIG. 2(B), it can be seen that the pre-reading steps S103-S105 are exactly the same as the pre-reading steps S216-S218. That is to say, the displacement of the offset value may be accumulated to be higher than 254 in the initialization procedure, causing the above-mentioned decoding process to crash.
发明内容Contents of the invention
本发明提出一种新的解码方法及解码装置,应用于数字音视频编解码技术标准系统。藉由适当地为偏移值读取程序设定一停止读取旗帜,根据本发明的解码方法与解码装置可有效避免偏移值位移量高于区间值位移量上限的情况,进而避免了解码流程因此崩溃的问题。值得注意的是,若采用根据本发明的解码方法与解码装置,便不需要对AVS编码端输出的编码结果施以相关预防性限制(例如令音视频数据中不得连续出现多于二百五十四个二进制零),亦毋须修改AVS解码端中用以储存区间值位移量的暂存器的大小。The invention proposes a new decoding method and decoding device, which are applied to the digital audio and video coding and decoding technology standard system. By properly setting a stop reading flag for the offset value reading program, the decoding method and decoding device according to the present invention can effectively avoid the situation that the offset value displacement is higher than the upper limit of the interval value displacement, thereby avoiding the decoding The problem of the process crashing because of this. It is worth noting that if the decoding method and decoding device according to the present invention are adopted, there is no need to impose relevant preventive restrictions on the encoding results output by the AVS encoding end (for example, the audio and video data must not continuously appear more than 250 four binary zeros), and there is no need to modify the size of the register used to store the displacement of the interval value in the AVS decoder.
根据本发明的一具体实施例为一种应用于一数字音视频编解码技术标准系统的解码方法,用以解码一音视频数据。根据这个解码方法,大于零且小于一区间值位移量上限的一偏移值位移量上限被预先提供。是否停止一偏移值预读程序的判断依据包含一偏移值位移量是否达到该偏移值位移量上限。于该偏移值预读程序停止后,一偏移值有效量的一最高有效位元被保留。在进行下一次符号判断程序,以判断该音视频数据中的一待解码符号为一较大机率符号或一较小机率符号时,该偏移值有效量被保留的该最高有效位元被用做考量依据。A specific embodiment according to the present invention is a decoding method applied to a standard system of digital audio and video codec technology to decode an audio and video data. According to this decoding method, an offset value upper limit displacement greater than zero and smaller than an interval value displacement upper limit is provided in advance. The basis for judging whether to stop an offset value pre-reading procedure includes whether an offset value displacement reaches the upper limit of the offset value displacement. After the offset lookahead procedure stops, a most significant bit of an offset valid amount is retained. When performing the next symbol determination procedure to determine whether a symbol to be decoded in the audio and video data is a symbol with a higher probability or a symbol with a lower probability, the most significant bit in which the effective amount of the offset value is reserved is used Make a basis for consideration.
根据本发明的另一具体实施例为一种应用于一数字音视频编解码技术标准系统的解码装置,用以解码一音视频数据。该解码装置包含一偏移值预读电路与一符号判断电路。大于零且小于一区间值位移量上限的一偏移值位移量上限被预先提供。该偏移值预读电路用以执行一偏移值预读程序、根据一偏移值位移量是否达到该偏移值位移量上限决定是否停止该偏移值预读程序,并且于该偏移值预读程序停止后,保留一偏移值有效量的一最高有效位元。该符号判断电路用以根据被保留的该偏移值有效量的该最高有效位元进行下一次符号判断程序,以判断该音视频数据中的一待解码符号为一较大机率符号或一较小机率符号。Another specific embodiment according to the present invention is a decoding device applied to a standard system of digital audio and video codec technology, for decoding an audio and video data. The decoding device includes an offset value pre-reading circuit and a symbol judgment circuit. An offset upper limit displacement greater than zero and smaller than an interval value upper limit displacement is provided in advance. The offset value pre-read circuit is used to execute an offset value pre-read program, and decide whether to stop the offset value pre-read program according to whether an offset value displacement reaches the upper limit of the offset value displacement, and at the offset After the value look-ahead procedure is stopped, a most significant bit of an offset value valid amount is reserved. The symbol judging circuit is used to perform the next symbol judging procedure according to the reserved most significant bit of the effective amount of the offset value, so as to judge that a symbol to be decoded in the audio and video data is a higher probability symbol or a lower probability symbol. Small probability symbol.
根据本发明的另一具体实施例为一种应用于一数字音视频编解码技术标准系统的解码方法,用以解码一音视频数据。根据该解码方法,一偏移值预读程序包含以下步骤:(a)判断一偏移值有效量是否低于一特定数值;(b)若步骤(a)的判断结果为是,为该偏移值有效量读取一个新的最低有效位元;以及(c)在步骤(b)被执行一次之后,停止该偏移值预读程序。Another specific embodiment according to the present invention is a decoding method applied to a standard system of digital audio and video codec technology to decode an audio and video data. According to the decoding method, an offset value pre-reading program includes the following steps: (a) judging whether an offset value effective amount is lower than a specific value; (b) if the judgment result of step (a) is yes, the The shift value reads a new least significant bit; and (c) after step (b) is performed once, stop the offset value look-ahead procedure.
根据本发明的另一具体实施例为一种应用于一数字音视频编解码技术标准系统的解码装置,用以解码一音视频数据。该解码装置包含用以执行一偏移值预读程序的一偏移值预读电路。该偏移值预读电路包含一判断电路与一读取电路。该判断电路用以判断一偏移值有效量是否低于一特定数值。若该判断电路的判断结果为是,该读取电路为该偏移值有效量读取一个新的最低有效位元后即停止该偏移值预读程序。Another specific embodiment according to the present invention is a decoding device applied to a standard system of digital audio and video codec technology, for decoding an audio and video data. The decoding device includes an offset value pre-reading circuit for performing an offset value pre-reading procedure. The offset value pre-reading circuit includes a judging circuit and a reading circuit. The judging circuit is used for judging whether an effective amount of an offset value is lower than a specific value. If the judging result of the judging circuit is yes, the reading circuit stops the offset value pre-reading procedure after reading a new least significant bit for the effective amount of the offset value.
根据本发明的另一具体实施例为一种应用于一数字音视频编解码技术标准系统的解码方法,用以解码一音视频数据。该解码方法包含判断该音视频数据中是否包含至少一笔待解码回避(bypass)数据。若判断结果为否,该音视频数据被施以一第一解码程序。若判断结果为是,该至少一笔待解码回避数据被施以不同于该第一解码程序的一第二解码程序。Another specific embodiment according to the present invention is a decoding method applied to a standard system of digital audio and video codec technology to decode an audio and video data. The decoding method includes judging whether the audio-video data contains at least one piece of bypass data to be decoded. If the judgment result is negative, the audio-video data is subjected to a first decoding procedure. If the determination result is yes, the at least one piece of avoidance data to be decoded is subjected to a second decoding process different from the first decoding process.
关于本发明的优点与精神可以藉由以下发明详述及附图得到进一步的了解。The advantages and spirit of the present invention can be further understood through the following detailed description of the invention and the accompanying drawings.
附图说明Description of drawings
图1绘示了传统AVS接收端采用的偏移值初始化程序的流程图。FIG. 1 shows a flow chart of an offset value initialization procedure adopted by a conventional AVS receiver.
图2(A)~图2(B)绘示了传统AVS接收端的算术编码引擎采用的主要解码程序的流程图。2(A)-2(B) illustrate the flow charts of the main decoding procedures adopted by the arithmetic coding engine of the traditional AVS receiver.
图3绘示了图2的步骤S202的详细子步骤与流程。FIG. 3 illustrates the detailed sub-steps and flow of step S202 in FIG. 2 .
图4绘示了根据本发明的一实施例中的偏移值初始化程序流程图。FIG. 4 is a flow chart of an offset value initialization procedure according to an embodiment of the present invention.
图5(A)~图5(B)绘示了根据本发明的一实施例中的主要解码程序的流程图。FIG. 5(A)-FIG. 5(B) illustrate the flow chart of the main decoding procedure according to an embodiment of the present invention.
图6为根据本发明的一实施例中的解码装置的功能方块图。FIG. 6 is a functional block diagram of a decoding device according to an embodiment of the present invention.
图7绘示了根据本发明的另一实施例中的偏移值初始化程序的流程图。FIG. 7 is a flow chart of an offset value initialization procedure according to another embodiment of the present invention.
图8绘示了根据本发明的另一实施例中的主要解码程序的局部流程图。FIG. 8 shows a partial flowchart of the main decoding process according to another embodiment of the present invention.
图9为根据本发明的一实施例中的解码方法的流程图。FIG. 9 is a flowchart of a decoding method according to an embodiment of the present invention.
图10绘示了根据本发明的一实施例中的第二解码程序的流程图。FIG. 10 is a flow chart of the second decoding procedure according to an embodiment of the present invention.
图11绘示了根据本发明的另一实施例中的第二解码程序的流程图。FIG. 11 shows a flow chart of the second decoding procedure according to another embodiment of the present invention.
图12为根据本发明的一实施例中的解码装置的功能方块图。FIG. 12 is a functional block diagram of a decoding device according to an embodiment of the present invention.
符号说明Symbol Description
S101~S108:步骤流程 S201~S224:步骤流程S101~S108: Step flow S201~S224: Step flow
S202A~S202G:步骤流程 S401~S404:步骤流程S202A~S202G: Step Flow S401~S404: Step Flow
S501~S524:步骤流程 600:解码装置S501~S524: Step flow 600: Decoding device
601:前置作业电路 602:符号判断电路601: Pre-operation circuit 602: Symbol judgment circuit
603:较小机率符号区间值决定电路603: Small probability sign interval value decision circuit
604:偏移值有效量重设电路 605:区间值有效量重设电路604: Offset value effective amount reset circuit 605: Interval value effective amount reset circuit
606:偏移值预读电路 607:预读驱动电路606: Offset value pre-reading circuit 607: Pre-reading drive circuit
608:上下文更新电路 S701~S704:步骤流程608: Context update circuit S701~S704: Step flow
S811~S824:步骤流程 S901~S903:步骤流程S811~S824: Step-by-step process S901-S903: Step-by-step process
S1001~S1024:步骤流程 S1101~S1106:步骤流程S1001~S1024: Step flow S1101~S1106: Step flow
1200:解码装置 1201:判断电路1200: decoding device 1201: judging circuit
1202:第一解码电路 1203:第二解码电路1202: first decoding circuit 1203: second decoding circuit
1203A:比较器 1203B:位元检查器1203A: Comparator 1203B: Bit Checker
1203C:输出电路 500:解码程序1203C: output circuit 500: decoding program
须说明的是,本发明的附图包含呈现多种彼此关联的功能性电路的功能方块图。这些图式并非细部电路图,且其中的连接线仅用以表示信号流。功能性元件及/或程序间的多种互动关系不一定要透过直接的电性连结始能达成。此外,个别元件的功能不一定要如附图中绘示的方式分配,且分散式的区块不一定要以分散式的电子元件实现。It should be noted that the drawings of the present invention include functional block diagrams showing various interrelated functional circuits. These drawings are not detailed circuit diagrams, and the connecting lines are only used to represent the flow of signals. Various interactions between functional elements and/or programs do not necessarily need to be achieved through direct electrical connections. In addition, the functions of individual components do not have to be distributed as shown in the drawings, and distributed blocks do not have to be realized by distributed electronic components.
具体实施方式Detailed ways
根据本发明的一具体实施例为一种应用于一数字音视频编解码技术标准(AVS)系统的解码方法,其流程图绘示于图4以及图5(A)~图5(B)。以下说明主要假设区间值位移量、区间值有效量、偏移值位移量、偏移值有效量等四个变数的长度分别被设定为二进位制的八位元、八位元、三十二位元、九位元。透过以下说明,本发明所属技术领域中具有通常知识者可理解,本发明的概念可应用至变数长度不同于此假设的情况。A specific embodiment according to the present invention is a decoding method applied to an AVS system, the flow chart of which is shown in FIG. 4 and FIG. 5(A)-FIG. 5(B). The following description mainly assumes that the lengths of the four variables, including interval value displacement, interval value effective amount, offset value displacement, and offset value effective amount, are respectively set to eight bits, eight bits, and thirty bits in binary. Two bits, nine bits. Through the following description, those skilled in the art of the present invention can understand that the concept of the present invention can be applied to situations where the length of the variable is different from this assumption.
首先请参阅图4呈现的偏移值初始化程序400。比较图1与图4可看出,步骤S401~S402与步骤S101~S102相同。不同于步骤S103,除了判断是否"偏移值有效量小于256",步骤S403进一步包含判断是否"偏移值位移量小于一偏移值位移量上限N"。此偏移值位移量上限N大于零且小于一区间值位移量上限。就区间值位移量的长度为八位元的情况而言,该区间值位移量上限等于255,偏移值位移量上限N因此可为1到254间的任一正整数。若步骤S403的判断结果为否,偏移值初始化程序400随即停止。若步骤S403的判断结果为是,则步骤S404被执行,亦即将偏移值有效量左移一个位元并读取一后续位元。相对应地,偏移值位移量被加1。随后,步骤S403会被重新执行。Please refer first to the offset value initializer 400 presented in FIG. 4 . Comparing FIG. 1 with FIG. 4, it can be seen that steps S401-S402 are the same as steps S101-S102. Different from step S103, in addition to judging whether "the effective offset value is less than 256", step S403 further includes judging whether "the offset value displacement is less than an offset value displacement upper limit N". The upper limit N of displacement of the offset value is greater than zero and smaller than the upper limit of displacement of an interval value. As far as the length of the interval value displacement is 8 bits, the upper limit of the interval value displacement is equal to 255, and therefore the upper limit N of the offset value displacement can be any positive integer between 1 and 254. If the determination result of step S403 is negative, the offset value initialization procedure 400 stops immediately. If the judgment result of step S403 is yes, then step S404 is executed, that is, the effective amount of the offset value is shifted to the left by one bit and a subsequent bit is read. Correspondingly, the displacement of the offset value is increased by 1. Subsequently, step S403 will be re-executed.
值得注意的是,用以将偏移值有效量的最高有效位元重新设定为二进制零的步骤(S105)并未出现在偏移值初始化程序400中。更具体地说,在偏移值预读程序停止后,偏移值有效量的最高有效位元(第九位元)被特意保留,用来记录偏移值预读程序的停止原因。更明确地说,若步骤S403(是否"偏移值有效量小于256"且"偏移值位移量小于一偏移值位移量上限N")的判断结果为否的原因是出于"偏移值有效量大于或等于256",目前偏移值有效量的最高有效位元必定为二进制一。相似地,若步骤S403是因为"偏移值有效量大于或等于256"与"偏移值位移量大于或等于偏移值位移量上限N"两个条件同时成立,使得步骤S403的判断结果为否,目前偏移值有效量的最高有效位元亦必定为二进制一。相对地,若步骤S403的判断结果因为"偏移值位移量达到偏移值位移量上限N"而为否,但"偏移值有效量大于或等于256"不成立,偏移值有效量的最高有效位元必定为二进制零。It should be noted that the step ( S105 ) for resetting the most significant bit of the offset significant amount to binary zero does not appear in the offset initialization procedure 400 . More specifically, after the offset value pre-reading program is stopped, the most significant bit (ninth bit) of the offset value effective amount is specially reserved to record the reason for the offset value pre-reading program's stop. More specifically, if the judgment result of step S403 (whether "the effective offset value is less than 256" and "the offset value displacement is less than an offset value displacement upper limit N") is negative, the reason is that the "offset The effective amount of the value is greater than or equal to 256", the most significant bit of the effective amount of the current offset value must be a binary one. Similarly, if step S403 is because the two conditions of "the effective offset value is greater than or equal to 256" and "the offset value displacement is greater than or equal to the upper limit N of the offset value displacement" are established simultaneously, the judgment result of step S403 is No, the most significant bit of the current offset value valid amount must also be a binary one. Relatively, if the judgment result of step S403 is negative because "the offset value displacement reaches the upper limit N of the offset value displacement", but "the effective offset value is greater than or equal to 256" is not established, the highest effective offset value Significant bits must be binary zeros.
以步骤S402读入的偏移值有效量为000000001且偏移值位移量上限N等于4的情况为例,步骤S403~S404会被重复执行四次;直到偏移值位移量被累加至不再小于4,步骤S403的判断结果始为否。在这个情况下,偏移值有效量为00001XXXX,其中符号X代表1或0。由偏移值有效量的最高有效位元为二进制零可看出,步骤S403是因为"偏移值位移量小于一偏移值位移量上限N"这个条件不成立而为否。Taking the case where the effective amount of the offset value read in step S402 is 000000001 and the upper limit N of the offset value displacement is equal to 4 as an example, steps S403-S404 will be repeated four times; until the offset value displacement is accumulated to no longer If it is less than 4, the judgment result of step S403 is no. In this case, the effective amount of offset value is 00001XXXX, where the symbol X represents 1 or 0. It can be seen from the fact that the most significant bit of the effective amount of the offset value is a binary zero, step S403 is negative because the condition "the displacement amount of the offset value is less than an upper limit N of the displacement amount of the offset value" is not satisfied.
以步骤S402读入的偏移值有效量为001001101且偏移值位移量上限N等于4的情况为例,步骤S403~S404会被重复执行两次;直到偏移值有效量被调整为1001101XX,步骤S403的判断结果始为否。在这个情况下,偏移值位移量仅为2,尚未达到偏移值位移量上限N。由偏移值有效量的最高有效位元为二进制一可看出,步骤S403是因为"偏移值有效量小于256"这个条件不成立而为否。Taking the case where the effective amount of the offset value read in step S402 is 001001101 and the upper limit N of the offset value displacement is equal to 4 as an example, steps S403-S404 will be repeated twice; until the effective amount of the offset value is adjusted to 1001101XX, The judgment result of step S403 is negative. In this case, the offset displacement amount is only 2, and the upper limit N of the offset value displacement amount has not yet been reached. It can be seen from the fact that the most significant bit of the effective amount of the offset value is binary one, step S403 is negative because the condition "the effective amount of the offset value is less than 256" is not satisfied.
由以上说明可看出,偏移值位移量上限N能将偏移值位移量限制为不等于或超过区间值位移量上限。因此,偏移值位移量不会有在初始化程序中就被累加至高于254的可能性。藉此,在偏移值初始化程序中因偏移值位移量过高而造成解码流程崩溃的原因可被消除。It can be seen from the above description that the upper limit N of the displacement of the offset value can limit the displacement of the offset value to not equal to or exceed the upper limit of the displacement of the interval value. Therefore, there is no possibility that the offset value will be accumulated higher than 254 in the initialization routine. In this way, the cause of the crash of the decoding process caused by the excessive displacement of the offset value in the initialization procedure of the offset value can be eliminated.
如先前所述,在偏移值位移量未超过254的情况下,区间值位移量恒得以透过步骤S202E逐步追上偏移值位移量,使偏移值有效量和区间值有效量的比较基础保持一致。在区间值位移量追上或超越偏移值位移量之后,只要解码结果为较小机率符号,区间值位移量和偏移值位移量便会被归零、重新累计。上述做法的优点之一在于,加入偏移值位移量上限N此一限制条件并不会对解码结果的正确性造成负面影响,只是令原本区间值位移量追上偏移值位移量的一较长时间被拆分为多段较短的时间。As previously mentioned, in the case where the displacement of the offset value does not exceed 254, the displacement of the interval value can gradually catch up with the displacement of the offset value through step S202E, so that the comparison between the effective amount of the offset value and the effective amount of the interval value The basis remains the same. After the displacement of the interval value catches up with or exceeds the displacement of the offset value, as long as the decoding result is a symbol with a lower probability, the displacement of the interval value and the displacement of the offset value will be reset to zero and accumulated again. One of the advantages of the above method is that adding the restriction condition of the upper limit N of the displacement value of the offset value will not have a negative impact on the correctness of the decoding result. Long periods of time are broken down into shorter periods of time.
在偏移值初始化程序400结束后,图5(A)~图5(B)所代表的主要解码程序被继续执行。比较图5(A)和图2(A)可看出,步骤S501~S502为已知技术,其详细实施方式不再赘述。步骤S503可被拆解为包含以下四个判断式:(1)区间值位移量是否大于偏移值位移量,(2)区间值位移量是否等于偏移值位移量,(3)偏移值有效量的末八位元是否大于或等于区间值有效量,以及(4)被保留的偏移值有效量的最高有效位元(第九位元)是否为二进制一。若判断式(1)的判断结果为是,或者判断式(2)~(4)的三个判断结果皆为是,则步骤S503的判断结果即为是,判定待解码符号为一较小机率符号的步骤S504会被执行。相对地,若判断式(1)的判断结果为否,且判断式(2)、(3)、(4)的判断结果中有任一个判断结果为否,则步骤S503的判断结果即为否,判定待解码符号为一较大机率符号的步骤S523会被执行。After the offset value initialization procedure 400 ends, the main decoding procedures represented by FIG. 5(A)-FIG. 5(B) are continued to be executed. Comparing FIG. 5(A) with FIG. 2(A), it can be seen that steps S501-S502 are known technologies, and the detailed implementation thereof will not be repeated here. Step S503 can be disassembled to include the following four judgment formulas: (1) whether the interval value displacement is greater than the offset value displacement, (2) whether the interval value displacement is equal to the offset value displacement, (3) the offset value Whether the last octet of the effective amount is greater than or equal to the effective amount of the interval value, and (4) whether the most significant bit (ninth bit) of the reserved offset value effective amount is a binary one. If the judgment result of judgment formula (1) is yes, or the three judgment results of judgment formula (2)~(4) are all yes, then the judgment result of step S503 is yes, and it is determined that the symbol to be decoded is a small probability The symbolic step S504 will be executed. Relatively, if the judgment result of the judgment formula (1) is negative, and any one of the judgment results of the judgment formulas (2), (3), and (4) is negative, then the judgment result of step S503 is no , the step S523 of determining that the symbol to be decoded is a symbol with a higher probability will be executed.
须说明的是,在实务上,步骤S503中的四个判断式不一定要全部执行。举例而言,如果判断式(1)首先被执行,并且发现判断式(1)的判断结果为是,即可确认步骤S503的判断结果必为是,不需要继续执行判断式(2)~(4)。再举例而言,如果已发现判断式(1)的判断结果为否,并且判断式(2)~(4)中有任一个判断式的判断结果为否,即可确认步骤S503的判断结果必为否,不需要继续执行其他判断式。It should be noted that, in practice, the four judgment expressions in step S503 do not necessarily have to be all executed. For example, if the judgment formula (1) is executed first, and it is found that the judgment result of the judgment formula (1) is yes, it can be confirmed that the judgment result of step S503 must be yes, and there is no need to continue to execute the judgment formulas (2)~( 4). For another example, if it is found that the judgment result of judgment formula (1) is no, and the judgment result of any judgment formula in judgment formulas (2)-(4) is no, it can be confirmed that the judgment result of step S503 must be If not, there is no need to continue to execute other judgment expressions.
此外,步骤S503亦可利用上述判断式(1)、(2)、(3)、(4)的其他等效组合来实现。举例而言,判断式(3)与(4)都与偏移值有效量相关,可被进一步结合为单一判断式。更明确地说,"偏移值有效量的末八位元大于或等于区间值有效量"与"偏移值有效量的第九位元为二进制一"同时成立,等效于"偏移值有效量大于或等于区间值有效量加上256"。藉由合并判断式(3)与(4),步骤S503所包含的判断式可以由四个精简为三个。图5(A)所呈现的即为如此修改后的步骤S503。本发明的范畴涵盖以上几个判断式的各种等效的组合变化型,不以特定组合为限。In addition, step S503 can also be implemented by using other equivalent combinations of the above judgment formulas (1), (2), (3), and (4). For example, the judgment formulas (3) and (4) are both related to the effective amount of the offset value, and can be further combined into a single judgment formula. More specifically, "the last octet of the effective value of the offset value is greater than or equal to the effective amount of the interval value" and "the ninth bit of the effective amount of the offset value is a binary one" are simultaneously true, which is equivalent to "the offset value The effective amount is greater than or equal to the interval value effective amount plus 256". By combining the judgment formulas (3) and (4), the judgment formulas included in step S503 can be simplified from four to three. Figure 5(A) presents the modified step S503. The scope of the present invention covers various equivalent combination variants of the above judgment expressions, and is not limited to specific combinations.
步骤S505~S515为已知技术,与图2中的步骤S205~S215相同,其详细实施方式不再赘述。值得注意的是,步骤S509与S510于运算时仅需要偏移值有效量的末八位元。因此,在步骤S508之前新增一个步骤S521,用以将偏移值有效量的第九位元重新设定为二进制零、仅保留末八位元,以维持运算逻辑的一致性。Steps S505-S515 are known technologies, and are the same as steps S205-S215 in FIG. 2, and the detailed implementation thereof will not be repeated here. It should be noted that only the last octet of the effective amount of the offset value is required in the operations of steps S509 and S510. Therefore, before step S508, a new step S521 is added to reset the ninth bit of the effective value of the offset value to binary zero, and only keep the last eight bits, so as to maintain the consistency of the operation logic.
随后的步骤S516~S517为偏移值预读程序,与图4中的步骤S403~S404作用相同。更具体地说,步骤S516于决定是否停止偏移值预读程序时,亦将是否"偏移值位移量小于一偏移值位移量上限N"纳入考量,藉此避免因偏移值位移量过高而造成的解码流程崩溃。若步骤S516的判断结果为否,偏移值预读程序即停止,且偏移值有效量的最高有效位元(第九位元)被保留,供下一次的符号判断程序(步骤S503)使用。也就是说,不同于解码程序200,解码程序500并未在偏移值预读程序之后包含一个舍弃偏移值有效量的第九位元的步骤(步骤S218)。如图5(B)所示,若步骤S516的判断结果为否,更新上下文模型并回传解码结果的步骤S522便会被执行。Subsequent steps S516-S517 are offset value pre-reading programs, which have the same function as steps S403-S404 in FIG. 4 . More specifically, when determining whether to stop the offset value pre-reading program in step S516, whether "the offset value displacement is less than an offset value displacement upper limit N" is also taken into consideration, so as to avoid the error caused by the offset value displacement. The decoding process crashes caused by too high. If the judgment result of step S516 is no, the offset value pre-reading program stops immediately, and the most significant bit (ninth bit) of the offset value effective amount is reserved for the next sign judgment program (step S503) to use . That is to say, different from the decoding procedure 200, the decoding procedure 500 does not include a step of discarding the ninth bit of the effective amount of the offset value after the offset value pre-reading procedure (step S218). As shown in FIG. 5(B), if the judgment result of step S516 is negative, step S522 of updating the context model and returning the decoding result will be executed.
另一方面,不同于解码程序200,在待解码符号被判定为一较大机率符号(步骤S523)之后,在解码程序500不会立即执行更新上下文模型并回传解码结果的步骤S522。如图5(B)所示,步骤S523之后有一个判断步骤S524,用以判断区间值位移量是否等于偏移值位移量上限N(步骤S524)。若步骤S523的判断结果为是,步骤S514~S517会被执行。若步骤S523的判断结果为否,更新上下文模型并回传解码结果的步骤S522才会被执行。On the other hand, unlike the decoding program 200, after the symbol to be decoded is determined to be a symbol with a higher probability (step S523), the decoding program 500 does not immediately execute the step S522 of updating the context model and returning the decoding result. As shown in FIG. 5(B), step S523 is followed by a judging step S524 for judging whether the displacement of the interval value is equal to the upper limit N of the displacement of the offset value (step S524). If the determination result of step S523 is yes, steps S514-S517 will be executed. If the judgment result of step S523 is negative, step S522 of updating the context model and returning the decoding result will be executed.
本发明所属技术领域中具有通常知识者可理解,在图4及图5(A)~图5(B)中,某些步骤的顺序或其中的判断逻辑的组合方式可被等效调换,并且不会影响该解码方法的整体效果。Those with ordinary knowledge in the technical field of the present invention can understand that in Fig. 4 and Fig. 5 (A) ~ Fig. 5 (B), the order of some steps or the combination of judgment logic therein can be equivalently exchanged, and Will not affect the overall effect of the decoding method.
根据本发明的另一具体实施例为一种应用于一数字音视频编解码技术标准系统的解码装置,用以解码一音视频数据,其功能方块图绘示于图6。解码装置600包含一前置作业电路601、一符号判断电路602、一较小机率符号区间值决定电路603、一偏移值有效量重设电路604、一区间值有效量重设电路605、一偏移值预读电路606、一预读驱动电路607,以及一上下文更新电路608。Another specific embodiment according to the present invention is a decoding device applied to a digital audio-video codec technology standard system for decoding an audio-video data, and its functional block diagram is shown in FIG. 6 . The decoding device 600 includes a pre-operation circuit 601, a symbol judgment circuit 602, a smaller probability symbol interval value determination circuit 603, an offset value effective amount reset circuit 604, an interval value effective amount reset circuit 605, a Offset pre-read circuit 606 , a pre-read driver circuit 607 , and a context update circuit 608 .
前置作业电路601负责执行偏移值初始化程序(对应于步骤S401~S404)、读取上下文模型(对应于步骤S501)、依据旧区间值和较大机率符号出现机率更新区间值并设定一判断旗帜(对应于步骤S502)。此外,前置作业电路601中亦预先储存有一偏移值位移量上限N。实务上,前置作业电路601可设有多个暂存器,用以储存该等随后将用于解码程序的参数或变数。须强调的是,在偏移值初始化程序中,前置作业电路601于判断是否应停止偏移值预读程序时,会同时考量"偏移值有效量小于256"以及"偏移值位移量小于一偏移值位移量上限N"(对应于步骤S403),藉此避免因偏移值位移量过高而造成的解码流程崩溃。The pre-operation circuit 601 is responsible for executing the offset value initialization program (corresponding to steps S401-S404), reading the context model (corresponding to step S501), updating the interval value and setting a Determine the flag (corresponding to step S502). In addition, the pre-operation circuit 601 also pre-stores an upper limit N of offset value displacement. In practice, the pre-operation circuit 601 may be provided with a plurality of registers for storing the parameters or variables that will be used in the decoding process later. It should be emphasized that in the offset value initialization procedure, the pre-operation circuit 601 will simultaneously consider "the effective offset value is less than 256" and "the offset value displacement amount" when judging whether to stop the offset value pre-reading procedure. is less than an upper limit N" of the offset value displacement (corresponding to step S403), thereby avoiding the collapse of the decoding process caused by too high offset value displacement.
符号判断电路602可自前置作业电路601得知目前的较大机率符号是二进制零或二进制一。符号判断电路602负责根据前置作业电路601提供的区间值位移量、偏移值位移量、偏移值有效量与区间值有效量进行符号判断程序(对应于步骤S503),以判断音视频数据中的一待解码符号为一较大机率符号或一较小机率符号(对应于步骤S504、S523)。值得注意的是,前置作业电路601提供给符号判断电路602的偏移值有效量共有九个位元,其最高有效位元(第九位元)并未在前一次偏移值预读程序(可能由前置作业电路601或是偏移值预读电路606执行)结束后被重设。并且,此第九位元是符号判断电路602进行符号判断程序时的参考依据之一。The symbol judging circuit 602 can learn from the pre-operation circuit 601 that the current symbol with a higher probability is a binary zero or a binary one. The symbol judging circuit 602 is responsible for carrying out the symbol judging procedure (corresponding to step S503) according to the interval value displacement amount, the offset value displacement amount, the offset value effective amount and the interval value effective amount provided by the pre-operation circuit 601 (corresponding to step S503), to judge audio and video data A symbol to be decoded is a higher probability symbol or a lower probability symbol (corresponding to steps S504 and S523). It is worth noting that the effective value of the offset value provided by the pre-operation circuit 601 to the symbol judgment circuit 602 has nine bits in total, and its most significant bit (ninth bit) has not been used in the previous offset value pre-reading procedure. (perhaps executed by the pre-operation circuit 601 or the offset value pre-reading circuit 606) is reset after completion. Moreover, the ninth bit is one of the references when the symbol judgment circuit 602 performs the symbol judgment procedure.
较小机率符号区间值决定电路603与偏移值有效量重设电路604都是受到符号判断电路602的输出信号驱动而运作。若符号判断电路602判定目前的待解码符号为一较小机率符号,较小机率符号区间值决定电路603会根据前置作业电路601提供的较大机率符号出现机率、判断旗帜以及一旧区间值有效量,决定一较小机率符号区间值(对应于步骤S505~S507)。此外,若符号判断电路602判定目前的待解码符号为一较小机率符号,偏移值有效量重设电路604首先会将偏移值有效量的最高有效位元设定为二进制零,且取偏移值有效量的后八位元做为一新的偏移值有效量(对应于步骤S521)。接着,偏移值有效量重设电路604会根据前置作业电路601提供的区间值位移量、偏移值位移量以及区间值有效量,再次重设偏移值有效量(对应于步骤S508~S510)。在图6中,偏移值有效量重设电路604产生的偏移值有效量被标示为"偏移值有效量_1"。The smaller probability symbol interval value determination circuit 603 and the effective offset value reset circuit 604 are both driven by the output signal of the symbol determination circuit 602 to operate. If the symbol judging circuit 602 determines that the current symbol to be decoded is a symbol with a lower probability, the interval value determination circuit 603 for the symbol with a lower probability will determine the occurrence probability of the symbol with a higher probability provided by the pre-operation circuit 601, the judgment flag, and an old interval value. The effective amount is to determine a smaller probability symbol interval value (corresponding to steps S505-S507). In addition, if the symbol judging circuit 602 determines that the current symbol to be decoded is a symbol with a low probability, the offset value effective amount reset circuit 604 first sets the most significant bit of the offset value effective amount to binary zero, and takes The last eight bits of the effective amount of the offset value are used as a new effective amount of the offset value (corresponding to step S521). Then, the offset value effective amount reset circuit 604 will reset the offset value effective amount again according to the interval value displacement amount, the offset value displacement amount and the interval value effective amount provided by the pre-operation circuit 601 (corresponding to steps S508- S510). In FIG. 6 , the offset effective amount generated by the offset effective amount reset circuit 604 is marked as "offset effective amount_1".
根据较小机率符号区间值决定电路603提供的较小机率符号区间值,区间值有效量重设电路605会重新设定较小机率符号区间值以及区间值有效量(对应于步骤S511~S513)。在这个过程中,区间值有效量重设电路605也会相对应地调整偏移值有效量(对应于步骤S512)。在图6中,区间值有效量重设电路605产生的偏移值有效量被标示为"偏移值有效量_2"。接着,偏移值预读电路606会先将区间值位移量与偏移值位移量重设为零,随后根据区间值有效量重设电路605产生的更新后偏移值有效量以及前置作业电路601提供的偏移值位移量上限,产生新的偏移值有效量与偏移值位移量(对应于步骤S514~S517)。在图6中,偏移值预读电路606产生的偏移值有效量被标示为"偏移值有效量_3"。偏移值预读电路606负责执行的工作即为一偏移值预读程序。须强调的是,偏移值预读电路606于判断是否应停止该偏移值预读程序时,会同时考量"偏移值有效量小于256"以及"偏移值位移量小于一偏移值位移量上限N"(对应于步骤S516)。如此一来,因偏移值位移量过高而造成的解码流程崩溃问题即可被有效避免。此外,于该偏移值预读程序停止后,偏移值预读电路606会保留偏移值有效量的最高有效位元,供符号判断电路602下一次进行符号判断程序时使用。According to the smaller probability symbol interval value provided by the smaller probability symbol interval value determination circuit 603, the interval value effective amount reset circuit 605 will reset the smaller probability symbol interval value and the interval value effective amount (corresponding to steps S511-S513) . During this process, the effective interval value reset circuit 605 will also correspondingly adjust the effective amount of the offset value (corresponding to step S512). In FIG. 6 , the effective offset value generated by the interval value effective amount resetting circuit 605 is marked as "offset effective amount_2". Next, the offset value pre-reading circuit 606 first resets the interval value displacement and the offset value displacement to zero, and then resets the effective offset value generated by the effective interval value reset circuit 605 and the pre-work The upper limit of the offset value provided by the circuit 601 generates a new effective offset value and offset value displacement (corresponding to steps S514-S517). In FIG. 6 , the effective offset value generated by the offset value pre-reading circuit 606 is marked as "offset effective amount_3". The work performed by the offset value pre-reading circuit 606 is an offset value pre-reading procedure. It should be emphasized that, when the offset value pre-reading circuit 606 judges whether the offset value pre-reading procedure should be stopped, it will simultaneously consider "the effective amount of the offset value is less than 256" and "the displacement of the offset value is less than an offset value". Displacement upper limit N" (corresponding to step S516). In this way, the problem of decoding process collapse caused by excessive displacement of the offset value can be effectively avoided. In addition, after the offset value pre-reading process is stopped, the offset value pre-reading circuit 606 will retain the most significant bit of the effective value of the offset value for use when the symbol determination circuit 602 performs the symbol determination process next time.
另一方面,若符号判断电路602判定待解码符号为一较大机率符号,预读驱动电路607会负责判断目前的区间值位移量是否等于偏移值位移量上限(对应于步骤S524)。若预读驱动电路607的判断结果为是,预读驱动电路607也会请求偏移值预读电路606执行上述偏移值预读程序。若预读驱动电路607的判断结果为否,或者是偏移值预读程序已结束,上下文更新电路608便会根据自区间值有效量重设电路605收到的区间值有效量,以及自偏移值预读电路606收到的偏移值有效量、偏移值位移量、区间值位移量,更新上下文模型供前置作业电路601参考(对应于步骤S522)。On the other hand, if the symbol judging circuit 602 determines that the symbol to be decoded is a symbol with a higher probability, the read-ahead driving circuit 607 is responsible for judging whether the current interval value displacement is equal to the upper limit of the offset value displacement (corresponding to step S524). If the judgment result of the pre-reading driving circuit 607 is yes, the pre-reading driving circuit 607 will also request the offset value pre-reading circuit 606 to execute the above-mentioned offset value pre-reading procedure. If the judgment result of the pre-reading driving circuit 607 is negative, or the offset value pre-reading program has ended, the context update circuit 608 will reset the effective amount of the interval value received by the circuit 605 according to the effective amount of the self-interval value, and the self-bias The offset value pre-reading circuit 606 receives the effective offset value, offset value displacement, and interval value displacement, and updates the context model for reference by the pre-operation circuit 601 (corresponding to step S522).
实务上,上述各电路可分别利用多种控制和处理平台实现,包含固定式的和可程式化的逻辑电路,例如可程式化逻辑门阵列、针对特定应用的积体电路、微控制器、微处理器、数字信号处理器。此外,上述各电路亦可被设计为透过执行一存储器(未绘示)中所储存的处理器指令,来完成多种任务。本发明所属技术领域中具有通常知识者可理解,有多种电路组态和元件可在不背离本发明精神的情况下实现本发明的概念。再者,于实际应用中,该等功能方块中的某些非同时运作且功能相似的电路可以被设计为共用硬件,以降低实现成本。In practice, the above-mentioned circuits can be implemented using a variety of control and processing platforms, including fixed and programmable logic circuits, such as programmable logic gate arrays, application-specific integrated circuits, microcontrollers, microcontrollers, etc. processor, digital signal processor. In addition, each of the above circuits can also be designed to perform various tasks by executing processor instructions stored in a memory (not shown). Those skilled in the art to which the present invention pertains can understand that there are various circuit configurations and elements that can realize the concept of the present invention without departing from the spirit of the present invention. Furthermore, in practical applications, some non-simultaneously operating circuits with similar functions in these functional blocks can be designed to share hardware to reduce implementation costs.
须说明的是,先前在介绍图4及图5(A)~图5(B)呈现的解码流程时描述的各种操作变化亦可应用至解码装置600,其细节不再赘述。It should be noted that the various operation changes described in the decoding process presented in FIG. 4 and FIG. 5(A)-FIG.
如先前所述,出现在步骤S403、S516、S524中的偏移值位移量上限N可为1到254间的任一正整数。于根据本发明的一实施例中,偏移值位移量上限N被设定为1。若将此设定代入图4中的偏移值初始化程序400,会产生一个更为简化的流程。由于偏移值位移量在步骤S401中被设定为零,第一次执行步骤S403时,偏移值位移量等于零,使得"偏移值位移量小于偏移值位移量上限N(=1)"这个条件必然成立。因此,只要"偏移值有效量小于256"这个条件成立,步骤S404就会被执行,令偏移值位移量被提高为1,且令偏移值有效量左移一位元并读进一个位元。在偏移值初始化程序400中,当步骤S404结束后,步骤S403会被重新执行。由于目前的偏移值位移量等于1,"偏移值位移量小于偏移值位移量上限N(=1)"这个条件不再成立,因而使得第二次执行步骤S403的判断结果必然为否。As mentioned above, the upper limit N of the offset displacement amount appearing in steps S403 , S516 , and S524 can be any positive integer between 1 and 254. In an embodiment according to the present invention, the upper limit N of the displacement amount of the offset value is set to 1. If this setting is substituted into the offset value initialization program 400 in FIG. 4, a more simplified flow will be generated. Since the offset value displacement is set to zero in step S401, when step S403 is executed for the first time, the offset value displacement is equal to zero, so that "the offset value displacement is less than the offset value displacement upper limit N (=1) "This condition must be met. Therefore, as long as the condition of "the effective amount of the offset value is less than 256" is established, step S404 will be executed, so that the offset value displacement amount is increased to 1, and the effective amount of the offset value is shifted to the left by one bit and read into a bits. In the offset value initialization procedure 400, after the step S404 is completed, the step S403 will be re-executed. Since the current offset value displacement is equal to 1, the condition "the offset value displacement is less than the upper limit N (= 1) of the offset value displacement" is no longer true, thus making the judgment result of the second execution of step S403 necessarily negative .
综上所述,若将偏移值位移量上限N设定为1,偏移值初始化程序400可被简化为图7所示的流程。步骤S701~S702与步骤S401~S402相同。步骤S703较步骤S403简单,仅判断"是否偏移值有效量小于256"。步骤S704亦与步骤S404相同。在这个简化后的偏移值初始化程序中,步骤S704只会被执行一次,随后该偏移值预读程序即停止。To sum up, if the upper limit N of the offset value displacement is set to 1, the offset value initialization procedure 400 can be simplified as the process shown in FIG. 7 . Steps S701-S702 are the same as steps S401-S402. Step S703 is simpler than step S403, and only judges "whether the effective offset value is less than 256". Step S704 is also the same as step S404. In this simplified offset value initialization procedure, step S704 is only executed once, and then the offset value look-ahead procedure stops.
相似地,上述概念亦可被应用至解码程序500中的步骤S516、S524。图8呈现据此简化后的后半段解码程序。步骤S811接续于图5(A)的步骤S510之后,而步骤S823接续于图5(A)的步骤S503之后。比较图7与图5(B)可看出,将偏移值位移量上限N设定为1可令步骤S816、S824较原本的步骤S516、S524更为简单。Similarly, the above concepts can also be applied to steps S516 and S524 in the decoding procedure 500 . Fig. 8 presents the simplified second half of the decoding procedure accordingly. Step S811 is subsequent to step S510 in FIG. 5(A), and step S823 is subsequent to step S503 in FIG. 5(A). Comparing FIG. 7 with FIG. 5(B), it can be seen that setting the upper limit N of the offset displacement amount to 1 can make steps S816 and S824 simpler than the original steps S516 and S524.
须说明的是,将偏移值位移量上限N设定为1的概念亦可应用在图1及图2(A)~图2(B)呈现的解码流程。因此,根据本发明的另一具体实施例为一种应用于AVS系统的解码方法,用以解码一音视频数据。根据该解码方法,一偏移值预读程序包含以下步骤:(a)判断一偏移值有效量是否低于一特定数值;(b)若步骤(a)的判断结果为是,为该偏移值有效量读取一个新的最低有效位元;其中,步骤(b)被执行一次之后,该偏移值预读程序即停止。It should be noted that the concept of setting the upper limit N of the offset displacement amount to 1 can also be applied to the decoding process shown in FIG. 1 and FIG. 2(A)-FIG. 2(B). Therefore, another specific embodiment of the present invention is a decoding method applied to an AVS system for decoding audio and video data. According to the decoding method, an offset value pre-reading program includes the following steps: (a) judging whether an offset value effective amount is lower than a specific value; (b) if the judgment result of step (a) is yes, the A new least significant bit is read from the effective amount of shifting; wherein, after the step (b) is executed once, the pre-reading procedure of the offset value stops.
此外,将偏移值位移量上限N设定为1的概念亦可应用在解码装置600等硬件电路中。根据本发明的另一具体实施例为一种应用AVS系统的解码装置,用以解码一音视频数据。该解码装置包含用以执行一偏移值预读程序的一偏移值预读电路(例如图6中的偏移值预读电路606)。该偏移值预读电路包含一判断电路与一读取电路。该判断电路用以判断一偏移值有效量是否低于一特定数值(256)。若该判断电路的判断结果为是,该读取电路为该偏移值有效量读取一个新的最低有效位元后即停止该偏移值预读程序。In addition, the concept of setting the upper limit N of the offset displacement amount to 1 can also be applied in hardware circuits such as the decoding device 600 . Another specific embodiment according to the present invention is a decoding device using the AVS system for decoding audio and video data. The decoding device includes an offset value pre-reading circuit (such as the offset value pre-reading circuit 606 in FIG. 6 ) for performing an offset value pre-reading procedure. The offset value pre-reading circuit includes a judging circuit and a reading circuit. The judging circuit is used to judge whether an effective amount of an offset value is lower than a specific value (256). If the judging result of the judging circuit is yes, the reading circuit stops the offset value pre-reading procedure after reading a new least significant bit for the effective amount of the offset value.
于实际应用中,AVS传送端常常会将音视频数据的绝对值与正负符号分别编码,也就是先对多笔数据的绝对值施以编码程序,随后再编码该多笔数据所各自对应的正负符号。在大部分的情况下,正负符号的出现顺序相当随机(正负符号各自出现的机率都接近0.5),于编码过程中对正负符号施以压缩程序往往无法得到良好的压缩效果。因此,AVS传送端会将这些正负符号视为回避(bypass)数据,采用较为简略的压缩/编码程序。举例而言,不同于非回避数据,回避数据的较大机率符号是固定值,较大机率符号出现机率也是固定值。In practical applications, the AVS transmitter often encodes the absolute value and sign of the audio and video data separately, that is, the absolute value of multiple pieces of data is encoded first, and then the respective corresponding values of the multiple pieces of data are encoded. Plus and minus signs. In most cases, the order of appearance of the positive and negative symbols is quite random (the probability of each of the positive and negative symbols appearing is close to 0.5), and applying a compression program to the positive and negative symbols during the encoding process often fails to obtain a good compression effect. Therefore, the AVS transmitter will regard these signs as bypass data and adopt a relatively simple compression/encoding procedure. For example, unlike the non-avoidance data, the avoidance data has a higher-probability symbol with a fixed value, and a higher-probability symbol occurrence rate is also a fixed value.
上述回避数据的特性能被利用来简化AVS接收端中的解码程序。根据本发明的一具体实施例为一种应用于AVS系统的解码方法,其流程图绘示于图9。步骤S901为判断一音视频数据中是否包含至少一笔待解码回避数据。若步骤S901的判断结果为否,步骤S902被执行,亦即对该音视频数据施以一第一解码程序(例如图4及图5(A)~图5(B)呈现的一般解码流程)。若步骤S901的判断结果为是,步骤S903被执行,亦即对该音视频数据中的非回避数据施以上述第一解码程序,并且对该至少一笔待解码回避数据施以一第二解码程序。不同于第一解码程序,第二解码程序可以是针对回避数据而设计,较第一解码程序简单。可理解的是,相较于对所有音视频数据都施以一般解码流程的先前技术,解码程序900能降低AVS接收端整体耗用的运算资源。The above-mentioned feature of avoiding data can be exploited to simplify the decoding process in the AVS receiver. A specific embodiment according to the present invention is a decoding method applied to an AVS system, the flow chart of which is shown in FIG. 9 . Step S901 is to determine whether an audio-video data contains at least one piece of avoidance data to be decoded. If the judgment result of step S901 is negative, step S902 is executed, that is, a first decoding process is applied to the audio and video data (for example, the general decoding process shown in FIG. 4 and FIG. 5(A)-FIG. 5(B)) . If the judgment result of step S901 is yes, step S903 is executed, that is, the above-mentioned first decoding procedure is applied to the non-avoidance data in the audio and video data, and a second decoding is applied to the at least one piece of avoidance data to be decoded program. Different from the first decoding procedure, the second decoding procedure may be designed for avoiding data, which is simpler than the first decoding procedure. It can be understood that, compared with the prior art that applies a general decoding process to all audio and video data, the decoding program 900 can reduce the overall computing resources consumed by the AVS receiving end.
图10呈现了第二解码程序的一种详细实施范例。步骤S1001与步骤S501相同。如先前所述,回避数据的较大机率符号出现机率为一已知的定值。AVS规范目前要求将此较大机率符号出现机率设定为对应于数值1024。因此,将较大机率符号出现机率右移两位元的结果(=256)无论如何一定会大于区间值有效量的可能最大值(=255)。基于这个特性,某些判断步骤可被省略。举例而言,由于图3的步骤S202A的判断结果必然为否,将使得判断旗帜必然为1。在这个情况下,判断旗帜实际上没有存在的必要。因此,步骤S1002可以只包含图3中的步骤S202E~S202F。Fig. 10 presents a detailed implementation example of the second decoding procedure. Step S1001 is the same as step S501. As mentioned earlier, the occurrence probability of the higher probability symbol of the avoidance data is a known constant value. The AVS specification currently requires that this higher probability symbol occurrence probability be set to correspond to a value of 1024. Therefore, the result of right-shifting the occurrence probability of a symbol with a higher probability by two bits (=256) must be greater than the possible maximum value (=255) of the effective amount of the interval value anyway. Based on this feature, some judgment steps can be omitted. For example, since the determination result of step S202A in FIG. 3 must be negative, the determination flag must be 1. In this case, the judgment flag is not actually necessary. Therefore, step S1002 may only include steps S202E˜S202F in FIG. 3 .
随后的步骤S1003~S1004、S1021、S1008~S1010各自相同于步骤S503~S504、S521、S508~S510。承上所述,判断旗帜必然为1,步骤S505的判断结果因此必然为否,使得较小机率符号区间值必然会在步骤S507中被设定为等于较大机率符号出现机率右移两位元(=256)加上旧区间值有效量。如此所产生的较小机率符号区间值必然会使得步骤S511的判断结果为否。基于上述逻辑推演,步骤S505~S507以及S511~S513在解码程序1000中都可省略。随后的步骤S1014~S1017与步骤S1022~S1024各自相同于步骤S514~S517与步骤S522~S524,不再赘述。若以图4及图5(A)~图5(B)呈现的解码流程做为第一解码程序来比较,图10呈现的第二解码程序显然更为简化。Subsequent steps S1003-S1004, S1021, S1008-S1010 are respectively the same as steps S503-S504, S521, S508-S510. As mentioned above, the judgment flag must be 1, and the judgment result of step S505 must therefore be negative, so that the interval value of the symbol with a smaller probability must be set in step S507 to be equal to the occurrence probability of a symbol with a higher probability, shifted to the right by two bits (=256) plus the old interval value effective amount. The smaller probability symbol interval value generated in this way will inevitably make the determination result of step S511 negative. Based on the above logic deduction, steps S505-S507 and S511-S513 can be omitted in the decoding program 1000 . Subsequent steps S1014-S1017 and steps S1022-S1024 are respectively the same as steps S514-S517 and steps S522-S524, and will not be repeated here. Comparing the decoding process shown in FIG. 4 and FIG. 5(A) to FIG. 5(B) as the first decoding process, the second decoding process shown in FIG. 10 is obviously more simplified.
此外,对AVS接收端来说,回避数据通常是跟随在非回避数据之后送达。举例而言,AVS接收端可预期在收到连续多笔数据的绝对值之后,随后将收到一连串该多笔数据所各自对应的正负符号。更明确地说,在收到连续M笔数据的绝对值之后(M为大于1的整数),AVS接收端可预期随后将收到对应于连续M个正负符号的待解码回避数据。值得注意的是,当音视频数据中包含连续多笔待解码回避数据,第二解码程序可以被更进一步地简化,详述如下。In addition, for the AVS receiver, avoidance data is usually delivered after non-evasion data. For example, the AVS receiver can expect that after receiving the absolute values of multiple consecutive pieces of data, it will subsequently receive a series of positive and negative signs corresponding to the multiple pieces of data. More specifically, after receiving the absolute values of M consecutive pieces of data (M is an integer greater than 1), the AVS receiver can expect to receive the avoidance data corresponding to M consecutive positive and negative symbols to be decoded. It should be noted that when the audio and video data contains multiple consecutive pieces of avoidance data to be decoded, the second decoding procedure can be further simplified, as detailed below.
假设在开始解码该M笔待解码回避数据前,稍早的偏移值预读程序已预读了P个位元的偏移值有效量(P为一整数),则偏移值位移量会等于P,这是AVS接收端原本即能掌握的资讯。于根据本发明的一实施例中,根据数值P与数值M的大小相对关系,该M笔待解码回避数据所对应的较大机率符号数量可以被快速地决定。Assuming that before starting to decode the M pieces of data to be decoded to avoid, the earlier offset value look-ahead program has pre-read the effective amount of offset value of P bits (P is an integer), then the offset value displacement will be It is equal to P, which is the information that the AVS receiver can grasp originally. In an embodiment according to the present invention, according to the relative relationship between the value P and the value M, the number of relatively high probability symbols corresponding to the M pieces of avoidance data to be decoded can be quickly determined.
首先讨论M小于P的情况。由于M大于1且已知M小于P,P必然大于2。如先前所述,区间值位移量在偏移值预读程序中会被重新设定为零。接着,在开始将该连续M笔待解码回避数据解码时,区间值位移量会在步骤S1002中被提高为1。因为目前的区间值位移量(=1)小于偏移值位移量P(>2),第一次执行的步骤S1003的判断结果必然为否,使得第一笔解码结果必然为较大机率符号。只要偏移值位移量上限N被设计为一个较高的数值(举例而言,高于M的可能最大值),随后的步骤S1024的判断结果亦必然为否。在这个情况下,图十中的步骤S1001、S1002、S1003、S1023、S1024、S1022会被依序循环执行M次。由此可推论,当M小于P,该连续M笔待解码回避数据的解码结果必然为M个较大机率符号。此外,经过这M次循环,最后的区间值位移量会被逐步提高为等于数值M。First discuss the case where M is less than P. Since M is greater than 1 and it is known that M is less than P, P must be greater than 2. As mentioned earlier, the interval offset is reset to zero during the offset lookahead procedure. Next, when starting to decode the M consecutive pieces of avoidance data to be decoded, the displacement of the interval value will be increased to 1 in step S1002 . Because the current interval value displacement (=1) is smaller than the offset value displacement P (>2), the judgment result of step S1003 executed for the first time must be negative, so that the first decoding result must be a symbol with a higher probability. As long as the upper limit N of the offset displacement amount is designed to be a higher value (for example, higher than the possible maximum value of M), the determination result of the subsequent step S1024 must also be negative. In this case, steps S1001 , S1002 , S1003 , S1023 , S1024 , and S1022 in FIG. 10 will be sequentially executed M times in a loop. It can be deduced from this that when M is smaller than P, the decoding results of the M consecutive pieces of avoidance data to be decoded must be M symbols with higher probability. In addition, after the M cycles, the final displacement of the interval value will be gradually increased to be equal to the value M.
接着讨论M大于或等于P的情况。基于步骤S1003中的判断规则,若经过偏移值预读程序后,偏移值有效量的最高有效位元为二进制一,则前(P-1)次执行的步骤S1003都会得出判断结果为否,直到第P次被执行时才得出判断结果为是。由此可推论,当M大于或等于P,且偏移值有效量的最高有效位元为二进制一,该连续M笔待解码回避数据中的前P笔待解码回避数据的解码结果必然为连续(P-1)个较大机率符号与一个较小机率符号。此外,最后的区间值位移量会被逐步提高为等于数值P。Then discuss the case where M is greater than or equal to P. Based on the judgment rule in step S1003, if after the offset value pre-reading program, the most significant bit of the effective amount of the offset value is a binary one, then the previous (P-1) step S1003 performed for the first time will obtain a judgment result of No, it is not until the execution of the Pth time that the judgment result is yes. It can be deduced from this that when M is greater than or equal to P, and the most significant bit of the effective amount of the offset value is binary one, the decoding results of the first P pieces of avoidance data to be decoded in the consecutive M pieces of avoidance data to be decoded must be continuous (P-1) higher probability symbols and one lower probability symbol. In addition, the final interval value displacement will be gradually increased to be equal to the value P.
同样基于步骤S1003中的判断规则,在M大于或等于P的情况下,若偏移值有效量的最高有效位元为二进制零,则前P次执行的步骤S1003都会得出判断结果为否。由此可推论,当M大于或等于P,且偏移值有效量的最高有效位元为二进制零,该连续M笔待解码回避数据中的前P笔待解码回避数据的解码结果必然为P个较大机率符号。此外,最后的区间值位移量会被逐步提高为等于数值(P-1)。Also based on the judgment rule in step S1003, if M is greater than or equal to P, if the most significant bit of the effective amount of the offset value is binary zero, the judgment result of step S1003 executed for the previous P times will be negative. It can be deduced from this that when M is greater than or equal to P, and the most significant bit of the effective amount of the offset value is binary zero, the decoding result of the first P pieces of avoidance data to be decoded in the consecutive M pieces of avoidance data to be decoded must be P a higher probability symbol. In addition, the final interval value displacement will be gradually increased to be equal to the value (P-1).
综上所述,根据数值P与数值M的相对关系,第二解码程序可被简化为图11所呈现的流程。首先,步骤S1101为取得数值M与数值P。接着,步骤S1102判断"M小于P"是否成立。若步骤S1102的判断结果为是,步骤S1103将被执行,亦即直接判定该连续M笔待解码回避数据的解码结果为M个较大机率符号,且将区间值位移量设定为等于数值M。若步骤S1102的判断结果为否,步骤S1104将被执行,亦即继续判断"偏移值有效量的最高有效位元为二进制一"是否成立。若步骤S1104的判断结果为是,步骤S1105将被执行,亦即直接判定该连续M笔待解码回避数据中的前P笔待解码回避数据的解码结果为连续(P-1)个较大机率符号与一个较小机率符号,并且将区间值位移量设定为等于数值P。若步骤S1104的判断结果为否,步骤S1106将被执行,亦即直接判定该连续M笔待解码回避数据中之前P笔待解码回避数据的解码结果为P个较大机率符号,并且将区间值位移量设定为等于数值(P-1)。相较于图10呈现的第二解码程序,图11呈现的第二解码程序显然更为大幅简化。To sum up, according to the relative relationship between the value P and the value M, the second decoding procedure can be simplified to the flow shown in FIG. 11 . Firstly, step S1101 is to obtain the value M and the value P. Next, step S1102 judges whether "M is less than P" is true. If the judgment result of step S1102 is yes, step S1103 will be executed, that is, it is directly judged that the decoding result of the consecutive M pieces of avoidance data to be decoded is M symbols of higher probability, and the interval value displacement is set equal to the value M . If the judgment result of step S1102 is negative, step S1104 will be executed, that is, continue to judge whether "the most significant bit of the effective amount of the offset value is a binary one" is true. If the judgment result of step S1104 is yes, step S1105 will be executed, that is, it is directly determined that the decoding results of the first P pieces of avoidance data to be decoded in the consecutive M pieces of avoidance data to be decoded are consecutive (P-1) higher probability sign with a lesser probability sign, and sets the interval-valued displacement equal to the value P. If the judgment result of step S1104 is negative, step S1106 will be executed, that is, it is directly determined that the decoding results of the previous P pieces of avoidance data to be decoded in the consecutive M pieces of avoidance data to be decoded are P symbols with a higher probability, and the interval value The displacement is set equal to the value (P-1). Compared with the second decoding procedure presented in FIG. 10 , the second decoding procedure presented in FIG. 11 is obviously much simplified.
上述利用回避数据特性来简化解码程序的概念亦可应用在硬件装置中。根据本发明的另一具体实施例为一种应用于一数字音视频编解码技术标准系统的解码装置,用以解码一音视频数据。图12为其功能方块图。解码装置1200包含一判断电路1201、一第一解码电路1202与一第二解码电路1203。判断电路1201以判断该音视频数据中是否包含至少一笔待解码回避数据。若判断电路1201的判断结果为否,第一解码电路1202负责对该音视频数据施以一第一解码程序。若判断电路1201的判断结果为是,第一解码电路1202负责对该音视频数据中的非回避数据施以第一解码程序,而第二解码电路1203负责对该至少一笔待解码回避数据施以不同于该第一解码程序的一第二解码程序。The above-mentioned concept of simplifying the decoding process by avoiding data characteristics can also be applied in hardware devices. Another specific embodiment according to the present invention is a decoding device applied to a standard system of digital audio and video codec technology, for decoding an audio and video data. Figure 12 is its functional block diagram. The decoding device 1200 includes a judging circuit 1201 , a first decoding circuit 1202 and a second decoding circuit 1203 . The judging circuit 1201 is used to judge whether the audio-video data contains at least one piece of avoidance data to be decoded. If the judgment result of the judging circuit 1201 is negative, the first decoding circuit 1202 is responsible for applying a first decoding procedure to the audio and video data. If the judging result of the judging circuit 1201 is yes, the first decoding circuit 1202 is responsible for applying the first decoding procedure to the non-avoiding data in the audio and video data, and the second decoding circuit 1203 is responsible for implementing the at least one piece of avoiding data to be decoded. With a second decoding procedure different from the first decoding procedure.
实务上,第一解码电路1202的内部电路可为先前介绍的解码装置600,而该第一解码程序可为图4及图5(A)~图5(B)呈现的解码流程,于此不赘述。在图12绘示的范例中,第二解码电路1203包含一比较器1203A、一位元检查器1203B与一输出电路1203C。比较器1203A用以比较自判断电路1201取得的数值M,以及自第一解码电路1202取得的数值P。位元检查器1203B负责检查自第一解码电路1202取得的偏移值有效量的最高有效位元是二进制一或二进制零。In practice, the internal circuit of the first decoding circuit 1202 can be the previously introduced decoding device 600, and the first decoding procedure can be the decoding process shown in FIG. 4 and FIG. 5(A)-FIG. repeat. In the example shown in FIG. 12 , the second decoding circuit 1203 includes a comparator 1203A, a bit checker 1203B and an output circuit 1203C. The comparator 1203A is used for comparing the value M obtained from the judging circuit 1201 with the value P obtained from the first decoding circuit 1202 . The bit checker 1203B is responsible for checking whether the most significant bit of the offset value valid amount obtained from the first decoding circuit 1202 is a binary one or a binary zero.
如果比较器1203A判断数值M小于数值P,输出电路1203C即输出M个较大机率符号做为解码结果,并将区间值位移量等于数值M的设定提供给第一解码电路1202。如果比较器1203A判断M大于或等于P,且位元检查器1203B判断偏移值有效量的最高有效位元为二进制一,输出电路1203C即输出(P-1)个较大机率符号与一个较小机率符号做为解码结果,并将区间值位移量等于数值P的设定提供给第一解码电路1202。如果比较器1203A判断M大于或等于P,且位元检查器1203B判断偏移值有效量的最高有效位元为二进制零,输出电路1203C即输出P个较大机率符号做为解码结果,并将区间值位移量等于数值(P-1)的设定提供给第一解码电路1202。If the comparator 1203A judges that the value M is smaller than the value P, the output circuit 1203C outputs M symbols with higher probability as the decoding result, and provides the first decoding circuit 1202 with the interval value displacement equal to the value M. If the comparator 1203A judges that M is greater than or equal to P, and the bit checker 1203B judges that the most significant bit of the effective amount of the offset value is a binary one, the output circuit 1203C promptly outputs (P−1) symbols with a higher probability and a higher probability symbol The low-probability symbol is used as the decoding result, and the setting of interval value displacement equal to the value P is provided to the first decoding circuit 1202 . If the comparator 1203A judges that M is greater than or equal to P, and the bit checker 1203B judges that the most significant bit of the effective amount of the offset value is a binary zero, the output circuit 1203C outputs P symbols with higher probability as the decoding result, and The setting of interval value displacement equal to the value (P−1) is provided to the first decoding circuit 1202 .
须说明的是,先前在介绍图9~图11呈现的解码流程时描述的各种操作变化亦可应用至解码装置1200,其细节不再赘述。It should be noted that the various operation changes described above when introducing the decoding process shown in FIGS. 9 to 11 can also be applied to the decoding device 1200 , and the details will not be repeated here.
藉由以上较佳具体实施例的详述,希望能更加清楚描述本发明的特征与精神,而并非以上述所揭示的较佳具体实施例来对本发明的范畴加以限制。相反地,其目的是希望能涵盖各种改变及具相等性的安排于本发明所欲申请的专利范围的范畴内。Through the above detailed description of the preferred embodiments, it is hoped that the features and spirit of the present invention can be described more clearly, rather than limiting the scope of the present invention by the preferred embodiments disclosed above. On the contrary, the intention is to cover various changes and equivalent arrangements within the scope of the claimed patent scope of the present invention.
| Application Number | Priority Date | Filing Date | Title | 
|---|---|---|---|
| CN201610803547.4ACN107801033B (en) | 2016-09-06 | 2016-09-06 | Decoding method and decoding device applied to digital audio and video codec technology standard system | 
| Application Number | Priority Date | Filing Date | Title | 
|---|---|---|---|
| CN201610803547.4ACN107801033B (en) | 2016-09-06 | 2016-09-06 | Decoding method and decoding device applied to digital audio and video codec technology standard system | 
| Publication Number | Publication Date | 
|---|---|
| CN107801033Atrue CN107801033A (en) | 2018-03-13 | 
| CN107801033B CN107801033B (en) | 2021-05-11 | 
| Application Number | Title | Priority Date | Filing Date | 
|---|---|---|---|
| CN201610803547.4AActiveCN107801033B (en) | 2016-09-06 | 2016-09-06 | Decoding method and decoding device applied to digital audio and video codec technology standard system | 
| Country | Link | 
|---|---|
| CN (1) | CN107801033B (en) | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| US20030113030A1 (en)* | 2001-12-18 | 2003-06-19 | Tomohiro Kimura | Encoding apparatus, decoding apparatus, encoding/decoding apparatus, encoding method, decoding method, encoding/decoding method, and programs | 
| US20060126744A1 (en)* | 2004-12-10 | 2006-06-15 | Liang Peng | Two pass architecture for H.264 CABAC decoding process | 
| CN1983334A (en)* | 2005-12-05 | 2007-06-20 | 华为技术有限公司 | Method and device for realizing arithmetic coding and decoding | 
| CN101167368A (en)* | 2005-12-05 | 2008-04-23 | 华为技术有限公司 | A method and device for realizing arithmetic encoding and decoding | 
| CN101212676A (en)* | 2006-12-29 | 2008-07-02 | 北京展讯高科通信技术有限公司 | Efficient and parallel CABAC decoding method and device | 
| US20120293343A1 (en)* | 2011-05-17 | 2012-11-22 | National Cheng Kung University | Method for high throughput parallel avc/h.264 context-based adaptive binary arithmetic coding decoder | 
| US20120299757A1 (en)* | 2006-08-25 | 2012-11-29 | Sony Computer Entertainment Inc. | Entropy decoding methods and apparatus using most probable and least probable signal cases | 
| AU2011247855A1 (en)* | 2011-11-08 | 2013-05-23 | Canon Kabushiki Kaisha | Method, apparatus and system for updating a probability estimate for arithmetic coding | 
| CN104243984A (en)* | 2013-06-19 | 2014-12-24 | 晨星半导体股份有限公司 | Decoding method and decoding device applied to digital audio and video codec technology standard system | 
| US20140376610A1 (en)* | 2013-06-19 | 2014-12-25 | Mstar Semiconductor, Inc. | Decoding method and decoding apparatus for avs system | 
| CN104394418A (en)* | 2014-09-23 | 2015-03-04 | 清华大学 | Method and device for encoding and decoding video data | 
| CN104980749A (en)* | 2014-04-11 | 2015-10-14 | 扬智科技股份有限公司 | Arithmetic coding decoding device and method | 
| CN105103548A (en)* | 2013-04-08 | 2015-11-25 | 索尼公司 | Select the maximum dynamic range of the transformation data and the data precision of the transformation matrix according to the bit depth of the input data | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| US20030113030A1 (en)* | 2001-12-18 | 2003-06-19 | Tomohiro Kimura | Encoding apparatus, decoding apparatus, encoding/decoding apparatus, encoding method, decoding method, encoding/decoding method, and programs | 
| US20060126744A1 (en)* | 2004-12-10 | 2006-06-15 | Liang Peng | Two pass architecture for H.264 CABAC decoding process | 
| CN1983334A (en)* | 2005-12-05 | 2007-06-20 | 华为技术有限公司 | Method and device for realizing arithmetic coding and decoding | 
| CN101167368A (en)* | 2005-12-05 | 2008-04-23 | 华为技术有限公司 | A method and device for realizing arithmetic encoding and decoding | 
| US20120299757A1 (en)* | 2006-08-25 | 2012-11-29 | Sony Computer Entertainment Inc. | Entropy decoding methods and apparatus using most probable and least probable signal cases | 
| CN101212676A (en)* | 2006-12-29 | 2008-07-02 | 北京展讯高科通信技术有限公司 | Efficient and parallel CABAC decoding method and device | 
| US20120293343A1 (en)* | 2011-05-17 | 2012-11-22 | National Cheng Kung University | Method for high throughput parallel avc/h.264 context-based adaptive binary arithmetic coding decoder | 
| AU2011247855A1 (en)* | 2011-11-08 | 2013-05-23 | Canon Kabushiki Kaisha | Method, apparatus and system for updating a probability estimate for arithmetic coding | 
| CN105103548A (en)* | 2013-04-08 | 2015-11-25 | 索尼公司 | Select the maximum dynamic range of the transformation data and the data precision of the transformation matrix according to the bit depth of the input data | 
| CN104243984A (en)* | 2013-06-19 | 2014-12-24 | 晨星半导体股份有限公司 | Decoding method and decoding device applied to digital audio and video codec technology standard system | 
| US20140376610A1 (en)* | 2013-06-19 | 2014-12-25 | Mstar Semiconductor, Inc. | Decoding method and decoding apparatus for avs system | 
| CN104980749A (en)* | 2014-04-11 | 2015-10-14 | 扬智科技股份有限公司 | Arithmetic coding decoding device and method | 
| CN104394418A (en)* | 2014-09-23 | 2015-03-04 | 清华大学 | Method and device for encoding and decoding video data | 
| Publication number | Publication date | 
|---|---|
| CN107801033B (en) | 2021-05-11 | 
| Publication | Publication Date | Title | 
|---|---|---|
| US9454552B2 (en) | Entropy coding and decoding using polar codes | |
| CN113574805A (en) | Method and apparatus for processing equal probability symbols in entropy coding | |
| CN101459492B (en) | A data transmission method and transmission system, and a data sending end | |
| RU2630750C1 (en) | Device and method for encoding and decoding initial data | |
| CN104199927A (en) | Data processing method and device | |
| EP3211897A1 (en) | Method and apparatus for encoding and decoding transform coefficients | |
| CN113300715B (en) | Data processing method, device, hardware compression equipment and medium | |
| CN113824449A (en) | Static Huffman parallel coding method, system, storage medium and equipment | |
| JPS60140981A (en) | Method and device for decoding digital coded word of coded word system | |
| CN111970007B (en) | Decoding method, decoder, device and medium | |
| CN109871520A (en) | A Binary Data Encoding and Decoding Method for HTTP Content Embedding | |
| CN119031137A (en) | A security monitoring video compression transmission method and system | |
| CN107801033A (en) | Decoding method and decoding device applied to digital audio and video coding and decoding technical standard system | |
| CN205545212U (en) | Manchester code's codec based on FPGA | |
| EP3149947B1 (en) | Dedicated arithmetic encoding instruction | |
| TWI517681B (en) | Decoding method and decoding apparatus for avs system | |
| TWI617186B (en) | Decoding method and decoding apparatus for avs system | |
| CN114070470B (en) | Encoding and decoding method and device | |
| CN104243984B (en) | Decoding method and decoding device applied to digital audio and video coding and decoding technical standard system | |
| CN105099571B (en) | A kind of audio communication method | |
| US20100316116A1 (en) | Processing data streams | |
| CN114626338A (en) | Character encoding method, character decoding method, character encoding system, character decoding system, character encoding device, character decoding device, and storage medium | |
| US10742783B2 (en) | Data transmitting apparatus, data receiving apparatus and method thereof having encoding or decoding functionalities | |
| CN119181231B (en) | Data communication method, device, equipment and medium applied to universal remote controller | |
| KR100997870B1 (en) | Data encoding and decoding methods, data transmission methods, transmitters and receivers | 
| Date | Code | Title | Description | 
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| TA01 | Transfer of patent application right | Effective date of registration:20191217 Address after:No.1, Duhang 1st Road, Hsinchu City, Hsinchu Science Park, Taiwan, China Applicant after:MediaTek.Inc Address before:1/2, 4th floor, 26 Taiyuan Street, Zhubei City, Hsinchu County, Taiwan, China Applicant before:MStar Semiconductor Co., Ltd. | |
| TA01 | Transfer of patent application right | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |