CN116074512A - Video encoding method, video encoding device, electronic equipment and storage medium - Google Patents

Video encoding method, video encoding device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116074512A
CN116074512A CN202310042005.XA CN202310042005A CN116074512A CN 116074512 A CN116074512 A CN 116074512A CN 202310042005 A CN202310042005 A CN 202310042005A CN 116074512 A CN116074512 A CN 116074512A
Authority
CN
China
Prior art keywords
transform block
target
transformation
transform
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310042005.XA
Other languages
Chinese (zh)
Inventor
何召亮
冯伟伦
罗法蕾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202310042005.XA priority Critical patent/CN116074512A/en
Publication of CN116074512A publication Critical patent/CN116074512A/en
Pending legal-status Critical Current

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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding

Abstract

The disclosure relates to a video coding method, a device, an electronic device and a storage medium, which belong to the technical field of video coding, and the method comprises the following steps: and for any one of the transformation blocks of the video frame to be encoded, determining a target threshold value of a transformation coefficient which participates in quantization processing in the transformation block based on attribute information of the transformation block, and after determining a target quantization position of the transformation block based on the target threshold value, carrying out quantization processing on the transformation block by taking the target quantization position as a starting position so as to obtain corresponding video encoding data. In the process, before the quantization processing is carried out on the transformation block, the target threshold value of the transformation block is determined in a targeted manner based on the attribute information of the transformation block, so that the accuracy of the target quantization position can be improved, the coding complexity is reduced, and the quantization processing efficiency and the video coding performance are effectively improved.

Description

