CN108810543B - Video coding compensation method and device and electronic equipment - Google Patents

Video coding compensation method and device and electronic equipment Download PDF

Info

Publication number
CN108810543B
CN108810543B CN201810605725.1A CN201810605725A CN108810543B CN 108810543 B CN108810543 B CN 108810543B CN 201810605725 A CN201810605725 A CN 201810605725A CN 108810543 B CN108810543 B CN 108810543B
Authority
CN
China
Prior art keywords
target
pixel
value
strips
strip
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
CN201810605725.1A
Other languages
Chinese (zh)
Other versions
CN108810543A (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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201810605725.1A priority Critical patent/CN108810543B/en
Publication of CN108810543A publication Critical patent/CN108810543A/en
Application granted granted Critical
Publication of CN108810543B publication Critical patent/CN108810543B/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/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
    • 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

Abstract

In the method, the device and the electronic equipment for compensating video coding provided by the embodiment of the invention, the strips with the number of pixel points exceeding the number threshold value are selected from the obtained strips to be used as target strips; each obtained stripe is determined by the pixel value of each pixel point in the coding unit; and compensating the pixel value of each pixel point in the target strip. In the embodiment, the number of the strips is reduced by selecting the strips of which the number of the pixels exceeds the number threshold, so that the coding efficiency can be improved.

Description

Video coding compensation method and device and electronic equipment
Technical Field
The present invention relates to the field of video coding technologies, and in particular, to a video coding compensation method, an apparatus, and an electronic device.
Background
With the popularization of high-resolution photographing devices, the amount of internet video is rapidly increasing. The prior art uses a new generation Video Coding standard HEVC (High Efficiency Video Coding) to code Video.
In HEVC, an encoder divides original frame images constituting a video into CTUs (coding tree units), and then encodes each CTU. The encoder divides the CTU into CUs (coding units) in a quadtree form, reconstructs pixel values of pixels in the CUs, compensates the pixel values of the reconstructed pixels by using a compensation method, and then encodes the compensated pixels. In the prior art, a banded compensation method in SAO (Sample adaptive offset, adaptive sampling point compensation) is introduced into HEVC to compensate pixel values of pixels in a CU. The process of compensating the pixel value of the pixel point in the CU by using the banded compensation method in the SAO is as follows:
the pixel value range 0-255 of the pixel point of one coding unit is evenly divided into 32 strips, and the pixel value of each strip is the reconstructed pixel value. And then comparing the reconstructed pixel value with the pixel value of the original frame image, calculating the average error value of the pixel values of the strips containing the pixels aiming at each strip, and taking the average error value as the average error value of the strip. And calculating a bias value corresponding to each strip by using the average error value of each strip, adding the bias value of the corresponding strip to the reconstructed pixel value of each strip, and compensating the pixel value in the CU.
The number of pixels contained in each band is large, and the prior art needs to calculate the offset values corresponding to all the bands, so that the compensation of all the pixel values in the CU is realized, the time is long, and the video coding efficiency is not high.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for compensating video coding, and an electronic device, which achieve improvement of video coding efficiency by reducing the number of unnecessary slices. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a compensation method for video coding, including:
selecting the strips with the number of contained pixel points exceeding a number threshold value from the obtained strips, and determining the strips as target strips; each obtained stripe is determined by the pixel value of each pixel point in the coding unit;
and compensating the pixel value of each pixel point in the target strip.
Optionally, the following steps may be adopted to determine the obtained individual bands:
sequencing the obtained pixel values of all pixel points in the coding unit;
and dividing the pixel values of the sorted pixel points into a first preset number of obtained strips according to a preset pixel value step length.
Optionally, the compensating the pixel value of each pixel point in the target band includes:
comparing the pixel value of the original frame image with the reconstructed pixel value, and calculating the error value of each pixel point in each target strip;
aiming at each target band, taking the average value of the error values of all pixel points in the target band as the average error value of the target band;
determining the average error value of the target strip as a bias value corresponding to the target strip aiming at each target strip;
and aiming at each target band, adding the pixel values of the pixel points in the target band with the offset value corresponding to the target band, and compensating the pixel values of the pixel points in the target band.
Optionally, after the compensating the pixel value of each pixel point in the target band, the method further includes:
and encoding the compensated target strip.
Optionally, the encoding the compensated target slice includes:
selecting a compensated target strip with the minimum average error value as a starting target strip according to the average error of each compensated target strip;
sorting the compensated target strips according to the minimum pixel value in the compensated target strips;
according to the sequence of the compensated target stripes after sequencing, selecting a second preset number of compensated target stripes as target coding stripes from the starting target stripe; the target encoded slice comprises a starting target slice;
and encoding the target encoding strip.
Optionally, the number threshold may be calculated by the following steps:
taking the value obtained by multiplying the length and the height of the coding unit as the total number of the pixel points contained in the coding unit;
taking the result of multiplying the total number of the pixel points contained in the coding unit by a preset proportional value P as a number threshold; 0< P < 1.
In a second aspect, an embodiment of the present invention provides a compensation apparatus for video coding, including:
the determining module is used for selecting the strips with the number of the contained pixel points exceeding the number threshold value from the obtained strips and determining the strips as target strips; each obtained stripe is determined by the pixel value of each pixel point in the coding unit;
and the compensation module is used for compensating the pixel value of each pixel point in the target strip.
Optionally, the determining module further includes:
the ordering subunit is used for ordering the pixel values of all the pixel points in the obtained coding unit;
and the target subunit is used for dividing the pixel values of the sequenced pixel points into a first preset number of acquired strips according to a preset pixel value step length.
Optionally, the compensation module includes:
the error calculation subunit is used for comparing the pixel value of the original frame image with the reconstructed pixel value and calculating the error value of each pixel point in each target strip;
the error determination subunit is used for taking the average value of the error values of all the pixel points in the target strip as the average error value of the target strip aiming at all the target strips;
the bias calculation subunit is used for determining the average error value of the target strip as a bias value corresponding to the target strip aiming at each target strip;
and the compensation subunit is used for adding the pixel values of the pixel points in the target band with the offset value corresponding to the target band aiming at each target band, and compensating the pixel values of the pixel points in the target band.
Optionally, the compensation apparatus for video coding further includes:
and the coding module is used for coding the compensated target strip.
Optionally, the encoding module includes:
the starting subunit selects the compensated target strip with the minimum average error value as a starting target strip according to the average error of each target strip after compensation is obtained;
the sorting subunit sorts the compensated target strips according to the minimum pixel value in the compensated target strips;
the selecting subunit selects a second preset number of compensated target strips as target coding strips from the starting target strip according to the sequence of the compensated target strips after sequencing; the target encoded slice comprises a starting target slice;
and the coding subunit is used for coding the target coding strip.
Optionally, the determining module further includes:
the pixel subunit is used for taking a value obtained by multiplying the length and the height of the coding unit as the total number of the pixel points contained in the coding unit;
the threshold subunit is used for taking a result obtained by multiplying the total number of the pixel points contained in the coding unit by a preset proportion value P as a number threshold; 0< P < 1.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to perform a compensation method for video coding as described in any one of the above.
In yet another aspect of the present invention, there is also provided a computer program product including instructions which, when run on a computer, cause the computer to perform a compensation method for video coding as described in any one of the above.
In the method, the device and the electronic equipment for compensating video coding provided by the embodiment of the invention, the strips with the number of pixel points exceeding the number threshold value are selected from the obtained strips to be used as target strips; each obtained stripe is determined by the pixel value of each pixel point in the coding unit; and compensating the pixel value of each pixel point in the target strip. In the embodiment, the number of the stripes is reduced by selecting the stripes with the number of the pixel points exceeding the number threshold, so that the coding efficiency can be improved.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart of a compensation method for video coding according to an embodiment of the present invention;
FIG. 2 is a flow chart of determining which stripes have been acquired according to an embodiment of the present invention;
fig. 3 is a flowchart of calculating a number threshold according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating pixel value compensation for each pixel point in a target band according to an embodiment of the present invention;
FIG. 5 is a flowchart of encoding a compensated target slice according to an embodiment of the present invention;
fig. 6 is a block diagram of a compensation apparatus for video coding according to an embodiment of the present invention;
fig. 7 is a structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
Aiming at the problem that the video coding efficiency is not high due to long time and the like caused by the fact that in the prior art, all pixel values in a CU are compensated by calculating bias values corresponding to all the strips, the embodiment of the invention provides a video coding compensation method and device, wherein the strips with the number of pixel points exceeding a number threshold value are selected from the obtained strips to serve as target strips; and compensating the pixel value of each pixel point in the target strip. In the embodiment, the number of the stripes is reduced by selecting the stripes with the number of the pixel points exceeding the number threshold, so that the coding efficiency can be improved.
First, a method for compensating video coding according to an embodiment of the present invention is briefly described below.
The video coding compensation method provided by the embodiment of the invention is applied to electronic equipment, and further the electronic equipment can be a mobile phone, a computer, a server, intelligent mobile terminal equipment, wearable intelligent mobile terminal equipment and the like. Without limitation, any electronic device that can implement the present invention is within the scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a compensation method for video coding, including:
s101, selecting the strips with the number of contained pixel points exceeding a number threshold value from the obtained strips, and determining the strips as target strips; each acquired stripe is determined by the pixel value of each pixel point in the coding unit;
the number threshold can be a numerical value preset manually according to industry experience, the preset number threshold can save the time for selecting the target strip, and a foundation is provided for subsequently improving the efficiency of compensating the target strip.
For example: each of the obtained stripes is [64, 71], [72, 79], [80, 87], [88, 95], [96, 103], [104, 111], [112, 119], [120, 127], the number of pixels included in each corresponding stripe is 123, 74, 198, 34, 107, 23, 165, 156, the number threshold is 100, the number of pixels included in each obtained stripe [72, 79], [88, 95], [96, 103] is less than 100, and the obtained stripes [64, 71], [80, 87], [104, 111], [112, 119], [120, 127] are used as target stripes.
S102, compensating the pixel value of each pixel point in the target strip.
In order to improve the efficiency of compensating the target band, in step S102, the pixel value of each pixel point in the target band may be compensated by using at least one of the following possible implementation manners:
in a possible implementation manner, a corresponding offset value is preset for each target band, and the offset value corresponding to the target band is added to the pixel value of each pixel point in the target band to perform compensation.
By presetting the implementation mode of the offset value corresponding to each target strip, the time for compensating each target strip can be saved.
In the embodiment of the invention, the strips with the number of pixel points exceeding the number threshold value are selected from the obtained strips to be used as target strips; and compensating the pixel value of each pixel point in the target strip. In the embodiment, the number of the stripes is reduced by selecting the stripes with the number of the pixel points exceeding the number threshold, so that the coding efficiency can be improved.
Based on a compensation method of video coding shown in fig. 1, as shown in fig. 2, in an alternative embodiment of the present invention, the obtained slices can be determined by the following steps:
s201, sequencing the pixel values of all the pixel points in the obtained coding unit;
in order to improve the efficiency of compensating the target stripe, in step S201, the obtained pixel values of the pixels in the coding unit may be sorted by using at least one of the following possible implementation manners:
in a possible implementation manner, bubble sorting, selection sorting, insertion sorting hilt sorting, merging sorting, quick sorting, heap sorting, counting sorting, bucket sorting, or radix sorting may be adopted, and any method capable of sorting may be used to sort the pixel values of the pixels in the obtained coding unit from large to small.
The obtained pixel values of all the pixel points in the coding unit are sorted from large to small, so that the time can be saved for dividing the target strip.
In another possible implementation manner, bubble sorting, selection sorting, insertion sorting hilt sorting, merging sorting, quick sorting, heap sorting, counting sorting, bucket sorting, or radix sorting, or any sorting method may be adopted to sort the pixel values of the pixels in the obtained coding unit from small to large.
The obtained pixel values of all the pixel points in the coding unit are sorted from small to large, so that the time can be saved for dividing the target strip.
S202, according to a preset pixel value step length, dividing the pixel values of the sorted pixel points into a first preset number of obtained strips.
The preset pixel value step length can be a value set manually according to industry experience, and can be modified so as to improve the efficiency of dividing the strips. The first preset number is a numerical value set manually according to industry experience, and can be modified in order to reduce the number of target strips and ensure the coding quality of the original frame images of the video.
In this embodiment, the obtained pixel values of the pixels in the coding unit are sorted, and then the strips are divided according to the preset step length of the pixel values, so that the time for obtaining each strip is saved.
In order to accurately select a target band, at least one possible implementation manner may be adopted to obtain the number threshold:
in one possible implementation, P is a value that is preset by a human based on industry experience.
For example, assuming that the size of the coding unit is M and N, the coding unit includes M × N pixels, and assuming that the preset ratio P is 0.5, M is 10, N is 35, and the number threshold P is 0.5 × 10 × 35 — 175.
The realization mode of the number threshold value preset artificially according to industry experience can save the time for selecting the target strip and improve the efficiency of video coding.
In another possible implementation manner, as shown in fig. 3, the number threshold may also be obtained by calculating:
s301, taking the value obtained by multiplying the length and the height of the coding unit as the total number of the pixel points contained in the coding unit;
s302, taking the result of multiplying the total number of the pixel points contained in the coding unit by a preset proportional value N as a number threshold; 0< P < 1.
The method for multiplying the length of the coding unit by the height of the coding unit by the preset proportional value N can obtain a more accurate implementation mode of the number threshold, and can improve the accuracy of selecting the target band.
With reference to the embodiments of fig. 1 and fig. 2, in order to improve the efficiency of compensating the target stripe, as shown in fig. 4, in another possible implementation manner, the compensation of the pixel value of each pixel point in the target stripe may be performed through the following steps:
s401, comparing the pixel value of the original frame image with the reconstructed pixel value, and calculating the error value of each pixel point in each target strip;
in order to improve the efficiency of compensating the target band, in step S401, the pixel value of the original frame image is compared with the reconstructed pixel value, and an error value of each pixel point in each target band is calculated:
and calculating the difference value between the pixel value of the original frame image of the same pixel point and the reconstructed pixel value by using an absolute error calculation formula, and calculating the error value of each pixel point in each target band of the difference value of the pixel point.
S402, aiming at each target strip, taking the average value of the error values of all pixel points in the target strip as the average error value of the target strip;
s403, determining the average error value of the target strip as a bias value corresponding to the target strip for each target strip;
s404, aiming at each target strip, adding the pixel values of the pixel points in the target strip and the offset value corresponding to the target strip, and compensating the pixel values of the pixel points in the target strip.
For example: the average error values of the target bands [64, 71], [80, 87] are: and 2 and 7, respectively setting the bias values corresponding to the target strips [64, 71], [80, 87] as-2 and 7. And adding the pixel value of each pixel point of the target strip [64, 71] to the offset value-2 corresponding to the target strip, so that the compensated target strip is [62, 69 ]. And adding the pixel value of each pixel point of the target strip [80, 87] to the offset value 7 corresponding to the target strip, so that the compensated target strip is [87, 94 ].
In this embodiment, an average error value of the target band is obtained by calculating an error value of the pixel value of each pixel point in each target band, and the average error value is determined as the offset value corresponding to the target band, so that the accuracy of the offset value corresponding to the target band is improved, and the accuracy of the pixel value compensation of each pixel point in the target band is improved.
In combination with the embodiments of fig. 1, fig. 2, and fig. 4, in order to better improve the efficiency of video coding, after S102, an optional implementation manner provided by the embodiments of the present invention, the method further includes: and encoding the compensated target strip.
In order to save time for encoding the compensated target slice, the compensated target slice may be encoded by at least one of the following possible implementations:
in a possible implementation manner, according to this embodiment, a second preset number of consecutive compensated target stripes may be selected for encoding in the order of the minimum pixel values in the compensated target stripes.
For example: the compensated target stripes are [65, 72], [82, 89], [107, 114], [120, 127], [130, 137], the second preset number is 4, and the compensated target stripes [130, 137], [120, 127], [107, 114], [82, 89] are selected and encoded according to the sequence of the minimum pixel value of the compensated target stripe from large to small. Alternatively, the compensated target stripes [65, 72], [82, 89], [107, 114], [120, 127] are selected in order of the smallest pixel value of the compensated target stripe from small to large and encoded.
And selecting a second preset number of continuous target strips for coding according to the sequence of the minimum pixel values in the compensated target strips, so that the time for coding the compensated target strips can be saved, and the video coding efficiency is improved.
In another possible implementation, a second preset number of compensated target slices can be optionally encoded in succession.
For example: and respectively encoding the compensated target stripes [65, 72], [82, 89], [107, 114], [120, 127], [130, 137], wherein the second preset number is 4, and optionally 4 compensated target stripes [82, 89], [107, 114], [120, 127], [130, 137] are continuously selected.
The implementation mode of optionally coding the compensated target stripes of the second preset number can save the time for selecting the compensated target stripes and improve the efficiency of coding the compensated target stripes.
In a third possible implementation manner, as shown in fig. 5, encoding the compensated target slice may further include the following steps:
s501, selecting a compensated target strip with the minimum average error value as an initial target strip according to the average error of each compensated target strip;
in order to save the time for encoding the compensated target stripes, the average error value of each compensated target stripe may be calculated in advance as the average error of each target stripe after compensation has been obtained, and then the compensated target stripe with the smallest absolute value of the average error value may be selected as the starting target stripe.
S502, sorting the compensated target strips according to the minimum pixel value in the compensated target strips;
in order to save the time for selecting the target encoding slice, the step S502 may employ at least one of the following possible implementations, and the compensated target slices are sorted according to the minimum pixel value in the compensated target slices:
in a possible implementation manner, bubble sorting, selection sorting, insertion sorting hilt sorting, merge sorting, quick sorting, heap sorting, count sorting, bucket sorting, or radix sorting may be adopted, and any sorting method may be used to sort each compensated target band according to the minimum pixel value in each compensated target band.
And according to the minimum pixel value in each compensated target strip, sequencing each compensated target strip from large to small, and saving time for selecting a target coding strip.
In another possible implementation manner, bubble sorting, selection sorting, insertion sorting hilt sorting, merging sorting, quick sorting, heap sorting, counting sorting, bucket sorting, or radix sorting, or any sorting method may be adopted to sort the pixel values of the pixels in the obtained coding unit from small to large.
And according to the minimum pixel value in each compensated target strip, sequencing each compensated target strip, so that the time of video coding can be saved.
S503, according to the sequence of the compensated target strips after sequencing, starting from the initial target strip, selecting a second preset number of compensated target strips as target coding strips; the target encoded slice comprises a starting target slice;
in order to save the time for selecting the target coding slice and improve the efficiency of video coding, in step S503, at least one possible implementation manner is as follows, and a second preset number of compensated target slices are selected as the target coding slices from the starting target slice in the order in which the compensated target slices are sorted:
in a possible implementation manner, according to the sequence of the compensated target stripes after being sorted, serial numbers are set for each compensated target stripe, starting from the serial number of the starting target stripe, a preset number of serial numbers are continuous, and the target stripes corresponding to the preset number of serial numbers are used as target coding stripes.
For example: the second preset number is 4, the compensated target stripes are [65, 72], [149, 156], [107, 114], [82, 89], [120, 127], [130, 137], "minimum pixel values of the compensated target stripes are 65, 149, 107, 82, 120, 130, respectively, the compensated target stripes are sorted according to the minimum pixel values of the compensated target stripes, and the sequence numbers of the compensated target stripes are set according to the sorted sequence of the compensated target stripes: 1: [65, 72], 2: [82, 89], 3: [107, 114], 4: [120, 127], 5: [130, 137], 6: [149, 156 ]; the average error of each target band after compensation is obtained is respectively: -2, 7, 1, 9, -4, 6. Where the absolute value of the average error value of the compensated target band [107, 114] is smallest, target band 3: [107, 114] as a starting target stripe, selecting a preset number of consecutive sequence numbers as: 3. 4, 5, and 6, the compensated target bands corresponding to the sequence numbers 3, 4, 5, and 6: 3: [107, 114], 4: [120, 127], 5: [130, 137], 6: [149, 156] as the target encoded slice.
In another possible implementation manner, a starting target band is selected by obtaining an average error of each compensated target band, each compensated target band is sorted according to a minimum pixel value in each compensated target band, and a second preset number of compensated target bands are selected as target coding bands from the starting target band according to a sorted order of each compensated target band.
S504, the target coding strip is coded.
In order to improve the efficiency of video coding, the above S504 may employ at least one of the following possible implementations to code the target coded slice:
in one possible implementation, the target encoded slice is encoded in order of its sequence number.
In another possible implementation, the target encoded slice is encoded in order of its smallest pixel value.
The following briefly introduces a video coding compensation apparatus according to an embodiment of the present invention.
As shown in fig. 6, an embodiment of the present invention provides a compensation apparatus for video coding, including:
a determining module 601, configured to select, from the obtained bands, a band in which the number of included pixels exceeds a number threshold, and determine the selected band as a target band; each acquired stripe is determined by the pixel value of each pixel point in the coding unit;
the compensation module 602 is configured to compensate pixel values of each pixel point in the target band.
Optionally, the determining module further includes:
the ordering subunit is used for ordering the pixel values of all the pixel points in the obtained coding unit;
and the target subunit is used for dividing the pixel values of the sequenced pixel points into a first preset number of acquired strips according to a preset pixel value step length.
Optionally, the compensation module includes:
the error calculation subunit is used for comparing the pixel value of the original frame image with the reconstructed pixel value and calculating the error value of each pixel point in each target strip;
the error determination subunit is used for taking the average value of the error values of all the pixel points in the target strip as the average error value of the target strip aiming at all the target strips;
the bias calculation subunit is used for determining the average error value of the target strip as a bias value corresponding to the target strip aiming at each target strip;
and the compensation subunit is used for adding the pixel values of the pixel points in the target band with the offset value corresponding to the target band aiming at each target band, and compensating the pixel values of the pixel points in the target band.
Optionally, the compensation apparatus for video coding according to an embodiment of the present invention further includes:
and the coding module is used for coding the compensated target strip.
Optionally, the encoding module includes:
the starting subunit selects the compensated target strip with the minimum average error value as a starting target strip according to the average error of each target strip after compensation is obtained;
the sorting subunit sorts the compensated target strips according to the minimum pixel value in the compensated target strips;
the selecting subunit selects a second preset number of compensated target strips as target coding strips by taking the initial target strips as the first according to the sequence of each compensated target strip; the target encoded slice comprises a starting target slice;
and the coding subunit is used for coding the target coding strip.
Optionally, the determining module further includes:
the pixel subunit is used for taking a value obtained by multiplying the length and the height of the coding unit as the total number of the pixel points contained in the coding unit;
the threshold subunit is used for taking the result of multiplying the total number of the pixel points contained in the coding unit by a preset proportional value P as a number threshold; 0< P < 1.
An embodiment of the present invention further provides an electronic device, as shown in fig. 7, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the following steps when executing the program stored in the memory 703:
selecting the strips with the number of contained pixel points exceeding a number threshold value from the obtained strips, and determining the strips as target strips; each acquired stripe is determined by the pixel value of each pixel point in the coding unit; and compensating the pixel value of each pixel point in the target strip.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, which stores instructions that, when executed on a computer, cause the computer to perform the compensation method for video coding described in any of the above embodiments.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the compensation method for video coding as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (9)

1. A compensation method for video coding, the method comprising:
selecting the strips with the number of contained pixel points exceeding a number threshold value from the obtained strips, and determining the strips as target strips; each obtained stripe is determined by the pixel value of each pixel point in the coding unit;
compensating the pixel value of each pixel point in the target strip;
encoding the compensated target strip;
the encoding the compensated target slice comprises:
selecting a compensated target strip with the minimum average error value as a starting target strip according to the average error of each compensated target strip;
sorting the compensated target strips according to the minimum pixel value in the compensated target strips;
according to the sequence of the compensated target stripes after sequencing, selecting a second preset number of compensated target stripes as target coding stripes from the starting target stripe; the target encoded slice comprises a starting target slice;
and encoding the target encoding strip.
2. The method according to claim 1, characterized in that the individual strips obtained are determined by the following steps:
sequencing the obtained pixel values of all pixel points in the coding unit;
and dividing the pixel values of the sorted pixel points into a first preset number of obtained strips according to a preset pixel value step length.
3. The method of claim 1, wherein the compensating the pixel values of the pixels in the target strip comprises:
comparing the pixel value of the original frame image with the reconstructed pixel value, and calculating the error value of each pixel point in each target strip;
aiming at each target band, taking the average value of the error values of all pixel points in the target band as the average error value of the target band;
determining the average error value of the target strip as a bias value corresponding to the target strip aiming at each target strip;
and aiming at each target band, adding the pixel values of the pixel points in the target band with the offset value corresponding to the target band, and compensating the pixel values of the pixel points in the target band.
4. The method of claim 1, wherein the number threshold is calculated by:
taking the value obtained by multiplying the length and the height of the coding unit as the total number of the pixel points contained in the coding unit;
taking the result of multiplying the total number of the pixel points contained in the coding unit by a preset proportional value P as a number threshold; 0< P < 1.
5. An apparatus for compensating for video coding, the apparatus comprising:
the determining module is used for selecting the strips with the number of the contained pixel points exceeding the number threshold value from the obtained strips and determining the strips as target strips; each obtained stripe is determined by the pixel value of each pixel point in the coding unit;
the compensation module is used for compensating the pixel value of each pixel point in the target strip;
an encoding module, configured to encode the compensated target slice, the encoding module including:
the starting subunit selects the compensated target strip with the minimum average error value as a starting target strip according to the average error of each target strip after compensation is obtained;
the sorting subunit sorts the compensated target strips according to the minimum pixel value in the compensated target strips;
the selecting subunit selects a second preset number of compensated target strips as target coding strips from the starting target strip according to the sequence of the compensated target strips after sequencing; the target encoded slice comprises a starting target slice;
and the coding subunit is used for coding the target coding strip.
6. The apparatus of claim 5, wherein the determining module further comprises:
the ordering subunit is used for ordering the pixel values of all the pixel points in the obtained coding unit;
and the target subunit is used for dividing the pixel values of the sequenced pixel points into a first preset number of acquired strips according to a preset pixel value step length.
7. The apparatus of claim 5, wherein the compensation module comprises:
the error calculation subunit is used for comparing the pixel value of the original frame image with the reconstructed pixel value and calculating the error value of each pixel point in each target strip;
the error determination subunit is used for taking the average value of the error values of all the pixel points in the target strip as the average error value of the target strip aiming at all the target strips;
the bias calculation subunit is used for determining the average error value of the target strip as a bias value corresponding to the target strip aiming at each target strip;
and the compensation subunit is used for adding the pixel values of the pixel points in the target band with the offset value corresponding to the target band aiming at each target band, and compensating the pixel values of the pixel points in the target band.
8. The apparatus of claim 5, wherein the determining module further comprises:
the pixel subunit is used for taking a value obtained by multiplying the length and the height of the coding unit as the total number of the pixel points contained in the coding unit;
the threshold subunit is used for taking a result obtained by multiplying the total number of the pixel points contained in the coding unit by a preset proportion value P as a number threshold; 0< P < 1.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
CN201810605725.1A 2018-06-13 2018-06-13 Video coding compensation method and device and electronic equipment Active CN108810543B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810605725.1A CN108810543B (en) 2018-06-13 2018-06-13 Video coding compensation method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810605725.1A CN108810543B (en) 2018-06-13 2018-06-13 Video coding compensation method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN108810543A CN108810543A (en) 2018-11-13
CN108810543B true CN108810543B (en) 2020-08-28

Family

ID=64085652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810605725.1A Active CN108810543B (en) 2018-06-13 2018-06-13 Video coding compensation method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN108810543B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112927311B (en) * 2021-02-24 2022-06-03 上海哔哩哔哩科技有限公司 Data processing method and device of sideband compensation mode of sample point adaptive compensation
CN114724087A (en) * 2022-04-22 2022-07-08 四川众合智控科技有限公司 Recognition method and system for improving image recognition accuracy of subway inspection equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013109419A1 (en) * 2012-01-21 2013-07-25 General Instrument Corporation Devices and methods for sample adaptive offset coding and/or selection of band offset parameters
EP2723073A4 (en) * 2011-06-14 2014-11-26 Lg Electronics Inc Method for encoding and decoding image information
CN105635732A (en) * 2014-10-30 2016-06-01 联想(北京)有限公司 Adaptive sampling point compensation coding method and device, and method and device for decoding video code stream

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2723073A4 (en) * 2011-06-14 2014-11-26 Lg Electronics Inc Method for encoding and decoding image information
WO2013109419A1 (en) * 2012-01-21 2013-07-25 General Instrument Corporation Devices and methods for sample adaptive offset coding and/or selection of band offset parameters
CN105635732A (en) * 2014-10-30 2016-06-01 联想(北京)有限公司 Adaptive sampling point compensation coding method and device, and method and device for decoding video code stream

Also Published As

Publication number Publication date
CN108810543A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
CN110839155B (en) Method and device for motion estimation, electronic equipment and computer-readable storage medium
EP3509305B1 (en) Intra-prediction video coding method and device
CN108810543B (en) Video coding compensation method and device and electronic equipment
US20210160515A1 (en) Method and device for video predicting colour component, and computer storage medium
CN111062884B (en) Image enhancement method and device, storage medium and terminal equipment
CN110062230B (en) Image coding method and device
CN113194306B (en) Frame rate fluctuation evaluation method and device, mobile terminal, system and storage medium
CN116132668A (en) Method and device for predicting video image component and computer storage medium
CN110826685A (en) Method and device for convolution calculation of neural network
CN110896477B (en) Video coding method, device, coding equipment and storage medium
CN112312133A (en) Video coding method and device, electronic equipment and readable storage medium
CN111131828A (en) Image compression method and device
CN110956594A (en) Image filtering method and device, electronic equipment and storage medium
EP3758373B1 (en) Video encoding method, electronic device, and storage medium
CN110418138B (en) Video processing method and device, electronic equipment and storage medium
CN109660806B (en) Encoding method and device and electronic equipment
CN110378479B (en) Image input method and device based on deep learning and terminal equipment
CN108683915B (en) Method and device for writing dQP value and electronic equipment
JP2020025290A (en) Image difference detection device, image difference detection method, and computer program
CN110581995A (en) Video processing method and device
JP5375590B2 (en) Quantization control circuit, quantization parameter changing method, and encoding apparatus
CN108632622B (en) Intra-frame prediction method and device and electronic equipment
CN109068144B (en) Probability estimation method and device and electronic equipment
CN109168004B (en) Interpolation method and device for motion compensation
CN109640086B (en) Image compression method, image compression device, electronic equipment and computer-readable 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
GR01 Patent grant
GR01 Patent grant