CN115834926B - Video encryption method based on H.265 entropy coding binarization - Google Patents

Video encryption method based on H.265 entropy coding binarization Download PDF

Info

Publication number
CN115834926B
CN115834926B CN202211454317.3A CN202211454317A CN115834926B CN 115834926 B CN115834926 B CN 115834926B CN 202211454317 A CN202211454317 A CN 202211454317A CN 115834926 B CN115834926 B CN 115834926B
Authority
CN
China
Prior art keywords
video
image quality
encrypted
quality type
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211454317.3A
Other languages
Chinese (zh)
Other versions
CN115834926A (en
Inventor
廖国波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Super Times Software Co ltd
Original Assignee
Shenzhen Super Times Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Super Times Software Co ltd filed Critical Shenzhen Super Times Software Co ltd
Priority to CN202211454317.3A priority Critical patent/CN115834926B/en
Publication of CN115834926A publication Critical patent/CN115834926A/en
Application granted granted Critical
Publication of CN115834926B publication Critical patent/CN115834926B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application discloses a video encryption method, a device, a medium and equipment based on H.265 entropy coding binarization, comprising the following steps: determining the code flow rate of each image quality type according to the image quality type of the video to be encrypted; dividing the video to be encrypted into a plurality of sub video packets to be encrypted in an H.265 format according to the code flow rate corresponding to each image quality type; determining the transmission weight corresponding to the image quality type through the data length of the sub-video packet corresponding to the image quality type; the method comprises the steps that encryption key matrix determination is carried out on a sub-video packet corresponding to an image quality type through similarity, transmission weight and a preset distribution function between adjacent video frames of the plurality of sub-video packets to be encrypted corresponding to the image quality type; inputting an encryption key matrix of an H.265 format sub-data packet to be video corresponding to the image quality type into an entropy coder to obtain a corresponding binary encryption key; and encrypting the sub-video package to be encrypted of the corresponding image quality type of the video to be encrypted by using the binarization encryption key.

Description

Video encryption method based on H.265 entropy coding binarization
Technical Field
The application relates to the technical field of video encryption, in particular to a video encryption method, device, medium and equipment based on H.265 entropy coding binarization.
Background
The H.265 video coding standard can improve the relation among code stream, coding quality, delay and algorithm complexity, so that the video can be optimally set during encryption, the compression efficiency, robustness and error recovery capability of the video are improved, and meanwhile, the delay, channel acquisition time and random access delay can be reduced, and the coding requirements of high-definition, ultra-high-definition or 3D video can be met. In the prior art, dividing and cutting H.265 format video data to obtain a plurality of H.265 format video sub-data, setting respective encryption keys of each H.265 format video sub-data, and inputting the encryption keys of the H.265 format video sub-data into an entropy coder, so that the entropy coder carries out binary encryption conversion on different syntax elements of the encryption keys, thereby obtaining corresponding binary encryption keys; and then storing all the binarization encryption keys and H.265 format video data together into a video database, thereby completing the encryption processing of the video. Although the coding performance can be balanced and the format compatibility can be improved, the method is only suitable for low-code-rate video, and cannot be suitable for high-code-rate video.
Disclosure of Invention
Aiming at the technical problem that the audio data has frame loss and the tone quality is defective in the prior art, the application provides a video encryption method, device, medium and equipment based on H.265 entropy coding binarization.
In order to achieve the above purpose, the application is realized by the following technical scheme:
in a first aspect of the embodiment of the present application, a video encryption method based on h.265 entropy coding binarization is provided, where the method includes:
aiming at the acquired video to be encrypted, determining the code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at a playing end;
dividing the video to be encrypted into a plurality of H.265 format sub-video packets to be encrypted according to the code flow rate corresponding to each image quality type, wherein the data length of the sub-video packets to be encrypted corresponding to each image quality type is different;
determining a transmission weight corresponding to the image quality type through the data lengths of a plurality of sub-video packets to be encrypted corresponding to the image quality type, wherein the transmission weight is positively correlated with the data length;
determining an encryption key matrix of a plurality of sub-video packets to be encrypted corresponding to the image quality type through the similarity between adjacent video frames in the sub-video packets, the transmission weight and a preset distribution function, wherein the preset distribution function is a distribution function taking a value of the similarity between a preset bandwidth and the adjacent video frames as an input parameter;
inputting an encryption key matrix of an H.265 format sub-data packet to be video corresponding to the image quality type into an entropy coder, so that the entropy coder carries out binary encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binary encryption key;
and video encryption is carried out on the sub-video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binarization encryption key.
Optionally, the step of determining the code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at the playing end includes:
obtaining a video stream to be processed containing each quantized image quality type according to the image quality type of the video to be encrypted at the playing end;
determining whether the quantized video stream to be processed is in an H.265 format, and performing format conversion on the quantized video stream to be processed to obtain a video stream in the H.265 format under the condition that the quantized video stream to be processed is not in the H.265 format;
performing inverse quantization on the video stream in the H.265 format to generate a video stream in a standby H.265 format;
generating a narrowband sub-band sequence signal by transforming the alternate h.265 format video stream into a time-frequency domain representation;
and applying the narrowband subband sequence signals according to the bandwidth expansion parameters contained in the video stream to be processed, and determining the code flow rate of the video to be encrypted corresponding to each image quality type.
Optionally, the step of applying the narrowband subband sequence signal according to the bandwidth extension parameter contained in the video stream to be processed to determine a code flow rate of the video to be encrypted corresponding to each image quality type includes:
determining a cavity rate for cavity convolution according to bandwidth expansion parameters contained in the video stream to be processed;
generating a hole convolution kernel according to the hole rate, and performing hole convolution processing on the narrowband subband sequence signal according to the hole convolution kernel to obtain a downsampled video image;
and carrying out deconvolution processing on the downsampled video image to obtain a deconvolution image, and obtaining the code flow rate of the video to be encrypted corresponding to each image quality type according to the video stream to be processed and the deconvolution image.
Optionally, the step of obtaining the code flow rate of the video to be encrypted corresponding to each image quality type according to the video stream to be processed and the deconvolution image includes:
calculating the Hardman product of the video stream to be processed and the deconvolution image to obtain a Hardman characteristic image;
placing a code stream mask on the Hardman feature image according to the size of a preset window and the preset step length, and calculating the average value of the feature values of the Hardman feature image covered by the code stream mask;
and forming a code stream sequence from the average value according to the coverage sequence of the code stream mask to obtain the code flow rate of the video to be encrypted corresponding to each image quality type.
Optionally, before the step of determining, for the obtained video to be encrypted, a code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at the playing end, the method includes:
sending a corresponding video acquisition instruction to a video acquisition device according to the image quality type of the playing end, wherein the video acquisition instruction is used for acquiring target videos with multiple definitions according to the definition corresponding to the image quality type by the video acquisition device;
receiving target videos corresponding to each image quality type uploaded by the video collector, and performing fidelity compression processing on the target videos with the plurality of definition to obtain a video to be repaired;
and performing brightness restoration processing on the video to be restored to obtain the video to be encrypted.
Optionally, the step of performing luminance restoration processing on the video to be restored to obtain the video to be encrypted includes:
determining a foreground average brightness value and a background average brightness corresponding to a foreground region and a background region in the video to be repaired;
determining a first brightness deviation value between the foreground average brightness value and a preset front Jing Liangdu threshold value and a second brightness deviation value between the background average brightness value and a preset background brightness threshold value;
if the first brightness deviation value is in a first preset deviation range and the second brightness deviation value is in a second preset deviation range, the brightness of the current foreground area and the brightness of the current background area are maintained, and the first preset deviation range and the second preset deviation range have a one-to-one correspondence with the image quality type;
and if the first brightness deviation value is not in the first preset deviation range or the second brightness deviation value is not in the second preset deviation range, adjusting the brightness of the foreground region in the video to be repaired or the brightness of the background region in the video to be repaired so that the first brightness deviation value is in the first preset deviation range and the second brightness deviation value is in the second preset deviation range.
Optionally, the image quality type includes at least one of standard image quality, high definition image quality, ultra high definition image quality, or blue light image quality.
In a second aspect of the embodiment of the present application, there is provided a video encryption device based on h.265 entropy coding binarization, the device comprising:
the code flow rate determining module is configured to determine the code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at the playing end aiming at the acquired video to be encrypted;
the video splitting module is configured to split the video to be encrypted into a plurality of sub-video packets to be encrypted in an H.265 format according to the code flow rate corresponding to each image quality type, wherein the data length of the sub-video packets to be encrypted corresponding to each image quality type is different;
a transmission weight module configured to determine a transmission weight corresponding to the image quality type by data lengths of the plurality of sub-video packets to be encrypted corresponding to the image quality type, the transmission weight being positively correlated with the data length;
a key matrix module configured to determine an encryption key matrix for a plurality of sub-video packets to be encrypted corresponding to the image quality type by using the similarity between adjacent video frames in the sub-video packets, the transmission weight and a preset distribution function, wherein the preset distribution function is a distribution function using a value of the similarity between a preset bandwidth and the adjacent video frames as an input parameter;
the input module is configured to input an encryption key matrix of the H.265 format to-be-video sub-data packet corresponding to the image quality type into an entropy coder, so that the entropy coder carries out binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key;
and the encryption module is configured to encrypt the video of the sub-video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binarization encryption key.
Optionally, the code flow rate determination module is configured to:
obtaining a video stream to be processed containing each quantized image quality type according to the image quality type of the video to be encrypted at the playing end;
determining whether the quantized video stream to be processed is in an H.265 format, and performing format conversion on the quantized video stream to be processed to obtain a video stream in the H.265 format under the condition that the quantized video stream to be processed is not in the H.265 format;
performing inverse quantization on the video stream in the H.265 format to generate a video stream in a standby H.265 format;
generating a narrowband sub-band sequence signal by transforming the alternate h.265 format video stream into a time-frequency domain representation;
and applying the narrowband subband sequence signals according to the bandwidth expansion parameters contained in the video stream to be processed, and determining the code flow rate of the video to be encrypted corresponding to each image quality type.
Optionally, the code flow rate determination module is configured to:
determining a cavity rate for cavity convolution according to bandwidth expansion parameters contained in the video stream to be processed;
generating a hole convolution kernel according to the hole rate, and performing hole convolution processing on the narrowband subband sequence signal according to the hole convolution kernel to obtain a downsampled video image;
and carrying out deconvolution processing on the downsampled video image to obtain a deconvolution image, and obtaining the code flow rate of the video to be encrypted corresponding to each image quality type according to the video stream to be processed and the deconvolution image.
Optionally, the code flow rate determination module is configured to:
calculating the Hardman product of the video stream to be processed and the deconvolution image to obtain a Hardman characteristic image;
placing a code stream mask on the Hardman feature image according to the size of a preset window and the preset step length, and calculating the average value of the feature values of the Hardman feature image covered by the code stream mask;
and forming a code stream sequence from the average value according to the coverage sequence of the code stream mask to obtain the code flow rate of the video to be encrypted corresponding to each image quality type.
Optionally, the code flow rate determining module is configured to send, before the step of determining, for the acquired video to be encrypted, a code flow rate of the video to be encrypted corresponding to each image quality type according to an image quality type of the video to be encrypted at a playing end, a corresponding video acquisition instruction to a video collector according to the image quality type of the playing end, where the video acquisition instruction is used for the video collector to acquire a plurality of definition target videos according to definition corresponding to the image quality type;
receiving target videos corresponding to each image quality type uploaded by the video collector, and performing fidelity compression processing on the target videos with the plurality of definition to obtain a video to be repaired;
and performing brightness restoration processing on the video to be restored to obtain the video to be encrypted.
Optionally, the code flow rate determination module is configured to:
determining a foreground average brightness value and a background average brightness corresponding to a foreground region and a background region in the video to be repaired;
determining a first brightness deviation value between the foreground average brightness value and a preset front Jing Liangdu threshold value and a second brightness deviation value between the background average brightness value and a preset background brightness threshold value;
if the first brightness deviation value is in a first preset deviation range and the second brightness deviation value is in a second preset deviation range, the brightness of the current foreground area and the brightness of the current background area are maintained, and the first preset deviation range and the second preset deviation range have a one-to-one correspondence with the image quality type;
and if the first brightness deviation value is not in the first preset deviation range or the second brightness deviation value is not in the second preset deviation range, adjusting the brightness of the foreground region in the video to be repaired or the brightness of the background region in the video to be repaired so that the first brightness deviation value is in the first preset deviation range and the second brightness deviation value is in the second preset deviation range.
Optionally, the image quality type includes at least one of standard image quality, high definition image quality, ultra high definition image quality, or blue light image quality.
In a third aspect of the embodiments of the present application, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method according to any of the first aspects.
In a fourth aspect of the embodiment of the present application, there is provided an electronic device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the steps of the method of any of the first aspects when executing the executable instructions.
Advantageous effects
The application provides a video encryption method, device, medium and equipment based on H.265 entropy coding binarization. Compared with the prior art, the method has the following beneficial effects:
according to the scheme, aiming at the acquired video to be encrypted, determining the code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at the playing end; dividing the video to be encrypted into a plurality of sub video packets to be encrypted in an H.265 format according to the code flow rate corresponding to each image quality type, wherein the data length of the sub video packets to be encrypted corresponding to each image quality type is different; determining transmission weight corresponding to the image quality type through the data length of a plurality of sub-video packets to be encrypted corresponding to the image quality type, wherein the transmission weight is positively correlated with the data length; the method comprises the steps that through the similarity, transmission weight and preset distribution function of a plurality of sub-video packets to be encrypted, which correspond to the image quality type, between adjacent video frames in the sub-video packets, encryption key matrix determination is carried out on the plurality of sub-video packets to be encrypted, which correspond to the image quality type, wherein the preset distribution function is a distribution function taking the numerical value of the similarity between preset bandwidth and the adjacent video frames as an input parameter; inputting an encryption key matrix of an H.265 format to-be-video sub-data packet corresponding to the image quality type into an entropy coder, so that the entropy coder carries out binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key; and video encryption is carried out on the sub-video packet to be encrypted of the corresponding image quality type of the video to be encrypted through the binarization encryption key. The method is suitable for low-code-rate video, can balance coding performance and improve format compatibility, can be suitable for high-code-rate video, and improves application range and applicability.
Drawings
Fig. 1 is a flow chart illustrating a video encryption method based on h.265 entropy coding binarization according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a method of implementing step S11 of fig. 1, according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating a method of implementing step S115 of fig. 2, according to an exemplary embodiment.
Fig. 4 is a block diagram illustrating a video encryption apparatus based on h.265 entropy coding binarization according to an exemplary embodiment.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, fig. 1 is a flowchart illustrating a video encryption method based on h.265 entropy coding binarization according to an exemplary embodiment, and the video encryption method based on h.265 entropy coding binarization provided by the present application may be applied to a transit terminal device, where the transit terminal device is connected between an intermediate layer of a telecommunication network structure of an operator and a user device, and may also be directly applied to the user device, and the method includes the following steps.
Step S11, aiming at the acquired video to be encrypted, determining the code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at a playing end;
and step S12, respectively dividing the video to be encrypted into a plurality of sub-video packets to be encrypted in an H.265 format according to the code flow rate corresponding to each image quality type.
The data length of the sub-video packets to be encrypted corresponding to each image quality type is different;
step S13, determining the transmission weight corresponding to the image quality type through the data length of a plurality of sub-video packets to be encrypted corresponding to the image quality type, wherein the transmission weight is positively correlated with the data length;
step S14, determining an encryption key matrix for a plurality of sub-video packets to be encrypted corresponding to the image quality type by using the similarity between adjacent video frames in the sub-video packets, the transmission weight and a preset distribution function, where the preset distribution function is a distribution function using a value of the similarity between a preset bandwidth and the adjacent video frames as an input parameter;
step S15, inputting an encryption key matrix of the H.265 format sub-data packet to be video corresponding to the image quality type into an entropy coder, so that the entropy coder carries out binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key;
and S16, video encryption is carried out on the sub-video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binarization encryption key.
According to the scheme, aiming at the acquired video to be encrypted, determining the code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at the playing end; dividing the video to be encrypted into a plurality of sub video packets to be encrypted in an H.265 format according to the code flow rate corresponding to each image quality type, wherein the data length of the sub video packets to be encrypted corresponding to each image quality type is different; determining transmission weight corresponding to the image quality type through the data length of a plurality of sub-video packets to be encrypted corresponding to the image quality type, wherein the transmission weight is positively correlated with the data length; the method comprises the steps that through the similarity, transmission weight and preset distribution function of a plurality of sub-video packets to be encrypted, which correspond to the image quality type, between adjacent video frames in the sub-video packets, encryption key matrix determination is carried out on the plurality of sub-video packets to be encrypted, which correspond to the image quality type, wherein the preset distribution function is a distribution function taking the numerical value of the similarity between preset bandwidth and the adjacent video frames as an input parameter; inputting an encryption key matrix of an H.265 format to-be-video sub-data packet corresponding to the image quality type into an entropy coder, so that the entropy coder carries out binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key; and video encryption is carried out on the sub-video packet to be encrypted of the corresponding image quality type of the video to be encrypted through the binarization encryption key. The method is suitable for low-code-rate video, can balance coding performance and improve format compatibility, can be suitable for high-code-rate video, and improves application range and applicability.
Optionally, referring to fig. 2, in step S11, the step of determining, according to the image quality type of the video to be encrypted at the playing end, a code flow rate of the video to be encrypted corresponding to each image quality type includes:
in step S111, according to the image quality type of the video to be encrypted at the playing end, a video stream to be processed including quantized image quality types is obtained;
in step S112, determining whether the quantized video stream to be processed is in h.265 format, and performing format conversion on the quantized video stream to be processed to obtain a video stream in h.265 format if the quantized video stream to be processed is not in h.265 format;
in step S113, the video stream in the h.265 format is inversely quantized to generate a video stream in a standby h.265 format;
generating a narrowband sub-band sequence signal by transforming the alternate h.265 format video stream into a time-frequency domain representation in step S114;
in step S115, the narrowband subband sequence signal is applied according to the bandwidth extension parameter contained in the video stream to be processed, so as to determine the code flow rate of the video stream to be encrypted corresponding to each image quality type.
Optionally, referring to fig. 3, in step S115, the step of applying the narrowband subband sequence signal according to the bandwidth extension parameter included in the video stream to be processed to determine a code flow rate of the video stream to be encrypted corresponding to each image quality type includes:
in step S1151, determining a hole rate for hole convolution according to the bandwidth extension parameter contained in the video stream to be processed;
in step S1152, generating a hole convolution kernel according to the hole rate, and performing hole convolution processing on the narrowband subband sequence signal according to the hole convolution kernel to obtain a downsampled video image;
in step S1153, deconvolution processing is performed on the downsampled video image to obtain a deconvoluted image, and a code flow rate of the video to be encrypted corresponding to each image quality type is obtained according to the video stream to be processed and the deconvoluted image.
Optionally, in step S1153, the step of obtaining a code flow rate of the video to be encrypted corresponding to each image quality type according to the video stream to be processed and the deconvoluted image includes:
calculating the Hardman product of the video stream to be processed and the deconvolution image to obtain a Hardman characteristic image;
placing a code stream mask on the Hardman feature image according to the size of a preset window and the preset step length, and calculating the average value of the feature values of the Hardman feature image covered by the code stream mask;
and forming a code stream sequence from the average value according to the coverage sequence of the code stream mask to obtain the code flow rate of the video to be encrypted corresponding to each image quality type.
Optionally, before the step of determining, for the obtained video to be encrypted, a code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at the playing end, the method includes:
sending a corresponding video acquisition instruction to a video acquisition device according to the image quality type of the playing end, wherein the video acquisition instruction is used for acquiring target videos with multiple definitions according to the definition corresponding to the image quality type by the video acquisition device;
receiving target videos corresponding to each image quality type uploaded by the video collector, and performing fidelity compression processing on the target videos with the plurality of definition to obtain a video to be repaired;
and performing brightness restoration processing on the video to be restored to obtain the video to be encrypted.
Optionally, the step of performing luminance restoration processing on the video to be restored to obtain the video to be encrypted includes:
determining a foreground average brightness value and a background average brightness corresponding to a foreground region and a background region in the video to be repaired;
determining a first brightness deviation value between the foreground average brightness value and a preset front Jing Liangdu threshold value and a second brightness deviation value between the background average brightness value and a preset background brightness threshold value;
if the first brightness deviation value is in a first preset deviation range and the second brightness deviation value is in a second preset deviation range, the brightness of the current foreground area and the brightness of the current background area are maintained, and the first preset deviation range and the second preset deviation range have a one-to-one correspondence with the image quality type;
and if the first brightness deviation value is not in the first preset deviation range or the second brightness deviation value is not in the second preset deviation range, adjusting the brightness of the foreground region in the video to be repaired or the brightness of the background region in the video to be repaired so that the first brightness deviation value is in the first preset deviation range and the second brightness deviation value is in the second preset deviation range.
Optionally, the image quality type includes at least one of standard image quality, high definition image quality, ultra high definition image quality, or blue light image quality.
The embodiment of the application also provides a video encryption device based on H.265 entropy coding binarization, which is shown in FIG. 4. The apparatus 400 includes:
the code flow rate determining module 410 is configured to determine, for the acquired video to be encrypted, a code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at the playing end;
the video splitting module 420 is configured to split the video to be encrypted into a plurality of sub-video packets to be encrypted in h.265 format according to the code flow rate corresponding to each image quality type, where the data lengths of the sub-video packets to be encrypted corresponding to each image quality type are different;
a transmission weight module 430 configured to determine a transmission weight corresponding to the image quality type by data lengths of the plurality of sub-video packets to be encrypted corresponding to the image quality type, the transmission weight being positively correlated with the data length;
a key matrix module 440 configured to determine an encryption key matrix for a plurality of sub-video packets to be encrypted corresponding to the image quality type by using a similarity between adjacent video frames in the sub-video packets, the transmission weight, and a preset distribution function, where the preset distribution function is a distribution function using a value of similarity between a preset bandwidth and the adjacent video frames as an input parameter;
the input module 450 is configured to input an encryption key matrix of the h.265 format to-be-video sub-packet corresponding to the image quality type into an entropy encoder, so that the entropy encoder performs binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key;
the encryption module 460 is configured to encrypt the video of the sub-video packet to be encrypted with the binary encryption key, where the sub-video packet is of the image quality type corresponding to the video to be encrypted.
The device is not only suitable for low-code-rate video, but also suitable for high-code-rate video, and improves the applicability, and can balance the coding performance and improve the format compatibility.
Optionally, the code flow rate determination module 410 is configured to:
obtaining a video stream to be processed containing each quantized image quality type according to the image quality type of the video to be encrypted at the playing end;
determining whether the quantized video stream to be processed is in an H.265 format, and performing format conversion on the quantized video stream to be processed to obtain a video stream in the H.265 format under the condition that the quantized video stream to be processed is not in the H.265 format;
performing inverse quantization on the video stream in the H.265 format to generate a video stream in a standby H.265 format;
generating a narrowband sub-band sequence signal by transforming the alternate h.265 format video stream into a time-frequency domain representation;
and applying the narrowband subband sequence signals according to the bandwidth expansion parameters contained in the video stream to be processed, and determining the code flow rate of the video to be encrypted corresponding to each image quality type.
Optionally, the code flow rate determination module 410 is configured to:
determining a cavity rate for cavity convolution according to bandwidth expansion parameters contained in the video stream to be processed;
generating a hole convolution kernel according to the hole rate, and performing hole convolution processing on the narrowband subband sequence signal according to the hole convolution kernel to obtain a downsampled video image;
and carrying out deconvolution processing on the downsampled video image to obtain a deconvolution image, and obtaining the code flow rate of the video to be encrypted corresponding to each image quality type according to the video stream to be processed and the deconvolution image.
Optionally, the code flow rate determination module 410 is configured to:
calculating the Hardman product of the video stream to be processed and the deconvolution image to obtain a Hardman characteristic image;
placing a code stream mask on the Hardman feature image according to the size of a preset window and the preset step length, and calculating the average value of the feature values of the Hardman feature image covered by the code stream mask;
and forming a code stream sequence from the average value according to the coverage sequence of the code stream mask to obtain the code flow rate of the video to be encrypted corresponding to each image quality type.
Optionally, the code flow rate determining module 410 is configured to send, before the step of determining, for the acquired video to be encrypted, a code flow rate of the video to be encrypted corresponding to each image quality type according to an image quality type of the video to be encrypted at a playing end, a corresponding video acquisition instruction to a video acquirer according to the image quality type of the playing end, where the video acquisition instruction is used for the video acquirer to acquire a plurality of definition target videos according to definition corresponding to the image quality type;
receiving target videos corresponding to each image quality type uploaded by the video collector, and performing fidelity compression processing on the target videos with the plurality of definition to obtain a video to be repaired;
and performing brightness restoration processing on the video to be restored to obtain the video to be encrypted.
Optionally, the code flow rate determination module 410 is configured to:
determining a foreground average brightness value and a background average brightness corresponding to a foreground region and a background region in the video to be repaired;
determining a first brightness deviation value between the foreground average brightness value and a preset front Jing Liangdu threshold value and a second brightness deviation value between the background average brightness value and a preset background brightness threshold value;
if the first brightness deviation value is in a first preset deviation range and the second brightness deviation value is in a second preset deviation range, the brightness of the current foreground area and the brightness of the current background area are maintained, and the first preset deviation range and the second preset deviation range have a one-to-one correspondence with the image quality type;
and if the first brightness deviation value is not in the first preset deviation range or the second brightness deviation value is not in the second preset deviation range, adjusting the brightness of the foreground region in the video to be repaired or the brightness of the background region in the video to be repaired so that the first brightness deviation value is in the first preset deviation range and the second brightness deviation value is in the second preset deviation range.
Optionally, the image quality type includes at least one of standard image quality, high definition image quality, ultra high definition image quality, or blue light image quality.
Embodiments of the present application also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method according to any of the preceding embodiments.
The embodiment of the application also provides electronic equipment, which comprises:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the steps of the method of any of the preceding embodiments when executing the executable instructions.
With the above-described preferred embodiments according to the present application as a teaching, the worker skilled in the art could make various changes and modifications without departing from the scope of the technical idea of the present application. The technical scope of the present application is not limited to the contents of the specification, and must be determined according to the scope of claims.
Although embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the application, the scope of which is defined in the appended claims and their equivalents.

Claims (10)

1. A video encryption method based on h.265 entropy coding binarization, the method comprising:
aiming at the acquired video to be encrypted, determining the code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at a playing end;
dividing the video to be encrypted into a plurality of H.265 format sub-video packets to be encrypted according to the code flow rate corresponding to each image quality type, wherein the data length of the sub-video packets to be encrypted corresponding to each image quality type is different;
determining a transmission weight corresponding to the image quality type through the data lengths of a plurality of sub-video packets to be encrypted corresponding to the image quality type, wherein the transmission weight is positively correlated with the data length;
determining an encryption key matrix of a plurality of sub-video packets to be encrypted corresponding to the image quality type through the similarity between adjacent video frames in the sub-video packets, the transmission weight and a preset distribution function, wherein the preset distribution function is a distribution function taking a value of the similarity between a preset bandwidth and the adjacent video frames as an input parameter;
inputting an encryption key matrix of an H.265 format sub-data packet to be video corresponding to the image quality type into an entropy coder, so that the entropy coder carries out binary encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binary encryption key;
and video encryption is carried out on the sub-video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binarization encryption key.
2. The method according to claim 1, wherein the step of determining the code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at the playing end comprises:
obtaining a video stream to be processed containing each quantized image quality type according to the image quality type of the video to be encrypted at the playing end;
determining whether the quantized video stream to be processed is in an H.265 format, and performing format conversion on the quantized video stream to be processed to obtain a video stream in the H.265 format under the condition that the quantized video stream to be processed is not in the H.265 format;
performing inverse quantization on the video stream in the H.265 format to generate a video stream in a standby H.265 format;
generating a narrowband sub-band sequence signal by transforming the alternate h.265 format video stream into a time-frequency domain representation;
and applying the narrowband subband sequence signals according to the bandwidth expansion parameters contained in the video stream to be processed, and determining the code flow rate of the video to be encrypted corresponding to each image quality type.
3. The method according to claim 2, wherein the step of applying the narrowband subband sequence signal according to the bandwidth extension parameter contained in the video stream to be processed to determine the code flow rate of the video stream to be encrypted for each image quality type comprises:
determining a cavity rate for cavity convolution according to bandwidth expansion parameters contained in the video stream to be processed;
generating a hole convolution kernel according to the hole rate, and performing hole convolution processing on the narrowband subband sequence signal according to the hole convolution kernel to obtain a downsampled video image;
and carrying out deconvolution processing on the downsampled video image to obtain a deconvolution image, and obtaining the code flow rate of the video to be encrypted corresponding to each image quality type according to the video stream to be processed and the deconvolution image.
4. A method according to claim 3, wherein the step of obtaining the code flow rate of the video to be encrypted for each picture quality type from the video stream to be processed and the deconvoluted image comprises:
calculating the Hardman product of the video stream to be processed and the deconvolution image to obtain a Hardman characteristic image;
placing a code stream mask on the Hardman feature image according to the size of a preset window and the preset step length, and calculating the average value of the feature values of the Hardman feature image covered by the code stream mask;
and forming a code stream sequence from the average value according to the coverage sequence of the code stream mask to obtain the code flow rate of the video to be encrypted corresponding to each image quality type.
5. The method according to claim 1, wherein before the step of determining, for the acquired video to be encrypted, a code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at the playing end, the method comprises:
sending a corresponding video acquisition instruction to a video acquisition device according to the image quality type of the playing end, wherein the video acquisition instruction is used for acquiring target videos with multiple definitions according to the definition corresponding to the image quality type by the video acquisition device;
receiving target videos corresponding to each image quality type uploaded by the video collector, and performing fidelity compression processing on the target videos with the plurality of definition to obtain a video to be repaired;
and performing brightness restoration processing on the video to be restored to obtain the video to be encrypted.
6. The method of claim 5, wherein the step of performing luminance restoration processing on the video to be restored to obtain the video to be encrypted comprises:
determining a foreground average brightness value and a background average brightness corresponding to a foreground region and a background region in the video to be repaired;
determining a first brightness deviation value between the foreground average brightness value and a preset front Jing Liangdu threshold value and a second brightness deviation value between the background average brightness value and a preset background brightness threshold value;
if the first brightness deviation value is in a first preset deviation range and the second brightness deviation value is in a second preset deviation range, the brightness of the current foreground area and the brightness of the current background area are maintained, and the first preset deviation range and the second preset deviation range have a one-to-one correspondence with the image quality type;
and if the first brightness deviation value is not in the first preset deviation range or the second brightness deviation value is not in the second preset deviation range, adjusting the brightness of the foreground region in the video to be repaired or the brightness of the background region in the video to be repaired so that the first brightness deviation value is in the first preset deviation range and the second brightness deviation value is in the second preset deviation range.
7. The method of any one of claims 1-6, wherein the image quality type includes at least one of standard image quality, high definition image quality, ultra high definition image quality, or blue light image quality.
8. A video encryption device based on h.265 entropy coding binarization, the device comprising:
the code flow rate determining module is configured to determine the code flow rate of the video to be encrypted corresponding to each image quality type according to the image quality type of the video to be encrypted at the playing end aiming at the acquired video to be encrypted;
the video splitting module is configured to split the video to be encrypted into a plurality of sub-video packets to be encrypted in an H.265 format according to the code flow rate corresponding to each image quality type, wherein the data length of the sub-video packets to be encrypted corresponding to each image quality type is different;
a transmission weight module configured to determine a transmission weight corresponding to the image quality type by data lengths of the plurality of sub-video packets to be encrypted corresponding to the image quality type, the transmission weight being positively correlated with the data length;
a key matrix module configured to determine an encryption key matrix for a plurality of sub-video packets to be encrypted corresponding to the image quality type by using the similarity between adjacent video frames in the sub-video packets, the transmission weight and a preset distribution function, wherein the preset distribution function is a distribution function using a value of the similarity between a preset bandwidth and the adjacent video frames as an input parameter;
the input module is configured to input an encryption key matrix of the H.265 format to-be-video sub-data packet corresponding to the image quality type into an entropy coder, so that the entropy coder carries out binarization encryption conversion on different syntax elements of the encryption key matrix to obtain a corresponding binarization encryption key;
and the encryption module is configured to encrypt the video of the sub-video packet to be encrypted of the image quality type corresponding to the video to be encrypted through the binarization encryption key.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to any one of claims 1-7.
10. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the steps of the method of any one of claims 1-7 when executing the executable instructions.
CN202211454317.3A 2022-11-21 2022-11-21 Video encryption method based on H.265 entropy coding binarization Active CN115834926B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211454317.3A CN115834926B (en) 2022-11-21 2022-11-21 Video encryption method based on H.265 entropy coding binarization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211454317.3A CN115834926B (en) 2022-11-21 2022-11-21 Video encryption method based on H.265 entropy coding binarization

Publications (2)

Publication Number Publication Date
CN115834926A CN115834926A (en) 2023-03-21
CN115834926B true CN115834926B (en) 2023-11-21

Family

ID=85529526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211454317.3A Active CN115834926B (en) 2022-11-21 2022-11-21 Video encryption method based on H.265 entropy coding binarization

Country Status (1)

Country Link
CN (1) CN115834926B (en)

Citations (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2363273A1 (en) * 1999-02-15 2000-08-24 Digital Accelerator Corporation Method and system of region-based image coding with dynamic streaming of code blocks
CN101710852A (en) * 2009-11-06 2010-05-19 北京交通大学 LDPC code encoding/decoding method and encoder/decoder with encryption function
KR20100054697A (en) * 2008-11-14 2010-05-25 한국전자통신연구원 Encryption method for data and decryption method therefor
CN103546750A (en) * 2013-10-22 2014-01-29 中国人民解放军重庆通信学院 H.264 video encryption method based on region of interest
JP2014093569A (en) * 2012-10-31 2014-05-19 Toshiba Corp Information processing device, control method, and control program
CN105791979A (en) * 2014-12-26 2016-07-20 深圳Tcl数字技术有限公司 Video file processing method and display device
KR101646072B1 (en) * 2015-04-22 2016-08-05 유승진 Encryption apparatus and method for moving picture data
CN105939484A (en) * 2016-06-14 2016-09-14 深圳创维数字技术有限公司 Audio/video encrypted playing method and system thereof
CN108650510A (en) * 2018-05-10 2018-10-12 中南大学 The coding method of video and device, storage medium, electronic device
CN108833924A (en) * 2018-06-22 2018-11-16 东北大学 It is a kind of based on more security level video encryption algorithms H.265
CN109167999A (en) * 2018-09-04 2019-01-08 宁波工程学院 A kind of HEVC video-encryption and decryption method
CN109391846A (en) * 2017-08-07 2019-02-26 浙江宇视科技有限公司 A kind of video scrambling method and device of adaptive model selection
CN109788160A (en) * 2018-12-13 2019-05-21 平安科技(深圳)有限公司 Image transfer method, device, electronic equipment and storage medium
CN111052748A (en) * 2017-07-06 2020-04-21 弗劳恩霍夫应用研究促进协会 Segmented video streaming concept
CN111083425A (en) * 2019-11-25 2020-04-28 视联动力信息技术股份有限公司 Video stream processing method and device, server, electronic equipment and storage medium
CN112243127A (en) * 2020-09-30 2021-01-19 江苏大学 HEVC video encryption method based on region of interest
CN112312231A (en) * 2019-07-31 2021-02-02 北京金山云网络技术有限公司 Video image coding method and device, electronic equipment and medium
CN112491532A (en) * 2020-12-03 2021-03-12 珠海格力电器股份有限公司 Video data encryption method and device, storage medium and electronic equipment
CN112689195A (en) * 2020-12-22 2021-04-20 中国传媒大学 Video encryption method, distributed encryption system, electronic device and storage medium
CN112929679A (en) * 2021-01-18 2021-06-08 广州虎牙科技有限公司 Method and device for detecting legality of live client and identifying plug-in behavior
CN113034334A (en) * 2021-03-22 2021-06-25 绍兴聚量数据技术有限公司 Encryption image reversible information hiding method and device combining JPEG and Huffman coding
CN113114619A (en) * 2021-03-02 2021-07-13 杭州海康威视数字技术股份有限公司 Video identification analysis method, device and system based on Handle system
CN113347421A (en) * 2021-06-02 2021-09-03 黑芝麻智能科技(上海)有限公司 Video encoding and decoding method, device and computer equipment
CN114363638A (en) * 2021-12-08 2022-04-15 慧之安信息技术股份有限公司 Video encryption method based on H.265 entropy coding binarization

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7313814B2 (en) * 2003-04-01 2007-12-25 Microsoft Corporation Scalable, error resilient DRM for scalable media
DE102009017436B4 (en) * 2009-04-15 2011-12-29 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Detecting a change between images or in a sequence of images
CN102867153B (en) * 2012-08-30 2014-04-09 腾讯科技(深圳)有限公司 Methods and devices for encrypting and decrypting video file and mobile terminal
US11343492B2 (en) * 2019-03-15 2022-05-24 Mux, Inc. Method for generating video- and audience-specific encoding ladders

Patent Citations (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2363273A1 (en) * 1999-02-15 2000-08-24 Digital Accelerator Corporation Method and system of region-based image coding with dynamic streaming of code blocks
KR20100054697A (en) * 2008-11-14 2010-05-25 한국전자통신연구원 Encryption method for data and decryption method therefor
CN101710852A (en) * 2009-11-06 2010-05-19 北京交通大学 LDPC code encoding/decoding method and encoder/decoder with encryption function
JP2014093569A (en) * 2012-10-31 2014-05-19 Toshiba Corp Information processing device, control method, and control program
CN103546750A (en) * 2013-10-22 2014-01-29 中国人民解放军重庆通信学院 H.264 video encryption method based on region of interest
CN105791979A (en) * 2014-12-26 2016-07-20 深圳Tcl数字技术有限公司 Video file processing method and display device
KR101646072B1 (en) * 2015-04-22 2016-08-05 유승진 Encryption apparatus and method for moving picture data
CN105939484A (en) * 2016-06-14 2016-09-14 深圳创维数字技术有限公司 Audio/video encrypted playing method and system thereof
CN111052748A (en) * 2017-07-06 2020-04-21 弗劳恩霍夫应用研究促进协会 Segmented video streaming concept
CN109391846A (en) * 2017-08-07 2019-02-26 浙江宇视科技有限公司 A kind of video scrambling method and device of adaptive model selection
CN108650510A (en) * 2018-05-10 2018-10-12 中南大学 The coding method of video and device, storage medium, electronic device
CN108833924A (en) * 2018-06-22 2018-11-16 东北大学 It is a kind of based on more security level video encryption algorithms H.265
CN109167999A (en) * 2018-09-04 2019-01-08 宁波工程学院 A kind of HEVC video-encryption and decryption method
CN109788160A (en) * 2018-12-13 2019-05-21 平安科技(深圳)有限公司 Image transfer method, device, electronic equipment and storage medium
CN112312231A (en) * 2019-07-31 2021-02-02 北京金山云网络技术有限公司 Video image coding method and device, electronic equipment and medium
CN111083425A (en) * 2019-11-25 2020-04-28 视联动力信息技术股份有限公司 Video stream processing method and device, server, electronic equipment and storage medium
CN112243127A (en) * 2020-09-30 2021-01-19 江苏大学 HEVC video encryption method based on region of interest
CN112491532A (en) * 2020-12-03 2021-03-12 珠海格力电器股份有限公司 Video data encryption method and device, storage medium and electronic equipment
CN112689195A (en) * 2020-12-22 2021-04-20 中国传媒大学 Video encryption method, distributed encryption system, electronic device and storage medium
CN112929679A (en) * 2021-01-18 2021-06-08 广州虎牙科技有限公司 Method and device for detecting legality of live client and identifying plug-in behavior
CN113114619A (en) * 2021-03-02 2021-07-13 杭州海康威视数字技术股份有限公司 Video identification analysis method, device and system based on Handle system
CN113034334A (en) * 2021-03-22 2021-06-25 绍兴聚量数据技术有限公司 Encryption image reversible information hiding method and device combining JPEG and Huffman coding
CN113347421A (en) * 2021-06-02 2021-09-03 黑芝麻智能科技(上海)有限公司 Video encoding and decoding method, device and computer equipment
CN114363638A (en) * 2021-12-08 2022-04-15 慧之安信息技术股份有限公司 Video encryption method based on H.265 entropy coding binarization

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Selective Encryption of the Versatile Video Coding Standard;MOUSA FARAJALLAH等;IEEE Access;第10卷;全文 *
Sufficient encryption based on entropy coding syntax elements of H.264/SVC;Asghar, MN等;multimedia tools and applications;第74卷(第23期);全文 *
基于H.265的部分视频加密技术;张潆元;CNKI优秀硕士学位论文全文库(第2期);全文 *
视频加密算法及其发展现状;廉士国, 孙金生, 王执铨;信息与控制(第05期);全文 *

Also Published As

Publication number Publication date
CN115834926A (en) 2023-03-21

Similar Documents

Publication Publication Date Title
CN106937121B (en) Image decoding and encoding method, decoding and encoding device, decoder and encoder
JP5970724B2 (en) Method and apparatus for obtaining video encoding compression quality
US9143776B2 (en) No-reference video/image quality measurement with compressed domain features
US20160381389A1 (en) 3D-HEVC depth video information hiding method based on single-depth intra mode
US20080123749A1 (en) Method of transmitting at varying bit rates through a transmission channel
WO2008047865A1 (en) Image quality evaluation method, image quality evaluation system and image quality evaluation program
US11418802B2 (en) Video decoder memory optimization
CN107343202B (en) Feedback-free distributed video coding and decoding method based on additional code rate
CN108347607B (en) Embedded video compression method with fixed code rate and based on lines and image processing equipment
CN115834926B (en) Video encryption method based on H.265 entropy coding binarization
US20160156970A1 (en) Fast processing and encryption method and system for compressed video
US20110317066A1 (en) Interactive System and Method for Transmitting Key Images Selected from a Video Stream Over a Low Bandwidth Network
Barannik et al. Technology of Composite Code Forming in The Spatial-Spectral Description Significant Microsegments
US20220405884A1 (en) Method and apparatus for adaptive artificial intelligence downscaling for upscaling during video telephone call
CN114827617A (en) Video coding and decoding method and system based on perception model
EP1841237B1 (en) Method and apparatus for video encoding
CN101316198B (en) Monitoring method for multimedia data based on index
JP4956527B2 (en) Method and apparatus for reducing quantization error
KR100365118B1 (en) Apparatus and method for dithering and compressing data of dynamic picture image
WO2016132074A1 (en) Encoding of images by vector quantization
CN116761023A (en) Video transmission method between different devices
CN110099279B (en) Method for adjusting lossy compression based on hardware
WO2016132075A1 (en) Image encoding and decoding method, encoding and decoding device, and corresponding computer programs
WO2024083524A1 (en) Method and device for fine-tuning a selected set of parameters in a deep coding system
WO2024094478A1 (en) Entropy adaptation for deep feature compression using flexible networks

Legal Events

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