Video encoding method, video encoding device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of video coding, and in particular relates to a video coding method, a video coding device, electronic equipment and a storage medium.
Background
In the video encoding process, image blocks of a video frame are usually preprocessed to obtain a plurality of transformation blocks, each transformation block comprises a plurality of transformation coefficients, after the transformation blocks are quantized, the quantized transformation blocks are further compressed to obtain corresponding video encoding data.
In the related art, before quantization processing is performed on a transform block, an initial quantization position of the transform block is often determined according to a preset threshold and a plurality of transform coefficients in the transform block, so that the transform block is quantized with the initial quantization position as a starting position.
However, the accuracy of the initial quantization position determined by the method is not high, so that the quantization processing efficiency is low, and the video coding performance is poor.
Disclosure of Invention
The disclosure provides a video coding method, a video coding device, an electronic device and a storage medium, which can effectively improve quantization processing efficiency and video coding performance. The technical scheme of the present disclosure is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided a video encoding method, the method comprising:
determining a target threshold of transform coefficients participating in quantization processing in a transform block of a video frame to be encoded based on attribute information of the transform block, the transform block including a plurality of transform coefficients, the attribute information indicating at least one of a type, a size, and a texture complexity of the transform block;
Determining a target quantization position of the transform block based on the target threshold and the plurality of transform coefficients, the target quantization position indicating a starting position for quantization processing of the transform block;
and carrying out quantization processing on the transformation block based on the target quantization position, and acquiring video coding data of the transformation block based on the transformation block after quantization processing.
By the method, for any one of the transformation blocks of the video frame to be encoded, the target threshold value of the transformation block is determined based on the attribute information of the transformation block, and after the target quantization position of the transformation block is determined based on the target threshold value, the transformation block is quantized by taking the target quantization position as the starting position, so that corresponding video encoding data is obtained. In the process, before the quantization processing is carried out on the transformation block, the target threshold value of the transformation block is determined in a targeted manner based on the attribute information of the transformation block, so that the accuracy of the target quantization position can be improved, the coding complexity is reduced, and the quantization processing efficiency and the video coding performance are effectively improved.
In some embodiments, a target threshold for a transform block of a video frame to be encoded is determined based on attribute information of the transform block, including any one of:
When the attribute information indicates that the type of the transformation block is a brightness transformation block, based on a first adjustment coefficient, adjusting a first threshold value of transformation coefficients participating in quantization processing in the transformation block to obtain the target threshold value;
and when the attribute information indicates that the type of the transformation block is a chroma transformation block, adjusting the first threshold value based on a second adjustment coefficient to obtain the target threshold value, wherein the first adjustment coefficient is smaller than the second adjustment coefficient.
By the method, in the video coding process, the brightness conversion block is more important than the chroma conversion block, so that the first adjustment coefficient is set smaller than the second adjustment coefficient, the target threshold of the brightness conversion block is lower than the target threshold of the chroma conversion block, and the target quantization position of the brightness conversion block is closer to the right lower corner of the conversion block than the chroma conversion block, so that the accuracy of the target quantization position is effectively improved.
In some embodiments, determining a target threshold for a transform block of a video frame to be encoded based on attribute information of the transform block comprises:
determining a size level of the transform block based on the size of the transform block indicated by the attribute information;
And adjusting a second threshold value of the transformation coefficient which participates in quantization processing in the transformation block based on the adjustment coefficient corresponding to the size level to obtain the target threshold value.
In some embodiments, the adjusting the second threshold based on the adjustment coefficient corresponding to the size level, to obtain the target threshold includes any one of the following:
under the condition that the size level is the first size level, based on a third adjustment coefficient, adjusting the second threshold value to obtain the target threshold value;
and under the condition that the size level is the second size level, adjusting the second threshold value based on a fourth adjustment coefficient to obtain the target threshold value, wherein the first size level is smaller than the second size level, and the third adjustment coefficient is larger than the fourth adjustment coefficient.
In the video coding process, the transform blocks with larger sizes have more non-zero transform coefficients than the transform blocks with smaller sizes, so that the third adjustment coefficient is set to be larger than the fourth adjustment coefficient, the target threshold of the transform block with larger sizes is lower than the target threshold of the transform block with smaller sizes, and therefore the transform block with larger sizes is closer to the lower right corner of the transform block, and accuracy of the target quantization position is effectively improved.
In some embodiments, determining a target threshold for a transform block of a video frame to be encoded based on attribute information of the transform block comprises:
determining a texture complexity level of the transform block based on the texture complexity of the transform block indicated by the attribute information;
and adjusting a third threshold value of the transformation coefficient participating in quantization processing in the transformation block based on the adjustment coefficient corresponding to the texture complexity level to obtain the target threshold value.
In some embodiments, the adjusting the third threshold based on the adjustment coefficient corresponding to the texture complexity level to obtain the target threshold includes any one of the following:
under the condition that the texture complexity level is the first texture complexity level, adjusting the third threshold value based on a fifth adjustment coefficient to obtain the target threshold value;
and under the condition that the texture complexity level is the second texture complexity level, adjusting the third threshold value based on a sixth adjustment coefficient to obtain the target threshold value, wherein the first texture complexity level is smaller than the second texture complexity level, and the fifth adjustment coefficient is larger than the sixth adjustment coefficient.
By the method, in the video coding process, the transformation blocks with higher texture complexity have more texture characteristics than the transformation blocks with lower texture complexity, namely are more important, so that the fifth adjustment coefficient is set to be larger than the sixth adjustment coefficient, the target threshold of the transformation block with higher texture complexity is lower than the target threshold of the transformation block with lower texture complexity, and the target quantization position of the transformation block with higher texture complexity is closer to the lower right corner of the transformation block than the transformation block with lower texture complexity, so that the accuracy of the target quantization position is effectively improved.
In some embodiments, determining a target threshold for a transform block of a video frame to be encoded based on attribute information of the transform block comprises:
determining a transform block level of the transform block based on at least two of a type, a size, and a texture complexity of the transform block indicated by the attribute information;
and adjusting the fourth threshold based on the adjustment coefficient corresponding to the level of the transformation block to obtain the target threshold.
According to the method, in the video coding process, as the importance of the transformation blocks with different characteristics on video coding is often different, the target threshold value is determined by integrating the various characteristics of the transformation blocks, and a more proper target threshold value can be determined for the transformation blocks in a targeted manner, so that the accuracy of the target quantization position is improved.
In some embodiments, determining the target quantization position for the transform block based on the target threshold and the plurality of transform coefficients comprises:
the plurality of transform coefficients are scanned based on a coefficient scan order, and when a target transform coefficient is scanned to be greater than the target threshold, a target quantization position of the transform block is determined based on a position of the target transform coefficient in the transform block, the target transform coefficient being any one of the transform blocks.
According to the method, the target threshold value of the transformation block is determined according to the attribute information of the transformation block, so that the adaptation degree between the target quantization position determined according to the target threshold value and the transformation block is high, namely the accuracy of the target quantization position is high, and on the basis of the adaptation degree, when the target quantization position is taken as the initial position for quantization processing, the coding complexity can be reduced, the calculation cost is saved, and the video coding performance is improved.
According to a second aspect of embodiments of the present disclosure, there is provided a video encoding apparatus, the apparatus comprising:
a threshold determining unit configured to perform determination of a target threshold of transform coefficients participating in quantization processing in a transform block based on attribute information of the transform block of a video frame to be encoded, the transform block including a plurality of transform coefficients, the attribute information indicating at least one of a type, a size, and a texture complexity of the transform block;
a position determining unit configured to perform determination of a target quantization position of the transform block, which indicates a start position of quantization processing of the transform block, based on the target threshold value and the plurality of transform coefficients;
and an acquisition unit configured to perform quantization processing on the transform block based on the target quantization position, and acquire video encoded data of the transform block based on the quantized transform block.
In some embodiments, the threshold determining unit is configured to perform any one of the following:
when the attribute information indicates that the type of the transformation block is a brightness transformation block, based on a first adjustment coefficient, adjusting a first threshold value of transformation coefficients participating in quantization processing in the transformation block to obtain the target threshold value;
and when the attribute information indicates that the type of the transformation block is a chroma transformation block, adjusting the first threshold value based on a second adjustment coefficient to obtain the target threshold value, wherein the first adjustment coefficient is smaller than the second adjustment coefficient.
In some embodiments, the threshold determining unit is configured to perform:
determining a size level of the transform block based on the size of the transform block indicated by the attribute information;
and adjusting a second threshold value of the transformation coefficient which participates in quantization processing in the transformation block based on the adjustment coefficient corresponding to the size level to obtain the target threshold value.
In some embodiments, the threshold determining unit is configured to perform any one of the following:
under the condition that the size level is the first size level, based on a third adjustment coefficient, adjusting the second threshold value to obtain the target threshold value;
And under the condition that the size level is the second size level, adjusting the second threshold value based on a fourth adjustment coefficient to obtain the target threshold value, wherein the first size level is smaller than the second size level, and the third adjustment coefficient is larger than the fourth adjustment coefficient.
In some embodiments, the threshold determining unit is configured to perform:
determining a texture complexity level of the transform block based on the texture complexity of the transform block indicated by the attribute information;
and adjusting a third threshold value of the transformation coefficient participating in quantization processing in the transformation block based on the adjustment coefficient corresponding to the texture complexity level to obtain the target threshold value.
In some embodiments, the threshold determining unit is configured to perform any one of the following:
under the condition that the texture complexity level is the first texture complexity level, adjusting the third threshold value based on a fifth adjustment coefficient to obtain the target threshold value;
and under the condition that the texture complexity level is the second texture complexity level, adjusting the third threshold value based on a sixth adjustment coefficient to obtain the target threshold value, wherein the first texture complexity level is smaller than the second texture complexity level, and the fifth adjustment coefficient is larger than the sixth adjustment coefficient.
In some embodiments, the threshold determining unit is configured to perform:
determining a transform block level of the transform block based on at least two of a type, a size, and a texture complexity of the transform block indicated by the attribute information;
and adjusting the fourth threshold based on the adjustment coefficient corresponding to the level of the transformation block to obtain the target threshold.
In some embodiments, the location determination unit is configured to perform:
the plurality of transform coefficients are scanned based on a coefficient scan order, and when a target transform coefficient is scanned to be greater than the target threshold, a target quantization position of the transform block is determined based on a position of the target transform coefficient in the transform block, the target transform coefficient being any one of the transform blocks.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device comprising:
one or more processors;
a memory for storing the processor-executable program code;
wherein the processor is configured to execute the program code to implement the video encoding method described above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium comprising: the program code in the computer readable storage medium, when executed by a processor of an electronic device, enables the electronic device to perform the video encoding method described above.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the video encoding method described above.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a schematic illustration of an implementation environment provided by an embodiment of the present disclosure;
fig. 2 is a flowchart of a video encoding method provided in an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of determining a target quantization position provided by an embodiment of the present disclosure;
fig. 4 is a block diagram of a video encoding apparatus provided by an embodiment of the present disclosure;
FIG. 5 is a block diagram of a terminal provided by an embodiment of the present disclosure;
fig. 6 is a block diagram of a server provided by an embodiment of the present disclosure.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
It should be noted that, the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals related to the present disclosure are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions. For example, attribute information and the like of the transformation block referred to in the embodiments of the present disclosure are acquired with sufficient authorization.
Fig. 1 is a schematic view of an implementation environment provided by an embodiment of the present disclosure. Referring to fig. 1, the implementation environment includes: encoding apparatus 101 and decoding apparatus 102. The encoding apparatus 101 and the decoding apparatus 102 may be directly or indirectly connected through wired or wireless communication, which is not limited by the embodiment of the present disclosure.
The encoding device 101 is used to implement a video encoding function. Illustratively, the encoding device 101 samples a video to be encoded to obtain a plurality of video frames of the video to be encoded, encodes the video frames based on a video encoding standard to obtain corresponding video encoded data (also referred to as a code stream), and transmits the video encoded data to the decoding device 102. Among other things, video coding standards typically employ a block-based hybrid coding framework, including but not limited to: high performance video coding standard (High Efficiency Video Coding, HEVC), multi-function video coding standard (Versatile Video Coding, VVC), audio video coding standard (Audio Video coding Standard, avs 3), and the like, to which embodiments of the disclosure are not limited.
The decoding device 102 is used to implement video decoding functions. Illustratively, the decoding device 102 receives the video encoded data, decodes the video encoded data according to the reverse sequence of the encoding device 101, and obtains a corresponding video frame, that is, a decoded video.
In the disclosed embodiment, the encoding device 101 and the decoding device 102 may be any form of electronic device. The electronic device is, for example, a terminal or a server. Taking an electronic device as an example, the terminal is at least one of a smart phone, a smart watch, a desktop computer, a portable computer, a virtual reality terminal, an augmented reality terminal, a wireless terminal, a laptop portable computer and the like. The terminal has a communication function and can be accessed to a wired network or a wireless network. Taking an electronic device as a server, the server may be an independent physical server, a server cluster or a distributed file system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, a CDN (Content Delivery Network ), basic cloud computing services such as big data and an artificial intelligence platform. Of course, the server may also include other functional servers in order to provide more comprehensive and diverse services.
In some embodiments, the encoding device 101 and the decoding device 102 are disposed in the same electronic device, and the video decoding function and the video encoding function are implemented by different functional modules of the electronic device, respectively. For example, taking an electronic device as an example, a terminal is running on the terminal with video compression software (with a built-in video encoder, i.e. the encoding device 101) and video playing software (with a built-in video decoder, i.e. the decoding device 102), the video encoding function is implemented by the video compression software, and the video decoding function is implemented by the video playing software, which is not limited in the embodiment of the present disclosure.
Some key terms related to the embodiments of the present disclosure are described first below.
Block Partition (Block Partition), in the video coding process, refers to dividing a video frame to be coded (or called an image frame) into a plurality of non-overlapping image blocks (or called coding units), where the image blocks are the basic units of video coding. In the video encoding process, a video frame to be encoded is divided into a plurality of Coding Tree Units (CTUs) that do not overlap each other, a cyclic hierarchical structure based on quadtrees or other structures are adopted inside the CTUs, further, each CTU is divided into a plurality of Coding Units (CUs), and each CU is encoded to obtain video encoded data.
The transformation processing is a linear operation, and the image described in the form of pixels in the space domain can be converted into a transformation coefficient matrix of the transformation domain through the transformation processing, so that the purpose of removing the space redundancy is achieved. Schematically, in the video encoding process, for any image block of a video frame, a prediction mode is used to predict the image block, so as to obtain a corresponding residual block. The prediction modes here include: intra prediction mode, inter prediction mode, or block copy intra prediction mode, and the like, without limitation. Further, the residual block is subjected to a transform process such as discrete fourier transform (Discrete Fourier Transform, DFT) or discrete cosine transform (Discrete Cosine Transform, DCT) to obtain a two-dimensional transform block composed of a plurality of transform coefficients. The Transform block herein may also be referred to as a Transform coefficient block, transform Unit (TU), transform coefficient matrix, or the like. Generally, the transform coefficients in the upper left corner of the transform block indicate low frequency information of the image, and the remaining transform coefficients indicate high frequency information of the image. The low frequency information represents the overall appearance of a graph, and the coefficient values of the low frequency transform coefficients are generally large. The high-frequency information mainly indicates that the number of high-frequency transform coefficients is large in a place where the change of the contour edge of a person or an object in an image is severe, and the coefficient value of the high-frequency transform coefficient is generally small.
Quantization processing is a process of mapping a plurality of transform coefficients in the above-described transform block into a plurality of discrete values, which corresponds to representing several values with one value. It should be understood that, in the transform block obtained through the transform process, the transform coefficient tends to have a large dynamic range, and by performing the quantization process on the transform block, the data amount of the transform coefficient in the quantized transform block obtained is greatly reduced, so that the data amount is effectively compressed. Illustratively, the quantization process comprises: common quantization, rate-distortion optimized quantization, dependent scalar quantization (Dependent Scalar Quantization, DQ), etc., to which embodiments of the present disclosure are not limited. In general, since the transform coefficients in the transform block are mostly concentrated in the upper left corner of the transform block, and there are many transform coefficients having coefficient values of 0 in the lower right corner of the transform block, if the transform coefficients having coefficient values of 0 are quantized, the calculation resources are wasted and the video coding performance is degraded, so before the quantization process is performed on the transform block, a target quantization position, also referred to as an initial quantization position, of the transform block is often determined, and the quantization process is performed on the transform block with the target quantization position as a starting position.
Entropy coding refers to a coding mode without losing any information according to an entropy principle in the coding process, namely a compression method. Schematically, in the video encoding process, after performing transformation processing and quantization processing on an image block of a video frame, entropy encoding is performed on the transformed block after the quantization processing, so as to obtain corresponding video encoding data.
Based on the foregoing description, a video encoding method provided by an embodiment of the present disclosure is described below.
Fig. 2 is a flowchart of a video encoding method provided in an embodiment of the present disclosure. As shown in fig. 2, the method is applied to a coding device, and the coding device is taken as an example of any form of electronic device, and the method includes the following steps 201 to 203.
In step 201, the electronic device determines a target threshold of transform coefficients participating in a quantization process in a transform block of a video frame to be encoded based on attribute information of the transform block, the transform block including a plurality of transform coefficients, the attribute information indicating at least one of a type, a size, and a texture complexity of the transform block.
In the embodiment of the present disclosure, a video frame to be encoded refers to any one of video frames in video to be encoded, and the transform block refers to any one of transform blocks of the video frame to be encoded. The video to be encoded may be a video stored locally in the electronic device, or may be a video transmitted to the electronic device based on a streaming media technology, which is not limited in this disclosure. The method comprises the steps that an electronic device responds to a video coding request aiming at a video to be coded, samples the video to be coded to obtain a plurality of video frames to be coded, performs block division on any video frame to be coded to obtain a plurality of image blocks, performs transformation processing on any image block to obtain a corresponding transformation block, and determines a target threshold value of a transformation coefficient which participates in quantization processing in the transformation block based on attribute information of the transformation block. It should be noted that, the specific process of the transformation process refers to the foregoing description, and is not repeated herein. The specific process of determining the target threshold by the electronic device according to the attribute information will be described in the following embodiments, which are not described herein.
The attribute information of any transform block of a video frame to be encoded will be described in detail below by taking this transform block as an example. It should be understood that the attribute information indicating at least one of a type, a size, and a texture complexity of the transform block means that the attribute information may indicate any of the foregoing, or any of the foregoing, and the present disclosure is not limited thereto.
Wherein the types of transform blocks include luma transform blocks and chroma transform blocks. The size of the transform block refers to the width and height of the transform block, for example, the width and height of the transform block are each 128 pixels, and the size of the transform block is 128×128; of course, the size of the transform block may be embodied by the area of the transform block, which is not limited. The texture complexity of a transform block refers to the gradient of the transform block. Here, texture is a visual feature reflecting a homogeneous phenomenon in an image, which represents a surface structural organization arrangement property of the surface of an object with a slow change or a periodic change. In general, the higher the texture complexity of a transform block, the more texture features of the image in the transform block, and the more image detail. In some embodiments, the texture complexity of the transform block can also be embodied by the second moment (variance) of the gray level histogram of the transform block, or by other means, which is not limited by the present disclosure.
Through the step 201, for any transform block of a video frame to be encoded, the electronic device can purposefully determine the target threshold of the transform block according to the attribute information of the transform block (or according to the characteristics of the transform block itself), and provide a basis for determining the target quantization position of the transform block.
In step 202, the electronic device determines a target quantization position for the transform block based on the target threshold and the plurality of transform coefficients, the target quantization position indicating a starting position for quantization processing of the transform block.
In an embodiment of the disclosure, the electronic device scans the plurality of transform coefficients based on a coefficient scan order, and determines a target quantization position (also referred to as an initial quantization position) of the transform block based on a position of a target transform coefficient in the transform block, which is any one of the transform coefficients, when the target transform coefficient is scanned to be greater than the target threshold. Wherein the coefficient scan order indicates a start position and a scan direction of the electronic device for scanning the plurality of transform coefficients. For example, the coefficient scanning order is a diagonal scan, that is, the electronic device scans toward the upper left corner of the transform block with the position of the transform coefficient in the lower right corner of the transform block as the starting position. In some embodiments, the electronic device sets the transform coefficient prior to scanning the target quantization position to 0 based on the target quantization position, providing technical support for subsequent quantization processes for the transform block.
Referring to fig. 3 schematically, fig. 3 is a schematic diagram of determining a target quantization position according to an embodiment of the present disclosure. As shown in fig. 3, the coefficient scan order is diagonal scan, the electronic device scans the plurality of transform coefficients one by one with the position of the transform coefficient at the lower right corner in the transform block as the start position, and when the transform coefficient a is scanned to be greater than the target threshold value, the position of the transform coefficient a in the transform block is taken as the target quantization position of the transform block, and the transform coefficient before the transform coefficient a is scanned is set to 0. It will be appreciated that the closer the target quantization position is to the upper left corner, the lower the encoding complexity is in quantizing the transform block, and the higher the quantization processing efficiency is.
It should be noted that the above-mentioned coefficient scanning sequence shown in fig. 3 is only an example provided in the embodiment of the present disclosure, and the electronic device may further scan the plurality of transform coefficients one by one according to other schemes based on the start position and the scanning sequence indicated by the coefficient scanning sequence, for example, the electronic device scans one transform coefficient to the left and then scans one transform coefficient to the right and so on until the transform coefficient at the upper left corner in the transform block is scanned. That is, the embodiment of the present disclosure is not limited to a specific process of performing the coefficient scan by the electronic device based on the coefficient scan order.
Through the above step 202, since the target threshold value of the transform block is determined according to the attribute information of the transform block, the adaptation degree between the target quantization position determined according to the target threshold value and the transform block, that is, the accuracy of the target quantization position is high, based on which, when the quantization processing is performed with the target quantization position as the starting position, the encoding complexity can be reduced, the calculation overhead is saved, and the video encoding performance is improved.
In step 203, the electronic device performs quantization processing on the transform block based on the target quantization position, and obtains video encoded data of the transform block based on the quantized transform block.
In the embodiment of the disclosure, the electronic device performs quantization processing on the transform block with the target quantization position as a starting position to obtain a quantized transform block, and further performs entropy coding on the quantized transform block to obtain video coding data of the transform block.
The above steps 201 to 203 are described by taking any transform block of the video frame to be encoded as an example, and in the process of encoding the video to be encoded, the electronic device performs the processing manner as described above on any transform block of each video frame to be encoded, so as to finally obtain video encoded data, that is, a code stream. In the process, before the quantization processing is carried out on the transformation block, the target threshold value of the transformation block is determined in a targeted manner based on the attribute information of the transformation block, so that the accuracy of the target quantization position can be improved, the coding complexity is reduced, and the quantization processing efficiency and the video coding performance are effectively improved.
The following describes a specific embodiment of determining the target threshold of the transform block by the electronic device in the above step 201, taking any transform block of the video frame to be encoded as an example. Illustratively, the following means are included:
mode one, a target threshold for a transform block is determined based on a type of the transform block.
Wherein the types of transform blocks include luma transform blocks and chroma transform blocks. A process for an electronic device to determine a target threshold for a transform block, comprising: when the attribute information indicates that the type of the conversion block is a brightness conversion block, the first threshold value is adjusted based on the first adjustment coefficient to obtain a target threshold value; and when the attribute information indicates that the type of the transformation block is a chroma transformation block, adjusting a first threshold of transformation coefficients participating in quantization processing in the transformation block based on the second adjustment coefficient to obtain a target threshold.
Wherein the first adjustment coefficient is smaller than the second adjustment coefficient. Adjusting the threshold based on the adjustment coefficient means that the adjustment coefficient is multiplied by the threshold, thereby obtaining a corresponding target threshold. In addition, the first adjustment coefficient, the second adjustment coefficient and the first threshold can be set according to requirements. For example, the first threshold is set to 1, the first adjustment coefficient is set to 1.1, and the second adjustment coefficient is set to 1.2, which is not limited thereto.
In the first mode, in the video encoding process, the luminance transformation block is more important than the chrominance transformation block, so that the first adjustment coefficient is set smaller than the second adjustment coefficient, so that the target threshold of the luminance transformation block is lower than the target threshold of the chrominance transformation block, and the target quantization position of the luminance transformation block is closer to the lower right corner of the transformation block than the chrominance transformation block, and the accuracy of the target quantization position is effectively improved.
Mode two, a target threshold for a transform block is determined based on the size of the transform block.
The size of the transformation block refers to the width and height of the transformation block. A process for determining a target threshold of a transformation block by an electronic device, comprising the following steps A1 and A2:
and A1, determining the size level of the transformation block based on the size of the transformation block indicated by the attribute information.
Wherein the larger the size of the transform block, the larger the size level of the transform block. It should be noted that the size levels can be divided according to the requirements. Illustratively, the size classes are divided into a size class a and a size class B, wherein the size class a indicates that the size of the transform block is smaller and the size class B indicates that the size of the transform block is larger. In this case, a size threshold may be set to distinguish the size levels. For example, the size threshold is 64 pixels, the size level of a transform block is a if the height or width of the transform block is less than 64 pixels, and correspondingly, the size level of a transform block is B if the height or width of the transform block is greater than or equal to 64 pixels.
It should be noted that the embodiments of the present disclosure are not limited to the number of size classes, that is, the size classes may be divided into two, three, or even more classes, and so on. By refining the size level, the degree of adaptation between the transform block and the target threshold of the transform block can be improved, thereby improving the accuracy of the target quantization position.
And A2, adjusting a second threshold value of the transformation coefficient which participates in quantization processing in the transformation block based on the adjustment coefficient corresponding to the size level to obtain a target threshold value.
Wherein different size levels correspond to different adjustment coefficients. The larger the size level, the smaller the adjustment coefficient. Illustratively, the step includes: under the condition that the size level is the first size level, based on a third adjustment coefficient, adjusting the second threshold value to obtain the target threshold value; and when the size level is the second size level, adjusting the second threshold based on a fourth adjustment coefficient to obtain the target threshold.
Wherein the first size level is smaller than the second size level, and the third adjustment coefficient is larger than the fourth adjustment coefficient. The adjustment of the threshold based on the adjustment coefficient is the same as the above manner, and thus will not be described in detail. In addition, the second threshold may be the same as the first threshold, which is not limited by the present disclosure.
In the second mode, in the video encoding process, the transform blocks with larger sizes have more non-zero transform coefficients than the transform blocks with smaller sizes, so that the third adjustment coefficient is set to be larger than the fourth adjustment coefficient, the target threshold of the transform block with larger sizes is lower than the target threshold of the transform block with smaller sizes, and therefore the transform block with larger sizes with larger target quantization positions is closer to the lower right corner of the transform block, and accuracy of the target quantization positions is effectively improved.
Mode three, determining a target threshold for a transform block based on a texture complexity of the transform block.
Wherein the texture complexity of a transform block refers to the gradient of the transform block. A process of determining a target threshold of a transformation block by an electronic device, comprising the following steps B1 and B2:
and B1, determining the texture complexity level of the transformation block based on the texture complexity of the transformation block indicated by the attribute information.
Wherein, the higher the texture complexity of the transform block, the greater the texture complexity level of the transform block. It should be noted that the texture complexity level can be divided according to the requirement. Illustratively, the texture complexity level is divided into a texture complexity level C and a texture complexity level D, wherein the texture complexity level C indicates that the texture complexity of the transform block is higher, the image details are richer, and the texture complexity level D indicates that the texture complexity of the transform block is lower, and the image details are less. In this case, a texture complexity threshold may be set to distinguish between texture complexity levels. For example, the texture complexity threshold is 50, and if the texture complexity of the transform block is less than 50, the texture complexity level of the transform block is C, and correspondingly, if the texture complexity of the transform block is greater than or equal to 50, the texture complexity level of the transform block is D.
It should be noted that the embodiments of the present disclosure are not limited to the number of texture complexity levels, i.e., the texture complexity levels may be divided into two, three, or even more levels, etc. By refining the texture complexity level, the adaptation between the transform block and the target threshold of the transform block can be improved, thereby improving the accuracy of the target quantization position.
And B2, adjusting a third threshold value of the transformation coefficient participating in quantization processing in the transformation block based on the adjustment coefficient corresponding to the texture complexity level to obtain the target threshold value.
Wherein different texture complexity levels correspond to different adjustment coefficients. The greater the texture complexity level, the smaller the adjustment coefficient. Illustratively, the step includes: under the condition that the texture complexity level is the first texture complexity level, adjusting the third threshold value based on a fifth adjustment coefficient to obtain the target threshold value; and under the condition that the texture complexity level is the second texture complexity level, adjusting the third threshold value based on a sixth adjustment coefficient to obtain the target threshold value.
Wherein the first texture complexity level is less than the second texture complexity level and the fifth adjustment coefficient is greater than the sixth adjustment coefficient. The adjustment of the threshold based on the adjustment coefficient is the same as the above manner, and thus will not be described in detail. The third threshold value may be the same as both the first threshold value and the second threshold value, and this is not limited by the present disclosure.
In the third mode, in the video encoding process, the transform block with higher texture complexity has more texture features, that is, is more important, than the transform block with lower texture complexity, so that the fifth adjustment coefficient is set to be larger than the sixth adjustment coefficient, so that the target threshold of the transform block with higher texture complexity is lower than the target threshold of the transform block with lower texture complexity, and the target quantization position of the transform block with higher texture complexity is closer to the lower right corner of the transform block than the transform block with lower texture complexity, thereby effectively improving the accuracy of the target quantization position.
Mode four, determining a target threshold for the transform block based on at least two of a type, a size, and a texture complexity of the transform block.
The process of determining the target threshold value of the transformation block by the electronic equipment comprises the following steps of C1 and C2:
and C1, determining a transformation block level of the transformation block based on at least two of the type, the size and the texture complexity of the transformation block indicated by the attribute information.
Wherein the electronic device is capable of determining a transform block level of the transform block in combination with a type and a size of the transform block, or in combination with a type and a texture complexity, or in combination with a size and a texture complexity, or in combination with a type, a size and a texture complexity. It should be noted that the transform block level can be divided according to the requirement. For example, taking an electronic device to determine a transform block level in combination with a type and a size of a transform block as an example, the transform block level is classified into 1 to 5, the electronic device determines a corresponding level based on the type and the size of the transform block, e.g., if a certain transform block is a luminance transform block and the size level is a first size level, the transform block level of the transform block is determined to be 1, if a certain transform block is a luminance transform block and the size level is a second size level, the transform block level of the transform block is determined to be 2, and so on, the present disclosure is not limited thereto. For another example, taking an electronic device to determine a transform block level by combining the type, the size and the texture complexity of the transform block as an example, the transform block level is divided into 1 to 10, and the electronic device determines a corresponding level based on the type, the size and the texture complexity of the transform block, for example, if a certain transform block is a luminance transform block, the size level is a first size level and the texture complexity level is a first texture complexity level, the transform block level of the transform block is determined to be 1, and so on, which is not described herein.
In some embodiments, the electronic device determines transform reference information for the transform block based on the type, size, and texture complexity of the transform block, the transform reference information indicating attribute information employed to determine the transform block level, thereby determining the transform block level for the transform block based on the attribute information indicated by the transform reference information. In other words, the electronic device can select the attribute for determining the transform block level from the attribute information of the transform block based on the transform reference information, thereby improving the accuracy of the transform block level and thus the accuracy of the target threshold. Illustratively, the electronic device determines transform reference information for the transform block based on the type, size, texture complexity, and target weight of the transform block. The target weight indicates importance of different attribute information for video coding, the target weight is a preset weight, and can be set according to requirements, for example, the target weight is 0.6, 0.8 and 0.9, the importance of the type, the size and the texture complexity of the transformation block for video coding are respectively indicated, the transformation reference information is numerical value type information, and the electronic device can select attribute information for determining the level of the transformation block from the attribute information of the transformation block based on the numerical value range where the transformation reference information is located. For example, if a transform block is a luminance transform block (represented by a value of 10) and has a size of 64 pixels and a texture complexity of 50, the transform reference information of the transform block is 0.6x1+0.8x64+0.9x50=102.2, and greater than 100, and the electronic device determines the transform block level based on the type, size, and texture complexity of the transform block. It should be noted that the specific implementation of the transformation reference information is merely illustrative, and in some embodiments, the electronic device may also select the attribute information for determining the transformation block level from the attribute information of the transformation block based on other manners, which is not limited by the embodiments of the present disclosure.
And C2, adjusting the fourth threshold value based on the adjustment coefficient corresponding to the conversion block level to obtain the target threshold value.
Different transformation block levels correspond to different adjustment coefficients and can be set according to requirements. For example, the transform block level is divided into 1 to 5, and the corresponding adjustment coefficients are 1.1, 1.2, 1.3, 1.4, and 1.5, respectively. The adjustment of the threshold based on the adjustment coefficient is the same as the above manner, and thus will not be described in detail. In addition, the fourth threshold may be the same as the first threshold, the second threshold, and the third threshold, which is not limited by the present disclosure.
In the fourth mode, in the video encoding process, as the importance of the transform blocks with different characteristics to video encoding is often different, the target threshold value is determined by integrating the various characteristics of the transform blocks, and a more suitable target threshold value can be determined for the transform blocks in a targeted manner, so that the accuracy of the target quantization position is improved.
In the first to fourth modes, the electronic device is described taking an example in which the electronic device adjusts a certain threshold value based on the adjustment coefficient to obtain the target threshold value, and in some embodiments, the electronic device may also determine the target threshold value directly based on the attribute information of the transformation block. Illustratively, the electronic device stores a target file indicating a mapping relationship between attribute information of the transform block and a target threshold value. For example, taking the above-described mode one as an example, the luminance transform block and the chrominance transform block correspond to the target threshold value a and the target threshold value b, respectively; taking the second mode as an example, the size level a and the size level B respectively correspond to the target threshold c and the target threshold d; the rest is the same, so it will not be described in detail. Through the preset target threshold values corresponding to different attribute information, the efficiency of determining the target threshold values can be improved in the video coding process, and further the video coding performance is improved.
Fig. 4 is a block diagram of a video encoding apparatus provided in an embodiment of the present disclosure. Referring to fig. 4, the apparatus includes a threshold determination unit 401, a position determination unit 402, and an acquisition unit 403.
A threshold determining unit 401 configured to perform determination of a target threshold of transform coefficients participating in quantization processing in a transform block based on attribute information of the transform block of a video frame to be encoded, the transform block including a plurality of transform coefficients, the attribute information indicating at least one of a type, a size, and a texture complexity of the transform block;
a position determining unit 402 configured to perform determination of a target quantization position of the transform block, which indicates a start position of quantization processing of the transform block, based on the target threshold value and the plurality of transform coefficients;
an acquisition unit 403 configured to perform quantization processing on the transform block based on the target quantization position, and acquire video encoded data of the transform block based on the quantized transform block.
In some embodiments, the threshold determining unit 401 is configured to perform any of the following:
when the attribute information indicates that the type of the transformation block is a brightness transformation block, based on a first adjustment coefficient, adjusting a first threshold value of transformation coefficients participating in quantization processing in the transformation block to obtain the target threshold value;
And when the attribute information indicates that the type of the transformation block is a chroma transformation block, adjusting the first threshold value based on a second adjustment coefficient to obtain the target threshold value, wherein the first adjustment coefficient is smaller than the second adjustment coefficient.
In some embodiments, the threshold determining unit 401 is configured to perform:
determining a size level of the transform block based on the size of the transform block indicated by the attribute information;
based on the adjustment coefficient corresponding to the size level, and adjusting a second threshold value of the transformation coefficient which participates in quantization processing in the transformation block to obtain the target threshold value.
In some embodiments, the threshold determining unit 401 is configured to perform any of the following:
under the condition that the size level is the first size level, based on a third adjustment coefficient, adjusting the second threshold value to obtain the target threshold value;
and under the condition that the size level is the second size level, adjusting the second threshold value based on a fourth adjustment coefficient to obtain the target threshold value, wherein the first size level is smaller than the second size level, and the third adjustment coefficient is larger than the fourth adjustment coefficient.
In some embodiments, the threshold determining unit 401 is configured to perform:
Determining a texture complexity level of the transform block based on the texture complexity of the transform block indicated by the attribute information;
and adjusting a third threshold value of the transformation coefficient participating in quantization processing in the transformation block based on the adjustment coefficient corresponding to the texture complexity level to obtain the target threshold value.
In some embodiments, the threshold determining unit 401 is configured to perform any of the following:
under the condition that the texture complexity level is the first texture complexity level, adjusting the third threshold value based on a fifth adjustment coefficient to obtain the target threshold value;
and under the condition that the texture complexity level is the second texture complexity level, adjusting the third threshold value based on a sixth adjustment coefficient to obtain the target threshold value, wherein the first texture complexity level is smaller than the second texture complexity level, and the fifth adjustment coefficient is larger than the sixth adjustment coefficient.
In some embodiments, the threshold determining unit 401 is configured to perform:
determining a transform block level of the transform block based on at least two of a type, a size, and a texture complexity of the transform block indicated by the attribute information;
and adjusting the fourth threshold based on the adjustment coefficient corresponding to the level of the transformation block to obtain the target threshold.
In some embodiments, the location determination unit 401 is configured to perform:
the plurality of transform coefficients are scanned based on a coefficient scan order, and when a target transform coefficient is scanned to be greater than the target threshold, a target quantization position of the transform block is determined based on a position of the target transform coefficient in the transform block, the target transform coefficient being any one of the transform blocks.
With the video encoding device, for any one of the transform blocks of the video frame to be encoded, a target threshold of the transform block is determined based on attribute information of the transform block, and after a target quantization position of the transform block is determined based on the target threshold, the transform block is quantized with the target quantization position as a starting position, so as to obtain corresponding video encoded data. In the process, before the quantization processing is carried out on the transformation block, the target threshold value of the transformation block is determined in a targeted manner based on the attribute information of the transformation block, so that the accuracy of the target quantization position can be improved, the coding complexity is reduced, and the quantization processing efficiency and the video coding performance are effectively improved.
It should be noted that: in the video encoding device provided in the above embodiment, only the division of the above functional modules is used for illustration, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to perform all or part of the functions described above. In addition, the video encoding device and the video encoding method provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the video encoding device and the video encoding method are detailed in the method embodiments and are not repeated herein.
In an exemplary embodiment, there is also provided an electronic device comprising a processor and a memory for storing at least one computer program that is loaded and executed by the processor to implement the video encoding method in embodiments of the present disclosure.
Taking an electronic device as an example of a terminal, fig. 5 is a block diagram of a terminal according to an embodiment of the disclosure. The terminal 500 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion picture expert compression standard audio plane 3), an MP4 (Moving Picture Experts Group Audio Layer IV, motion picture expert compression standard audio plane 4) player, a notebook computer, or a desktop computer. The terminal 500 may also be referred to by other names of user devices, portable terminals, laptop terminals, desktop terminals, etc.
In general, the terminal 500 includes: a processor 501 and a memory 502.
Processor 501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 501 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Progra mmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 501 may also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 501 may be integrated with a GPU (Graphics Processing Unit, image processor) for taking care of rendering and rendering of content that the display screen is required to display. In some embodiments, the processor 501 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 502 may include one or more computer-readable storage media, which may be non-transitory. Memory 502 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 502 is used to store at least one program code for execution by processor 501 to implement the video encoding method described above.
In some embodiments, the terminal 500 may further optionally include: a peripheral interface 503 and at least one peripheral. The processor 501, memory 502, and peripheral interface 503 may be connected by buses or signal lines. The individual peripheral devices may be connected to the peripheral device interface 503 by buses, signal lines or circuit boards. Specifically, the peripheral device includes: at least one of radio frequency circuitry 504, a display 505, a camera assembly 506, audio circuitry 507, a positioning assembly 508, and a power supply 509.
Peripheral interface 503 may be used to connect at least one Input/Output (I/O) related peripheral to processor 501 and memory 502. In some embodiments, processor 501, memory 502, and peripheral interface 503 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 501, memory 502, and peripheral interface 503 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 504 is configured to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuitry 504 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 504 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 504 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 504 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 504 may also include NFC (Near Field Communication ) related circuitry, which is not limited in this application.
The display 505 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 505 is a touch display, the display 505 also has the ability to collect touch signals at or above the surface of the display 505. The touch signal may be input as a control signal to the processor 501 for processing. At this time, the display 505 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 505 may be one, and disposed on the front panel of the terminal 500; in other embodiments, the display 505 may be at least two, respectively disposed on different surfaces of the terminal 500 or in a folded design; in other embodiments, the display 505 may be a flexible display disposed on a curved surface or a folded surface of the terminal 500. Even more, the display 505 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The display 505 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 506 is used to capture images or video. Optionally, the camera assembly 506 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 506 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuitry 507 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 501 for processing, or inputting the electric signals to the radio frequency circuit 504 for voice communication. For the purpose of stereo acquisition or noise reduction, a plurality of microphones may be respectively disposed at different portions of the terminal 500. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 501 or the radio frequency circuit 504 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, audio circuitry 507 may also include a headphone jack.
The location component 508 is used to locate the current geographic location of the terminal 500 to enable navigation or LBS (Location Based Service, location-based services).
A power supply 509 is used to power the various components in the terminal 500. The power supply 509 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 509 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 500 further includes one or more sensors 510. The one or more sensors 510 include, but are not limited to: an acceleration sensor 511, a gyro sensor 512, a pressure sensor 513, a fingerprint sensor 514, an optical sensor 515, and a proximity sensor 516.
The acceleration sensor 511 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 500. For example, the acceleration sensor 511 may be used to detect components of gravitational acceleration on three coordinate axes. The processor 501 may control the display 505 to display a user interface in a landscape view or a portrait view according to a gravitational acceleration signal acquired by the acceleration sensor 511. The acceleration sensor 511 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 512 may detect a body direction and a rotation angle of the terminal 500, and the gyro sensor 512 may collect a 3D motion of the user to the terminal 500 in cooperation with the acceleration sensor 511. The processor 501 may implement the following functions based on the data collected by the gyro sensor 512: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 513 may be disposed at a side frame of the terminal 500 and/or at a lower layer of the display 505. When the pressure sensor 513 is disposed at a side frame of the terminal 500, a grip signal of the user to the terminal 500 may be detected, and the processor 501 performs left-right hand recognition or quick operation according to the grip signal collected by the pressure sensor 513. When the pressure sensor 513 is disposed at the lower layer of the display screen 505, the processor 501 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 505. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 514 is used for collecting the fingerprint of the user, and the processor 501 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 514, or the fingerprint sensor 514 identifies the identity of the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the user is authorized by the processor 501 to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 514 may be provided at the front, rear or side of the terminal 500. When a physical key or a vendor Logo is provided on the terminal 500, the fingerprint sensor 514 may be integrated with the physical key or the vendor Logo.
The optical sensor 515 is used to collect the ambient light intensity. In one embodiment, the processor 501 may control the display brightness of the display screen 505 based on the intensity of ambient light collected by the optical sensor 515. Specifically, when the intensity of the ambient light is high, the display brightness of the display screen 505 is turned up; when the ambient light intensity is low, the display brightness of the display screen 505 is turned down. In another embodiment, the processor 501 may also dynamically adjust the shooting parameters of the camera assembly 506 based on the ambient light intensity collected by the optical sensor 515.
A proximity sensor 516, also referred to as a distance sensor, is typically provided on the front panel of the terminal 500. The proximity sensor 516 serves to collect a distance between the user and the front surface of the terminal 500. In one embodiment, when the proximity sensor 516 detects that the distance between the user and the front of the terminal 500 gradually decreases, the processor 501 controls the display 505 to switch from the bright screen state to the off screen state; when the proximity sensor 516 detects that the distance between the user and the front surface of the terminal 500 gradually increases, the processor 501 controls the display 505 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 5 is not limiting and that more or fewer components than shown may be included or certain components may be combined or a different arrangement of components may be employed.
Taking an electronic device as an example of a server, fig. 6 is a block diagram of a server according to an embodiment of the disclosure. Illustratively, the server 600 may include one or more processors (Ce ntral Processing Units, CPU) 601 and one or more memories 602, where the one or more memories 602 store at least one program code that is loaded and executed by the one or more processors 601 to implement the video encoding method provided in the above-described method embodiments. Of course, the server 600 may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
In an exemplary embodiment, a computer readable storage medium is also provided, e.g. a memory 602, comprising program code executable by the processor 601 of the server 600 to perform the video encoding method described above. Alternatively, the computer readable storage medium may be a Read-only Memory (ROM), a random access Memory (Random Access Memory, RAM), a Compact-disk Read-only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, comprising a computer program which, when executed by a processor, implements the video encoding method described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (11)

