CN114666600B - Data encoding method and device based on irregular template, electronic equipment and medium - Google Patents

Data encoding method and device based on irregular template, electronic equipment and medium Download PDF

Info

Publication number
CN114666600B
CN114666600B CN202210133940.2A CN202210133940A CN114666600B CN 114666600 B CN114666600 B CN 114666600B CN 202210133940 A CN202210133940 A CN 202210133940A CN 114666600 B CN114666600 B CN 114666600B
Authority
CN
China
Prior art keywords
coding
template
coded
region
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210133940.2A
Other languages
Chinese (zh)
Other versions
CN114666600A (en
Inventor
高文
任荟文
王苫社
马思伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University
Original Assignee
Peking University
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 Peking University filed Critical Peking University
Priority to CN202210133940.2A priority Critical patent/CN114666600B/en
Publication of CN114666600A publication Critical patent/CN114666600A/en
Application granted granted Critical
Publication of CN114666600B publication Critical patent/CN114666600B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • 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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • 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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • 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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/184Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being bits, e.g. of the compressed video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The application discloses a data encoding method and device based on an irregular template, electronic equipment and a medium. By applying the technical scheme of the application, after the region to be coded is obtained, the matching of pixels inside the template and the matching between the templates are respectively carried out on the region to be coded by utilizing the pre-designed templates with various irregular shapes, so that a more compact coded data expression form is provided, and the problem of low quality of a decoded and reconstructed image caused by the loss of coefficients due to inaccurate prediction is solved.

Description

Data encoding method and device based on irregular template, electronic equipment and medium
Technical Field
The present application relates to data processing technologies, and in particular, to a data encoding method and apparatus based on an irregular template, an electronic device, and a medium.
Background
With the continuous popularization of image and video applications, the video light compression technology is also continuously iterated and innovated. Common video light compression standards such as DSC, VDC-M, apple ProRes and JPEG-XS are widely applied to the fields of display interfaces such as HDMI and DP and the field of image video production.
The general video light compression standard mainly aims to realize 4-16 times of data compression under the conditions of low delay, low complexity and subjective lossless. Taking a general DSC1 coding standard as an example, the compression process mainly comprises the steps of input and output, cache fragmentation, prediction, quantization, reconstruction, entropy coding, code rate control, code stream synthesis and the like.
However, the related art encoding method usually has a problem of large parameter loss in the pixel prediction process. This also results in affecting the user experience.
Disclosure of Invention
The embodiment of the application provides a data encoding method and device based on an irregular template, electronic equipment and a medium. The method is used for solving the problem that the coding method in the related technology usually has large parameter loss in the pixel prediction process so as to influence the browsing experience of a user.
According to an aspect of the embodiments of the present application, there is provided an irregular template-based data encoding method, including:
respectively determining coding parameters corresponding to each region to be coded, wherein the coding parameters comprise pixel positions in the region to be coded, at least one coding template and a reference pixel queue, and the coding template is a template corresponding to an irregular shape;
respectively utilizing each coding template to carry out predictive coding on pixels in the region to be coded based on a predetermined intra-template matching rule, an inter-coding matching rule and a reference pixel queue to obtain a coding result corresponding to each coding template;
and selecting the prediction mode with the minimum code rate and distortion cost in the coding result as the optimal prediction mode, and performing predictive coding on each region to be coded by using the optimal prediction mode.
Optionally, in another embodiment based on the foregoing method of the present application, after the determining the coding parameter corresponding to the region to be coded, the method further includes:
determining an internal coding order of each coding template; determining the coding sequence among the coding templates;
based on the coding sequence among the coding templates, carrying out predictive coding on each region to be coded in sequence; and the number of the first and second groups,
and performing predictive coding on each pixel in the area to be coded in sequence based on the internal coding sequence of each coding template.
Optionally, in another embodiment based on the foregoing method of the present application, the sequentially performing predictive coding on each pixel in the region to be coded based on the intra-coding order of each coding template includes:
detecting whether the current coding template is a first coding template;
if so, performing predictive coding on other pixels except the first pixel in the area to be coded by taking a pixel default value as a predicted value according to the internal coding sequence, wherein the pixel default value is half of the maximum pixel value in the corresponding coding template;
if not, carrying out predictive coding on the pixels in the region to be coded according to the internal coding sequence.
Optionally, in another embodiment based on the foregoing method of the present application, the sequentially performing predictive coding on each pixel in the region to be coded based on the intra-coding order of each coding template includes:
performing predictive coding on each pixel in the area to be coded by using a reconstructed value of at least one reference pixel, wherein the reference pixel is a coded pixel adjacent to the current pixel to be coded
Optionally, in another embodiment based on the foregoing method of the present application, after obtaining the encoding result corresponding to each encoding template, the method further includes:
after each coding template is translated, rotated and scaled and is overlapped with the current coding region, calculating a residual error value between a coding result corresponding to the coding template and a corresponding original region to be coded and between each corresponding pixel;
and selecting a target coding template with a coding result reaching a preset residual condition as an optimal coding template of the region to be coded according to the residual value.
Optionally, in another embodiment based on the foregoing method of the present application, the selecting, according to the residual value, a target coding template whose coding result meets a preset residual condition as an optimal coding template of the region to be coded includes:
traversing and calculating a total residual value and a mean residual value between a coding result corresponding to each coding template and a corresponding original region to be coded, and sequencing the code rate and the distortion cost of each coding template according to the size relationship between the total residual value and the mean residual value;
and selecting the prediction mode with the minimum code rate and distortion cost as the optimal prediction mode.
According to another aspect of the embodiments of the present application, there is provided an irregular template-based data encoding apparatus, including:
the encoding module is configured to determine encoding parameters corresponding to each region to be encoded respectively, wherein the encoding parameters comprise pixel positions in the region to be encoded, at least one encoding template and a reference pixel queue, and the encoding template is a template corresponding to an irregular shape;
the encoding module is configured to perform predictive encoding on pixels in the region to be encoded by using each encoding template respectively based on a predetermined intra-template matching rule, an inter-encoding matching rule and a reference pixel queue to obtain an encoding result corresponding to each encoding template;
and the selection module is configured to select the prediction mode with the minimum code rate and distortion cost in the coding result as the optimal prediction mode, and perform predictive coding on each region to be coded by using the optimal prediction mode.
According to another aspect of the embodiments of the present application, there is provided an electronic device including:
a memory for storing executable instructions; and
a display for communicating with the memory to execute the executable instructions to perform any of the above-described irregular template-based data encoding methods.
According to a further aspect of the embodiments of the present application, there is provided a computer-readable storage medium for storing computer-readable instructions, which when executed, perform the operations of any one of the irregular template-based data encoding methods described above.
In the application, encoding parameters corresponding to each region to be encoded can be respectively determined, the encoding parameters include pixel positions in the region to be encoded, at least one encoding template and a reference pixel queue, and the encoding template is a template corresponding to an irregular shape; respectively utilizing each coding template to carry out predictive coding on pixels in a region to be coded based on a predetermined intra-template matching rule, an inter-coding matching rule and a reference pixel queue to obtain a coding result corresponding to each coding template; and selecting the prediction mode with the minimum code rate and distortion cost in the coding result as the optimal prediction mode, and performing prediction coding on each region to be coded by using the optimal prediction mode. By applying the technical scheme of the application, after the region to be coded is obtained, the matching of pixels inside the template and the matching between the templates are respectively carried out on the region to be coded by utilizing the pre-designed templates with various irregular shapes, so that a more compact coded data expression form is provided, and the problem of low quality of a decoded and reconstructed image caused by the loss of coefficients due to inaccurate prediction is solved.
The technical solution of the present application is further described in detail by the accompanying drawings and examples.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description, serve to explain the principles of the application.
The present application may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
fig. 1 is a schematic diagram of a data encoding method based on an irregular template proposed in the present application;
fig. 2 is a schematic diagram of an encoding method proposed in the present application;
fig. 3-4 are schematic diagrams of a data encoding flow architecture based on an irregular template according to the present application;
fig. 5 is a schematic structural diagram of an electronic device for encoding data based on an irregular template according to the present application;
fig. 6 is a schematic structural diagram of an irregular template-based data encoding electronic device according to the present application.
Detailed Description
Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the application, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be discussed further in subsequent figures.
In addition, technical solutions between the various embodiments of the present application may be combined with each other, but it must be based on the realization of the technical solutions by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination of technical solutions should be considered to be absent and not within the protection scope of the present application.
It should be noted that all directional indicators (such as up, down, left, right, front, back, 8230) \8230;) in the embodiments of the present application are only used to explain the relative positional relationship between the components in a specific posture (as shown in the attached drawings), the motion situation, etc., and if the specific posture is changed, the directional indicators are correspondingly changed.
A method for performing irregular template-based data encoding according to an exemplary embodiment of the present application is described below in conjunction with fig. 1-4. It should be noted that the following application scenarios are merely illustrated for the convenience of understanding the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. Rather, embodiments of the present application may be applied to any scenario where applicable.
The application also provides a data coding method and device based on the irregular template, electronic equipment and a medium.
Fig. 1 schematically shows a flow chart of an irregular template-based data encoding method according to an embodiment of the present application. As shown in fig. 1, the method is applied to a system including:
s101, respectively determining coding parameters corresponding to each region to be coded, wherein the coding parameters comprise pixel positions in the region to be coded, at least one coding template and a reference pixel queue, and the coding template is a template corresponding to an irregular shape.
And S102, based on a predetermined intra-template matching rule, an inter-coding matching rule and a reference pixel queue, respectively performing predictive coding on pixels in the region to be coded by using each coding template to obtain a coding result corresponding to each coding template.
S103, selecting the prediction mode with the minimum code rate and distortion cost in the coding result as the optimal prediction mode, and performing prediction coding on each region to be coded by using the optimal prediction mode.
Further, with the increasing popularity of image and video applications, the video soft compression technique is also continuously iterated and innovated. Common video soft compression standards are in the field of display interfaces such as DSC and the like and in the field of image video and other production.
The general video light compression standard mainly aims to realize 4-16 times of data compression under the conditions of low delay, low complexity and subjective lossless. By more general DSC 1 The coding standard is taken as an example, and the compression process mainly comprises the steps of input and output, cache fragmentation, prediction, quantization, reconstruction, entropy coding, code rate control, code stream synthesis and the like.
However, the related art encoding method usually has a problem of large parameter loss in the pixel prediction process. This also results in affecting the user experience.
In order to solve the above problem, the present application provides a data encoding method based on an irregular template, which includes the following steps:
step 1: in one approach, the present application can be applied to any coding framework. Among them, the template type that can be used for prediction and encoding is initialized, i.e., a set of continuous pixels of an indefinite form is set for use in template encoding. And grouping and arranging the pixel values operated in the area to be coded according to the template shape of at least one template coding template. For boundary pixels that cannot meet the shape of the template, the adaptation is completed by clipping the template.
It should be noted that the encoding template in the present application is a template corresponding to an irregular shape, such as an L-shaped template, a Z-shaped template, a step-shaped template, a diamond-shaped template, and so on.
And 2, step: recording all pixel positions in the current region to be coded (generally, the minimum square region formed by combining a plurality of coding templates), the mutual positions among the coding templates and the number N of pixels for reference.
And step 3: the coding order inside the coding templates is decided (i.e. the internal coding order of each coding template is determined such that each pixel in the area to be coded is subsequently predictively coded).
In one approach, the code may be accessed in a zigzag loop from the top left corner to the bottom right corner, as shown in FIG. 2.
And 4, step 4: determining the coding order among the coding templates (i.e. determining the coding order among the coding templates so as to perform predictive coding on each region to be coded in sequence), in one method, the coding may be performed from left to right, and from top to bottom one by one.
And 5: and entering an intra-template matching mode, wherein the first pixel of the coding sequence in the coding templates can be determined firstly, and if the template is the first coded template in the coding sequence among the coding templates, the first pixel of the current template is not subjected to predictive coding. If not, the first pixel can be subjected to predictive coding.
Step 6: and sequentially coding the subsequent pixels according to the internal coding sequence of the coding template. In one mode, during encoding, reconstruction values of M encoded pixels closest to the current pixel and reconstruction values of N encoded pixels in the reference pixel queue may be selected for prediction, and if a certain reconstructed pixel is selected as a reference pixel, only the index and the prediction residual of the pixel are encoded. If no reference pixel is selected, the pixel original value and the self-reference index value are encoded.
And 7: the reconstructed value in the reference pixel queue is updated according to a proximity rule or an accumulated hit rate.
And 8: entering a matching mode between the templates, wherein the matching mode comprises the following steps: firstly, the encoding template used for matching is determined, wherein the encoding template can completely cover the template group to be encoded after the determined non-scaling operations such as rotation, mirror image and the like.
And step 9: and performing difference operation on the pixels in each coding template and the corresponding pixels in the original to-be-coded region one by one, and recording a residual error.
Step 10: and traversing and calculating all referenceable template groups in the effective range, sequencing according to the total residual value and the mean value, and selecting the optimal coding template as a target coding template.
Step 11: in one approach, for coding designs that use only the same template, a dynamically updated temporary reference template is allowed to be established. Specifically, each pixel position in the encoding template is used for recording the pixel value which is hit the most frequently at the position in the encoding process within a certain time range. In traversing the template, the encoding template will also be traversed as a reference position.
In the application, encoding parameters corresponding to each region to be encoded can be respectively determined, the encoding parameters include pixel positions in the region to be encoded, at least one encoding template and a reference pixel queue, and the encoding template is a template corresponding to an irregular shape; respectively utilizing each coding template to carry out predictive coding on pixels in a region to be coded based on a predetermined intra-template matching rule, an inter-coding matching rule and a reference pixel queue to obtain a coding result corresponding to each coding template; and selecting the prediction mode with the minimum code rate and distortion cost in the coding result as the optimal prediction mode, and performing predictive coding on each region to be coded by using the optimal prediction mode. By applying the technical scheme of the application, after the region to be coded is obtained, the pre-designed templates with various irregular shapes are used for respectively carrying out matching on pixels in the templates and matching between the templates in the region to be coded, so that a more compact coded data expression form is provided, and the problem of low quality of a decoded and reconstructed image caused by coefficient loss due to inaccurate prediction is solved.
Optionally, in another embodiment based on the foregoing method of the present application, after the determining the coding parameter corresponding to the region to be coded, the method further includes:
determining an internal coding order of each coding template; determining the coding sequence among the coding templates;
based on the coding sequence among the coding templates, performing predictive coding on each region to be coded in sequence; and (c) a second step of,
and performing predictive coding on each pixel in the area to be coded in sequence based on the internal coding sequence of each coding template.
Optionally, in another embodiment based on the foregoing method of the present application, the sequentially performing predictive coding on each pixel in the region to be coded based on the intra-coding order of each coding template includes:
detecting whether the current coding template is a first coding template;
if so, performing predictive coding on other pixels except the first pixel in the area to be coded by taking a pixel default value as a predicted value according to the internal coding sequence, wherein the pixel default value is half of the maximum pixel value in the corresponding coding template;
if not, performing predictive coding on the pixels in the region to be coded according to the internal coding sequence.
Optionally, in another embodiment of the method according to the present application, the sequentially performing prediction coding on each pixel in the region to be coded based on the intra-coding order of each coding template includes:
performing predictive coding on each pixel in the area to be coded by using a reconstructed value of at least one reference pixel, wherein the reference pixel is a coded pixel adjacent to the current pixel to be coded
Optionally, in another embodiment based on the foregoing method of the present application, after obtaining the encoding result corresponding to each encoding template, the method further includes:
after each coding template is translated, rotated and scaled and is overlapped with the current coding region, calculating a residual error value between a coding result corresponding to the coding template and a corresponding original region to be coded and between each corresponding pixel;
and selecting a target coding template with a coding result reaching a preset residual condition as an optimal coding template of the region to be coded according to the residual value.
Optionally, in another embodiment based on the foregoing method of the present application, the selecting, according to the residual value, a target coding template whose coding result meets a preset residual condition as an optimal coding template of the region to be coded includes:
traversing and calculating a total residual value and a mean residual value between a coding result corresponding to each coding template and a corresponding original region to be coded, and sequencing the code rate and the distortion cost of each coding template according to the size relationship between the total residual value and the mean residual value;
and selecting the prediction mode with the minimum code rate and distortion cost as the optimal prediction mode.
Furthermore, the application provides a template-based adaptive matching algorithm, which can respectively predict pixels between templates and in the templates by designing various different template types. The algorithm realizes better compression performance without losing subjective quality in the lossless video coding or light compression coding engineering through modes of template internal pixel matching, template integral translation matching and the like.
In one mode, the encoding template in the present application may be an L-shaped encoding template with an irregular shape as shown in fig. 3. As shown in fig. 4, the area to be encoded is a dark gray area, and the areas where abc is located, 123 is located, and 456 is three templates respectively. Wherein a, b and c are the coded and referable history pixels. In the area of 123 and 456, the upper number is the current pixel number and the lower number is the pixel number for reference. The areas of different colors may be directly referenced via rotation or translation (i.e., the area of each encoded template may be directly referenced to the areas of the other two encoded templates).
The method and the device can perform mode expansion on image prediction in video coding to improve coding performance. The method specifically comprises template generation, template combination, template rotation, scaling, clipping, splicing and other methods for generating the template. In addition, the present application may also predict, reference, and otherwise generate reconstructed pixel values within and between each of the encoding template regions.
By applying the technical scheme of the application, after the region to be coded is obtained, the pre-designed templates with various irregular shapes are used for respectively carrying out matching on pixels in the templates and matching between the templates in the region to be coded, so that a more compact coded data expression form is provided, and the problem of low quality of a decoded and reconstructed image caused by coefficient loss due to inaccurate prediction is solved.
Optionally, in another embodiment of the present application, as shown in fig. 5, the present application further provides an irregular template-based data encoding apparatus. Which comprises the following steps:
a determining module 201 configured to determine encoding parameters corresponding to each region to be encoded, where the encoding parameters include a pixel position in the region to be encoded, at least one encoding template and a reference pixel queue, and the encoding template is a template corresponding to an irregular shape;
the encoding module 202 is configured to perform predictive encoding on pixels in the region to be encoded by using each encoding template respectively based on a predetermined intra-template matching rule, an inter-encoding matching rule and a reference pixel queue to obtain an encoding result corresponding to each encoding template;
and the selecting module 203 is configured to select the prediction mode with the minimum code rate and distortion cost in the coding result as an optimal prediction mode, and perform predictive coding on each region to be coded by using the optimal prediction mode.
In the application, encoding parameters corresponding to each region to be encoded can be respectively determined, the encoding parameters include pixel positions in the region to be encoded, at least one encoding template and a reference pixel queue, and the encoding template is a template corresponding to an irregular shape; based on a predetermined intra-template matching rule, an inter-coding matching rule and a reference pixel queue, respectively performing predictive coding on pixels in a region to be coded by using each coding template to obtain a coding result corresponding to each coding template; and selecting the prediction mode with the minimum code rate and distortion cost in the coding result as the optimal prediction mode, and performing predictive coding on each region to be coded by using the optimal prediction mode. By applying the technical scheme of the application, after the region to be coded is obtained, the matching of pixels inside the template and the matching between the templates are respectively carried out on the region to be coded by utilizing the pre-designed templates with various irregular shapes, so that a more compact coded data expression form is provided, and the problem of low quality of a decoded and reconstructed image caused by the loss of coefficients due to inaccurate prediction is solved.
In another embodiment of the present application, the determining module 201 is configured to perform the steps including:
determining an internal coding order of each coding template; determining the coding sequence among the coding templates;
based on the coding sequence among the coding templates, performing predictive coding on each region to be coded in sequence; and the number of the first and second groups,
and performing predictive coding on each pixel in the area to be coded in sequence based on the internal coding sequence of each coding template.
In another embodiment of the present application, the determining module 201 is configured to perform the steps including:
detecting whether the current coding template is a first coding template;
if so, performing predictive coding on other pixels except the first pixel in the area to be coded by taking a pixel default value as a predicted value according to the internal coding sequence, wherein the pixel default value is half of the maximum pixel value in the corresponding coding template;
if not, carrying out predictive coding on the pixels in the region to be coded according to the internal coding sequence.
In another embodiment of the present application, the determining module 201 is configured to perform the steps including:
and performing predictive coding on each pixel in the area to be coded by using the reconstructed value of at least one reference pixel, wherein the reference pixel is a coded pixel adjacent to the current pixel to be coded.
In another embodiment of the present application, the determining module 201 is configured to perform the steps including:
after each coding template is translated, rotated and scaled and is overlapped with the current coding region, calculating a residual error value between a coding result corresponding to the coding template and a corresponding original region to be coded and between each corresponding pixel;
and selecting a target coding template with a coding result reaching a preset residual condition as an optimal coding template of the region to be coded according to the residual value.
In another embodiment of the present application, the determining module 201 is configured to perform the steps including:
traversing and calculating a total residual value and a mean residual value between a coding result corresponding to each coding template and a corresponding original region to be coded, and sequencing the code rate and the distortion cost of each coding template according to the size relationship between the total residual value and the mean residual value;
selecting the prediction mode with the minimum code rate and distortion cost as the optimal prediction mode
FIG. 6 is a block diagram illustrating a logical structure of an electronic device in accordance with an exemplary embodiment. For example, the electronic device 300 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium, such as a memory, including instructions executable by a processor of an electronic device to perform the irregular template-based data encoding method, the method including: respectively determining coding parameters corresponding to each region to be coded, wherein the coding parameters comprise pixel positions in the region to be coded, at least one coding template and a reference pixel queue, and the coding template is a template corresponding to an irregular shape; respectively utilizing each coding template to carry out predictive coding on pixels in the region to be coded based on a predetermined intra-template matching rule, an inter-coding matching rule and a reference pixel queue to obtain a coding result corresponding to each coding template; and selecting the prediction mode with the minimum code rate and distortion cost in the coding result as the optimal prediction mode, and performing predictive coding on each region to be coded by using the optimal prediction mode. Optionally, the instructions may also be executable by a processor of the electronic device to perform other steps involved in the exemplary embodiments described above. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided an application/computer program product including one or more instructions executable by a processor of an electronic device to perform the irregular template-based data encoding method described above, the method including: respectively determining coding parameters corresponding to each region to be coded, wherein the coding parameters comprise pixel positions in the region to be coded, at least one coding template and a reference pixel queue, and the coding template is a template corresponding to an irregular shape; respectively utilizing each coding template to carry out predictive coding on pixels in the region to be coded based on a predetermined intra-template matching rule, an inter-coding matching rule and a reference pixel queue to obtain a coding result corresponding to each coding template; and selecting the prediction mode with the minimum code rate and distortion cost in the coding result as the optimal prediction mode, and performing predictive coding on each region to be coded by using the optimal prediction mode. Optionally, the instructions may also be executable by a processor of the electronic device to perform other steps involved in the exemplary embodiments described above.
Fig. 6 is an exemplary diagram of an electronic device 300. Those skilled in the art will appreciate that the schematic diagram 6 is merely an example of the electronic device 300 and does not constitute a limitation of the electronic device 300 and may include more or less components than those shown, or combine certain components, or different components, e.g., the electronic device 300 may also include input-output devices, network access devices, buses, etc.
The Processor 302 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor 302 may be any conventional processor or the like, and the processor 302 is the control center of the electronic device 300 and connects the various parts of the entire electronic device 300 using various interfaces and lines.
Memory 301 may be used to store computer readable instructions 303 and processor 302 may implement various functions of electronic device 300 by executing or executing computer readable instructions or modules stored in memory 301 and by invoking data stored in memory 301. The memory 301 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device 300, and the like. In addition, the Memory 301 may include a hard disk, a Memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Memory Card (Flash Card), at least one disk storage device, a Flash Memory device, a Read-Only Memory (ROM), a Random Access Memory (RAM), or other non-volatile/volatile storage devices.
The modules integrated by the electronic device 300 may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by hardware related to computer readable instructions, which may be stored in a computer readable storage medium, and when the computer readable instructions are executed by a processor, the steps of the method embodiments may be implemented.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (6)

