CN105744271A - Video coding method and device - Google Patents

Video coding method and device Download PDF

Info

Publication number
CN105744271A
CN105744271A CN201610089504.4A CN201610089504A CN105744271A CN 105744271 A CN105744271 A CN 105744271A CN 201610089504 A CN201610089504 A CN 201610089504A CN 105744271 A CN105744271 A CN 105744271A
Authority
CN
China
Prior art keywords
macro block
value
code check
video
interest
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
Application number
CN201610089504.4A
Other languages
Chinese (zh)
Other versions
CN105744271B (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201610089504.4A priority Critical patent/CN105744271B/en
Publication of CN105744271A publication Critical patent/CN105744271A/en
Application granted granted Critical
Publication of CN105744271B publication Critical patent/CN105744271B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/134Methods 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/167Position within a video image, e.g. region of interest [ROI]
    • 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/134Methods 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/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods 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

Landscapes

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

Abstract

The invention discloses a video coding method and device. The method comprises the following steps of setting a plurality of regions of interest in a video frame and setting a level value for each region of interest; carrying out first adjustment on quantization parameters QP of macro blocks at the critical points of the adjacent regions of interest with different level values; carrying out second adjustment on the QPs of the macro blocks in the video frame according to the actual encoding rate of the macro blocks in the video frame and the complexity of the encoding mode; and encoding the video frame according to the QP of each macro block after second adjustment to obtain a reconstructed video frame. According to the method, the quality of each region of interest in the video can be simply and effectively adjusted, the quality of the region of interest at each level is improved in various degree, and the quality of the whole video frame cannot be fuzzy.

Description

A kind of method for video coding and device
Technical field
The present invention relates to technical field of video coding, particularly relate to a kind of method for video coding and device.
Background technology
nullIn order to improve the compression efficiency of Video coding,Ensure that Video coding can adapt to the TV signal of high definition simultaneously,Such as satellite、The storage of ground launch and high quality video signal,At H.264/AVC (AdvancedVideoCoding,Advanced video coding) basis on,Video Coding Experts group (VideoCodingExpertsGroup) and ISO (InternationalStandardizationOrganization,ISO)/IEC (InternationalElectrotechnicalCommission,International Electrotechnical Commission) MEPG (MovingPicturesExpertsGroup/MotionPicturesExpertsGroup,Dynamic image expert group) committee combines the united organization having set up Video coding,Formulate HEVC (HighEfficiencyVideoCoding,HD video coding standard),I.e. H.265 standard.HEVC with existing H.264 compared with, on the basis of mixed coding technology, introduced more core technology, achieved breakthrough progress.Relative to H.264, when identical coding quality, it is possible to save encoder bit rate and reach 50%, but the encoder complexity of HEVC will be greater than 150% H.264.In recent years, along with the mankind are to HVS (HumanVisualSystem, human eye visual perception system) deepen continuously understanding, and the extensive use that intelligent video processes, and occurs in that the collision problem between high-resolution requirement and the finite bandwidth of video quality of video.Based on this, Video coding propose based on ROI (RegionOfInterest, area-of-interest) coded method, can according to the area-of-interest of terminal use's actual set, encoder bit rate between reasonable adjusting area-of-interest and regions of non-interest, and change the QP (QuantitativeParameters of area-of-interest and regions of non-interest accordingly, quantization parameter), with the high-quality requirement of this gratification region-of-interest, simultaneously without influence on the subjective quality of whole frame video.
As it is shown in figure 1, a kind of method for video coding schematic diagram based on area-of-interest provided for prior art, the method includes: carry out calculating based on the degree of depth significance of macro block to the depth map of current video frame, it is thus achieved that the degree of depth significance value of each macro block;Degree of depth significance value according to each macro block, and the segmentation standard calculating segmentation threshold of multi-level region-of-interest;According to each segmentation threshold, multi-view point video is split, obtain the video interested region of multiple different stage;Multiple video areas are encoded respectively by the QP of each macro block of rank adjusting according to area-of-interest by the QP after adjusting.In this method, the area-of-interest QP method of adjustment to each different stage is to distribute minimum QP for most interested region, and the QP value in all the other regions is along with area-of-interest rank SLIncrease and increase, i.e. SLIt is worth more big, it was shown that area-of-interest is more lost interest in by human eye.Wherein the minimum code QP in most interested region is original QP, and the QP in all the other regions incrementally increases, specific as follows:
Q P = QP h S L = 1 QP h + ( S L - 1 ) × Δ Q P S L ≥ 1
Wherein QPhBasic QP for present frame, then known prior art does not have to reduce and be most interested in QP partly, but increase the QP in all the other regions, reduce the quality in non-most interested region according to this, the subjective quality making area-of-interest compares better, but does not substantially improve the quality of area-of-interest.
As shown in Figure 2, another offer for prior art is based on the method for video coding schematic diagram of area-of-interest, the method includes: frame of video is divided into ROI and non-ROI region, the ratio according to area-of-interest set in advance, calculates the encoder bit rate obtaining ROI region and non-ROI region;Then judge whether current macro is in area-of-interest, the macro block of area-of-interest enters corresponding rate control algorithm, the macro block of area-of-interest adopts the Rate Control of area-of-interest, and the Rate Control of entrance background area, background area, both Rate Control are separate.This scheme is user configured area-of-interest equally, but only includes two kinds of regions and area-of-interest and background area, and in frame of video, the significance level of each area-of-interest is identical;And this scheme is the encoder bit rate that the ratio according to user configured two kinds of regions calculates two kinds of regions.
Summary of the invention
The embodiment of the present invention provides a kind of method for video coding and device, it is possible to the quality of each area-of-interest in simple efficiently adjustment video, improves the quality of each rank area-of-interest to some extent, and ensures that the quality of whole frame of video will not be smudgy.
The embodiment of the present invention is by the following technical solutions:
First aspect, it is provided that a kind of method for video coding, including:
Multiple semi-cylindrical hills is set in the video frame, and is each area-of-interest degree of establishment value;
The quantization parameter QP of the macro block being in adjacent and that class value is different area-of-interest critical part is carried out the first adjustment;
Complexity according to the actual coding code check of macro block in described frame of video and coding mode, carries out the second adjustment to the QP of the macro block in described frame of video;
After adjusting according to second, the QP of each macro block, is encoded described frame of video, obtains the frame of video rebuild.
Wherein, the QP of the macro block being in adjacent and that class value is different area-of-interest critical part is carried out the first adjustment, specifically includes:
Target macroblock is selected from the macro block being arranged in adjacent and that class value is different area-of-interest critical part;Wherein, described target macroblock meets: described target macroblock is respectively in adjacent and that class value is different area-of-interest from the previous macro block of described target macroblock;
The QP of described target macroblock is carried out the first adjustment.
Wherein, the QP of described target macroblock is carried out the first adjustment, specifically includes:
When the class value of the area-of-interest residing for described target macroblock is higher than the class value of area-of-interest residing for the previous macro block of described target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of described target macroblock, difference by QP less in the current QP of described frame level QP and the previous macro block of described target macroblock with the first adjusted value pre-set, it is determined that the QP after adjusting for described target macroblock first;
When the class value of the area-of-interest residing for described target macroblock is lower than the class value of the area-of-interest residing for the previous macro block of described target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of described target macroblock, by QP bigger in the current QP of described frame level QP and the previous macro block of described target macroblock and the second adjusted value pre-set and value, it is determined that the QP after adjusting for described target macroblock first.
Wherein, according to the actual coding code check of macro block in described frame of video and coding mode complexity, the QP of the macro block in described frame of video is carried out the second adjustment, specifically includes:
According to the coded sequence of macro block in described frame of video, successively each macro block except first macro block is performed:
When described macro block is second macro block in described frame of video, performing the first operation, described first operation includes:
Determine the relevant information of described macro block;Described relevant information includes: the current QP of described macro block, maximum encoder bit rate, minimum code code check, maximum QP and minimum QP;
The coding mode complexity of front n the macro block according to described macro block, it is determined that the QP of described macro block adjusts value of statistical indicant;Wherein, described n is that what pre-set be not less than the integer of 1;
Relation between the actual coding code check of front n the macro block according to described macro block and target code code check, described maximum encoder bit rate and described minimum code code check three, the current QP and described maximum QP of described macro block and described minimum QP relation therebetween, described macro block QP adjust value of statistical indicant, and the 3rd adjusted value pre-set, the current QP of described macro block is carried out the 3rd adjustment;Wherein, the actual coding code check of front n the macro block of described macro block is the meansigma methods of the actual coding code check of each macro block in front n the macro block of described macro block;The target code code check of front n the macro block of described macro block is the meansigma methods of the target code code check of each macro block in front n the macro block of described macro block;
QP after adjusting according to described macro block the 3rd, it is determined that the residual sum coding mode of described macro block;
When described residual error is zero and described coding mode is preset mode, the QP of described macro block is reduced to the initial Q P pre-set, and described initial Q P is defined as the final QP of described macro block;
When described residual error is not zero and/or described coding mode is not described preset mode, the QP after being adjusted by described macro block the 3rd is defined as the final QP of described macro block;
When described macro block is macro block except the first two macro block in described frame of video, it is judged that the final QP of the previous macro block of described macro block be the 3rd adjust after QP or described initial Q P;
When judge the final QP of previous macro block of described macro block be the 3rd adjust after QP time, to described macro block perform described first operation;
When judging that the final QP of previous macro block of described macro block is described initial Q P, performing the second operation, described second operation includes:
Determine the adjustment mode of the QP of the previous macro block of described macro block;Described adjustment mode includes described first and adjusts and described 3rd adjustment;
According to the adjustment mode of QP of the previous macro block of described macro block, the QP of described macro block is adjusted;
QP after adjusting according to described macro block the 3rd, it is determined that the residual sum coding mode of described macro block;
When described residual error is zero and described coding mode is preset mode, the QP of described macro block is reduced to the initial Q P pre-set, and described initial Q P is defined as the final QP of described macro block;
When described residual error is not zero and/or described coding mode is not described preset mode, the QP after being adjusted by described macro block the 3rd is defined as the final QP of described macro block.
Wherein, relation between the actual coding code check of front n the macro block according to described macro block and target code code check, described maximum encoder bit rate and described minimum code code check three, the current QP and described maximum QP of described macro block and described minimum QP relation therebetween, described macro block QP adjust value of statistical indicant, and the 3rd adjusted value pre-set, the current QP of described macro block is carried out the 3rd adjustment, specifically includes:
When the actual coding code check of front n macro block of described macro block is less than described target code code check and more than described minimum code code check, the current QP of described macro block is more than described minimum QP, and described QP adjusts value of statistical indicant when being the first preset value, difference by the current QP of described macro block Yu described 3rd adjusted value, it is determined that the QP after adjusting for described macro block the 3rd;
When the actual coding code check of front n macro block of described macro block is more than described target code code check and less than described maximum encoder bit rate, the current QP of described macro block is less than described maximum QP, and described QP adjusts value of statistical indicant when being the second preset value, by the current QP of described macro block and described 3rd adjusted value and value, it is determined that the QP after adjusting for described macro block the 3rd.
Wherein, the target code code check of each macro block is determined as follows:
Determine the average encoder bit rate of described macro block;
Product by the average encoder bit rate of described macro block Yu the code check weighted value of described macro block, it is determined that for the target code code check of described macro block;Wherein, the code check weighted value of described macro block is the code check weighted value that region residing for described macro block is arranged in advance.
Wherein it is determined that the average encoder bit rate of described macro block, specifically include:
The average encoder bit rate of described macro block is determined according to equation below:
A 0 × a × β 0 + Σ i = 1 m A i × a × β i = B ;
Wherein, a is the average encoder bit rate of described macro block;A0For the area value of regions of non-interest in described frame of video;β0For the code check weighted value arranged for described regions of non-interest in advance;Described i is the rank of area-of-interest in described frame of video;AiIt is the area value of the area-of-interest of i for rank in described frame of video;βiFor the code check weighted value arranged for the area-of-interest that described rank is i in advance;B is the target bit rate of the described frame of video pre-set.
Second aspect, it is provided that a kind of video coding apparatus, including:
Unit is set, for arranging multiple semi-cylindrical hills in the video frame, and is each area-of-interest degree of establishment value;
First adjustment unit, for carrying out the first adjustment to the quantization parameter QP of the macro block being in adjacent and that class value is different area-of-interest critical part;
Second adjustment unit, for the complexity according to the actual coding code check of macro block in described frame of video and coding mode, carries out the second adjustment to the QP of the macro block in described frame of video;
Coding unit, for the QP of each macro block after adjusting according to second, is encoded described frame of video, obtains the frame of video rebuild.
Wherein, described first adjustment unit, specifically include:
Choose module, for selecting target macroblock from the macro block being arranged in adjacent and that class value is different area-of-interest critical part;Wherein, described target macroblock meets: described target macroblock is respectively in adjacent and that class value is different area-of-interest from the previous macro block of described target macroblock;
First adjusting module, for carrying out the first adjustment to the QP of described target macroblock.
Wherein, described first adjusting module, specifically for:
When the class value of the area-of-interest residing for described target macroblock is higher than the class value of area-of-interest residing for the previous macro block of described target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of described target macroblock, difference by QP less in the current QP of described frame level QP and the previous macro block of described target macroblock with the first adjusted value pre-set, it is determined that the QP after adjusting for described target macroblock first;
When the class value of the area-of-interest residing for described target macroblock is lower than the class value of the area-of-interest residing for the previous macro block of described target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of described target macroblock, by QP bigger in the current QP of described frame level QP and the previous macro block of described target macroblock and the second adjusted value pre-set and value, it is determined that the QP after adjusting for described target macroblock first.
Wherein, described second adjustment unit, specifically for:
According to the coded sequence of macro block in described frame of video, successively each macro block except first macro block is performed:
When described macro block is second macro block in described frame of video, performing the first operation, described first operation includes:
Determine the relevant information of described macro block;Described relevant information includes: the current QP of described macro block, maximum encoder bit rate, minimum code code check, maximum QP and minimum QP;
The coding mode complexity of front n the macro block according to described macro block, it is determined that the QP of described macro block adjusts value of statistical indicant;Wherein, described n is that what pre-set be not less than the integer of 1;
Relation between the actual coding code check of front n the macro block according to described macro block and target code code check, described maximum encoder bit rate and described minimum code code check three, the current QP and described maximum QP of described macro block and described minimum QP relation therebetween, described macro block QP adjust value of statistical indicant, and the 3rd adjusted value pre-set, the current QP of described macro block is carried out the 3rd adjustment;Wherein, the actual coding code check of front n the macro block of described macro block is the meansigma methods of the actual coding code check of each macro block in front n the macro block of described macro block;The target code code check of front n the macro block of described macro block is the meansigma methods of the target code code check of each macro block in front n the macro block of described macro block;
QP after adjusting according to described macro block the 3rd, it is determined that the residual sum coding mode of described macro block;
When described residual error is zero and described coding mode is preset mode, the QP of described macro block is reduced to the initial Q P pre-set, and described initial Q P is defined as the final QP of described macro block;
When described residual error is not zero and/or described coding mode is not described preset mode, the QP after being adjusted by described macro block the 3rd is defined as the final QP of described macro block;
When described macro block is macro block except the first two macro block in described frame of video, it is judged that the final QP of the previous macro block of described macro block be the 3rd adjust after QP or described initial Q P;
When judge the final QP of previous macro block of described macro block be the 3rd adjust after QP time, to described macro block perform described first operation;
When judging that the final QP of previous macro block of described macro block is described initial Q P, performing the second operation, described second operation includes:
Determine the adjustment mode of the QP of the previous macro block of described macro block;Described adjustment mode includes described first and adjusts and described 3rd adjustment;
According to the adjustment mode of QP of the previous macro block of described macro block, the QP of described macro block is adjusted;
QP after adjusting according to described macro block the 3rd, it is determined that the residual sum coding mode of described macro block;
When described residual error is zero and described coding mode is preset mode, the QP of described macro block is reduced to the initial Q P pre-set, and described initial Q P is defined as the final QP of described macro block;
When described residual error is not zero and/or described coding mode is not described preset mode, the QP after being adjusted by described macro block the 3rd is defined as the final QP of described macro block.
Wherein, described second adjustment unit, specifically for:
When the actual coding code check of front n macro block of described macro block is less than described target code code check and more than described minimum code code check, the current QP of described macro block is more than described minimum QP, and described QP adjusts value of statistical indicant when being the first preset value, difference by the current QP of described macro block Yu described 3rd adjusted value, it is determined that the QP after adjusting for described macro block the 3rd;
When the actual coding code check of front n macro block of described macro block is more than described target code code check and less than described maximum encoder bit rate, the current QP of described macro block is less than described maximum QP, and described QP adjusts value of statistical indicant when being the second preset value, by the current QP of described macro block and described 3rd adjusted value and value, it is determined that the QP after adjusting for described macro block the 3rd.
Wherein, described device also includes: target code code check determines unit, wherein,
Described target code code check determines unit, specifically includes:
Average encoder bit rate determines module, for determining the average encoder bit rate of described macro block;
Target code code check determines module, for the product by the average encoder bit rate of described macro block with the code check weighted value of described macro block, it is determined that for the target code code check of described macro block;Wherein, the code check weighted value of described macro block is the code check weighted value that region residing for described macro block is arranged in advance.
Wherein, described average encoder bit rate determines module, specifically for:
The average encoder bit rate of described macro block is determined according to equation below:
A 0 × a × β 0 + Σ i = 1 m A i × a × β i = B ;
Wherein, a is the average encoder bit rate of described macro block;A0For the area value of regions of non-interest in described frame of video;β0For the code check weighted value arranged for described regions of non-interest in advance;Described i is the rank of area-of-interest in described frame of video;AiIt is the area value of the area-of-interest of i for rank in described frame of video;βiFor the code check weighted value arranged for the area-of-interest that described rank is i in advance;B is the target bit rate of the described frame of video pre-set.
Having the beneficial effect that of the embodiment of the present invention:
In the embodiment of the present invention, multiple semi-cylindrical hills is set in the video frame, and be each area-of-interest degree of establishment value, first the QP of the macro block being in adjacent and that class value is different area-of-interest critical part is carried out the first adjustment, meet the requirement of coding quality in each rank region with this;Further according to the complexity of the actual coding code check of macro block in frame of video and coding mode, the QP of the macro block in described frame of video is carried out the second adjustment so that the QP of the macro block in the area-of-interest of each rank more conforms to the attribute requirements of video itself;After adjusting finally according to second, the QP of each macro block, is encoded frame of video, obtains the frame of video rebuild.The method can simply efficiently regulate the quality of each area-of-interest in video, improves the quality of each rank area-of-interest to some extent, and ensures that the quality of whole frame of video will not be smudgy.
Accompanying drawing explanation
A kind of method for video coding schematic diagram based on area-of-interest that Fig. 1 provides for prior art;
Fig. 2 provide for prior art another based on the method for video coding schematic diagram of area-of-interest;
The flowchart of a kind of method for video coding that Fig. 3 provides for the embodiment of the present invention;
The structural representation of a kind of video coding apparatus that Fig. 4 provides for the embodiment of the present invention.
Detailed description of the invention
The embodiment of the present invention provides a kind of Video Coding Scheme.In this scenario, multiple semi-cylindrical hills is set in the video frame, and be each area-of-interest degree of establishment value, first the QP of the macro block being in adjacent and that class value is different area-of-interest critical part is carried out the first adjustment, meet the requirement of coding quality in each rank region with this;Further according to the complexity of the actual coding code check of macro block in frame of video and coding mode, the QP of the macro block in described frame of video is carried out the second adjustment so that the QP of the macro block in the area-of-interest of each rank more conforms to the attribute requirements of video itself;After adjusting finally according to second, the QP of each macro block, is encoded frame of video, obtains the frame of video rebuild.The method can simply efficiently regulate the quality of each area-of-interest in video, improves the quality of each rank area-of-interest to some extent, and ensures that the quality of whole frame of video will not be smudgy.
Below in conjunction with Figure of description, embodiments of the invention are illustrated, it will be appreciated that embodiment described herein is merely to illustrate and explains the present invention, is not limited to the present invention.And when not conflicting, embodiment and the feature of embodiment in the present invention can be combined with each other.
Providing a kind of method for video coding in the embodiment of the present invention, as it is shown on figure 3, be the flowchart of the method, the method specifically includes following step:
Step 31, arranges multiple semi-cylindrical hills in the video frame, and is each area-of-interest degree of establishment value.
Wherein, each area-of-interest coordinate in the video frame arbitrarily can be arranged by user.
In the embodiment of the present invention, the class value of area-of-interest is more big, it was shown that the prescription of this area-of-interest is more high, and user's interest level is more high.
If it addition, there is overlapping region between different interest regions, then the class value of overlapping region is the higher value in the class value of this different interest regions.
Step 32, carries out the first adjustment to the QP of the macro block being in adjacent and that class value is different area-of-interest critical part.
Step 32 can be, but not limited to realize as follows:
First, target macroblock is selected from the macro block being arranged in adjacent and that class value is different area-of-interest critical part;Wherein, target macroblock meets: target macroblock is respectively in adjacent and that class value is different area-of-interest from the previous macro block of target macroblock;
Wherein, the previous macro block of involved in embodiment of the present invention target macroblock is for the coded sequence of macro block in frame of video, say, that coded sequence is the previous macro block of target macroblock at the previous macro block of target macroblock.
Again the QP of the target macroblock chosen is carried out the first adjustment.
Concrete, when the class value of the area-of-interest residing for target macroblock is higher than the class value of area-of-interest residing for the previous macro block of target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of target macroblock, difference by QP less in the current QP of frame level QP and the previous macro block of target macroblock with the first adjusted value pre-set, it is determined that the QP after adjusting for target macroblock first;
Concrete, it is possible to determine according to equation below (1) and (2):
QPb1=min (QP0, QP1)(1)
QPc=QPb1–a(2)
Wherein, a represents the first adjusted value being pre-configured with, it is possible to change the size of a value according to actual needs;
QP0For frame level QP;
QP1Current QP for the previous macro block of target macroblock;
QPb1QP less in current QP for frame level QP and the previous macro block of target macroblock;
QPcQP after adjusting for target macroblock first.
When the class value of the area-of-interest residing for target macroblock is lower than the class value of the area-of-interest residing for the previous macro block of target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of target macroblock, by QP bigger in the current QP of frame level QP and the previous macro block of target macroblock and the second adjusted value pre-set and value, it is determined that the QP after adjusting for target macroblock first.
Concrete, it is possible to determine according to equation below (3) and (4):
QPb2=max (QP0, QP1)(3)
QPc=QPb2+b(4)
Wherein, b represents the second adjusted value being pre-configured with, it is possible to change the size of b value according to actual needs;
QP0For frame level QP;
QP1Current QP for the previous macro block of target macroblock;
QPb2QP bigger in current QP for frame level QP and the previous macro block of target macroblock;
QPcQP after adjusting for target macroblock first.
Step 33, the complexity according to the actual coding code check of macro block in frame of video and coding mode, the QP of the macro block in frame of video is carried out the second adjustment.
Concrete, step 33 can be, but not limited to realize as follows:
According to the coded sequence of macro block in frame of video, successively each macro block except first macro block is performed:
1) in the first situation, when macro block is second macro block in frame of video, performing the first operation, the first operation includes:
A, determine the relevant information of this macro block;Relevant information includes: the current QP of this macro block, maximum encoder bit rate, minimum code code check, maximum QP and minimum QP;
Wherein, the current QP of this macro block can be the final QP of the previous macro block of this macro block.When this macro block is second macro block in frame of video, the final QP of the previous macro block of this macro block is initial Q P.
B, coding mode complexity according to front n the macro block of this macro block, it is determined that its QP adjusts value of statistical indicant;Wherein, n is that what pre-set be not less than the integer of 1;
Concrete, the coding mode complexity of front n the macro block of this macro block can be determined according to the meansigma methods of the coding mode complexity of each macro block in front n the macro block of this macro block, and compare with the threshold value T pre-set, if more than T value, then the QP of this macro block adjusts value of statistical indicant and is equal to the first preset value, and such as 1;Otherwise the QP of this macro block adjusts value of statistical indicant and is equal to the second preset value, and such as 0.
C, QP according to the relation between actual coding code check and target code code check, maximum encoder bit rate and the minimum code code check three of front n the macro block of this macro block, the current QP and maximum QP of this macro block and minimum QP relation therebetween, this macro block adjust value of statistical indicant, and the 3rd adjusted value pre-set, the current QP of this macro block is carried out the 3rd adjustment;Wherein, the actual coding code check of front n the macro block of this macro block is the meansigma methods of the actual coding code check of each macro block in front n the macro block of this macro block;The target code code check of front n the macro block of this macro block is the meansigma methods of the target code code check of each macro block in front n the macro block of this macro block;
Wherein, above-mentioned steps c can specifically include:
When the actual coding code check of front n macro block of this macro block is less than target code code check and more than minimum code code check, the current QP of this macro block is more than minimum QP, and QP adjusts value of statistical indicant when being the first preset value, difference by current QP and the three adjusted value of this macro block, it is determined that the QP after adjusting for this macro block the 3rd;
When the actual coding code check of front n macro block of this macro block is more than target code code check and less than maximum encoder bit rate, the current QP of this macro block is less than maximum QP, and QP adjusts value of statistical indicant when being the second preset value, by current QP and the three adjusted value of this macro block and value, it is determined that for this macro block the 3rd adjust after QP.
Wherein, the target code code check of each macro block can be determined as follows:
First, it is determined that the average encoder bit rate of macro block;
Concrete, it is possible to the average encoder bit rate of macro block is determined according to equation below (5):
A 0 × a × β 0 + Σ i = 1 m A i × a × β i = B - - - ( 5 )
Wherein, a is the average encoder bit rate of described macro block;A0For the area value of regions of non-interest in described frame of video;β0For the code check weighted value arranged for described regions of non-interest in advance;Described i is the rank of area-of-interest in described frame of video;AiIt is the area value of the area-of-interest of i for rank in described frame of video;βiFor the code check weighted value arranged for the area-of-interest that described rank is i in advance;B is the target bit rate of the described frame of video pre-set.
In the embodiment of the present invention, for the area-of-interest arranging 8 different stage values, wherein, A1, A2, A3, A4, A5, A6, A7, A8Represent the area value of 8 area-of-interests, A respectively1~A8According to user configured coordinate figure, its value can be obtained.Width and height represents width and height, then the size A of known regions of non-interest of current video frame images respectively0For:
A0=width*height-A1-A2-A3-A4-A5-A6-A7-A8
If the target bit rate that B is a frame (known), β0For the code check weighted value of regions of non-interest, β1~β8Be the code check weighted value of corresponding area-of-interest, then the average encoder bit rate of each macro block, is set to a, then:
A0×a×β0+A1×a×β1+A2×a×β2+…+A8×a×β8=B
Then, by the product of the average encoder bit rate of macro block Yu the code check weighted value of macro block, it is determined that for the target code code check of macro block;Wherein, the code check weighted value of macro block is the code check weighted value that region residing for macro block is arranged in advance.
D, according to this macro block the 3rd adjust after QP, it is determined that the residual sum coding mode of this macro block;
E, when the residual error determined is zero and coding mode is preset mode, the QP of this macro block is reduced to the initial Q P pre-set, and this initial Q P is defined as the final QP of this macro block;
F, when the residual error determined be not zero and/or coding mode not for preset mode time, the QP after being adjusted by this macro block the 3rd is defined as the final QP of this macro block.
2) in the second situation, when macro block is macro block except the first two macro block in frame of video, it is judged that the final QP of the previous macro block of this macro block be the 3rd adjust after QP or initial Q P;
When judge the final QP of previous macro block of this macro block be the 3rd adjust after QP time, to this macro block perform above-mentioned first operation;
When judging that the final QP of previous macro block of this macro block is initial Q P, performing the second operation, the second operation includes:
A, determine the adjustment mode of the QP of the previous macro block of this macro block;Wherein, adjustment mode includes above-mentioned first and adjusts and the 3rd adjustment;
B, the adjustment mode of QP of previous macro block according to this macro block, be adjusted the QP of this macro block;
It should be noted that be not that each macro block can carry out the first adjustment, if therefore the QP of the previous macro block of this macro block had both carried out the first adjustment, carry out again the 3rd adjustment, then the QP of this macro block is also sequentially carried out the first adjustment and the 3rd adjustment;If the QP of the previous macro block of this macro block has only carried out the 3rd adjustment, then the QP of this macro block is also only carried out the 3rd adjustment.
C, according to this macro block the 3rd adjust after QP, it is determined that the residual sum coding mode of this macro block;
D, when determine residual error be zero and coding mode be preset mode time, the QP of this macro block is reduced to the initial Q P pre-set, and initial Q P is defined as the final QP of this macro block;
E, when determine residual error be not zero and/or coding mode not for preset mode time, the QP after being adjusted by this macro block the 3rd is defined as the final QP of this macro block.
Step 34, after adjusting according to second, the QP of each macro block, is encoded described frame of video, obtains the frame of video rebuild.
In the embodiment of the present invention, multiple semi-cylindrical hills is set in the video frame, and be each area-of-interest degree of establishment value, first the QP of the macro block being in adjacent and that class value is different area-of-interest critical part is carried out the first adjustment, meet the requirement of coding quality in each rank region with this;Further according to the complexity of the actual coding code check of macro block in frame of video and coding mode, the QP of the macro block in described frame of video is carried out the second adjustment so that the QP of the macro block in the area-of-interest of each rank more conforms to the attribute requirements of video itself;After adjusting finally according to second, the QP of each macro block, is encoded frame of video, obtains the frame of video rebuild.The method can simply efficiently regulate the quality of each area-of-interest in video, improves the quality of each rank area-of-interest to some extent, and ensures that the quality of whole frame of video will not be smudgy.
Based on same inventive concept, additionally providing a kind of video coding apparatus in the embodiment of the present invention, owing to the principle of said apparatus solution problem is similar to method for video coding, therefore the enforcement of said apparatus may refer to the enforcement of method, repeats part and repeats no more.
As shown in Figure 4, for the structural representation of video coding apparatus that the embodiment of the present invention provides, including:
Unit 41 is set, for arranging multiple semi-cylindrical hills in the video frame, and is each area-of-interest degree of establishment value;
First adjustment unit 42, for carrying out the first adjustment to the quantization parameter QP of the macro block being in adjacent and that class value is different area-of-interest critical part;
Second adjustment unit 43, for the complexity according to the actual coding code check of macro block in described frame of video and coding mode, carries out the second adjustment to the QP of the macro block in described frame of video;
Coding unit 44, for the QP of each macro block after adjusting according to second, is encoded described frame of video, obtains the frame of video rebuild.
Wherein, described first adjustment unit 42, specifically include:
Choose module 421, for selecting target macroblock from the macro block being arranged in adjacent and that class value is different area-of-interest critical part;Wherein, described target macroblock meets: described target macroblock is respectively in adjacent and that class value is different area-of-interest from the previous macro block of described target macroblock;
First adjusting module 422, for carrying out the first adjustment to the QP of described target macroblock.
Wherein, described first adjusting module 422, specifically for:
When the class value of the area-of-interest residing for described target macroblock is higher than the class value of area-of-interest residing for the previous macro block of described target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of described target macroblock, difference by QP less in the current QP of described frame level QP and the previous macro block of described target macroblock with the first adjusted value pre-set, it is determined that the QP after adjusting for described target macroblock first;
When the class value of the area-of-interest residing for described target macroblock is lower than the class value of the area-of-interest residing for the previous macro block of described target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of described target macroblock, by QP bigger in the current QP of described frame level QP and the previous macro block of described target macroblock and the second adjusted value pre-set and value, it is determined that the QP after adjusting for described target macroblock first.
Wherein, described second adjustment unit 43, specifically for:
According to the coded sequence of macro block in described frame of video, successively each macro block except first macro block is performed:
When described macro block is second macro block in described frame of video, performing the first operation, described first operation includes:
Determine the relevant information of described macro block;Described relevant information includes: the current QP of described macro block, maximum encoder bit rate, minimum code code check, maximum QP and minimum QP;
The coding mode complexity of front n the macro block according to described macro block, it is determined that the QP of described macro block adjusts value of statistical indicant;Wherein, described n is that what pre-set be not less than the integer of 1;
Relation between the actual coding code check of front n the macro block according to described macro block and target code code check, described maximum encoder bit rate and described minimum code code check three, the current QP and described maximum QP of described macro block and described minimum QP relation therebetween, described macro block QP adjust value of statistical indicant, and the 3rd adjusted value pre-set, the current QP of described macro block is carried out the 3rd adjustment;Wherein, the actual coding code check of front n the macro block of described macro block is the meansigma methods of the actual coding code check of each macro block in front n the macro block of described macro block;The target code code check of front n the macro block of described macro block is the meansigma methods of the target code code check of each macro block in front n the macro block of described macro block;
QP after adjusting according to described macro block the 3rd, it is determined that the residual sum coding mode of described macro block;
When described residual error is zero and described coding mode is preset mode, the QP of described macro block is reduced to the initial Q P pre-set, and described initial Q P is defined as the final QP of described macro block;
When described residual error is not zero and/or described coding mode is not described preset mode, the QP after being adjusted by described macro block the 3rd is defined as the final QP of described macro block;
When described macro block is macro block except the first two macro block in described frame of video, it is judged that the final QP of the previous macro block of described macro block be the 3rd adjust after QP or described initial Q P;
When judge the final QP of previous macro block of described macro block be the 3rd adjust after QP time, to described macro block perform described first operation;
When judging that the final QP of previous macro block of described macro block is described initial Q P, performing the second operation, described second operation includes:
Determine the adjustment mode of the QP of the previous macro block of described macro block;Described adjustment mode includes described first and adjusts and described 3rd adjustment;
According to the adjustment mode of QP of the previous macro block of described macro block, the QP of described macro block is adjusted;
QP after adjusting according to described macro block the 3rd, it is determined that the residual sum coding mode of described macro block;
When described residual error is zero and described coding mode is preset mode, the QP of described macro block is reduced to the initial Q P pre-set, and described initial Q P is defined as the final QP of described macro block;
When described residual error is not zero and/or described coding mode is not described preset mode, the QP after being adjusted by described macro block the 3rd is defined as the final QP of described macro block.
Wherein, described second adjustment unit 43, specifically for:
When the actual coding code check of front n macro block of described macro block is less than described target code code check and more than described minimum code code check, the current QP of described macro block is more than described minimum QP, and described QP adjusts value of statistical indicant when being the first preset value, difference by the current QP of described macro block Yu described 3rd adjusted value, it is determined that the QP after adjusting for described macro block the 3rd;
When the actual coding code check of front n macro block of described macro block is more than described target code code check and less than described maximum encoder bit rate, the current QP of described macro block is less than described maximum QP, and described QP adjusts value of statistical indicant when being the second preset value, by the current QP of described macro block and described 3rd adjusted value and value, it is determined that the QP after adjusting for described macro block the 3rd.
Wherein, described device also includes: target code code check determines unit 45, wherein,
Described target code code check determines unit 45, specifically includes:
Average encoder bit rate determines module 451, for determining the average encoder bit rate of described macro block;
Target code code check determines module 452, for the product by the average encoder bit rate of described macro block with the code check weighted value of described macro block, it is determined that for the target code code check of described macro block;Wherein, the code check weighted value of described macro block is the code check weighted value that region residing for described macro block is arranged in advance.
Wherein, described average encoder bit rate determines module 451, specifically for:
The average encoder bit rate of described macro block is determined according to equation below:
A 0 × a × β 0 + Σ i = 1 m A i × a × β i = B ;
Wherein, a is the average encoder bit rate of described macro block;A0For the area value of regions of non-interest in described frame of video;β0For the code check weighted value arranged for described regions of non-interest in advance;Described i is the rank of area-of-interest in described frame of video;AiIt is the area value of the area-of-interest of i for rank in described frame of video;βiFor the code check weighted value arranged for the area-of-interest that described rank is i in advance;B is the target bit rate of the described frame of video pre-set.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, complete software implementation or the embodiment in conjunction with software and hardware aspect.And, the present invention can adopt the form at one or more upper computer programs implemented of computer-usable storage medium (including but not limited to disk memory, CD-ROM, optical memory etc.) wherein including computer usable program code.
The present invention is that flow chart and/or block diagram with reference to method according to embodiments of the present invention, equipment (system) and computer program describe.It should be understood that can by the combination of the flow process in each flow process in computer program instructions flowchart and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can be provided to produce a machine to the processor of general purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device so that the instruction performed by the processor of computer or other programmable data processing device is produced for realizing the device of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and can guide in the computer-readable memory that computer or other programmable data processing device work in a specific way, the instruction making to be stored in this computer-readable memory produces to include the manufacture of command device, and this command device realizes the function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices provides for realizing the step of function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame.
Although preferred embodiments of the present invention have been described, but those skilled in the art are once know basic creative concept, then these embodiments can be made other change and amendment.So, claims are intended to be construed to include preferred embodiment and fall into all changes and the amendment of the scope of the invention.
Obviously, the present invention can be carried out various change and modification without deviating from the spirit and scope of the present invention by those skilled in the art.So, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (14)

