A method for embedding secret information into a video, a video steganography method and related devices
By dividing the video coding unit into a two-dimensional array and performing polygonal encoding, filtering replacement sets, and using the improved Manhattan distance for secret information embedding, the problems of insufficient embedding capacity and poor visual quality in the prior art are solved, achieving efficient secret information embedding and video quality preservation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING UNIV OF INFORMATION SCI & TECH
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-01
AI Technical Summary
Existing secret information embedding methods based on prediction unit partitioning patterns suffer from insufficient secret information embedding capacity and poor video visual quality after embedding.
The video coding unit is divided into a two-dimensional array. By polygon partitioning and assignment, the replacement set is selected. The improved Manhattan distance is used to determine the replacement elements for secret information embedding, which increases the embedding capacity while ensuring visual quality.
It significantly improves the embedding capacity of secret information and maintains the visual quality of the video with limited structural modifications, achieving an excellent balance between embedding capacity and visual quality.
Smart Images

Figure CN121603676B_ABST
Abstract
Description
A method for embedding secret information into video, a video steganography method, and related devices. Technical Field
[0001] This invention relates to a method for embedding secret information into video, a video steganography method, and related devices, belonging to the fields of computer vision and information security. Background Technology
[0002] Video steganography is a technique that achieves covert transmission by embedding secret information into video. It mainly involves the encoding end (the hiding end) embedding the secret information into the video, and the decoding end (the extraction end) using a reverse decoding method to restore the secret information. The core requirement is to maximize the information embedding capacity while ensuring video visual quality and coding efficiency. Existing secret information embedding methods based on prediction unit partitioning suffer from insufficient secret information embedding capacity and poor visual quality of the embedded video. Summary of the Invention
[0003] This invention provides a method for embedding secret information into video, a video steganography method, and related apparatus, which solves the problems disclosed in the background art.
[0004] According to one aspect of this application, a method for embedding secret information into a video is provided, comprising:
[0005] The video is segmented into coding units, and the coding units are further divided into prediction units. The segmentation patterns of adjacent prediction units in the coding units are converted into row and column numbers of a two-dimensional array, and a two-dimensional array of coding units is constructed.
[0006] Based on the embedding capacity requirements of the secret information, the encoding unit A for embedding the secret information is determined. The two-dimensional array graph of the encoding unit A is divided into polygons to obtain the coverage area of each polygon. The two-dimensional array of the encoding unit A is then assigned values. Among them, the coverage area of the polygon is the element E corresponding to the polygon coverage area; element E is an element in the two-dimensional array; the polygon size is obtained according to the embedding capacity requirements.
[0007] The secret information is converted to a two-dimensional array within the range of values. Based on the coverage area and the positional relationship between element S and the coverage area, a replacement set of element S is selected from the assigned two-dimensional array. Here, element S is the element in the two-dimensional array corresponding to the adjacent prediction unit in the coding unit A that embeds the secret information. The element T in the replacement set is element E that is equal to the converted value.
[0008] Based on the distance between element S and each element T, determine the replacement element of element S, replace the partitioning pattern corresponding to element S with the partitioning pattern corresponding to the replacement element, and complete the embedding of secret information; where the replacement element is element T in the replacement set.
[0009] Furthermore, the two-dimensional array graph of encoding unit A is divided into polygons to obtain the coverage area of each polygon, including:
[0010] Based on the embedding capacity requirements of the secret information, determine the number of elements E that the polygon needs to cover and the polygon size;
[0011] Based on the number of elements E that the polygons need to cover and the polygon size, the two-dimensional array graph of encoding unit A is divided into polygons to obtain the coverage area of each polygon. During the polygon division process, the horizontal edges of the polygons are distributed along the center of their respective rows, the vertical edges of the polygons are distributed along the center of their respective columns, and the diagonal edges of the polygons are distributed along the diagonal of the area corresponding to the covered element. Adjacent polygons share the same edge. If a complete polygon cannot be drawn between the boundary of the two-dimensional array graph and the nearest polygon, and there are at least one column / row of elements, an incomplete polygon is drawn between the boundary of the two-dimensional array graph and the nearest polygon. The coverage area includes the elements E located within the polygon and the elements E that the polygon edges pass through.
[0012] Furthermore, based on the embedding capacity requirements of the secret information, the number of elements E that the polygon needs to cover and the polygon size are determined, including:
[0013] Calculate the number of elements E that the polygon needs to cover based on the embedding capacity requirements of the secret information;
[0014] Calculate the polygon size based on the number of elements E that the polygon needs to cover;
[0015] The formula for calculating the number of elements E, num, that the polygon needs to cover is: num = 2 ω ω represents the number of bits of the secret information; the relationship between the polygon size and num is: num = m × n - 4 × k (k + 1) / 2, where m, n and k are the length, width and horizontal offset of the hypotenuse of the polygon, respectively.
[0016] Furthermore, the range of values assigned to the two-dimensional array of encoding unit A is [0, num-1];
[0017] The rules for assigning values to the two-dimensional array of encoding unit A are as follows:
[0018] Rule 1: Assign any integer in the range [0, num-1] to the first element a of the two-dimensional array. 0,0 ;
[0019] Rule 2: Elements E in the same row are determined by a. x+1,y =(a x,y +1)mod(num) is assigned a value; where a x,y Let E be the element in the (x+1)th row and (y+1)th column, and a x+1,yLet E be the element in the (x+2)th row and (y+1)th column, and mod represents the remainder.
[0020] Rule 3: Elements E in the same column are determined by a. x,y+1 =(a x,y +d y The mod(num) function assigns a value; where a x,y+1 Let E be the element in the (x+1)th row and (y+2)th column; if k > (n-2) / 2, then the parameter d y =m-1, If k≤(n-2) / 2, the parameter .
[0021] Furthermore, based on the covering domain and the positional relationship between element S and the covering domain, a replacement set for element S is selected from the assigned two-dimensional array, including:
[0022] If element S is located within the covering domain F1, and an element E with the same base conversion value is found within the covering domain F1, the found element E is used to construct the replacement set.
[0023] If element S is located within the covering domain F1, and no element E with the same base conversion value can be found within the covering domain F1, search for element E with the same base conversion value in the entire two-dimensional array, and construct a replacement set using the found element E.
[0024] If element S is located in both adjacent covering domains F1 and F2, and an element E with the same base conversion value is found in covering domains F1 and / or F2, the found element E is used to construct a replacement set.
[0025] If element S is located in both adjacent covering domains F1 and F2, and no element E with the same base conversion value can be found in covering domains F1 and F2, search for element E with the same base conversion value in the entire two-dimensional array, and construct a replacement set using the found element E.
[0026] If element S is not located within any covering region, search for element E in the entire two-dimensional array that is equal to the base conversion value, and construct a replacement set using the found element E.
[0027] Furthermore, the element to be replaced is the element T with the smallest distance, and the distance is calculated using the following formula:
[0028] ;
[0029] In the formula, For a x1,y1 and The distance, a x1,y1 The element T in the replacement set of row x1+1 and column y1+1 is... For elements S and ps and p s+1 Here, λ represents the row and column number of element S, respectively, and λ is a penalty constant. The penalty constant is used to ensure that the distance corresponding to all partitioning patterns of element S is greater than the distance corresponding to a single partitioning pattern change. Z1 and Z2 are both constants. .
[0030] According to another aspect of this application, an apparatus for embedding secret information into a video is provided, comprising:
[0031] The video is divided into coding units and prediction units. The partitioning patterns of adjacent prediction units in the coding units are converted into row and column numbers of a two-dimensional array, and a two-dimensional array of coding units is constructed.
[0032] The assignment and coverage module determines the encoding unit A for embedding secret information based on the embedding capacity requirements of the secret information, divides the two-dimensional array graph of encoding unit A into polygons to obtain the coverage of each polygon, and assigns values to the two-dimensional array of encoding unit A; wherein, the coverage of a polygon is the element E corresponding to the polygon's coverage area; element E is an element in the two-dimensional array; the polygon size is obtained according to the embedding capacity requirements.
[0033] The filtering module converts the number system of the secret information to the range of the two-dimensional array assignment. Based on the coverage area and the positional relationship between element S and the coverage area, it filters out the replacement set of element S from the assigned two-dimensional array. Here, element S is the element in the two-dimensional array corresponding to the adjacent prediction unit in the encoding unit A that embeds the secret information. The element T in the replacement set is element E that is equal to the number system conversion value.
[0034] The embedding module determines the replacement element of element S based on the distance between element S and each element T, and replaces the partitioning pattern corresponding to element S with the partitioning pattern corresponding to the replacement element to complete the embedding of secret information; wherein, the replacement element is element T in the replacement set.
[0035] According to another aspect of this application, a video steganography method is provided, including the method of embedding the aforementioned secret information into a video.
[0036] According to another aspect of this application, a computer-readable storage medium is provided that stores one or more programs, the one or more programs including instructions that, when executed by a computing device, cause the computing device to perform a method for embedding secret information into a video or a video steganography method.
[0037] According to another aspect of this application, a computer device is provided, including one or more processors and one or more memories, one or more programs stored in the one or more memories and configured to be executed by the one or more processors, the one or more programs including instructions for performing a method of embedding secret information into video or a video steganography method.
[0038] The beneficial effects achieved by this invention are as follows: This invention converts the partitioning patterns of adjacent prediction units into row and column numbers of a two-dimensional array, constructs a two-dimensional array of coding units, thereby extending the original one-dimensional representation to a structured two-dimensional embedding space. This significantly increases the number of candidate states available for each embedding operation, laying the foundation for high-capacity embedding. By introducing polygon partitioning, region-based encoding rather than point-based mapping is achieved, greatly improving the expressive power of the prediction unit partitioning patterns. This allows for the embedding of more secret information with limited structural modifications. By filtering the replacement set of element S based on the positional relationship between element S and the coverage area, the replacement element of element S is determined based on distance and the replacement is performed to complete the embedding of secret information. This can more accurately simulate the distortion cost caused by different modification directions and structural perturbations, ensuring that the candidate replacement elements remain within an acceptable distortion range. This can enforce the principle of minimum distortion and effectively maintain visual quality. Attached Figure Description
[0039] Figure 1 is a flowchart of a method for embedding secret information into video;
[0040] Figure 2 shows an example of polygon partitioning;
[0041] Figure 3 shows an example of embedding secret information in an 8×8 coding unit;
[0042] Figure 4 shows an example of embedding secret information in a 16×16 coding unit;
[0043] Figure 5 is a block diagram of a device for embedding secret information into video. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this application or its application or use. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0045] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of this application.
[0046] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.
[0047] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0048] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0049] It should be noted that similar symbols and letters in the accompanying drawings represent similar items; therefore, once an item is defined in one accompanying drawing, it does not need to be discussed further in subsequent accompanying drawings.
[0050] Referring to Figure 1, which is a flowchart of a method for embedding secret information into video according to an embodiment of this application, the method can be executed by a hidden end, which can be a terminal device or a server. The terminal device can include, but is not limited to, mobile phones, computers, etc., as described in this embodiment. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, big data, and artificial intelligence platforms, etc., as described in this embodiment. Optionally, the method can also be executed collaboratively by multiple electronic devices with computing power. For ease of explanation, subsequent embodiments will be described as being executed by a hidden end.
[0051] The method for embedding secret information into video, as shown in Figure 1, may include at least the following steps:
[0052] Step 1: Segment the video into coding units, divide the coding units into prediction units, and convert the partitioning patterns of adjacent prediction units in the coding units into row and column numbers of a two-dimensional array to construct a two-dimensional array of coding units.
[0053] It should be noted that the video is a carrier of confidential information, and the video can be encoded in H.265 / HEVC (High Efficiency Video Coding) format, with a resolution of any size from 416×240 to 2560×1600.
[0054] Each frame of a video can be divided into coding units of different sizes according to the coding standard. Each coding unit can be further divided into prediction units. Each prediction unit corresponds to a partitioning mode. A mapping value can be preset for each partitioning mode. The mapping value can be an integer value. Different partitioning modes in the same coding unit have different mapping values.
[0055] For example, after segmentation, the coding unit contains only 8×8 coding units and 16×16 coding units. These two sizes of coding units are evenly distributed throughout the video frame, providing a stable carrier for subsequent selection of prediction unit partitioning modes and secret information embedding operations. The partitioning modes for prediction units in an 8×8 coding unit mainly include four modes: 2N×2N, 2N×N, N×2N, and N×N. The partitioning modes for prediction units in a 16×16 coding unit mainly include seven modes: 2N×2N, 2N×N, N×2N, 2N×nN, 2N×nD, nL×2N, and nR×2N.
[0056] To facilitate the construction of two-dimensional arrays, the mapping values for the four patterns 2N×2N, 2N×N, N×2N, and N×N can be 0, 1, 2, and 3 respectively; the mapping values for the seven patterns 2N×2N, 2N×N, N×2N, 2N×nN, 2N×nD, nL×2N, and nR×2N can be 0, 1, 2, 3, 4, 5, and 6 respectively. Using the mapping values as row and column numbers, an 8×8 coding unit can construct a 4×4 two-dimensional array, and a 16×16 coding unit can construct a 7×7 two-dimensional array, with both row and column numbers starting from 0. Of course, if the mapping values start from 1, then the corresponding row and column numbers of the two-dimensional array can also start from 1.
[0057] The primary purpose of constructing a two-dimensional array is to enhance the expressive power of prediction unit partitioning patterns, enabling the embedding of more secret information with fewer modifications to the coding structure. By mapping the partitioning patterns of two adjacent prediction units to a two-dimensional embedding space, the originally limited one-dimensional representation is expanded into a structured two-dimensional embedding space, thereby significantly improving the embedding capacity without significantly increasing the amount of modification. At the same time, the two-dimensional structure makes adjacent coordinates correspond to local and small modifications to the prediction unit partitioning patterns, which helps to minimize the perturbation to the original coding structure while ensuring the number of embedded bits. In addition, this two-dimensional array structure provides natural support for subsequent polygonal region coding and distance constraint optimization, enabling capacity improvement and distortion control to be achieved within a unified framework.
[0058] Step 2: Based on the embedding capacity requirements of the secret information, determine the encoding unit A for embedding the secret information, divide the two-dimensional array graph of encoding unit A into polygons, obtain the coverage area of each polygon, and assign values to the two-dimensional array of encoding unit A; wherein, the coverage area of the polygon is the element E corresponding to the polygon coverage area; element E is an element in the two-dimensional array; the polygon size is obtained according to the embedding capacity requirements.
[0059] It should be noted that the secret information can be binary data such as text or code. In order to meet the embedding capacity requirements while minimizing modifications to the original encoding structure, the encoding unit can be adaptively selected based on the number of bits of the secret information to be embedded. For example, when the length of the secret information to be embedded is no more than 3 bits (i.e., the decimal range is [0,7]), an 8×8 encoding unit is used for embedding. The polygonal encoding structure corresponding to this encoding unit can represent 8 different decimal states, thus meeting the embedding requirements with minimal modification cost. When the length of the secret information is 4 to 5 bits (i.e., the decimal range is [0,31]), a 16×16 encoding unit is selected for embedding because it can represent 32 decimal states, and 5 bits of information can be hidden in one embedding operation.
[0060] In some embodiments, the process of obtaining the coverage area of each polygon may include:
[0061] 21) Based on the embedding capacity requirements of the secret information, determine the number of elements E that the polygon needs to cover and the polygon size.
[0062] Specifically, based on the embedding capacity requirements of the secret information, the parameter ω can be determined, where ω is the number of bits in the secret information. If the secret information is binary, then ω is the number of bits in the binary secret information. Furthermore, the number of elements E that the polygon needs to cover can be calculated, which can be expressed by the formula: num=2 ω =m×n-4×k(k+1) / 2, where ω takes values of {3, 5}. Different ω correspond to different polygon sizes and also determine the number of covered elements E. m, n, and k are the length, width, and horizontal offset of the polygon, respectively.
[0063] For example, when ω=3, it means embedding 3 bits of binary secret information at a time. The polygon size in the corresponding embedding scheme is m=4, n=3, k=1, which can cover 8 elements. When ω=5, it means embedding 5 bits of binary secret information at a time. The polygon size in the corresponding embedding scheme is m=6, n=6, k=1, which can cover 32 elements.
[0064] 22) Based on the number of elements E that the polygon needs to cover and the size of the polygon, the two-dimensional array graph of the encoding unit A is divided into polygons to obtain the coverage area of each polygon; wherein, during the polygon division process, the horizontal edge of the polygon is distributed along the center of the row, the vertical edge of the polygon is distributed along the center of the column, and the diagonal edge of the polygon is distributed along the diagonal of the area corresponding to the covered element. Adjacent polygons share the same edge; if a complete polygon cannot be drawn between the boundary of the two-dimensional array graph and the nearest polygon, and there is at least one column / row element, an incomplete polygon is drawn between the boundary of the two-dimensional array graph and the nearest polygon; the coverage area includes the elements E located inside the polygon and the elements E that the polygon edge passes through.
[0065] Assuming that num is 32 as calculated from 21), and using m=6, n=6, and k=1 as the polygon dimensions, the division result is shown in Figure 2. The green borders in Figure 2 represent polygons, and two complete octagons (i.e., the two green border shapes at the top of Figure 2) and two incomplete octagons (i.e., the two green border shapes at the bottom of Figure 2) can be drawn. The yellow area represents the element E covered by all polygons, where a 1,0 ~a 4,0 a 0,1 ~a 5,1 a 0,2 ~a 5,2 a 0,3 ~a 5,3 a 0,4 ~a 5,4 a 1,5 ~a 4,5 For the element a in the coverage region of the polygon on the upper left in Figure 2, a 6,0 ~a 9,0 a 5,1 ~a 10,1 a 5,2 ~a 10,2 a 5,3 ~a 10,3 a 5,4 ~a 10,4 a 6,5 ~a 9,5 For the element a in the coverage area of the polygon on the upper right in Figure 2, a 1,5 ~a 4,5 a 0,6 ~a 5,6 For the element a in the coverage area of the polygon on the lower left in Figure 2, a 6,5 ~a 9,5 a 5,6 ~a 10,6Let S be an element within the coverage area of the polygon on the lower right side of Figure 2. After the above division, the specific replacement set can be determined based on the position of element S relative to the polygon coverage area. In the subsequent process of embedding and searching for replacement elements, the search only needs to be performed within the corresponding replacement set, and only in rare cases is it extended to search the entire two-dimensional array. This significantly improves the embedding efficiency of the scheme and reduces the time complexity.
[0066] To establish a deterministic mapping between the encoded state and the secret information, enabling reversible embedding and reliable extraction, each two-dimensional array needs to be assigned a value. Since each combination of partitioning patterns corresponds to a different encoding structure, the assignment must be unique to avoid decoding ambiguity. Therefore, in some embodiments, the rules for assigning values to the two-dimensional array of encoding unit A can be as follows:
[0067] Rule 1: Assign any integer in the range [0, num-1] to the first element a of the two-dimensional array. 0,0 ;
[0068] Rule 2: Elements E in the same row are determined by a. x+1,y =(a x,y +1)mod(num) is assigned a value; where a x,y Let E be the element in the (x+1)th row and (y+1)th column, and a x+1,y Let E be the element in the (x+2)th row and (y+1)th column, and mod represents the remainder.
[0069] Rule 3: Elements E in the same column are determined by a. x,y+1 =(a x,y +d y The mod(num) function assigns a value; where a x,y+1 Let E be the element in the (x+1)th row and (y+2)th column; if k > (n-2) / 2, then the parameter d y =m-1, If k≤(n-2) / 2, the parameter .
[0070] Using the above rules, each element (i.e., element E) in the two-dimensional array can represent 0 to... Different integers between them. Secret information is embedded in the partitioning pattern of adjacent prediction units, mapped to row and column numbers, such as x and y, and then passed through the corresponding element a. x,y It indicates secret information.
[0071] The above assignment rules are designed to establish a deterministic and reversible mapping relationship between two-dimensional arrays and one-dimensional secret symbol space, thereby ensuring the reliability and simplicity of the embedding and extraction processes. Simultaneously, ensuring that all two-dimensional arrays are continuously mapped to the interval [0, num-1] allows for full utilization of the embedding space, and the continuous integer numbering format facilitates subsequent binary conversion and embedding processes, achieving simplicity and stability in the encoding and decoding process. Furthermore, the assignment rules maintain consistency in spatial and numerical proximity to a certain extent, helping to reduce the degree of encoding modification when embedding adjacent secret symbols.
[0072] Step 3: Convert the number system of the secret information to the range of the two-dimensional array assignment. Based on the coverage area and the positional relationship between element S and the coverage area, select the replacement set of element S from the assigned two-dimensional array. Here, element S is the element in the two-dimensional array corresponding to the adjacent prediction unit in the coding unit A that embeds the secret information. The element T in the replacement set is element E that is equal to the number system conversion value.
[0073] It should be noted that converting the number system of secret information to the range of values assigned to a two-dimensional array can specifically be done by converting binary secret information to decimal, for example, converting binary secret information 00110 to the decimal value 6.
[0074] In some embodiments, the process of filtering out the replacement set of element S may include:
[0075] If element S is located within the covering domain F1, and an element E with the same base conversion value is found within the covering domain F1, the found element E is used to construct the replacement set.
[0076] If element S is located within the covering domain F1, and no element E with the same base conversion value can be found within the covering domain F1, search for element E with the same base conversion value in the entire two-dimensional array, and construct a replacement set using the found element E.
[0077] If element S is located in both adjacent covering domains F1 and F2, and an element E with the same base conversion value is found in covering domains F1 and / or F2, the found element E is used to construct a replacement set.
[0078] If element S is located in both adjacent covering domains F1 and F2, and no element E with the same base conversion value can be found in covering domains F1 and F2, search for element E with the same base conversion value in the entire two-dimensional array, and construct a replacement set using the found element E.
[0079] If element S is not located within any covering region, search for element E in the entire two-dimensional array that is equal to the base conversion value, and construct a replacement set using the found element E.
[0080] Figure 3 illustrates the process of determining the replacement set. The left side of the dashed line in Figure 3 shows the diagram after polygon partitioning, and the right side shows the assigned two-dimensional array. Assume that secret information is embedded in an 8×8 coding unit, the decimal value of the secret information is 6, and the element S is a. 1,1 The element is located within the complete hexagonal frame (i.e., within the area covered by the hexagonal frame, specifically the yellow and blue regions). Within this area, an element with a value of 6 can be found, namely 'a'. 3,1 Then a 3,1 This forms a replacement set; assuming element S is a 1,3 The element 'a' is located within the incomplete hexagonal frame (specifically, within the gray and blue areas covered by the incomplete hexagonal frame). Since no element with a value of 6 can be found within the covered area of the incomplete hexagonal frame, the search will proceed through the entire two-dimensional array, yielding element 'a'. 3,1 and element a 0,2 , element a 3,1 and element a 0,2 This forms a replacement set; assuming element S is a 0,0 If the element is not located within a complete or incomplete hexagonal frame, then the search will be performed throughout the entire two-dimensional array to obtain element 'a'. 3,1 and element a 0,2 , element a 3,1 and element a 0,2 This forms the replacement set; element S is a 1,2 Element 'a' lies within both the incomplete hexagonal frame and the complete hexagonal frame (i.e., the blue area). Searching within these two areas (specifically the yellow, gray, and blue areas) yields the element 'a'. 31 Then a 31 This constitutes the replacement set.
[0081] The above filtering method does not exhaustively search the entire two-dimensional embedding space, but rather adaptively restricts the search space to polygons. In most cases, the search range only covers the area of one or two adjacent polygons, rarely extending to the entire space, thus significantly improving efficiency.
[0082] Step 4: Based on the distance between element S and each element T, determine the replacement element of element S, and replace the partitioning pattern corresponding to element S with the partitioning pattern corresponding to the replacement element to complete the embedding of secret information; wherein, the replacement element is element T in the replacement set.
[0083] It's worth noting that the Manhattan distance is highly compatible with the characteristics of two-dimensional arrays, as embedding modifications typically occur independently along the horizontal and vertical directions. Compared to other distance calculation methods, the Manhattan distance can characterize the degree of distortion or offset in a simple, linear way, while avoiding nonlinear operations such as square root calculations. It has lower computational complexity and is suitable for use in large-scale candidate search and rate-distortion optimization.
[0084] Traditional Manhattan distance measures distance by summing the absolute differences across all dimensions. However, in some cases, it may classify a small change in multiple dimensions simultaneously as a closer distance than a large change in a single dimension. In actual video coding and information embedding, however, it is generally preferred to choose schemes that modify fewer elements or fewer dimensions (because such modifications cause less disturbance to the original structure and have a more controllable impact on bitrate and visual quality). Therefore, in some embodiments, an improved Manhattan distance is used. This improved Manhattan distance adds a penalty constant to the traditional Manhattan distance. The penalty constant ensures that the distance corresponding to all changes in the partitioning patterns of element S is greater than the distance corresponding to a change in only one partitioning pattern, thereby minimizing modifications to the original partitioning patterns and reducing the loss of video quality and increase in bitrate caused by the modifications.
[0085] The improved Manhattan distance formula can be expressed as:
[0086] ;
[0087] In the formula, For a x1,y1 and The distance, a x1,y1 The element T in the replacement set of row x1+1 and column y1+1 is... For elements S and p s and p s+1 Let be the row number and column number of element S, respectively, and λ be the penalty constant. Z1 and Z2 are both constants. For example, Z1 is 100 and Z2 is 0.
[0088] Find the element T with the smallest distance in the replacement set, and use this element as the replacement element. Then, replace the partitioning pattern corresponding to element S with the partitioning pattern corresponding to the replacement element. The secret information is embedded by modifying the partitioning pattern.
[0089] To further illustrate the above method, let's assume that the capacity requirements for secret information are determined by parameters. =5, corresponding to =32, corresponding to a 16×16 encoding unit, the secret information decimal value is 6, the polygon size is m=6, n=6, k=1, the polygon partitioning and two-dimensional array assignment results can be seen in Figure 4, assuming element S is a 0,0 If the element 'a' is located outside all covered regions, then the element 'a' can be found in the entire two-dimensional array. 6,0 a 1,1 a 5,6 Construct a replacement set, and obtain element a based on the improved Manhattan distance.6,0 As a replacement element, a 6,0 The corresponding partitioning patterns are nR×2N and 2N×2N, where a 0,0 The original partitioning patterns (both 2N×2N) are modified to nR×2N and 2N×2N to complete the embedding of secret information and generate a secret video.
[0090] The aforementioned method addresses the issues of insufficient embedding capacity and degraded visual quality through a series of collaborative mechanisms, including 2D array construction, polygon encoding, improved Manhattan distance constraints, and adaptive encoding unit selection. Its basic principles are as follows: First, the partitioning patterns of adjacent prediction units are converted into row and column numbers of a 2D array, constructing a 2D array of encoding units. This extends the original one-dimensional representation to a structured 2D embedding space, significantly increasing the number of candidate states available for each embedding operation and laying the foundation for high-capacity embedding. Second, polygon partitioning is introduced to achieve region-based encoding rather than point-based mapping, greatly improving the expressive power of the prediction unit partitioning patterns, thus allowing for the embedding of more secret information with limited structural modifications. Third, the size of the encoding units is adaptively selected according to the embedding capacity requirements (e.g., using 8×8 encoding units to embed three bits of binary information, while using 16×16 encoding units to embed up to five bits of binary information). This avoids repetitive embedding operations and minimizes redundant modifications under high payload requirements. Fourth, by filtering the replacement set of element S based on its positional relationship with the coverage region, the distortion cost caused by different modification directions and structural perturbations can be simulated more accurately, ensuring that candidate replacement elements remain within an acceptable distortion range. The replacement elements of element S are determined based on the improved Manhattan distance, and the replacements are performed to complete the embedding of secret information. This process further simulates the distortion cost caused by different modification directions and structural perturbations, ensuring that candidate replacement elements remain within an acceptable distortion range, thereby enforcing the principle of minimum distortion and effectively maintaining visual quality. Through these steps, the proposed method achieves an excellent balance between embedding capacity and visual quality.
[0091] Referring to Figure 5, which is a block diagram of a device for embedding secret information into video according to an embodiment of this application, the device is a virtual device that can be loaded and executed by a hidden terminal. The device in Figure 5 may include a partitioning and construction module, an assignment and overlay module, a filtering module, and an embedding module. When used to execute the above method, it can:
[0092] The video is divided into coding units and prediction units. The partitioning patterns of adjacent prediction units in the coding units are converted into row and column numbers of a two-dimensional array, and a two-dimensional array of coding units is constructed.
[0093] The assignment and coverage module determines the encoding unit A for embedding secret information based on the embedding capacity requirements of the secret information, divides the two-dimensional array graph of encoding unit A into polygons, obtains the coverage of each polygon, and assigns values to the two-dimensional array of encoding unit A; wherein, the coverage of the polygon is the element E corresponding to the polygon coverage area; element E is an element in the two-dimensional array; the polygon size is obtained according to the embedding capacity requirements.
[0094] The filtering module converts the number system of the secret information to the range of the two-dimensional array assignment. Based on the coverage area and the positional relationship between element S and the coverage area, it filters out the replacement set of element S from the assigned two-dimensional array. Here, element S is the element in the two-dimensional array corresponding to the adjacent prediction unit in the encoding unit A that embeds the secret information. The element T in the replacement set is element E that is equal to the number system conversion value.
[0095] The embedding module determines the replacement element of element S based on the distance between element S and each element T, and replaces the partitioning pattern corresponding to element S with the partitioning pattern corresponding to the replacement element to complete the embedding of secret information; wherein, the replacement element is element T in the replacement set.
[0096] The aforementioned device converts the partitioning patterns of adjacent prediction units into row and column numbers of a two-dimensional array, constructing a two-dimensional array of coding units. This extends the original one-dimensional representation to a structured two-dimensional embedding space, significantly increasing the number of candidate states available for each embedding operation and laying the foundation for high-capacity embedding. By introducing polygon partitioning, region-based encoding rather than point-based mapping is achieved, greatly improving the expressive power of the prediction unit partitioning patterns. This allows for the embedding of more secret information with limited structural modifications. By analyzing the positional relationship between element S and the coverage area, a replacement set for element S is selected. The replacement element for element S is determined based on distance and the replacement is performed to complete the embedding of secret information. This device can more accurately simulate the distortion costs caused by different modification directions and structural perturbations, ensuring that candidate replacement elements remain within an acceptable distortion range. This enforces the principle of minimum distortion and effectively maintains visual quality.
[0097] This application also relates to a video steganography method, which is implemented by a hiding end and an extraction end working together; wherein, the hiding end generates a coded video using the above-mentioned method of embedding secret information into the video, and the extraction end decodes the coded video to extract the secret information.
[0098] It should be noted that the extraction process is the reverse of the hiding process. Specifically, it can be as follows: decode the cryptic video, extract the partitioning pattern of adjacent prediction units, convert the extracted prediction unit partitioning pattern into the corresponding row and column numbers according to the mapping relationship of the hiding end (i.e., the partitioning pattern corresponds to a mapping value), obtain the cryptic element, query the value corresponding to the cryptic element according to the same polygon encoding rules as the hiding end, convert the value into binary data, and restore the secret information.
[0099] For example, referring to Figure 4, for a 16×16 coding unit, the current partitioning pattern of the two corresponding prediction units is (2N×2N, 2N×2N), which is mapped to (0, 0) just like the steganographic end, corresponding to a on the left side of Figure 4. 0,0 Then, referring to the right side of Figure 4, we can obtain a. 0,0 The corresponding decimal secret information is "0". Since the hiding end reads 5 bits of binary secret information and converts it to decimal when embedding the secret information in the 16×16 encoding unit, when the extraction end obtains the decimal secret information "0", it needs to be reversed and converted into 5 bits of binary secret information "00000" to complete the extraction of the secret information.
[0100] The above method can solve the problems of limited embedding capacity, insufficient compatibility and practicality, and provides a new approach to video steganography. It has good application prospects in covert communication and can be applied to fields such as privacy protection and secure communication, digital rights protection and traceability.
[0101] This application also relates to a computer-readable storage medium that stores one or more programs, the one or more programs including instructions that, when executed by a computing device, cause the computing device to perform a method for embedding secret information into a video or a video steganography method.
[0102] This application also relates to a computer device including one or more processors and one or more memories, wherein one or more programs are stored in the one or more memories and configured to be executed by the one or more processors, and the one or more programs include instructions for performing a method for embedding secret information into video or a video steganography method.
[0103] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0104] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0105] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0106] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0107] The above are merely embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of the claims of the present invention pending approval.
Claims
1. A method for embedding secret information into video, characterized in that, include: The video is segmented into coding units, and each coding unit is further divided into prediction units. The segmentation patterns of adjacent prediction units within a coding unit are converted into row and column numbers of a two-dimensional array, constructing a two-dimensional array of coding units. Based on the embedding capacity requirements of the secret information, the coding unit A for embedding the secret information and the number of elements E that the polygon needs to cover are determined. Based on the number of elements E that the polygon needs to cover, the polygon size is calculated. Based on the number of elements E that the polygon needs to cover and the polygon size, the two-dimensional array of coding unit A is divided into polygons to obtain the coverage area of each polygon. The two-dimensional array of coding unit A is then assigned values; where element E is an element in the two-dimensional array. The formula for calculating the number of elements E num that the polygon needs to cover is: num = 2. ω ω represents the number of bits of the secret information. The relationship between the polygon size and num is: num = m × n - 4 × k(k + 1) / 2, where m, n, and k are the length, width, and horizontal offset of the hypotenuse of the polygon, respectively. During the polygon partitioning process, the horizontal edges of the polygon are distributed along the center of the row, the vertical edges are distributed along the center of the column, and the hypotenuses are distributed along the diagonal of the area corresponding to the covered element. Adjacent polygons share the same edge. If a complete polygon cannot be drawn between the boundary of the two-dimensional array graph and the nearest polygon, and there is at least one column / row element, an incomplete polygon is drawn between the boundary of the two-dimensional array graph and the nearest polygon. The coverage area includes the element E located inside the polygon and the element E passed through by the edge of the polygon. The assignment range of the two-dimensional array of encoding unit A is [0, num - 1]. The rule for assigning values to the two-dimensional array of encoding unit A is: Rule 1: Assign any integer in the range [0, num - 1] to the first element a of the two-dimensional array. 0,0 Rule 2: Elements E in the same row are determined by a. x+1,y =(a x,y +1)mod(num) assignment, a x,y Let E be the element in the (x+1)th row and (y+1)th column, and a x+1,y Let E be the element in the (x+2)th row and (y+1)th column, where mod represents the remainder; Rule 3: Elements E in the same column are determined by a x,y+1 =(a x,y +d y The mod(num) method assigns a value to a. x,y+1 Let E be the element in the (x+1)th row and (y+2)th column; if k > (n-2) / 2, then the parameter d y =m-1, If k≤(n-2) / 2, the parameter The secret information is converted to its base within the range of the assigned two-dimensional array. Based on the coverage area and the positional relationship between element S and the coverage area, a replacement set for element S is selected from the assigned two-dimensional array. Element S is an element in the two-dimensional array corresponding to the adjacent prediction unit containing the secret information in coding unit A. Element T in the replacement set is element E with the same base conversion value. The process of selecting the replacement set for element S from the assigned two-dimensional array based on the coverage area and the positional relationship between element S and the coverage area includes: if element S is located within the coverage area F1 and an element E with the same base conversion value is found within the coverage area F1, the replacement set is constructed using the found element E; if element S is located within the coverage area F1 and an element E with the same base conversion value is not found within the coverage area F1, an element E with the same base conversion value is searched throughout the entire two-dimensional array, and the replacement set is constructed using the found element E. If element S is located in both adjacent covering domains F1 and F2, and an element E with the same base conversion value is found in both covering domains F1 and / or F2, the found element E is used to construct a replacement set. If element S is located in both adjacent covering domains F1 and F2, and an element E with the same base conversion value is not found in either covering domain, an element E with the same base conversion value is searched in the entire two-dimensional array, and the found element E is used to construct a replacement set. If element S is not located in any covering domain, an element E with the same base conversion value is searched in the entire two-dimensional array, and the found element E is used to construct a replacement set. Based on the distance between element S and each element T, the replacement element of element S is determined, and the partitioning pattern corresponding to element S is replaced with the partitioning pattern corresponding to the replacement element to complete the embedding of secret information. The replacement element is element T in the replacement set.
2. The method according to claim 1, characterized in that, The element to be replaced is the element T with the smallest distance. The distance is calculated using the following formula: In the formula, For a x1,y1 and The distance, a x1,y1 The element T in the replacement set of row x1+1 and column y1+1 is... For elements S and p s and p s+1 Here, λ represents the row and column number of element S, respectively, and λ is a penalty constant. The penalty constant is used to ensure that the distance corresponding to all partitioning patterns of element S is greater than the distance corresponding to a single partitioning pattern change. Z1 and Z2 are both constants. 。 3. A device for embedding secret information into video, characterized in that, include: The segmentation and construction module divides the video into coding units (CUs), then further divides each CU into prediction units (RFUs). It converts the segmentation patterns of adjacent RFUs within a CU into row and column numbers of a two-dimensional array, constructing the CU's 2D array. The assignment and coverage module determines the CUA for embedding secret information based on the required embedding capacity and calculates the number of elements E that the polygon needs to cover. Based on the number of elements E to be covered, it calculates the polygon size. Then, based on the number of elements E to be covered and the polygon size, it divides the 2D array of CUA into polygons, obtaining the coverage area of each polygon. Finally, it assigns values to the 2D array of CUA. Here, element E is an element in the 2D array. The formula for calculating the number of elements E (num) that the polygon needs to cover is: num = 2. ω ω represents the number of bits of the secret information. The relationship between the polygon size and num is: num = m × n - 4 × k(k + 1) / 2, where m, n, and k are the length, width, and horizontal offset of the hypotenuse of the polygon, respectively. During the polygon partitioning process, the horizontal edges of the polygon are distributed along the center of the row, the vertical edges are distributed along the center of the column, and the hypotenuses are distributed along the diagonal of the area corresponding to the covered element. Adjacent polygons share the same edge. If a complete polygon cannot be drawn between the boundary of the two-dimensional array graph and the nearest polygon, and there is at least one column / row element, an incomplete polygon is drawn between the boundary of the two-dimensional array graph and the nearest polygon. The coverage area includes the element E located inside the polygon and the element E passed through by the edge of the polygon. The assignment range of the two-dimensional array of encoding unit A is [0, num - 1]. The rule for assigning values to the two-dimensional array of encoding unit A is: Rule 1: Assign any integer in the range [0, num - 1] to the first element a of the two-dimensional array. 0,0 Rule 2: Elements E in the same row are determined by a. x+1,y =(a x,y +1)mod(num) assignment, a x,y Let E be the element in the (x+1)th row and (y+1)th column, and a x+1,y Let E be the element in the (x+2)th row and (y+1)th column, where mod represents the remainder; Rule 3: Elements E in the same column are determined by a x,y+1 =(a x,y +d y The mod(num) method assigns a value to a. x,y+1 Let E be the element in the (x+1)th row and (y+2)th column; if k > (n-2) / 2, then the parameter d y =m-1, If k≤(n-2) / 2, the parameter The filtering module converts the radix of the secret information to the range of the assigned two-dimensional array. Based on the coverage area and the positional relationship between element S and the coverage area, it filters out the replacement set of element S from the assigned two-dimensional array. Element S is an element in the two-dimensional array corresponding to the adjacent prediction unit in encoding unit A that embeds the secret information. Element T in the replacement set is element E with the same radix conversion value. The filtering module filters out the replacement set of element S from the assigned two-dimensional array based on the coverage area and the positional relationship between element S and the coverage area, including: if element S is located within the coverage area F1 and an element E with the same radix conversion value is found within the coverage area F1, the found element E is used to construct the replacement set; if element S is located within the coverage area F1 and an element E with the same radix conversion value is not found within the coverage area F1, an element E with the same radix conversion value is searched for in the entire two-dimensional array, and the found element E is used to construct the replacement set. Replacement set; if element S is simultaneously located in adjacent covering domains F1 and F2, and an element E with the same base conversion value is found in covering domains F1 and / or F2, the found element E is used to construct the replacement set; if element S is simultaneously located in adjacent covering domains F1 and F2, and an element E with the same base conversion value is not found in covering domains F1 and F2, an element E with the same base conversion value is searched in the entire two-dimensional array, and the found element E is used to construct the replacement set; if element S is not located in any covering domain, an element E with the same base conversion value is searched in the entire two-dimensional array, and the found element E is used to construct the replacement set; Embedding module, based on the distance between element S and each element T, determines the replacement element of element S, replaces the partitioning pattern corresponding to element S with the partitioning pattern corresponding to the replacement element, and completes the embedding of secret information; where the replacement element is element T in the replacement set.
4. A video steganography method, characterized in that, Includes the method described in any one of claims 1 to 2.
5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, the one or more programs including instructions that, when executed by a computing device, cause the computing device to perform the method of any one of claims 1 to 2, 4.
6. A computer device, characterized in that, include: One or more processors and one or more memories, one or more programs stored in one or more memories and configured to be executed by one or more processors, the one or more programs including instructions for performing the method of any one of claims 1 to 2, 4.
Citation Information
Patent Citations
Block size self-adaptive video steganography method
CN111212284A
Method and system for hiding reversible information of dual-channel audio based on two-dimensional histogram
CN113077801A