1. A data encoding method based on an irregular template is characterized by comprising the following steps:
respectively determining coding parameters corresponding to each region to be coded, wherein the coding parameters comprise pixel positions in the region to be coded, at least one coding template and a reference pixel queue, and the coding template is a template corresponding to an irregular shape;
respectively utilizing each coding template to carry out predictive coding on pixels in the region to be coded based on a predetermined intra-template matching rule, an inter-coding matching rule and a reference pixel queue to obtain a coding result corresponding to each coding template;
selecting a prediction mode with the minimum code rate and distortion cost in the coding result as an optimal prediction mode, and performing predictive coding on each region to be coded by using the optimal prediction mode;
after determining the coding parameters corresponding to the region to be coded, the method further includes:
determining an internal coding order of each coding template; determining the coding sequence among the coding templates;
based on the coding sequence among the coding templates, performing predictive coding on each region to be coded in sequence; and (c) a second step of,
based on the internal coding sequence of each coding template, sequentially carrying out predictive coding on each pixel in the region to be coded;
after obtaining the coding result corresponding to each coding template, the method further includes:
after each coding template is translated, rotated and scaled and is overlapped with the current coding region, calculating a residual error value between a coding result corresponding to the coding template and a corresponding original region to be coded and between each corresponding pixel;
selecting a target coding template with a coding result reaching a preset residual condition as an optimal coding template of the region to be coded according to the residual value;
selecting a target coding template with a coding result reaching a preset residual error condition as an optimal coding template of the region to be coded according to the residual error value, wherein the method comprises the following steps:
traversing and calculating a total residual value and a mean residual value between a coding result corresponding to each coding template and a corresponding original region to be coded, and sequencing the code rate and the distortion cost of each coding template according to the size relationship between the total residual value and the mean residual value;
and selecting the prediction mode with the minimum code rate and distortion cost as the optimal prediction mode.
2. The method as claimed in claim 1, wherein said sequentially predictive coding each pixel in the region to be coded based on the intra coding order of each coding template comprises:
detecting whether the current coding template is a first coding template;
if so, performing predictive coding on other pixels except the first pixel in the area to be coded by taking a pixel default value as a predicted value according to the internal coding sequence, wherein the pixel default value is half of the maximum pixel value in the corresponding coding template;
if not, performing predictive coding on the pixels in the region to be coded according to the internal coding sequence.
3. The method as claimed in claim 1, wherein said sequentially predictive coding each pixel in the region to be coded based on the intra coding order of each coding template comprises:
and performing predictive coding on each pixel in the area to be coded by using the reconstructed value of at least one reference pixel, wherein the reference pixel is a coded pixel adjacent to the current pixel to be coded.
4. An irregular template-based data encoding apparatus, comprising:
the encoding module is configured to determine encoding parameters corresponding to each region to be encoded respectively, wherein the encoding parameters comprise pixel positions in the region to be encoded, at least one encoding template and a reference pixel queue, and the encoding template is a template corresponding to an irregular shape;
the encoding module is configured to perform predictive encoding on pixels in the region to be encoded by using each encoding template respectively based on a predetermined intra-template matching rule, an inter-encoding matching rule and a reference pixel queue to obtain an encoding result corresponding to each encoding template;
the selection module is configured to select a prediction mode with the minimum code rate and distortion cost in the coding result as an optimal prediction mode, and perform predictive coding on each region to be coded by using the optimal prediction mode;
after the determining of the coding parameters corresponding to the region to be coded, the method further includes:
determining an internal coding order of each coding template; determining the coding sequence among the coding templates;
based on the coding sequence among the coding templates, carrying out predictive coding on each region to be coded in sequence; and (c) a second step of,
based on the internal coding sequence of each coding template, sequentially carrying out predictive coding on each pixel in the region to be coded;
after obtaining the coding result corresponding to each coding template, the method further includes:
after each coding template is translated, rotated and scaled and is overlapped with the current coding region, calculating a residual error value between a coding result corresponding to the coding template and a corresponding original region to be coded and between each corresponding pixel;
selecting a target coding template with a coding result reaching a preset residual condition as an optimal coding template of the region to be coded according to the residual value;
selecting a target coding template with a coding result reaching a preset residual error condition as an optimal coding template of the region to be coded according to the residual error value, wherein the method comprises the following steps:
traversing and calculating a total residual value and a mean residual value between a coding result corresponding to each coding template and a corresponding original region to be coded, and sequencing the code rate and the distortion cost of each coding template according to the size relationship between the total residual value and the mean residual value;
and selecting the prediction mode with the minimum code rate and distortion cost as the optimal prediction mode.
5. An electronic device, comprising:
a memory for storing executable instructions; and (c) a second step of,
a processor for executing the executable instructions with the memory to perform the operations of the irregular template-based data encoding method of any one of claims 1-3.
6. A computer-readable storage medium storing computer-readable instructions, wherein the instructions, when executed, perform the operations of the irregular template-based data encoding method of any of claims 1-3.
CN202210133940.2A 2022-02-14 2022-02-14 Data encoding method and device based on irregular template, electronic equipment and medium Active CN114666600B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210133940.2A CN114666600B (en) 2022-02-14 2022-02-14 Data encoding method and device based on irregular template, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210133940.2A CN114666600B (en) 2022-02-14 2022-02-14 Data encoding method and device based on irregular template, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN114666600A CN114666600A (en) 2022-06-24
CN114666600B true CN114666600B (en) 2023-04-07

