CN109660806A - A kind of coding method and device - Google Patents
A kind of coding method and device Download PDFInfo
- Publication number
- CN109660806A CN109660806A CN201811611361.4A CN201811611361A CN109660806A CN 109660806 A CN109660806 A CN 109660806A CN 201811611361 A CN201811611361 A CN 201811611361A CN 109660806 A CN109660806 A CN 109660806A
- Authority
- CN
- China
- Prior art keywords
- image block
- rate distortion
- video
- coding
- distortion costs
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/17—Methods 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
- H04N19/176—Methods 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 the region being a block, e.g. a macroblock
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/146—Data rate or code amount at the encoder output
- H04N19/147—Data rate or code amount at the encoder output according to rate distortion criteria
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/189—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
- H04N19/19—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding using optimisation based on Lagrange multipliers
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The embodiment of the invention provides a kind of coding method and devices, method includes: to obtain to carry out encoding obtained first rate distortion costs and coding mode information for the first image block in first via video, the second image block in the second road video is encoded using coding mode information, obtains the second rate distortion costs;The coding for completing to be directed to the second image block is determined when the second rate distortion costs are not more than rate distortion threshold.In this programme, the coding mode information and the first rate distortion costs of the first image block are obtained from encoded first via video, it is encoded when being encoded to the second image block in the second road video using coding mode information, in the case where the second rate distortion costs are not more than rate distortion threshold, not other coding modes of reselection shorten the time entirely encoded.It is smaller to the code rate of the second road Video coding in this programme compared to lossless coding, improve compression efficiency.
Description
Technical field
The present invention relates to multimedia technology fields, more particularly to a kind of coding method and device.
Background technique
Video needs to be handled by Video coding before video website is online, obtains required video.For same
One video, video is online in different regions requirement is different, for example, the online video in some areas can have with watermark
Area be not energy band watermark.Based on this, for same video, need to make multiple and different versions, it is different to cope with
Demand.
Therefore, it is directed to same video at present, needs to carry out multi-channel video coding, generates different requirements per Video coding all the way
Video.When carrying out multi-channel video coding, current main coding mode is code-multiplexed manner, specifically, first to all the way
Video is encoded, then when to another way Video coding, for region identical with preceding video pictures all the way, is regarded all the way before multiplexing
The coding mode of frequency, and for the region different from preceding video pictures all the way, then guarantee image boundary using lossless coding not
Become, and then guarantees the quality Jing Guo encoded video.
However, inventor has found in the implementation of the present invention, at least there are the following problems for the prior art: current volume
In code mode, the code rate of lossless coding is higher, so that compression efficiency reduces.Therefore, how to the identical video of video content
Coding rate is improved when carrying out multiplex coding on the basis of high compression efficiency to be a problem to be solved.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of coding method and device, with realize identical video is carried out it is more
Road can improve coding rate on the basis of high compression efficiency when encoding.Specific technical solution is as follows:
In a first aspect, the embodiment of the invention provides a kind of coding methods, which comprises
It obtains and carries out encoding obtained first rate distortion costs and coding for the first image block in first via video
Pattern information, wherein the first image block is the multiple images block that the first via video is divided according to default division rule
In it is one of;
Using the coding mode information, the second image block in the second road video is encoded, obtains the mistake of the second rate
True cost, wherein the first via video and second road video are the identical video of video content, second image block
Are as follows: in multiple images block of second road video according to the default division rule division, with the first image block in institute
State the identical image block in position in first via video;
Judge whether second rate distortion costs are greater than rate distortion threshold;
If second rate distortion costs are not more than rate distortion threshold, it is determined that complete for second image block
Coding.
Optionally, it obtains and carries out encoding obtained first rate distortion costs for the first image block in first via video
And before the step of coding mode information, further includes:
The first image block in the first via video is encoded, the first image block corresponding is obtained
One rate distortion costs and coding mode information;
First rate distortion costs and the coding mode information are stored.
Optionally, the rate distortion threshold obtains in the following manner:
By first rate distortion costs multiplied by the first default value, the rate distortion threshold is obtained;Alternatively, by described
The product of one rate distortion costs and the second default value, in addition the Lagrange's multiplier of presupposition multiple, obtains the rate distortion threshold
Value.
Optionally, using the coding mode information, the second image block in the second road video is encoded, obtains
Before the step of two rate distortion costs, further includes:
The default division rule is obtained, and determines the first image block in the first via video after division
Position;
According to the default division rule, second road video is divided into multiple images block;
From described multiple images block, will with the first image block in the first via video the identical image in position
Block is determined as second image block.
Optionally, the method also includes:
If second rate distortion costs are greater than the rate distortion threshold, preset coding in preset block encoder is utilized
Mode respectively encodes second image block, and respectively obtains corresponding rate distortion costs;
The smallest rate distortion costs are selected from obtained rate distortion costs, and selected rate distortion costs are corresponding
Coding mode be determined as the coding mode encoded to second image block.
Second aspect, the embodiment of the invention provides a kind of code device, described device includes:
First obtains module, carries out encoding obtained first for obtaining the first image block being directed in first via video
Rate distortion costs and coding mode information, wherein the first image block is the first via video according to default division rule
It is one of in the multiple images block of division;
First coding module carries out the second image block in the second road video for utilizing the coding mode information
Coding, obtains the second rate distortion costs, wherein the first via video and second road video are the identical view of video content
Frequently, second image block are as follows: in multiple images block of second road video according to the default division rule division, with institute
State the first image block identical image block in position in the first via video;
Judgment module, for judging whether second rate distortion costs are greater than rate distortion threshold;When the judgment module
Judging result be it is no when, it is determined that complete be directed to second image block coding.
Optionally, described device further include:
Second coding module obtains described for encoding to the first image block in the first via video
Corresponding first rate distortion costs of first image block and coding mode information;
Memory module, for storing first rate distortion costs and the coding mode information.
Optionally, the rate distortion threshold obtains in the following manner:
By first rate distortion costs multiplied by the first default value, the rate distortion threshold is obtained;Alternatively, by described
The product of one rate distortion costs and the second default value, in addition the Lagrange's multiplier of presupposition multiple, obtains the rate distortion threshold
Value.
Optionally, described device further include:
Second obtains module, for obtaining the default division rule, and determines the first image block after division
Position in the first via video;
Division module, for according to the default division rule, second road video to be divided into multiple images block;
Determining module is used for from described multiple images block, will be with the first image block in the first via video
The identical image block in position is determined as second image block.
Optionally, described device further include:
Third coding module utilizes preset piece if being greater than the rate distortion threshold for second rate distortion costs
Preset coding mode in encoder respectively encodes second image block, and respectively obtains corresponding rate distortion generation
Valence;
Selecting module, for selecting the smallest rate distortion costs from obtained rate distortion costs, and will be selected
The corresponding coding mode of rate distortion costs is determined as the coding mode encoded to second image block.
The third aspect, the embodiment of the invention provides a kind of electronic equipment, including processor, communication interface, memory and
Communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any of the above-described coding method step.
At the another aspect that the present invention is implemented, a kind of computer readable storage medium is additionally provided, it is described computer-readable
Instruction is stored in storage medium, when run on a computer, so that computer executes any of the above-described coding staff
Method.
At the another aspect that the present invention is implemented, the embodiment of the invention also provides a kind of, and the computer program comprising instruction is produced
Product, when run on a computer, so that computer executes any of the above-described coding method.
In technical solution provided in an embodiment of the present invention, obtains and encoded for the first image block in first via video
Obtained first rate distortion costs and coding mode information, using the coding mode information, to second in the second road video
Image block is encoded, and the second rate distortion costs are obtained;When the second rate distortion costs are not more than rate distortion threshold, then completion pair
The coding of second image block.The technical solution provided through the embodiment of the present invention obtains from encoded first via video
The coding mode information of one image block and the first rate distortion costs, it is first when being encoded to the second image block in the second road video
It is encoded using the coding mode information, in the case where obtained second rate distortion costs are not more than rate distortion threshold,
The selection for no longer carrying out other coding modes, shortens the time entirely encoded, improves coding rate.Compared to lossless volume
Yard, it is smaller to the code rate of the second road Video coding in this programme, compression efficiency is improved, also, utilization rate distortion threshold guarantees
To the coding quality of the second road video.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described.
Fig. 1 is a kind of flow chart of coding method provided in an embodiment of the present invention;
Fig. 2 (a) is a kind of schematic diagram that image provided in an embodiment of the present invention divides;
Fig. 2 (b) is another schematic diagram that image provided in an embodiment of the present invention divides;
Fig. 3 is a kind of structural schematic diagram of code device provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention is described.
Coding can be improved on the basis of high compression efficiency when carrying out multiplex coding to identical video to realize
Speed, the embodiment of the invention provides a kind of coding method and devices, wherein compression efficiency refers in the same compression artefacts of video
Under conditions of, code rate is smaller, and compression efficiency is higher.Coding method provided in an embodiment of the present invention includes:
It obtains and carries out encoding obtained first rate distortion costs and coding for the first image block in first via video
Pattern information, wherein the first image block be in multiple images block that first via video is divided according to default division rule wherein
One piece;
Wherein, the first rate distortion costs are greater than preset threshold.When the first rate distortion costs are not more than preset threshold, indicate
The coding mode of first image block is available, and otherwise, the second road video is because possible after the coding mode of multiplexing first via video
Better effect can not be obtained.
Using coding mode information, the second image block in the second road video is encoded, obtains the second rate distortion generation
Valence, wherein first via video and the second road video are the identical video of video content, the second image block are as follows: the second road video is pressed
In the multiple images block divided according to default division rule, with the first image block in first via video the identical image block in position;
Illustratively, the video content of first via video and the second class video is identical, but wherein has video carrying all the way
There are watermark, such as the mark of video, such difference needs to judge whether the second class video can be multiplexed the volume of first via video
Pattern, if can if be directly multiplexed the coding mode of the first via, otherwise recompiled using other coding modes.Its
In, since the video content of first via video and the second class video is identical in the embodiment of the present invention, by first via video and
Second class video uses identical division mode, and each video frame in this two-path video is respectively divided into multiple corresponding figures
As block, as shown in Fig. 2 (a) and Fig. 2 (b) of the following figure, by judging whether the image block in the second tunnel can be multiplexed first respectively
The coding mode of road correspondence image block to encode to the second road video, and then completes the entire coding of the second road video, this
Inventive embodiments are only illustrated by taking an image block corresponding in this two-path video as an example, other in the second road image
The coding mode of image block is also in this way, which is not described herein again.
Judge whether the second rate distortion costs are greater than rate distortion threshold;
If the second rate distortion costs are not more than rate distortion threshold, it is determined that complete the coding for being directed to the second image block.
Illustratively, since the video content of first via video and the second class video is identical, may have in this two-path video
Watermark is carried in video all the way, video frame is respectively divided into multiple images block in a like fashion adopting two-path video
When, if having an image block in the second image block in the first image block and corresponding second road image in first via video
There are watermarks, and when second image block is multiplexed the coding mode of first image block, the second rate of the second image block is distorted generation
Valence may can be greater than distortion rate threshold value.
In technical solution provided in an embodiment of the present invention, obtains and encoded for the first image block in first via video
Obtained first rate distortion costs and coding mode information, using the coding mode information, to second in the second road video
Image block is encoded, and the second rate distortion costs are obtained;When the second rate distortion costs are not more than rate distortion threshold, then completion pair
The coding of second image block.The technical solution provided through the embodiment of the present invention obtains from encoded first via video
The coding mode information of one image block and the first rate distortion costs, it is first when being encoded to the second image block in the second road video
It is encoded using the coding mode information, in the case where obtained second rate distortion costs are not more than rate distortion threshold,
The selection for no longer carrying out other coding modes, shortens the time entirely encoded, improves coding rate.Compared to lossless volume
Yard, it is smaller to the code rate of the second road Video coding in this programme, compression efficiency is improved, also, utilization rate distortion threshold guarantees
To the coding quality of the second road video.
A kind of coding method provided in an embodiment of the present invention is introduced first below.The embodiment of the invention provides one
Kind coding method, the coding method can be applied to Video coding.As shown in Figure 1, coding method provided in an embodiment of the present invention
Include the following steps.
S101, obtain for the first image block in first via video encode obtained first rate distortion costs and
Coding mode information.
Wherein, the first image block is wherein one in multiple images block that first via video is divided according to default division rule
Block.That is, first via video can be divided into several image blocks when encoding to first via video, it is then successively right
Each image block is encoded.When completing to the coding of all image blocks in first via video, that is, complete to regard the first via
The coding of frequency.
Wherein, the default division rule divided to first via video can be customized.In a kind of implementation,
Default division rule can be irregular division, can also be regular partition.By taking Fig. 2 (a) as an example, by first via video rules
It is divided into 2 × 4 image block, i.e., first via video is divided into 8 image blocks.
After first via video is divided into several image blocks according to default division rule, if the first image block can be
Any image block in dry image block.By taking Fig. 2 (a) as an example, the first image block can be any one in 8 image blocks, than
Such as, the first image block can be the image block that number is a1.
First rate distortion costs are the rate distortion costs encoded for the first image block.Wherein, rate distortion costs are used
In indicating the relationship between image fault and code rate, it is believed that be when being encoded to image to distortion and code rate simultaneously into
Row optimization, in the hope of reaching a preferable equalization point, which is rate distortion costs.Rate distortion costs can use following public affairs
Formula indicates:
J=D+ λ R
Wherein, J is rate distortion costs, and D is image fault, and λ is Lagrange's multiplier, and R is code rate.
Therefore, when being encoded to the first image block, image fault and code rate be it is determining, based on determining image
Distortion and code rate, the available rate distortion costs for being directed to the first image block and being encoded, i.e. the first rate distortion costs.
Wherein, obtained coding mode information is the related letter in the coding mode encoded for the first image block
Breath, for example, motion vector, intra prediction angle etc. can determine that the first image block is compiled according to the coding mode information
The coding mode of code.In addition, based on it is used H.264, the coding standards such as H.265, can also include in coding mode information
Information converting, quantified parameter information etc..
In a kind of embodiment, when being encoded to the first image block, available first image block corresponding
One rate distortion costs and coding mode information, then obtained first rate distortion costs and coding mode information are stored.
In this way, when needing to be multiplexed the coding mode of the first image block, can directly acquire and be stored when being encoded to the second road video
The first rate distortion costs and coding mode information.
Wherein, it stores in the first rate distortion costs of the first image block and the storage medium of coding mode information, it can be with
Store the rate distortion costs and coding mode information of other image blocks in first via video.
S102 encodes the second image block in the second road video using coding mode information, obtains the mistake of the second rate
True cost.
Wherein, the second road video can be video identical with first via video.For example, first via video is original image,
Second road video is on the basis of original image added with the image of logo.
The second road video is divided into several image blocks according to default division rule before being encoded to the second road video, so
Successively each image block is encoded afterwards.When completing to the coding of all image blocks in the second road video, i.e. completion pair
The coding of second road video.
Wherein, identical as the division rule of the second road video to the division rule of first via video, based on identical default
Obtained image number of blocks is identical after division rule, first via video and the second road video divide, and each image block is
It is corresponding.For example, in the first via video the first row first row image block, the figure with the first row first row in the second road video
As block is corresponding.
In another example Fig. 2 (a) is first via video, which is divided into 2 × 4 figure according to default division rule
As block, the number of obtained each image block are as follows: a1, a2, a3, a4, a5, a6, a7 and a8.Fig. 2 (b) be the second road video, second
Road video is identical as first via video, and only more some logo on the basis of first via video, are based on this second road video
According to the default division rule of first via video, it is divided into 2 × 4 image block, the number of obtained image block are as follows: b1, b2,
B3, b4, b5, b6, b7 and b8.Wherein, the image block a1 in first via video corresponds to the image block b1 in the second road video, figure
As block a2 correspond to image block b2, image block a3 correspond to image block b3, image block a4 correspond to image block b4, a5 pairs of image block
Image block b6 should be corresponded in image block b5, image block a6, image block a7 corresponds to image block b7, and image block a8 corresponds to image
Block b8.
Wherein, the second image block are as follows: in the multiple images block that the second road video is divided according to default division rule, with first
Image block identical image block in position in first via video.That is, position of second image block in the second road video
It is identical as position of first image block in first via video.
By taking Fig. 2 (a) and Fig. 2 (b) as an example, when the first image block is a1, the second image block is b1;When the first image block is
When a4, the second image block is b4;When the first image block is a5, the second image block is b5.
Utilize the coding mode information for being directed to the first image block, it can determine the coding mode of the first image block coding.
It is multiplexed the coding mode of the first image block coding, the second image block is encoded, available second rate distortion costs, this
Two rate distortion costs are the rate distortion costs for the second image block.
In a kind of embodiment, using coding mode information, the second image block in the second road video is encoded, is obtained
Before the step of to the second rate distortion costs, it can also include the following steps.
The default division rule divided to first via video is obtained, and determines first of the first image block after division
Position in the video of road.According to default division rule, the second road video is divided into multiple images block, wherein the second road video is drawn
Obtained image block is identical as the image number of blocks in first via video after point, also, each image in the second road video
Block is one-to-one with an image block in first via video.After the second road video is divided into multiple images block,
It, will the identical image block in position be determined as in first via video with the first image block from dividing in obtained multiple images block
Second image block.
By taking Fig. 2 (a) and Fig. 2 (b) as an example, first via video is divided according to 2 × 4 division rule, obtained figure
As shown in block such as Fig. 2 (a), wherein using image block a1 as the first image block, it is determined that the first image block in first via video
In position be the first row first row.Before to the second road Video coding, first according to 2 × 4 division rule to the second road video
It is divided, shown in acquired image block such as Fig. 2 (b).The image block of the first row first row is b1 in Fig. 2 (b), then by image
Block b1 is determined as the second image block.
S103, judges whether the second rate distortion costs are greater than rate distortion threshold;If not, step S104 is executed, if so,
Execute step S105.
Wherein, rate distortion threshold be used for when other road images be multiplexed the first image block coding mode when with obtained rate
Distortion cost is compared, and occurs being distorted larger situation when being encoded to avoid the coding mode of the first image block of multiplexing,
And then ensure that the quality of the coding mode progress encoded images of other road images the first image block of multiplexing is preferable.Rate distortion threshold
It can be obtained by following at least two mode.
In the first embodiment, rate distortion threshold can be obtained by the first rate distortion costs multiplied by the first default value,
It can be indicated with following formula are as follows:
T=a × cost
Wherein, T is rate distortion threshold, and a is the first default value, and cost is the first rate distortion costs.
Wherein, the first default value can be customized setting.For example, the first default value can be 1.2, in this way,
When the first rate distortion costs are 1000, then available rate distortion threshold is 1200.
In second of embodiment, by the product of the first rate distortion costs and the second default value, in addition presupposition multiple
Lagrange's multiplier obtains rate distortion threshold.It can be indicated with following formula are as follows:
T=b × cost+c × λ
Wherein, T is rate distortion threshold, and b is the second default value, and cost is the first rate distortion costs, and c is presupposition multiple, λ
For Lagrange's multiplier.
Wherein, the second default value can be customized setting, and presupposition multiple is also possible to customized setting.Example
Such as, the second default value is 1.1, presupposition multiple 5.
It is not limited in both the above based on the embodiment that rate distortion threshold is calculated in the first rate distortion costs, may be used also
There are other calculations, it is not limited thereto.
After obtaining rate distortion threshold, the second rate distortion costs are compared with rate distortion threshold, to determine to the
It is smaller whether the coding of two image blocks is distorted.When the second rate distortion costs are less than rate distortion threshold, it is believed that the second figure
As the coding distortion of block is smaller;When the second rate distortion costs are not less than rate distortion threshold, it is believed that the second image block
Coding distortion is larger.
S104 determines the coding for completing to be directed to the second image block.
It is smaller to the coding distortion of the second image block when judging the second rate distortion costs no more than rate distortion threshold,
At this time it is considered that completing the coding to the second image block, and next image block in the second road video can be compiled
Code.Furthermore it is possible to using coding mode determined by coding mode information as the coding mode encoded to the second image block.
When judging that the second rate distortion costs are greater than rate distortion threshold, that is, think to the coding distortion of the second image block compared with
Greatly, then it is assumed that coding mode determined by coding mode information cannot function as the coding mode encoded to the second image block,
Need to redefine a kind of coding mode, i.e. step S105.
Using preset coding mode in preset block encoder, the second image block is encoded respectively, and respectively
To corresponding rate distortion costs;Select the smallest rate distortion costs from obtained rate distortion costs, and by selected rate
The corresponding coding mode of distortion cost is determined as the coding mode encoded to the second image block.
Specifically, preset coding mode is obtained from preset block encoder, wherein each volume stored in block encoder
The quantity of pattern can be customized, and each coding mode is all satisfied the standards such as H.264 or H.265.Pass through block encoder
Each coding mode is traversed, and first encoding is carried out to the second image block using each coding mode, and obtain a rate and lose
True cost.In this way, how many coding mode in block encoder, can obtain how many a rate distortion costs.Wherein, to preset
The sequence that coding mode is traversed can be customized.
In having traversed block encoder after all coding modes, i.e., preset all coding modes are to the second figure
As block is encoded, the smallest rate distortion costs are selected from obtained rate distortion costs, and selected rate is distorted generation
The corresponding coding mode of valence is determined as the coding mode encoded to the second image block.
For example, including 4 kinds of coding modes in preset block encoder, it is respectively as follows: coding mode 1, coding mode 2, compiles
Pattern 3 and coding mode 4.When judging that the second rate distortion costs are greater than rate distortion threshold, block encoder can be first with
Coding mode 1 encodes the second image block, obtains rate distortion costs 1;Coding mode 2 is recycled to carry out the second image block
Coding, obtains rate distortion costs 2;It recycles coding mode 3 to encode the second image block, obtains rate distortion costs 3;Most
Afterwards, second image block is encoded using coding mode 4, obtains rate distortion costs 4.Wherein, rate distortion costs 1, rate distortion
The smallest in cost 2, rate distortion costs 3 and rate distortion costs 4 is rate distortion costs 1, then coding mode 1 is determined as to second
The coding mode that image block is encoded.
In technical solution provided in an embodiment of the present invention, obtains and encoded for the first image block in first via video
Obtained first rate distortion costs and coding mode information, using the coding mode information, to second in the second road video
Image block is encoded, and the second rate distortion costs are obtained;When the second rate distortion costs are not more than rate distortion threshold, then completion pair
The coding of second image block.The technical solution provided through the embodiment of the present invention obtains from encoded first via video
The coding mode information of one image block and the first rate distortion costs, it is first when being encoded to the second image block in the second road video
It is encoded using the coding mode information, in the case where obtained second rate distortion costs are not more than rate distortion threshold,
The selection for no longer carrying out other coding modes, shortens the time entirely encoded, improves coding rate.Compared to lossless volume
Yard, it is smaller to the code rate of the second road Video coding in this programme, compression efficiency is improved, also, utilization rate distortion threshold guarantees
To the coding quality of the second road video.
Corresponding to above-mentioned coding method embodiment, the embodiment of the present invention also provides a kind of code device, as shown in figure 3, should
Code device includes:
First obtains module 310, for obtains encode for the first image block in first via video it is obtained
First rate distortion costs and coding mode information, wherein the first image block is that first via video is divided according to default division rule
Multiple images block in it is one of;
First coding module 320 compiles the second image block in the second road video for utilizing coding mode information
Code, obtains the second rate distortion costs, wherein first via video and the second road video are the identical video of video content, the second figure
As block are as follows: in the multiple images block that the second road video is divided according to default division rule, with the first image block in first via video
The identical image block in middle position;
Judgment module 330, for judging whether the second rate distortion costs are greater than rate distortion threshold;When the judgement of judgment module
When being as a result no, it is determined that complete the coding for being directed to the second image block.
In a kind of embodiment, which can also include:
Second coding module obtains the first image block pair for encoding to the first image block in first via video
The first rate distortion costs and coding mode information answered;
Memory module, for storing the first rate distortion costs and coding mode information.
In a kind of embodiment, rate distortion threshold obtains in the following manner:
By the first rate distortion costs multiplied by the first default value, rate distortion threshold is obtained;Alternatively,
By the product of the first rate distortion costs and the second default value, in addition the Lagrange's multiplier of presupposition multiple, obtains
Rate distortion threshold.
In a kind of embodiment, which can also include:
Second obtains module, for obtaining default division rule, and determines first via view of first image block after division
Position in frequency;
Division module, for according to default division rule, the second road video to be divided into multiple images block;
Determining module, for from multiple images block, will with the first image block in first via video the identical figure in position
As block is determined as the second image block.
In a kind of embodiment, which can also include:
Third coding module, if being greater than rate distortion threshold for the second rate distortion costs, using in preset block encoder
Preset coding mode respectively encodes the second image block, and respectively obtains corresponding rate distortion costs;
Selecting module, for selecting the smallest rate distortion costs from obtained rate distortion costs, and will be selected
The corresponding coding mode of rate distortion costs is determined as the coding mode encoded to the second image block.
In technical solution provided in an embodiment of the present invention, obtains and encoded for the first image block in first via video
Obtained first rate distortion costs and coding mode information, using the coding mode information, to second in the second road video
Image block is encoded, and the second rate distortion costs are obtained;When the second rate distortion costs are not more than rate distortion threshold, then completion pair
The coding of second image block.The technical solution provided through the embodiment of the present invention obtains from encoded first via video
The coding mode information of one image block and the first rate distortion costs, it is first when being encoded to the second image block in the second road video
It is encoded using the coding mode information, in the case where obtained second rate distortion costs are not more than rate distortion threshold,
The selection for no longer carrying out other coding modes, shortens the time entirely encoded, improves coding rate.Compared to lossless volume
Yard, it is smaller to the code rate of the second road Video coding in this programme, compression efficiency is improved, also, utilization rate distortion threshold guarantees
To the coding quality of the second road video.
The embodiment of the invention also provides a kind of electronic equipment, as shown in figure 4, include processor 410, communication interface 420,
Memory 430 and communication bus 440, wherein processor 410, communication interface 420, memory 430 are complete by communication bus 440
At mutual communication,
Memory 430, for storing computer program;
Processor 410 when for executing the program stored on memory 430, realizes following steps:
It obtains and carries out encoding obtained first rate distortion costs and coding for the first image block in first via video
Pattern information, wherein the first image block be in multiple images block that first via video is divided according to default division rule wherein
One piece;
Using coding mode information, the second image block in the second road video is encoded, obtains the second rate distortion generation
Valence, wherein first via video and the second road video are the identical video of video content, the second image block are as follows: the second road video is pressed
In the multiple images block divided according to default division rule, with the first image block in first via video the identical image block in position;
Judge whether the second rate distortion costs are greater than rate distortion threshold;
If the second rate distortion costs are not more than rate distortion threshold, it is determined that complete the coding for being directed to the second image block.
In technical solution provided in an embodiment of the present invention, obtains and encoded for the first image block in first via video
Obtained first rate distortion costs and coding mode information, using the coding mode information, to second in the second road video
Image block is encoded, and the second rate distortion costs are obtained;When the second rate distortion costs are not more than rate distortion threshold, then completion pair
The coding of second image block.The technical solution provided through the embodiment of the present invention obtains from encoded first via video
The coding mode information of one image block and the first rate distortion costs, it is first when being encoded to the second image block in the second road video
It is encoded using the coding mode information, in the case where obtained second rate distortion costs are not more than rate distortion threshold,
The selection for no longer carrying out other coding modes, shortens the time entirely encoded, improves coding rate.Compared to lossless volume
Yard, it is smaller to the code rate of the second road Video coding in this programme, compression efficiency is improved, also, utilization rate distortion threshold guarantees
To the coding quality of the second road video.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component
Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just
It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy
The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also
To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal
Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing
It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete
Door or transistor logic, discrete hardware components.
In another embodiment provided by the invention, a kind of computer readable storage medium is additionally provided, which can
It reads to be stored with instruction in storage medium, when run on a computer, so that computer executes any institute in above-described embodiment
The coding method stated.
In another embodiment provided by the invention, a kind of computer program product comprising instruction is additionally provided, when it
When running on computers, so that computer executes any coding method in above-described embodiment.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real
It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program
Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or
It partly generates according to process or function described in the embodiment of the present invention.The computer can be general purpose computer, dedicated meter
Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium
In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer
Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center
User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or
Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or
It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with
It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk
Solid State Disk (SSD)) etc..
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.It is filled especially for coding
It sets, for electronic equipment, computer readable storage medium and computer program product embodiments, since it is substantially similar to volume
Code embodiment of the method, so being described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (11)
1. a kind of coding method, which is characterized in that the described method includes:
It obtains and carries out encoding obtained first rate distortion costs and coding mode for the first image block in first via video
Information, wherein the first image block is in the multiple images block that the first via video is divided according to default division rule
It is one of;
Using the coding mode information, the second image block in the second road video is encoded, obtains the second rate distortion generation
Valence, wherein the first via video and second road video are the identical video of video content, second image block are as follows:
In the multiple images block that second road video is divided according to the default division rule, with the first image block described the
The identical image block in position in video all the way;
Judge whether second rate distortion costs are greater than rate distortion threshold;
If second rate distortion costs are not more than rate distortion threshold, it is determined that complete the volume for being directed to second image block
Code.
2. being carried out the method according to claim 1, wherein obtaining for the first image block in first via video
Before the step of encoding obtained first rate distortion costs and coding mode information, further includes:
The first image block in the first via video is encoded, corresponding first rate of the first image block is obtained
Distortion cost and coding mode information;
First rate distortion costs and the coding mode information are stored.
3. the method according to claim 1, wherein the rate distortion threshold obtains in the following manner:
By first rate distortion costs multiplied by the first default value, the rate distortion threshold is obtained;Alternatively,
By the product of first rate distortion costs and the second default value, in addition the Lagrange's multiplier of presupposition multiple, obtains
The rate distortion threshold.
4. the method according to claim 1, wherein using the coding mode information, in the second road video
The second image block the step of being encoded, obtaining the second rate distortion costs before, further includes:
The default division rule is obtained, and determines position of the first image block in the first via video after division
It sets;
According to the default division rule, second road video is divided into multiple images block;
It, will the identical image block in position be true in the first via video with the first image block from described multiple images block
It is set to second image block.
5. the method according to claim 1, wherein the method also includes:
If second rate distortion costs are greater than the rate distortion threshold, coding mould preset in preset block encoder is utilized
Formula respectively encodes second image block, and respectively obtains corresponding rate distortion costs;
Select the smallest rate distortion costs from obtained rate distortion costs, and by the corresponding volume of selected rate distortion costs
Pattern is determined as the coding mode encoded to second image block.
6. a kind of code device, which is characterized in that described device includes:
First obtains module, carries out encoding obtained first rate mistake for obtaining the first image block being directed in first via video
True cost and coding mode information, wherein the first image block is that the first via video is divided according to default division rule
Multiple images block in it is one of;
First coding module, for being encoded to the second image block in the second road video using the coding mode information,
Obtain the second rate distortion costs, wherein the first via video and second road video are the identical video of video content, institute
State the second image block are as follows: in the multiple images block that second road video is divided according to the default division rule, with described the
One image block identical image block in position in the first via video;
Judgment module, for judging whether second rate distortion costs are greater than rate distortion threshold;When sentencing for the judgment module
When disconnected result is no, it is determined that complete the coding for being directed to second image block.
7. device according to claim 6, which is characterized in that described device further include:
Second coding module obtains described first for encoding to the first image block in the first via video
Corresponding first rate distortion costs of image block and coding mode information;
Memory module, for storing first rate distortion costs and the coding mode information.
8. device according to claim 6, which is characterized in that the rate distortion threshold obtains in the following manner:
By first rate distortion costs multiplied by the first default value, the rate distortion threshold is obtained;Alternatively,
By the product of first rate distortion costs and the second default value, in addition the Lagrange's multiplier of presupposition multiple, obtains
The rate distortion threshold.
9. device according to claim 6, which is characterized in that described device further include:
Second obtains module, for obtaining the default division rule, and described in determining the first image block after division
Position in first via video;
Division module, for according to the default division rule, second road video to be divided into multiple images block;
Determining module, for from described multiple images block, will with the first image block in the first via video position
Identical image block is determined as second image block.
10. device according to claim 6, which is characterized in that described device further include:
Third coding module utilizes preset block coding if being greater than the rate distortion threshold for second rate distortion costs
Preset coding mode in device respectively encodes second image block, and respectively obtains corresponding rate distortion costs;
Selecting module is lost for selecting the smallest rate distortion costs from obtained rate distortion costs, and by selected rate
The true corresponding coding mode of cost is determined as the coding mode encoded to second image block.
11. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing
Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and step of claim 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811611361.4A CN109660806B (en) | 2018-12-27 | 2018-12-27 | Encoding method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811611361.4A CN109660806B (en) | 2018-12-27 | 2018-12-27 | Encoding method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109660806A true CN109660806A (en) | 2019-04-19 |
CN109660806B CN109660806B (en) | 2021-01-29 |
Family
ID=66117186
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811611361.4A Active CN109660806B (en) | 2018-12-27 | 2018-12-27 | Encoding method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109660806B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110049326A (en) * | 2019-05-28 | 2019-07-23 | 广州酷狗计算机科技有限公司 | Method for video coding and device, storage medium |
CN110177275A (en) * | 2019-05-30 | 2019-08-27 | 广州酷狗计算机科技有限公司 | Method for video coding and device, storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101272498A (en) * | 2008-05-14 | 2008-09-24 | 杭州华三通信技术有限公司 | Video encoding method and device |
US20100080284A1 (en) * | 2008-09-26 | 2010-04-01 | Qualcomm Incorporated | Resolving geometric relationships among video data units |
CN101959067A (en) * | 2010-09-26 | 2011-01-26 | 北京大学 | Decision method and system in rapid coding mode based on epipolar constraint |
CN104320657A (en) * | 2014-10-31 | 2015-01-28 | 中国科学技术大学 | Method for selecting prediction mode of HEVC lossless video coding and corresponding coding method |
-
2018
- 2018-12-27 CN CN201811611361.4A patent/CN109660806B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101272498A (en) * | 2008-05-14 | 2008-09-24 | 杭州华三通信技术有限公司 | Video encoding method and device |
US20100080284A1 (en) * | 2008-09-26 | 2010-04-01 | Qualcomm Incorporated | Resolving geometric relationships among video data units |
CN101959067A (en) * | 2010-09-26 | 2011-01-26 | 北京大学 | Decision method and system in rapid coding mode based on epipolar constraint |
CN104320657A (en) * | 2014-10-31 | 2015-01-28 | 中国科学技术大学 | Method for selecting prediction mode of HEVC lossless video coding and corresponding coding method |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110049326A (en) * | 2019-05-28 | 2019-07-23 | 广州酷狗计算机科技有限公司 | Method for video coding and device, storage medium |
CN110049326B (en) * | 2019-05-28 | 2022-06-28 | 广州酷狗计算机科技有限公司 | Video coding method and device and storage medium |
CN110177275A (en) * | 2019-05-30 | 2019-08-27 | 广州酷狗计算机科技有限公司 | Method for video coding and device, storage medium |
CN110177275B (en) * | 2019-05-30 | 2022-09-30 | 广州酷狗计算机科技有限公司 | Video encoding method and apparatus, and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109660806B (en) | 2021-01-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104717510B (en) | Method and apparatus for image procossing | |
US10834398B2 (en) | Method for dividing prediction block, encoding device, and decoding device | |
CA3027764C (en) | Intra-prediction video coding method and device | |
CN108737841A (en) | Coding unit depth determination method and device | |
CN110971898B (en) | Point cloud coding and decoding method and coder-decoder | |
EP3849188A1 (en) | Point cloud coding method and encoder | |
EP3758373B1 (en) | Video encoding method, electronic device, and storage medium | |
JP2021531548A (en) | Method and device for encoding / decoding point cloud geometry | |
EP3706421A1 (en) | Method and apparatus for video encoding and decoding based on affine motion compensation | |
CN110495178A (en) | The device and method of 3D Video coding | |
CN109660806A (en) | A kind of coding method and device | |
CN109429064A (en) | A kind of method and apparatus handling video data | |
CN110024397A (en) | Method and device for coding video | |
CA3028510C (en) | Bidirectional interframe predictive coding method and device using forward and backward block weighting and block brightness weighting | |
CN104602018B (en) | The acquisition methods and device of the movable information of video data, coding method and device | |
CN111654696B (en) | Intra-frame multi-reference-line prediction method and device, storage medium and terminal | |
CN110324668A (en) | The inverse transform method and device in transform method, decoding in image block coding | |
CN109547788B (en) | Image compression method, equipment and image transmission system | |
CN114157868B (en) | Video frame coding mode screening method and device and electronic equipment | |
CN109640081A (en) | A kind of intra-frame prediction method, encoder, electronic equipment and readable storage medium storing program for executing | |
CN108737836A (en) | A kind of interframe prediction encoding method, device and electronic equipment | |
CN115442617A (en) | Video processing method and device based on video coding | |
US10097838B2 (en) | System and method for depth map coding for smooth depth map area | |
CN109618152A (en) | Depth divides coding method, device and electronic equipment | |
CN112004099B (en) | Intra-frame block copy prediction method and device 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 |