WO2023088141A1 - Syntax element coding method and apparatus, syntax element decoding method and apparatus, and electronic device and storage medium - Google Patents

Syntax element coding method and apparatus, syntax element decoding method and apparatus, and electronic device and storage medium Download PDF

Info

Publication number
WO2023088141A1
WO2023088141A1 PCT/CN2022/130709 CN2022130709W WO2023088141A1 WO 2023088141 A1 WO2023088141 A1 WO 2023088141A1 CN 2022130709 W CN2022130709 W CN 2022130709W WO 2023088141 A1 WO2023088141 A1 WO 2023088141A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
syntax element
coded
width
height
Prior art date
Application number
PCT/CN2022/130709
Other languages
French (fr)
Chinese (zh)
Inventor
李振纲
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2023088141A1 publication Critical patent/WO2023088141A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the embodiments of the present invention relate to the technical field of video encoding and decoding, and in particular, relate to an encoding and decoding method, device, electronic device, and storage medium of syntax elements.
  • the new coding standard achieves a higher compression rate than before, however, its efficiency in coding syntax elements is not high enough, and there is room for improvement.
  • Embodiments of the present invention provide a syntax element encoding and decoding method, device, electronic equipment, and storage medium, so as to improve encoding and decoding efficiency of syntax elements.
  • Embodiments of the present invention provide a method for encoding syntax elements, including:
  • the first encoding value is obtained; according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element, the second encoding value is obtained; according to The magnitude relationship between the value of the width syntax element and the value of the height syntax element is to obtain the third coded value; the first coded value, the second coded value and the third coded value are coded sequentially; wherein, the first coded value and the second coded value
  • the encoded value is unsigned Exponential Golomb encoded
  • the third encoded value is unsigned Exponential Golomb encoded or u(1) encoded.
  • Embodiments of the present invention also provide a method for decoding syntax elements, including:
  • the received code stream Decode the received code stream to obtain the first coded value, the second coded value and the third coded value in sequence; wherein, the first coded value and the second coded value are obtained by unsigned exponential Golomb decoding, and the third coded value is obtained by Obtained by unsigned exponential Golomb decoding or u(1) decoding, the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element, and the second coded value represents the value of the width syntax element and the value of the height syntax element
  • the absolute value of the value difference, the third encoding value represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element; according to the first encoding value, the second encoding value and the third encoding value, the value of the width syntax element is obtained and the value of the height syntax element.
  • the embodiment of the present invention also provides an encoding device for syntax elements, including: a first acquisition module, configured to acquire a first encoding value according to the smaller value of the width syntax element value and the height syntax element value; The second acquisition module is set to acquire the second encoding value according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element; the third acquisition module is set to be based on the value of the width syntax element and the value of the height syntax element The size relationship of the third encoding value is obtained; the encoding module is set to encode the first encoding value, the second encoding value and the third encoding value in sequence; wherein, the unsigned exponent is performed on the first encoding value and the second encoding value Golomb encoding, performing unsigned exponential Golomb encoding or u(1) encoding on the third encoded value.
  • Embodiments of the present invention also provide a syntax element decoding device, including:
  • the parsing module is configured to decode the received code stream to obtain the first coded value, the second coded value and the third coded value in sequence; wherein, the first coded value and the second coded value are obtained by unsigned exponential Columbus decoding, The third coded value is obtained by unsigned exponential Golomb decoding or u(1) decoding, the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element, and the second coded value represents the value of the width syntax element and the absolute value of the difference between the value of the height syntax element, the third encoding value represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element; the acquisition module is set to be based on the first encoding value, the second encoding value and the first Three-encoded value that gets the value of the width syntax element and the value of the height syntax element.
  • Embodiments of the present invention also provide a server, including: at least one processor; and a memory connected in communication with at least one processor; wherein, the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor. Executed by a processor, so that at least one processor can execute the above-mentioned method for encoding a syntax element, or execute the above-mentioned method for decoding a syntax element.
  • Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, implements the above-mentioned method for encoding syntax elements, or implements the above-mentioned method for decoding syntax elements.
  • FIG. 1 is a flow chart of a method for encoding syntax elements according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for decoding syntax elements according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for decoding syntax elements according to another embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an encoding device for syntax elements according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an apparatus for decoding syntax elements according to an embodiment of the present invention.
  • Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • H.265/HEVC and H.266/VVC coding standards are currently the most commonly used coding standards.
  • H.265/HEVC can achieve more than 50% bit rate saving while achieving the same image quality.
  • the latest H. 266/VVC coding standard can further obtain more than 40% bit rate savings.
  • the H.265/HEVC and H.266/VVC coding standards use unsigned exponential Golomb coding for the width syntax elements and height syntax elements representing image resolution information.
  • the unsigned exponent Columbus code table is shown in Table 1.
  • bit string format code value range 1 0 01x 0 1-2 001x 1 xx 3-6 0001xxx 1 x 0 7-14 00001x 3x2x1x0 _ _ 15-30 000001x 4x3x2x1x0 _ _ _ 31-62 0000001x 5 x 4 x 3 x 2 x 1 x 0 63-126 00000001x 6 x 5 x 4 x 3 x 2 x 1 x 0 127-254 000000001x 7 x 6 x 5 x 4 x 3 x 2 x 1 x 0 255-510 0000000001x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 x 0 511-1022 ... ... ...
  • unsigned exponential Columbus coding is that the number of coded bits increases with the increase of the coded value, and when the coded value differs greatly, the difference in the number of coded bits consumed is also large.
  • the unsigned exponential Golomb coding is used to encode the width and height syntax elements. When the image resolution is large, the number of coding bits consumed is large. The encoding efficiency of this way of encoding the width and height syntax elements is not high enough, and there is room for improvement.
  • An embodiment of the present invention relates to a method for encoding syntax elements, and the specific process is shown in FIG. 1 .
  • the method for encoding syntax elements involved in this embodiment can be applied to products such as video conferencing, set-top boxes, and media codec chips.
  • the first coded value according to the smaller value of the value of the width syntax element and the value of the height syntax element, obtain the first coded value; according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element, obtain The second encoding value; according to the magnitude relationship between the value of the width syntax element and the value of the height syntax element, the third encoding value is obtained; the first encoding value, the second encoding value and the third encoding value are encoded in sequence; wherein, the first encoding value The first encoded value and the second encoded value are subjected to unsigned exponential Golomb encoding, and the third encoded value is subjected to unsigned exponential Golomb encoding or u(1) encoding, so as to improve the encoding and decoding efficiency of the syntax elements.
  • Step 101 Obtain a first coded value according to the smaller value of the width syntax element and the height syntax element.
  • the value of the width syntax element is the width of the image in the video
  • the value of the height syntax element is the height of the image in the video.
  • Step 102 according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element, a second coded value is obtained.
  • Step 103 according to the magnitude relationship between the value of the width syntax element and the value of the height syntax element, a third coded value is obtained.
  • the third encoding value is set to represent the magnitude relationship between the value of the width syntax element and the value of the height syntax element.
  • the third coded value in this step is preferably a value with a small number of coded bits in the unsigned Exponential Golomb coding rule.
  • the third encoding value is obtained, including: taking the value of the width syntax element as the numerator and the value of the height syntax element as the denominator, and calculating the width syntax The ratio of the element to the height syntax element; when the ratio is not less than 1, the third coded value is set to represent a value whose width syntax element is not less than the value of the height syntax element; when the ratio is less than 1, set the third The triple-coded value is set to a value that characterizes that the width syntax element has a smaller value than the height syntax element.
  • the third encoding value can be set to 1 or 0 according to the ratio of the width and height syntax element values.
  • the third encoding value can be set to 1 to indicate that the value of the width syntax element is not less than the value of the height syntax element, and the third encoding value can be set to 0 to indicate that the value of the width syntax element is less than The value of the height syntax element.
  • set the third encoding value to 0 to indicate that the value of the width syntax element is not less than the value of the height syntax element, and correspondingly set the third encoding value to 1 to indicate that the value of the width syntax element is less than the value of the height syntax element .
  • both the width syntax element and the height syntax element involved in this embodiment conform to the H.265/HEVC or H.266/VVC coding standard. It should be noted that the encoding method of the syntax elements in this embodiment is not only applicable to syntax elements conforming to the H.265/HEVC or H.266/VVC encoding standards, but also applicable to syntax elements conforming to other encoding standards.
  • the width syntax element is pic_width_in_luma_samples; the height syntax element is pic_height_in_luma_samples;
  • the width syntax element may include: sps_pic_width_max_in_luma_samples and/or pps_pic_width_in_luma_samples;
  • the height syntax element may include: sps_pic_height_max_in_luma_samples and/or pps_pic_height_in_luma_samples.
  • the H.266/VVC coding standard contains more syntax elements representing image width and height information than previous coding standards, so these syntax elements representing image width and height information are all encoded by the coding method in this embodiment, which can It saves bit rate better and improves coding efficiency even more.
  • Step 104 sequentially encode the first encoded value, the second encoded value and the third encoded value; wherein, perform unsigned exponential Golomb encoding on the first encoded value and the second encoded value, and perform unsigned exponential on the third encoded value Columbus encoding or u(1) encoding.
  • the encoded values obtained in the preceding steps are encoded, the first encoded value and the second encoded value are encoded by unsigned exponential Golomb encoding, and the third encoded value may also be encoded by unsigned exponential Golomb encoding.
  • Unsigned exponential Golomb coding has the characteristics that the smaller the coding value, the fewer the number of coding bits. Therefore, in the previous steps, the coding value with a greatly reduced value is used to replace the value of the width and height syntax elements as the coding object, and the unsigned exponent is used in combination.
  • Columbus coding is a technical means for coding coded values, which can save the number of bits consumed by coding width and height information.
  • the u(1) encoding involved in this step is a one-bit unsigned integer encoding method, and both the unsigned exponential Golomb encoding belong to entropy encoding.
  • u(1) encoding is one of the encoding methods that save the most encoding bits. Therefore, in this step, u(1) coding may also be performed on the third coded value.
  • both the width syntax element and the height syntax element conform to the H.265/HEVC coding standard.
  • the width syntax element is pic_width_in_luma_samples;
  • the height syntax element is pic_height_in_luma_samples.
  • the process of encoding the above syntax elements is as follows: first, the encoding device compares the values of the pic_width_in_luma_samples and pic_height_in_luma_samples syntax elements. The smaller value of the two, that is, the first coded value, can be represented by the syntax element pic_width_heigh_min.
  • the syntax element pic_diffwidth_height_abs can be used to represent the absolute value of the difference between pic_width_in_luma_samples and pic_height_in_luma_samples syntax elements, that is, the second code value, and the acquisition of the second code value can be expressed as:
  • pic_diff_width_height_abs ABS(pic_width_in_luma_samples-pic_height_in_luma_samples).
  • the size relationship syntax element pic_aspect_ratio_flag representing the size relationship of the image width and height can be added, and its value can be used as the third encoding value.
  • the value of pic_aspect_ratio_flag is 1, the acquisition of the third encoding value is completed.
  • unsigned exponential Columbus encoding is performed on the syntax elements in the order of pic_width_height_min, pic_diff_width_height_abs, and pic_aspect_ratio_flag, and written into the code stream.
  • the image width value is associated with the height value
  • the difference between the image height value and the width value is obtained
  • the third coded value used to represent the size relationship between the image height value and the width value is set.
  • the smaller value of the height value and the width value, the difference between the height value and the width value, and the third encoded value are encoded, and the larger value of the two is not encoded.
  • the difference between the width and height and the third encoding value are much smaller than the larger value of the two. Compared with the traditional method of encoding the width and height of the image, the value of the encoded data is significantly reduced.
  • U(1) encoding has the characteristics of encoding an unsigned integer with a small number of encoding bits, so the third encoding value representing the relationship between the width and height of the image is encoded using u(1) encoding, which can further shorten the number of encoding bits , to improve the coding efficiency of syntax elements.
  • the received code stream is decoded to obtain the first coded value, the second coded value and the third coded value in sequence; wherein, the first coded value and the second coded value are obtained by unsigned exponential Golomb decoding , the third coded value is obtained by unsigned exponential Golomb decoding or u(1) decoding, the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element, and the second coded value represents the value of the width syntax element value and the absolute value of the difference between the value of the height syntax element, and the third coded value represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element; according to the first coded value, the second coded value and the third coded value, Gets the value of the width syntax element and the value of the height syntax element.
  • Step 201 Decode the received code stream to obtain a first coded value, a second coded value and a third coded value in sequence.
  • the first encoded value and the second encoded value are obtained by unsigned exponential Golomb decoding
  • the third encoded value is obtained by unsigned exponential Golomb decoding or u(1) decoding.
  • the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element
  • the second coded value represents the absolute value of the difference between the value of the width syntax element and the value of the height syntax element
  • the third coded value represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element.
  • Step 202 according to the first encoded value, the second encoded value and the third encoded value, the value of the width syntax element and the value of the height syntax element are obtained.
  • the syntax element decoding device can know the magnitude relationship between the value of the width syntax element and the value of the height syntax element according to the value of the third coded value analyzed in the code stream. Combining the size relationship, it can be obtained that the value of the smaller one of the width and height syntax elements is the first coded value, and the value of the larger one is the sum of the first coded value and the second coded value.
  • obtaining the value of the width syntax element and the value of the height syntax element according to the first encoding value, the second encoding value and the third encoding value may include: the value of the third encoding value representing the width syntax element is not In the case of a value less than the value of the height syntax element, the first coded value is used as the value of the height syntax element, and the sum of the first coded value and the second coded value is used as the value of the width syntax element; when the third coded value is In the case that the value of the width syntax element is smaller than the value of the height syntax element, the first coded value is used as the value of the width syntax element, and the sum of the first coded value and the second coded value is used as the value of the height syntax element.
  • the third encoding value is set to 0 or 1 according to the size relationship of the width and height syntax elements
  • the value of the height syntax element is set to the first encoding value , set the value of the width syntax element to the sum of the first code value and the second code value; when the third code value is 1, set the value of the width syntax element to the first code value, and set the value of the height syntax element
  • the value is set to the sum of the first encoded value and the second encoded value.
  • the first coded value, the second coded value and the third coded value can be analyzed from the code stream obtained by coding according to the above coding method. Furthermore, according to the above-mentioned first coded value, the second coded value and the third coded value, the value of the width syntax element and the value of the height syntax element are obtained, that is, the height and width values of the image in the video are obtained. Compared with the traditional analysis method of analyzing image width and height information from a longer code, this embodiment parses a code value based on a shorter code, and then obtains the width and height, which can improve decoding efficiency.
  • An embodiment of the present invention relates to an encoding device for syntax elements, as shown in FIG. 4 , including:
  • the first obtaining module 301 is configured to obtain the first coded value according to the smaller value of the value of the width syntax element and the value of the height syntax element;
  • the second obtaining module 302 is configured to obtain the second coded value according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element;
  • the third obtaining module 303 is configured to obtain a third coded value according to the magnitude relationship between the value of the width syntax element and the value of the height syntax element;
  • the coding module 304 is configured to encode the first coded value, the second coded value and the third coded value sequentially; wherein, the first coded value and the second coded value are unsigned exponential Golomb coded, and the third coded value is coded Unsigned Exponential Golomb encoding or u(1) encoding.
  • the encoding device of the syntax element may further include: a calculation module (not shown in the figure), configured to calculate the ratio of the width syntax element to the height syntax element; when the ratio is not less than 1, encode the third The value is set to a value representing that the value of the width syntax element is not less than the value of the height syntax element; in case the ratio is less than 1, the third encoding value is set to a value representing that the value of the width syntax element is less than the value of the height syntax element.
  • a calculation module (not shown in the figure), configured to calculate the ratio of the width syntax element to the height syntax element; when the ratio is not less than 1, encode the third The value is set to a value representing that the value of the width syntax element is not less than the value of the height syntax element; in case the ratio is less than 1, the third encoding value is set to a value representing that the value of the width syntax element is less than the value of the height syntax element.
  • the encoding device for syntax elements can associate the image width value with the height value, obtain the difference between the image height value and the width value, and set the third encoding used to represent the size relationship between the image height value and the width value value. Further, the smaller value of the height value and the width value, the difference between the height value and the width value, and the third encoded value are encoded, and the larger value of the two is not encoded. The difference between the width and height and the third encoding value are much smaller than the larger value of the two. Compared with the traditional method of encoding the width and height of the image, the value of the encoded data is significantly reduced.
  • the u(1) encoding has the characteristic of encoding an unsigned integer with a small number of bits, so the u(1) encoding method is used to encode the third encoding value representing the relationship between the width and height of the image, which can further shorten the number of encoding bits. Improve the coding efficiency of syntax elements.
  • An embodiment of the present invention relates to a device for decoding syntax elements, as shown in FIG. 5 , including:
  • the parsing module 401 is configured to decode the received code stream to sequentially obtain a first coded value, a second coded value and a third coded value; wherein, the first coded value and the second coded value are obtained by unsigned exponential Golomb decoding , the third coded value is obtained by unsigned exponential Golomb decoding or u(1) decoding, the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element, and the second coded value represents the value of the width syntax element The absolute value of the difference between the value of the value and the value of the height syntax element, and the third coded value represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element;
  • the obtaining module 402 is configured to obtain the value of the width syntax element and the value of the height syntax element according to the first code value, the second code value and the third code value.
  • the device for decoding syntax elements may further include: an assignment module (not shown in the figure), which is configured to represent a value of a width syntax element that is not less than a value of a height syntax element when the third encoding value is not less than a value of a height syntax element , take the first coded value as the value of the height syntax element, and use the sum of the first coded value and the second coded value as the value of the width syntax element; the third coded value represents that the value of the width syntax element is less than that of the height syntax element In the case of value, the first coded value is used as the value of the width syntax element, and the sum of the first coded value and the second coded value is used as the value of the height syntax element.
  • an assignment module (not shown in the figure), which is configured to represent a value of a width syntax element that is not less than a value of a height syntax element when the third encoding value is not less than a value of a height syntax element , take the first coded value as the value of
  • the syntax element decoding apparatus can analyze the first coded value, the second coded value and the third coded value from the code stream obtained by coding according to the above coding method. Furthermore, according to the above-mentioned first coded value, the second coded value and the third coded value, the value of the width syntax element and the value of the height syntax element are obtained, that is, the height and width values of the image in the video are obtained. Compared with the traditional analysis method of analyzing image width and height information from a longer code, this embodiment parses a code value based on a shorter code, and then obtains the width and height, which can improve decoding efficiency.
  • a logical unit can be a physical unit, or a part of a physical unit, or multiple physical units. Combination of units.
  • this embodiment does not introduce units that are not closely related to solving the technical problems raised by the embodiment of the present invention, but this does not mean that there are no other elements in this embodiment unit.
  • Embodiments of the present invention also provide an electronic device, as shown in FIG. 6 , including at least one processor 501; and a memory 502 connected in communication with at least one processor 501; wherein, the memory 502 stores information that can be processed by at least one processor.
  • the instructions executed by the processor 501 are executed by at least one processor 501, so that at least one processor 501 can execute the above method for encoding syntax elements, or execute the above method for decoding syntax elements.
  • the memory 502 and the processor 501 are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors 501 and various circuits of the memory 502 together.
  • the bus may also connect together various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and therefore will not be further described herein.
  • the bus interface provides an interface between the bus and the transceivers.
  • a transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing means for communicating with various other devices over a transmission medium.
  • the data processed by the processor 501 is transmitted on the wireless medium through the antenna, further, the antenna also receives the data and transmits the data to the processor 501 .
  • Processor 501 is responsible for managing the bus and general processing, and may also provide various functions including timing, peripheral interface, voltage regulation, power management and other control functions. And the memory 502 may be used to store data used by the processor 501 when performing operations.
  • Embodiments of the present invention also provide a computer-readable storage medium storing a computer program.
  • the computer program is executed by the processor, the above-mentioned method for encoding syntax elements is realized, or the above-mentioned method for decoding syntax elements is realized.
  • a device which can be A single chip microcomputer, a chip, etc.
  • a processor processor
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiments of the present invention relate to the technical field of video coding and decoding, and particularly relates to a syntax element coding method and apparatus, a syntax element decoding method and apparatus, and an electronic device and a storage medium. In the embodiments of the present invention, the syntax element coding method comprises: on the basis of the smaller one of the value of a width syntax element and the value of a height syntax element, acquiring a first code value; on the basis of the absolute value of the difference between the value of the width syntax element and the value of the height syntax element, acquiring a second code value; on the basis of the size relationship between the value of the width syntax element and the value of the height syntax element, acquiring a third code value; and sequentially coding the first code value, the second code value and the third code value, wherein unsigned exponential-Golomb coding is performed on the first code value and the second code value, and unsigned exponential-Golomb coding or u(1) coding is performed on the third code value.