1. A method of video encoding, the method comprising:
determining a target threshold of transform coefficients participating in quantization processing in a transform block based on attribute information of the transform block of a video frame to be encoded, the transform block including a plurality of transform coefficients, the attribute information indicating at least one of a type, a size, and a texture complexity of the transform block;
Determining a target quantization position of the transform block based on the target threshold and the plurality of transform coefficients, the target quantization position indicating a starting position for quantization processing of the transform block;
and carrying out quantization processing on the transformation block based on the target quantization position, and acquiring video coding data of the transformation block based on the quantized transformation block.
2. The video encoding method according to claim 1, wherein the determining the target threshold of the transform block based on the attribute information of the transform block of the video frame to be encoded comprises any one of:
when the attribute information indicates that the type of the transformation block is a brightness transformation block, adjusting a first threshold value of transformation coefficients participating in quantization processing in the transformation block based on a first adjustment coefficient to obtain the target threshold value;
and under the condition that the attribute information indicates that the type of the transformation block is a chroma transformation block, adjusting the first threshold value based on a second adjustment coefficient to obtain the target threshold value, wherein the first adjustment coefficient is smaller than the second adjustment coefficient.
3. The video encoding method according to claim 1, wherein the determining the target threshold of the transform block based on the attribute information of the transform block of the video frame to be encoded comprises:
Determining a size level of the transform block based on the size of the transform block indicated by the attribute information;
and adjusting a second threshold value of the transformation coefficient which participates in quantization processing in the transformation block based on the adjustment coefficient corresponding to the size level to obtain the target threshold value.
4. The video encoding method according to claim 3, wherein the adjusting the second threshold based on the adjustment coefficient corresponding to the size level to obtain the target threshold includes any one of:
under the condition that the size level is the first size level, adjusting the second threshold value based on a third adjustment coefficient to obtain the target threshold value;
and under the condition that the size level is the second size level, adjusting the second threshold value based on a fourth adjustment coefficient to obtain the target threshold value, wherein the first size level is smaller than the second size level, and the third adjustment coefficient is larger than the fourth adjustment coefficient.
5. The video encoding method according to claim 1, wherein the determining the target threshold of the transform block based on the attribute information of the transform block of the video frame to be encoded comprises:
Determining a texture complexity level of the transform block based on the texture complexity of the transform block indicated by the attribute information;
and adjusting a third threshold value of the transformation coefficient participating in quantization processing in the transformation block based on the adjustment coefficient corresponding to the texture complexity level to obtain the target threshold value.
6. The video coding method according to claim 5, wherein the adjusting the third threshold based on the adjustment coefficient corresponding to the texture complexity level to obtain the target threshold includes any one of:
under the condition that the texture complexity level is the first texture complexity level, adjusting the third threshold value based on a fifth adjustment coefficient to obtain the target threshold value;
and under the condition that the texture complexity level is the second texture complexity level, adjusting the third threshold value based on a sixth adjustment coefficient to obtain the target threshold value, wherein the first texture complexity level is smaller than the second texture complexity level, and the fifth adjustment coefficient is larger than the sixth adjustment coefficient.
7. The video encoding method according to claim 1, wherein the determining the target threshold of the transform block based on the attribute information of the transform block of the video frame to be encoded comprises:
Determining a transform block level of the transform block based on at least two of a type, a size, and a texture complexity of the transform block indicated by the attribute information;
and adjusting the fourth threshold based on the adjustment coefficient corresponding to the transformation block level to obtain the target threshold.
8. The video encoding method of claim 1, wherein the determining a target quantization position for the transform block based on the target threshold and the plurality of transform coefficients comprises:
and scanning the plurality of transformation coefficients based on a coefficient scanning sequence, and determining a target quantization position of the transformation block based on the position of the target transformation coefficient in the transformation block when the target transformation coefficient is larger than the target threshold value, wherein the target transformation coefficient is any transformation coefficient in the transformation block.
9. A video encoding device, the device comprising:
a threshold determining unit configured to perform determination of a target threshold of transform coefficients participating in quantization processing in a transform block based on attribute information of the transform block of a video frame to be encoded, the transform block including a plurality of transform coefficients, the attribute information indicating at least one of a type, a size, and a texture complexity of the transform block;
A position determining unit configured to perform determination of a target quantization position of the transform block, which indicates a start position of quantization processing of the transform block, based on the target threshold and the plurality of transform coefficients;
and an acquisition unit configured to perform quantization processing on the transform block based on the target quantization position, and acquire video encoding data of the transform block based on the quantized transform block.
10. An electronic device, the electronic device comprising:
one or more processors;
a memory for storing the processor-executable program code;
wherein the processor is configured to execute the program code to implement the video coding method of any one of claims 1 to 8.
11. A computer readable storage medium, characterized in that program code in the computer readable storage medium, when executed by a processor of an electronic device, enables the electronic device to perform the video encoding method of any one of claims 1 to 8.
CN202310042005.XA 2023-01-12 2023-01-12 Video encoding method, video encoding device, electronic equipment and storage medium Pending CN116074512A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310042005.XA CN116074512A (en) 2023-01-12 2023-01-12 Video encoding method, video encoding device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310042005.XA CN116074512A (en) 2023-01-12 2023-01-12 Video encoding method, video encoding device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116074512A true CN116074512A (en) 2023-05-05