Family

ID=82027121

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210133940.2A Active CN114666600B (en) 2022-02-14 2022-02-14 Data encoding method and device based on irregular template, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114666600B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557514B (en) * 2008-04-11 2011-02-09 华为技术有限公司 Method, device and system for inter-frame predicting encoding and decoding
CN102801995B (en) * 2012-06-25 2016-12-21 北京大学深圳研究生院 A kind of multi-view video motion based on template matching and disparity vector prediction method
US9948930B2 (en) * 2016-05-17 2018-04-17 Arris Enterprises Llc Template matching for JVET intra prediction
EP3644608A4 (en) * 2017-07-11 2020-06-10 Huawei Technologies Co. Ltd. Decoding method and apparatus based on template matching
CN110267041B (en) * 2019-06-28 2021-11-09 Oppo广东移动通信有限公司 Image encoding method, image encoding device, electronic device, and computer-readable storage medium

Also Published As

Publication number Publication date
CN114666600A (en) 2022-06-24

Similar Documents

Publication Publication Date Title
KR100809354B1 (en) Apparatus and method for up-converting frame-rate of decoded frames
CN111131837B (en) Motion compensation correction method, encoding method, encoder, and storage medium
EP3675496A1 (en) Method and device for determining motion vector of affine coding block
CN110913218A (en) Video frame prediction method and device and terminal equipment
CN110213576B (en) Video encoding method, video encoding device, electronic device, and storage medium
CN110913219A (en) Video frame prediction method and device and terminal equipment
CN114666600B (en) Data encoding method and device based on irregular template, electronic equipment and medium
KR100377131B1 (en) Video data encoder and method of encoding video data
WO2023142715A1 (en) Video coding method and apparatus, real-time communication method and apparatus, device, and storage medium
CN115834889A (en) Video encoding and decoding method and device, electronic equipment and medium
KR101362545B1 (en) Variable shape motion estimation in video sequence
CN115442617A (en) Video processing method and device based on video coding
CN114422779A (en) Method, apparatus, electronic device and medium for predicting cell size decision
CN114125443A (en) Video code rate control method and device and electronic equipment
CN109561315B (en) Motion estimation method and device, electronic equipment and storage medium
CN112183227A (en) Intelligent pan-face region coding method and equipment
CN105872538A (en) Time-domain filtering method and time-domain filtering device
JP2021013145A (en) Video transmission device and video transmission method
KR20220066166A (en) Current block prediction method and prediction apparatus, device, and storage medium
CN110830806A (en) Video frame prediction method and device and terminal equipment
WO2023198144A1 (en) Inter-frame prediction method and terminal
WO2024140568A1 (en) Image processing method and apparatus, electronic device, and readable storage medium
WO2023116510A1 (en) Inter-frame prediction method and terminal
CN116156174B (en) Data encoding processing method, device, computer equipment and storage medium
JP2000299866A (en) Method for encoding image

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
GR01 Patent grant
GR01 Patent grant