Description

语法元素的编码、解码方法、装置、电子设备和存储介质Encoding and decoding method, device, electronic equipment and storage medium of syntax element
相关申请的交叉引用Cross References to Related Applications
本申请基于2021年11月22日提交的发明名称为“语法元素的编码、解码方法、装置、电子设备和存储介质”的中国专利申请CN202111389452.X,并且要求该专利申请的优先权,通过引用将其所公开的内容全部并入本申请。This application is based on the Chinese patent application CN202111389452.X filed on November 22, 2021 with the title of "encoding, decoding method, device, electronic equipment and storage medium of syntax elements", and claims the priority of this patent application, by reference All the disclosed content is incorporated in this application.
技术领域technical field
本发明实施例涉及视频编解码技术领域,尤其是涉及一种语法元素的编码、解码方法、装置、电子设备和存储介质。The embodiments of the present invention relate to the technical field of video encoding and decoding, and in particular, relate to an encoding and decoding method, device, electronic device, and storage medium of syntax elements.
背景技术Background technique
近年来,随着户体验需求的不断提升,为用户提供高清甚至超高清视频已成为视频业务的趋势。视频信号包含的数据量巨大,需要占用大量的传输带宽和存储空间。因此,在传输和存储视频信号时,需要对视频信号进行压缩编码,视频压缩技术越来越成为视频应用领域不可或缺的关键技术。在此背景下,国际标准组织相继推出了压缩性能更高的H.265/HEVC、H.266/VVC编码标准。相比前一代视频编码标准H.264/AVC,H.265/HEVC在实现同等图像质量的情况下能够节省超过50%的码率。而与H.265/HEVC相比,最新的编码标准H.266/VVC能够进一步节省超过40%的码率。In recent years, with the continuous improvement of user experience requirements, providing users with high-definition or even ultra-high-definition video has become a trend of video services. The video signal contains a huge amount of data, which requires a large amount of transmission bandwidth and storage space. Therefore, when transmitting and storing video signals, it is necessary to compress and encode the video signals, and video compression technology has increasingly become an indispensable key technology in the field of video applications. In this context, the International Standards Organization has successively introduced H.265/HEVC and H.266/VVC coding standards with higher compression performance. Compared with the previous generation video coding standard H.264/AVC, H.265/HEVC can save more than 50% bit rate while achieving the same image quality. Compared with H.265/HEVC, the latest coding standard H.266/VVC can further save more than 40% of the code rate.
新的编码标准相比以往取得了更高的压缩率,然而,其对语法元素编码的效率不够高,存在一定的提升空间。The new coding standard achieves a higher compression rate than before, however, its efficiency in coding syntax elements is not high enough, and there is room for improvement.
发明内容Contents of the invention
本发明的实施方式提供一种语法元素的编码、解码方法、装置、电子设备和存储介质,用以提高语法元素的编解码效率。Embodiments of the present invention provide a syntax element encoding and decoding method, device, electronic equipment, and storage medium, so as to improve encoding and decoding efficiency of syntax elements.
本发明的实施方式提供了一种语法元素的编码方法,包括:Embodiments of the present invention provide a method for encoding syntax elements, including:
根据宽度语法元素的值和高度语法元素的值中较小的值,获取第一编码值;根据宽度语法元素的值和高度语法元素的值的差值的绝对值,获取第二编码值;根据宽度语法元素的值和高度语法元素的值的大小关系,获取第三编码值;对第一编码值,第二编码值以及第三编码值依次进行编码;其中,对第一编码值和第二编码值进行无符号指数哥伦布编码,对第三编码值进行无符号指数哥伦布编码或者u(1)编码。According to the smaller value of the value of the width syntax element and the value of the height syntax element, the first encoding value is obtained; according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element, the second encoding value is obtained; according to The magnitude relationship between the value of the width syntax element and the value of the height syntax element is to obtain the third coded value; the first coded value, the second coded value and the third coded value are coded sequentially; wherein, the first coded value and the second coded value The encoded value is unsigned Exponential Golomb encoded, and the third encoded value is unsigned Exponential Golomb encoded or u(1) encoded.
本发明的实施方式还提供了一种语法元素解码的方法,包括:Embodiments of the present invention also provide a method for decoding syntax elements, including:
对接收到的码流进行解码,依次得到第一编码值,第二编码值以及第三编码值;其中,第一编码值和第二编码值由无符号指数哥伦布解码得到,第三编码值由无符号指数哥伦布解码或者u(1)解码得到,第一编码值表示宽度语法元素的值和高度语法元素的值中较小的值,第二编码值表示宽度语法元素的值和高度语法元素的值的差值的绝对值,第三编码值表示宽度语法元素的值和高度语法元素的值的大小关系;根据第一编码值,第二编码值以及第三编码值,获取宽度语法元素的值和高度语法元素的值。Decode the received code stream to obtain the first coded value, the second coded value and the third coded value in sequence; wherein, the first coded value and the second coded value are obtained by unsigned exponential Golomb decoding, and the third coded value is obtained by Obtained by unsigned exponential Golomb decoding or u(1) decoding, the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element, and the second coded value represents the value of the width syntax element and the value of the height syntax element The absolute value of the value difference, the third encoding value represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element; according to the first encoding value, the second encoding value and the third encoding value, the value of the width syntax element is obtained and the value of the height syntax element.
本发明的实施方式还提供了一种语法元素的编码装置,包括:第一获取模块,设置为根据宽度语法元素的值和高度语法元素的值中较小的值,获取第一编码值;第二获取模块,设置为根据宽度语法元素的值和高度语法元素的值的差值的绝对值,获取第二编码值;第三获取模块,设置为根据宽度语法元素的值和高度语法元素的值的大小关系,获取第三编码值;编码模块,设置为对第一编码值,第二编码值以及第三编码值依次进行编码;其中,对第一编码值和第二编码值进行无符号指数哥伦布编码,对第三编码值进行无符号指数哥伦布编码或者u(1)编码。The embodiment of the present invention also provides an encoding device for syntax elements, including: a first acquisition module, configured to acquire a first encoding value according to the smaller value of the width syntax element value and the height syntax element value; The second acquisition module is set to acquire the second encoding value according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element; the third acquisition module is set to be based on the value of the width syntax element and the value of the height syntax element The size relationship of the third encoding value is obtained; the encoding module is set to encode the first encoding value, the second encoding value and the third encoding value in sequence; wherein, the unsigned exponent is performed on the first encoding value and the second encoding value Golomb encoding, performing unsigned exponential Golomb encoding or u(1) encoding on the third encoded value.
本发明的实施方式还提供一种语法元素的解码装置,包括:Embodiments of the present invention also provide a syntax element decoding device, including:
解析模块,设置为对接收到的码流进行解码,依次得到第一编码值,第二编码值以及第三编码值;其中,第一编码值和第二编码值由无符号指数哥伦布解码得到,第三编码值由无符号指数哥伦布解码或者u(1)解码得到,第一编码值表示宽度语法元素的值和高度语法元素的值中较小的值,第二编码值表示宽度语法元素的值和高度语法元素的值的差值的绝对值,第三编码值表示宽度语法元素的值和高度语法元素的值的大小关系;获取模块,设置为根据第一编码值,第二编码值以及第三编码值,获取宽度语法元素的值和高度语法元素的值。The parsing module is configured to decode the received code stream to obtain the first coded value, the second coded value and the third coded value in sequence; wherein, the first coded value and the second coded value are obtained by unsigned exponential Columbus decoding, The third coded value is obtained by unsigned exponential Golomb decoding or u(1) decoding, the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element, and the second coded value represents the value of the width syntax element and the absolute value of the difference between the value of the height syntax element, the third encoding value represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element; the acquisition module is set to be based on the first encoding value, the second encoding value and the first Three-encoded value that gets the value of the width syntax element and the value of the height syntax element.
本发明的实施方式还提供了一种服务器,包括:至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行上述的语法元素编码的方法,或执行上述的语法元素解码的方法。Embodiments of the present invention also provide a server, including: at least one processor; and a memory connected in communication with at least one processor; wherein, the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor. Executed by a processor, so that at least one processor can execute the above-mentioned method for encoding a syntax element, or execute the above-mentioned method for decoding a syntax element.
本发明的实施方式还提供了一种计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时实现上述的语法元素编码的方法,或实现上述的语法元素解码的方法。Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, implements the above-mentioned method for encoding syntax elements, or implements the above-mentioned method for decoding syntax elements.
附图说明Description of drawings
一个或多个实施方式通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施方式的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings, and these exemplifications do not constitute a limitation to the embodiments. Elements with the same reference numerals in the drawings represent similar elements. Unless otherwise stated, the drawings in the drawings are not limited to scale.
图1是根据本发明一实施方式中的语法元素编码的方法流程图;FIG. 1 is a flow chart of a method for encoding syntax elements according to an embodiment of the present invention;
图2是根据本发明一实施方式中的语法元素解码的方法流程图;FIG. 2 is a flowchart of a method for decoding syntax elements according to an embodiment of the present invention;
图3是根据本发明另一实施方式中的语法元素解码的方法流程图;FIG. 3 is a flowchart of a method for decoding syntax elements according to another embodiment of the present invention;
图4是根据本发明一实施方式中的语法元素的编码装置的结构示意图;FIG. 4 is a schematic structural diagram of an encoding device for syntax elements according to an embodiment of the present invention;
图5是根据本发明一实施方式中的语法元素的解码装置的结构示意图;FIG. 5 is a schematic structural diagram of an apparatus for decoding syntax elements according to an embodiment of the present invention;
图6是根据本发明一实施方式的电子设备的结构示意图。Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的实施方式的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本发明实施例而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本发明实施例所要求保护的技术方案。以下各个实施方式的划分是为了描述方便,不应对本发明实施例的具体实现方式构成任何限定,各个实施方式在不矛盾的前提下可以相互结合相互引用。In order to make the objectives, technical solutions and advantages of the embodiments of the present invention more clear, the following will describe each embodiment of the present invention in detail with reference to the accompanying drawings. However, those of ordinary skill in the art can understand that in various implementation manners of the present invention, many technical details are provided for readers to better understand the embodiments of the present invention. However, even without these technical details and various changes and modifications based on the following implementation manners, the technical solutions claimed in the embodiments of the present invention can also be realized. The division of the following implementations is for the convenience of description, and should not constitute any limitation to the specific implementations of the embodiments of the present invention, and the implementations can be combined and referred to each other on the premise of no contradiction.
在视频压缩技术领域,H.265/HEVC、H.266/VVC编码标准是目前最为常用的编码标准。相比前一代视频编码标准H.264/AVC,H.265/HEVC在实现同等图像质量的情况下能够获得超过50%的码率节省,而与H.265/HEVC相比,最新的H.266/VVC编码标准能够进一步获得超过40%的码率节省。In the field of video compression technology, H.265/HEVC and H.266/VVC coding standards are currently the most commonly used coding standards. Compared with the previous generation of video coding standard H.264/AVC, H.265/HEVC can achieve more than 50% bit rate saving while achieving the same image quality. Compared with H.265/HEVC, the latest H. 266/VVC coding standard can further obtain more than 40% bit rate savings.
H.265/HEVC、H.266/VVC编码标准,对于表征图像分辨率信息的宽度语法元素和高度语法元素,均采用无符号指数哥伦布编码。无符号指数哥伦布编码表如表1所示。The H.265/HEVC and H.266/VVC coding standards use unsigned exponential Golomb coding for the width syntax elements and height syntax elements representing image resolution information. The unsigned exponent Columbus code table is shown in Table 1.
表1.无符号指数哥伦布编码表Table 1. Unsigned Exponential Columbus Encoding Table
比特串格式bit string format 码值范围code value range
11 00
01x 0 01x 0 1-21-2
001x 1xx 001x 1 xx 3-63-6
0001xxx 1x 0 0001xxx 1 x 0 7-147-14
00001x 3x 2x 1x 0 00001x 3x2x1x0 _ _ 15-3015-30
000001x 4x 3x 2x 1x 0 000001x 4x3x2x1x0 _ _ _ 31-6231-62
0000001x 5x 4x 3x 2x 1x 0 0000001x 5 x 4 x 3 x 2 x 1 x 0 63-12663-126
00000001x 6x 5x 4x 3x 2x 1x 0 00000001x 6 x 5 x 4 x 3 x 2 x 1 x 0 127-254127-254
000000001x 7x 6x 5x 4x 3x 2x 1x 0 000000001x 7 x 6 x 5 x 4 x 3 x 2 x 1 x 0 255-510255-510
0000000001x 8x 7x 6x 5x 4x 3x 2x 1x 0 0000000001x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 x 0 511-1022511-1022
……... ……...
从表中可以看出,无符号指数哥伦布编码的特点是,编码比特数随编码数值的增大而增大,在编码数值差异较大的情况下,消耗的编码比特数差距也较大。采用无符号指数哥伦布编码对宽高语法元素进行编码,在图像分辨率较大的情况下,消耗的编码比特数很多。这种对宽高语法元素编码的方式编码效率不够高,存在一定的提升空间。It can be seen from the table that the characteristic of unsigned exponential Columbus coding is that the number of coded bits increases with the increase of the coded value, and when the coded value differs greatly, the difference in the number of coded bits consumed is also large. The unsigned exponential Golomb coding is used to encode the width and height syntax elements. When the image resolution is large, the number of coding bits consumed is large. The encoding efficiency of this way of encoding the width and height syntax elements is not high enough, and there is room for improvement.
本发明的一实施方式涉及一种语法元素编码的方法,具体流程如图1所示。本实施方式涉及的语法元素编码的方法可以应用于会议电视、机顶盒、媒体编解码芯片等产品中。An embodiment of the present invention relates to a method for encoding syntax elements, and the specific process is shown in FIG. 1 . The method for encoding syntax elements involved in this embodiment can be applied to products such as video conferencing, set-top boxes, and media codec chips.
在本实施方式中,根据宽度语法元素的值和高度语法元素的值中较小的值,获取第一编码值;根据宽度语法元素的值和高度语法元素的值的差值的绝对值,获取第二编码值;根据宽度语法元素的值和高度语法元素的值的大小关系,获取第三编码值;对第一编码值,第二编码值以及第三编码值依次进行编码;其中,对第一编码值和第二编码值进行无符号指数哥伦布编码,对第三编码值进行无符号指数哥伦布编码或者u(1)编码,用以提高语法元素的编解码效率。In this embodiment, according to the smaller value of the value of the width syntax element and the value of the height syntax element, obtain the first coded value; according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element, obtain The second encoding value; according to the magnitude relationship between the value of the width syntax element and the value of the height syntax element, the third encoding value is obtained; the first encoding value, the second encoding value and the third encoding value are encoded in sequence; wherein, the first encoding value The first encoded value and the second encoded value are subjected to unsigned exponential Golomb encoding, and the third encoded value is subjected to unsigned exponential Golomb encoding or u(1) encoding, so as to improve the encoding and decoding efficiency of the syntax elements.
下面对本实施方式中的语法元素的编码方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。具体流程如图1所示,至少包括但不限 于如下步骤:The implementation details of the encoding method of the syntax elements in this embodiment will be described in detail below. The following content is only the implementation details provided for the convenience of understanding, and is not necessary for the implementation of this solution. The specific process is shown in Figure 1, at least including but not limited to the following steps:
步骤101,根据宽度语法元素的值和高度语法元素的值中较小的值,获取第一编码值。Step 101: Obtain a first coded value according to the smaller value of the width syntax element and the height syntax element.
在本步骤中,宽度语法元素的值即为视频中图像的宽度,高度语法元素的值即为视频中图像的高度。比较宽度语法元素的值和高度语法元素的值的大小,取二者之中较小者为第一编码值。若将第一编码值记为A,则第一编码值可用公式表示为A=MIN(宽,高)。In this step, the value of the width syntax element is the width of the image in the video, and the value of the height syntax element is the height of the image in the video. The value of the width syntax element and the value of the height syntax element are compared, and the smaller of the two is taken as the first coded value. If the first encoded value is recorded as A, then the first encoded value can be expressed as A=MIN(width, height).
步骤102,根据宽度语法元素的值和高度语法元素的值的差值的绝对值,获取第二编码值。 Step 102, according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element, a second coded value is obtained.
在本步骤中,首先计算获取宽度语法元素的值和高度语法元素的值的差值。进而将第二编码值设置为该差值的绝对值。若将第二编码值记为B,则第二编码值可用公式表示为B=ABS(宽,高)。In this step, the difference between the value of the width syntax element and the height syntax element is calculated first. Furthermore, the second encoding value is set as the absolute value of the difference. If the second encoded value is recorded as B, then the second encoded value can be expressed as B=ABS(width, height).
步骤103,根据宽度语法元素的值和高度语法元素的值的大小关系,获取第三编码值。 Step 103, according to the magnitude relationship between the value of the width syntax element and the value of the height syntax element, a third coded value is obtained.
在本步骤中,设置第三编码值用以表征宽度语法元素的值和高度语法元素的值的大小关系。本步骤中的第三编码值优选在无符号指数哥伦布编码规则中编码比特数较少的值。In this step, the third encoding value is set to represent the magnitude relationship between the value of the width syntax element and the value of the height syntax element. The third coded value in this step is preferably a value with a small number of coded bits in the unsigned Exponential Golomb coding rule.
在一个例子中,根据宽度语法元素的值和高度语法元素的值的大小关系,获取第三编码值,包括:将宽度语法元素的值作为分子,将高度语法元素的值作为分母,计算宽度语法元素和高度语法元素的比值;在比值不小于1的情况下,将第三编码值设置为表征宽度语法元素的值不小于高度语法元素的值的值;在比值小于1的情况下,将第三编码值设置为表征宽度语法元素的值小于高度语法元素的值的值。In an example, according to the magnitude relationship between the value of the width syntax element and the value of the height syntax element, the third encoding value is obtained, including: taking the value of the width syntax element as the numerator and the value of the height syntax element as the denominator, and calculating the width syntax The ratio of the element to the height syntax element; when the ratio is not less than 1, the third coded value is set to represent a value whose width syntax element is not less than the value of the height syntax element; when the ratio is less than 1, set the third The triple-coded value is set to a value that characterizes that the width syntax element has a smaller value than the height syntax element.
0和1是用无符号指数哥伦布编码规则进行编码编码比特数最少的数值,而第三编码值仅表征宽度语法元素的值和高度语法元素的值的大小关系,并无实际数学意义。因此在本例中可以根据宽高语法元素值的比值将第三编码值设置为1或0。上述例子在实际实施时,可以将第三编码值设置为1用以表征宽度语法元素的值不小于高度语法元素的值,同时将第三编码值设置为0用以表征宽度语法元素的值小于高度语法元素的值。或者,将第三编码值设置为0用以表征宽度语法元素的值不小于高度语法元素的值,相应地将第三编码值设置为1用以表征宽度语法元素的值小于高度语法元素的值。0 and 1 are values with the least number of encoding bits encoded by the unsigned exponential Golomb encoding rule, and the third encoding value only represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element, and has no actual mathematical meaning. Therefore, in this example, the third encoding value can be set to 1 or 0 according to the ratio of the width and height syntax element values. In the actual implementation of the above example, the third encoding value can be set to 1 to indicate that the value of the width syntax element is not less than the value of the height syntax element, and the third encoding value can be set to 0 to indicate that the value of the width syntax element is less than The value of the height syntax element. Or, set the third encoding value to 0 to indicate that the value of the width syntax element is not less than the value of the height syntax element, and correspondingly set the third encoding value to 1 to indicate that the value of the width syntax element is less than the value of the height syntax element .
在一个例子中,本实施方式中涉及的宽度语法元素和高度语法元素均符合H.265/HEVC或H.266/VVC编码标准。应当说明的是,本实施方式中的语法元素的编码方法不仅仅适用于符合H.265/HEVC或H.266/VVC编码标准的语法元素,也适用于符合其他编码标准的语法元素。In an example, both the width syntax element and the height syntax element involved in this embodiment conform to the H.265/HEVC or H.266/VVC coding standard. It should be noted that the encoding method of the syntax elements in this embodiment is not only applicable to syntax elements conforming to the H.265/HEVC or H.266/VVC encoding standards, but also applicable to syntax elements conforming to other encoding standards.
在一个宽度语法元素和高度语法元素均符合H.265/HEVC编码标准的例子中,宽度语法元素为pic_width_in_luma_samples;高度语法元素为pic_height_in_luma_samples;在一个宽度语法元素和高度语法元素均符合H.266/VVC编码标准的例子中,宽度语法元素可以包括:sps_pic_width_max_in_luma_samples和/或pps_pic_width_in_luma_samples;高度语法元素可以包括:sps_pic_height_max_in_luma_samples和/或pps_pic_height_in_luma_samples。In an example where both the width syntax element and the height syntax element conform to the H.265/HEVC coding standard, the width syntax element is pic_width_in_luma_samples; the height syntax element is pic_height_in_luma_samples; In an example of a coding standard, the width syntax element may include: sps_pic_width_max_in_luma_samples and/or pps_pic_width_in_luma_samples; the height syntax element may include: sps_pic_height_max_in_luma_samples and/or pps_pic_height_in_luma_samples.
H.266/VVC编码标准包含相比以往的编码标准更多的表征图像宽高信息的语法元素,因此对于这些表征图像宽高信息的语法元素均用本实施方式中的编码方法进行编码,能够更好地节省码率,编码效率得到更大提升。The H.266/VVC coding standard contains more syntax elements representing image width and height information than previous coding standards, so these syntax elements representing image width and height information are all encoded by the coding method in this embodiment, which can It saves bit rate better and improves coding efficiency even more.
步骤104,对第一编码值,第二编码值以及第三编码值依次进行编码;其中,对第一编码值和第二编码值进行无符号指数哥伦布编码,对第三编码值进行无符号指数哥伦布编码或 者u(1)编码。 Step 104, sequentially encode the first encoded value, the second encoded value and the third encoded value; wherein, perform unsigned exponential Golomb encoding on the first encoded value and the second encoded value, and perform unsigned exponential on the third encoded value Columbus encoding or u(1) encoding.
在本步骤中,对在前述步骤中获取的编码值进行编码,对第一编码值和第二编码值进行无符号指数哥伦布编码,对第三编码值也可以采用无符号指数哥伦布编码进行编码。无符号指数哥伦布编码具有编码值越小、编码比特数越少的特点,因此在前述步骤中用数值大幅缩小的编码值取代宽高语法元素的值作为编码对象的基础上,结合采用无符号指数哥伦布编码对编码值进行编码的技术手段,能够节省对宽高信息进行编码消耗的比特数。In this step, the encoded values obtained in the preceding steps are encoded, the first encoded value and the second encoded value are encoded by unsigned exponential Golomb encoding, and the third encoded value may also be encoded by unsigned exponential Golomb encoding. Unsigned exponential Golomb coding has the characteristics that the smaller the coding value, the fewer the number of coding bits. Therefore, in the previous steps, the coding value with a greatly reduced value is used to replace the value of the width and height syntax elements as the coding object, and the unsigned exponent is used in combination. Columbus coding is a technical means for coding coded values, which can save the number of bits consumed by coding width and height information.
本步骤中涉及的u(1)编码是一种一位无符号整数编码的方法,与无符号指数哥伦布编码均属于熵编码。对于编码值为0或1的情况,u(1)编码是最节省编码比特数的编码方式之一。因此,在本步骤中,对第三编码值还可以进行u(1)编码。The u(1) encoding involved in this step is a one-bit unsigned integer encoding method, and both the unsigned exponential Golomb encoding belong to entropy encoding. For the case where the encoding value is 0 or 1, u(1) encoding is one of the encoding methods that save the most encoding bits. Therefore, in this step, u(1) coding may also be performed on the third coded value.
在一示例性实施例中,宽度语法元素和高度语法元素均符合H.265/HEVC编码标准。其中,宽度语法元素为pic_width_in_luma_samples;高度语法元素为pic_height_in_luma_samples。对上述语法元素进行编码的过程如下:首先编码装置比较pic_width_in_luma_samples和pic_height_in_luma_samples语法元素的值的大小。可以用语法元素pic_width_heigh_min来表示二者中较小的值,也即第一编码值。第一编码值的获取可以用公式表示为pic_width_heigh_min=MIN(pic_width_in_luma_samples,pic_height_in_luma_samples)。In an exemplary embodiment, both the width syntax element and the height syntax element conform to the H.265/HEVC coding standard. Wherein, the width syntax element is pic_width_in_luma_samples; the height syntax element is pic_height_in_luma_samples. The process of encoding the above syntax elements is as follows: first, the encoding device compares the values of the pic_width_in_luma_samples and pic_height_in_luma_samples syntax elements. The smaller value of the two, that is, the first coded value, can be represented by the syntax element pic_width_heigh_min. The acquisition of the first coded value can be expressed by a formula as pic_width_heigh_min=MIN(pic_width_in_luma_samples, pic_height_in_luma_samples).
随后,可以用语法元素pic_diffwidth_height_abs表示pic_width_in_luma_samples和pic_height_in_luma_samples语法元素值差的绝对值,也就是第二编码值,第二编码值的获取可以用公式表示为:Subsequently, the syntax element pic_diffwidth_height_abs can be used to represent the absolute value of the difference between pic_width_in_luma_samples and pic_height_in_luma_samples syntax elements, that is, the second code value, and the acquisition of the second code value can be expressed as:
pic_diff_width_height_abs=ABS(pic_width_in_luma_samples-pic_height_in_luma_samples)。pic_diff_width_height_abs=ABS(pic_width_in_luma_samples-pic_height_in_luma_samples).
在获取第三编码值时,可以增加表示图像宽高大小关系的大小关系语法元素pic_aspect_ratio_flag,并将其数值作为第三编码值,当宽>=高时可以设置pic_aspect_ratio_flag的值为0,宽<高时pic_aspect_ratio_flag值为1,即完成了第三编码值的获取。最后将语法元素按pic_width_heigh_min,pic_diff_width_height_abs,pic_aspect_ratio_flag的顺序依次进行无符号指数哥伦布编码写入码流。When obtaining the third encoding value, the size relationship syntax element pic_aspect_ratio_flag representing the size relationship of the image width and height can be added, and its value can be used as the third encoding value. When width>=height, the value of pic_aspect_ratio_flag can be set to 0, width<height When the value of pic_aspect_ratio_flag is 1, the acquisition of the third encoding value is completed. Finally, unsigned exponential Columbus encoding is performed on the syntax elements in the order of pic_width_height_min, pic_diff_width_height_abs, and pic_aspect_ratio_flag, and written into the code stream.
本发明实施方式将图像宽度值与高度值进行关联,获取图像高度值与宽度值的差值,并设置用以表征图像高度值与宽度值的大小关系的第三编码值。进而对高度值和宽度值中较小的值、高度值和宽度值的差值以及第三编码值进行编码,不再对二者中较大的值进行编码。宽高的差值和第三编码值均远小于二者中较大的值,相比传统方法中对图像的宽高值进行编码,显著减小了编码数据的数值,结合无符号指数哥伦布编码方式编码值越小编码比特数越少的特点,能够缩短编码位数,从而实现提高语法元素的编码效率。u(1)编码具有对一位无符号整数进行编码编码比特数少的特点,因此对表征图像宽高大小关系的第三编码值采用u(1)编码方式进行编码,能够进一步缩短编码位数,提高语法元素的编码效率。In the embodiment of the present invention, the image width value is associated with the height value, the difference between the image height value and the width value is obtained, and the third coded value used to represent the size relationship between the image height value and the width value is set. Further, the smaller value of the height value and the width value, the difference between the height value and the width value, and the third encoded value are encoded, and the larger value of the two is not encoded. The difference between the width and height and the third encoding value are much smaller than the larger value of the two. Compared with the traditional method of encoding the width and height of the image, the value of the encoded data is significantly reduced. Combined with unsigned exponential Columbus encoding The smaller the encoding value of the mode, the less the number of encoding bits, which can shorten the number of encoding bits, thereby improving the encoding efficiency of the syntax elements. U(1) encoding has the characteristics of encoding an unsigned integer with a small number of encoding bits, so the third encoding value representing the relationship between the width and height of the image is encoded using u(1) encoding, which can further shorten the number of encoding bits , to improve the coding efficiency of syntax elements.
本发明的另一个实施方式涉及一种语法元素解码的方法,具体流程如图2所示。在本实施方式中,对接收到的码流进行解码,依次得到第一编码值,第二编码值以及第三编码值;其中,第一编码值和第二编码值由无符号指数哥伦布解码得到,第三编码值由无符号指数哥伦布解码或者u(1)解码得到,第一编码值表示宽度语法元素的值和高度语法元素的值中较小的值,第二编码值表示宽度语法元素的值和高度语法元素的值的差值的绝对值,第三编码值表示宽度语法元素的值和高度语法元素的值的大小关系;根据第一编码值,第二编码值以及第三编码值,获取宽度语法元素的值和高度语法元素的值。Another embodiment of the present invention relates to a method for decoding syntax elements, and the specific process is shown in FIG. 2 . In this embodiment, the received code stream is decoded to obtain the first coded value, the second coded value and the third coded value in sequence; wherein, the first coded value and the second coded value are obtained by unsigned exponential Golomb decoding , the third coded value is obtained by unsigned exponential Golomb decoding or u(1) decoding, the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element, and the second coded value represents the value of the width syntax element value and the absolute value of the difference between the value of the height syntax element, and the third coded value represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element; according to the first coded value, the second coded value and the third coded value, Gets the value of the width syntax element and the value of the height syntax element.
下面对本实施方式中的语法元素解码的方法的实现细节进行具体的说明,以下内容仅为方便理解提供的实现细节,并非实施本方案的必须。具体流程如图2所示,至少包括但不限于如下步骤:The implementation details of the syntax element decoding method in this embodiment are described in detail below. The following content is only implementation details provided for easy understanding, and is not necessary for implementing this solution. The specific process is shown in Figure 2, at least including but not limited to the following steps:
步骤201,对接收到的码流进行解码,依次得到第一编码值,第二编码值以及第三编码值。其中,第一编码值和第二编码值由无符号指数哥伦布解码得到,第三编码值由无符号指数哥伦布解码或者u(1)解码得到。Step 201: Decode the received code stream to obtain a first coded value, a second coded value and a third coded value in sequence. Wherein, the first encoded value and the second encoded value are obtained by unsigned exponential Golomb decoding, and the third encoded value is obtained by unsigned exponential Golomb decoding or u(1) decoding.
在本步骤中,第一编码值表示宽度语法元素的值和高度语法元素的值中较小的值,第二编码值表示宽度语法元素的值和高度语法元素的值的差值的绝对值,第三编码值表示宽度语法元素的值和高度语法元素的值的大小关系。In this step, the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element, and the second coded value represents the absolute value of the difference between the value of the width syntax element and the value of the height syntax element, The third coded value represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element.
步骤202,根据第一编码值,第二编码值以及第三编码值,获取宽度语法元素的值和高度语法元素的值。 Step 202, according to the first encoded value, the second encoded value and the third encoded value, the value of the width syntax element and the value of the height syntax element are obtained.
在本步骤中,语法元素解码装置根据在码流中解析出的第三编码值的数值,能够获知宽度语法元素的值和高度语法元素的值的大小关系。结合该大小关系,可以得到宽高语法元素中较小者的值即为第一编码值,较大者的值为第一编码值与第二编码值之和。In this step, the syntax element decoding device can know the magnitude relationship between the value of the width syntax element and the value of the height syntax element according to the value of the third coded value analyzed in the code stream. Combining the size relationship, it can be obtained that the value of the smaller one of the width and height syntax elements is the first coded value, and the value of the larger one is the sum of the first coded value and the second coded value.
在一个例子中,根据第一编码值,第二编码值以及第三编码值,获取宽度语法元素的值和高度语法元素的值,可以包括:在第三编码值为表征宽度语法元素的值不小于高度语法元素的值的值的情况下,将第一编码值作为高度语法元素的值,并将第一编码值与第二编码值的和作为宽度语法元素的值;在第三编码值为表征宽度语法元素的值小于高度语法元素的值的值的情况下,将第一编码值作为宽度语法元素的值,并将第一编码值与第二编码值的和作为高度语法元素的值。In an example, obtaining the value of the width syntax element and the value of the height syntax element according to the first encoding value, the second encoding value and the third encoding value may include: the value of the third encoding value representing the width syntax element is not In the case of a value less than the value of the height syntax element, the first coded value is used as the value of the height syntax element, and the sum of the first coded value and the second coded value is used as the value of the width syntax element; when the third coded value is In the case that the value of the width syntax element is smaller than the value of the height syntax element, the first coded value is used as the value of the width syntax element, and the sum of the first coded value and the second coded value is used as the value of the height syntax element.
在一个根据宽高语法元素的值的大小关系,将第三编码值设置为0或1的例子中,在第三编码值为0的情况下,将高度语法元素的值设置为第一编码值,将宽度语法元素的值设置为第一编码值与第二编码值的和;在第三编码值为1的情况下,将宽度语法元素的值设置为第一编码值,将高度语法元素的值设置为第一编码值与第二编码值的和。本例涉及的流程图如图3所示。In an example where the third encoding value is set to 0 or 1 according to the size relationship of the width and height syntax elements, in the case where the third encoding value is 0, the value of the height syntax element is set to the first encoding value , set the value of the width syntax element to the sum of the first code value and the second code value; when the third code value is 1, set the value of the width syntax element to the first code value, and set the value of the height syntax element The value is set to the sum of the first encoded value and the second encoded value. The flowchart involved in this example is shown in Figure 3 .
本实施方式能够从根据上述编码方法进行编码得到的码流中,解析出第一编码值,第二编码值以及第三编码值。进而根据上述第一编码值,第二编码值以及第三编码值得到宽度语法元素的值和高度语法元素的值,即得到视频中图像的高度和宽度值。相比于传统的从较长的编码中解析出图像宽度高度信息的解析方式,本实施方式根据较短的编码解析出编码值,进而获取宽度和高度,能够提高解码效率。In this embodiment, the first coded value, the second coded value and the third coded value can be analyzed from the code stream obtained by coding according to the above coding method. Furthermore, according to the above-mentioned first coded value, the second coded value and the third coded value, the value of the width syntax element and the value of the height syntax element are obtained, that is, the height and width values of the image in the video are obtained. Compared with the traditional analysis method of analyzing image width and height information from a longer code, this embodiment parses a code value based on a shorter code, and then obtains the width and height, which can improve decoding efficiency.
上面方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。The division of steps in the above method is only for the sake of clarity of description. During implementation, it can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but not changing the core design of the algorithm and process are all within the protection scope of the patent.
本发明的一实施方式涉及一种语法元素的编码装置,如图4所示,包括:An embodiment of the present invention relates to an encoding device for syntax elements, as shown in FIG. 4 , including:
第一获取模块301,设置为根据宽度语法元素的值和高度语法元素的值中较小的值,获取第一编码值;The first obtaining module 301 is configured to obtain the first coded value according to the smaller value of the value of the width syntax element and the value of the height syntax element;
第二获取模块302,设置为根据宽度语法元素的值和高度语法元素的值的差值的绝对值,获取第二编码值;The second obtaining module 302 is configured to obtain the second coded value according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element;
第三获取模块303,设置为根据宽度语法元素的值和高度语法元素的值的大小关系,获取第三编码值;The third obtaining module 303 is configured to obtain a third coded value according to the magnitude relationship between the value of the width syntax element and the value of the height syntax element;
编码模块304,设置为对第一编码值,第二编码值以及第三编码值依次进行编码;其中,对第一编码值和第二编码值进行无符号指数哥伦布编码,对第三编码值进行无符号指数哥伦布编码或者u(1)编码。The coding module 304 is configured to encode the first coded value, the second coded value and the third coded value sequentially; wherein, the first coded value and the second coded value are unsigned exponential Golomb coded, and the third coded value is coded Unsigned Exponential Golomb encoding or u(1) encoding.
在一个例子中,语法元素的编码装置还可以包括:计算模块(图中未示出),设置为计算宽度语法元素和高度语法元素的比值;在比值不小于1的情况下,将第三编码值设置为表征宽度语法元素的值不小于高度语法元素的值的值;在比值小于1的情况下,将第三编码值设置为表征宽度语法元素的值小于高度语法元素的值的值。In one example, the encoding device of the syntax element may further include: a calculation module (not shown in the figure), configured to calculate the ratio of the width syntax element to the height syntax element; when the ratio is not less than 1, encode the third The value is set to a value representing that the value of the width syntax element is not less than the value of the height syntax element; in case the ratio is less than 1, the third encoding value is set to a value representing that the value of the width syntax element is less than the value of the height syntax element.
本实施方式提供的语法元素的编码装置能够将图像宽度值与高度值进行关联,获取图像高度值与宽度值的差值,并设置用以表征图像高度值与宽度值的大小关系的第三编码值。进而对高度值和宽度值中较小的值、高度值和宽度值的差值以及第三编码值进行编码,不再对二者中较大的值进行编码。宽高的差值和第三编码值均远小于二者中较大的值,相比传统方法中对图像的宽高值进行编码,显著减小了编码数据的数值,结合无符号指数哥伦布编码方式编码值越小编码比特数越少的特点,能够缩短编码位数,从而实现提高语法元素的编码效率。u(1)编码具有对一位无符号整数进行编码比特数少的特点,因此对表征图像宽高大小关系的第三编码值采用u(1)编码方式进行编码,能够进一步缩短编码位数,提高语法元素的编码效率。The encoding device for syntax elements provided in this embodiment can associate the image width value with the height value, obtain the difference between the image height value and the width value, and set the third encoding used to represent the size relationship between the image height value and the width value value. Further, the smaller value of the height value and the width value, the difference between the height value and the width value, and the third encoded value are encoded, and the larger value of the two is not encoded. The difference between the width and height and the third encoding value are much smaller than the larger value of the two. Compared with the traditional method of encoding the width and height of the image, the value of the encoded data is significantly reduced. Combined with unsigned exponential Columbus encoding The smaller the encoding value of the mode, the less the number of encoding bits, which can shorten the number of encoding bits, thereby improving the encoding efficiency of the syntax elements. The u(1) encoding has the characteristic of encoding an unsigned integer with a small number of bits, so the u(1) encoding method is used to encode the third encoding value representing the relationship between the width and height of the image, which can further shorten the number of encoding bits. Improve the coding efficiency of syntax elements.
本发明的一实施方式涉及一种语法元素的解码装置,如图5所示,包括:An embodiment of the present invention relates to a device for decoding syntax elements, as shown in FIG. 5 , including:
解析模块401,设置为对接收到的码流进行解码,依次得到第一编码值,第二编码值以及第三编码值;其中,第一编码值和第二编码值由无符号指数哥伦布解码得到,第三编码值由无符号指数哥伦布解码或者u(1)解码得到,第一编码值表示宽度语法元素的值和高度语法元素的值中较小的值,第二编码值表示宽度语法元素的值和高度语法元素的值的差值的绝对值,第三编码值表示宽度语法元素的值和高度语法元素的值的大小关系;The parsing module 401 is configured to decode the received code stream to sequentially obtain a first coded value, a second coded value and a third coded value; wherein, the first coded value and the second coded value are obtained by unsigned exponential Golomb decoding , the third coded value is obtained by unsigned exponential Golomb decoding or u(1) decoding, the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element, and the second coded value represents the value of the width syntax element The absolute value of the difference between the value of the value and the value of the height syntax element, and the third coded value represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element;
获取模块402,设置为根据第一编码值,第二编码值以及第三编码值,获取宽度语法元素的值和高度语法元素的值。The obtaining module 402 is configured to obtain the value of the width syntax element and the value of the height syntax element according to the first code value, the second code value and the third code value.
在一个例子中,语法元素的解码装置还可以包括:赋值模块(图中未示出),设置为在第三编码值为表征宽度语法元素的值不小于高度语法元素的值的值的情况下,将第一编码值作为高度语法元素的值,并将第一编码值与第二编码值的和作为宽度语法元素的值;在第三编码值为表征宽度语法元素的值小于高度语法元素的值的值的情况下,将第一编码值作为宽度语法元素的值,并将第一编码值与第二编码值的和作为高度语法元素的值。In one example, the device for decoding syntax elements may further include: an assignment module (not shown in the figure), which is configured to represent a value of a width syntax element that is not less than a value of a height syntax element when the third encoding value is not less than a value of a height syntax element , take the first coded value as the value of the height syntax element, and use the sum of the first coded value and the second coded value as the value of the width syntax element; the third coded value represents that the value of the width syntax element is less than that of the height syntax element In the case of value, the first coded value is used as the value of the width syntax element, and the sum of the first coded value and the second coded value is used as the value of the height syntax element.
本实施方式提供的语法元素的解码装置能够从根据上述编码方法进行编码得到的码流中,解析出第一编码值,第二编码值以及第三编码值。进而根据上述第一编码值,第二编码值以及第三编码值得到宽度语法元素的值和高度语法元素的值,即得到视频中图像的高度和宽度值。相比于传统的从较长的编码中解析出图像宽度高度信息的解析方式,本实施方式根据较短的编码解析出编码值,进而获取宽度和高度,能够提高解码效率。The syntax element decoding apparatus provided in this embodiment can analyze the first coded value, the second coded value and the third coded value from the code stream obtained by coding according to the above coding method. Furthermore, according to the above-mentioned first coded value, the second coded value and the third coded value, the value of the width syntax element and the value of the height syntax element are obtained, that is, the height and width values of the image in the video are obtained. Compared with the traditional analysis method of analyzing image width and height information from a longer code, this embodiment parses a code value based on a shorter code, and then obtains the width and height, which can improve decoding efficiency.
值得一提的是,本实施方式中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本发明实施例的创新部分,本实施方式中并没有将与解决本发明实 施例所提出的技术问题关系不太密切的单元引入,但这并不表明本实施方式中不存在其它的单元。It is worth mentioning that all the modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, or a part of a physical unit, or multiple physical units. Combination of units. In addition, in order to highlight the innovative part of the embodiment of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problems raised by the embodiment of the present invention, but this does not mean that there are no other elements in this embodiment unit.
本发明的实施方式还提供一种电子设备,如图6所示,包括至少一个处理器501;以及,与至少一个处理器501通信连接的存储器502;其中,存储器502存储有可被至少一个处理器501执行的指令,指令被至少一个处理器501执行,以使至少一个处理器501能够执行上述语法元素编码的方法,或执行上述的语法元素解码的方法。Embodiments of the present invention also provide an electronic device, as shown in FIG. 6 , including at least one processor 501; and a memory 502 connected in communication with at least one processor 501; wherein, the memory 502 stores information that can be processed by at least one processor. The instructions executed by the processor 501 are executed by at least one processor 501, so that at least one processor 501 can execute the above method for encoding syntax elements, or execute the above method for decoding syntax elements.
其中,存储器502和处理器501采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器501和存储器502的各种电路连接在一起。总线还可以将诸如***设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器501处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器501。Wherein, the memory 502 and the processor 501 are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors 501 and various circuits of the memory 502 together. The bus may also connect together various other circuits such as peripherals, voltage regulators, and power management circuits, all of which are well known in the art and therefore will not be further described herein. The bus interface provides an interface between the bus and the transceivers. A transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing means for communicating with various other devices over a transmission medium. The data processed by the processor 501 is transmitted on the wireless medium through the antenna, further, the antenna also receives the data and transmits the data to the processor 501 .
处理器501负责管理总线和通常的处理,还可以提供各种功能,包括定时,***接口,电压调节、电源管理以及其他控制功能。而存储器502可以被用于存储处理器501在执行操作时所使用的数据。 Processor 501 is responsible for managing the bus and general processing, and may also provide various functions including timing, peripheral interface, voltage regulation, power management and other control functions. And the memory 502 may be used to store data used by the processor 501 when performing operations.
上述产品可执行本发明实施方式所提供的方法,具备执行方法相应的功能模块和有益效果,未在本实施方式中详尽描述的技术细节,可参见本发明实施方式所提供的方法。The above-mentioned products can execute the method provided by the embodiment of the present invention, and have corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, please refer to the method provided by the embodiment of the present invention.
本发明的实施方式还提供一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述的语法元素编码的方法,或实现上述的语法元素解码的方法。Embodiments of the present invention also provide a computer-readable storage medium storing a computer program. When the computer program is executed by the processor, the above-mentioned method for encoding syntax elements is realized, or the above-mentioned method for decoding syntax elements is realized.
本领域技术人员可以理解,实现上述实施方式方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本发明各个实施方式方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Those skilled in the art can understand that all or part of the steps in the method of the above-mentioned embodiments can be completed by instructing related hardware through a program, the program is stored in a storage medium, and includes several instructions to make a device (which can be A single chip microcomputer, a chip, etc.) or a processor (processor) executes all or part of the steps of the methods in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .
上述实施方式是提供给本领域普通技术人员来实现和使用本发明实施例的,本领域普通技术人员可以在不脱离本发明实施例的发明思想的情况下,对上述实施方式做出种种修改或变化,因而本发明实施例的保护范围并不被上述实施方式所限,而应该符合权利要求书所提到的创新性特征的最大范围。The above-mentioned embodiments are provided for those of ordinary skill in the art to implement and use the embodiments of the present invention. Those skilled in the art can make various modifications or changes to the above-mentioned embodiments without departing from the inventive idea of the embodiments of the present invention. Therefore, the scope of protection of the embodiments of the present invention is not limited by the above-mentioned implementation, but should conform to the maximum scope of the innovative features mentioned in the claims.

Claims (10)

  1. 一种语法元素编码的方法,包括:A method of encoding syntax elements comprising:
    根据宽度语法元素的值和高度语法元素的值中较小的值,获取第一编码值;Acquiring the first encoded value according to the smaller value of the value of the width syntax element and the value of the height syntax element;
    根据所述宽度语法元素的值和所述高度语法元素的值的差值的绝对值,获取第二编码值;Acquiring a second coded value according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element;
    根据所述宽度语法元素的值和所述高度语法元素的值的大小关系,获取第三编码值;Acquiring a third coded value according to the magnitude relationship between the value of the width syntax element and the value of the height syntax element;
    对所述第一编码值,所述第二编码值以及所述第三编码值依次进行编码;其中,对所述第一编码值和所述第二编码值进行无符号指数哥伦布编码,对所述第三编码值进行无符号指数哥伦布编码或者u(1)编码。Encoding the first coded value, the second coded value, and the third coded value in sequence; wherein, the unsigned exponential Golomb code is performed on the first coded value and the second coded value, and the The third coded value is unsigned Exponential Golomb coded or u(1) coded.
  2. 根据权利要求1所述的语法元素编码的方法,其中,所述根据所述宽度语法元素的值和所述高度语法元素的值的大小关系,获取第三编码值,包括:The method for encoding syntax elements according to claim 1, wherein said obtaining a third encoding value according to the magnitude relationship between the value of the width syntax element and the value of the height syntax element comprises:
    将所述宽度语法元素的值作为分子,将所述高度语法元素的值作为分母,计算所述宽度语法元素和所述高度语法元素的比值;Using the value of the width syntax element as a numerator and the value of the height syntax element as a denominator, calculating the ratio of the width syntax element to the height syntax element;
    在所述比值不小于1的情况下,将所述第三编码值设置为表征所述宽度语法元素的值不小于所述高度语法元素的值的值;In the case where the ratio is not less than 1, setting the third encoded value to a value characterizing that the value of the width syntax element is not less than the value of the height syntax element;
    在所述比值小于1的情况下,将所述第三编码值设置为表征所述宽度语法元素的值小于所述高度语法元素的值的值。In case the ratio is less than 1, the third coded value is set to a value characterizing that the value of the width syntax element is smaller than the value of the height syntax element.
  3. 根据权利要求1所述的语法元素编码的方法,其中,所述宽度语法元素和所述高度语法元素均符合H.265/HEVC或H.266/VVC编码标准。The method for encoding syntax elements according to claim 1, wherein both the width syntax elements and the height syntax elements conform to the H.265/HEVC or H.266/VVC coding standards.
  4. 根据权利要求3所述的语法元素编码的方法,其中,在所述宽度语法元素和所述高度语法元素均符合H.265/HEVC编码标准的情况下,所述宽度语法元素为pic_width_in_luma_samples;所述高度语法元素为pic_height_in_luma_samples;The method for encoding syntax elements according to claim 3, wherein, when both the width syntax elements and the height syntax elements comply with the H.265/HEVC coding standard, the width syntax elements are pic_width_in_luma_samples; the The height syntax element is pic_height_in_luma_samples;
    在所述宽度语法元素和所述高度语法元素均符合H.266/VVC编码标准的情况下,所述宽度语法元素包括:sps_pic_width_max_in_luma_samples和/或pps_pic_width_in_luma_samples,所述高度语法元素包括:sps_pic_height_max_in_luma_samples和/或pps_pic_height_in_luma_samples。When both the width syntax element and the height syntax element conform to the H.266/VVC coding standard, the width syntax element includes: sps_pic_width_max_in_luma_samples and/or pps_pic_width_in_luma_samples, and the height syntax element includes: sps_pic_height_max_in_luma_samples and/or pps_pic_height_in_luma_samples .
  5. 一种语法元素解码的方法,包括:A method of decoding syntax elements, comprising:
    对接收到的码流进行解码,依次得到第一编码值,第二编码值以及第三编码值;其中,所述第一编码值和所述第二编码值由无符号指数哥伦布解码得到,所述第三编码值由无符号指数哥伦布解码或者u(1)解码得到,所述第一编码值表示宽度语法元素的值和高度语法元素的值中较小的值,所述第二编码值表示所述宽度语法元素的值和所述高度语法元素的值的差值的绝对值,所述第三编码值表示所述宽度语法元素的值和所述高度语法元素的值的大小关系;Decoding the received code stream to sequentially obtain a first coded value, a second coded value and a third coded value; wherein, the first coded value and the second coded value are obtained by unsigned exponential Golomb decoding, so The third coded value is obtained by unsigned exponential Golomb decoding or u(1) decoding, the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element, and the second coded value represents The absolute value of the difference between the value of the width syntax element and the value of the height syntax element, the third coded value represents the magnitude relationship between the value of the width syntax element and the value of the height syntax element;
    根据所述第一编码值,所述第二编码值以及所述第三编码值,获取所述宽度语法元素的值和所述高度语法元素的值。Acquiring the value of the width syntax element and the value of the height syntax element according to the first code value, the second code value and the third code value.
  6. 根据权利要求5所述的语法元素解码的方法,其中,根据所述第一编码值,所述第二编码值以及所述第三编码值,获取所述宽度语法元素的值和所述高度语法元素的值,包括:The method for decoding syntax elements according to claim 5, wherein, according to the first code value, the second code value and the third code value, the value of the width syntax element and the height syntax are obtained The value of the element, including:
    在所述第三编码值为表征所述宽度语法元素的值不小于所述高度语法元素的值的值的情况下,将所述第一编码值作为所述高度语法元素的值,并将所述第一编码值与所述第二编码值的和作为所述宽度语法元素的值;In the case where the third coded value is a value representing that the value of the width syntax element is not less than the value of the height syntax element, the first coded value is used as the value of the height syntax element, and the The sum of the first encoded value and the second encoded value is used as the value of the width syntax element;
    在所述第三编码值为表征所述宽度语法元素的值小于所述高度语法元素的值的值的情况下,将所述第一编码值作为所述宽度语法元素的值,并将所述第一编码值与所述第二编码值的和作为所述高度语法元素的值。In the case where the third coded value is a value representing that the value of the width syntax element is smaller than the value of the height syntax element, the first coded value is used as the value of the width syntax element, and the The sum of the first encoded value and the second encoded value is used as the value of the height syntax element.
  7. 一种语法元素的编码装置,包括:A device for encoding syntax elements, comprising:
    第一获取模块,设置为根据宽度语法元素的值和高度语法元素的值中较小的值,获取第一编码值;The first acquiring module is configured to acquire the first encoding value according to the smaller value of the width syntax element and the height syntax element;
    第二获取模块,设置为根据所述宽度语法元素的值和所述高度语法元素的值的差值的绝对值,获取第二编码值;The second obtaining module is configured to obtain a second coded value according to the absolute value of the difference between the value of the width syntax element and the value of the height syntax element;
    第三获取模块,设置为根据所述宽度语法元素的值和所述高度语法元素的值的大小关系,获取第三编码值;A third obtaining module, configured to obtain a third coded value according to the magnitude relationship between the value of the width syntax element and the value of the height syntax element;
    编码模块,设置为对第一编码值,第二编码值以及第三编码值依次进行编码;其中,对所述第一编码值和所述第二编码值进行无符号指数哥伦布编码,对所述第三编码值进行无符号指数哥伦布编码或者u(1)编码。The encoding module is configured to encode the first encoded value, the second encoded value and the third encoded value in sequence; wherein, the unsigned exponential Golomb encoding is performed on the first encoded value and the second encoded value, and the The third coded value is unsigned Exponential Golomb coded or u(1) coded.
  8. 一种语法元素的解码装置,包括:A device for decoding syntax elements, comprising:
    解析模块,设置为对接收到的码流进行解码,依次得到第一编码值,第二编码值以及第三编码值;其中,所述第一编码值和所述第二编码值由无符号指数哥伦布解码得到,所述第三编码值由无符号指数哥伦布解码或者u(1)解码得到,所述第一编码值表示宽度语法元素的值和高度语法元素的值中较小的值,所述第二编码值表示所述宽度语法元素的值和所述高度语法元素的值的差值的绝对值,所述第三编码值表示所述宽度语法元素的值和所述高度语法元素的值的大小关系;The parsing module is configured to decode the received code stream to obtain a first coded value, a second coded value and a third coded value in sequence; wherein, the first coded value and the second coded value are represented by an unsigned exponent Obtained by Golomb decoding, the third coded value is obtained by unsigned exponential Golomb decoding or u(1) decoding, the first coded value represents the smaller value of the value of the width syntax element and the value of the height syntax element, and the The second coded value represents the absolute value of the difference between the value of the width syntax element and the value of the height syntax element, and the third coded value represents the difference between the value of the width syntax element and the value of the height syntax element size relationship;
    获取模块,设置为根据所述第一编码值,所述第二编码值以及所述第三编码值,获取宽度语法元素的值和高度语法元素的值。An acquisition module configured to acquire the value of the width syntax element and the value of the height syntax element according to the first code value, the second code value and the third code value.
  9. 一种电子设备,包括:An electronic device comprising:
    至少一个处理器;以及,at least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至4中任一项所述的语法元素编码的方法,或执行如权利要求5至6中任一项所述的语法元素解码的方法。The memory stores instructions executable by the at least one processor, the instructions are executed by the at least one processor, so that the at least one processor can perform the operation described in any one of claims 1 to 4 The method for encoding syntax elements described above, or the method for decoding syntax elements described in any one of claims 5 to 6.
  10. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现权利要求1至4中任一项所述的语法元素编码的方法,或实现如权利要求5至6中 任一项所述的语法元素解码的方法。A computer-readable storage medium storing a computer program, wherein, when the computer program is executed by a processor, the method for encoding syntax elements according to any one of claims 1 to 4 is implemented, or the method according to claims 5 to 4 is implemented. A method for decoding the syntax element described in any one of 6.
PCT/CN2022/130709 2021-11-22 2022-11-08 Syntax element coding method and apparatus, syntax element decoding method and apparatus, and electronic device and storage medium WO2023088141A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111389452.XA CN116156203A (en) 2021-11-22 2021-11-22 Syntax element encoding and decoding methods and devices, electronic equipment and storage medium
CN202111389452.X 2021-11-22

Publications (1)

Publication Number Publication Date
WO2023088141A1 true WO2023088141A1 (en) 2023-05-25

Family

ID=86358752

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/130709 WO2023088141A1 (en) 2021-11-22 2022-11-08 Syntax element coding method and apparatus, syntax element decoding method and apparatus, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN116156203A (en)
WO (1) WO2023088141A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102934431A (en) * 2010-04-05 2013-02-13 三星电子株式会社 Low complexity entropy-encoding/decoding method and apparatus
CN106170980A (en) * 2014-04-25 2016-11-30 夏普株式会社 Picture decoding apparatus, picture coding device and coded data converting device
WO2021125145A1 (en) * 2019-12-18 2021-06-24 Sharp Kabushiki Kaisha Systems and methods for signaling picture output resolution in video coding
WO2021136375A1 (en) * 2019-12-30 2021-07-08 Mediatek Inc. Video encoding or decoding methods and apparatuses related to high-level information signaling
WO2021170091A1 (en) * 2020-02-29 2021-09-02 Beijing Bytedance Network Technology Co., Ltd. Constrains for high level syntax elements

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102934431A (en) * 2010-04-05 2013-02-13 三星电子株式会社 Low complexity entropy-encoding/decoding method and apparatus
CN106170980A (en) * 2014-04-25 2016-11-30 夏普株式会社 Picture decoding apparatus, picture coding device and coded data converting device
WO2021125145A1 (en) * 2019-12-18 2021-06-24 Sharp Kabushiki Kaisha Systems and methods for signaling picture output resolution in video coding
WO2021136375A1 (en) * 2019-12-30 2021-07-08 Mediatek Inc. Video encoding or decoding methods and apparatuses related to high-level information signaling
WO2021170091A1 (en) * 2020-02-29 2021-09-02 Beijing Bytedance Network Technology Co., Ltd. Constrains for high level syntax elements

Also Published As

Publication number Publication date
CN116156203A (en) 2023-05-23

Similar Documents

Publication Publication Date Title
US11006134B2 (en) Picture decoding and encoding methods and apparatuses, decoder, and encoder
CN113228650B (en) Quantization for video encoding or decoding of block-based surfaces
US20210274182A1 (en) Context-based binary arithmetic encoding and decoding
US11343501B2 (en) Video transcoding method and device, and storage medium
EP4128777A1 (en) Signaling coding parameters in video coding
CN114270837A (en) Lossless mode for general video codec
CN113647111A (en) In-loop reshaping adaptive reshaping direction
CN112823522A (en) Direction for wide-angle intra prediction
CN112335246B (en) Method and apparatus for adaptive coefficient set-based video encoding and decoding
WO2020113827A1 (en) Image compression method
WO2023088141A1 (en) Syntax element coding method and apparatus, syntax element decoding method and apparatus, and electronic device and storage medium
CN114208204A (en) Unification of context codec binary bit (CCB) counting methods
US11611765B2 (en) Refinement mode processing in video encoding and decoding
CN113170137A (en) Residual coding to reduce use of local neighborhood
EP3994623A1 (en) Systems and methods for encoding a deep neural network
US20240114140A1 (en) Video decoding and encoding method, device and storage medium
WO2023231775A1 (en) Filtering method, filtering model training method and related device
WO2024007843A9 (en) Encoding method and apparatus, decoding method and apparatus, and computer device
US20240064298A1 (en) Loop filtering, video encoding, and video decoding methods and apparatus, storage medium, and electronic device
US20230421765A1 (en) Video coding and decoding method and system, and video coder and video decoder
CN113905233A (en) Entropy decoding method based on audio video coding standard, readable medium and electronic device thereof
WO2023198527A1 (en) Video encoding and decoding using operations constraint
JP2022548495A (en) Most Probable Mode Signaling Using Multiple Reference Line Intra Prediction
CN117176952A (en) Video encapsulation and decapsulation method, apparatus, electronic device, and computer-readable storage medium
CN118233633A (en) Quantization for video encoding or decoding of block-based surfaces

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22894678

Country of ref document: EP

Kind code of ref document: A1