CN118042147A - Video encoding method, video decoding method, encoder, decoder, and medium - Google Patents

Video encoding method, video decoding method, encoder, decoder, and medium Download PDF

Info

Publication number
CN118042147A
CN118042147A CN202410190387.5A CN202410190387A CN118042147A CN 118042147 A CN118042147 A CN 118042147A CN 202410190387 A CN202410190387 A CN 202410190387A CN 118042147 A CN118042147 A CN 118042147A
Authority
CN
China
Prior art keywords
authentication data
data
code stream
authentication
video
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.)
Pending
Application number
CN202410190387.5A
Other languages
Chinese (zh)
Inventor
张雪
林聚财
江东
方诚
彭双
殷俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202410190387.5A priority Critical patent/CN118042147A/en
Publication of CN118042147A publication Critical patent/CN118042147A/en
Pending legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application provides a video encoding method, a video decoding method, a video encoder, a video decoder and a computer storage medium. The video encoding method includes: acquiring a current code stream fragment, wherein the current code stream fragment is obtained by coding through a layered coding technology and comprises code streams of at least two spatial layers; acquiring abstract data of each airspace layer code stream; according to a preset authentication data making scheme, making authentication data by using the abstract data of each airspace layer code stream or making authentication data by using the abstract data of all airspace layer code streams; and adding the authentication data into the current code stream segment to generate a video code stream. By the video coding method, the authentication data production method under the spatial division and spatial layer is provided, so that the authentication of a certain spatial layer code stream can be realized independently, and the video coding efficiency is improved.

Description

Video encoding method, video decoding method, encoder, decoder, and medium
Technical Field
The present application relates to the field of video encoding and decoding technologies, and in particular, to a video encoding method, a video decoding method, a video encoder, a video decoder, and a computer storage medium.
Background
In video encoding and decoding, in order to increase the compression rate and reduce the code words to be transmitted, an encoder does not directly encode and transmit pixel values, but adopts an intra-frame or inter-frame prediction mode, and adopts reconstructed pixels of an encoded block of a current frame or a reference frame to predict the pixel values of the current block. The pixel value predicted using a certain prediction mode is called a predicted pixel value, and the difference between the predicted pixel value and the original pixel value is called a residual. The encoder only needs to encode a certain prediction mode and residual errors generated when the prediction mode is adopted, and the decoding end can decode corresponding pixel values according to the code stream information. This greatly reduces the code words required for encoding.
In the current video encoding and decoding authentication technology, if the summary list is not stored in the authentication data at the transmitting end, the receiving end cannot extract the corresponding authentication data under the condition of evacuating the domain layer, and the summary needs to be made again to support the authentication of the evacuated domain layer, so that the efficiency of video encoding and decoding is reduced. In addition, the authentication scheme of the SVAC3 can be compatible with the authentication method of the SVAC2 under the single airspace layer condition, and cannot be compatible with the authentication method of the SVAC2 under the sub airspace layer condition.
Disclosure of Invention
In order to solve the technical problems, the application provides a video encoding method, a video decoding method, a video encoder, a video decoder and a computer storage medium.
In order to solve the technical problems, the present application provides a video encoding method, which includes:
acquiring a current code stream fragment, wherein the current code stream fragment is obtained by coding through a layered coding technology and comprises code streams of at least two spatial layers;
Acquiring abstract data of each airspace layer code stream;
according to a preset authentication data making scheme, making authentication data by using the abstract data of each airspace layer code stream or making authentication data by using the abstract data of all airspace layer code streams;
and adding the authentication data into the current code stream segment to generate a video code stream.
The step of preparing authentication data by using the summary data of each airspace layer code stream or preparing authentication data by using the summary data of all airspace layer code streams according to a preset authentication data preparation scheme comprises the following steps:
Judging whether the summary list is included or not according to the first authentication data making scheme;
If not, the digest data of each airspace layer code stream is utilized to manufacture authentication data of each airspace layer code stream;
the number of the authentication data is the same as the airspace layer number of the code stream.
Wherein, the video coding method further comprises:
Generating a summary list by using summary data of all airspace layer code streams in response to the first authentication data making scheme including the summary list;
generating final summary data by using all summary data in the summary list;
creating an authentication signature using the final digest data;
And generating the authentication data according to the authentication signature and the digest list.
The step of preparing authentication data by using the summary data of each airspace layer code stream or preparing authentication data by using the summary data of all airspace layer code streams according to a preset authentication data preparation scheme comprises the following steps:
Calculating sub-summary data of each spatial layer unit of each spatial layer code stream according to the bit stream sequence of the current code stream segment according to a second authentication data making scheme;
generating the summary list by utilizing sub summary data of all airspace layer units in all airspace layer code streams;
Generating final summary data by utilizing all sub summary data in the summary list;
creating an authentication signature using the final digest data;
Generating the authentication data according to the authentication signature and the digest list;
Or generating the authentication data according to the authentication signature.
The step of preparing authentication data by using the summary data of each airspace layer code stream according to a preset authentication data preparation scheme comprises the following steps:
And according to a third authentication data making scheme, making the same amount of authentication data according to the spatial layer number of the code stream, wherein each authentication data stores an authentication signature made by the corresponding spatial layer code stream.
The video coding method further comprises the following steps:
Configuring an authentication data spatial layer number syntax at an authentication data set of each authentication data in response to the video bitstream including a plurality of authentication data;
According to the space domain layer number of the code stream corresponding to each authentication data in the current code stream fragment, carrying out syntax assignment on the space domain layer number of the authentication data;
The value of the data airspace layer number syntax of the network abstraction airspace layer unit head of the authentication data is the same as the value of the authentication data airspace layer number syntax.
The video coding method further comprises the following steps:
setting a syntax of a transmission summary list switch, indicating syntax of a spatial layer number of transmission authentication data under the condition that the transmission summary list switch is closed, and indicating a transmission summary list under the condition that the transmission summary list switch is opened.
The video coding method further comprises the following steps:
And in response to the video code stream comprising authentication data, when the authentication data set of the authentication data does not transmit authentication data spatial layer number syntax or authentication data spatial layer number syntax is 0, the data spatial layer number syntax of the network abstraction spatial layer unit head of the authentication data is assigned to be 0.
The video coding method further comprises the following steps:
And responding to the video code stream comprising a plurality of authentication data, and assigning a data space layer number syntax of a network abstract space layer unit head of the authentication data according to the space layer number of the code stream corresponding to each authentication data in the current code stream segment.
The method comprises the steps that a data space layer number syntax of a network abstraction space layer unit head of current authentication data is assigned to 0, and the current authentication data comprises an abstract list and authentication signatures of all space layer code streams or comprises an authentication signature of a 0 th space layer code stream;
and the syntax value of the data airspace layer number of the network abstraction airspace layer unit head of the current authentication data is not 0, which indicates that the current authentication data does not comprise a summary list.
The video coding method further comprises the following steps:
The summary list is not transmitted if the syntax of the transmit summary list switch indicates that the transmit summary list switch is off, and the syntax of the transmit summary list switch indicates that the transmit summary list switch is on.
In order to solve the above technical problems, the present application provides a video decoding method, which includes:
Acquiring a video code stream;
Extracting each airspace layer code stream of the current code stream fragment from the video code stream, and calculating abstract data of each airspace layer code stream;
Authenticating the video code stream by utilizing the abstract data of each airspace layer code stream;
after the video code stream passes the authentication, extracting abstract data of the current airspace layer code stream to calculate a first verification value;
Extracting authentication data of the current airspace layer code stream from the video code stream to calculate a second verification value;
and decoding the current code stream fragment when the first verification value and the second verification value are the same.
The authenticating the video code stream by using the summary data of each spatial layer code stream comprises the following steps:
And responding to the authentication data of the current code stream fragment to comprise a summary list, and verifying the summary data of each airspace layer code stream by using the summary list.
Wherein the extracting the authentication data of the current spatial layer code stream from the video code stream to calculate a second verification value includes:
judging whether the authentication data comprises a summary list or not;
if yes, extracting authentication data of the current code stream fragment from the video code stream;
If not, extracting one authentication data corresponding to the current airspace layer code stream from the video code stream;
Calculating the second verification value using the authentication data.
Wherein the extracting the authentication data of the current spatial layer code stream from the video code stream to calculate a second verification value includes:
judging whether the authentication data comprises a summary list or not;
If not, obtaining a summary list calculated by summary data of all airspace layer code streams, and writing the summary list into the authentication data;
Calculating the second verification value using the authentication data.
Wherein the extracting the authentication data of the current spatial layer code stream from the video code stream to calculate a second verification value includes:
Extracting one authentication data corresponding to the current airspace layer code stream from the video code stream;
Calculating the second verification value using the authentication data.
In order to solve the technical problem, the application also provides a video encoder, which comprises a memory and a processor coupled with the memory;
Wherein the memory is configured to store program data and the processor is configured to execute the program data to implement a video encoding method as described above.
In order to solve the above technical problems, the present application further provides a video decoder, which includes a memory and a processor coupled to the memory;
Wherein the memory is configured to store program data and the processor is configured to execute the program data to implement a video decoding method as described above.
To solve the above technical problem, the present application further proposes a computer storage medium for storing program data, which when executed by a computer, is configured to implement the above video encoding method and/or video decoding method.
Compared with the prior art, the application has the beneficial effects that: the video encoder acquires a current code stream segment, wherein the current code stream segment is obtained by coding through a layered coding technology and comprises at least two spatial domain code streams; acquiring abstract data of each airspace layer code stream; according to a preset authentication data making scheme, making authentication data by using the abstract data of each airspace layer code stream or making authentication data by using the abstract data of all airspace layer code streams; and adding the authentication data into the current code stream segment to generate a video code stream. By the video coding method, the authentication data production method under the spatial division and spatial layer is provided, so that the authentication of a certain spatial layer code stream can be realized independently, and the video coding efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Wherein:
FIG. 1 is a schematic flow chart of an authentication scheme specified by SVAC 2;
FIG. 2 is a schematic diagram of a signing process using summary list approach provided by the present application;
FIG. 3 is a schematic diagram of a signing process using summary list approach provided by the present application;
FIG. 4 is a schematic diagram of a crown summary provided by the present application;
FIG. 5 is a schematic flow chart of an authentication method based on spatial domain layering provided by the application;
FIG. 6 is a flowchart illustrating an embodiment of a video encoding method according to the present application;
FIG. 7 is a schematic diagram of an embodiment of a layered code stream according to the present application;
FIG. 8 is a schematic diagram of an embodiment of hierarchical authentication data provided by the present application;
FIG. 9 is a schematic diagram of another embodiment of hierarchical authentication data provided by the present application;
FIG. 10 is a flowchart of an embodiment of a video decoding method according to the present application;
FIG. 11 is a schematic diagram of a first embodiment of the extracted sub-spatial layer post-code stream according to the present application;
FIG. 12 is a schematic diagram of a second embodiment of the extracted sub-spatial layer post-code stream provided by the present application;
FIG. 13 is a schematic diagram of a third embodiment of the extracted sub-spatial layer post-code stream according to the present application;
fig. 14 is a schematic diagram of a fourth embodiment of a post-extraction sub-spatial layer code stream provided in the present application;
FIG. 15 is a schematic diagram of a video encoder according to an embodiment of the present application;
FIG. 16 is a schematic diagram of a video decoder according to an embodiment of the present application;
fig. 17 is a schematic structural diagram of an embodiment of a computer storage medium according to the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the application. 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.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented, for example, in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The video image data volume is relatively large, and video pixel data (RGB, YUV, etc.) is usually required to be compressed, and the compressed data is called a video code stream, and the video code stream is transmitted to a user terminal through a wired or wireless network and then decoded and watched. The whole video coding flow comprises the processes of prediction, transformation, quantization, coding and the like.
In video coding, the most commonly used color coding methods include YUV, RGB, etc., and the color coding method adopted in the invention is YUV. Y represents brightness, that is, a gray value of an image; u and V (i.e., cb and Cr) represent chromaticity, which functions to describe image color and saturation. Each Y luminance block corresponds to one Cb and one Cr chrominance block, and each chrominance block also corresponds to only one luminance block.
RAS (Random access segment ), generally refers to all frames before one Random access point to the next, and if there is a non-display knowledge image, it will also contain a non-display knowledge image before the starting RL frame.
The main process of the authentication technology related to the application is shown in fig. 1, and fig. 1 is a schematic flow chart of an authentication technical scheme specified by SVAC2 provided by the application.
As shown in fig. 1, the signing process in the authentication technology specified by SVAC2 is specifically:
(1) One or more NAL unit data to be authenticated is read. Wherein NAL is Network Abstraction Layer, a network abstraction layer is used to encapsulate video data and related information and transmit these encapsulated units in the network.
(2) And carrying out hash calculation on the NAL unit according to the algorithm and the mode agreed by the security parameter set to generate a primary or secondary hash value.
(3) And (3) signing (SM 2) the tree top hash (SM 3) result of one or more images by using a device private key according to the algorithm and the mode agreed by the security parameter set signature_type to generate video authentication data.
(4) Video authentication data is encapsulated into authentication data units, encapsulated in the form of independent NALs.
As shown in fig. 1, the signature verification process in the authentication technology specified by SVAC2 specifically includes:
(1) And acquiring source equipment information from the security parameter set NAL, and finding a public key of the corresponding source equipment.
(2) And decrypting the authentication data by using a signature algorithm specified in the signature_type and using the public key of the source terminal equipment to generate a verification hash value.
(3) And positioning the first authentication NAL unit of the image corresponding to the authentication data in the video code stream.
(4) And performing primary hash calculation or tree top hash calculation (SM 3) on one or more groups of authentication NAL units starting from the first authentication NAL unit according to the algorithm and the mode agreed by the security parameter set, wherein the calculation result is used as a comparison hash value.
(5) And comparing the verification hash value with the comparison hash value, and if the verification hash value and the comparison hash value are identical, verifying the image corresponding to the video authentication data.
Further, the signing process of the current authentication technology of SVAC3 is specifically described as follows:
step 1: a security parameter set NAL unit is generated and inserted into the compressed video bitstream.
Step 2: and calculating abstract data of the security parameter set corresponding to the participation signature image.
Step 3: the digital signature is calculated using the tree top digest.
Step 4: authentication data NAL units corresponding to the security parameter sets are generated and added to the compressed video bitstream.
The authentication procedure of the current authentication technology of SVAC3 is specifically described as follows:
step 1: and inputting the compressed video bit stream, and acquiring a security parameter set NAL unit in the bit stream.
Step 2: the digest data is computed for a security parameter set of the participating signature images.
Step 3: and acquiring image authentication data to finish authentication.
Specifically, referring to fig. 2 and fig. 3, fig. 2 is a schematic diagram of a signing process using a digest list method provided by the present application, and fig. 3 is a schematic diagram of a signing process using a digest list method provided by the present application.
As shown in fig. 2, the steps of the signing process using the summary list mode are as follows:
1. when the authentication of an access unit needs to be supported, a security parameter set RBSP is generated and added into a video sequence, and the video sequence is packed into a compressed video bit stream; wherein authentication_flag is set to 1, and each access unit is independently used for digest authentication.
2. An authentication identifier is set in the header of the NAL unit, and summary data of the access unit to be authenticated is calculated, and the summary data are H1, H2 and … Hn in sequence.
3. And abstracting all the access units needing authentication to generate Hg.
4. And signing Hg by adopting an algorithm corresponding to the signature_type by using a private key of the video encoding end, and generating Signature data Signature.
5. Generating an authentication RBSP data set, adding the authentication RBSP data set into a video sequence, and packaging the authentication RBSP data set into a compressed video bit stream; the authentication_data_id authentication identifier is added and used for uniquely identifying and authenticating the RBSP data set, the authentication_hash list stores H1, H2, … and Hn values, and the authentication_data stores Base64 coded Signature data Signature.
As shown in fig. 3, the authentication procedure using the digest list method is as follows:
1. And receiving the compressed video bit stream, and after receiving the security parameter set RBSP, if authentication is required, acquiring authentication_mode and hash_ type, signature _type, and acquiring an authentication mode, a digest algorithm and a signature algorithm used for authentication.
2. The receiving access unit acquires authentication_data_id, calculates summary data H, and sequentially comprises H1', H2', … and Hn '.
3. An authenticated RBSP data set is obtained from the compressed video bitstream,
4. And obtaining a summary list { H1, H2, …, hn }, which is in the authentication RBSP data set, and performing summary to generate Hg'.
5. Signature data Signature in the RBSP data set is obtained, signature public key corresponding to the Signature is used for verifying Signature data Signature of Hg', success of verification is ensured, and the Signature data Signature is stored in an authentication data list. The authentication public key can inquire an authentication certificate according to a certificate identification camera_idc in the security parameter set RBSP, and is obtained from the certificate.
6. Verifying the access unit to be authenticated, and searching an authentication RBSP data set with the consistent authentication identification authentication_data_id field from an authentication data list according to the authentication identification authentication_data_id in the access unit; and searching summary data H of the access unit in summary lists { H1, H2, …, hn } of the authentication RBSP data set, if the summary data H is found, the corresponding access unit is successfully verified, and if the summary data H is not found, the corresponding access unit is failed to verify.
It should be noted that, for the time-domain SVC coding and the space-domain SVC coding of the SVAC standard, since unified authentication data is adopted, the temporal_id and the layer_id of the NAL header of the authentication RBSP data set packet are both set to 0, so as to ensure that the authentication data set can be normally received.
The safety parameter set sentence method specified by SVAC3 of the application is specifically as follows:
the semantics of the security parameter set are specifically as follows:
knowledge image identification (is_library_flag): binary variables. A value of '1' indicates that the security parameter set acts on the knowledge image and a value of '0' indicates that the security parameter set acts on the display image.
Security parameter set ID (sec_para_set_id): 2-bit unsigned integer. The method is used for distinguishing different security parameter sets acting on the same RAS or a knowledge image access unit, and the value range is 1-3.
Encryption enable flag (encryption_enable_flag): binary variables. A value of '1' indicates that encryption of the display image slice, or the display image sequence parameter set, or the display image parameter set, or the non-display knowledge image slice, or the knowledge image sequence parameter set, or the knowledge image parameter set, or the extension data unit is supported, i.e. RBSP in the NAL unit may be encrypted. A value of '0' indicates that encryption of RBSPs in the NAL unit is not supported.
Authentication enable flag (authentication_enable_flag): binary variables. A value of '1' indicates that authentication of the current RAS or the knowledge image is supported, and the NAL unit that can participate in authentication includes a coded slice of the display image or the knowledge image in the current RAS, and a sequence parameter set, an image parameter set, a security parameter set, an extension data unit, supplemental enhancement information, etc., transmitted at the access unit. When authentication of the data content is supported, the authentication data carried in the encoded bit stream should be Base64 encoded. Authentication data is transmitted through NAL units having nal_unit_type equal to 10. A value of '0' indicates that the current security parameter set does not support authentication of the RAS or the knowledge picture, and there should not be NAL units of nal_unit_type equal to 10 of the RAS or the knowledge picture generated using the security parameter set.
The knowledge image only supports independent signature authentication, and the display image supports common signature authentication. Multiple display image access units participating in common signature authentication should be located at the same RAS. The image type in the plurality of access units participating in the common signature may be a display image. Knowledge image independent signature authentication, which adopts a security parameter set independent of a display image to perform independent signature authentication, and is_library_flag is used for distinguishing in the security parameter set.
If NAL units with authentication_idc greater than 0 and nal_unit_type equal to 0-3, 5-9, 12,14,17, 18 and 19 exist in an access unit, the NAL units with authentication_idc values equal to and greater than 0 and with the same layer_id value of each spatial layer unit in the access unit are arranged in bit stream sequence and then subjected to digest calculation, and digest data of NumOfLayers spatial layer units of the access unit corresponding to the authentication_idc are generated. The digest calculation method is specified by hash_type.
For the hash_period_in_doi_minus1+1 access units, calculating the abstract of each airspace layer unit in each access unit according to the bit stream sequence, wherein the application range of authentication data does not span RAS; and then sequentially calculating the tree top abstracts of the abstract values according to the method shown in fig. 4, wherein fig. 4 is a schematic diagram of the tree top abstracts provided by the application.
And carrying out digital signature on the last tree top abstract to generate authentication data RBSP, and packaging the authentication data RBSP NAL unit.
It should be noted that if the authentication_enable_flag and the encryption_enable_flag of the plurality of security parameter sets in the code stream have values equal to 1, that is, the current RAS or the knowledge image supports both encryption and authentication, the encryption and authentication should be performed first, that is, the data used for authentication should be an encrypted NAL unit.
Encryption basic unit (encryption_unit_mode): 2-bit unsigned integer. Indicating an encryption basic unit, a value of '0' indicating encryption in units of NAL; the value of '1' represents that the access unit is used as encryption unit, the parts of all NAL units RBSP in the access unit, which need to be encrypted, are spliced together according to the decoding sequence for encryption (the NAL units of the non-display knowledge image are spliced according to the bit stream sequence), and the NAL units are restored to the encrypted NAL units after encryption; the value of '2' represents that encryption is carried out by taking a space domain layer unit as a unit, all NAL units RBSP in the space domain layer unit are spliced together according to the decoding sequence and encrypted (NAL units of non-display knowledge images are spliced according to the bit stream sequence), and the encrypted NAL units are restored to the encrypted NAL units; the value is '3' reserved. Each encryption requires a re-initialization of the IV.
Encryption level mode (encryption_level_mode): 2-bit unsigned integer. Indicating an encryption level mode, a value of '0' indicating that all types of NAL units are encrypted, the encryption object is all RBSP data (except for the RBSP last byte); a value of '1' indicates that when NAL units having nal_unit_type equal to 0,1,2,12,14,17,18,19 are encrypted, the encryption object is encryptionByte bytes before RBSP, and when other types of NAL units are encrypted, the encryption object is all RBSP data (except for RBSP last byte); a value of '2' indicates that when NAL units having nal_unit_type equal to 0,1,2,12,14,17,18,19 and 5 are encrypted, the encryption object is encryptionByte bytes before RBSP, and when other types of NAL units are encrypted, the encryption object is all RBSP data (except for RBSP last byte); the value is '3' reserved. Wherein encryptionByte =min (EncryptionNum x EncryptionBaseByte, numBytesInPayload-1).
The number of encrypted basic byte lengths (encryption_num_minus1): 8-bit unsigned integer. The number EncryptionNum of encrypted base byte lengths is indicated as the value of encryption_num_minus1 plus 1.
Encryption base byte length (encryption_base_byte): 2-bit unsigned integer. Indicating the encryption basic byte length, a value of '0' indicates that the encryption basic byte length EncryptionBaseByte has a value of 16, a value of '1' indicates that the encryption basic byte length EncryptionBaseByte has a value of 64, a value of '2' indicates that the encryption basic byte length EncryptionBaseByte has a value of 256, and a value of '3' indicates that the encryption basic byte length EncryptionBaseByte has a value of 1024.
Encryption type (encryption_type): 4-bit unsigned integer. The algorithm used for indicating encryption is shown in table 1.
Table 1 correspondence between encryption type and specific encryption algorithm
Value of encryption_type Encryption algorithm
0 SM1
1 SM4
2~15 Reservation of
Video encryption key flag (vek _flag): binary variables. A value of '1' indicates carry vek and a value of '0' indicates no carry vkek.
Initial vector flag (iv_flag): binary variables. A value of '1' indicates carrying iv and a value of '0' indicates not carrying iv.
Video encryption key encryption type (vek _encryption_type): 4-bit unsigned integer. The encryption type of the video encryption key is indicated, and the specific corresponding relation is shown in table 1.
Encrypted video encryption key length (evek _length_minus1): 8-bit unsigned integer. Indicating the length of the encrypted video encryption key in bytes.
Encrypted video encryption key (evek): n-bit unsigned integer. The encrypted video encryption key is indicated and used for encryption calculation, and the length is evek _length_minus1 plus 1 byte.
Video encryption key version number length (vkek _version length_minus1): 8-bit unsigned integer. The video encryption key version number length is indicated in bytes.
Video encryption key version number (vkek _version): n-bit unsigned integer. The video encryption key version number is indicated, with a length vkek _version_length_minus1 plus 1 byte.
Initial vector length (iv_length_minus1): 8-bit unsigned integer. The initial vector length is indicated in bytes.
Initial vector (iv): n-bit unsigned integer. An initial vector is indicated for packet encryption, of length iv_length_minus1 plus 1 byte.
Hash type (hash_type) 2-bit unsigned integer. The algorithm used for the instruction authentication, and the specific correspondence is shown in table 2.
TABLE 2 correspondence of hash types to specific algorithms
Value of hash_type Authentication algorithm Summary data length (bytes)
0 SM3 32
1~3 Reservation of Reservation of
P/B frame hash authentication flag (hash_discard_ nrap _pictures_flag): binary variables. A value of '1' indicates that the non-random access point image is not authenticated; a value equal to 0 indicates authentication of the non-random access point image. If hash_discard_ nrap _pictures are not in the stream, default its value is equal to 1.
Hash period (hash_period_in_doi_minus1): 8-bit unsigned integer, with a value range of 0 to (MAX_HASH_PERIOD/NumOfLayers-1), MAX_HASH_PERIOD is set to 256.HashPeriodInDoi is equal to hash_period_in_doi_minus1+1. Indicating the number of access units involved in signature authentication associated with one authentication data. The number is less than or equal to HashPeriodInDoi.
HashPeriodInDoi is a representation of an independent signature for a single access unit, the authentication data NAL unit carrying the signature should be located at the access unit with which the signature is associated or at the first access unit thereafter. HashPeriodInDoi greater than 1 indicates that multiple access units are commonly signed.
Digital signature type (signature_type): 2-bit unsigned integer. An algorithm for digitally signing digest data of an image is indicated as shown in table 3.
TABLE 3 correspondence of digital signature types to specific encryption algorithms
Value of signature_type Signature algorithm
0 SM2
1~3 Reservation of
Signature data format (signature_fmt): 2-bit unsigned integer. The specific specification of the correspondence between the meaning of the signature_fmt value and the signature_type syntax, which indicates the signature data format, is shown in table 4.
Table 4 signature data format
Note that: r|S represents the result of direct concatenation of the secret words R and S output by the SM2 encryption algorithm, and the specific reference standard is GM/T0003.1-2012 SM2 elliptic curve public key cryptography algorithm part 1: general rule 4.2.2 conversion of integers to byte strings, and GM/T0003.2-2012 SM2 elliptic curve public key cryptography algorithm part 2: digital signature algorithm 6.1 digital signature generation algorithm.
Asn.1der coding is a coding system for the tag, length and value of each element, specifically referring to the standard GM/T0009-2012 SM2 cryptographic algorithm using the specification, 7.3 signature data format.
Camera certificate identification (camera_idc): 152 bit string. Certificate identification of the camera indicating the source of the image.
Camera identification (camera_id): 160-bit character string. A camera ID indicating the source of the image.
The validation mechanism of the security parameter set is as follows:
The security parameter set RBSP includes parameters that may be used by one or more other types of NAL units. The knowledge image is individually encrypted or authenticated independently of the display image to distinguish whether it is a security parameter set of the knowledge image according to the is_library_flag in the RBSP.
The code stream may contain a plurality of security parameter sets, and at most 3 security parameter sets are simultaneously supported by the security parameter set ID sec_para_set_id. The random access point access unit or the first knowledge image access unit of the RAS should have a security parameter set NAL unit previously in the RAS or the first knowledge image access unit, acting on the current RAS or the knowledge image, the security parameter set providing parameters for encryption and authentication of the current RAS or the knowledge image access unit, and in case of multiple security parameter sets, sec_para_set_id distinction is used.
If the security parameter set NAL unit does not exist in the random access point access unit of the RAS, the current RAS (excluding the non-display knowledge image access unit) is considered to be not encrypted and not participate in authentication; if no security parameter set NAL unit exists in the first knowledge image access unit, the current knowledge image is considered not encrypted and not participating in authentication.
The security parameter set NAL unit should be located within the same access unit as the sequence parameter set NAL unit, and the security parameter set NAL unit should be located before the sequence parameter set NAL unit. If an access unit demarcation NAL unit is included in the access unit, the security parameter set NAL unit should be located after the access unit demarcation NAL unit.
The syntax semantics of the authentication data NAL specified by SVAC3 of the application are specifically as follows:
/>
the NAL syntax is specifically as follows:
authentication data location identification (for_current_ras_idc): binary variables. A value of '1' indicates that all access units corresponding to digests in the digest list in the authentication data are within the current random access segment. If the value is '0', indicating that all access units corresponding to digests in the digest list in the authentication data are not in the current random access fragment. All access units of the common signature should be located within the same random access fragment.
Knowledge image authentication data flag bit (is_library_flag): binary variables. A value of '1' indicates that the authentication data is signature data of a knowledge image; a value of '0' indicates that the authentication data is signature data of a display image or a display knowledge image. IsLibraryFlag is equal to the value of is_library_flag. If there is no is_library_flag in the bitstream, isLibraryFlag has a value of 0.
Authentication knowledge image index (authenticaion _library_picture_index): n-bit unsigned integer. The index of the knowledge bit stream corresponding to the knowledge image, which indicates the action of the current authentication data, is in the range of 0-511. If authenticaion _library_picture_index does not exist in the bitstream, its value is equal to 0 by default.
Authentication data identification (authentication_data_id): 1-bit unsigned integer. And the value range is 0-1, and the identification of the authentication data is realized.
For authentication data NAL units with the same authentication_idc value, authentication data NAL units with authentication_data_id values of 0 or 1 should alternately appear in the encoded video sequence, i.e. authentication_data_id values of two adjacent authentication data NAL units in decoding order in one encoded video sequence should not be the same.
Authentication digest list identification (authentication_hash_list_flag): binary variables. A value of '1' indicates that the authentication data carries a list of digests of access units that generated signatures in the authentication data. A value of '0' indicates that the authentication data does not carry a digest list of the access unit that generated the signature in the authentication data.
Authentication digest number (authentication_hash_number_minus1): 8-bit unsigned integer, and the value range is 0-255. authentication_hash_number_minus1 plus 1 represents the number of authentication digest data.
Authentication digest data (authentication_hash): binary data. And summarizing the access unit according to a summarization algorithm corresponding to the hash_type in the corresponding security parameter set to obtain summarization data with the length of the summarization data corresponding to the hash_type of the summarization algorithm listed in table 2. In the display image and the display knowledge image, the arrangement sequence of the digests in the digest list carried in the authentication data NAL unit is the same as the bit stream sequence of each airspace layer unit; in the non-display knowledge image, the order of arrangement of digests in the digest list carried in the authentication data NAL unit should be the same as the bit stream order of each spatial layer unit therein.
Length of signature data (authentication_data_length_minus1): 8-bit unsigned integer. The addition of 1 indicates the length of the signature data, and the value should be 0 to 255 in bytes.
The number of bytes of signature data (authentication_data [ i ]): 8-bit unsigned integer. The ith byte of one signature data is subjected to Base64 coding, and the Base64 coding method is shown in rfc3548.
The authentication data NAL unit should follow all other types of NAL units in the access unit except end of stream NAL units, end of coded video sequence NAL units. The order of authentication data NAL units corresponding to the same security parameter set in the bitstream should be the same as the bitstream order of their corresponding access units, i.e. a first authentication data NAL unit precedes a second authentication data NAL unit, then any access unit associated with the first authentication data NAL unit precedes any access unit associated with the second authentication data NAL unit.
The authentication data NAL unit of the display image should be located in or after the last access unit of the present authentication, before the next authentication data NAL unit and before the next random access point access unit that is not the display knowledge image. In particular, the last authentication data in each RAS is allowed to be put into the next RAS, in which case for_current_ras_idc in the authentication data is set to 0. The space domain unit interval between the authentication data and the last access unit participating in authentication cannot exceed HashPeriodInDoi (equal to the hash_period_in_doi_minus1+1 in the security parameter set corresponding to the authentication at this time) (without the non-display knowledge image access unit). The authentication data of the display image can be located in the access unit where the last display image encoding sheet is located; or in an access unit of a display image coding slice of the next RAS.
The authentication data NAL unit of the knowledge image should be located in or after the last access unit of the present authentication, before the next authentication data NAL unit and before the next random access point access unit.
The authentication data of the display knowledge image and the access units of the display knowledge image should be spaced apart by no more than HashPeriodInDoi (equal to hash_period_in_doi_minus1+1 in the security parameter set corresponding to the authentication at this time). The authentication data of the display knowledge image can be positioned in the access unit where the last display knowledge image coding sheet is positioned; or in an access unit of a display image coding slice of the next RAS.
The authentication data of the non-display knowledge image is located in the access unit where the last non-display knowledge image code piece is located.
Based on the above, the application provides an authentication method based on airspace layering, which can realize the authentication of a certain airspace layer independently aiming at the situation of airspace layering. Fig. 5 is a schematic flow chart of an authentication method based on spatial domain layering according to the present application.
As shown in fig. 5, the present application proposes the following improvement points:
(1) The authentication data making method under the space domain layering comprises the following steps: a method for producing authentication data under airspace layering is provided, which supports correct authentication of sub airspace layering extracted after receiving at a receiving end.
(2) The authentication data extraction and sub-airspace layer authentication method when the sub-airspace layer is extracted under airspace layering comprises the steps of: the method for extracting the authentication data in the specific sub-airspace layer extraction and the method for sub-airspace layer authentication are provided.
(3) Syntax setting: it is necessary to add a syntax for marking the spatial layer number corresponding to the signature data.
Based on the above improvement, the present application proposes a specific video encoding method, and with reference to fig. 6, fig. 6 is a schematic flow chart of an embodiment of the video encoding method provided by the present application.
As shown in fig. 6, the specific steps are as follows:
step S11: and obtaining a current code stream segment, wherein the current code stream segment is obtained by coding through a layered coding technology and comprises at least two spatial domain code streams.
In the embodiment of the application, the video encoder acquires the current code stream fragment, i.e., the current RAS. Current RAS conditions include, but are not limited to: only including displaying knowledge images; when the video stream has the displayed knowledge images, the video stream comprises two frames of conventional images between the displayed knowledge images; when the video stream has a non-display knowledge image, it includes all frames from the start RL frame to the non-display knowledge image.
It should be noted that, if the current code stream segment is the first frame of the non-display knowledge image, the current code stream segment is not an RAS but exists only as a single frame of video frame.
Further, the current code stream segment according to the present application may be divided into a plurality of spatial layer code streams by spatial layer, and in the embodiment of the present application, two spatial layer code streams are taken as an example, that is, the current code stream segment includes layer0 and layer1. In other embodiments, the video encoding method of the present application is equally applicable to spatial layering schemes with other spatial layers, which are not listed here.
Step S12: and obtaining abstract data of each airspace layer code stream.
In the embodiment of the present application, each spatial layer code stream includes several spatial layer units, for example, layer0 includes: poc0layer0, poc1layer0, poc2layer0, poc3layer0; layer1 includes: poc0layer1, poc1layer1, poc2layer1, poc3layer1.
Step S13: and according to a preset authentication data making scheme, making authentication data by using the summary data of each airspace layer code stream or making authentication data by using the summary data of all airspace layer code streams.
In the embodiment of the application, the video encoder is provided with a plurality of authentication data making schemes in advance so as to make one authentication data by utilizing the summary data of each spatial domain code stream or make one authentication data by utilizing the summary data of all the spatial domain code streams. The former authentication data creation scheme obtains a plurality of authentication data having the same number as the number of spatial layers, and the latter authentication data creation scheme obtains one authentication data.
Specifically, in the case of spatial hierarchy, the video encoder may generate authentication data by the following methods:
The first authentication data making scheme comprises the following steps: the video encoder selects whether to store the digest list, if the digest list is not stored, it is necessary to create a plurality of authentication data according to the number of spatial layers, and if the digest list is stored, the digest list and the signature created using all the spatial layer digests are stored in the authentication data.
Specifically, when the video encoder selects the first authentication data making scheme, it is confirmed whether a summary list exists in the final video bitstream, wherein the summary list is used for storing summary data of all spatial layer units. If the summary list does not exist, the video encoder utilizes the summary data of each spatial layer code stream to manufacture authentication data of each spatial layer code stream, namely the number of authentication data is the same as the spatial layer number of the code stream. If the summary list exists, the video encoder uses the summary data of all the spatial layer code streams to make signature data, and generates authentication data by using the summary list and the signature data.
In one embodiment, referring to fig. 7, fig. 7 is a schematic diagram of an embodiment of a layered code stream of a current code stream segment.
As shown in fig. 7, the current code stream segment is the first 4 frames of one RAS, authentication data is produced, and the current sub-spatial layer is 2 spatial layers. And performing authentication data on the partial code stream, wherein the authentication data is required to support the successful authentication after the receiving terminal extracts the sub-airspace layer.
The video encoder chooses whether to send the summary list, e.g. the current video encoder chooses not to send the summary list, i.e. chooses each spatial layer to produce authentication data. The code stream respectively generates authentication data for different spatial layers, namely authentication data of a layer0 spatial layer and authentication data of a layer1 spatial layer, and layer_id marks of corresponding authentication data are 0 and 1. Specifically, as shown in fig. 8, fig. 8 is a schematic diagram of an embodiment of hierarchical authentication data provided by the present application.
For another example, the current video encoder selects to send a summary list, that is, selects all spatial layers to make one summary data, and the layer_id of the authentication data is marked with 0. Specifically, as shown in fig. 9, fig. 9 is a schematic diagram of another embodiment of hierarchical authentication data provided by the present application. At this time, the authentication data also stores digest list and layer0+layer1 signature data.
The second authentication data making scheme is as follows: the transmitting end calculates the abstract of each airspace layer unit according to the bit stream sequence, and the authentication data stores an abstract list and the signature manufactured by using all airspace layer abstracts or only stores the signature manufactured by using all airspace layer abstracts.
Specifically, when the video encoder selects the second authentication data creation scheme, only one authentication data created using all spatial layer digests is needed. The authentication data may store a digest list and signature data created using all the spatial layer digests, or may store only signature data created using all the spatial layer digests. For example, as shown in fig. 7, the video encoder calculates sub-digest data of each of poc0layer0, poc1layer0, poc2layer0, and poc3layer0, respectively, and then calculates a secondary digest for all sub-digest data simultaneously in layer0, thereby obtaining a spatial layer digest of layer 0. By using the spatial layer digest of layer0 and the spatial layer digest of layer1, the video encoder can create signature data of layer0+layer1 and further create authentication data.
The third authentication data making scheme: the transmitting end generates a plurality of authentication data according to the airspace layer number, and the generated signatures of different airspace layer units are in different authentication data.
Specifically, when the video encoder selects the third authentication data creation scheme, it is necessary to create the corresponding authentication data individually for each spatial layer code stream. The signature data of the airspace layer abstract of the corresponding airspace layer code stream is only needed to be stored in each authentication data.
Step S14: and adding the authentication data into the current code stream fragment to generate a video code stream.
In the embodiment of the present application, as shown in fig. 1, a video encoder writes authentication data obtained by encoding signature data encrypted by a private key via Base64 into a code stream, so as to obtain a video code stream to be transmitted.
Further, implementing the video coding method of the present application, the video encoder also needs to set the authentication data syntax. Specifically, the authentication data syntax setting method provided by the application comprises the following steps:
(1) Adding a syntax in the authentication data NAL, wherein the syntax is transmitted under the condition of not transmitting a summary list and is used for distinguishing the space domain layer unit numbers corresponding to the signature data; meanwhile, the airspace layer number mark in the NAL unit head of the authentication unit is kept the same as the airspace layer unit number corresponding to the signature data. The authentication data syntax setting scheme one will be referred to as follows.
(2) The authentication data NAL unit header airspace layer number marks the airspace layer id authenticated by the current authentication data, and the summary list in the authentication data NAL unit is transmitted only when the airspace layer number is 0. The authentication data syntax setting scheme two is hereinafter referred to.
In one embodiment, the video encoder uses a syntax representation of authentication data syntax setting scheme one:
(1) The added syntax authentication layer id in the authentication data represents the spatial layer id authenticated by the current authentication data.
(2) The authentication data NAL unit header layer_id value is the same as authentication layer_id, but the layer_id value is 0 when this syntax is not transmitted in the authentication data.
The authentication data NAL unit syntax is modified as follows:
The new syntax meaning is as follows:
Authentication data spatial layer number (authentication layer id): 2-bit unsigned integer. The number of the airspace layer unit airspace layer which is used for representing the authentication and corresponds to the authentication data is 0 to 3.
In one embodiment, the video encoder uses a syntax representation of authentication data syntax setting scheme two:
(1) The authentication data NAL unit header layer_id marks the spatial layer id authenticated by the current authentication data.
(2) When the NAL unit header layer_id value of the authentication data is 0, the possibility of transmitting a digest list in the current authentication data is indicated, and when the digest list is not transmitted, the signature in the current authentication data is only the signature of the 0 th airspace layer.
The authentication data NAL unit syntax is modified as follows:
Wherein the condition of transmitting the digest list is modified and transmitted only when the layer_id is 0.
In the embodiment of the application, a video encoder acquires a current code stream segment, wherein the current code stream segment comprises at least two spatial domain code streams; acquiring abstract data of each airspace layer code stream; according to a preset authentication data making scheme, making authentication data by using the abstract data of each airspace layer code stream or making authentication data by using the abstract data of all airspace layer code streams; and adding the authentication data into the current code stream segment to generate a video code stream. By the video coding method, the authentication data manufacturing method under the spatial domain layering is provided, the authentication of a certain spatial domain layer code stream can be realized independently, and the video coding efficiency is improved.
With continued reference to fig. 10, fig. 10 is a flowchart illustrating an embodiment of a video decoding method according to the present application.
As shown in fig. 10, the specific steps are as follows:
step S21: and obtaining a video code stream.
Step S22: and extracting each airspace layer code stream of the current code stream fragment from the video code stream, and calculating abstract data of each airspace layer code stream.
Step S23: and authenticating the video code stream by using the abstract data of each spatial domain code stream.
Step S24: and after the video code stream passes the authentication, extracting abstract data of the current airspace layer code stream to calculate a first verification value.
Step S25: and extracting authentication data of the current airspace layer code stream from the video code stream to calculate a second verification value.
In the embodiment of the application, the video decoder adopts the authentication data extraction and sub-airspace layer authentication method when the sub-airspace layer is extracted under the airspace layer.
Specifically, the present application is directed to the above three schemes for making authentication data, and after receiving the signed airspace multi-airspace layer code stream, the following requirements are met: and checking the signature of the code stream, extracting the code stream and authentication data corresponding to part of the airspace layer, and checking the signature of the extracted code stream. Thus, the video decoder needs to adopt the sub-spatial layer extraction and sub-spatial layer authentication schemes corresponding to the three production authentication data schemes.
(1) First sub-spatial layer extraction and sub-spatial layer authentication scheme corresponding to first authentication data generation:
Authenticating a complete code stream when the code stream extraction is not performed: before analyzing or decoding the authentication data, calculating the abstract of each airspace layer, recording the airspace layer id, and determining the authentication mode according to whether the subsequently received authentication data carries an abstract list or not. If the received authentication data has no summary list, the authentication data corresponding to all airspace layers can be received to authenticate all sub airspace layers, if the received authentication data has the summary list, the correctness of the summary list needs to be verified a priori, and then the summary list is used for verifying the correctness of the summary of each frame.
Extracting authentication data of a sub-airspace layer: including but not limited to the following:
a) Authentication data in which layer_id is equal to 0 and layer_id is equal to the extracted spatial layer number is directly extracted.
B) Confirming whether the authentication data contains a summary list or not, and if the summary list does not exist, directly extracting the authentication data with layer_id equal to the extracted airspace layer number; otherwise, all authentication data is extracted.
Authenticating the extracted code stream: the same way as the authentication of the complete code stream.
(2) Second sub-spatial layer extraction and sub-spatial layer authentication scheme corresponding to second authentication data generation:
Authenticating a complete code stream when the code stream extraction is not performed: before analyzing or decoding the authentication data, calculating the abstract of each airspace layer, and determining an authentication mode according to whether the subsequently received authentication data carries an abstract list. If the received authentication data does not have the abstract list, the abstracts are calculated by using abstracts of all airspace layers together, and signature verification in the abstracts and the authentication data is used; if the received authentication data has a summary list, the correctness of the summary list needs to be verified a priori, and then the summary list is used for verifying the correctness of each frame summary.
Extracting authentication data of a sub-airspace layer: the method includes the steps that a summary list of all airspace layer units corresponding to authentication data is required to be manufactured in the whole code stream authentication process, if the summary list does not exist in the authentication data, the summary list calculated by all airspace layer units is required to be stored, the summary list is written into the corresponding summary data, and the authentication data is required to be extracted when sub airspace layers are extracted. If the authentication data has a summary list, the authentication data is directly extracted when the sub-airspace layer is extracted.
(3) Third sub-spatial layer extraction and sub-spatial layer authentication scheme corresponding to third authentication data generation:
authenticating a complete code stream when the code stream extraction is not performed: before analyzing or decoding the authentication data, calculating the abstract of each airspace layer, recording the airspace layer id, jointly calculating the secondary abstract by using the airspace layer abstracts with the same airspace layer number, and checking the signature of the secondary abstract by using the authentication data corresponding to the same airspace layer number.
Extracting authentication data of a sub-airspace layer: the extraction layer_id is equal to the abstract data of the extracted spatial layer number.
In one embodiment, the video decoder uses the method a) of the first sub-spatial layer extraction and sub-spatial layer authentication scheme. For example, authentication data is created for the first 4 frames in one RAS, and the current sub-spatial layer is 2 spatial layers.
The video decoder extracts the 1 st spatial layer after receiving, if decoding of the 1 st spatial layer image needs a part of NAL of the 0 th spatial layer, the part of NAL marked as the 0 th spatial layer needs to be extracted, meanwhile, the NAL of the 0 th spatial layer is marked as non-authentication, and if decoding of the 1 st spatial layer image needs all NAL of the 0 th spatial layer, all NAL of the 0 th spatial layer needs to be extracted for decoding of the 1 st spatial layer.
The video decoder directly extracts the authentication data with layer_id equal to 0 and layer_id equal to 1, and whether the authentication data contains a summary list or not, the extracted sub-spatial layer can be ensured to be authenticated correctly.
If the authentication data includes a summary list, the extracted code stream is shown in fig. 11, and fig. 11 is a schematic diagram of a first embodiment of the extracted sub-airspace layer code stream provided by the present application. At this time, the authentication data in which the layer_id is equal to 0 and the layer_id is equal to 1 are the same authentication data.
If the authentication data does not include the summary list, the extracted code stream is shown in fig. 12, and fig. 12 is a schematic diagram of a second embodiment of the extracted sub-airspace layer post-code stream provided by the present application. At this time, the authentication data of which layer_id is equal to 0 and layer_id is equal to 1 are two separate authentication data.
In another embodiment, the video decoder uses the b) method of the first sub-spatial layer extraction and sub-spatial layer authentication scheme. For example, authentication data is created for the first 4 frames in one RAS, and the current sub-spatial layer is 2 spatial layers.
The video decoder extracts the 1 st spatial layer after receiving, if decoding of the 1 st spatial layer image needs a part of NAL of the 0 th spatial layer, the part of NAL marked as the 0 th spatial layer needs to be extracted, meanwhile, the NAL of the 0 th spatial layer is marked as non-authentication, and if decoding of the 1 st spatial layer image needs all NAL of the 0 th spatial layer, all NAL of the 0 th spatial layer needs to be extracted for decoding of the 1 st spatial layer.
The video decoder confirms whether the authentication data contains a summary list or not, and if the summary list is not contained, the authentication data with layer_id equal to 1 is directly extracted; otherwise, all authentication data is extracted.
If the authentication data includes a summary list, the extracted code stream is shown in fig. 13, and fig. 13 is a schematic diagram of a third embodiment of the extracted code stream with sub-airspace layer according to the present application. At this time, the video decoder extracts authentication data in which layer_id is equal to 0.
If the authentication data does not include the digest list, the extracted code stream is shown in fig. 14, and fig. 14 is a schematic diagram of a fourth embodiment of the extracted sub-airspace layer code stream provided by the present application. At this time, the video decoder extracts authentication data in which layer_id is equal to 1.
Step S26: and decoding the current code stream fragment when the first verification value and the second verification value are the same.
In the embodiment of the application, the authentication method under the condition of no summary list is perfected on the basis of the existing authentication scheme, and the direct space domain hierarchical extraction can be realized under the condition of not storing the summary list. In addition, the authentication method provided by the application is compatible with the hierarchical authentication method of the old standard, and is beneficial to scheme realization.
It will be appreciated by those skilled in the art that in the above-described method of the specific embodiments, the written order of steps is not meant to imply a strict order of execution but rather should be construed according to the function and possibly inherent logic of the steps.
In order to implement the video encoding method, the present application further provides a video encoder, and referring to fig. 15, fig. 15 is a schematic structural diagram of an embodiment of the video encoder provided by the present application.
The video encoder 400 of the present embodiment includes a processor 41, a memory 42, an input-output device 43, and a bus 44.
The processor 41, the memory 42 and the input/output device 43 are respectively connected to the bus 44, and the memory 42 stores program data, and the processor 41 is configured to execute the program data to implement the video encoding method according to the above embodiment.
In an embodiment of the present application, the processor 41 may also be referred to as a CPU (Central Processing Unit ). The processor 41 may be an integrated circuit chip with signal processing capabilities. Processor 41 may also be a general purpose processor, a digital signal processor (DSP, digital Signal Process), an Application Specific Integrated Circuit (ASIC), a field programmable gate array (FPGA, field Programmable GATE ARRAY) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The general purpose processor may be a microprocessor or the processor 41 may be any conventional processor or the like.
In order to implement the above video decoding method, the present application further provides a video decoder, and referring to fig. 16 specifically, fig. 16 is a schematic structural diagram of an embodiment of the video decoder provided by the present application.
The video decoder 500 of the present embodiment includes a processor 51, a memory 52, an input-output device 53, and a bus 54.
The processor 51, the memory 52, and the input/output device 53 are respectively connected to the bus 54, and the memory 52 stores program data, and the processor 51 is configured to execute the program data to implement the video decoding method according to the above embodiment.
In an embodiment of the present application, the processor 51 may also be referred to as a CPU (Central Processing Unit ). The processor 51 may be an integrated circuit chip with signal processing capabilities. Processor 51 may also be a general purpose processor, a digital signal processor (DSP, digital Signal Process), an Application SPECIFIC INTEGRATED Circuit (ASIC), a field programmable gate array (FPGA, field Programmable GATE ARRAY) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The general purpose processor may be a microprocessor or the processor 51 may be any conventional processor or the like.
The present application further provides a computer storage medium, and referring to fig. 17, fig. 17 is a schematic structural diagram of an embodiment of the computer storage medium provided by the present application, in which a computer program 61 is stored in the computer storage medium 600, and the computer program 61 is used to implement the video encoding method and/or the video decoding method according to the above embodiments when executed by a processor.
Embodiments of the present application may be stored in a computer readable storage medium when implemented in the form of software functional units and sold or used as a stand alone product. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description is only of embodiments of the present application, and is not intended to limit the scope of the application, and all equivalent structures or equivalent processes using the descriptions and the drawings of the present application or directly or indirectly applied to other related technical fields are included in the scope of the present application.

Claims (19)

1. A video encoding method, the video encoding method comprising:
acquiring a current code stream fragment, wherein the current code stream fragment is obtained by coding through a layered coding technology and comprises code streams of at least two spatial layers;
Acquiring abstract data of each airspace layer code stream;
according to a preset authentication data making scheme, making authentication data by using the abstract data of each airspace layer code stream or making authentication data by using the abstract data of all airspace layer code streams;
and adding the authentication data into the current code stream segment to generate a video code stream.
2. The video coding method of claim 1, wherein,
The step of preparing authentication data by using the summary data of each spatial layer code stream or preparing authentication data by using the summary data of all spatial layer code streams according to a preset authentication data preparation scheme comprises the following steps:
Judging whether the summary list is included or not according to the first authentication data making scheme;
If not, the digest data of each airspace layer code stream is utilized to manufacture authentication data of each airspace layer code stream;
the number of the authentication data is the same as the airspace layer number of the code stream.
3. The video coding method of claim 2, wherein,
The video encoding method further includes:
generating a summary list by utilizing summary data of all airspace layer code streams in response to the first authentication data making scheme comprising the summary list;
generating final summary data by using all summary data in the summary list;
creating an authentication signature using the final digest data;
And generating the authentication data according to the authentication signature and the digest list.
4. The video coding method of claim 1, wherein,
The step of preparing authentication data by using the summary data of each spatial layer code stream or preparing authentication data by using the summary data of all spatial layer code streams according to a preset authentication data preparation scheme comprises the following steps:
Calculating sub-summary data of each spatial layer unit of each spatial layer code stream according to the bit stream sequence of the current code stream segment according to a second authentication data making scheme;
generating a summary list by utilizing sub summary data of all airspace layer units in all airspace layer code streams;
Generating final summary data by utilizing all sub summary data in the summary list;
creating an authentication signature using the final digest data;
Generating the authentication data according to the authentication signature and the digest list;
Or generating the authentication data according to the authentication signature.
5. The video coding method of claim 1, wherein,
The step of preparing authentication data by using the abstract data of each airspace layer code stream according to a preset authentication data preparation scheme comprises the following steps:
And according to a third authentication data making scheme, making the same amount of authentication data according to the spatial layer number of the code stream, wherein each authentication data stores an authentication signature made by the corresponding spatial layer code stream.
6. The video coding method of claim 1, wherein,
The video encoding method further comprises the steps of:
Configuring an authentication data spatial layer number syntax at an authentication data set of each authentication data in response to the video bitstream including a plurality of authentication data;
According to the space domain layer number of the code stream corresponding to each authentication data in the current code stream fragment, carrying out syntax assignment on the space domain layer number of the authentication data;
The value of the data airspace layer number syntax of the network abstraction airspace layer unit head of the authentication data is the same as the value of the authentication data airspace layer number syntax.
7. The video coding method of claim 6, wherein,
The video encoding method further comprises the steps of:
setting a syntax of a transmission summary list switch, indicating syntax of a spatial layer number of transmission authentication data under the condition that the transmission summary list switch is closed, and indicating a transmission summary list under the condition that the transmission summary list switch is opened.
8. The video coding method according to claim 6 or 7, wherein,
The video encoding method further comprises the steps of:
And in response to the video code stream comprising authentication data, when the authentication data set of the authentication data does not transmit authentication data spatial layer number syntax or authentication data spatial layer number syntax is 0, the data spatial layer number syntax of the network abstraction spatial layer unit head of the authentication data is assigned to be 0.
9. The video coding method of claim 1, wherein,
The video encoding method further comprises the steps of:
And responding to the video code stream comprising a plurality of authentication data, and assigning a data space layer number syntax of a network abstract space layer unit head of the authentication data according to the space layer number of the code stream corresponding to each authentication data in the current code stream segment.
10. The video coding method of claim 9, wherein,
The syntax value of the data airspace layer number of the network abstract airspace layer unit head of the current authentication data is 0, which indicates that the current authentication data comprises an abstract list and authentication signatures of all airspace layer code streams or the current authentication data comprises an authentication signature of the 0 th airspace layer code stream;
and the syntax value of the data airspace layer number of the network abstraction airspace layer unit head of the current authentication data is not 0, which indicates that the current authentication data does not comprise a summary list.
11. The video coding method of claim 1, wherein,
The video encoding method further comprises the steps of:
The summary list is not transmitted if the syntax of the transmit summary list switch indicates that the transmit summary list switch is off, and the syntax of the transmit summary list switch indicates that the transmit summary list switch is on.
12. A video decoding method, the video decoding method comprising:
Acquiring a video code stream;
Extracting each airspace layer code stream of the current code stream fragment from the video code stream, and calculating abstract data of each airspace layer code stream;
Authenticating the video code stream by utilizing the abstract data of each airspace layer code stream;
after the video code stream passes the authentication, extracting abstract data of the current airspace layer code stream to calculate a first verification value;
Extracting authentication data of the current airspace layer code stream from the video code stream to calculate a second verification value;
and decoding the current code stream fragment when the first verification value and the second verification value are the same.
13. The video decoding method of claim 12, wherein,
The authenticating the video code stream by using the summary data of each spatial layer code stream comprises the following steps:
And responding to the authentication data of the current code stream fragment to comprise a summary list, and verifying the summary data of each airspace layer code stream by using the summary list.
14. The video decoding method according to claim 12 or 13, wherein,
The step of extracting the authentication data of the current airspace layer code stream from the video code stream to calculate a second verification value comprises the following steps:
judging whether the authentication data comprises a summary list or not;
if yes, extracting authentication data of the current code stream fragment from the video code stream;
If not, extracting one authentication data corresponding to the current airspace layer code stream from the video code stream;
Calculating the second verification value using the authentication data.
15. The video decoding method of claim 12, wherein,
The step of extracting the authentication data of the current airspace layer code stream from the video code stream to calculate a second verification value comprises the following steps:
judging whether the authentication data comprises a summary list or not;
If not, obtaining a summary list calculated by summary data of all airspace layer code streams, and writing the summary list into the authentication data;
extracting authentication data written into the abstract list;
Calculating the second verification value using the authentication data.
16. The video decoding method of claim 12, wherein,
The step of extracting the authentication data of the current airspace layer code stream from the video code stream to calculate a second verification value comprises the following steps:
Extracting one authentication data corresponding to the current airspace layer code stream from the video code stream;
Calculating the second verification value using the authentication data.
17. A video encoder comprising a memory and a processor coupled to the memory;
Wherein the memory is for storing program data and the processor is for executing the program data to implement the video encoding method of any one of claims 1 to 11.
18. A video decoder comprising a memory and a processor coupled to the memory;
Wherein the memory is for storing program data and the processor is for executing the program data to implement the video decoding method of any of claims 12 to 16.
19. A computer storage medium for storing program data which, when executed by a computer, is adapted to carry out the video encoding method of any one of claims 1 to 11 and/or the video decoding method of any one of claims 12 to 16.
CN202410190387.5A 2024-02-20 2024-02-20 Video encoding method, video decoding method, encoder, decoder, and medium Pending CN118042147A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410190387.5A CN118042147A (en) 2024-02-20 2024-02-20 Video encoding method, video decoding method, encoder, decoder, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410190387.5A CN118042147A (en) 2024-02-20 2024-02-20 Video encoding method, video decoding method, encoder, decoder, and medium

