Coding and decoding method and device, equipment and storage medium

By obtaining the permission levels of the user and processing unit in video encoding, and using the corresponding entropy decoder and encoder for analysis and encoding, the problems of low efficiency and high resource consumption in the prior art are solved, and efficient encoding and decoding of users of multiple permission levels is realized.

CN120568082APending Publication Date: 2025-08-29HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510887036.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-11-14
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

In the prior art, encoding and decoding at least two video streams with different permissions leads to low efficiency, high resource consumption, and difficult to meet the user needs of multiple permission levels.

Method used

By obtaining the user permission level and the permission level of the current processing unit, the code stream to be parsed is obtained from the current frame code stream information, and the entropy decoder corresponding to the permission level is used for parsing, encode and decode areas of different permission levels, and use different entropy encoders and context models to avoid the decoding process of multiple code streams.

Benefits of technology

It realizes efficient encoding and decoding among users of different permission levels, saves resources, meets the analysis needs of users of multiple permission levels, and ensures that low-privileges users cannot decode high-privileges content, while high-privileges users can correctly parse low-privileges and high-privileges content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120568082A_ABST
    Figure CN120568082A_ABST
Patent Text Reader

Abstract

The invention discloses a coding and decoding method and device, equipment and a storage medium. The method comprises the following steps: acquiring a user permission and a permission level of a current processing unit; obtaining a to-be-analyzed code stream of the current processing unit according to the user permission level and the permission level of the current processing unit; the code stream is obtained from the interior of the current frame code stream information, and the current intra-frame code stream information comprises the lowest permission level code stream and at least one code stream greater than the lowest permission level; when the user permission level is greater than or equal to the permission level of the current processing unit, the code stream to be analyzed is equal to the code stream of the permission of the current processing unit, and a user with a non-lowest permission level can analyze the code stream with the lowest permission level and at least one code stream greater than the lowest permission level; and obtaining an entropy decoder corresponding to the permission level according to the user permission level, the permission level of the current processing unit and the corresponding code stream, and analyzing the code stream to be analyzed to obtain a corresponding image block. According to the invention, the user can obtain the image block corresponding to the authority.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This invention patent application is a divisional application of the Chinese invention patent application with the application date of November 14, 2022, application number 202211421087.0, and name “Coding and decoding method, device, equipment and storage medium”. Technical Field

[0002] The present application relates to the field of image processing technology, and in particular to a coding and decoding method, apparatus, device and storage medium. Background Art

[0003] As people increasingly prioritize the protection of personal sensitive information under surveillance, the demand for video sensitive information protection technology is growing. Video sensitive information protection involves coding, blocking, or scrambling local sensitive information areas in video images, rendering them unrecognizable while preserving the original content in other areas. To restore the original content in surveillance videos during public safety incidents, the captured video stream is currently processed into two streams: one stream is not processed for sensitive information, retaining the original video frames for encoding (visible to non-minimum-privilege users); the other stream undergoes sensitive information protection processing (e.g., scrambling, coding, or blocking) and encodes the protected video frames (visible to both non-minimum-privilege users and minimum-privilege users). Encoding and decoding at least two video streams for users with different permissions results in low efficiency and high resource consumption. Currently, users are divided into only two permission levels; if users have more permission levels, meeting requirements becomes even more difficult. Summary of the Invention

[0004] In view of this, the embodiments of the present application provide a coding and decoding method, apparatus, device and storage medium, which aim to solve the technical problem in the related art of encoding and decoding at least two videos for users with different permissions, resulting in low efficiency and high resource consumption.

[0005] An embodiment of the present application provides a decoding method, the decoding method comprising:

[0006] Get the user's permission level and the permission level of the current processing unit;

[0007] Obtaining a code stream to be parsed of the current processing unit based on the user authority level and the authority level of the current processing unit; the code stream is obtained from the code stream information of the current frame, and the code stream information within the current frame includes a code stream with a minimum authority level and at least one code stream with a level greater than the minimum authority level; when the user authority level is greater than or equal to the authority level of the current processing unit, the code stream to be parsed is equal to the code stream with the authority level of the current processing unit, and the code streams to be parsed at a non-minimum authority level include a code stream with a minimum authority level and at least one code stream with a level greater than the minimum authority level;

[0008] An entropy decoder corresponding to the permission level is obtained according to the user permission level, the permission level of the current processing unit and the corresponding code stream, and the code stream to be parsed is parsed to obtain the reconstructed image block of the current processing unit.

[0009] In a possible implementation of the present application, the step of obtaining the permission of the current processing unit includes:

[0010] The permission level of the current processing unit is obtained from the image header of the current frame or from the non-permission level code stream information of the current frame.

[0011] In a possible implementation manner of the present application, the current processing unit has only one authority level.

[0012] In a possible implementation of the present application, when obtaining the permissions of the current processing unit from the image header of the current frame, if it is determined that the current processing unit corresponds to multiple permission levels, the highest permission among the multiple permissions is used as the permission level of the current processing unit.

[0013] In a possible implementation of the present application, the step of obtaining the to-be-parsed code stream of the current processing unit according to the user authority level and the authority level of the current processing unit includes:

[0014] The code stream to be parsed of the current processing unit is obtained according to the user authority level and the authority level of the current processing unit, wherein the code stream to be parsed includes a related coding coefficient code stream and an adjustment parameter code stream of the current processing unit.

[0015] In a possible implementation of the present application, the adjustment parameter bitstream includes a quantization step size adjustment parameter bitstream, and the step of obtaining the to-be-parsed bitstream of the current processing unit according to the user authority level and the authority level of the current processing unit includes:

[0016] Obtaining the relevant coding coefficient stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit;

[0017] Obtain the quantization step size adjustment parameter bitstream from the lowest permission level bitstream.

[0018] In a possible implementation of the present application, the step of obtaining an entropy decoder corresponding to the permission level according to the user permission level, the permission level of the current processing unit, and the corresponding bitstream, and parsing the bitstream to be parsed includes:

[0019] According to the user authority level, the authority level of the current processing unit and the corresponding code stream, an entropy decoder corresponding to the authority level is obtained, and a set of contexts is obtained to parse the code stream to be parsed.

[0020] In a possible implementation of the present application, the context corresponding to the lowest authority level processing unit is the first set of contexts, and the context corresponding to the non-lowest authority level processing unit is the second set of contexts. Before obtaining the second set of contexts, the updated first set of contexts is copied and updated.

[0021] In a possible implementation of the present application, when updating the context, only the context of some syntax elements corresponding to the current processing unit is updated, or the context of all syntax elements corresponding to the current processing unit is updated.

[0022] In one possible implementation of the present application, non-minimum authority level processing units all use the first set of contexts of the lowest authority level processing unit as their second set of contexts. Only the lowest authority level processing unit can update its first set of contexts, and non-minimum authority level processing units cannot update any contexts.

[0023] In one possible implementation of the present application, if the permission level of the current processing unit is the same as or higher than the permission level of the previous processing unit, the context of the previous processing unit is updated; if the permission level of the current processing unit is lower than that of the previous processing unit, the context of the previous processing unit is initialized.

[0024] In a possible implementation of the present application, current processing units of different permission levels all use a set of contexts, and current processing units of the same level share a set of contexts.

[0025] In a possible implementation of the present application, the step of obtaining the to-be-parsed code stream of the current processing unit according to the user authority level and the authority level of the current processing unit includes:

[0026] The code stream to be parsed of the current processing unit is obtained according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level.

[0027] In a possible implementation of the present application, if the splicing method of the code streams of different processing units is frame-level splicing,

[0028] The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level, includes:

[0029] Read the position of the end code of the current frame and / or the position of the start code of the next frame;

[0030] Based on the user permission level and the permission level of the current processing unit, if the current processing unit is the first processing unit under the current permission level of the current frame, the starting position of the code stream of the current processing unit is derived based on the position of the end code of the current frame and / or the position of the start code of the next frame, as well as the start code of the code stream under the current permission level or the length information of the permission code stream before the current permission. Otherwise, the starting position of the code stream of the current processing unit is directly obtained, where the current permission level refers to the permission level corresponding to the current processing unit, to parse the code stream to be parsed. After the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated.

[0031] In a possible implementation of the present application, if the splicing method of the code streams of different processing units is slice-level splicing,

[0032] The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level, includes:

[0033] Read the starting position of the non-minimum privilege level code stream and the starting position of the next slice and / or the ending code position of the current slice;

[0034] Based on the user permission level and the permission level of the current processing unit, if the current processing unit is the first processing unit under the current permission level of the current slice, the starting position of the code stream of the current processing unit is derived based on the position of the end code of the current slice and / or the position of the start code of the next slice, as well as the start code of the code stream under the current permission level or the length information of the permission code stream before the current permission. Otherwise, the starting position of the code stream of the current processing unit is directly obtained to parse the code stream to be parsed. After the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated.

[0035] In a possible implementation of the present application, if the splicing method of the code streams of different processing units is the largest processing unit lcu level splicing method,

[0036] The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level, includes:

[0037] Read the starting position of the non-minimum privilege level code stream and the starting position of the next lcu level and / or the ending code position of the lcu level;

[0038] According to the user authority level and the authority level of the current processing unit, if the current processing unit is the first processing unit under the current authority level of the current LCU, the starting position of the code stream of the current processing unit is derived based on the position of the current LCU end code and / or the position of the next LCU start code and the start code of the code stream under the current authority level or the length information of the previous authority code stream of the current authority; otherwise, the starting position of the code stream of the current processing unit is directly obtained to parse the code stream to be parsed. After the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated.

[0039] In a possible implementation of the present application, the step of obtaining the to-be-parsed code stream of the current processing unit according to the user authority level and the authority level of the current processing unit, and the start code and / or end code of the code stream of the current processing unit authority level includes:

[0040] The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level, includes:

[0041] If the permission level of the current processing unit is not the lowest level and the permission of the current processing unit is not equal to the permission of the previous processing unit, then the start code of the permission level of the current processing unit, or the end code of the previous processing unit, or the code stream length of the previous processing unit is obtained. Based on the start code of the permission level of the current processing unit, or the end code of the previous processing unit, or the code stream length of the previous processing unit and the starting position of the code stream of the previous processing unit, the starting position of the code stream of the current processing unit is derived; otherwise, the starting position of the current processing unit is derived according to the starting position of the code stream of the previous processing unit.

[0042] In a possible implementation of the present application, when the user authority level is lower than the authority level of the current processing unit, the code stream of the current processing unit's authority is not decoded, and the code stream without authority is decoded to obtain the reconstructed image block of the current processing unit.

[0043] In one possible implementation of the present application, when the user authority level is less than the authority level of the current processing unit, the code stream of the current processing unit's authority is not decoded, and a fixed image block or image block information with authority around the current processing unit less than or equal to the authority of the current processing unit is used to derive the reconstructed image block of the current processing unit.

[0044] The present application also provides an encoding method, the method comprising:

[0045] Acquire a frame image to be encoded, and determine position information of regions of different permission levels in the frame image to be encoded;

[0046] Based on the position information, dividing the frame image to be encoded into processing units;

[0047] Among them, each divided processing unit only corresponds to an area of ​​one permission level;

[0048] For relevant coding coefficients corresponding to processing units in areas with different permission levels, an entropy encoder corresponding to the permission level is obtained, and the relevant coding coefficients are respectively encoded to obtain different bitstreams, and the different bitstreams are spliced; wherein the bitstream is placed within the bitstream information of the current frame, and the bitstream information within the current frame includes the bitstream of the lowest permission level and at least one bitstream with a level greater than the lowest permission level; when the user permission level is greater than or equal to the permission level of the current processing unit, the bitstream to be parsed is equal to the bitstream of the permission of the current processing unit, and the bitstream to be parsed of a non-lowest permission level includes the bitstream of the lowest permission level and at least one bitstream with a level greater than the lowest permission level.

[0049] In a possible implementation of the present application, when the divided processing unit corresponds to areas of multiple permission levels, the divided processing unit continues to be divided until the further divided processing unit has been divided to a preset division depth, or the further divided processing unit only corresponds to an area of ​​one permission level.

[0050] In a possible implementation of the present application, after the processing unit is divided to a preset division depth, if the divided processing unit still corresponds to areas of multiple permission levels, the permission level of the area corresponding to the divided processing unit is adjusted to a non-minimum permission level of the area.

[0051] In a possible implementation of the present application, the frame image to be encoded is divided into processing units based on the position information. If each processing unit after division corresponds to only one permission level area, further division is allowed or not allowed.

[0052] In a possible implementation of the present application, when further division of a processing unit corresponding to only one permission level area is allowed, further division of the processing unit is performed in different sizes.

[0053] In a possible implementation of the present application, the step of respectively encoding relevant coding coefficients corresponding to processing units of different permission level areas to obtain different code streams includes:

[0054] Different entropy encoders are used to encode the relevant coding coefficients corresponding to the processing units in different permission level areas respectively to obtain different code streams.

[0055] In a possible implementation of the present application, the step of using different entropy encoders to respectively encode relevant coding coefficients corresponding to processing units in different permission level areas to obtain different bitstreams includes:

[0056] Different entropy encoders are used and a set of contexts are obtained to encode the relevant coding coefficients corresponding to the processing units in different permission level areas respectively to obtain different code streams.

[0057] In a possible implementation of the present application, the context corresponding to the lowest authority level processing unit is the first set of contexts, and the context corresponding to the non-lowest authority level processing unit is the second set of contexts. Before obtaining the second set of contexts, the updated first set of contexts is copied and updated.

[0058] In one possible implementation of the present application, non-minimum authority level processing units all use the first set of contexts of the lowest authority level processing unit as their second set of contexts. Only the lowest authority level processing unit can update its first set of contexts, and non-minimum authority level processing units cannot update any contexts.

[0059] In one possible implementation of the present application, if the permission level of the current processing unit is the same as or higher than the permission level of the previous processing unit, the context of the previous processing unit is updated; if the permission level of the current processing unit is lower than that of the previous processing unit, the context of the previous processing unit is initialized.

[0060] In a possible implementation of the present application, current processing units of different permission levels all use a set of contexts, and current processing units of the same level share a set of contexts.

[0061] In a possible implementation of the present application, the step of encoding the relevant coding coefficients corresponding to the processing units of the different permission level areas using different entropy encoders to obtain different bitstreams includes:

[0062] Different entropy encoders are used to encode the relevant coding coefficients and adjustment parameters corresponding to the processing units in different permission level areas, and the encoding is correspondingly encoded into different bit streams.

[0063] In a possible implementation of the present application, the adjustment parameters include quantization step adjustment parameters, and the quantization step adjustment parameters of the processing units in different permission level areas are encoded into the code stream corresponding to the processing unit in the lowest permission area.

[0064] In a possible implementation manner of the present application, the step of splicing the different code streams includes:

[0065] splicing the different code streams in a preset splicing method;

[0066] The preset splicing method includes a frame-level splicing method, a slice-level splicing method, an lcu-level splicing method or a cu-level splicing method.

[0067] In a possible implementation manner of the present application, the step of splicing the different code streams in a frame-level splicing manner includes:

[0068] At the position of the end code of the current frame and / or the position of the start code of the next frame, according to the permission level of the non-minimum permission level processing unit, the code stream corresponding to the permission code stream of the non-minimum permission level processing unit and / or the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed.

[0069] In a possible implementation manner of the present application, the step of splicing the different code streams in a frame-level splicing manner includes:

[0070] At the position of the end code of the current frame and / or the position of the start code of the next frame, according to the permission level of the non-minimum permission level processing unit, the start code and / or end code of the permission code stream corresponding to the non-minimum permission level processing unit and the permission level code stream of the non-minimum permission level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed.

[0071] In a possible implementation manner of the present application, the step of splicing the different bitstreams in a slice-level splicing manner includes:

[0072] At the starting position of the non-minimum permission level code stream and the starting position of the next slice and / or the ending code position of the current slice, the start code and / or the ending code of the permission code stream corresponding to the non-minimum permission level processing unit and the permission level code stream of the non-minimum permission level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed.

[0073] In a possible implementation manner of the present application, the step of splicing the different bitstreams in an LCU-level splicing manner includes:

[0074] At the starting position of the non-minimum privilege level code stream and the starting position of the next LCU level and / or the end code position of the LCU level, the start code and / or end code of the privilege level code stream corresponding to the non-minimum privilege level processing unit and the privilege level code stream of the non-minimum privilege level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum privilege level processing unit are spliced ​​and placed.

[0075] In a possible implementation manner of the present application, the step of splicing the different bitstreams in a CU-level splicing manner includes:

[0076] If the authority of the current processing unit is not equal to the authority of the previous processing unit, encode the start code of the current processing unit code stream and / or the end code of the previous processing unit and / or the corresponding code stream length information of the previous processing unit, and then write them into the code stream of the current processing unit.

[0077] The present application also provides a decoding device, comprising:

[0078] A first acquisition module is used to obtain the user authority level and the authority level of the current processing unit;

[0079] a second acquisition module, configured to acquire a code stream to be parsed of the current processing unit based on the user authority level and the authority level of the current processing unit; the code stream is acquired from code stream information within the current frame, where the code stream information within the current frame includes a code stream with a minimum authority level and at least one code stream with a level greater than the minimum authority level; when the user authority level is greater than or equal to the authority level of the current processing unit, the code stream to be parsed is equal to the code stream with the authority level of the current processing unit, and code streams to be parsed at a non-minimum authority level include a code stream with a minimum authority level and at least one code stream with a level greater than the minimum authority level;

[0080] The parsing module is used to obtain an entropy decoder corresponding to the permission level according to the user permission level, the permission level of the current processing unit and the corresponding code stream, parse the code stream to be parsed, and obtain the reconstructed image block of the current processing unit.

[0081] The present application also provides an encoding device, comprising:

[0082] A third acquisition module is used to acquire a frame image to be encoded and determine position information of regions of different permission levels in the frame image to be encoded;

[0083] A division module, configured to divide the frame image to be encoded into processing units based on the position information;

[0084] Among them, each divided processing unit only corresponds to an area of ​​one permission level;

[0085] The encoding module is configured to obtain an entropy encoder corresponding to the permission level for the relevant coding coefficients corresponding to the processing units in the different permission level areas, encode them respectively to obtain different bitstreams, and splice the different bitstreams; wherein the bitstream is placed within the bitstream information of the current frame, and the bitstream information within the current frame includes the bitstream of the lowest permission level and at least one bitstream of a level greater than the lowest permission level; when the user permission level is greater than or equal to the permission level of the current processing unit, the bitstream to be parsed is equal to the bitstream of the permission level of the current processing unit, and the bitstream to be parsed of a non-lowest permission level includes the bitstream of the lowest permission level and at least one bitstream of a level greater than the lowest permission level.

[0086] The present application also provides a decoding device, which is a physical node device, and the decoding device includes: a memory, a processor, and a program of the decoding method stored in the memory and capable of running on the processor. When the program of the decoding method is executed by the processor, the steps of the decoding method described above can be implemented.

[0087] To achieve the above-mentioned purpose, a storage medium is further provided, on which a decoding program is stored. When the decoding program is executed by a processor, the steps of any of the above-mentioned decoding methods are implemented.

[0088] The present application also provides an encoding device, which is a physical node device, and the encoding device includes: a memory, a processor, and a program of the encoding method stored in the memory and capable of running on the processor. When the program of the encoding method is executed by the processor, the steps of the encoding method described above can be implemented.

[0089] To achieve the above-mentioned purpose, a storage medium is further provided, on which a coding program is stored. When the coding program is executed by a processor, the steps of any of the above-mentioned coding methods are implemented.

[0090] The present application provides a coding and decoding method, apparatus, device and storage medium. Compared with the related art, in which at least two videos are encoded and decoded for users with different permissions, resulting in low efficiency and high resource consumption, in the present application, the code stream is obtained from the current frame code stream information, and the code stream information in the current frame includes the lowest permission level code stream and at least one code stream greater than the lowest permission level, that is, code streams of different permission levels are all one code stream instead of multiple code streams (avoiding low efficiency and high consumption caused by decoding multiple code streams at the same time). In addition, in the present embodiment, the code stream to be parsed of the current processing unit is obtained according to the user permission level and the permission level of the current processing unit. When the user permission level is greater than or equal to the permission level of the current processing unit, , the code stream to be parsed is equal to the code stream of the current processing unit's authority. Therefore, low-authority users cannot correctly decode the code stream content of the processing unit with a higher authority level. Users with higher authority can correctly parse the code stream of the processing unit with a lower authority level (meeting the parsing needs of users with more than two authority levels). After determining the code stream to be parsed, an entropy decoder corresponding to the authority level is obtained according to the user authority level, the authority level of the current processing unit, and the corresponding code stream (different authorities correspond to different entropy decoders, which meet the encoding needs in different situations and can effectively protect content with different authorities). The code stream to be parsed is parsed to obtain the reconstructed image block of the current processing unit, meeting the needs of users of each authority level to obtain their corresponding content. BRIEF DESCRIPTION OF THE DRAWINGS

[0091] Figure 1This is a flowchart of the first embodiment of the decoding method of the present application;

[0092] Figure 2 This is a flowchart of the first embodiment of the encoding method of the present application;

[0093] Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application;

[0094] Figure 4 This is a schematic diagram of the first scenario involved in the encoding and decoding method of this application;

[0095] Figure 5 This is a schematic diagram of the first scenario involved in the decoding method of this application;

[0096] Figure 6 This is a diagram of the code stream structure involved in the encoding method of this application;

[0097] Figure 7 The composition of the code stream within the image data involved in the encoding method of this application;

[0098] Figure 8 This is a schematic diagram of the second scenario involved in the decoding method of this application;

[0099] Figure 9 This is a schematic diagram of the third scenario involved in the decoding method of this application;

[0100] Figure 10 This is a schematic diagram of the fourth scenario involved in the decoding method of this application. DETAILED DESCRIPTION

[0101] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.

[0102] The present application provides a decoding method. In one embodiment of the decoding method of the present application, refer to Figure 1 , the method comprising:

[0103] The decoding method comprises:

[0104] Step A1, obtaining the user authority level and the authority level of the current processing unit;

[0105] Step A2: Obtaining a code stream to be parsed for the current processing unit based on the user authority level and the authority level of the current processing unit; the code stream is obtained from the code stream information of the current frame, where the code stream information within the current frame includes a code stream with a minimum authority level and at least one code stream with a level greater than the minimum authority level; when the user authority level is greater than or equal to the authority level of the current processing unit, the code stream to be parsed is equal to the code stream with the authority level of the current processing unit, and code streams to be parsed at a non-minimum authority level include a code stream with a minimum authority level and at least one code stream with a level greater than the minimum authority level;

[0106] Step A3: obtaining an entropy decoder corresponding to the authority level according to the user authority level, the authority level of the current processing unit and the corresponding bitstream, parsing the bitstream to be parsed, and obtaining the reconstructed image block of the current processing unit.

[0107] In this embodiment, the codestream is obtained from the codestream information of the current frame. The codestream information within the current frame includes the codestream with the lowest privilege level and at least one codestream with a privilege level greater than the lowest privilege level. That is, codestreams of different privilege levels are all one codestream rather than multiple codestreams. In addition, in this embodiment, the codestream to be parsed for the current processing unit is obtained based on the user privilege level and the privilege level of the current processing unit. When the user privilege level is greater than or equal to the privilege level of the current processing unit, the codestream to be parsed is equal to the privilege level of the current processing unit. Therefore, users with lower privilege levels cannot correctly decode the codestream content of processing units with higher privilege levels, while users with higher privilege levels can correctly parse the codestream content of processing units with lower privilege levels. After determining the codestream to be parsed, an entropy decoder corresponding to the privilege level is obtained based on the user privilege level, the privilege level of the current processing unit, and the corresponding codestream (different privilege levels correspond to different entropy decoders to meet different encoding requirements and effectively protect content with different privileges). The codestream to be parsed is then parsed to obtain a reconstructed image block for the current processing unit.

[0108] As an example, the current processing unit authority is accurately determined from the image header of the current frame or from the non-authority level code stream information of the current frame, providing a basis for users with different permissions to correctly parse code streams corresponding to different authority levels.

[0109] As an example, since the current processing unit corresponds to an authority level, it can not only avoid the confidentiality of the image from being compromised (large blocks of non-minimum authority level image blocks correspond to low-authority level processing units, allowing low-authority users to obtain the content of high-authority image blocks), but also avoid the inability of the lowest authority level processing unit to be effectively restored to a reconstructed image block (large blocks of lowest authority level image blocks correspond to non-minimum authority level processing units, resulting in the inability to effectively restore).

[0110] As an example, in a small number of cases, the processing unit obtained from the image header of the current frame corresponds to multiple permission level code streams and is not changed according to the permission levels of different code streams within the current frame code stream information. Therefore, when obtaining the permission of the current processing unit from the image header of the current frame, if it is determined that the current processing unit corresponds to multiple permission levels, the highest permission among the multiple permissions is used as the permission level of the current processing unit to accurately determine the permission level of the current processing unit (corresponding to the permission division of different code streams within the current frame code stream information).

[0111] As an example, the code stream to be parsed of the current processing unit is obtained according to the user authority level and the authority level of the current processing unit. The code stream to be parsed includes the relevant coding coefficient code stream and the adjustment parameter code stream of the current processing unit, thereby meeting the adjustment requirements of the corresponding coding coefficients of different processing units.

[0112] As an example, the quantization step adjustment parameter bitstream is obtained from the lowest privilege level bitstream, so that different processing units can perform corresponding adjustments.

[0113] As an example, obtaining an entropy decoder corresponding to the permission level and a set of contexts to parse the code stream to be parsed can adapt to different decoding scenarios and improve decoding efficiency.

[0114] As an example, the context corresponding to the lowest authority level processing unit is the first set of contexts, and the context corresponding to the non-lowest authority level processing unit is the second set of contexts. Before obtaining the second set of contexts, the updated first set of contexts is first copied and updated. Since the updated first set of contexts is first copied and updated before obtaining the second set of contexts, there is no need to maintain many sets of contexts, saving resources.

[0115] As an example, context-based adaptive binary arithmetic coding CABAC encodes and decodes different syntax elements. When using context-based adaptive binary arithmetic coding CABAC to encode and decode different syntax elements, a table for probability parameter updates is pre-set, and the context model (context) derives the variables that need to be updated each time. After obtaining the variables, the next one is indexed according to the current context model.

[0116] As an example, by constructing a context model, the redundancy between symbols can be reduced and the coding efficiency can be improved. Since the encoded symbols are correlated, the context information provided by the previously encoded symbols for the current encoding element can be used to select the appropriate probability.

[0117] As an example, when updating the context, you can choose to update only the context of some syntax elements corresponding to the current processing unit or update the context of all syntax elements corresponding to the current processing unit to meet different decoding requirements.

[0118] As an example, all non-minimum privilege level processing units use the first set of contexts of the lowest privilege level processing unit as their second set of contexts. Only the lowest privilege level processing unit can update its first set of contexts, and non-minimum privilege level processing units cannot update any contexts. In this embodiment, different encoding requirements can be met.

[0119] As an example, if the current processing unit has the same or higher permission level as the previous processing unit, the context of the previous processing unit is updated. If the current processing unit has a lower permission level than the previous processing unit, the context of the previous processing unit is initialized. In this embodiment, only one set of contexts is saved to conserve resources.

[0120] As an example, current processing units of different permission levels all use a set of contexts, and current processing units of the same level share a set of contexts. Sharing only one set of contexts can save resources.

[0121] As an example, the code stream to be parsed of the current processing unit is obtained based on the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit's authority level, so as to facilitate the search for the code stream to be parsed of the current processing unit.

[0122] As an example, if the splicing method of the code streams of different processing units is frame-level splicing, based on the position of the end code of the current frame and / or the position of the start code of the next frame, the starting position of the permission code stream corresponding to the current processing unit or the length information of the previous permission code stream is obtained to accurately obtain and parse the code stream to be parsed.

[0123] As an example, if the splicing method of the code streams of different processing units is slice-level splicing, based on the starting position of the non-lowest permission level code stream and the starting position of the next slice and / or the ending code position of the current slice, the starting position of the permission code stream corresponding to the current processing unit or the length information of the previous permission code stream is obtained to accurately obtain and parse the code stream to be parsed.

[0124] As an example, if the splicing method of the code streams of different processing units is the largest processing unit LCU level splicing method, based on the starting position of the non-lowest permission level code stream and the starting position of the next LCU level and / or the end code position of the LCU level, the starting position of the permission code stream corresponding to the current processing unit or the length information of the previous permission code stream is obtained to accurately obtain and parse the code stream to be parsed.

[0125] As an example, based on the starting position of the lowest permission level code stream and the starting position of the next cu level and / or the end code position of the cu level, the starting position of the permission code stream corresponding to the current processing unit or the length information of the current permission code stream is obtained to accurately obtain and parse the code stream to be parsed.

[0126] As an example, when the user authority level is lower than the authority level of the current processing unit, the code stream with authority of the current processing unit is not decoded, but the code stream without authority is decoded, and a fixed image block or default image block information is used to obtain the reconstructed image block of the current processing unit.

[0127] As an example, the application scenario of this embodiment is:

[0128] Applied to monitoring scenarios for vehicles in parking lots, the current processing unit is the processing unit corresponding to the license plate image block in the monitoring image (whose authority level is higher than the processing units corresponding to other non-license plate image blocks), or the current processing unit is the processing unit corresponding to other non-license plate image blocks in the monitoring image (whose authority level is lower than the processing unit corresponding to the license plate image block). For different users, such as ordinary users (with the lowest authority level), only the code stream corresponding to the processing unit corresponding to other non-license plate image blocks can be obtained and parsed. For non-ordinary users, the code stream corresponding to the processing unit corresponding to other non-license plate image blocks can be obtained, as well as the code stream corresponding to the processing unit corresponding to the license plate image block, and the code streams of different processing units are the same code stream.

[0129] As an example, in an authentication scenario for authenticating qualifications, the current processing unit is the processing unit corresponding to the ID card image block in the authentication image (whose authority level is higher than other processing units), or the current processing unit is the processing unit corresponding to the face image block in the authentication image (whose authority level is lower than the processing unit corresponding to the ID card image block, but higher than the processing units corresponding to other non-ID card image blocks), and the current processing unit is the processing unit corresponding to other image blocks in the authentication image (whose authority level is the lowest). For different users, such as users with the third authority level (the lowest level), only the code stream corresponding to the processing unit corresponding to other image blocks (non-face or non-ID card image blocks) can be obtained and parsed; while for users with the second authority level (non-lowest authority level), the code stream corresponding to the processing unit corresponding to the face image block can be obtained, as well as the code stream corresponding to the processing unit corresponding to other image blocks (non-face or non-ID card image blocks); and for users with the first authority level (the highest authority level), the code stream corresponding to the processing unit corresponding to all image blocks can be obtained, and the code streams of different processing units are the same code stream.

[0130] Figure 4 Corresponding to a commonly used video coding framework, this codec framework is applicable to this application, including prediction, transformation, quantization, entropy coding and filtering modules. Briefly introduce each module

[0131] (1): The prediction module includes intra-frame prediction and inter-frame prediction. Intra-frame prediction uses the reconstructed pixels around the current block to make predictions and remove spatial redundancy; inter-frame prediction uses the reconstructed pixels on the time domain reference frame to make predictions and remove temporal redundancy.

[0132] (2): The transformation module linearly maps the residual information in the spatial domain to the transformation domain (such as the frequency domain). The goal is to make the energy more concentrated and remove the frequency domain correlation of the signal. Theoretically, the transformation matrix is ​​reversible and will not cause signal loss.

[0133] (3): The quantization module is a "many-to-one" mapping process, which is irreversible and will cause signal loss; the advantage is that it can greatly reduce the value range of the signal, allowing the encoder to give a good approximation of the original signal with a small number of symbols, thereby improving the compression rate.

[0134] (4): The entropy coding module is a lossless coding method based on the principle of information entropy. It converts a series of element symbols used to represent the video sequence (such as transformation coefficients and mode information, etc.) into a binary code stream, removing the statistical redundancy of these video element symbols.

[0135] (5): The filtering module will enhance the reconstructed image, with the goal of making the reconstructed image closer to the original image, while reducing the impact of blocking and ringing effects, and improving the quality of the reconstructed image.

[0136] The above explanation uses encoding as an example. Video decoding and encoding are parallel processes. Video decoding typically involves entropy decoding, prediction, inverse quantization, inverse transform, and filtering. The implementation principles of each process are the same or similar to those of entropy encoding. Filtering includes deblocking filtering, sample adaptive offset filtering, adaptive loop filtering, and neural network-based filtering.

[0137] In this embodiment, the specific steps are as follows:

[0138] Step A10, obtaining the user authority level and the authority level of the current processing unit;

[0139] As an example, for the current processing unit (decoding unit), the user authority level can be directly obtained based on the user's attribute information, where the user authority level can be the first authority level, the second authority level, the third authority level, etc. (lowest (authority) authority level user, non-lowest (authority) level user), without specific limitation.

[0140] As an example, the authority of the current processing unit can be a processing unit with the lowest authority level (third authority level) or a processing unit with a non-lowest authority level (a processing unit with a non-lowest authority level can have more than one authority level, including the first authority level and the second authority level, etc.).

[0141] The step of obtaining the authority of the current processing unit includes:

[0142] Step A11: Obtain the permission level of the current processing unit from the image header of the current frame or from the non-permission level code stream information of the current frame.

[0143] As an example, the current processing unit directly reads its permission level from the image header of the current frame (it can also be based on the slice header or the lcu header, that is, when encoding the current slice / lcu, first obtain the permission information in the current slice / lcu from the code stream, and mark it with m*n as the minimum unit. If there is more than one permission level in m*n, the current m*n block is marked as the highest permission level in the current m*n); or obtain its permission within the decoded non-permission level code stream information (determined during decoding).

[0144] As an example, the current processing unit has only one permission level.

[0145] As an example, the authority level of the current processing unit is only the first authority level or only the second authority level.

[0146] As an example, since the current processing unit corresponds to a permission level, it can not only avoid the confidentiality of the image from being compromised, but also avoid the lowest permission level processing unit from being unable to effectively restore it to a reconstructed image block (large blocks of lowest permission level image blocks correspond to non-lowest permission level processing units, resulting in ineffective restoration, so that users at the lowest permission level cannot use the contents of image blocks at their corresponding permission level).

[0147] As an example, the permission level of the processing unit is determined from the image header of the current frame. At the same time, the current processing unit is obtained by parsing the current code stream information. If it is determined that the current processing unit corresponds to multiple permission level code streams, the highest permission among the multiple permissions is used as the permission level of the current processing unit (corresponding to the permissions of different code streams within the current frame code stream information). The image header information and processing unit division information here, and their code streams are all placed in the lowest permission level.

[0148] As an example, during subsequent decoding, if the processing unit determined from the image header of the current frame corresponds to code streams of the second permission level and the third permission level (the lowest permission level), the permission level of the current processing unit is the second permission level.

[0149] As an example, obtaining the permissions of the current processing unit when decoding the internal code stream information of the current frame (determining while decoding) means: if the number of permission levels in the entire frame is obtained only based on the image header, rather than obtaining the specific permission level of the current processing unit based on the image header, then the permissions of the current processing unit are obtained (determined while decoding) when parsing the internal code stream information of the current frame. At this time, the permission level of the current processing unit is obtained based on the code stream information in the internal code stream information of the current frame.

[0150] As an example, the processing unit in this embodiment may be at an LCU (largest processing unit / macroblock) level, a PU unit, or a TU unit.

[0151] Parse the code stream to determine whether the multi-user permission level function is enabled. If enabled, the code stream information in the current frame includes the code stream with the lowest permission level and at least one code stream with a permission level greater than the lowest permission level; otherwise, the code stream information in the current frame only includes the code stream with the lowest permission level.

[0152] Step A20: Obtaining a codestream to be parsed for the current processing unit based on the user authority level and the authority level of the current processing unit; the codestream is obtained from the codestream information within the current frame, where the codestream information within the current frame includes a codestream with a minimum authority level and at least one codestream with a level greater than the minimum authority level; when the user authority level is greater than or equal to the authority level of the current processing unit, the codestream to be parsed is equal to the codestream with the authority level of the current processing unit, and codestreams to be parsed at a non-minimum authority level include a codestream with a minimum authority level and at least one codestream with a level greater than the minimum authority level;

[0153] As an example, the codestream to be parsed is obtained from the codestream information of the current frame. The codestream information in the current frame includes the codestream of the lowest permission level and at least one codestream with a higher permission level. That is, users of different permission levels parse the same codestream (the same codestream includes the codestream of the lowest permission level and at least one codestream with a higher permission level) to obtain the codestream to be parsed corresponding to their permission levels, rather than parsing one codestream for the user of the lowest permission level and another codestream for users at a level other than the lowest permission level.

[0154] As an example, the codestream to be parsed of the current processing unit is obtained based on the user authority level and the authority level of the current processing unit: when the user authority level is greater than or equal to the authority level of the current processing unit, the codestream to be parsed is equal to the codestream of the current processing unit's authority, and the codestream to be parsed of a non-minimum authority level includes a codestream of the minimum authority level and at least one codestream of a level greater than the minimum authority level. However, a user of the minimum authority level can parse the codestream of the minimum authority level but cannot parse codestreams of a level other than the minimum authority level.

[0155] As an example, when the user authority level is lower than the authority level of the current processing unit, the code stream with authority of the current processing unit is not decoded, and the code stream without authority is decoded to obtain the reconstructed image block of the current processing unit.

[0156] As an example, the code stream without the permission level is placed at a preset position in the current frame code stream structure. Therefore, the current processing unit obtains the code stream without the permission level from the preset position and decodes it.

[0157] As an example, the code stream with no permission level is placed before the frame end code and after the code stream with a non-minimum permission level.

[0158] As an example, when the user authority level is less than the authority level of the current processing unit, the code stream of the current processing unit's authority is not decoded, and a fixed image block or image block information with authority less than or equal to the current processing unit's authority around the current processing unit is used to derive the reconstructed image block of the current processing unit.

[0159] As an example, when the user authority level is lower than the authority level of the current processing unit, a fixed image block (default) is used as the reconstructed image block of the current processing unit.

[0160] As an example, when the user authority level is lower than the authority level of the current processing unit, the reconstructed image block of the current processing unit is derived using information of image blocks around the current processing unit whose authority is lower than or equal to that of the current processing unit.

[0161] As an example, when the user's authority level is lower than the authority level of the current processing unit, the reconstructed image block of the current processing unit is derived using information about one or more image blocks surrounding the current processing unit, where the authority level of the processing unit corresponding to the one or more image blocks is lower than or equal to the authority level of the current processing unit.

[0162] As an example, when deriving the reconstructed image blocks of the current processing unit, if the authority of the processing unit corresponding to the one or more image block information is greater than the authority of the current processing unit, the image block information is not referenced.

[0163] As an example, the step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit includes:

[0164] Step A21 : obtaining the to-be-parsed bitstream of the current processing unit according to the user authority level and the authority level of the current processing unit, wherein the to-be-parsed bitstream includes the relevant coding coefficient bitstream and the adjustment parameter bitstream of the current processing unit.

[0165] As an example, the code stream to be parsed further includes an adjustment parameter code stream, wherein the adjustment parameter may be a qp (quantization) parameter, and the permission level of the adjustment parameter code stream also corresponds to the permission level of the current processing unit.

[0166] As an example, the relevant coding coefficients include residual information and prediction mode information, etc.

[0167] The adjustment parameter bitstream includes a quantization step adjustment parameter bitstream, and the step of obtaining the to-be-parsed bitstream of the current processing unit according to the user authority level and the authority level of the current processing unit includes:

[0168] Step A22, obtaining the relevant coding coefficient stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit;

[0169] Obtain the quantization step size adjustment parameter bitstream from the lowest permission level bitstream.

[0170] As an example, the quantization step size adjustment parameter code stream is placed in the lowest permission level code stream, so for the current processing unit (regardless of whether it is the lowest permission level or not), the quantization step size adjustment parameter code stream can be obtained from the lowest permission level code stream.

[0171] Step S30: obtaining an entropy decoder corresponding to the authority level according to the user authority level, the authority level of the current processing unit and the corresponding bitstream, parsing the bitstream to be parsed, and obtaining a reconstructed image block of the current processing unit.

[0172] An entropy decoder corresponding to the permission level is obtained according to the user permission level, the permission level of the current processing unit, and the corresponding bit stream, that is, different permissions correspond to different entropy decoders.

[0173] After obtaining the entropy decoder of the permission level of the current processing unit, the code stream to be parsed is parsed based on the entropy decoder to obtain the reconstructed image block of the current processing unit, so that the user can obtain the reconstructed image block corresponding to his permission.

[0174] Taking the figure as an example, the overall embodiment is described:

[0175] After obtaining user permissions, the current processing unit can obtain N different permission levels in the current image as a whole based on the frame-level image header, and at the same time can obtain the specific division of different permission levels. Therefore, the permission level of the current processing unit can be obtained (if it is determined that the current processing unit corresponds to multiple permission level code streams, the highest permission among the multiple permissions will be used as the permission level of the current processing unit).

[0176] As an example, the current processing unit obtains its permission level based on the code stream information during the decoding process (wherein, the encoding end has divided the current frame image into areas with different permissions with m*n as the minimum unit, and transmitted the corresponding code stream to the decoding end. Each m*n contains only one permission. If different permissions actually correspond to the m*n small blocks, the current m*n permission level corresponds to the highest permission. The decoding end is also marked with m*n. When obtaining the permission area information of the entire frame (the permission level of the processing unit) from the image header, it needs to be marked according to m*n as the minimum unit. As an example, for example: the m*n size can be 4x4 or 8x8 or 16x16, etc.).

[0177] As an example, if the user's authority level is greater than or equal to the authority level of the current processing unit, the code stream to be parsed is equal to the code stream of the current processing unit's authority (including the relevant coding coefficient code stream and the adjustment parameter code stream).

[0178] In this embodiment, the codestream is obtained from the codestream information of the current frame. The codestream information within the current frame includes the codestream with the lowest permission level and at least one codestream with a permission level greater than the lowest. That is, codestreams of different permission levels are all one codestream rather than multiple codestreams. In addition, in this embodiment, the codestream to be parsed of the current processing unit is obtained based on the user permission level and the permission level of the current processing unit. When the user permission level is greater than or equal to the permission level of the current processing unit, the codestream to be parsed is equal to the codestream of the permission level of the current processing unit. Therefore, users with lower permission levels cannot correctly decode the codestream content of processing units with higher permission levels, while users with higher permission levels can correctly parse the codestream of processing units with lower permission levels. After determining the codestream to be parsed, an entropy decoder corresponding to the permission level is obtained based on the user permission level, the permission level of the current processing unit, and the corresponding codestream (different entropy decoders correspond to different permissions to meet different encoding requirements in different situations, effectively protecting content with different permissions). The codestream to be parsed is then parsed to obtain a reconstructed image block of the current processing unit, satisfying the requirements of users of each permission level to obtain the corresponding content.

[0179] Furthermore, based on the first embodiment of the present application, another embodiment of the present application is provided. In this embodiment, the step of obtaining an entropy decoder corresponding to the permission level according to the user permission level, the permission level of the current processing unit, and the corresponding bitstream, and parsing the bitstream to be parsed includes:

[0180] Step A31: Obtain an entropy decoder corresponding to the permission level according to the user permission level, the permission level of the current processing unit, and the corresponding bitstream, and obtain a set of contexts to parse the bitstream to be parsed.

[0181] As an example, an entropy decoder corresponding to the permission level is obtained according to the user permission level, the permission level of the current processing unit, and the corresponding code stream, and a set of contexts are obtained to parse the code stream to be parsed.

[0182] As an example, each processing unit of a different permission level uses a different entropy decoder and has a different entropy decoding state.

[0183] As an example, for a current processing unit, a separate entropy decoder corresponding to its authority is used.

[0184] As an example, for the current processing unit, in addition to using a separate entropy decoder corresponding to its authority, a set of contexts is obtained to parse the code stream to be parsed.

[0185] As an example, non-minimum privilege level processing units all use the first set of contexts of the lowest privilege level processing unit as their second set of contexts. Only the lowest privilege level processing unit can update its first set of contexts, and non-minimum privilege level processing units cannot update any contexts.

[0186] As an example, if the permission level of the current processing unit is the same as or higher than that of the previous processing unit, the context of the previous processing unit is updated; if the permission level of the current processing unit is lower than that of the previous processing unit, the context of the previous processing unit is initialized.

[0187] As an example, current processing units of different permission levels all use a set of contexts, and current processing units of the same level share a set of contexts.

[0188] As an example, the following situations can be considered:

[0189] 1): Obtain the authority of the current processing unit. When the current processing unit (lowest authority level) uses the entropy decoder for decoding, the context used is the first set of contexts. Among them, only the processing unit with the lowest authority level can update its corresponding context, that is, the first set of contexts. When the current processing unit (non-lowest authority level) uses the entropy decoder for decoding, the context used is the second set of contexts that is a copy of the updated first set of contexts. In case 1), only one set of contexts needs to be saved (the first set of contexts updated by the lowest authority level).

[0190] 2): As an example, the context corresponding to the lowest authority level processing unit is the first set of contexts, and the context corresponding to the non-lowest authority level processing unit is the second set of contexts. Before obtaining the second set of contexts, the updated first set of contexts is copied and updated.

[0191] Specifically, the entropy decoder corresponding to the lowest privilege level processing unit uses the context of the lowest privilege level. For the entropy decoder corresponding to the processing unit not at the lowest privilege level, all the updated contexts corresponding to the current lowest level are first copied. If any context is allowed to be updated (the level of the current processing unit is higher than or equal to the level of the previous processing unit), all the updated contexts obtained are updated for the current processing unit to use for decoding the corresponding bitstream to be parsed.

[0192] After the decoding of the code stream to be parsed by the current processing unit is completed, the context state is restored to the context corresponding to the processing unit with the lowest privilege level. In 2), two sets of contexts need to be saved (the context corresponding to the processing unit with the lowest privilege level, and the context obtained by copying and updating the first set of contexts after updating), but the context corresponding to the processing unit with the lowest privilege level can be used by processing units of all privilege levels.

[0193] 3) If the level of the current processing unit is higher than or equal to the level of the previous processing unit, the context updated by the previous processing unit is allowed to be updated; otherwise, the context updated by the previous processing unit is initialized.

[0194] 4) Since the context is a set rather than a single one, that is, different syntaxes exist during entropy decoding, and some syntaxes correspond to separate contexts, when updating the context, only the context of some syntax elements corresponding to the current processing unit can be updated, or the context of all syntax elements corresponding to the current processing unit can be updated.

[0195] In this embodiment, an entropy decoder corresponding to the permission level is obtained based on the user permission level, the permission level of the current processing unit, and the corresponding bitstream, and a set of contexts are obtained to parse the bitstream to be parsed, thereby improving decoding efficiency.

[0196] Furthermore, based on the above embodiments of the present application, another embodiment of the present application is provided. In this embodiment,

[0197] The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit includes:

[0198] Step A23: Obtain the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit's authority level.

[0199] As an example, the code stream to be parsed of the current processing unit is obtained according to the user authority level and the authority level of the current processing unit, the code stream splicing method, and the start code and / or end code of the code stream of the current processing unit authority level.

[0200] As an example, the starting position of the code stream of the current processing unit can be found according to the start codes existing in the code streams between different permission levels, and the code stream to be parsed of the current processing unit can be obtained.

[0201] As an example, the starting position of the code stream of the current processing unit is found according to the code stream lengths of different levels, and the code stream to be parsed of the current processing unit is obtained.

[0202] As an example, Figure 6 The following is a diagram showing the code stream structure. Figure 7 It is the composition of the code stream within the image data.

[0203] As an example, if the splicing method of the code streams of different processing units is a frame-level splicing method.

[0204] The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level, includes:

[0205] Step A231, reading the position of the end code of the current frame and / or the position of the start code of the next frame;

[0206] As an example, the current processing unit directly reads the position of the end code of the current frame and / or the position of the start code of the next frame.

[0207] Step A232: Based on the user's permission level and the permission level of the current processing unit, if the current processing unit is the first processing unit under the current permission level of the current frame, the starting position of the code stream of the current processing unit is derived based on the position of the current frame's end code and / or the position of the next frame's start code, as well as the start code of the code stream under the current permission level or the length of the permission code stream of the previous permission level of the current permission. Otherwise, the starting position of the code stream of the current processing unit is directly obtained, where the current permission level refers to the permission level corresponding to the current processing unit, to parse the code stream to be parsed. After the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated.

[0208] As an example, if the splicing mode of the code streams of different processing units is frame-level splicing, that is, the current processing unit parses the code stream based on frame-level splicing, such as Figure 8, which shows the newly added non-minimum privilege area information (high privilege area information). At this time, based on the user privilege level and the privilege level of the current processing unit, if the current processing unit is the first processing unit under the current privilege level of the current frame, the starting position of the code stream of the current processing unit is derived based on the position of the current frame end code and / or the position of the next frame start code, as well as the start code of the code stream under the current privilege level or the length information of the privilege code stream of the previous privilege level of the current privilege. Otherwise, the starting position of the code stream of the current processing unit is directly obtained (where the current privilege level refers to the privilege level corresponding to the current processing unit), and then the current code stream to be parsed is obtained. After parsing is completed, the starting position of the privilege code stream corresponding to the current processing unit is updated so that the next processing unit of the corresponding privilege level can quickly obtain the starting position of its corresponding privilege code stream.

[0209] If the splicing method of the code streams of different processing units is slice-level splicing,

[0210] The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level, includes:

[0211] Step A233, reading the starting position of the non-minimum privilege level code stream and the starting position of the next slice and / or the ending code position of the current slice;

[0212] Step A234: Based on the user's permission level and the permission level of the current processing unit, if the current processing unit is the first processing unit under the current permission level of the current slice, the starting position of the code stream of the current processing unit is derived based on the position of the end code of the current slice and / or the position of the start code of the next slice, as well as the start code of the code stream under the current permission level or the length of the permission code stream of the previous permission of the current permission. Otherwise, the starting position of the code stream of the current processing unit is directly obtained to parse the code stream to be parsed. After the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated.

[0213] like Figure 9 As shown, the slice-level code stream is spliced ​​(in this embodiment, the high-authority area start code and high-authority area information are newly added). The slice-level code stream is spliced ​​as follows: the first segment is the 0th-order level information, the second segment is the 1st-order level information (including the start code of the 1st-order level information), and the nth segment is the n-1st-order level information (including the start code of the nth-order level information).

[0214] As an example, similar to the frame-level splicing method, if different processing units are spliced ​​at the slice (patch) level, then if the current processing unit is the first processing unit at the current permission level of the current slice, the starting position of the code stream of the current processing unit is derived based on the position of the current slice end code and / or the position of the next slice start code, as well as the start code of the code stream at the current permission level or the length information of the previous permission code stream of the current permission. Otherwise, the starting position of the code stream of the current processing unit is directly obtained, and the code stream to be parsed is obtained and parsed. After the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated so that the next processing unit can obtain its corresponding permission code stream.

[0215] As an example, if the splicing method of the code streams of different processing units is the largest processing unit lcu level splicing method,

[0216] The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level, includes:

[0217] Step A235, reading the starting position of the non-minimum privilege level code stream and the starting position of the next ICU level and / or the ending code position of the LCU level;

[0218] Step A236: Based on the user authority level and the authority level of the current processing unit, if the current processing unit is the first processing unit under the current authority level of the current LCU, the starting position of the code stream of the current processing unit is derived based on the position of the current LCU end code and / or the position of the next LCU start code and the start code of the code stream under the current authority level or the length information of the previous authority code stream of the current authority. Otherwise, the starting position of the code stream of the current processing unit is directly obtained to parse the code stream to be parsed. After the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated.

[0219] like Figure 10 The figure shows the splicing of the lcu level code stream (in this embodiment, the lcu start code, high authority area start code and high authority area information are added);

[0220] As an example, the code stream parsing based on LCU (largest decoding unit) splicing is similar to slice-level splicing. If the current processing unit is the first processing unit under the current permission level of the current LCU, the starting position of the code stream of the current processing unit is derived based on the position of the current LCU end code and / or the position of the next LCU start code and the start code of the code stream under the current permission level or the length information of the previous permission code stream of the current permission. Otherwise, the starting position of the code stream of the current processing unit is directly obtained to obtain the code stream to be parsed. Then, after the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated.

[0221] The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level, includes:

[0222] The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level, includes:

[0223] Step A237: If the permission level of the current processing unit is not the lowest level and the permission of the current processing unit is not equal to the permission of the previous processing unit, then the start code of the permission level of the current processing unit, or the end code of the previous processing unit, or the length of the code stream of the previous processing unit is obtained. Based on the start code of the permission level of the current processing unit, or the end code of the previous processing unit, or the length of the code stream of the previous processing unit and the starting position of the code stream of the previous processing unit, the starting position of the code stream of the current processing unit is derived. Otherwise, the starting position of the current processing unit is derived based on the starting position of the code stream of the previous processing unit.

[0224] As an example, code stream parsing based on CU (decoding unit) splicing is similar to LCU-level splicing. If the permission level of the current processing unit is not the lowest level and the permission of the current processing unit is not equal to the permission of the previous processing unit, the start code of the permission level of the current processing unit, or the end code of the previous processing unit, or the code stream length of the previous processing unit is obtained. Based on the obtained start code of the permission level of the current processing unit, or the end code of the previous processing unit, or the code stream length of the previous processing unit and the starting position of the code stream of the previous processing unit, the starting position of the code stream of the current processing unit is derived. Otherwise, the starting position of the current processing unit is derived based on the starting position of the code stream of the previous processing unit to obtain the code stream to be parsed and parse it. After the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated so that the next processing unit can obtain the updated starting position and process it.

[0225] In this embodiment, the code stream to be parsed of the current processing unit is obtained based on the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit's authority level, and the code stream to be parsed of the current processing unit is quickly found to meet the parsing requirements.

[0226] Based on the above embodiment, this embodiment also provides an encoding method, such as Figure 2 As shown, the encoding method includes:

[0227] Step S10, obtaining a frame image to be encoded, and determining position information of regions of different authority levels in the frame image to be encoded;

[0228] Step S20: dividing the frame image to be encoded into processing units based on the position information;

[0229] Among them, each divided processing unit only corresponds to an area of ​​one permission level;

[0230] Step S30: Obtain an entropy encoder corresponding to the permission level for the relevant coding coefficients corresponding to the processing units in the different permission level areas, encode them respectively to obtain different bitstreams, and splice the different bitstreams; wherein the bitstream is placed within the bitstream information of the current frame, and the bitstream information within the current frame includes the bitstream of the lowest permission level and at least one bitstream with a higher permission level; when the user permission level is greater than or equal to the permission level of the current processing unit, the bitstream to be parsed is equal to the bitstream of the permission level of the current processing unit, and the bitstream to be parsed of a non-lowest permission level includes the bitstream of the lowest permission level and at least one bitstream with a higher permission level.

[0231] In this embodiment, each divided processing unit corresponds to only one permission level region, and the code stream is placed within the code stream information of the current frame. The code stream information within the current frame includes the code stream of the lowest permission level and at least one code stream with a higher permission level. When the user's permission level is greater than or equal to the permission level of the current processing unit, the code stream to be parsed is equal to the code stream of the permission level of the current processing unit. The code streams to be parsed for non-lowest permission levels include the code stream of the lowest permission level and at least one code stream with a higher permission level. This avoids waste caused by encoding multiple code streams.

[0232] In this embodiment: each processing unit after division corresponds to only one permission level area, which not only avoids the confidentiality of non-lowest permission level areas from being damaged (large blocks of lowest permission level areas are divided into the lowest level), but also avoids the lowest permission level areas from being unable to be effectively restored during decoding (large blocks of lowest level areas are divided into non-lowest level areas, resulting in the inability to refer to large blocks during restoration and causing ineffective restoration).

[0233] As an example, during the encoding process of this application, when the divided processing unit corresponds to areas of multiple permission levels, the divided processing unit continues to be divided until the continued divided processing unit has been divided to a preset division depth, or the continued divided processing unit only corresponds to an area of ​​one permission level. In this embodiment, the processing unit will not be divided indefinitely to avoid excessive resource or excessive consumption of time.

[0234] As an example, during the encoding process of this application, after the processing unit is divided to a preset division depth, if the divided processing unit still corresponds to areas with multiple permission levels, the permission level of the area corresponding to the divided processing unit will be adjusted to the highest permission level of the area, thereby facilitating the correspondence between code streams of different permissions and corresponding permission users.

[0235] As an example, based on the position information, the frame image to be encoded is divided into processing units. If each processing unit after division corresponds to only one permission level area, it is allowed to be further divided or not to be further divided to meet different encoding requirements.

[0236] As an example, when further division of a processing unit corresponding to only one permission level area is allowed, it is further divided into different sizes to meet different coding requirements.

[0237] As an example, the present application adopts different entropy encoders to encode processing units in areas with different permission levels, thereby meeting the encoding requirements of processing units in areas with different permission levels.

[0238] As an example, by using different entropy encoders and obtaining a set of contexts, the relevant coding coefficients corresponding to the processing units in different permission level areas are encoded separately to obtain different code streams, which can adapt to different coding scenarios and improve coding efficiency.

[0239] As an example, the context corresponding to the lowest authority level processing unit is the first set of contexts, and the context corresponding to the non-lowest authority level processing unit is the second set of contexts. Before obtaining the second set of contexts, the updated first set of contexts is copied and updated to avoid wasting resources due to excessive storage of contexts.

[0240] As an example, all non-minimum authority level processing units use the first set of contexts of the lowest authority level processing unit as their second set of contexts. Only the lowest authority level processing unit can update its first set of contexts, and non-minimum authority level processing units cannot update any contexts. This embodiment can avoid waste of resources.

[0241] As an example, if the permission level of the current processing unit is the same as or higher than that of the previous processing unit, the context of the previous processing unit is updated; if the permission level of the current processing unit is lower than that of the previous processing unit, the context of the previous processing unit is initialized to meet different encoding requirements.

[0242] As an example, current processing units of different permission levels all use a set of contexts, and current processing units of the same level share a set of contexts to avoid waste of resources.

[0243] As an example, different entropy encoders are used to encode the relevant coding coefficients and adjustment parameters corresponding to the processing units of different permission level areas, and then encode them into different code streams accordingly, thereby meeting the adjustment requirements of the corresponding coding coefficients of different permission level areas.

[0244] As an example, the quantization step adjustment parameters of the processing units in different permission level areas are encoded into the code stream corresponding to the processing unit in the lowest permission area, so that the corresponding coding coefficients (processing units) of each permission level area can refer to the quantization step adjustment parameters.

[0245] As an example, the different code streams may be spliced ​​in a picture-level code stream splicing manner, a slice-level code stream splicing manner, a maximum processing unit-level code stream splicing manner, or a processing unit-level code stream splicing manner.

[0246] As an example, at the position of the end code of the current frame and / or the position of the start code of the next frame, according to the permission level of the non-minimum permission level processing unit, the start code and / or end code of the permission code stream corresponding to the non-minimum permission level processing unit and the permission level code stream of the non-minimum permission level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed, or at the starting position of the non-minimum permission level code stream and the starting position of the next slice and / or the end code position of the current slice, the start code and / or end code of the permission code stream corresponding to the non-minimum permission level processing unit and the permission level code stream of the non-minimum permission level processing unit, and / or the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed. The start code and / or end code of the permission code stream corresponding to the non-lowest permission level processing unit and the permission level code stream of the non-lowest permission level processing unit are spliced ​​and placed at the starting position of the non-lowest permission level code stream and the starting position of the next LCU level and / or the end code position of the LCU level, and / or the code stream of the length information of the code stream corresponding to the non-lowest permission level processing unit; or if the permission of the current processing unit is not equal to the permission of the previous processing unit, the start code of the code stream of the current processing unit and / or the end code of the code stream of the previous processing unit and / or the length information of the code stream corresponding to the previous processing unit are encoded and then written into the code stream of the current processing unit, so as to facilitate the subsequent rapid retrieval of the code stream to be parsed of the corresponding processing unit and improve the decoding efficiency.

[0247] Figure 4 This corresponds to a commonly used video coding framework, which is applicable to this application and includes modules such as prediction, transformation, quantization, entropy coding and filtering. Each module is briefly introduced.

[0248] (1): The prediction module includes intra-frame prediction and inter-frame prediction. Intra-frame prediction uses the reconstructed pixels around the current block to make predictions and remove spatial redundancy; inter-frame prediction uses the reconstructed pixels on the time domain reference frame to make predictions and remove temporal redundancy.

[0249] (2): The transformation module linearly maps the residual information in the spatial domain to the transformation domain (such as the frequency domain). The goal is to make the energy more concentrated and remove the frequency domain correlation of the signal. Theoretically, the transformation matrix is ​​reversible and will not cause signal loss.

[0250] (3): The quantization module is a "many-to-one" mapping process, which is irreversible and will cause signal loss; the advantage is that it can greatly reduce the value range of the signal, allowing the encoder to give a good approximation of the original signal with a small number of symbols, thereby improving the compression rate.

[0251] (4): The entropy coding module is a lossless coding method based on the principle of information entropy. It converts a series of element symbols used to represent the video sequence (such as transformation coefficients and mode information, etc.) into a binary code stream, removing the statistical redundancy of these video element symbols.

[0252] (5): The filtering module will enhance the reconstructed image, with the goal of making the reconstructed image closer to the original image, while reducing the impact of blocking and ringing effects, and improving the quality of the reconstructed image.

[0253] The above explanation uses encoding as an example. Video decoding and encoding are parallel processes. Video decoding typically involves entropy decoding, prediction, inverse quantization, inverse transform, and filtering. The implementation principles of each process are the same or similar to those of entropy encoding. Filtering includes deblocking filtering, sample adaptive offset filtering, adaptive loop filtering, and neural network-based filtering.

[0254] The specific steps are as follows:

[0255] Step S10, obtaining a frame image to be encoded, and determining position information of regions of different authority levels in the frame image to be encoded;

[0256] As an example, the frame image to be encoded does not specifically refer to a fixed video image, but may refer to any frame image in the original video.

[0257] As an example, the frame image to be encoded can be divided into areas with different permission levels;

[0258] As an example, the different permission level areas may be two permission level areas or multiple permission level areas.

[0259] As an example, the frame image to be encoded is divided into two permission level areas, specifically, areas that need to be masked or areas that do not need to be masked;

[0260] As an example, the frame image to be encoded is divided into multiple permission level areas, such as three permission level areas, which can be specifically divided into a first permission level area, a second permission level area, a third permission level area, and the like.

[0261] As an example, assuming that the monitoring scene includes a license plate area, the license plate area in the frame image to be encoded can be set in advance as the area to be masked, and other non-license plate areas can be set as areas that do not need to be masked.

[0262] As an example, assuming that the scene includes a person's face area, an ID card area, and other areas, the other areas can be pre-set as the third permission level area, the face area as the second permission level area, and the ID card area as the first permission level area. Among them, the first permission level area has the highest permission level.

[0263] As an example, after obtaining the frame image to be encoded, the position information of the areas of different permission levels in the frame image to be encoded may be determined based on the configuration file.

[0264] As an example, after obtaining the frame image to be encoded, the position information of the regions of different permission levels in the frame image to be encoded may be determined based on other input methods.

[0265] As an example, after obtaining the frame image to be encoded, the position information of the first permission level area, the second permission level area, and the third permission level area in the frame image to be encoded is determined.

[0266] Step S20: dividing the frame image to be encoded into processing units based on the position information;

[0267] Among them, each divided processing unit (coding unit) corresponds to only one permission level area;

[0268] As an example, the frame image to be encoded is divided into processing units based on the location of the permission level area.

[0269] As an example, the divided processing units may be lcu (largest processing unit / macroblock) units, or smaller units such as PU (prediction unit) or TU (transform unit).

[0270] As an example, for the permission level area, the permission is marked with m*n as the smallest unit.

[0271] As an example, when dividing the processing units, the division restrictions on the processing units are imposed with m*n as the minimum permission unit.

[0272] As an example, the division of processing units must be strictly based on the m*n permission tags (one processing unit corresponds to one permission tag).

[0273] As an example, when the divided processing unit corresponds to areas of multiple permission levels, the divided processing unit is further divided until the further divided processing unit has been divided to a preset division depth, or the further divided processing unit corresponds to an area of ​​only one permission level.

[0274] That is, as an example, the division of the processing units does not necessarily have to be strictly divided according to the m*n permission tags (one processing unit corresponds to multiple permission tags).

[0275] That is, as an example, the division of processing units does not necessarily have to be strictly based on the m*n permission mark. It is also reflected in the following: if the divided processing units are divided to the preset division depth, the size of the divided processing units is greater than m*n, and the corresponding permission level area still has multiple different permission levels, then the division will no longer continue.

[0276] As an example, if the divided processing unit is divided to the preset division depth and the size of the divided processing unit is 16*16 (m*n is 8*8), and the corresponding permission level area has multiple different permission levels, the division will no longer continue.

[0277] As an example, after the processing unit is divided to a preset division depth, if the divided processing unit still corresponds to areas of multiple permission levels, the permission level of the area corresponding to the divided processing unit is adjusted to a non-minimum permission level of the area.

[0278] As an example, if the divided processing unit is divided to a preset division depth, the level of the corresponding area is the non-lowest authority level among the corresponding authority levels (multiple authority levels) of the area rather than all areas;

[0279] As an example, if the divided processing unit is divided to a preset division depth, and the level of its corresponding area is two different authority levels, the highest level of the two different authority levels is the level of the corresponding area.

[0280] As an example, if after the frame image to be encoded is divided into processing units, the divided processing units are not divided to the preset division depth, and they correspond to more than one permission level area, then they will continue to be divided, that is, the divided processing units will continue to be divided until the continued divided processing units have been divided to the preset division depth, or the continued divided processing units only correspond to an area of ​​one permission level.

[0281] As an example, if the frame image to be encoded is divided into processing units cu, and the divided processing units correspond to one permission level area, no further division is performed.

[0282] As an example, for a frame image to be encoded, the processing units divided therein may include lcu (largest processing unit / macroblock) units, or may include smaller units such as PU (prediction unit) or TU (transform unit).

[0283] As an example, since each processing unit after division corresponds to only one area of ​​permission level, when the processing unit after division corresponds to areas of multiple permission levels, the processing unit after division continues to be divided until the processing unit to be divided has been divided to the preset division depth, or the processing unit to be divided only corresponds to an area of ​​one permission level. Therefore, areas of different permission levels will not be divided too much, so that subsequent targeted encoding can be performed based on the reasonably divided permission level areas, that is, the relevant coding coefficients corresponding to the processing units of different permission level areas (the relevant coding coefficients include the residual information and prediction mode information obtained by the previous encoding operation of the current permission level area) are reasonably encoded to obtain a spliced ​​data stream, which not only avoids the confidentiality of non-lowest permission level areas from being damaged (large blocks of non-lowest permission level areas are divided into low levels), but also avoids the low permission level areas from being unable to be effectively restored during decoding (large blocks of low-level areas are divided into high-level areas, resulting in the inability to refer to the large blocks during restoration and resulting in ineffective restoration).

[0284] As an example, based on the position information, the frame image to be encoded is divided into processing units. If each processing unit after division corresponds to only one permission level area, it is allowed to be further divided or not to be further divided to meet different encoding requirements.

[0285] As an example, if each processing unit (16*16) after division corresponds to only one permission level area, further division is not allowed.

[0286] Or as an example, if each processing unit (16*16) after division corresponds to only one permission level area, further division (dividing into 8*8) is allowed.

[0287] As an example, when further division of a processing unit corresponding to only one permission level area is allowed, it is further divided into different sizes (divided into 4*4, and / or 8*8, and / or 16*16, etc.).

[0288] Step S30: Obtain an entropy encoder corresponding to the permission level for the relevant coding coefficients corresponding to the processing units in the different permission level areas, encode them respectively to obtain different bitstreams, and splice the different bitstreams; wherein the bitstream is placed within the bitstream information of the current frame, and the bitstream information within the current frame includes the bitstream of the lowest permission level and at least one bitstream of a level greater than the lowest permission level; when the user permission level is greater than or equal to the permission level of the current processing unit, the bitstream to be parsed is equal to the bitstream of the permission level of the current processing unit, and the bitstream to be parsed of a non-lowest permission level includes the bitstream of the lowest permission level and at least one bitstream of a level greater than the lowest permission level;

[0289] As an example, during encoding, relevant encoding coefficients corresponding to processing units in areas with different permission levels are encoded separately to obtain a spliced ​​data stream.

[0290] As an example, during encoding, relevant coding coefficients corresponding to processing units in different permission level areas are encoded separately to obtain a spliced ​​data stream, that is, in this embodiment, there is only one data stream instead of multiple data streams.

[0291] As an example, the code stream is placed within the code stream information of the current frame, and the code stream information within the current frame includes the code stream of the lowest permission level and at least one code stream with a level greater than the lowest permission level. When the user permission level is greater than or equal to the permission level of the current processing unit, the code stream to be parsed is equal to the code stream with the permission of the current processing unit, and the code stream to be parsed of a non-lowest permission level includes the code stream of the lowest permission level and at least one code stream with a level greater than the lowest permission level.

[0292] As an example, the relevant coding coefficients include residual information and prediction mode information obtained by performing a previous coding operation on the current permission level region, such as Figure 4 shown.

[0293] As an example, the residual information refers to the difference between the original pixels and the predicted pixels of the image to be encoded.

[0294] As an example, the prediction signal is obtained based on the reconstructed pixels of the spatial neighboring blocks of the current block (in the same frame image as the current block) or the temporal neighboring blocks of the current block (in different images as the current block).

[0295] As an example, the closer the predicted pixel is to the original pixel, the smaller the residual energy obtained by subtracting the two pixels, and the higher the coding compression performance.

[0296] As an example, the step of respectively encoding the relevant coding coefficients corresponding to the processing units of the areas with different permission levels to obtain different code streams includes the following steps S31-S32:

[0297] In step S31 , different entropy encoders are used to encode the relevant coding coefficients corresponding to the processing units in the different permission level areas respectively to obtain different code streams.

[0298] As an example, if the relevant coding coefficients corresponding to the processing units in the areas of different permission levels are respectively encoded using different entropy encoders, different code streams are obtained.

[0299] As an example, the relevant coding coefficients corresponding to the processing units of the first permission level area are encoded using a first entropy encoder, the relevant coding coefficients corresponding to the processing units of the second permission level area are encoded using a second entropy encoder, and the relevant coding coefficients corresponding to the processing units of the third permission level area are encoded using a third entropy encoder to obtain different code streams.

[0300] As an example, other information of the frame image to be encoded is encoded using the entropy encoder of the processing unit corresponding to the lowest authority level area.

[0301] As an example, after obtaining the code streams corresponding to areas of different permission levels, the different code streams are spliced ​​to obtain a spliced ​​data stream.

[0302] As an example, after obtaining the code streams corresponding to areas of different permission levels, different encoding methods are used to splice the different code streams to obtain a spliced ​​data stream.

[0303] The step of encoding the relevant coding coefficients corresponding to the processing units of the different permission level areas using different entropy encoders to obtain different bit streams includes the following steps S32:

[0304] In step S32 , different entropy encoders are used to encode the relevant coding coefficients and adjustment parameters corresponding to the processing units in the different permission level areas, and the encoding is correspondingly encoded into different bit streams.

[0305] As an example, the adjustment parameter may be a qp (quantization) parameter.

[0306] As an example, for the QP (quantization) parameter of the processing unit in the A1 permission level area, it is encoded together with the relevant coding coefficients corresponding to the processing unit in the A1 permission level area using the corresponding entropy encoder and encoded into the corresponding code stream.

[0307] As an example, for the QP (quantization) parameters of the processing units in the b1 permission level area (higher than the a permission level), they are encoded together with the relevant coding coefficients corresponding to the processing units in the b1 permission level area using the corresponding entropy encoder and encoded into the corresponding bit stream.

[0308] As an example, for the adjustment parameters of the processing units of different permission level areas, they and the relevant coding coefficients corresponding to the processing units of different permission level areas are encoded respectively using different entropy encoders, and encoded into different code streams accordingly. Then, the processing units corresponding to the low permission level area (a1 permission level area) cannot refer to the adjustment parameters corresponding to the processing units corresponding to the non-lowest permission level area (b1 permission level area) (the non-lowest permission level area is such as the b1 permission level area corresponding code stream), and the processing units corresponding to the non-lowest permission level area can refer to the adjustment parameters corresponding to the processing units corresponding to the low permission level area (the low permission level area is such as the a1 permission level area corresponding code stream).

[0309] As an example, the adjustment parameters further include a quantization step adjustment parameter. The quantization step adjustment parameters of the processing units in different permission level areas are all placed in the code stream corresponding to the lowest permission area.

[0310] As an example, if the quantization step adjustment parameters are all placed in the code stream corresponding to the lowest authority area (such as the a1 authority level area is the lowest authority area), then if the processing units are allowed to be adjusted one by one, the processing units corresponding to each different authority level area (such as the b1 authority level area) can all be adjusted based on the quantization step adjustment parameters.

[0311] Before the step of encoding the relevant coding coefficients corresponding to the processing units of the different permission level areas using different entropy encoders to obtain different bit streams, the method includes the following steps S01-S03:

[0312] Step S01, determining a reference area of ​​a current authority level area, wherein the reference area is an authority area whose authority level is lower than or equal to the current level and whose pixels have been reconstructed;

[0313] In this embodiment, how to obtain residual information is described.

[0314] As an example, a reference area of ​​the current authority level area is first determined, wherein when determining the residual information at the encoding end, the reference area is clearly defined as an authority area with an authority level lower than or equal to the current level and reconstructed pixels.

[0315] As an example, if the current permission level area is a b2 permission level area, and the spatially adjacent blocks of the b2 permission level area are a1 permission level area, b1 permission level area, and c1 permission level area, where the permission of the a1 permission level area is lower than that of the b2 permission level area, the permission of the a1 permission level area is equal to that of the b2 permission level area, and the permission of the c1 permission level area is greater than that of the b2 permission level area, then it is determined that the permission level of the reference area of ​​the current b2 permission level area is lower than or equal to the current level (the reference area is an a1 permission level area or a b1 permission level area, but not a c1 permission level area), and the reference area is the permission area of ​​the reconstructed pixels.

[0316] Step S02, using the optimal reconstructed pixel corresponding to the reference area as the predicted pixel of the current authority level area;

[0317] As an example, the optimal reconstructed pixel corresponding to the reference area is used as the predicted pixel of the current authority level area.

[0318] As an example, if the reference area is the a1 permission level area or the b1 permission level area, the optimal reconstructed pixel is selected from the reconstructed pixels corresponding to the a1 permission level area or the b1 permission level area as the predicted pixel of the current permission level area.

[0319] As an example, if the reference area is an a1 authority level area or a b1 authority level area, the reconstructed pixel with the highest similarity to the current area is selected from the reconstructed pixels corresponding to the a1 authority level area or the b1 authority level area as the predicted pixel of the current authority level area.

[0320] Step S03: determining residual information of the current authority level area based on the predicted pixels.

[0321] As an example, the residual information between the predicted pixel and the current area pixel is directly calculated.

[0322] The present application provides a coding and decoding method, apparatus, device and storage medium. Compared with the related art in which the sensitive information area in the video frame is roughly divided into processing units, that is, the entire macroblock is judged as the sensitive information area or the non-sensitive information area, resulting in unreasonable coding, in the present application, due to obtaining the frame image to be encoded, the position information of the areas with different permission levels in the frame image to be encoded is determined; based on the position information, the frame image to be encoded is divided into processing units; wherein each processing unit after division corresponds to only one permission level area; the relevant coding coefficients corresponding to the processing units of the areas with different permission levels are encoded respectively, and different codes are obtained. Stream, and splice the different code streams, therefore, different permission level areas will not be divided too much (sensitive information area or non-sensitive information area), so that subsequent targeted and reasonable encoding can be performed based on the reasonably divided permission level areas, that is, the relevant coding coefficients corresponding to the processing units of different permission level areas are reasonably encoded to obtain a spliced ​​data stream, which can avoid the confidentiality of non-lowest permission level areas from being damaged (large blocks of non-lowest permission level areas are divided into low levels), and can also avoid the low permission level areas from being unable to be effectively restored during decoding (large blocks of low level areas are divided into non-lowest level areas, resulting in the inability to refer to the large blocks during restoration and resulting in ineffective restoration).

[0323] Furthermore, based on the above-mentioned embodiment of the present application, another embodiment of the present application is provided. In this embodiment, the step of using different entropy encoders to respectively encode the relevant coding coefficients corresponding to the processing units of different permission level areas to obtain different code streams includes:

[0324] In step M1, different entropy encoders are used and a set of contexts are obtained to encode the relevant coding coefficients corresponding to the processing units in the different permission level areas respectively to obtain different code streams.

[0325] As an example, each processing unit of a different permission level uses a different entropy encoder and has a different entropy encoding state.

[0326] As an example, the processing unit of each permission level area obtains a separate entropy encoder and a set of contexts to parse the code stream to be parsed.

[0327] As an example, the processing unit of each permission level region obtains a separate entropy encoder, that is, each different processing unit has a different entropy coding state.

[0328] As an example, the processing unit of each permission level area obtains a separate entropy encoder and also obtains a set of contexts to parse the code stream to be parsed.

[0329] As an example, the context corresponding to the lowest permission level processing unit is the first set of contexts, and the context corresponding to the non-lowest permission level processing unit is the second set of contexts. Before obtaining the second set of contexts, the updated first set of contexts is copied and updated.

[0330] As an example, the lowest privilege level processing unit uses the first set of contexts of the lowest privilege level processing unit as its second set of contexts. Only the lowest privilege level processing unit can update its first set of contexts, and non-lowest privilege level processing units cannot update any contexts.

[0331] As an example, if the permission level of the current processing unit is the same as or higher than that of the previous processing unit, the context of the previous processing unit is updated; if the permission level of the current processing unit is lower than that of the previous processing unit, the context of the previous processing unit is initialized.

[0332] As an example, current processing units of different permission levels all use a set of contexts, and current processing units of the same level share a set of contexts.

[0333] As an example, the following situations can be considered:

[0334] 1): Obtain the authority of the current processing unit. When the current processing unit (lowest authority level) uses the entropy encoder for encoding, the context used is the first set of contexts. Among them, only the processing unit with the lowest authority level can update its corresponding context, that is, the first set of contexts. When the current processing unit (not the lowest authority level) uses the entropy encoder for encoding, the context used is the second set of contexts that is a copy of the updated first set of contexts. In case 1), only one set of contexts needs to be saved (the first set of contexts updated with the lowest authority level).

[0335] 2): As an example, the context corresponding to the lowest authority level processing unit is the first set of contexts, and the context corresponding to the non-lowest authority level processing unit is the second set of contexts. Before obtaining the second set of contexts, the updated first set of contexts is copied and updated.

[0336] Specifically, the entropy encoder corresponding to the processing unit with the lowest authority level uses the context of the lowest authority level. For the entropy encoder corresponding to the processing unit with a non-lowest authority level, all the updated contexts corresponding to the current lowest level are first copied. If any context is allowed to be updated (the level of the current processing unit is higher than or equal to the level of the previous processing unit), all the updated contexts obtained are updated for the current processing unit to use for encoding the corresponding bitstream to be parsed.

[0337] After the encoding of the code stream to be parsed by the current processing unit is completed, the context state is restored to the context corresponding to the lowest-privilege-level processing unit. In 2), two sets of contexts need to be saved (the context corresponding to the lowest-privilege-level processing unit, and the context after copying and updating the first set of contexts), but the context corresponding to the lowest-privilege-level processing unit can be used by all processing units of the same privilege level.

[0338] 3) If the level of the current processing unit is higher than or equal to the level of the previous processing unit, the context updated by the previous processing unit is allowed to be updated; otherwise, the context updated by the previous processing unit is initialized.

[0339] 4) Since the context is a set rather than a single one, that is, different syntaxes exist during entropy coding, and some syntaxes correspond to separate contexts, when updating the context, only the context of some syntax elements corresponding to the current processing unit can be updated, or the context of all syntax elements corresponding to the current processing unit can be updated.

[0340] In this embodiment, for processing units with different permissions, corresponding contexts are used for encoding, which is suitable for different encoding scenarios.

[0341] Furthermore, based on the above embodiment of the present application, another embodiment of the present application is provided. In this embodiment, the step of splicing the different code streams includes:

[0342] Step N10, splicing the different code streams in a preset splicing method;

[0343] The preset splicing method includes a frame-level splicing method, a slice-level splicing method, an lcu-level splicing method or a cu-level splicing method.

[0344] The splicing method includes an image-level code stream splicing method, a slice-level code stream splicing method, a maximum processing unit-level code stream splicing method, or a processing unit-level code stream splicing method;

[0345] Among them, in the image-level code stream splicing method, slice-level code stream splicing method, maximum processing unit-level code stream splicing method, and processing unit-level code stream splicing method, the code streams corresponding to the permission areas of non-lowest permission levels are placed in different code stream structures.

[0346] As an example, in the image-level code stream splicing method and the slice-level code stream splicing method, the code stream (including the length information code stream) corresponding to the permission area of ​​the non-lowest permission level is placed in the extended information of the image header of the image to be encoded.

[0347] As an example, the step of splicing the different code streams in a frame-level splicing manner includes:

[0348] Step N11: At the position of the end code of the current frame and / or the position of the start code of the next frame, according to the permission level of the non-minimum permission level processing unit, the start code and / or end code of the permission code stream corresponding to the non-minimum permission level processing unit and the permission level code stream of the non-minimum permission level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed.

[0349] As an example, Figure 8 As shown (refer to how to obtain the code stream to be parsed during decoding), at the position of the end code of the current frame and / or the position of the start code of the next frame, according to the permission level of the non-minimum permission level processing unit, the start code and / or end code of the permission code stream corresponding to the non-minimum permission level processing unit and the permission level code stream of the non-minimum permission level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed.

[0350] As an example, at the position of the end code of the current frame and / or the position of the start code of the next frame, the start code and / or end code of the permission code stream corresponding to the non-lowest permission level processing unit and the permission level code stream of the non-lowest permission level processing unit are spliced ​​and placed according to the permission level of the non-lowest permission level processing unit;

[0351] As an example, at the position of the end code of the current frame and / or the position of the start code of the next frame, the code stream corresponding to the code stream length information of the non-minimum authority level processing unit is spliced ​​and placed according to the authority level of the non-minimum authority level processing unit.

[0352] As an example, based on the permission level of the non-minimum permission level processing unit, the start code and / or end code of the permission level code stream corresponding to the non-minimum permission level processing unit and the code stream of the permission level code stream corresponding to the non-minimum permission level processing unit are spliced ​​and placed.

[0353] As an example, for processing units of different authority levels (3 levels), the code streams are sorted and placed in the order of the lowest authority level, the second lowest authority level, and the highest authority level, wherein corresponding start codes and / or end codes are set (the start codes and / or end codes of the authority code streams corresponding to the non-lowest authority level processing units and the authority level code streams of the non-lowest authority level processing units are spliced ​​and placed, and / or the code streams of the code stream length information corresponding to the non-lowest authority level processing units are spliced).

[0354] The step of splicing the different bitstreams in a slice-level splicing manner includes:

[0355] At the starting position of the non-minimum permission level code stream and the starting position of the next slice and / or the ending code position of the current slice, the start code and / or the ending code of the permission code stream corresponding to the non-minimum permission level processing unit and the permission level code stream of the non-minimum permission level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed.

[0356] As an example, in the slice-level splicing method, a start code of a non-minimum authority area is added to facilitate rapid acquisition of the corresponding bit stream during subsequent decoding.

[0357] As an example, the slice-level splicing method is as follows Figure 9 As shown (refer to how to obtain the code stream to be parsed during decoding), the start code and / or end code of the permission code stream corresponding to the non-minimum permission level processing unit and the permission level code stream of the non-minimum permission level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed at the start position of the non-minimum permission level code stream and the start position of the next slice and / or the end code position of the current slice.

[0358] As an example, the step of splicing the different code streams in an LCU-level splicing manner includes:

[0359] At the starting position of the non-minimum privilege level code stream and the starting position of the next LCU level and / or the end code position of the LCU level, the start code and / or end code of the privilege level code stream corresponding to the non-minimum privilege level processing unit and the privilege level code stream of the non-minimum privilege level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum privilege level processing unit are spliced ​​and placed.

[0360] As an example, in the slice-level splicing method, a new lcu start code and a start code of a non-minimum authority area are added to facilitate rapid acquisition of the corresponding bit stream during subsequent decoding.

[0361] As an example, the step of splicing the different code streams in a CU-level splicing manner includes:

[0362] If the permissions of the current processing unit are not equal to those of the previous processing unit, encode the start code of the current processing unit's code stream and / or the end code of the previous processing unit and / or the length of the code stream corresponding to the previous processing unit, and then write them into the code stream of the current processing unit.

[0363] In this embodiment, the different code streams are spliced ​​in a preset splicing method; the preset splicing method includes a frame-level splicing method, a slice-level splicing method, an lcu-level splicing method, or a cu-level splicing method, so that the code stream to be parsed of the current processing unit can be quickly found and obtained to meet the parsing requirements.

[0364] Reference Figure 3 , Figure 3 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.

[0365] like Figure 3 As shown, the decoding device may include: a processor 1001 , a memory 1005 , and a communication bus 1002 . The communication bus 1002 is used to implement connection and communication between the processor 1001 and the memory 1005 .

[0366] Optionally, the decoding device may further include a user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, a WiFi module, and the like. The user interface may include a display screen and an input submodule such as a keyboard. The optional user interface may also include a standard wired interface and a wireless interface. The network interface may include a standard wired interface and a wireless interface (such as a WiFi interface).

[0367] Those skilled in the art will understand that Figure 3 The decoding device structure shown in the figure does not constitute a limitation to the decoding device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0368] like Figure 3 As shown, memory 1005, which serves as a storage medium, may include an operating system, a network communication module, and a decoding program. The operating system is a program that manages and controls the hardware and software resources of the decoding device, supporting the operation of the decoding program and other software and / or programs. The network communication module is used to enable communication between the various components within memory 1005, as well as communication with other hardware and software in the decoding device.

[0369] exist Figure 3 In the decoding device shown, the processor 1001 is used to execute the decoding program stored in the memory 1005 to implement the steps of any one of the above-mentioned decoding methods.

[0370] The specific implementation of the decoding device of the present application is basically the same as the above-mentioned embodiments of the decoding method, and will not be repeated here.

[0371] The present application also provides a decoding device, comprising:

[0372] A first acquisition module is used to obtain the user authority level and the authority level of the current processing unit;

[0373] a second acquisition module, configured to acquire a code stream to be parsed of the current processing unit based on the user authority level and the authority level of the current processing unit; the code stream is acquired from code stream information within the current frame, where the code stream information within the current frame includes a code stream with a minimum authority level and at least one code stream with a level greater than the minimum authority level; when the user authority level is greater than or equal to the authority level of the current processing unit, the code stream to be parsed is equal to the code stream with the authority level of the current processing unit, and code streams to be parsed at a non-minimum authority level include a code stream with a minimum authority level and at least one code stream with a level greater than the minimum authority level;

[0374] The parsing module is used to obtain an entropy decoder corresponding to the permission level according to the user permission level, the permission level of the current processing unit and the corresponding code stream, parse the code stream to be parsed, and obtain the reconstructed image block of the current processing unit.

[0375] In a possible implementation manner of the present application, the device is used to implement:

[0376] The permission level of the current processing unit is obtained from the image header of the current frame or from the non-permission level code stream information of the current frame.

[0377] In a possible implementation manner of the present application, the current processing unit has only one authority level.

[0378] In a possible implementation of the present application, when obtaining the permissions of the current processing unit from the image header of the current frame, if it is determined that the current processing unit corresponds to multiple permission levels, the highest permission among the multiple permissions is used as the permission level of the current processing unit.

[0379] In a possible implementation manner of the present application, the device is used to implement:

[0380] The code stream to be parsed of the current processing unit is obtained according to the user authority level and the authority level of the current processing unit, wherein the code stream to be parsed includes a related coding coefficient code stream and an adjustment parameter code stream of the current processing unit.

[0381] In a possible implementation manner of the present application, the device is used to implement:

[0382] Obtaining the relevant coding coefficient stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit;

[0383] Obtain the quantization step size adjustment parameter bitstream from the lowest permission level bitstream.

[0384] In a possible implementation manner of the present application, the device is used to implement:

[0385] According to the user authority level, the authority level of the current processing unit and the corresponding code stream, an entropy decoder corresponding to the authority level is obtained, and a set of contexts is obtained to parse the code stream to be parsed.

[0386] In a possible implementation of the present application, the context corresponding to the lowest authority level processing unit is the first set of contexts, and the context corresponding to the non-lowest authority level processing unit is the second set of contexts. Before obtaining the second set of contexts, the updated first set of contexts is copied and updated.

[0387] In a possible implementation of the present application, when updating the context, only the context of some syntax elements corresponding to the current processing unit is updated, or the context of all syntax elements corresponding to the current processing unit is updated.

[0388] In one possible implementation of the present application, non-minimum authority level processing units all use the first set of contexts of the lowest authority level processing unit as their second set of contexts. Only the lowest authority level processing unit can update its first set of contexts, and non-minimum authority level processing units cannot update any contexts.

[0389] In one possible implementation of the present application, if the permission level of the current processing unit is the same as or higher than the permission level of the previous processing unit, the context of the previous processing unit is updated; if the permission level of the current processing unit is lower than that of the previous processing unit, the context of the previous processing unit is initialized.

[0390] In a possible implementation of the present application, current processing units of different permission levels all use a set of contexts, and current processing units of the same level share a set of contexts.

[0391] In a possible implementation manner of the present application, the device is used to implement:

[0392] The code stream to be parsed of the current processing unit is obtained according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level.

[0393] In a possible implementation of the present application, if the splicing method of the code streams of different processing units is frame-level splicing,

[0394] The device is used to achieve:

[0395] Read the position of the end code of the current frame and / or the position of the start code of the next frame;

[0396] Based on the user permission level and the permission level of the current processing unit, if the current processing unit is the first processing unit under the current permission level of the current frame, the starting position of the code stream of the current processing unit is derived based on the position of the end code of the current frame and / or the position of the start code of the next frame, as well as the start code of the code stream under the current permission level or the length information of the permission code stream before the current permission. Otherwise, the starting position of the code stream of the current processing unit is directly obtained, where the current permission level refers to the permission level corresponding to the current processing unit, to parse the code stream to be parsed. After the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated.

[0397] In a possible implementation of the present application, if the splicing method of the code streams of different processing units is slice-level splicing,

[0398] The device is used to achieve:

[0399] Read the starting position of the non-minimum privilege level code stream and the starting position of the next slice and / or the ending code position of the current slice;

[0400] Based on the user permission level and the permission level of the current processing unit, if the current processing unit is the first processing unit under the current permission level of the current slice, the starting position of the code stream of the current processing unit is derived based on the position of the end code of the current slice and / or the position of the start code of the next slice, as well as the start code of the code stream under the current permission level or the length information of the permission code stream before the current permission. Otherwise, the starting position of the code stream of the current processing unit is directly obtained to parse the code stream to be parsed. After the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated.

[0401] In a possible implementation of the present application, if the splicing method of the code streams of different processing units is the largest processing unit lcu level splicing method,

[0402] The device is used to achieve:

[0403] Read the starting position of the non-minimum privilege level code stream and the starting position of the next lcu level and / or the ending code position of the lcu level;

[0404] According to the user authority level and the authority level of the current processing unit, if the current processing unit is the first processing unit under the current authority level of the current LCU, the starting position of the code stream of the current processing unit is derived based on the position of the current LCU end code and / or the position of the next LCU start code and the start code of the code stream under the current authority level or the length information of the previous authority code stream of the current authority; otherwise, the starting position of the code stream of the current processing unit is directly obtained to parse the code stream to be parsed. After the parsing is completed, the starting position of the permission code stream corresponding to the current processing unit is updated.

[0405] In a possible implementation manner of the present application, the device is used to implement:

[0406] The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit, as well as the start code and / or end code of the code stream of the current processing unit authority level, includes:

[0407] If the permission level of the current processing unit is not the lowest level and the permission of the current processing unit is not equal to the permission of the previous processing unit, then the start code of the permission level of the current processing unit, or the end code of the previous processing unit, or the code stream length of the previous processing unit is obtained. Based on the start code of the permission level of the current processing unit, or the end code of the previous processing unit, or the code stream length of the previous processing unit and the starting position of the code stream of the previous processing unit, the starting position of the code stream of the current processing unit is derived; otherwise, the starting position of the current processing unit is derived according to the starting position of the code stream of the previous processing unit.

[0408] In a possible implementation of the present application, when the user authority level is lower than the authority level of the current processing unit, the code stream of the current processing unit's authority is not decoded, and the code stream without authority is decoded to obtain the reconstructed image block of the current processing unit.

[0409] In one possible implementation of the present application, when the user authority level is less than the authority level of the current processing unit, the code stream of the current processing unit's authority is not decoded, and a fixed image block or image block information with authority around the current processing unit less than or equal to the authority of the current processing unit is used to derive the reconstructed image block of the current processing unit.

[0410] The specific implementation of the decoding device of the present application is basically the same as the above-mentioned embodiments of the decoding method, and will not be repeated here.

[0411] The present application provides a coding device, the coding device comprising:

[0412] A third acquisition module is used to acquire a frame image to be encoded and determine position information of regions of different permission levels in the frame image to be encoded;

[0413] A division module, configured to divide the frame image to be encoded into processing units based on the position information;

[0414] Among them, each divided processing unit only corresponds to an area of ​​one permission level;

[0415] The encoding module is configured to obtain an entropy encoder corresponding to the permission level for the relevant coding coefficients corresponding to the processing units in the different permission level areas, encode them respectively to obtain different bitstreams, and splice the different bitstreams; wherein the bitstream is placed within the bitstream information of the current frame, and the bitstream information within the current frame includes the bitstream of the lowest permission level and at least one bitstream of a level greater than the lowest permission level; when the user permission level is greater than or equal to the permission level of the current processing unit, the bitstream to be parsed is equal to the bitstream of the permission level of the current processing unit, and the bitstream to be parsed of a non-lowest permission level includes the bitstream of the lowest permission level and at least one bitstream of a level greater than the lowest permission level.

[0416] In a possible implementation of the present application, when the divided processing unit corresponds to areas of multiple permission levels, the divided processing unit continues to be divided until the further divided processing unit has been divided to a preset division depth, or the further divided processing unit only corresponds to an area of ​​one permission level.

[0417] In a possible implementation of the present application, after the processing unit is divided to a preset division depth, if the divided processing unit still corresponds to areas of multiple permission levels, the permission level of the area corresponding to the divided processing unit is adjusted to a non-minimum permission level of the area.

[0418] In a possible implementation of the present application, the frame image to be encoded is divided into processing units based on the position information. If each processing unit after division corresponds to only one permission level area, further division is allowed or not allowed.

[0419] In a possible implementation of the present application, when further division of a processing unit corresponding to only one permission level area is allowed, further division of the processing unit is performed in different sizes.

[0420] In a possible implementation manner of the present application, the encoding device is used to implement:

[0421] Different entropy encoders are used to encode the relevant coding coefficients corresponding to the processing units in different permission level areas respectively to obtain different code streams.

[0422] In a possible implementation manner of the present application, the encoding device is used to implement:

[0423] Different entropy encoders are used and a set of contexts are obtained to encode the relevant coding coefficients corresponding to the processing units in different permission level areas respectively to obtain different code streams.

[0424] In a possible implementation of the present application, the context corresponding to the lowest authority level processing unit is the first set of contexts, and the context corresponding to the non-lowest authority level processing unit is the second set of contexts. Before obtaining the second set of contexts, the updated first set of contexts is copied and updated.

[0425] In one possible implementation of the present application, non-minimum authority level processing units all use the first set of contexts of the lowest authority level processing unit as their second set of contexts. Only the lowest authority level processing unit can update its first set of contexts, and non-minimum authority level processing units cannot update any contexts.

[0426] In one possible implementation of the present application, if the permission level of the current processing unit is the same as or higher than the permission level of the previous processing unit, the context of the previous processing unit is updated; if the permission level of the current processing unit is lower than that of the previous processing unit, the context of the previous processing unit is initialized.

[0427] In a possible implementation of the present application, current processing units of different permission levels all use a set of contexts, and current processing units of the same level share a set of contexts.

[0428] In a possible implementation of the present application, the step of encoding the relevant coding coefficients corresponding to the processing units of the different permission level areas using different entropy encoders to obtain different bitstreams includes:

[0429] Different entropy encoders are used to encode the relevant coding coefficients and adjustment parameters corresponding to the processing units in different permission level areas, and the encoding is correspondingly encoded into different bit streams.

[0430] In a possible implementation of the present application, the adjustment parameters include quantization step adjustment parameters, and the quantization step adjustment parameters of the processing units in different permission level areas are encoded into the code stream corresponding to the processing unit in the lowest permission area.

[0431] In a possible implementation manner of the present application, the encoding device is used to implement: splicing the different code streams in a preset splicing manner;

[0432] The preset splicing method includes a frame-level splicing method, a slice-level splicing method, an lcu-level splicing method or a cu-level splicing method.

[0433] In a possible implementation manner of the present application, the encoding device is used to implement:

[0434] At the position of the end code of the current frame and / or the position of the start code of the next frame, according to the permission level of the non-minimum permission level processing unit, the code stream corresponding to the permission code stream of the non-minimum permission level processing unit and / or the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed.

[0435] In a possible implementation manner of the present application, the encoding device is used to implement:

[0436] At the position of the end code of the current frame and / or the position of the start code of the next frame, according to the permission level of the non-minimum permission level processing unit, the start code and / or end code of the permission code stream corresponding to the non-minimum permission level processing unit and the permission level code stream of the non-minimum permission level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed.

[0437] In a possible implementation manner of the present application, the encoding device is used to implement:

[0438] At the starting position of the non-minimum permission level code stream and the starting position of the next slice and / or the ending code position of the current slice, the start code and / or the ending code of the permission code stream corresponding to the non-minimum permission level processing unit and the permission level code stream of the non-minimum permission level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum permission level processing unit are spliced ​​and placed.

[0439] In a possible implementation manner of the present application, the encoding device is used to implement:

[0440] At the starting position of the non-minimum privilege level code stream and the starting position of the next LCU level and / or the end code position of the LCU level, the start code and / or end code of the privilege level code stream corresponding to the non-minimum privilege level processing unit and the privilege level code stream of the non-minimum privilege level processing unit, and / or the code stream of the code stream length information corresponding to the non-minimum privilege level processing unit are spliced ​​and placed.

[0441] In a possible implementation manner of the present application, the encoding device is used to implement:

[0442] If the authority of the current processing unit is not equal to the authority of the previous processing unit, encode the start code of the current processing unit code stream and / or the end code of the previous processing unit and / or the corresponding code stream length information of the previous processing unit, and then write them into the code stream of the current processing unit.

[0443] The specific implementation of the encoding device of the present application is basically the same as the embodiments of the above encoding method, and will not be repeated here.

[0444] An embodiment of the present application provides a storage medium, and the storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the above-mentioned decoding methods.

[0445] The specific implementation of the storage medium of the present application is basically the same as the above-mentioned decoding method embodiments, and will not be repeated here.

[0446] An embodiment of the present application provides a storage medium, and the storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the above-mentioned encoding methods.

[0447] The specific implementation of the storage medium of this application is basically the same as the embodiments of the above-mentioned encoding method, and will not be repeated here.

[0448] The present application also provides a computer program product, including a computer program, which implements the steps of the above encoding method when executed by a processor.

[0449] The specific implementation of the computer program product of the present application is basically the same as the above-mentioned embodiments of the encoding method, and will not be repeated here.

[0450] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0451] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0452] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus hardware platform, or by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM) and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0453] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A decoding method, characterized in that: The decoding method comprises: Get the user's permission level and the permission level of the current processing unit; Obtain the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit; An entropy decoder corresponding to the permission level is obtained according to the user permission level, the permission level of the current processing unit and the corresponding code stream, and the code stream to be parsed is parsed to obtain the reconstructed image block of the current processing unit.

2. The decoding method according to claim 1, wherein When the user authority level is lower than the authority level of the current processing unit, the code stream of the current processing unit authority is not decoded, and the code stream without authority is decoded to obtain the reconstructed image block of the current processing unit.

3. The decoding method according to claim 1, wherein: When the user authority level is lower than the authority level of the current processing unit, the code stream of the current processing unit authority is not decoded, and the reconstructed image block of the current processing unit is derived using the fixed image block.

4. The decoding method according to claim 1, wherein: The step of obtaining the permission of the current processing unit includes: Obtain the permission level of the current processing unit from the non-permission level code stream information of the current frame.

5. The decoding method according to claim 4, wherein: The current processing unit has only one authority level.

6. The decoding method according to claim 5, wherein: The step of obtaining the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit includes: The code stream to be parsed of the current processing unit is obtained according to the user authority level and the authority level of the current processing unit, wherein the code stream to be parsed includes a related coding coefficient code stream and an adjustment parameter code stream of the current processing unit.

7. The decoding method according to claim 1, wherein: The step of obtaining an entropy decoder corresponding to the permission level according to the user permission level, the permission level of the current processing unit, and the corresponding bitstream, and parsing the bitstream to be parsed includes: According to the user authority level, the authority level of the current processing unit and the corresponding code stream, an entropy decoder corresponding to the authority level is obtained, and a set of contexts is obtained to parse the code stream to be parsed.

8. The decoding method according to claim 7, wherein: Current processing units of different permission levels use a set of contexts, and current processing units of the same level share a set of contexts.

9. A decoding device, characterized in that: The device comprises: A first acquisition module is used to obtain the user authority level and the authority level of the current processing unit; A second acquisition module is used to acquire the code stream to be parsed of the current processing unit according to the user authority level and the authority level of the current processing unit; The parsing module is used to obtain an entropy decoder corresponding to the permission level according to the user permission level, the permission level of the current processing unit and the corresponding code stream, parse the code stream to be parsed, and obtain the reconstructed image block of the current processing unit.

10. An electronic device, characterized in that: The method comprises a memory, a processor, and an encoding program or a decoding program stored in the memory and executable on the processor, wherein the processor implements the steps of the encoding method according to any one of claims 1 to 8 when executing the encoding program.

11. A storage medium, characterized in that: The storage medium stores an encoding program or a decoding program, and when the encoding program is executed by the processor, the steps of the encoding method according to any one of claims 1 to 8 are implemented.