Family

ID=86181579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310042005.XA Pending CN116074512A (en) 2023-01-12 2023-01-12 Video encoding method, video encoding device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116074512A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116847126A (en) * 2023-07-20 2023-10-03 北京富通亚讯网络信息技术有限公司 Video decoding data transmission method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116847126A (en) * 2023-07-20 2023-10-03 北京富通亚讯网络信息技术有限公司 Video decoding data transmission method and system

Similar Documents

Publication Publication Date Title
CN111698504B (en) Encoding method, decoding method and device
CN112449192B (en) Decoding method, encoding method and device
CN108391127B (en) Video encoding method, device, storage medium and equipment
WO2019140952A1 (en) Video encoding method, device, apparatus and storage medium
CN111770340B (en) Video encoding method, device, equipment and storage medium
CN111586413B (en) Video adjusting method and device, computer equipment and storage medium
CN110049326B (en) Video coding method and device and storage medium
CN116074512A (en) Video encoding method, video encoding device, electronic equipment and storage medium
CN111107357A (en) Image processing method, device and system
CN110177275B (en) Video encoding method and apparatus, and storage medium
CN110572679B (en) Method, device and equipment for coding intra-frame prediction and readable storage medium
CN110543403B (en) Power consumption assessment method and device
CN113891074B (en) Video encoding method and apparatus, electronic apparatus, and computer-readable storage medium
CN111770339B (en) Video encoding method, device, equipment and storage medium
CN109040753B (en) Prediction mode selection method, device and storage medium
CN116563771A (en) Image recognition method, device, electronic equipment and readable storage medium
CN110460856B (en) Video encoding method, video encoding device, video encoding apparatus, and computer-readable storage medium
CN114422782B (en) Video encoding method, video encoding device, storage medium and electronic equipment
CN111641831B (en) Intra-frame prediction method, device, equipment and storage medium
CN116546203A (en) Video frame processing method and device, electronic equipment and readable storage medium
CN115118979A (en) Image encoding method, image decoding method, device, equipment and storage medium
CN117676170A (en) Method, apparatus, device and storage medium for detecting blocking effect
CN116506616A (en) Video frame coding method, device, electronic equipment and storage medium
CN117834881A (en) Video frame filtering method, video frame encoding method and device
CN116506645A (en) Video compression method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination