Image decoding and coding method and device, equipment and storage medium

By determining the code stream to be decoded according to the unit and user permission level in the privacy encoding mode, the problem that low-privilege users cannot correctly decode high-privilege image areas is solved, ensuring that low-privilege users can also decode image content in non-privilege areas, improving the image visual effect.

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

Patent Information

Application Number
CN202510890327.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-22
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Low-privileged users cannot correctly decode high-privileged image areas in privacy protection schemes, resulting in poor visual effects.

Method used

When the privacy encoding mode is turned on, the unit permission level and user permission level are obtained, the code stream to be decoded is determined based on these two permission levels, and the corresponding decoding process is performed to ensure that low-privileged users can also decode the image content in the non-private area.

Benefits of technology

It realizes that low-privileged users can also correctly decode image content in non-private areas, avoiding low-privileged users skipping the decoding of private areas, and improving image visual effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455719A_ABST
    Figure CN120455719A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image processing, and discloses an image decoding and coding method and device, equipment and a storage medium. According to the method, when a privacy coding mode is in an open state, a unit permission level and a user permission level are obtained, the unit permission level is the permission level of a current processing unit, and the user permission level is the permission level of a decoding end user; determining a to-be-decoded code stream corresponding to the current processing unit according to the unit permission level and the user permission level; and decoding the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit. When the privacy coding mode is in the open state, the corresponding to-be-decoded code stream is selected for decoding according to the unit permission level and the user permission level, so that even a low-permission user can decode a non-privacy code stream to obtain the reconstructed image corresponding to the privacy-removed image content corresponding to the privacy area, and the user experience is improved. And the situation that the low-permission user skips decoding of the processing unit corresponding to the privacy area is avoided.
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 January 22, 2024, application number 202410089093.3, and name “Image decoding and encoding method, device, equipment and storage medium”. Technical Field

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

[0003] Early research in video privacy protection technology was driven by the need to protect the privacy of surveillance video sequences. By protecting private areas in a video that can directly or indirectly identify an individual (such as moving bodies and faces), while maintaining visibility of other areas to all users, a good balance between public safety and personal privacy is achieved.

[0004] The current privacy protection solution is implemented by generating two bitstreams for each frame to be encoded. One bitstream is the private bitstream obtained by encoding the private area, and the other bitstream is the non-private bitstream obtained by encoding other information and the non-private area. The private bitstream includes all information within the image processing unit (CU) after the private area is divided into CUs. The non-private bitstream includes all other information.

[0005] In this privacy protection scheme, low-privilege decoding users cannot obtain the correct high-privilege code stream. Therefore, when decoding, if a low-privilege user finds that the CU is high-privilege, the parsing of this CU will be skipped, resulting in poor visual effects of the image seen by the low-privilege user. Summary of the Invention

[0006] The main purpose of this application is to provide an image decoding and encoding method, apparatus, device and storage medium, aiming to solve the technical problem of poor visual effects of images seen by low-authority users in privacy protection schemes.

[0007] To achieve the above objectives, the present application provides an image decoding method, which includes:

[0008] When the privacy coding mode is on, obtain the unit authority level and user authority level, where the unit authority level is the authority level of the current processing unit and the user authority level is the authority level of the decoding end user;

[0009] Determine the to-be-decoded bitstream corresponding to the current processing unit according to the unit authority level and the user authority level;

[0010] Decode the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0011] In a possible implementation manner of the present application, determining the to-be-decoded code stream corresponding to the current processing unit according to the unit authority level and the user authority level includes:

[0012] If the unit authority level is not the lowest authority level and the user authority level is greater than or equal to the unit authority level, reading a private code stream and a non-private code stream corresponding to the current processing unit, the private code stream and the non-private code stream including at least one information used for prediction, inverse quantization, or inverse transformation, the non-private code stream being the code stream corresponding to the lowest authority level, and the private code stream being the code stream corresponding to the unit authority level;

[0013] The privacy code stream is used as the code stream to be decoded corresponding to the current processing unit.

[0014] In a possible implementation of the present application, reading the privacy code stream and the non-privacy code stream corresponding to the current processing unit includes:

[0015] The privacy code stream corresponding to the current processing unit is read according to a first entropy decoder, and the non-privacy code stream corresponding to the current processing unit is read according to a second entropy decoder, where the first entropy decoder is an entropy decoder corresponding to the unit permission level, and the second entropy decoder is an entropy decoder corresponding to the lowest permission level.

[0016] In a possible implementation manner of the present application, determining the to-be-decoded code stream corresponding to the current processing unit according to the unit authority level and the user authority level includes:

[0017] If the unit authority level is not the lowest authority level and the user authority level is lower than the unit authority level, reading a non-private code stream corresponding to the current processing unit, the non-private code stream including at least one information used for prediction, inverse quantization, or inverse transformation;

[0018] The non-privacy code stream is used as the code stream to be decoded corresponding to the current processing unit.

[0019] In a possible implementation of the present application, when the privacy coding mode is on, before obtaining the unit authority level and the user authority level, the method further includes:

[0020] Extracting a mode flag from an image code stream corresponding to an image to be decoded, wherein the mode flag is a sequence-level syntax;

[0021] Whether the privacy coding mode is turned on is determined according to the value of the mode flag.

[0022] In a possible implementation manner of the present application, after determining whether the privacy coding mode is enabled according to the value of the mode flag, the method further includes:

[0023] When the privacy coding mode is off, obtain the unit permission level and user permission level;

[0024] If the user authority level is greater than or equal to the unit authority level, obtaining the bitstream corresponding to the unit authority level;

[0025] Using the code stream corresponding to the unit authority level as the code stream to be decoded corresponding to the current processing unit;

[0026] Decode the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0027] In a possible implementation of the present application, when the privacy coding mode is in the off state, after obtaining the unit authority level and the user authority level, the method further includes:

[0028] If the user authority level is lower than the unit authority level, constructing a reconstructed image block corresponding to the current processing unit according to fixed pixel values;

[0029] or,

[0030] If the user authority level is lower than the unit authority level, a reconstructed image block corresponding to the current processing unit is constructed according to reconstructed image blocks corresponding to reconstructed units around the current processing unit.

[0031] In a possible implementation manner of the present application, determining the to-be-decoded code stream corresponding to the current processing unit according to the unit authority level and the user authority level includes:

[0032] If the unit authority level is the lowest authority level, then read the non-privacy code stream corresponding to the current processing unit;

[0033] The non-privacy code stream is used as the code stream to be decoded corresponding to the current processing unit.

[0034] In a possible implementation manner of the present application, determining the to-be-decoded code stream corresponding to the current processing unit according to the unit authority level and the user authority level includes:

[0035] Determining a code stream to be parsed according to the unit authority level and the user authority level;

[0036] Obtaining a peripheral processing unit whose corresponding permission level is less than or equal to the permission level of the code stream to be parsed, and obtaining a reference unit, wherein the peripheral processing unit is a processing unit adjacent to the current processing unit in the time domain or the spatial domain;

[0037] Referring to the decoding information corresponding to the reference unit, the to-be-parsed code stream is read, and the to-be-decoded code stream corresponding to the current processing unit is selected from the to-be-parsed code stream, where the decoding information is information that has been parsed and decoded when reconstructing the image of the reference unit.

[0038] In a possible implementation manner of the present application, decoding the to-be-decoded bitstream to obtain a reconstructed image block corresponding to the current processing unit includes:

[0039] If the custom mode is not enabled, the code stream to be decoded is decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0040] In a possible implementation manner of the present application, decoding the to-be-decoded bitstream to obtain a reconstructed image block corresponding to the current processing unit includes:

[0041] If the custom mode is enabled, the reconstructed image block corresponding to the current processing unit is obtained in any of the following ways:

[0042] Decoding the to-be-decoded bitstream to obtain a decoded image block, and replacing the decoded image block with an image block constructed with pixel values specified by a custom mode as a reconstructed image block corresponding to a current processing unit;

[0043] Not decoding the to-be-decoded bitstream, obtaining pixel values specified by the custom mode, and constructing a reconstructed image block corresponding to the current processing unit according to the pixel values;

[0044] Decode the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0045] In a possible implementation manner of the present application, a method for obtaining a reconstructed image block corresponding to a current processing unit is specified according to a mode parameter corresponding to a custom mode.

[0046] In a possible implementation of the present application, when the privacy coding mode is on, before obtaining the unit authority level and the user authority level, the method further includes:

[0047] Extracting a code stream corresponding to the lowest permission level from the image code stream corresponding to the image to be decoded;

[0048] Extracting unit division information from the bitstream corresponding to the lowest permission level;

[0049] Perform unit division according to the unit division information to obtain a plurality of image processing units;

[0050] Traversing the multiple image processing units to obtain a current processing unit;

[0051] After decoding the code stream to be decoded to obtain the reconstructed image block corresponding to the current processing unit, the method further includes:

[0052] caching the reconstructed image block corresponding to the current processing unit;

[0053] When the caching is completed, if the current processing unit is the last image processing unit among the multiple image processing units, a reconstructed image corresponding to the image to be decoded is constructed according to the reconstructed image blocks corresponding to the cached image processing units.

[0054] In a possible implementation manner of the present application, before caching the reconstructed image block corresponding to the current processing unit, the method further includes:

[0055] Extracting a filtering pixel and a reference pixel corresponding to the filtering pixel from the reconstructed image block, wherein the reference pixel is a pixel referenced when filtering the filtering pixel, or a pixel at a peripheral position of the filtering pixel;

[0056] If the authority level of the filtered pixel is less than the authority level of any of the reference pixels, filtering of the filtered pixel is skipped, and the reconstructed image block is cached.

[0057] In a possible implementation manner of the present application, after extracting the filtered pixels and the reference pixels corresponding to the filtered pixels from the reconstructed image block, the method further includes:

[0058] If the authority level of the filtered pixel is greater than or equal to the authority levels of all the reference pixels, filtering is performed on the filtered pixel according to the reference pixels.

[0059] In a possible implementation manner of the present application, extracting the filtered pixels and the reference pixels corresponding to the filtered pixels from the reconstructed image block includes:

[0060] Extracting filtered pixels from the reconstructed image block, and acquiring target pixels according to reference positions corresponding to the filtered pixels;

[0061] If the target pixel is available, using the target pixel as a reference pixel;

[0062] If the target pixel is not available, the pixel at the nearest position to the target pixel in the filtering unit corresponding to the filtering pixel is used as the reference pixel, and the authority level of the pixel at the nearest position to the target pixel in the filtering unit corresponding to the filtering pixel is used as the authority level of the reference pixel.

[0063] In a possible implementation manner of the present application, the current processing unit is an enhancement layer processing unit;

[0064] The decoding of the to-be-decoded code stream to obtain a reconstructed image block corresponding to the current processing unit includes:

[0065] Acquire reference information corresponding to the current processing unit in a base layer, where the reference information includes mode reference information and pixel reference information;

[0066] If the permission level of the code stream to be decoded is greater than the permission level of the reference information, the code stream to be decoded is decoded with reference to the reference information to obtain a reconstructed image block corresponding to the current processing unit.

[0067] In a possible implementation manner of the present application, decoding the to-be-decoded bitstream to obtain a reconstructed image block corresponding to the current processing unit includes:

[0068] Get multiple sets of quantitative parameters according to user authority level;

[0069] Updating the multiple sets of quantization parameters;

[0070] After the update is completed, the to-be-decoded code stream is decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0071] In a possible implementation of the present application, each set of quantization parameters in the multiple sets of quantization parameters corresponds to a level of authority, and the multiple sets of quantization parameters are initialized according to quantization information of the peripheral processing units;

[0072] Each set of quantization parameters in the multiple sets of quantization parameters satisfies the following conditions:

[0073] If the authority level of the peripheral processing unit is less than or equal to the authority level corresponding to the quantization parameter, the current quantization parameter is equal to the quantization parameter of the peripheral processing unit;

[0074] If the permission level of the peripheral processing unit is greater than the permission level corresponding to the quantization parameter, the quantization parameter is equal to the quantization parameter of the current slice level, the current coding tree unit or the current frame level.

[0075] In a possible implementation manner of the present application, updating the multiple sets of quantization parameters includes:

[0076] If the unit authority level is not the lowest authority level and the user authority level is greater than or equal to the unit authority level, selecting a private quantization parameter from the multiple sets of quantization parameters based on the authority level of the private code stream, and selecting a non-private quantization parameter from the multiple sets of quantization parameters based on the authority level of the non-private code stream;

[0077] The private quantization parameter is updated according to the quantization information of the current processing unit extracted from the private code stream, and the non-private quantization parameter is updated according to the quantization information of the current processing unit extracted from the non-private code stream.

[0078] In a possible implementation manner of the present application, updating the multiple sets of quantization parameters includes:

[0079] If the unit authority level is the lowest authority level, or the user authority level is lower than the unit authority level, selecting a non-private quantization parameter from the multiple sets of quantization parameters according to the authority level of the non-private code stream;

[0080] The non-private quantization parameter is updated according to the quantization information of the current processing unit extracted from the non-private code stream.

[0081] In a possible implementation manner of the present application, decoding the to-be-decoded bitstream to obtain a reconstructed image block corresponding to the current processing unit includes:

[0082] If it is detected that the sample reference condition is met, obtaining a reference sample corresponding to the current processing unit;

[0083] Perform intra-frame prediction based on the reference sample to obtain a prediction result;

[0084] Decoding is performed according to the prediction result and the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0085] In a possible implementation manner of the present application, before obtaining the reference sample corresponding to the current processing unit if it is detected that the sample reference condition is met, the method further includes:

[0086] If there is at least one reference sample at the reference position corresponding to the current processing unit that belongs to the same slice level as the current processing unit, image reconstruction has been completed, and the corresponding permission level is less than or equal to the permission level of the code stream to be decoded, then it is determined that the sample reference condition is met.

[0087] In a possible implementation manner of the present application, performing intra-frame prediction according to the reference sample to obtain a prediction result includes:

[0088] Taking a reference sample whose corresponding permission level is greater than the permission level of the code stream to be decoded as a target sample;

[0089] Performing pixel replacement processing on the target sample in the reference sample, where a processing manner of the pixel replacement processing is determined according to a position of the target sample relative to the current processing unit;

[0090] Intra-frame prediction is performed based on the reference sample after replacement processing to obtain a prediction result.

[0091] In addition, to achieve the above-mentioned purpose, the present application also proposes an image encoding method, which includes:

[0092] When the privacy coding mode is on, obtaining a privacy determination result, wherein the privacy determination result is used to indicate whether the current processing unit is located in a privacy area;

[0093] The image corresponding to the current processing unit is encoded according to the privacy determination result to generate at least one code stream corresponding to the current processing unit.

[0094] In a possible implementation of the present application, encoding the image corresponding to the current processing unit according to the privacy determination result to generate at least one code stream corresponding to the current processing unit includes:

[0095] If the privacy determination result is that the image is located in a privacy area, encoding the image corresponding to the current processing unit to generate a privacy code stream and a non-privacy code stream corresponding to the current processing unit;

[0096] If the privacy determination result is that the image is not located in the privacy area, the image corresponding to the current processing unit is encoded to generate a non-privacy code stream corresponding to the current processing unit.

[0097] In a possible implementation of the present application, the privacy code stream and the non-privacy code stream are encoded using different entropy encoders;

[0098] The image encoding method further comprises:

[0099] Obtaining the permission level of the privacy area to obtain the privacy permission level;

[0100] The permission level of the current processing unit and the privacy code stream is set to the privacy permission level, and the permission level of the non-privacy code stream is set to the lowest permission level.

[0101] In a possible implementation manner of the present application, the image encoding method further includes:

[0102] When the privacy coding mode is off, obtain the privacy determination result;

[0103] If the privacy determination result is that the image is located in a privacy area, encoding the image corresponding to the current processing unit to generate a privacy code stream corresponding to the current processing unit;

[0104] If the privacy determination result is that the image is not located in the privacy area, the image corresponding to the current processing unit is encoded to generate a non-privacy code stream corresponding to the current processing unit.

[0105] In a possible implementation of the present application, when the privacy coding mode is in the on state, before obtaining the privacy determination result, the method further includes:

[0106] Dividing the image to be encoded into units according to the unit division information to obtain a plurality of image processing units;

[0107] Traversing the multiple image processing units to obtain a current processing unit;

[0108] After encoding the image corresponding to the current processing unit according to the privacy determination result to generate at least one code stream corresponding to the current processing unit, the method further includes:

[0109] If the current processing unit is the last processing unit among the multiple image processing units, constructing an image code stream according to at least one code stream corresponding to each processing unit;

[0110] The image code stream is sent to a decoding end.

[0111] In a possible implementation of the present application, encoding the image corresponding to the current processing unit according to the privacy determination result to generate at least one code stream corresponding to the current processing unit includes:

[0112] If it is detected that the sample reference condition is met, obtaining a reference sample corresponding to the current processing unit;

[0113] Perform intra-frame prediction based on the reference sample to obtain a prediction result;

[0114] The image corresponding to the current processing unit is encoded based on the prediction result and the privacy determination result to generate at least one code stream corresponding to the current processing unit.

[0115] In addition, to achieve the above objectives, the present application also proposes an image decoding device, which includes the following modules:

[0116] An acquisition module, configured to acquire a unit authority level and a user authority level when the privacy coding mode is enabled, wherein the unit authority level is the authority level of the current processing unit and the user authority level is the authority level of the decoding end user;

[0117] An extraction module, configured to determine a to-be-decoded bitstream corresponding to a current processing unit according to the unit authority level and the user authority level;

[0118] The decoding module is used to decode the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0119] In addition, to achieve the above objectives, the present application also proposes an image encoding device, which includes the following modules:

[0120] an acquisition module, configured to acquire a privacy determination result when the privacy coding mode is enabled, wherein the privacy determination result is used to indicate whether the current processing unit is located in a privacy area;

[0121] The encoding module is configured to encode the image corresponding to the current processing unit according to the privacy determination result, and generate at least one code stream corresponding to the current processing unit.

[0122] In addition, to achieve the above-mentioned purpose, the present application also proposes a decoding device, which includes: a processor, a memory, and an image decoding program stored on the memory and capable of running on the processor, and when the image decoding program is executed by the processor, the steps of the image decoding method described above are implemented.

[0123] In addition, to achieve the above-mentioned purpose, the present application also proposes a coding device, which includes: a processor, a memory, and an image coding program stored in the memory and runnable on the processor, and when the image coding program is executed by the processor, the steps of the image coding method described above are implemented.

[0124] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a processor and a machine-readable storage medium, on which machine-executable instructions that can be executed by the processor are stored; the processor is used to execute the machine-executable instructions to implement the method described above.

[0125] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, characterized in that an image decoding program and / or an image encoding program is stored on the storage medium, and when the image decoding program is executed, the steps of the image decoding method described above are implemented, and when the image encoding program is executed, the steps of the image encoding method described above are implemented.

[0126] In addition, to achieve the above objectives, the present application also proposes a computer application product, including a computer application, characterized in that the computer application implements the above method when executed by a processor.

[0127] The present embodiment of the present invention obtains the unit permission level and user permission level when the privacy coding mode is enabled. The unit permission level is the permission level of the current processing unit, and the user permission level is the permission level of the user at the decoding end. Based on the unit permission level and the user permission level, the to-be-decoded code stream corresponding to the current processing unit is determined. The to-be-decoded code stream is decoded to obtain a reconstructed image block corresponding to the current processing unit. Since the corresponding to-be-decoded code stream is selected for decoding based on the unit permission level and the user permission level when the privacy coding mode is enabled, even low-privilege users can decode the non-privacy code stream and obtain a reconstructed image corresponding to the deprived image content corresponding to the privacy region, preventing low-privilege users from skipping decoding of the processing unit corresponding to the privacy region. BRIEF DESCRIPTION OF THE DRAWINGS

[0128] Figure 1 It is a structural diagram of an electronic device in a hardware operating environment involved in an embodiment of the present application;

[0129] Figure 2 A schematic diagram of a video encoding and decoding framework according to an embodiment of the present application;

[0130] Figure 3 This is a schematic diagram of the encoding process before improvement of an embodiment of the present application;

[0131] Figure 4 This is a schematic diagram of a decoding process for a high-authority user before improvement according to an embodiment of the present application;

[0132] Figure 5 This is a schematic diagram of a decoding process for low-authority users before improvement according to an embodiment of the present application;

[0133] Figure 6 This is a flowchart of the first embodiment of the image decoding method of the present application;

[0134] Figure 7 This is a schematic diagram of an improved encoding process according to an embodiment of the present application;

[0135] Figure 8 This is a schematic diagram of the improved high-authority user decoding process according to an embodiment of the present application;

[0136] Figure 9 This is a schematic diagram of the improved high-authority user decoding process according to an embodiment of the present application;

[0137] Figure 10 This is a flowchart of the second embodiment of the image decoding method of the present application;

[0138] Figure 11 This is a flowchart of the third embodiment of the image decoding method of the present application;

[0139] Figure 12This is a flowchart of a fourth embodiment of the image decoding method of the present application;

[0140] Figure 13 This is a flowchart of a fifth embodiment of the image decoding method of the present application;

[0141] Figure 14 A schematic diagram of the position of a reference sample according to an embodiment of the present application;

[0142] Figure 15 This is a flowchart of the first embodiment of the image encoding method of the present application;

[0143] Figure 16 This is a structural block diagram of the first embodiment of the image decoding device of the present application;

[0144] Figure 17 This is a structural block diagram of the first embodiment of the image encoding device of the present application.

[0145] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0146] 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.

[0147] Reference Figure 1 , Figure 1 This is a schematic diagram of the electronic device structure of the hardware operating environment involved in the embodiment of the present application.

[0148] like Figure 1 As shown, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

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

[0150] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and an image decoding program and / or an image encoding program.

[0151] exist Figure 1 In the electronic device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and memory 1005 in the electronic device of this application can be set in the electronic device.

[0152] If the electronic device is used at a decoding end to perform image decoding, it acts as a decoding device. At this time, the electronic device calls the image decoding program stored in the memory 1005 through the processor 1001 and executes the image decoding method provided in the embodiment of the present application.

[0153] If the electronic device is used to perform image encoding at the encoding end, then as an encoding device, the electronic device calls the image encoding program stored in the memory 1005 through the processor 1001 and executes the image encoding method provided in the embodiment of the present application.

[0154] For ease of understanding, now combined Figure 2 、 3 , 4 and 5 are used to illustrate, but not to limit this solution.

[0155] The terms that may be involved in the image encoding and decoding process include:

[0156] Intra Prediction and Inter Prediction:

[0157] Intra-frame prediction refers to predictive coding using the reconstructed pixel values of the spatially adjacent blocks of the current block (in the same frame image as the current block), while inter-frame prediction refers to predictive coding using the reconstructed pixel values of the temporal adjacent blocks of the current block (in different images as the current block).

[0158] Prediction Signal: A prediction signal is a pixel value derived from an already coded pixel. The difference between the original pixel and the predicted pixel yields a residual, which is then transformed, quantized, and encoded. Specifically, an inter-frame prediction signal refers to the pixel value of the current block derived from a reference frame (reconstructed pixel frame). Due to the discrete pixel positions, interpolation is required to obtain the final prediction signal. The closer the predicted pixel is to the original pixel, the smaller the residual energy obtained by subtracting the two, resulting in higher coding compression performance.

[0159] like Figure 2 As shown in the figure, the currently commonly used video codecs mainly involve prediction, transformation, quantization, entropy coding and filtering modules in the entire image coding and decoding process, among which:

[0160] 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.

[0161] The transform module linearly maps the residual information in the spatial domain to a transform domain (such as the frequency domain). The goal is to concentrate the energy and remove the frequency domain correlation of the signal. Theoretically, the transform matrix is reversible and does not cause signal loss.

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

[0163] 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 transform coefficients and mode information, etc.) into a binary code stream, removing the statistical redundancy of these video element symbols.

[0164] The filtering module enhances the reconstructed image, aiming to make the reconstructed image closer to the original image while reducing the effects of blocking and ringing effects, thereby improving the quality of the reconstructed image.

[0165] The privacy protection scheme currently used is specifically implemented as follows:

[0166] Image encoding end such as Figure 3 As shown in the figure, for each frame to be encoded, the encoder generates two bitstreams: one is the private bitstream obtained by encoding the private area, and the other is the non-private bitstream obtained by encoding other information and the non-private area. The private bitstream includes all information within the CU after the private area is divided into CUs. The non-private bitstream includes all other information.

[0167] During the image decoding process, the sequence header, image header, patch header, filter information, CU partition information and CU permission flag are parsed from the non-privacy code stream. Among them, the CU permission flag is a newly added flag, indicating whether the current CU has low permission (non-privacy content) or high permission (privacy content). Finally, the information of the low-privacy CU is parsed from the non-privacy code stream. The information of the high-privacy CU is parsed from the privacy code stream. Therefore, only high-privacy users can parse the high-privacy CU content (the image decoding process for high-privacy users is as follows). Figure 4 As shown), low-privilege users need to skip the decoding process of the high-privilege CU and use fixed values to fill as reconstruction values (the image decoding process of low-privilege users is as follows Figure 5 shown).

[0168] The present application embodiment provides an image decoding method, referring to Figure 6 , Figure 6 This is a flowchart of a first embodiment of an image decoding method of the present application.

[0169] In this embodiment, the image decoding method includes the following steps:

[0170] Step S10: When the privacy coding mode is on, the unit authority level and the user authority level are obtained.

[0171] It should be noted that the execution subject of this embodiment can be a decoding device, which can be the above-mentioned electronic device used at the decoding end to perform image decoding. The decoding device can be an electronic device such as a personal computer, a server, or other devices that can achieve the same or similar functions. This embodiment is not limited to this. In this embodiment and the following embodiments, the image decoding method of this application is described using a decoding device as an example. In particular, since the decoding end device also performs image decoding when verifying the image compression rate and adjusting the image encoding effect during image encoding, under this premise, the execution subject of this embodiment can also be a decoding end device, which can be an electronic device used at the encoding end to perform image encoding.

[0172] It should be noted that the unit authority level may be the authority level of the current processing unit, which may be the image processing unit currently performing image decoding processing, and the user authority level may be the authority level of the decoding end user.

[0173] Since there may be multiple permission levels in the subsequent explanations, in order to avoid confusion, a unified explanation is given here:

[0174] The processing unit permission level may be the permission level of the image processing unit obtained by parsing the lowest permission code stream.

[0175] User authority level can be input or specified by the decoder, specified by the encoder, or obtained from other encrypted code streams. Each decoder has only one authority.

[0176] The code stream permission level is generated by the encoder and sent to the decoder. Each processing unit determines the specific code stream permission level based on the user permission level and the current processing unit level.

[0177] The permission level of the reference pixel is equal to the permission of the pixel actually participating in filtering.

[0178] The permission level of the peripheral unit is equal to the permission level of the peripheral processing unit corresponding to the current processing unit.

[0179] The permission level corresponding to the quantization parameter. The maximum value is the maximum permission corresponding to the current image, and the minimum value is the lowest permission level. The quantization parameter update is bound to the bitstream permission.

[0180] A privacy code stream is a code stream whose permission level is not the lowest permission level (i.e., the minimum value of the permission level, such as 0). If an image processing unit corresponds to a privacy code stream, the permission level of the privacy code stream is consistent with the permission level of the image processing unit.

[0181] The non-privacy code stream may be a code stream with a permission level of the lowest permission level, and its permission level is the minimum value of all permission levels (such as 0).

[0182] It should be noted that in order to improve the visual effect of the image seen by the low-privilege user, it is necessary to ensure that the low-privilege user does not skip the decoding of the processing unit (CU) corresponding to the privacy area, while at the same time ensuring that privacy is not leaked. To address this situation, this embodiment additionally provides a privacy coding mode. If the privacy coding mode is enabled, the encoder will encode the image content of the privacy area into the privacy code stream during image encoding, and perform privacy removal processing (such as coding or replacing the content of the privacy area with common content) on the content of the privacy area to generate privacy-removed image content. The privacy-removed image content corresponding to the privacy area is then written into the non-privacy code stream. At this time, both high-privilege users and low-privilege users can obtain the corresponding code stream for decoding without skipping the decoding of the image processing unit corresponding to the privacy area.

[0183] Therefore, if the decoding device detects that the privacy coding mode is on, it needs to determine which code stream to decode and obtain the reconstructed image block corresponding to the current processing unit. In order to determine which code stream to use for decoding, the unit permission level and user permission level can be obtained at this time.

[0184] In a specific implementation, since low-privilege users cannot obtain the privacy code stream, in order to ensure that all users can obtain the permission level of the current processing unit, the encoder can write the division information of the image processing units and the permission level of each image processing unit into the code stream with the lowest permission, that is, the non-privacy code stream, during encoding.

[0185] Step S20: determining the to-be-decoded code stream corresponding to the current processing unit according to the unit authority level and the user authority level.

[0186] It should be noted that the image processing unit corresponding to the privacy area generally has a high unit authority level (i.e., it indicates that the user authority level must reach a certain level before the privacy code stream corresponding to the current processing unit can be decoded to obtain the image content of the privacy area). Therefore, based on the unit authority level and the user authority level, it can be determined whether the current processing unit is the image processing unit corresponding to the privacy area, and whether the current decoding end user is a high-authority user or a low-authority user, thereby determining the code stream that the decoding end user should decode for the current processing unit, i.e., the code stream to be decoded.

[0187] In a specific implementation, in order to reasonably determine the code stream to be decoded, step S20 in this embodiment may include:

[0188] If the unit authority level is not the lowest authority level, and the user authority level is greater than or equal to the unit authority level, then reading the privacy code stream and the non-privacy code stream corresponding to the current processing unit;

[0189] The privacy code stream is used as the code stream to be decoded corresponding to the current processing unit.

[0190] It should be noted that both the private code stream and the non-private code stream may include at least one type of information used for prediction, inverse quantization, or inverse transformation. The non-private code stream may be the code stream corresponding to the lowest permission level, and the permission level of the non-private code stream may be the lowest permission level. The private code stream may be the code stream corresponding to the unit permission level, and the permission level of the private code stream may be consistent with the unit permission level of the current processing unit.

[0191] In actual use, if the unit authority level is not the lowest authority level, it means that the current processing unit is the image processing unit corresponding to the privacy area. If the user authority level is greater than or equal to the unit authority level, it means that the decoding end user has the authority to obtain the image content corresponding to the privacy area. Since the most basic information (such as the division information of the image processing unit, etc.) is stored in the non-privacy code stream, in order to facilitate subsequent processing, the privacy code stream and the non-privacy code stream corresponding to the current processing unit can be read.

[0192] Reading the privacy code stream and the non-privacy code stream corresponding to the current processing unit may be performed by parsing the code stream transmitted from the encoding end through an entropy decoder, and reading the privacy code stream and the non-privacy code stream contained therein.

[0193] It is understandable that since the decoding end user has the authority to obtain the image content corresponding to the privacy area, the privacy code stream can be used as the code stream to be decoded to ensure that the decoding end user can correctly obtain the image content of the privacy area.

[0194] In a specific implementation, in order to correctly read the private code stream and the non-private code stream, the steps of reading the private code stream and the non-private code stream corresponding to the current processing unit in this embodiment may include:

[0195] The privacy code stream corresponding to the current processing unit is read according to the first entropy decoder, and the non-privacy code stream corresponding to the current processing unit is read according to the second entropy decoder.

[0196] It should be noted that the private code stream and the non-private code stream can be encoded using different entropy encoders. Therefore, to ensure correct parsing, different entropy decoders are also required for decoding. The first entropy decoder is the entropy decoder corresponding to the unit permission level, and the second entropy decoder is the entropy decoder corresponding to the lowest permission level.

[0197] In a specific implementation, in order to reasonably determine the code stream to be decoded, step S20 in this embodiment may include:

[0198] If the unit authority level is not the lowest authority level and the user authority level is lower than the unit authority level, reading a non-private code stream corresponding to the current processing unit, the non-private code stream including at least one information used for prediction, inverse quantization, or inverse transformation;

[0199] The non-privacy code stream is used as the code stream to be decoded corresponding to the current processing unit.

[0200] It should be noted that if the unit permission level is not the minimum permission level, it indicates that the current processing unit is the image processing unit corresponding to the privacy region. If the user permission level is lower than the unit permission level, it indicates that the decoding end user does not have permission to obtain the image content corresponding to the privacy region. Therefore, in this case, it is not necessary to read the privacy code stream, and only the non-privacy code stream needs to be read. The privacy code stream can also be read using the second entropy encoder described above, that is, the entropy decoder corresponding to the minimum permission level reads the non-privacy code stream corresponding to the current processing unit.

[0201] In a specific implementation, in order to reasonably determine the code stream to be decoded, step S20 in this embodiment may include:

[0202] If the unit authority level is the lowest authority level, then read the non-privacy code stream corresponding to the current processing unit;

[0203] The non-privacy code stream is used as the code stream to be decoded corresponding to the current processing unit.

[0204] It should be noted that if the unit permission level is the lowest permission level, it means that the current processing unit is not the image processing unit corresponding to the privacy area. At this time, there is no privacy code stream corresponding to the current processing unit, and there is only a non-privacy code stream corresponding to the current processing unit. Regardless of the permission level of the decoding end user, only the non-privacy code stream can be decoded. Therefore, the non-privacy code stream corresponding to the current processing unit can be directly read and used as the code stream to be decoded corresponding to the current processing unit.

[0205] In a possible implementation of this embodiment, in some cases, when reading a code stream, it may be necessary to refer to decoding information of surrounding reconstructed image processing units. If a low-privilege CU refers to information of a high-privilege CU, erroneous decoding may occur because the low-privilege user cannot obtain the high-privilege content. To avoid this phenomenon, it is necessary to limit the reference processing units during parsing. In this case, step S20 in this embodiment may include:

[0206] Determining a code stream to be parsed according to the unit authority level and the user authority level;

[0207] Acquire a peripheral processing unit whose corresponding permission level is less than or equal to the permission level of the code stream to be parsed, and obtain a reference unit;

[0208] The decoding information corresponding to the reference unit is referred to, the code stream to be parsed is read, and the code stream to be decoded corresponding to the current processing unit is selected from the code stream to be parsed.

[0209] It should be noted that determining the codestream to be parsed based on the unit permission level and the user permission level may mean determining the codestream to be read based on the unit permission level and the user permission level. For example, if the unit permission level is not the lowest permission level and the user permission level is greater than or equal to the unit permission level, and both the privacy codestream and the non-privacy codestream need to be read, then the codestream to be parsed includes both the privacy codestream and the non-privacy codestream. If the unit permission level is not the lowest permission level and the user permission level is less than the unit permission level, and the non-privacy codestream is needed, then the codestream to be parsed is the non-privacy codestream. If the unit permission level is the lowest permission level, then the codestream to be parsed is the non-privacy codestream.

[0210] If there are multiple code streams to be parsed, then a reference unit may be obtained for each code stream to be parsed, and read according to the decoding information of the reference unit.

[0211] It should be noted that the surrounding processing units may be processing units adjacent to the current processing unit in the temporal or spatial domain. The decoded information corresponding to the reference unit may be information that has been parsed and decoded when reconstructing the image of the reference unit, such as prediction mode, quantization parameter, residual information, etc.

[0212] In actual use, when reading the code stream, it is still necessary to ensure that the reference information can be read. Therefore, it is necessary to avoid reading the code stream with a low permission level using the reference information of the high-privilege processing unit when reading the code stream. Therefore, the peripheral processing units whose corresponding permission level is less than or equal to the permission level of the code stream to be parsed can be used as reference units, and then the code stream to be parsed can be read with reference to the decoding information of the reference units.

[0213] If the code stream to be parsed is a privacy code stream, the permission level of the code stream to be parsed is consistent with the unit permission level; if the code stream to be parsed is a non-privacy code stream, the permission level of the code stream to be parsed is the lowest permission level.

[0214] It is understandable that since there may be multiple code streams to be parsed, after reading the code streams to be parsed, a code stream to be decoded can be selected from them. The selection method is consistent with the above method of determining the code stream to be decoded, which will not be repeated here.

[0215] Step S30: Decode the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0216] It is understandable that after the code stream to be decoded is determined, the code stream to be decoded can be decoded and image reconstruction can be performed to obtain a reconstructed image block corresponding to the current processing unit.

[0217] In a specific implementation, in order to improve the user experience and allow low-privilege users to choose how to display the contents of the privacy area, a custom mode is added on the basis of the privacy masking mode. If it is determined that the current processing unit is the processing unit corresponding to the privacy area (i.e., the unit permission level is not the lowest permission level) and the user is a low-privilege user (i.e., the user permission level is lower than the unit permission level), it is possible to further detect whether the custom mode is enabled to determine whether it is necessary to generate a reconstructed image block corresponding to the current processing unit in the custom mode. In this case, step S30 of this embodiment may include:

[0218] If the custom mode is not enabled, the code stream to be decoded is decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0219] It is understandable that if the custom mode is not turned on, it means that the low-authority user has not used a custom method to limit how to display the content of the privacy area. Therefore, the image block obtained by decoding the decoded code stream and reconstructing the image can be used as the reconstructed image block corresponding to the current processing unit.

[0220] Among them, the custom mode is closed by default. Whether the custom mode is turned on can be determined according to the value of the custom mode flag parameter of the relevant parameters in the decoding end. The user of the decoding end can modify the custom mode flag parameter to turn the custom mode on or off.

[0221] For example, a custom mode flag parameter value of 0 indicates that the custom mode is off, and a custom mode flag parameter value of 1 indicates that the custom mode is on. The default value of the custom mode flag parameter is 0.

[0222] If custom mode is enabled, the reconstructed image block of the current processing unit can be generated in any of the following ways:

[0223] Decode the code stream to be decoded to obtain a decoded image block, and replace the decoded image block with an image block constructed with pixel values specified by the custom mode as the reconstructed image block corresponding to the current processing unit;

[0224] Do not decode the code stream to be decoded, obtain the pixel values specified by the custom mode, and construct the reconstructed image block corresponding to the current processing unit according to the pixel values;

[0225] Decode the code stream to be decoded to obtain the reconstructed image block corresponding to the current processing unit.

[0226] In actual use, the method for generating the reconstructed image block for the current processing unit can be specified using a mode parameter of the custom mode. For example, the custom mode includes a specific mode parameter type, with values ranging from 1 to 3, each corresponding to a method for generating the reconstructed image block for the current processing unit. Of course, a second custom mode can also be set within the custom mode, and the method can be specified based on the mode parameter corresponding to the second custom mode. This embodiment does not limit this.

[0227] It should be noted that the decoded image block may be an image block obtained by decoding the code stream to be decoded and reconstructing the image. The pixel value specified by the custom mode may be specified by the relevant parameters set at the decoding end.

[0228] It can be understood that the decoded code stream is decoded to obtain a decoded image block, and the decoded image block is replaced by an image block constructed by the pixel values specified by the custom mode as the reconstructed image block corresponding to the current processing unit. At this time, the decoded image block obtained by decoding can be cached. If the user modifies the on or off status of the custom mode, there is no need to re-decode at this time, and the decoded image block can be directly extracted from the cache for display.

[0229] If the cache is not considered, in order to reduce the encoding process, the reconstructed image block corresponding to the current processing unit can be directly constructed according to the pixel value specified by the custom mode.

[0230] Of course, the user may also choose to use the image block obtained by decoding the code stream to be decoded as the reconstructed image block corresponding to the current processing unit.

[0231] In a specific implementation, when performing spatial layered coding, there is coding of the enhancement layer and the base layer, wherein the processing unit of the base layer first parses and reconstructs, and then the processing unit of the enhancement layer may refer to the mode information and reconstructed pixels of the base layer processing unit to perform parsing and reconstruction. If the current processing unit is the enhancement layer processing unit, then step S30 of this embodiment may include:

[0232] Obtaining reference information corresponding to the current processing unit in the base layer;

[0233] If the permission level of the code stream to be decoded is greater than the permission level of the reference information, the code stream to be decoded is decoded with reference to the reference information to obtain a reconstructed image block corresponding to the current processing unit.

[0234] It should be noted that the reference information may include pattern reference information and pixel reference information. Of course, it may also include more reference information, which is not limited in this embodiment.

[0235] In practice, if a low-privilege-level bitstream is decoded while referencing high-privilege reference information, the difference in user privilege levels may cause the high-privilege reference information to fail to be retrieved, ultimately leading to decoding errors. To avoid this, after obtaining the reference information corresponding to the current processing unit in the base layer, the privilege level of the reference information can be compared with the privilege level of the bitstream to be decoded. The privilege level of the reference information is consistent with the privilege level of the processing unit to which it belongs.

[0236] It is understandable that if the permission level of the code stream to be decoded is greater than the permission level of the reference information, this means that when decoding the code stream to be decoded, reference information with a permission level higher than the permission level of the code stream to be decoded is not referenced, and no decoding error will occur. Therefore, the code stream to be decoded can be decoded based on the reference information to obtain the reconstructed image block corresponding to the current processing unit.

[0237] In actual applications, in some cases, enhancement processing can be skipped, and the pixels in the base layer at the same position as the current processing unit can be directly used as the reconstructed pixels of the current processing unit (in this case, the current processing unit is the enhancement layer processing unit). For example, if the privacy coding mode is turned on, and the enhancement layer and the base layer have the same resolution and the same block division method, when the user authority level is less than the authority level of the current processing unit (in this case, the current processing unit is the enhancement layer processing unit), the current processing unit skips parsing and directly uses the pixels in the base layer at the same position as the current processing unit as the reconstructed pixels of the current processing unit.

[0238] For ease of understanding, now combined Figure 7 、 8 and 9 for illustration, but do not limit this solution.

[0239] The image encoding process of the improved privacy protection scheme is as follows: Figure 7 As shown in the figure, during the encoding process, if the current processing unit (current CU) is in the privacy area (that is, the current processing unit is the image processing unit corresponding to the privacy area), the CU privacy code stream is encoded first. If the front-end masked privacy area mode (that is, privacy encoding mode) is turned on, the non-privacy code stream corresponding to the current CU will be additionally encoded; if it is not in the privacy area, only the non-privacy code stream corresponding to the current CU will be encoded.

[0240] The improved privacy protection scheme is executed on the decoding end. The decoding process for high-authority users is as follows: Figure 8 As shown, the decoding process for low-privilege users is as follows Figure 9 As shown in the figure, if the current CU is in the privacy area, it will first detect whether the privacy coding mode is enabled. If the privacy coding mode is enabled, the low-privilege user will read and decode the non-private code stream to obtain the reconstructed image block corresponding to the current processing unit, while the high-privilege user will read both the privacy code stream and the non-private code stream, but will only decode the privacy code stream to obtain the reconstructed image block corresponding to the current processing unit. If the privacy coding mode is not enabled, all decoding-end users will read and decode the non-private code stream.

[0241] This embodiment obtains the unit permission level and user permission level when the privacy coding mode is enabled. The unit permission level represents the permission level of the current processing unit, while the user permission level represents the permission level of the user at the decoding end. Based on the unit permission level and user permission level, the to-be-decoded bitstream corresponding to the current processing unit is determined. The to-be-decoded bitstream is then decoded to obtain the reconstructed image block corresponding to the current processing unit. Since the corresponding to-be-decoded bitstream is selected for decoding based on the unit permission level and user permission level when the privacy coding mode is enabled, even low-privilege users can decode the non-privacy bitstream and obtain a reconstructed image corresponding to the de-privacy image content corresponding to the privacy region, preventing low-privilege users from skipping decoding of the processing units corresponding to the privacy region.

[0242] refer to Figure 10 , Figure 10 This is a flowchart of a second embodiment of an image decoding method of the present application.

[0243] Based on the first embodiment, the image decoding method of this embodiment further includes, before step S10:

[0244] Step S01: extracting a mode flag from an image code stream corresponding to an image to be decoded.

[0245] It should be noted that the mode flag can be read from the image code stream using sequence-level syntax. The image to be decoded can be the image currently being decoded, and can be a single-frame image or multiple-frame images, which is not limited in this embodiment.

[0246] Step S02: determining whether the privacy coding mode is enabled according to the value of the mode flag.

[0247] It should be noted that whether the privacy coding mode is turned on can be determined based on the value of the mode flag. The correspondence between the value of the mode flag and whether the privacy coding mode is turned on can be pre-set by the administrator of the decoding device. For example, if the mode flag value is 1, it means that the privacy coding mode is on; if the mode flag value is 0, it means that the privacy coding mode is off.

[0248] It should be noted that if the privacy coding mode is turned on, it means that the improved privacy protection scheme is adopted at this time, and the above step S10 and subsequent steps can be executed at this time.

[0249] If the privacy coding mode is turned off, it means that the privacy protection scheme before the improvement is still used. In this case, after step S02 of this embodiment, the following steps may also be included:

[0250] When the privacy coding mode is off, obtain the unit permission level and user permission level;

[0251] If the unit authority level is not the lowest authority level, and the user authority level is greater than or equal to the unit authority level, obtaining the code stream corresponding to the unit authority level;

[0252] Using the code stream corresponding to the unit authority level as the code stream to be decoded corresponding to the current processing unit;

[0253] Decode the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0254] It can be understood that if the privacy coding mode is in the off state, it means that the image encoding end is still using the privacy protection scheme before the improvement for encoding. If the unit authority level is not the lowest authority level at this time, and the user authority level is greater than or equal to the unit authority level, it means that the current processing unit is the processing unit corresponding to the privacy area, and the user has the authority to obtain the image content of the privacy area. However, in the previous scheme, since low-authority users skip decoding the processing unit corresponding to the privacy area, there is no relevant basic information for decoding the processing unit corresponding to the privacy area in the non-privacy code stream. At this time, the high-authority user no longer needs to obtain the non-privacy code stream. Therefore, the code stream corresponding to the current processing unit can be obtained, and the code stream corresponding to the unit authority level can be used as the code stream to be decoded corresponding to the current processing unit. The to-be-decoded code stream is then decoded to obtain the reconstructed image block corresponding to the current processing unit.

[0255] In actual use, during decoding of the code stream to be decoded, if the permission level of the reconstructed units around the current processing unit is less than or equal to the permission level of the current processing unit, the code stream to be decoded can be decoded with reference to the reconstruction information of the reconstructed units, otherwise it cannot be referenced.

[0256] For example: assuming that the current CU permission level is not equal to 0, but during parsing, the information in the current CU is parsed from the code stream with level 0. During the parsing process, if it is necessary to refer to the CU information in the surrounding spatial domain or time domain and the CU permission level in the surrounding spatial domain or time domain is greater than the permission level of the code stream to be decoded, the referenced CU is marked as non-existent or cannot be referenced;

[0257] Assuming that the current CU permission level is equal to 0 (the lowest permission), when parsing, the information in the current CU is parsed from the bitstream of level 0. During the parsing process, if it is necessary to refer to the CU information in the surrounding spatial domain or time domain and the CU permission level in the surrounding spatial domain or time domain is greater than the bitstream level, the referenced CU is marked as non-existent or cannot be referenced;

[0258] If the current CU permission level is not equal to 0, during parsing, the current CU information is parsed from the bitstream with non-0 permission level. During the parsing process, the CU information with permission less than or equal to the current CU permission level in the surrounding or time domain can be referenced.

[0259] In a possible implementation of this embodiment, when the privacy coding mode is in the off state, after the step of obtaining the unit authority level and the user authority level, the following steps may be further included:

[0260] If the unit authority level is not the lowest authority level, and the user authority level is lower than the unit authority level, constructing a reconstructed image block corresponding to the current processing unit according to fixed pixel values;

[0261] or,

[0262] If the unit authority level is not the lowest authority level and the user authority level is lower than the unit authority level, a reconstructed image block corresponding to the current processing unit is constructed based on the reconstructed image blocks corresponding to the reconstructed units surrounding the current processing unit.

[0263] It should be noted that if the unit permission level is not the minimum permission level, and the user permission level is lower than the unit permission level, it means that the current processing unit is the processing unit corresponding to the privacy area, and the user does not have the permission to obtain the image content of the privacy area. At this time, for this current processing unit, the decoding end needs to skip decoding. In order to ensure the integrity of the subsequent image, it can be considered to use fixed pixel values for padding to construct the reconstructed image block corresponding to the current processing unit.

[0264] Of course, you can also try to construct the reconstructed image block corresponding to the current processing unit based on the reconstructed image blocks corresponding to the reconstructed units around the current processing unit. For example, extract one or more pixel values from the reconstructed image blocks corresponding to the reconstructed units around the current processing unit for interpolation and filling to construct the reconstructed image block corresponding to the current processing unit.

[0265] This embodiment extracts a mode flag from the image stream corresponding to the image to be decoded. This mode flag is a sequence-level syntax. The value of this mode flag determines whether the privacy coding mode is enabled based on the value of the mode flag. Because the mode flag is stored in the image stream using sequence-level syntax, the decoder can quickly determine whether the privacy coding mode is enabled based on the sequence-level syntax after receiving the image stream.

[0266] refer to Figure 11 , Figure 11 This is a flowchart of a third embodiment of an image decoding method of the present application.

[0267] Based on the first embodiment, the image decoding method of this embodiment further includes, before step S10:

[0268] Step S01 ′: extracting a code stream corresponding to the lowest permission level from the image code stream corresponding to the image to be decoded.

[0269] Step S02': extracting unit division information from the code stream corresponding to the lowest authority level.

[0270] Step S03 ′: performing unit division according to the unit division information to obtain a plurality of image processing units.

[0271] Step S04': traverse the multiple image processing units to obtain a current processing unit;

[0272] It should be noted that in order to ensure that all users can obtain the unit division information, when performing image encoding, the encoding end will encode the unit division information into the code stream corresponding to the lowest permission level (that is, write it into the non-privacy code stream). In order to ensure the normal execution of image decoding, the decoding end can first extract the code stream corresponding to the lowest permission level from the image code stream corresponding to the image to be decoded, and then extract the unit division information from the code stream corresponding to the lowest permission level. After that, the unit division is performed according to the unit division information to obtain multiple image processing units. After that, the multiple image processing units can be traversed, and the image processing unit obtained by traversal is used as the current processing unit.

[0273] After step S30, the following steps may also be included:

[0274] caching the reconstructed image block corresponding to the current processing unit;

[0275] When the caching is completed, if the current processing unit is the last image processing unit among the multiple image processing units, a reconstructed image corresponding to the image to be decoded is constructed according to the reconstructed image blocks corresponding to the cached image processing units.

[0276] It should be noted that after obtaining the reconstructed image block corresponding to the current processing unit, since it is not certain whether the multiple image processing units obtained have been processed, that is, whether the image decoding of the image to be decoded has been completed, the reconstructed image block corresponding to the current processing unit can be cached first, and then it is detected whether the current processing unit is the last image processing unit among the multiple image processing units obtained.

[0277] In actual use, if the current processing unit is the last image processing unit among multiple image processing units, it means that the image decoding of the image to be decoded has been completed, and the reconstructed image blocks corresponding to the previously cached image processing units can be read from the cache and combined, spliced, etc. to generate a reconstructed image corresponding to the image to be decoded.

[0278] If the current processing unit is not the last one among the multiple image processing units, it means that the image decoding of the image to be decoded has not been completed yet, and the process can return to the above step S04 ′ to continue traversal.

[0279] In a possible implementation of this embodiment, in order to ensure the display effect of the reconstructed image, before the step of caching the reconstructed image block corresponding to the current processing unit in the embodiment, the following steps may be further included:

[0280] Extracting filtered pixels and reference pixels corresponding to the filtered pixels from the reconstructed image block;

[0281] If the authority level of the filtered pixel is less than the authority level of any of the reference pixels, filtering of the filtered pixel is skipped, and the reconstructed image block is cached.

[0282] It should be noted that, since the image is reconstructed after image encoding and decoding, it is inevitable that a certain amount of noise will be generated, which will affect the display effect of the image. At this time, filtering processing is required to suppress the generated noise to ensure a better display effect of the image. Extracting filter pixels from the reconstructed image block can be to use some or all pixels in the reconstructed image block as filter pixels. The reference pixel can be a pixel referenced when filtering the filter pixel, or a pixel at a position around the filter pixel. The pixel at a position around the filter pixel can be a pixel corresponding to one or more samples above, below, left, right, upper left corner, lower left corner, upper right corner and lower right corner of the filter pixel. The authority level of the filter pixel and the reference pixel is consistent with the authority level of the corresponding processing unit.

[0283] In practical applications, when performing filtering processing, it is also necessary to avoid filtering pixels whose reference authority level is higher than the authority level of the filtered pixel. Therefore, the authority level of the filtered pixel can be compared with the authority level of each reference pixel. If the authority level of the filtered pixel is lower than the authority level of any reference pixel, it means that there is a reference pixel used for filtering the filtered pixel with an authority higher than the authority of the filtered pixel. At this time, the data reading may fail due to the user's authority level, and ultimately lead to an error. In order to avoid this phenomenon, the filtering processing of the filtered pixel can be skipped and the reconstructed image block can be directly cached.

[0284] In actual use, in order to ensure the comprehensiveness of the judgment, the authority level of the filtered pixel can be first compared with the authority level of each pixel in its surrounding positions. When the authority level of the filtered pixel is greater than the authority level of each pixel in the surrounding positions, the pixel referenced when filtering the filtered pixel is obtained, and the authority level of the filtered pixel is compared with the authority level of each pixel referenced when filtering.

[0285] If the authority level of the filtered pixel is lower than the authority level of any pixel in its surrounding position, or the authority level of the filtered pixel is lower than the authority level of any pixel referenced during filtering, filtering of the filtered pixel can be skipped.

[0286] If the permission level of the filtered pixel is greater than or equal to the permission levels of all reference pixels, it means that there are no reference pixels with higher permission levels than the filtered pixel when filtering the filtered pixel. In this case, the filtering process can proceed normally. Therefore, the filtered pixel can be filtered based on the reference pixels. The filtering process can be performed using a commonly used filtering algorithm, such as a mean filter, a median filter, etc.

[0287] In a specific implementation, if the reference pixel is a pixel used as a reference when filtering the filtered pixel, then the step of extracting the filtered pixel and the reference pixel corresponding to the filtered pixel from the reconstructed image block in this embodiment may include:

[0288] Extracting filtered pixels from the reconstructed image block, and acquiring target pixels according to reference positions corresponding to the filtered pixels;

[0289] If the target pixel is available, using the target pixel as a reference pixel;

[0290] If the target pixel is not available, the pixel at the nearest position to the target pixel in the filtering unit corresponding to the filtering pixel is used as the reference pixel, and the authority level of the pixel at the nearest position to the target pixel in the filtering unit corresponding to the filtering pixel is used as the authority level of the reference pixel.

[0291] It should be noted that the reference position corresponding to the filtered pixel can be pre-set by the administrator of the decoding device based on the filtering algorithm used. The filtering unit corresponding to the filtered pixel can be the filtering unit to which the filtered pixel belongs during the filtering process. The filtering unit can correspond to at least one processing unit. For example, during the filtering process, the filtering unit can include all pixels in processing unit A and some pixels in processing unit B.

[0292] In actual use, if the target pixel is outside the image, outside the slice boundary when cross-slice filtering is not allowed, or outside the upper or lower boundary of the current processing unit, it can be determined that the target pixel is unavailable. Otherwise, it can be determined that the target pixel is available.

[0293] It can be understood that if the target pixel is available, it means that the target pixel can be obtained normally during the filtering process, so the target pixel can be directly used as a reference pixel; if the target pixel is unavailable, it means that the target pixel cannot be directly obtained during the filtering process, and then a replacement is required. At this time, the pixel with the smallest possible difference can be used for replacement. Therefore, the pixel at the nearest position to the target pixel in the filtering unit corresponding to the filtered pixel can be used as the reference pixel. Since the authority level of the reference pixel may be read according to the reference position during the filtering process, after the replacement, in order to avoid errors in the authority level reading, the authority level of the pixel at the nearest position to the target pixel in the filtering unit corresponding to the filtered pixel can also be used as the authority level of the reference pixel.

[0294] There may be multiple reference positions and multiple reference pixels obtained. For each reference pixel, a judgment can be made separately to determine whether it is available and subsequent processing can be performed without affecting each other.

[0295] This embodiment extracts the codestream corresponding to the lowest permission level from the image codestream corresponding to the image to be decoded; extracts unit division information from the codestream corresponding to the lowest permission level; performs unit division based on the unit division information to obtain multiple image processing units; and traverses the multiple image processing units to obtain the current processing unit. Because the unit division information is extracted from the codestream corresponding to the lowest permission level, the image processing units can be divided based on the unit division information, ensuring that the image decoding method can proceed in a reasonable and orderly manner.

[0296] refer to Figure 12 , Figure 12 This is a flowchart of a fourth embodiment of an image decoding method of the present application.

[0297] Based on the first embodiment, step S30 of the image decoding method of this embodiment includes:

[0298] Step S301: Acquire multiple sets of quantization parameters set according to user authority levels.

[0299] It should be noted that the decoding end will set multiple sets of quantization parameters according to the user's permission level.

[0300] The multiple sets of quantization parameters are initialized and obtained according to the quantization information of the peripheral processing units, and each set of quantization parameters in the multiple sets of quantization parameters corresponds to a level of authority.

[0301] For example: assuming the minimum permission level is 0, if the user permission level of the decoding end user is 1, the decoding end will set 1+1=2 sets of quantization parameters, one set corresponding to permission level 0 and the other set corresponding to permission level 1; if the user permission level of the decoding end user is 2, the decoding end will set 2+1=3 sets of quantization parameters, and the 3 sets of quantization parameters correspond to permission levels 0, 1 and 2 respectively.

[0302] In actual use, the above-mentioned multiple sets of quantization parameters all meet the following conditions:

[0303] If the authority level of the peripheral processing unit is less than or equal to the authority level corresponding to the quantization parameter, the current quantization parameter is equal to the quantization parameter of the peripheral processing unit;

[0304] If the permission level of the surrounding processing unit is greater than the permission level corresponding to the quantization parameter, the quantization parameter is equal to the quantization parameter of the current slice level, the current coding tree unit (LCU) or the current frame level.

[0305] Step S302: Update the multiple sets of quantization parameters.

[0306] It should be noted that updating the multiple sets of quantization parameters may be updating the multiple sets of quantization parameters according to the code streams read previously.

[0307] In a possible implementation of this embodiment, a region of a fixed size may include multiple processing units. In this case, step S302 of this embodiment may include:

[0308] If the unit authority level is not the lowest authority level and the user authority level is greater than or equal to the unit authority level, selecting a private quantization parameter from the multiple sets of quantization parameters based on the authority level of the private code stream, and selecting a non-private quantization parameter from the multiple sets of quantization parameters based on the authority level of the non-private code stream;

[0309] The private quantization parameter is updated according to the quantization information of the current processing unit extracted from the private code stream, and the non-private quantization parameter is updated according to the quantization information of the current processing unit extracted from the non-private code stream.

[0310] It is understood that if the unit permission level is not the minimum permission level and the user permission level is greater than or equal to the unit permission level, the decoder will read the private codestream and non-private codestream corresponding to the current processing unit. At this time, the private quantization parameter can be selected from multiple sets of quantization parameters based on the permission level of the private codestream, and the non-private quantization parameter can be selected from multiple sets of quantization parameters based on the permission level of the non-private codestream. The private quantization parameter is then updated based on the quantization information of the current processing unit extracted from the private codestream, and the non-private quantization parameter is updated based on the quantization information of the current processing unit extracted from the non-private codestream. The current processing unit can also be divided into multiple sub-blocks, and the quantization information of the current processing unit may include information such as the quantization parameters of each divided sub-block.

[0311] For example, assuming the user permission level of the decoder user is 2, the decoder will set 2+1=3 sets of quantization parameters, corresponding to permission levels 0, 1, and 2, respectively. If the permission level of the privacy code stream is 1 and the permission level of the non-privacy code stream is 0, the corresponding quantization parameters for permission level 1 can be updated based on the quantization information of the current processing unit extracted from the privacy code stream, and the corresponding quantization parameters for permission level 0 can be updated based on the quantization information of the current processing unit extracted from the non-privacy code stream.

[0312] Similarly, similar processing may be performed for a low-authority user or a low-authority current processing unit. In this case, step S302 of this embodiment may include:

[0313] If the unit authority level is the lowest authority level, or the user authority level is lower than the unit authority level, selecting a non-private quantization parameter from the multiple sets of quantization parameters according to the authority level of the non-private code stream;

[0314] The non-private quantization parameter is updated according to the quantization information of the current processing unit extracted from the non-private code stream.

[0315] It should be noted that if the unit permission level is the lowest permission level, or the user permission level is lower than the unit permission level, the decoding end will only read the non-private code stream. At this time, the non-private quantization parameter can be selected from multiple sets of quantization parameters based on the non-private code stream, and the non-private quantization parameter can be updated based on the quantization information of the current processing unit extracted from the non-private code stream.

[0316] Step S303: After the update is completed, the to-be-decoded code stream is decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0317] It can be understood that after the update is completed, when decoding the to-be-decoded code stream, the corresponding target quantization parameter can be obtained from the updated multiple sets of quantization parameters according to the permission level of the to-be-decoded code stream, and then inverse quantization and other processing are performed based on the target quantization parameter to decode the decoded code stream and reconstruct the image to obtain the reconstructed image block corresponding to the current processing unit.

[0318] This embodiment obtains multiple sets of quantization parameters, set based on user privilege levels; updates these multiple sets of quantization parameters; and, after the updates are complete, decodes the to-be-decoded bitstream to obtain a reconstructed image block corresponding to the current processing unit. Because multiple sets of quantization parameters are set based on user privilege levels and are updated based on the acquired bitstream before decoding, this ensures that quantization parameters remain consistent even when the current processing unit is further divided into sub-blocks.

[0319] refer to Figure 13 , Figure 13 This is a flowchart of a fifth embodiment of an image decoding method of the present application.

[0320] Based on the first embodiment, step S30 of the image decoding method of this embodiment includes:

[0321] Step S301 ′: if it is detected that the sample reference condition is met, then obtaining a reference sample corresponding to the current processing unit.

[0322] It should be noted that if intra-frame prediction is used at the encoder, intra-frame prediction can also be performed during image decoding. However, if intra-frame prediction is used, it is necessary to detect whether there are reference samples. The reference samples can be samples at the reference position corresponding to the current processing unit. The reference position corresponding to the current processing unit can be determined based on the prediction mode of intra-frame prediction.

[0323] In a specific implementation, in order to determine whether a sample reference can be performed, before step S301' in this embodiment, the following steps may be further included:

[0324] If there is at least one reference sample at the reference position corresponding to the current processing unit that belongs to the same slice level as the current processing unit, image reconstruction has been completed, and the corresponding permission level is less than or equal to the permission level of the code stream to be decoded, then it is determined that the sample reference condition is met.

[0325] It can be understood that if there is at least one reference sample at the reference position corresponding to the current processing unit that belongs to the same slice level as the current processing unit, image reconstruction has been completed, and the corresponding permission level is less than or equal to the permission level of the code stream to be decoded, it means that there is at least one sample in the current flow unit that can be directly referenced for intra-frame prediction. Therefore, it can be determined that the sample reference condition is met.

[0326] Step S302 ′: performing intra-frame prediction according to the reference samples to obtain a prediction result.

[0327] Step S303 ′: Decoding is performed according to the prediction result and the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0328] It can be understood that after obtaining the reference samples, intra-frame prediction can be performed based on the reference samples, and the decoding of the decoded code stream can be assisted based on the intra-frame prediction results, thereby speeding up the decoding and image reconstruction speed, thereby ensuring that the reconstructed image block corresponding to the current unit can be quickly obtained.

[0329] In a specific implementation, to ensure that intra-frame prediction can be performed normally, step S302' in this embodiment may include:

[0330] Taking a reference sample whose corresponding permission level is greater than the permission level of the code stream to be decoded as a target sample;

[0331] Performing pixel replacement processing on the target sample in the reference sample, where a processing manner of the pixel replacement processing is determined according to a position of the target sample relative to the current processing unit;

[0332] Intra-frame prediction is performed based on the reference sample after replacement processing to obtain a prediction result.

[0333] It should be noted that, in some cases, the reference samples may contain samples whose corresponding permission levels are greater than the permission level of the code stream to be decoded. Due to the influence of the user permission level, the information of such samples may not be read during decoding, and they cannot be directly referenced and need to be processed. In this case, pixel replacement processing is performed, and then intra-frame prediction is performed based on the reference samples after replacement processing to obtain the prediction results, thereby ensuring that the intra-frame prediction will not cause execution errors due to information acquisition failure.

[0334] For ease of understanding, now combined Figure 14 This is to illustrate the alternative treatments but not to limit the present solution. Figure 14 Schematic diagram of the reference sample position of this embodiment.

[0335] For the current processing unit directly above Figure 14 Middle r1-r8 (or left Figure 14For reference samples c1-c8), if the permission level of the first part of the samples is less than or equal to the permission level of the current processing unit, and the permission level of the second part of the samples is greater than the permission level of the current processing unit, the pixel values of the second part of the reference samples are replaced by fixed values.

[0336] For the upper right corner of the current processing unit Figure 14 Middle r9-r16 (or lower left Figure 14 For the reference samples in c9-c16), if the permission level of the first part of the samples is less than or equal to the permission level of the current processing unit, and the permission level of the second part of the pixels is greater than the permission level of the current processing unit, the reference samples in the upper right are arranged from left to right, and the reference samples in the lower left are arranged from top to bottom. Then, the pixel r[i] of the second part of the reference samples in the upper right is r[i-1], and the pixel c[i] of the second part of the reference samples in the lower left is c[i-1].

[0337] It should be noted that the embodiments of the image decoding methods provided in the above embodiments can be combined in any manner to obtain new embodiments.

[0338] This embodiment, if it is detected that a sample reference condition is met, obtains a reference sample corresponding to the current processing unit; performs intra-frame prediction based on the reference sample to obtain a prediction result; and decodes the code stream to be decoded based on the prediction result to obtain a reconstructed image block corresponding to the current processing unit. Because intra-frame prediction is performed on the reference sample in a reasonable manner and image decoding is assisted by the intra-frame prediction result, image decoding efficiency is improved.

[0339] The present application embodiment provides an image encoding method, referring to Figure 15 , Figure 15 This is a flowchart of a first embodiment of an image encoding method of the present application.

[0340] In this embodiment, the image encoding method includes the following steps:

[0341] Step A10: When the privacy coding mode is on, a privacy determination result is obtained, where the privacy determination result is used to indicate whether the current processing unit is located in a privacy area.

[0342] It should be noted that the executor of this embodiment may be a decoding end device, and the decoding end device may be an electronic device used at the encoding end for image encoding. The electronic device may be an electronic device such as a personal computer, a server, or other devices that can achieve the same or similar functions. This embodiment does not impose any restrictions on this. In this embodiment and the following embodiments, the image encoding method of this embodiment is described using a decoding end device.

[0343] It should be noted that if the privacy coding mode is on, it means that the improved privacy protection mode is adopted at this time. At this time, additional processing methods are required for the image content corresponding to the privacy area. Therefore, you can first obtain the privacy judgment result used to characterize whether the current processing unit is located in the privacy area.

[0344] Step A20: Encode the image corresponding to the current processing unit according to the privacy determination result to generate at least one code stream corresponding to the current processing unit.

[0345] It is understandable that the image content of the privacy area and the image content of the private area need to be encoded in different ways, and at least one code stream corresponding to the current processing unit can be generated.

[0346] In a specific implementation, to ensure that the image can be decoded normally, step S20 in this embodiment may include:

[0347] If the privacy determination result is that the image is located in a privacy area, encoding the image corresponding to the current processing unit to generate a privacy code stream and a non-privacy code stream corresponding to the current processing unit;

[0348] If the privacy determination result is that the image is not located in the privacy area, the image corresponding to the current processing unit is encoded to generate a non-privacy code stream corresponding to the current processing unit.

[0349] It is understandable that if the privacy determination result is that the unit is located in the privacy area, it means that the current processing unit is the image processing unit corresponding to the privacy area. In this case, in order to prevent the image encoder from skipping the current unit during decoding, it is necessary to encode the image corresponding to the current processing unit and generate the privacy code stream and non-privacy code stream corresponding to the current processing unit.

[0350] If the privacy determination result is not located in the privacy area, it means that the current processing unit is not the image processing unit corresponding to the privacy area. At this time, the image corresponding to the current processing unit can be directly encoded to generate a non-privacy code stream corresponding to the current processing unit.

[0351] Among them, the encoding of the private code stream and the non-private code stream uses different entropy encoders. The entropy encoder for encoding the private code stream corresponds to the entropy decoder for reading the private code stream at the decoding end, and the entropy encoder for encoding the non-private code stream corresponds to the entropy decoder for reading the non-private code stream at the decoding end.

[0352] In a possible implementation of this embodiment, in order to speed up the image encoding processing speed, step A20 of this embodiment may include:

[0353] If it is detected that the sample reference condition is met, obtaining a reference sample corresponding to the current processing unit;

[0354] Perform intra-frame prediction based on the reference sample to obtain a prediction result;

[0355] The image corresponding to the current processing unit is encoded based on the prediction result and the privacy determination result to generate at least one code stream corresponding to the current processing unit.

[0356] It should be noted that the sample reference conditions and the method for obtaining the reference samples corresponding to the current processing unit, as well as the subsequent intra-frame prediction method are similar to those implemented in the fifth embodiment of the above-mentioned image decoding method. Please refer to the above description and will not be repeated here.

[0357] In a possible implementation of this embodiment, in order to facilitate the decoding end to correctly perform permission control, after step A20 described in this embodiment, the following steps may be further included:

[0358] Obtaining the permission level of the privacy area to obtain the privacy permission level;

[0359] The permission level of the current processing unit and the privacy code stream is set to the privacy permission level, and the permission level of the non-privacy code stream is set to the lowest permission level.

[0360] It's understandable that the permission level of the private code stream is consistent with the permission level of the current processing unit, and its permission level is set based on the permission level of the privacy zone. Therefore, the permission level of the current processing unit and the private code stream can be set based on the permission level of the privacy zone. When decoding at the decoding end, the non-private code stream is accessible to all authorized users, so the permission level of the non-private code stream can be set to the lowest permission level.

[0361] In a specific implementation, to ensure compatibility with the privacy protection mode before the improvement, the image encoding method of this embodiment may further include:

[0362] When the privacy coding mode is off, obtain the privacy determination result;

[0363] If the privacy determination result is that the image is located in a privacy area, encoding the image corresponding to the current processing unit to generate a privacy code stream corresponding to the current processing unit;

[0364] If the privacy determination result is that the image is not located in the privacy area, the image corresponding to the current processing unit is encoded to generate a non-privacy code stream corresponding to the current processing unit.

[0365] It should be noted that if the privacy coding mode is in the off state, it means that the improved privacy protection mode is not used at this time. At this time, the processing flow of the privacy protection mode before the improvement needs to be used. Therefore, the privacy code stream or non-privacy code stream corresponding to the current processing unit is generated according to the privacy judgment result.

[0366] In one possible implementation of this embodiment, before step A10 described in this embodiment, the following steps may also be included:

[0367] Dividing the image to be encoded into units according to the unit division information to obtain a plurality of image processing units;

[0368] Traversing the multiple image processing units to obtain a current processing unit;

[0369] After step A20, the following steps may also be included:

[0370] If the current processing unit is the last processing unit among the multiple image processing units, constructing an image code stream according to at least one code stream corresponding to each processing unit;

[0371] The image code stream is sent to a decoding end.

[0372] It should be noted that the unit division information can be preferably set by the administrator of the encoding device according to actual needs. The image to be encoded can be the image data that currently needs to be encoded. The image to be encoded can be a single-frame image or a multi-frame image. This embodiment does not limit this.

[0373] It is understandable that if the current processing unit is the last processing unit among the multiple image processing units, it means that the image encoding has been completed at this time, and the image code stream can be constructed according to at least one code stream corresponding to each processing unit.

[0374] When constructing the image code stream, the code streams obtained by each entropy encoder can be spliced together, and then the code streams with different permissions can be spliced together based on the frame level to obtain a complete image code stream.

[0375] It should be noted that the decoding end device can also perform the reverse processing of the decoding device in the image decoding process. During this process, the image encoding method and the image decoding method can refer to each other, and the encoding methods corresponding to all image decoding method embodiments are applicable to this application.

[0376] Illustratively, the above embodiments can be implemented individually or in combination. For example, each of Embodiments 1 to 6 can be implemented individually, and at least two of Embodiments 1 to 6 can be implemented in combination. Illustratively, in the above embodiments, the content of the encoding end can also be adapted to the steps of the decoding end. That is, the implementation method of the encoding end can be derived based on the steps of the decoding end, and will not be repeated here.

[0377] This embodiment obtains a privacy determination result when the privacy coding mode is enabled. The privacy determination result indicates whether the current processing unit is located in a privacy region. Based on the privacy determination result, the image corresponding to the current processing unit is encoded to generate at least one codestream corresponding to the current processing unit. Because the image of the current processing unit is encoded to generate a privacy codestream and a non-privacy codestream when the current processing unit is determined to be an image processing unit corresponding to a privacy region, this ensures that even low-privacy users can decode the non-privacy codestream when decoding on the decoding end and obtain the de-privacyized image content corresponding to the privacy region.

[0378] Based on the same application concept as the above method, an embodiment of the present application also proposes a storage medium, on which an image decoding program and / or an image encoding program is stored. When the image decoding program is executed by a processor, the steps of the image decoding method described above are implemented, and when the image encoding program is executed by a processor, the steps of the image encoding method described above are implemented.

[0379] Based on the same application concept as the above method, an embodiment of the present application further provides a computer application, which, when executed by a processor, can implement the image decoding method or image encoding method disclosed in the above example of the present application.

[0380] Reference Figure 16 , Figure 16 This is a structural block diagram of the first embodiment of the image decoding device of the present application.

[0381] like Figure 16 As shown, the image decoding device proposed in the embodiment of the present application includes:

[0382] An acquisition module 10 is configured to acquire a unit authority level and a user authority level when the privacy coding mode is enabled, wherein the unit authority level is the authority level of the current processing unit and the user authority level is the authority level of the decoding end user;

[0383] An extraction module 20 is configured to determine a to-be-decoded bitstream corresponding to a current processing unit according to the unit authority level and the user authority level;

[0384] The decoding module 30 is configured to decode the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0385] This embodiment obtains the unit permission level and user permission level when the privacy coding mode is enabled. The unit permission level represents the permission level of the current processing unit, while the user permission level represents the permission level of the user at the decoding end. Based on the unit permission level and user permission level, the to-be-decoded bitstream corresponding to the current processing unit is determined. The to-be-decoded bitstream is then decoded to obtain the reconstructed image block corresponding to the current processing unit. Since the corresponding to-be-decoded bitstream is selected for decoding based on the unit permission level and user permission level when the privacy coding mode is enabled, even low-privilege users can decode the non-privacy bitstream and obtain a reconstructed image corresponding to the de-privacy image content corresponding to the privacy region, preventing low-privilege users from skipping decoding of the processing units corresponding to the privacy region.

[0386] In one possible implementation of this embodiment, the extraction module 20 is further configured to, if the unit permission level is not the lowest permission level and the user permission level is greater than or equal to the unit permission level, read a private codestream and a non-private codestream corresponding to the current processing unit, where the private codestream and the non-private codestream include at least one type of information used for prediction, inverse quantization, or inverse transformation, the non-private codestream being the codestream corresponding to the lowest permission level, and the private codestream being the codestream corresponding to the unit permission level; and use the private codestream as the to-be-decoded codestream corresponding to the current processing unit.

[0387] In a possible implementation of this embodiment, the extraction module 20 is further configured to read the privacy code stream corresponding to the current processing unit according to a first entropy decoder, and read the non-privacy code stream corresponding to the current processing unit according to a second entropy decoder, wherein the first entropy decoder is an entropy decoder corresponding to the unit permission level, and the second entropy decoder is an entropy decoder corresponding to the lowest permission level.

[0388] In one possible implementation of this embodiment, the extraction module 20 is further configured to, if the unit permission level is not the minimum permission level and the user permission level is lower than the unit permission level, read a non-private codestream corresponding to the current processing unit, the non-private codestream including at least one type of information used for prediction, inverse quantization, or inverse transformation; and use the non-private codestream as the to-be-decoded codestream corresponding to the current processing unit in one possible implementation of this embodiment.

[0389] In a possible implementation of this embodiment, the acquisition module 10 is further used to extract a mode flag from an image code stream corresponding to the image to be decoded, where the mode flag is a sequence-level syntax; and determine whether the privacy coding mode is enabled based on the value of the mode flag.

[0390] In one possible implementation of this embodiment, the acquisition module 10 is further configured to, when the privacy coding mode is off, acquire a unit authority level and a user authority level; if the unit authority level is not the minimum authority level and the user authority level is greater than or equal to the unit authority level, acquire a code stream corresponding to the unit authority level; use the code stream corresponding to the unit authority level as the to-be-decoded code stream corresponding to the current processing unit; and decode the to-be-decoded code stream to obtain a reconstructed image block corresponding to the current processing unit.

[0391] In a possible implementation of this embodiment, the acquisition module 10 is further used to construct a reconstructed image block corresponding to the current processing unit based on a fixed pixel value if the unit authority level is not the lowest authority level and the user authority level is less than the unit authority level; or, if the unit authority level is not the lowest authority level and the user authority level is less than the unit authority level, construct a reconstructed image block corresponding to the current processing unit based on the reconstructed image blocks corresponding to the reconstructed units surrounding the current processing unit.

[0392] In a possible implementation of this embodiment, the extraction module 20 is further configured to read the non-privacy code stream corresponding to the current processing unit if the unit authority level is the lowest authority level; and use the non-privacy code stream as the to-be-decoded code stream corresponding to the current processing unit.

[0393] In one possible implementation of this embodiment, the extraction module 20 is further configured to determine a codestream to be parsed based on the unit permission level and the user permission level; obtain surrounding processing units whose corresponding permission levels are less than or equal to the permission level of the codestream to be parsed, to obtain a reference unit, where the surrounding processing units are processing units adjacent to the current processing unit in the temporal or spatial domain; and read the codestream to be parsed with reference to decoding information corresponding to the reference units, and select a codestream to be decoded corresponding to the current processing unit from the codestream to be parsed, where the decoding information is information that has been parsed and decoded when performing image reconstruction on the reference unit.

[0394] In a possible implementation of this embodiment, the decoding module 30 is further configured to decode the to-be-decoded code stream to obtain a reconstructed image block corresponding to the current processing unit if the custom mode is not enabled.

[0395] In a possible implementation of this embodiment, the decoding module 30 is further configured to obtain the reconstructed image block corresponding to the current processing unit in any one of the following ways if the custom mode is enabled:

[0396] Decoding the to-be-decoded bitstream to obtain a decoded image block, and replacing the decoded image block with an image block constructed with pixel values specified by a custom mode as a reconstructed image block corresponding to a current processing unit;

[0397] Not decoding the to-be-decoded bitstream, obtaining pixel values specified by the custom mode, and constructing a reconstructed image block corresponding to the current processing unit according to the pixel values;

[0398] Decode the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0399] In a possible implementation of this embodiment, a method for obtaining the reconstructed image block corresponding to the current processing unit is specified according to a mode parameter corresponding to the custom mode.

[0400] In a possible implementation of this embodiment, the acquisition module 10 is further configured to extract a code stream corresponding to a lowest permission level from an image code stream corresponding to an image to be decoded; extract unit division information from the code stream corresponding to the lowest permission level; perform unit division according to the unit division information to obtain a plurality of image processing units; and traverse the plurality of image processing units to obtain a current processing unit.

[0401] The decoding module 30 is further configured to cache the reconstructed image blocks corresponding to the current processing unit; when caching is completed, if the current processing unit is the last image processing unit among the multiple image processing units, a reconstructed image corresponding to the image to be decoded is constructed based on the reconstructed image blocks corresponding to each cached image processing unit.

[0402] In a possible implementation of this embodiment, the decoding module 30 is further used to extract filtered pixels and reference pixels corresponding to the filtered pixels from the reconstructed image block, where the reference pixels are pixels referenced when filtering the filtered pixels, or pixels at peripheral positions of the filtered pixels; if the authority level of the filtered pixels is less than the authority level of any of the reference pixels, the filtering processing of the filtered pixels is skipped, and the reconstructed image block is cached.

[0403] In a possible implementation of this embodiment, the decoding module 30 is further configured to filter the filtered pixel according to the reference pixel if the authority level of the filtered pixel is greater than or equal to the authority level of all the reference pixels.

[0404] In a possible implementation of this embodiment, the decoding module 30 is further used to extract the filtered pixel from the reconstructed image block, and obtain the target pixel based on the reference position corresponding to the filtered pixel; if the target pixel is available, the target pixel is used as the reference pixel; if the target pixel is not available, the pixel at the nearest position to the target pixel in the filtering unit corresponding to the filtered pixel is used as the reference pixel, and the authority level of the pixel at the nearest position to the target pixel in the filtering unit corresponding to the filtered pixel is used as the authority level of the reference pixel.

[0405] In a possible implementation of this embodiment, the current processing unit is an enhancement layer processing unit;

[0406] The decoding module 30 is further configured to obtain reference information corresponding to the current processing unit in the base layer, the reference information including mode reference information and pixel reference information; if the permission level of the code stream to be decoded is greater than the permission level of the reference information, the code stream to be decoded is decoded with reference to the reference information to obtain a reconstructed image block corresponding to the current processing unit.

[0407] In a possible implementation of this embodiment, the decoding module 30 is further used to obtain multiple sets of quantization parameters set according to user authority levels; update the multiple sets of quantization parameters; and after the update is completed, decode the code stream to be decoded to obtain the reconstructed image block corresponding to the current processing unit.

[0408] In a possible implementation of this embodiment, each set of quantization parameters in the multiple sets of quantization parameters corresponds to a level of permission level, and the multiple sets of quantization parameters are initialized according to quantization information of the peripheral processing units;

[0409] Each set of quantization parameters in the multiple sets of quantization parameters satisfies the following conditions:

[0410] If the authority level of the peripheral processing unit is less than or equal to the authority level corresponding to the quantization parameter, the current quantization parameter is equal to the quantization parameter of the peripheral processing unit;

[0411] If the permission level of the peripheral processing unit is greater than the permission level corresponding to the quantization parameter, the quantization parameter is equal to the quantization parameter of the current slice level, the current coding tree unit or the current frame level.

[0412] In a possible implementation of this embodiment, the decoding module 30 is further configured to, if the unit permission level is not the lowest permission level and the user permission level is greater than or equal to the unit permission level, select a private quantization parameter from the multiple sets of quantization parameters based on the permission level of the private code stream, and select a non-private quantization parameter from the multiple sets of quantization parameters based on the permission level of the non-private code stream; and update the private quantization parameter based on quantization information of the current processing unit extracted from the private code stream, and update the non-private quantization parameter based on quantization information of the current processing unit extracted from the non-private code stream.

[0413] In a possible implementation of this embodiment, the decoding module 30 is further configured to, if the unit permission level is the lowest permission level, or the user permission level is lower than the unit permission level, select a non-private quantization parameter from the multiple sets of quantization parameters based on the permission level of the non-private code stream; and update the non-private quantization parameter based on quantization information of the current processing unit extracted from the non-private code stream.

[0414] In a possible implementation of this embodiment, the decoding module 30 is further configured to obtain a reference sample corresponding to the current processing unit if it is detected that a sample reference condition is met; perform intra-frame prediction based on the reference sample to obtain a prediction result; and perform decoding based on the prediction result and the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

[0415] In a possible implementation of this embodiment, the decoding module 30 is further configured to determine that the sample reference condition is met if there is at least one reference sample at the reference position corresponding to the current processing unit that belongs to the same slice level as the current processing unit, image reconstruction has been completed, and the corresponding permission level is less than or equal to the permission level of the code stream to be decoded.

[0416] In a possible implementation of this embodiment, the decoding module 30 is further configured to use a reference sample whose corresponding permission level is greater than the permission level of the code stream to be decoded as a target sample; perform pixel replacement processing on the target sample in the reference sample, where the pixel replacement processing method is determined according to the position of the target sample relative to the current processing unit; and perform intra-frame prediction based on the reference sample after the replacement processing to obtain a prediction result.

[0417] It should be understood that the above is merely an example and does not constitute any limitation on the technical solution of the present application. In specific applications, the image decoding device provided in this embodiment can execute the image decoding method provided by any of the above embodiments, or can execute the image decoding method provided by an embodiment composed of at least two of the above embodiments. Those skilled in the art can make settings as needed, and this application does not impose any restrictions on this.

[0418] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this application. In actual applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of this embodiment scheme, and no restrictions are imposed here.

[0419] In addition, for technical details not fully described in this embodiment, please refer to the image decoding method provided in any embodiment of the present application, and will not be repeated here.

[0420] Reference Figure 17 , Figure 17 This is a structural block diagram of the first embodiment of the image encoding device of the present application.

[0421] like Figure 17 As shown, the image encoding device proposed in the embodiment of the present application includes:

[0422] An acquisition module 100 is configured to acquire a privacy determination result when the privacy coding mode is enabled, wherein the privacy determination result is used to indicate whether the current processing unit is located in a privacy area;

[0423] The encoding module 200 is configured to encode the image corresponding to the current processing unit according to the privacy determination result, and generate at least one code stream corresponding to the current processing unit.

[0424] This embodiment obtains a privacy determination result when the privacy coding mode is enabled. The privacy determination result indicates whether the current processing unit is located in a privacy region. Based on the privacy determination result, the image corresponding to the current processing unit is encoded to generate at least one codestream corresponding to the current processing unit. Because the image of the current processing unit is encoded to generate a privacy codestream and a non-privacy codestream when the current processing unit is determined to be an image processing unit corresponding to a privacy region, this ensures that even low-privacy users can decode the non-privacy codestream when decoding on the decoding end and obtain the de-privacyized image content corresponding to the privacy region.

[0425] In one possible implementation of this embodiment, the encoding module 200 is further configured to, if the privacy determination result indicates that the image is located in a privacy area, encode the image corresponding to the current processing unit to generate a privacy code stream and a non-privacy code stream corresponding to the current processing unit; and, if the privacy determination result indicates that the image is not located in a privacy area, encode the image corresponding to the current processing unit to generate a non-privacy code stream corresponding to the current processing unit.

[0426] In a possible implementation of this embodiment, the private code stream and the non-private code stream are encoded using different entropy encoders;

[0427] The encoding module 200 is further configured to obtain the permission level of the privacy area and obtain a privacy permission level; set the permission level of the current processing unit and the privacy code stream to the privacy permission level, and set the permission level of the non-privacy code stream to the lowest permission level.

[0428] In a possible implementation of this embodiment, the encoding module 200 is further configured to obtain a privacy determination result when the privacy coding mode is off; if the privacy determination result indicates that the image is located in a privacy area, encode the image corresponding to the current processing unit to generate a privacy code stream corresponding to the current processing unit; if the privacy determination result indicates that the image is not located in a privacy area, encode the image corresponding to the current processing unit to generate a non-privacy code stream corresponding to the current processing unit.

[0429] In a possible implementation of this embodiment, the acquisition module 100 is further configured to divide the image to be encoded into units according to the unit division information to obtain a plurality of image processing units; and traverse the plurality of image processing units to obtain a current processing unit.

[0430] The encoding module 200 is further configured to construct an image code stream according to at least one code stream corresponding to each processing unit if the current processing unit is the last processing unit among the multiple image processing units; and send the image code stream to a decoding end.

[0431] In a possible implementation of this embodiment, the encoding module 200 is further configured to obtain a reference sample corresponding to the current processing unit if it is detected that a sample reference condition is met; perform intra-frame prediction based on the reference sample to obtain a prediction result; and encode the image corresponding to the current processing unit based on the prediction result and the privacy determination result to generate at least one code stream corresponding to the current processing unit.

[0432] It should be understood that the above is only an example and does not constitute any limitation to the technical solution of the present application. In specific applications, technicians in this field can make settings as needed, and the present application does not impose any restrictions on this.

[0433] It should be understood that the above is only an example and does not constitute any limitation to the technical solution of the present application. In specific applications, technicians in this field can make settings as needed, and the present application does not impose any restrictions on this.

[0434] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this application. In actual applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of this embodiment scheme, and no restrictions are imposed here.

[0435] In addition, for technical details not fully described in this embodiment, please refer to the image encoding method provided in any embodiment of the present application, and will not be repeated here.

[0436] In addition, 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 system 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 system. 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 system comprising the element.

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

[0438] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, or of course by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

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

Claims

1. An image decoding method, characterized in that: The image decoding method comprises: When the privacy coding mode is on, obtain the unit authority level and user authority level, where the unit authority level is the authority level of the current processing unit and the user authority level is the authority level of the decoding end user; Determine the to-be-decoded bitstream corresponding to the current processing unit according to the unit authority level and the user authority level; Get multiple sets of quantitative parameters according to user authority level; Updating the multiple sets of quantization parameters; After the update is completed, the to-be-decoded code stream is decoded to obtain a reconstructed image block corresponding to the current processing unit.

2. The image decoding method according to claim 1, wherein: Each set of quantization parameters in the plurality of sets of quantization parameters corresponds to a level of authority level, and the plurality of sets of quantization parameters are initialized according to quantization information of the peripheral processing units; Each set of quantization parameters in the multiple sets of quantization parameters satisfies the following conditions: If the authority level of the peripheral processing unit is less than or equal to the authority level corresponding to the quantization parameter, the current quantization parameter is equal to the quantization parameter of the peripheral processing unit; If the permission level of the peripheral processing unit is greater than the permission level corresponding to the quantization parameter, the quantization parameter is equal to the quantization parameter of the current slice level, the current coding tree unit or the current frame level.

3. The image decoding method according to claim 1, wherein: The updating of the multiple sets of quantization parameters includes: If the unit authority level is not the lowest authority level and the user authority level is greater than or equal to the unit authority level, selecting a private quantization parameter from the multiple sets of quantization parameters based on the authority level of the private code stream, and selecting a non-private quantization parameter from the multiple sets of quantization parameters based on the authority level of the non-private code stream; The private quantization parameter is updated according to the quantization information of the current processing unit extracted from the private code stream, and the non-private quantization parameter is updated according to the quantization information of the current processing unit extracted from the non-private code stream.

4. The image decoding method according to claim 1, wherein: The updating of the multiple sets of quantization parameters includes: If the unit authority level is the lowest authority level, or the user authority level is lower than the unit authority level, selecting a non-private quantization parameter from the multiple sets of quantization parameters according to the authority level of the non-private code stream; The non-private quantization parameter is updated according to the quantization information of the current processing unit extracted from the non-private code stream.

5. The image decoding method according to claim 1, wherein: When the privacy coding mode is on, before obtaining the unit authority level and the user authority level, the following steps are also included: Extracting a mode flag from an image code stream corresponding to an image to be decoded, wherein the mode flag is a sequence-level syntax; Whether the privacy coding mode is turned on is determined according to the value of the mode flag.

6. The image decoding method according to claim 5, wherein: After determining whether the privacy coding mode is on according to the value of the mode flag, the method further includes: When the privacy coding mode is off, obtain the unit permission level and user permission level; If the unit authority level is not the lowest authority level, and the user authority level is greater than or equal to the unit authority level, obtaining the code stream corresponding to the unit authority level; Using the code stream corresponding to the unit authority level as the code stream to be decoded corresponding to the current processing unit; Decode the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

7. The image decoding method according to claim 6, wherein: When the privacy coding mode is in the off state, after obtaining the unit authority level and the user authority level, the method further includes: If the unit authority level is not the lowest authority level, and the user authority level is lower than the unit authority level, a reconstructed image block corresponding to the current processing unit is constructed according to fixed pixel values.

8. The image decoding method according to claim 1, wherein: The determining the to-be-decoded code stream corresponding to the current processing unit according to the unit authority level and the user authority level includes: If the unit authority level is the lowest authority level, then read the non-privacy code stream corresponding to the current processing unit; The non-privacy code stream is used as the code stream to be decoded corresponding to the current processing unit.

9. The image decoding method according to claim 1, wherein: The determining the to-be-decoded code stream corresponding to the current processing unit according to the unit authority level and the user authority level includes: Determining a code stream to be parsed according to the unit authority level and the user authority level; Obtaining a peripheral processing unit whose corresponding permission level is less than or equal to the permission level of the code stream to be parsed, and obtaining a reference unit, wherein the peripheral processing unit is a processing unit adjacent to the current processing unit in the time domain or the spatial domain; Referring to the decoding information corresponding to the reference unit, the to-be-parsed code stream is read, and the to-be-decoded code stream corresponding to the current processing unit is selected from the to-be-parsed code stream, where the decoding information is information that has been parsed and decoded when reconstructing the image of the reference unit.

10. The image decoding method according to claim 1, wherein: The decoding of the to-be-decoded code stream to obtain a reconstructed image block corresponding to the current processing unit includes: If the custom mode is not enabled, the code stream to be decoded is decoded to obtain a reconstructed image block corresponding to the current processing unit.

11. The image decoding method according to claim 1, wherein: The mode parameter corresponding to the custom mode specifies a method for obtaining the reconstructed image block corresponding to the current processing unit.

12. The image decoding method according to claim 11, wherein: After decoding the to-be-decoded code stream to obtain a reconstructed image block corresponding to the current processing unit, the method further includes: Extracting a filtering pixel and a reference pixel corresponding to the filtering pixel from the reconstructed image block, wherein the reference pixel is a pixel referenced when filtering the filtering pixel, or a pixel at a peripheral position of the filtering pixel; If the authority level of the filtered pixel is less than the authority level of any of the reference pixels, filtering of the filtered pixel is skipped, and the reconstructed image block is cached.

13. The image decoding method according to claim 12, wherein: After extracting the filtered pixels and the reference pixels corresponding to the filtered pixels from the reconstructed image block, the method further includes: If the authority level of the filtered pixel is greater than or equal to the authority levels of all the reference pixels, filtering is performed on the filtered pixel according to the reference pixels.

14. The image decoding method according to claim 1, wherein: The decoding of the to-be-decoded code stream to obtain a reconstructed image block corresponding to the current processing unit includes: If it is detected that the sample reference condition is met, obtaining a reference sample corresponding to the current processing unit; Perform intra-frame prediction based on the reference sample to obtain a prediction result; Decoding is performed according to the prediction result and the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

15. The image decoding method according to claim 14, wherein: If it is detected that the sample reference condition is met, before obtaining the reference sample corresponding to the current processing unit, the method further includes: If there is at least one reference sample at the reference position corresponding to the current processing unit that belongs to the same slice level as the current processing unit, image reconstruction has been completed, and the corresponding permission level is less than or equal to the permission level of the code stream to be decoded, then it is determined that the sample reference condition is met.

16. An image coding method, characterized in that: The image encoding method comprises: When the privacy coding mode is on, obtaining a privacy determination result, wherein the privacy determination result is used to indicate whether the current processing unit is located in a privacy area; The image corresponding to the current processing unit is encoded according to the privacy determination result to generate at least one code stream corresponding to the current processing unit.

17. An image decoding device, characterized in that: The image decoding device includes the following modules: An acquisition module, configured to acquire a unit authority level and a user authority level when the privacy coding mode is enabled, wherein the unit authority level is the authority level of the current processing unit and the user authority level is the authority level of the decoding end user; An extraction module, configured to determine a to-be-decoded bitstream corresponding to a current processing unit according to the unit authority level and the user authority level; The decoding module is used to obtain multiple sets of quantization parameters set according to user authority levels; update the multiple sets of quantization parameters; after the update is completed, decode the code stream to be decoded to obtain a reconstructed image block corresponding to the current processing unit.

18. An image encoding device, characterized in that The image encoding device includes the following modules: an acquisition module, configured to acquire a privacy determination result when the privacy coding mode is enabled, wherein the privacy determination result is used to indicate whether the current processing unit is located in a privacy area; The encoding module is configured to encode the image corresponding to the current processing unit according to the privacy determination result, and generate at least one code stream corresponding to the current processing unit.

19. A decoding device, characterized in that: The decoding device includes: a processor, a memory, and an image decoding program stored in the memory and executable on the processor. When the image decoding program is executed by the processor, the steps of the image decoding method according to any one of claims 1 to 15 are implemented.

20. An encoding device, characterized in that The encoding device includes: a processor, a memory, and an image encoding program stored in the memory and executable on the processor. When the image encoding program is executed by the processor, the steps of the image encoding method according to claim 16 are implemented.

21. An electronic device, characterized in that: The electronic device includes: a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method according to any one of claims 1 to 16.

22. A storage medium, characterized in that The storage medium stores an image decoding program and / or an image encoding program. When the image decoding program is executed, the steps of the image decoding method according to any one of claims 1 to 15 are implemented. When the image encoding program is executed, the steps of the image encoding method according to claim 16 are implemented.

23. A computer application product, comprising a computer application, characterized in that: When the computer application is executed by a processor, the method according to any one of claims 1 to 16 is implemented.

Citation Information

Patent Citations

  • Video frame coding method and device, electronic equipment and storage medium

    CN113473138A

  • Image processing method, encoding device, decoding device and storage medium

    CN116800965A

  • Video decoding and encoding methods and devices, and storage medium

    WO2023004590A1

  • Image encoding method and apparatus, and image decoding method and apparatus

    WO2023236936A1