Publications (1)

Publication Number Publication Date
CN118042147A true CN118042147A (en) 2024-05-14

Family

ID=90999886

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410190387.5A Pending CN118042147A (en) 2024-02-20 2024-02-20 Video encoding method, video decoding method, encoder, decoder, and medium

Country Status (1)

Country Link
CN (1) CN118042147A (en)

Similar Documents

Publication Publication Date Title
US11023618B2 (en) Systems and methods for detecting modifications in a video clip
US5907619A (en) Secure compressed imaging
US8046580B2 (en) Data processing apparatus and method for generation of protection compression encoded data
US7958361B2 (en) Information processing apparatus and method
US8938095B2 (en) Verification method, verification device, and computer product
CN105704545A (en) Secret key synchronizing information transmission method based on H.264 video stream
CN106664203A (en) Systems and methods for protecting elementary bitstreams incorporating independently encoded tiles
US7747087B2 (en) Apparatus, method, and article of manufacture used to encode information into an image and to decode information from a captured image
US9319752B2 (en) Robust watermark
CN111866547B (en) Novel video tamper-proofing method
CN118042147A (en) Video encoding method, video decoding method, encoder, decoder, and medium
CN114363638B (en) Video encryption method based on H.265 entropy coding binarization
CN111064717B (en) Data encoding method, data decoding method, related terminal and device
CN115550328A (en) Digital copyright protection method based on auxiliary enhancement information of H.264 video code stream
JP2005318068A (en) Electronic watermark embedding system of contents authentication data, and authentication system
CN109902528B (en) Encoding and decoding method of two-dimension code
EP4369725A1 (en) Transcodable signed video data
Veličković et al. Resilience of MDCS Watermarking Algorithm in Wireless Network Environment
JP4446400B2 (en) Digital watermark embedding method and authentication method for content
CN117528149A (en) Key updating method, code stream encryption method, code stream decryption method and related devices
CN117651146A (en) Video code stream authentication method, computer device and storage medium
CN117640958A (en) Video code stream authentication method, computer device and storage medium
CN117478907B (en) Video tamper-proof method, device and medium based on image coding
CN118042144A (en) Security processing method, related device, equipment and medium
EP4195661A1 (en) Methods of adding and validating a digital signature in a video data segment

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