1. a method for video coding, it is characterised in that including:
Multiple semi-cylindrical hills is set in the video frame, and is each area-of-interest degree of establishment value;
The quantization parameter QP of the macro block being in adjacent and that class value is different area-of-interest critical part is carried out the first adjustment;
Complexity according to the actual coding code check of macro block in described frame of video and coding mode, carries out the second adjustment to the QP of the macro block in described frame of video;
After adjusting according to second, the QP of each macro block, is encoded described frame of video, obtains the frame of video rebuild.
2. the method for claim 1, it is characterised in that the QP of the macro block being in adjacent and that class value is different area-of-interest critical part is carried out the first adjustment, specifically includes:
Target macroblock is selected from the macro block being arranged in adjacent and that class value is different area-of-interest critical part;Wherein, described target macroblock meets: described target macroblock is respectively in adjacent and that class value is different area-of-interest from the previous macro block of described target macroblock;
The QP of described target macroblock is carried out the first adjustment.
3. method as claimed in claim 2, it is characterised in that the QP of described target macroblock is carried out the first adjustment, specifically includes:
When the class value of the area-of-interest residing for described target macroblock is higher than the class value of area-of-interest residing for the previous macro block of described target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of described target macroblock, difference by QP less in the current QP of described frame level QP and the previous macro block of described target macroblock with the first adjusted value pre-set, it is determined that the QP after adjusting for described target macroblock first;
When the class value of the area-of-interest residing for described target macroblock is lower than the class value of the area-of-interest residing for the previous macro block of described target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of described target macroblock, by QP bigger in the current QP of described frame level QP and the previous macro block of described target macroblock and the second adjusted value pre-set and value, it is determined that the QP after adjusting for described target macroblock first.
4. the method for claim 1, it is characterised in that according to the actual coding code check of macro block in described frame of video and coding mode complexity, the QP of the macro block in described frame of video is carried out the second adjustment, specifically includes:
According to the coded sequence of macro block in described frame of video, successively each macro block except first macro block is performed:
When described macro block is second macro block in described frame of video, performing the first operation, described first operation includes:
Determine the relevant information of described macro block;Described relevant information includes: the current QP of described macro block, maximum encoder bit rate, minimum code code check, maximum QP and minimum QP;
The coding mode complexity of front n the macro block according to described macro block, it is determined that the QP of described macro block adjusts value of statistical indicant;Wherein, described n is that what pre-set be not less than the integer of 1;
Relation between the actual coding code check of front n the macro block according to described macro block and target code code check, described maximum encoder bit rate and described minimum code code check three, the current QP and described maximum QP of described macro block and described minimum QP relation therebetween, described macro block QP adjust value of statistical indicant, and the 3rd adjusted value pre-set, the current QP of described macro block is carried out the 3rd adjustment;Wherein, the actual coding code check of front n the macro block of described macro block is the meansigma methods of the actual coding code check of each macro block in front n the macro block of described macro block;The target code code check of front n the macro block of described macro block is the meansigma methods of the target code code check of each macro block in front n the macro block of described macro block;
QP after adjusting according to described macro block the 3rd, it is determined that the residual sum coding mode of described macro block;
When described residual error is zero and described coding mode is preset mode, the QP of described macro block is reduced to the initial Q P pre-set, and described initial Q P is defined as the final QP of described macro block;
When described residual error is not zero and/or described coding mode is not described preset mode, the QP after being adjusted by described macro block the 3rd is defined as the final QP of described macro block;
When described macro block is macro block except the first two macro block in described frame of video, it is judged that the final QP of the previous macro block of described macro block be the 3rd adjust after QP or described initial Q P;
When judge the final QP of previous macro block of described macro block be the 3rd adjust after QP time, to described macro block perform described first operation;
When judging that the final QP of previous macro block of described macro block is described initial Q P, performing the second operation, described second operation includes:
Determine the adjustment mode of the QP of the previous macro block of described macro block;Described adjustment mode includes described first and adjusts and described 3rd adjustment;
According to the adjustment mode of QP of the previous macro block of described macro block, the QP of described macro block is adjusted;
QP after adjusting according to described macro block the 3rd, it is determined that the residual sum coding mode of described macro block;
When described residual error is zero and described coding mode is preset mode, the QP of described macro block is reduced to the initial Q P pre-set, and described initial Q P is defined as the final QP of described macro block;
When described residual error is not zero and/or described coding mode is not described preset mode, the QP after being adjusted by described macro block the 3rd is defined as the final QP of described macro block.
5. method as claimed in claim 4, it is characterized in that, relation between the actual coding code check of front n the macro block according to described macro block and target code code check, described maximum encoder bit rate and described minimum code code check three, the current QP and described maximum QP of described macro block and described minimum QP relation therebetween, described macro block QP adjust value of statistical indicant, and the 3rd adjusted value pre-set, the current QP of described macro block is carried out the 3rd adjustment, specifically includes:
When the actual coding code check of front n macro block of described macro block is less than described target code code check and more than described minimum code code check, the current QP of described macro block is more than described minimum QP, and described QP adjusts value of statistical indicant when being the first preset value, difference by the current QP of described macro block Yu described 3rd adjusted value, it is determined that the QP after adjusting for described macro block the 3rd;
When the actual coding code check of front n macro block of described macro block is more than described target code code check and less than described maximum encoder bit rate, the current QP of described macro block is less than described maximum QP, and described QP adjusts value of statistical indicant when being the second preset value, by the current QP of described macro block and described 3rd adjusted value and value, it is determined that the QP after adjusting for described macro block the 3rd.
6. method as claimed in claim 4, it is characterised in that the target code code check of each macro block is determined as follows:
Determine the average encoder bit rate of described macro block;
Product by the average encoder bit rate of described macro block Yu the code check weighted value of described macro block, it is determined that for the target code code check of described macro block;Wherein, the code check weighted value of described macro block is the code check weighted value that region residing for described macro block is arranged in advance.
7. method as claimed in claim 6, it is characterised in that determine the average encoder bit rate of described macro block, specifically include:
The average encoder bit rate of described macro block is determined according to equation below:
A 0 × a × β 0 + Σ i = 1 m A i × a × β i = B ;
Wherein, a is the average encoder bit rate of described macro block;A0For the area value of regions of non-interest in described frame of video;β0For the code check weighted value arranged for described regions of non-interest in advance;Described i is the rank of area-of-interest in described frame of video;AiIt is the area value of the area-of-interest of i for rank in described frame of video;βiFor the code check weighted value arranged for the area-of-interest that described rank is i in advance;B is the target bit rate of the described frame of video pre-set.
8. a video coding apparatus, it is characterised in that including:
Unit is set, for arranging multiple semi-cylindrical hills in the video frame, and is each area-of-interest degree of establishment value;
First adjustment unit, for carrying out the first adjustment to the quantization parameter QP of the macro block being in adjacent and that class value is different area-of-interest critical part;
Second adjustment unit, for the complexity according to the actual coding code check of macro block in described frame of video and coding mode, carries out the second adjustment to the QP of the macro block in described frame of video;
Coding unit, for the QP of each macro block after adjusting according to second, is encoded described frame of video, obtains the frame of video rebuild.
9. device as claimed in claim 8, it is characterised in that described first adjustment unit, specifically includes:
Choose module, for selecting target macroblock from the macro block being arranged in adjacent and that class value is different area-of-interest critical part;Wherein, described target macroblock meets: described target macroblock is respectively in adjacent and that class value is different area-of-interest from the previous macro block of described target macroblock;
First adjusting module, for carrying out the first adjustment to the QP of described target macroblock.
10. device as claimed in claim 9, it is characterised in that described first adjusting module, specifically for:
When the class value of the area-of-interest residing for described target macroblock is higher than the class value of area-of-interest residing for the previous macro block of described target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of described target macroblock, difference by QP less in the current QP of described frame level QP and the previous macro block of described target macroblock with the first adjusted value pre-set, it is determined that the QP after adjusting for described target macroblock first;
When the class value of the area-of-interest residing for described target macroblock is lower than the class value of the area-of-interest residing for the previous macro block of described target macroblock, the frame level QP relatively pre-set and the current QP of the previous macro block of described target macroblock, by QP bigger in the current QP of described frame level QP and the previous macro block of described target macroblock and the second adjusted value pre-set and value, it is determined that the QP after adjusting for described target macroblock first.
11. device as claimed in claim 8, it is characterised in that described second adjustment unit, specifically for:
According to the coded sequence of macro block in described frame of video, successively each macro block except first macro block is performed:
When described macro block is second macro block in described frame of video, performing the first operation, described first operation includes:
Determine the relevant information of described macro block;Described relevant information includes: the current QP of described macro block, maximum encoder bit rate, minimum code code check, maximum QP and minimum QP;
The coding mode complexity of front n the macro block according to described macro block, it is determined that the QP of described macro block adjusts value of statistical indicant;Wherein, described n is that what pre-set be not less than the integer of 1;
Relation between the actual coding code check of front n the macro block according to described macro block and target code code check, described maximum encoder bit rate and described minimum code code check three, the current QP and described maximum QP of described macro block and described minimum QP relation therebetween, described macro block QP adjust value of statistical indicant, and the 3rd adjusted value pre-set, the current QP of described macro block is carried out the 3rd adjustment;Wherein, the actual coding code check of front n the macro block of described macro block is the meansigma methods of the actual coding code check of each macro block in front n the macro block of described macro block;The target code code check of front n the macro block of described macro block is the meansigma methods of the target code code check of each macro block in front n the macro block of described macro block;
QP after adjusting according to described macro block the 3rd, it is determined that the residual sum coding mode of described macro block;
When described residual error is zero and described coding mode is preset mode, the QP of described macro block is reduced to the initial Q P pre-set, and described initial Q P is defined as the final QP of described macro block;
When described residual error is not zero and/or described coding mode is not described preset mode, the QP after being adjusted by described macro block the 3rd is defined as the final QP of described macro block;
When described macro block is macro block except the first two macro block in described frame of video, it is judged that the final QP of the previous macro block of described macro block be the 3rd adjust after QP or described initial Q P;
When judge the final QP of previous macro block of described macro block be the 3rd adjust after QP time, to described macro block perform described first operation;
When judging that the final QP of previous macro block of described macro block is described initial Q P, performing the second operation, described second operation includes:
Determine the adjustment mode of the QP of the previous macro block of described macro block;Described adjustment mode includes described first and adjusts and described 3rd adjustment;
According to the adjustment mode of QP of the previous macro block of described macro block, the QP of described macro block is adjusted;
QP after adjusting according to described macro block the 3rd, it is determined that the residual sum coding mode of described macro block;
When described residual error is zero and described coding mode is preset mode, the QP of described macro block is reduced to the initial Q P pre-set, and described initial Q P is defined as the final QP of described macro block;
When described residual error is not zero and/or described coding mode is not described preset mode, the QP after being adjusted by described macro block the 3rd is defined as the final QP of described macro block.
12. device as claimed in claim 11, it is characterised in that described second adjustment unit, specifically for:
When the actual coding code check of front n macro block of described macro block is less than described target code code check and more than described minimum code code check, the current QP of described macro block is more than described minimum QP, and described QP adjusts value of statistical indicant when being the first preset value, difference by the current QP of described macro block Yu described 3rd adjusted value, it is determined that the QP after adjusting for described macro block the 3rd;
When the actual coding code check of front n macro block of described macro block is more than described target code code check and less than described maximum encoder bit rate, the current QP of described macro block is less than described maximum QP, and described QP adjusts value of statistical indicant when being the second preset value, by the current QP of described macro block and described 3rd adjusted value and value, it is determined that the QP after adjusting for described macro block the 3rd.
13. device as claimed in claim 11, it is characterised in that described device also includes: target code code check determines unit, wherein,
Described target code code check determines unit, specifically includes:
Average encoder bit rate determines module, for determining the average encoder bit rate of described macro block;
Target code code check determines module, for the product by the average encoder bit rate of described macro block with the code check weighted value of described macro block, it is determined that for the target code code check of described macro block;Wherein, the code check weighted value of described macro block is the code check weighted value that region residing for described macro block is arranged in advance.
14. device as claimed in claim 13, it is characterised in that described average encoder bit rate determines module, specifically for:
The average encoder bit rate of described macro block is determined according to equation below:
A 0 × a × β 0 + Σ i = 1 m A i × a × β i = B ;
Wherein, a is the average encoder bit rate of described macro block;A0For the area value of regions of non-interest in described frame of video;β0For the code check weighted value arranged for described regions of non-interest in advance;Described i is the rank of area-of-interest in described frame of video;AiIt is the area value of the area-of-interest of i for rank in described frame of video;βiFor the code check weighted value arranged for the area-of-interest that described rank is i in advance;B is the target bit rate of the described frame of video pre-set.
CN201610089504.4A 2016-02-17 2016-02-17 A kind of method for video coding and device Active CN105744271B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610089504.4A CN105744271B (en) 2016-02-17 2016-02-17 A kind of method for video coding and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610089504.4A CN105744271B (en) 2016-02-17 2016-02-17 A kind of method for video coding and device

