CN110784713B - Coding and decoding method capable of changing effective image size - Google Patents
Coding and decoding method capable of changing effective image size Download PDFInfo
- Publication number
- CN110784713B CN110784713B CN201911286945.3A CN201911286945A CN110784713B CN 110784713 B CN110784713 B CN 110784713B CN 201911286945 A CN201911286945 A CN 201911286945A CN 110784713 B CN110784713 B CN 110784713B
- Authority
- CN
- China
- Prior art keywords
- coding
- image size
- effective image
- frame
- decoding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
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/172—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 picture, frame or field
-
- 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/44—Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention discloses a coding and decoding method with variable effective image size. The method specifically comprises the following steps: (1) in the encoder: analyzing the complexity of each frame of the file, segmenting the file according to the complexity, evaluating the size of an effective image suitable for each segment, writing the effective image into a configuration file, determining whether the image is reset or not according to the frame level width setting in the configuration file by a reset module, wherein a coding core is responsible for coding, and a code stream synthesizer packs the video stream from the coding core and the information of an effective area of the image into a final video stream for output; (2) in the decoder: the video stream analyzer analyzes whether the current frame carries effective image size information or not, the decoding kernel is responsible for decoding, and the Resize module determines whether to Resize or not according to the effective image size and the video coding image size. The invention has the beneficial effects that: the size of the coded image is not changed, the viewing effect is guaranteed, the method is suitable for any coder and decoder kernel, the coder and decoder kernel is not affected, and the stability of the coder and decoder kernel is guaranteed.
Description
Technical Field
The present invention relates to the field of video processing technologies, and in particular, to a method for encoding and decoding a variable effective image size.
Background
In practical application, the encoder is set with a fixed image size, a fixed code rate or a maximum code rate, which causes poor quality of a complex section in a video, and a plurality of blocks appear to influence viewing. Viewing may be improved if the complex segment is encoded with a smaller encoded picture size, but the same video, changes in encoded picture size will require the encoder and decoder to delete, reconstruct, which will make the encoder and decoder likely to be unstable and potentially stuttered when played, especially with hardware encoders and decoders (NVidia codec creation sometimes takes more than 2-3 seconds).
Disclosure of Invention
The present invention provides a coding and decoding method with variable effective image size and good stability to overcome the above-mentioned defects in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
a variable effective image size coding and decoding method specifically comprises the following steps:
(1) in the encoder: analyzing the complexity of each frame of the file, segmenting the file according to the complexity, evaluating the size of an effective image suitable for each segment, writing the effective image into a configuration file, determining whether the image is reset or not according to the frame level width setting in the configuration file by a reset module, wherein a coding core is responsible for coding, and a code stream synthesizer packs the video stream from the coding core and the information of an effective area of the image into a final video stream for output;
(2) in the decoder: the video stream analyzer analyzes whether the current frame carries effective image size information or not, the decoding kernel is responsible for decoding, and the Resize module determines whether to Resize or not according to the effective image size and the video coding image size.
The encoder changes the size of an effective image and fills black in an invalid area in a video at a complex section, so that the size of the encoded image is not changed, the viewing effect is ensured, the encoder is suitable for any codec kernel, the encoder and the decoder kernel are not influenced, and the stability of the encoder and the decoder kernel is ensured. The codec can also be used in other applications where it is desirable to change the effective image size, such as network real-time transcoding or real-time communication applications.
Preferably, in step (1), the specific steps of encoding are as follows:
(11) starting coding of a frame, reading a configuration file, judging whether the current frame has information setting of effective image size change according to frame level width setting in the configuration file, and directly entering the next step if the current frame does not have information setting of effective image size change; if yes, updating the effective image size for the current frame, and then entering the next step;
(12) judging whether the effective image size is equal to the coding image size, if so, directly continuing coding in a coding kernel, and then entering the next step; if not, the image frame Resize is adjusted to the effective image size through a Resize module, the upper left corner of a memory of the coded image is placed, other areas of the memory of the coded image are filled with black, then the memory of the coded image is sent to a coding kernel, the coding kernel codes the frame into an IDR frame, codes the frame in an IDR frame type, and then the next step is carried out;
(13) judging whether the effective image size of the current frame is updated or not, and if not, outputting a code stream given by a coding kernel by a code stream synthesizer; and if the video coding rate is updated, the effective image size information is packed according to the user _ data _ unregistered format of sei in the HEVC, and the code stream synthesizer packs the coding core output code stream and the effective image size information into a new video code rate for output.
Preferably, in step (11), the frame level width setting method in the configuration file is as follows:
firstly, transcoding is configured by self-adaption of a fixed Qp scene and IDR frames, and after the transcoding is completed, the average pixel compression ratio bpp of all frames between two IDR frames and the average pixel compression ratio bitrate _ bpp of a given code rate are calculated;
if the bitrate _ bpp is more than or equal to the bpp, the original height and width are adopted;
if bpp > bitrate _ bpp is more than or equal to 0.5 bpp, the height of the effective image is unchanged, and the width adopts a new width:
if bitrate _ bpp <0.5 bpp, the height and width of the effective image all need to be new, new width:
new_width = (old_width/2+15)/16*16
the new height is as follows:
preferably, in step (2), the specific steps of decoding are as follows:
(21) when the decoding of a frame starts, a video stream analyzer analyzes the code stream, checks whether the video frame has effective image size information, if so, updates the effective image size information, and enters a decoding kernel; if not, directly entering a decoding kernel;
(22) the decoding kernel carries out decoding operation;
(23) judging whether the effective image size is consistent with the coding image size, if not, resetting the image with the effective image size to the coding image size through a reset module, and outputting a video image; and if the video images are consistent, directly outputting the video images.
The invention has the beneficial effects that: the size of the coded image is not changed, the viewing effect is guaranteed, the method is suitable for any coder and decoder kernel, the coder and decoder kernel is not affected, and the stability of the coder and decoder kernel is guaranteed.
Drawings
FIG. 1 is a diagram of the coding framework of the present invention;
FIG. 2 is a flow chart of the encoding of the present invention;
FIG. 3 is a decoding framework of the present invention;
fig. 4 is a decoding flow diagram of the present invention.
Detailed Description
The invention is further described with reference to the following figures and detailed description.
A variable effective image size coding and decoding method specifically comprises the following steps:
(1) in the encoder: analyzing the complexity of each frame of the file, segmenting the file according to the complexity, evaluating the size of an effective image suitable for each segment, writing the effective image into a configuration file, determining whether the image is reset or not according to the frame level width setting in the configuration file by a reset module, wherein a coding core is responsible for coding, and a code stream synthesizer packs video streams coming out of the coding core and information of an effective area of the image into final video streams to be output, as shown in FIG. 1;
as shown in fig. 2, the specific steps of encoding are as follows:
(11) starting coding of a frame, reading a configuration file, judging whether the current frame has information setting of effective image size change according to frame level width setting in the configuration file, and directly entering the next step if the current frame does not have information setting of effective image size change; if yes, updating the effective image size for the current frame, and then entering the next step;
the frame level high-width setting method in the configuration file is as follows:
firstly, transcoding is configured by self-adaption of a fixed Qp scene and IDR frames, and after the transcoding is completed, the average pixel compression ratio bpp of all frames between two IDR frames and the average pixel compression ratio bitrate _ bpp of a given code rate are calculated;
if the bitrate _ bpp is more than or equal to the bpp, the original height and width are adopted;
if bpp > bitrate _ bpp is more than or equal to 0.5 bpp, the height of the effective image is unchanged, and the width adopts a new width:
if bitrate _ bpp <0.5 bpp, the height and width of the effective image all need to be new, new width:
new_width = (old_width/2+15)/16*16
the new height is as follows:
(12) judging whether the effective image size is equal to the coding image size, if so, directly continuing coding in a coding kernel, and then entering the next step; if not, the image frame Resize is adjusted to the effective image size through a Resize module, the upper left corner of a memory of the coded image is placed, other areas of the memory of the coded image are filled with black, then the memory of the coded image is sent to a coding kernel, the coding kernel codes the frame into an IDR frame, codes the frame in an IDR frame type, and then the next step is carried out;
(13) judging whether the effective image size of the current frame is updated or not, and if not, outputting a code stream given by a coding kernel by a code stream synthesizer; and if the video coding rate is updated, the effective image size information is packed according to the user _ data _ unregistered format of sei in the HEVC, and the code stream synthesizer packs the coding core output code stream and the effective image size information into a new video code rate for output.
(2) In the decoder: the video stream analyzer analyzes whether the current frame carries effective image size information or not, a decoding kernel is responsible for decoding, and a Resize module determines whether Resize or not according to the effective image size and the video coding image size, as shown in fig. 3;
as shown in fig. 4, the specific steps of decoding are as follows:
(21) when the decoding of a frame starts, a video stream analyzer analyzes the code stream, checks whether the video frame has effective image size information, if so, updates the effective image size information, and enters a decoding kernel; if not, directly entering a decoding kernel;
(22) the decoding kernel carries out decoding operation;
(23) judging whether the effective image size is consistent with the coding image size, if not, resetting the image with the effective image size to the coding image size through a reset module, and outputting a video image; and if the video images are consistent, directly outputting the video images.
Here, it should be noted that: the effective image size refers to the actual image size, and the encoded image size refers to the actual image size plus the size of other areas filled with black. In step (11), the frame level in the configuration file is set to be higher than the width of the configuration file, and the division by 16 means integer division and decimal division, so that the following must be multiplied by 16.
The encoder changes the size of an effective image and fills black in an invalid area in a video at a complex section, so that the size of the encoded image is not changed, the viewing effect is ensured, the encoder is suitable for any codec kernel, the encoder and the decoder kernel are not influenced, and the stability of the encoder and the decoder kernel is ensured. The codec can also be used in other applications where it is desirable to change the effective image size, such as network real-time transcoding or real-time communication applications.
Claims (3)
1. A coding and decoding method with variable effective image size is characterized by comprising the following steps:
(1) in the encoder: analyzing the complexity of each frame of the file, segmenting the file according to the complexity, evaluating the size of an effective image suitable for each segment, writing the effective image into a configuration file, determining whether the image is reset or not according to the frame level width setting in the configuration file by a reset module, wherein a coding core is responsible for coding, and a code stream synthesizer packs the video stream from the coding core and the information of an effective area of the image into a final video stream for output; the specific steps of encoding are as follows:
(11) starting coding of a frame, reading a configuration file, judging whether the current frame has information setting of effective image size change according to frame level width setting in the configuration file, and directly entering the next step if the current frame does not have information setting of effective image size change; if yes, updating the effective image size for the current frame, and then entering the next step;
(12) judging whether the effective image size is equal to the coding image size, if so, directly continuing coding in a coding kernel, and then entering the next step; if not, the image frame Resize is adjusted to the effective image size through a Resize module, the upper left corner of the size of the coded image is placed, other areas of the size of the coded image are filled with black, then the size of the coded image is sent to a coding kernel, the coding kernel codes the frame into an IDR frame, codes the frame in an IDR frame type, and then the next step is carried out;
(13) judging whether the effective image size of the current frame is updated or not, and if not, outputting a code stream given by a coding kernel by a code stream synthesizer; if the video coding rate is updated, the effective image size information is packaged according to a user _ data _ unregistered format of sei in HEVC, and a code stream synthesizer packages a coding core output code stream and the effective image size information into a new video code rate for output;
(2) in the decoder: the video stream analyzer analyzes whether the current frame carries effective image size information or not, the decoding kernel is responsible for decoding, and the Resize module determines whether to Resize or not according to the effective image size and the video coding image size.
2. The method of claim 1, wherein in the step (11), the frame level width in the configuration file is set as follows:
firstly, transcoding is configured by self-adaption of a fixed Qp scene and IDR frames, and after the transcoding is completed, the average pixel compression ratio bpp of all frames between two IDR frames and the average pixel compression ratio bitrate _ bpp of a given code rate are calculated;
if the bitrate _ bpp is more than or equal to the bpp, the original height and width are adopted;
if bpp > bitrate _ bpp is more than or equal to 0.5 bpp, the height of the effective image is unchanged, and the width adopts a new width:
if bitrate _ bpp <0.5 bpp, the height and width of the effective image all need to be new, new width:
new_width = (old_width/2+15)/16*16
the new height is as follows:
3. the method as claimed in claim 1, wherein the decoding in step (2) comprises the following steps:
(21) when the decoding of a frame starts, a video stream analyzer analyzes the code stream, checks whether the video frame has effective image size information, if so, updates the effective image size information, and enters a decoding kernel; if not, directly entering a decoding kernel;
(22) the decoding kernel carries out decoding operation;
(23) judging whether the effective image size is consistent with the coding image size, if not, resetting the image with the effective image size to the coding image size through a reset module, and outputting a video image; and if the video images are consistent, directly outputting the video images.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911286945.3A CN110784713B (en) | 2019-12-14 | 2019-12-14 | Coding and decoding method capable of changing effective image size |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911286945.3A CN110784713B (en) | 2019-12-14 | 2019-12-14 | Coding and decoding method capable of changing effective image size |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110784713A CN110784713A (en) | 2020-02-11 |
CN110784713B true CN110784713B (en) | 2022-02-22 |
Family
ID=69394599
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911286945.3A Active CN110784713B (en) | 2019-12-14 | 2019-12-14 | Coding and decoding method capable of changing effective image size |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110784713B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101742296A (en) * | 2008-11-14 | 2010-06-16 | 北京中星微电子有限公司 | Video encoding and decoding method and device capable of reducing stream data fluctuation |
JP2015032924A (en) * | 2013-07-31 | 2015-02-16 | 日本電信電話株式会社 | Conversion quantization method, conversion quantization device and conversion quantization program |
CN109257601A (en) * | 2012-07-03 | 2019-01-22 | 夏普株式会社 | Picture decoding apparatus and picture coding device |
CN110024408A (en) * | 2016-10-04 | 2019-07-16 | 金起佰 | Coded image data/coding/decoding method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB201318658D0 (en) * | 2013-10-22 | 2013-12-04 | Microsoft Corp | Controlling resolution of encoded video |
-
2019
- 2019-12-14 CN CN201911286945.3A patent/CN110784713B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101742296A (en) * | 2008-11-14 | 2010-06-16 | 北京中星微电子有限公司 | Video encoding and decoding method and device capable of reducing stream data fluctuation |
CN109257601A (en) * | 2012-07-03 | 2019-01-22 | 夏普株式会社 | Picture decoding apparatus and picture coding device |
JP2015032924A (en) * | 2013-07-31 | 2015-02-16 | 日本電信電話株式会社 | Conversion quantization method, conversion quantization device and conversion quantization program |
CN110024408A (en) * | 2016-10-04 | 2019-07-16 | 金起佰 | Coded image data/coding/decoding method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110784713A (en) | 2020-02-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113168718B (en) | Video decoding method, device and storage medium | |
US7924917B2 (en) | Method for encoding and decoding video signals | |
US10298937B2 (en) | Method, device, computer program, and information storage means for encoding or decoding a video sequence | |
CN116320409A (en) | Method, device, equipment and storage medium for intra-frame prediction | |
CN113678457B (en) | Video encoding and decoding method, computer system and electronic equipment | |
US20150262404A1 (en) | Screen Content And Mixed Content Coding | |
US11909963B2 (en) | Image encoding method, decoding method, encoder, and decoder | |
TW201415896A (en) | Coding random access pictures for video coding | |
US20190045185A1 (en) | Coding tools for subjective quality improvements in video codecs | |
WO2019179401A1 (en) | Image filtering method and apparatus, and video codec | |
KR20230125723A (en) | Subpicture signaling in video coding | |
CN111193928B (en) | Method and apparatus for delivering region of interest information in video | |
US11438611B2 (en) | Method and apparatus of scaling window constraint for worst case bandwidth consideration for reference picture resampling in video coding | |
CN114071161B (en) | Image encoding method, image decoding method and related devices | |
CN110784713B (en) | Coding and decoding method capable of changing effective image size | |
WO2021056575A1 (en) | Low-delay joint source-channel coding method, and related device | |
FR2894739A1 (en) | ENCODING METHOD, DECODING METHOD, ENCODING DEVICE, AND VIDEO DATA DECODING DEVICE | |
US12034944B2 (en) | Video encoding method and apparatus, video decoding method and apparatus, electronic device and readable storage medium | |
US11616983B2 (en) | Joint component secondary transform | |
CN116248895B (en) | Video cloud transcoding method and system for virtual reality panorama roaming | |
Carmo et al. | Binary tree decomposition depth coding for 3D video applications | |
US20090003433A1 (en) | Transcoder and transcoding method | |
WO2024077806A1 (en) | Coding method and apparatus, decoding method and apparatus, coder, decoder, and storage medium | |
US20230007281A1 (en) | Video Encoding or Decoding Methods and Apparatuses with Scaling Ratio Constraint | |
US20230105452A1 (en) | Method and apparatus of adaptive sampling for mesh compression by decoders |
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 |