Publications (2)

Publication Number Publication Date
CN105744271A true CN105744271A (en) 2016-07-06
CN105744271B CN105744271B (en) 2018-06-26

Family

ID=56245258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610089504.4A Active CN105744271B (en) 2016-02-17 2016-02-17 A kind of method for video coding and device

Country Status (1)

Country Link
CN (1) CN105744271B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109391757A (en) * 2017-08-09 2019-02-26 佳能株式会社 Information processing unit, information processing method and storage medium
CN110062230A (en) * 2019-04-29 2019-07-26 湖南国科微电子股份有限公司 Image encoding method and device
CN111034184A (en) * 2017-08-29 2020-04-17 连株式会社 Improving video quality of video calls
CN111918066A (en) * 2020-09-08 2020-11-10 北京字节跳动网络技术有限公司 Video encoding method, device, equipment and storage medium
WO2020243906A1 (en) * 2019-06-04 2020-12-10 SZ DJI Technology Co., Ltd. Method, device, and storage medium for encoding video data base on regions of interests
CN112070718A (en) * 2020-08-06 2020-12-11 北京博雅慧视智能技术研究院有限公司 Method and device for determining regional quantization parameter, storage medium and terminal
CN113011210A (en) * 2019-12-19 2021-06-22 北京百度网讯科技有限公司 Video processing method and device
CN113489993A (en) * 2021-07-22 2021-10-08 Oppo广东移动通信有限公司 Encoding method, apparatus, encoder, device, and computer-readable storage medium
CN114501015A (en) * 2022-04-06 2022-05-13 杭州未名信科科技有限公司 Video coding rate processing method and device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202912A (en) * 2007-11-30 2008-06-18 上海广电(集团)有限公司中央研究院 Method for controlling balanced code rate and picture quality code rate
CN102685491A (en) * 2012-03-02 2012-09-19 中兴通讯股份有限公司 Method and system for realizing video coding
US8897365B2 (en) * 2008-11-19 2014-11-25 Nvidia Corporation Video rate control processor for a video encoding process

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101202912A (en) * 2007-11-30 2008-06-18 上海广电(集团)有限公司中央研究院 Method for controlling balanced code rate and picture quality code rate
US8897365B2 (en) * 2008-11-19 2014-11-25 Nvidia Corporation Video rate control processor for a video encoding process
CN102685491A (en) * 2012-03-02 2012-09-19 中兴通讯股份有限公司 Method and system for realizing video coding

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11012624B2 (en) 2017-08-09 2021-05-18 Canon Kabushiki Kaisha Information processing apparatus, information processing method, and storage medium for determining whether to perform preprocessing to exclude setting information related to an image
CN109391757A (en) * 2017-08-09 2019-02-26 佳能株式会社 Information processing unit, information processing method and storage medium
US11223662B2 (en) 2017-08-29 2022-01-11 Line Corporation Method, system, and non-transitory computer readable record medium for enhancing video quality of video call
CN111034184A (en) * 2017-08-29 2020-04-17 连株式会社 Improving video quality of video calls
CN110062230A (en) * 2019-04-29 2019-07-26 湖南国科微电子股份有限公司 Image encoding method and device
CN110062230B (en) * 2019-04-29 2022-03-25 湖南国科微电子股份有限公司 Image coding method and device
WO2020243906A1 (en) * 2019-06-04 2020-12-10 SZ DJI Technology Co., Ltd. Method, device, and storage medium for encoding video data base on regions of interests
CN113011210A (en) * 2019-12-19 2021-06-22 北京百度网讯科技有限公司 Video processing method and device
CN113011210B (en) * 2019-12-19 2022-09-16 北京百度网讯科技有限公司 Video processing method and device
US11659181B2 (en) 2019-12-19 2023-05-23 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for determining region of interest
CN112070718A (en) * 2020-08-06 2020-12-11 北京博雅慧视智能技术研究院有限公司 Method and device for determining regional quantization parameter, storage medium and terminal
CN111918066A (en) * 2020-09-08 2020-11-10 北京字节跳动网络技术有限公司 Video encoding method, device, equipment and storage medium
CN111918066B (en) * 2020-09-08 2022-03-15 北京字节跳动网络技术有限公司 Video encoding method, device, equipment and storage medium
CN113489993A (en) * 2021-07-22 2021-10-08 Oppo广东移动通信有限公司 Encoding method, apparatus, encoder, device, and computer-readable storage medium
CN114501015B (en) * 2022-04-06 2022-09-02 杭州未名信科科技有限公司 Video coding rate processing method and device, storage medium and electronic equipment
CN114501015A (en) * 2022-04-06 2022-05-13 杭州未名信科科技有限公司 Video coding rate processing method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN105744271B (en) 2018-06-26

Similar Documents

Publication Publication Date Title
CN105744271A (en) Video coding method and device
CN1164123C (en) Quantization process for video encoding
US10237576B2 (en) 3D-HEVC depth video information hiding method based on single-depth intra mode
CN101888566B (en) Estimation method of distortion performance of stereo video encoding rate
CN111432210B (en) Point cloud attribute compression method based on filling
CN104469386B (en) A kind of perception method for encoding stereo video of the proper appreciable error model based on DOF
CN105898565A (en) Video processing method and device
CN107222748B (en) The treating method and apparatus of image data code rate
CN103179405A (en) Multi-stage area-of-interest-based multi-view video coding method
CN101374242A (en) Depth map encoding compression method for 3DTV and FTV system
CN113038127B (en) ROI-based real-time video multi-path parallel transmission code rate control method
CN104378636A (en) Video image coding method and device
CN104994382A (en) Optimization method for sensing rate distortion
CN104811730B (en) A kind of texture analysis of video image intraframe coding unit and coding unit system of selection
CN103414889B (en) A kind of method for controlling three-dimensional video code rates based on the proper discernable distortion of binocular
CN103391439A (en) H.264/AVC code rate control method based on active macroblock concealment
CN110677644A (en) Video coding and decoding method and video coding intra-frame predictor
DE69835431T2 (en) PICTURE CODING AND DECODING METHOD AND DEVICE
CN105812824B (en) A kind of video encoding method and device
CN102281434B (en) Video compression method and equipment
CN102685491A (en) Method and system for realizing video coding
CN105141967A (en) Fast adaptive loop filter algorithm based on just noticeable distortion (JND) model
CN105007494A (en) Intra-frame wedge-shaped segmentation mode selection method of 3D video depth image model mode
EP2890124A1 (en) Coding method and device applied to hevc-based 3dvc
CN104581157A (en) JPEG 2000 area-of-interest coding method based on pre-truncation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant