Data shaping method and apparatus
By using a status flag array and detection window traversal technology, the problem of strict data format requirements in the video data compression module was solved, enabling adaptive shaping for different data output formats and improving data compression efficiency and storage resource utilization.
Patent Information
- Application Number
- CN202511563572.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-10-30
AI Technical Summary
In existing technologies, video data compression modules have strict requirements on data formats, which means that preceding modules must output video data in a specific format. This makes it impossible to adapt to different data output formats, affecting data compression efficiency and storage resource consumption.
The status flag array determines whether the received pixel data has been compressed to a certain granularity, enabling adaptive shaping for different data output formats. The video data is then output according to the requirements of the compression module, including updating the status flag array in bitmap or pixel group form and traversing the detection window.
The data shaping scheme improves its adaptability to different data output formats, reduces constraints on the data output formats of preceding modules, reduces bandwidth and storage resource consumption, and achieves reliable data compression.
Smart Images

Figure CN121037523B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data shaping method and apparatus. Background Technology
[0002] To reduce the consumption of system storage resources, video data needs to be input into a compression module before being stored in the system storage space. The compression module compresses the video data to reduce its size. However, the compression module can usually only compress data according to a fixed format. When the input data format does not match the requirements of the compression module, the compression module will not be able to compress the data properly. For example, if the compression module compresses data in macroblock format, and the data is input into the compression module in pixel row format, the compression module cannot complete the data compression in pixel row format. Summary of the Invention
[0003] In view of this, embodiments of this application provide a data shaping method and apparatus to at least partially solve the above-mentioned problems.
[0004] According to a first aspect of the embodiments of this application, a data shaping method is provided, comprising: in response to receiving a video data packet, determining the relative position of each pixel data in the video data packet within a complete video frame; updating data items at corresponding positions in a status identifier array according to the relative positions of each pixel data in the complete video frame; each data item in the status identifier array being used to identify the reception status of different pixel data in the complete video frame; and, after determining that the received pixel data includes a target pixel array based on the updated status identifier array, sending the target pixel array to a data compression module for data compression, wherein the size of the target pixel array is determined according to the data compression granularity.
[0005] According to a second aspect of the embodiments of this application, an electronic device is provided, including a computer storage medium configured to store computer program instructions for performing the method as described in the first aspect.
[0006] According to a third aspect of the embodiments of this application, a computer storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0007] In the above technical solution, since the determination of whether the received pixel data forms a data compression granularity is based on the status identifier array, regardless of the data output format adopted by the preceding module, it is only necessary to update the status identifier array according to the received pixel data. Based on the status identifier array, it is possible to determine whether the received pixel data constitutes a data compression granularity, thereby reliably realizing data shaping and completing data compression.
[0008] The above technical solution can perform data shaping on the video data output by the preceding module and output video data in a format that meets the requirements of the data compression module. Furthermore, the above solution can greatly reduce the constraints on the data output format of the preceding module, improve the adaptability of the data shaping solution to different data output formats, and can be widely applied to different nodes in the video data processing link. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0010] Figure 1 This is a schematic diagram of a video data processing link provided in an embodiment of this application;
[0011] Figure 2 A flowchart of a data shaping method provided in an embodiment of this application;
[0012] Figure 3 A schematic diagram of a scenario for the data shaping method provided in the embodiments of this application;
[0013] Figure 4 A schematic diagram of another scenario for the data shaping method provided in the embodiments of this application;
[0014] Figure 5 A schematic diagram of another scenario for the data shaping method provided in the embodiments of this application;
[0015] Figure 6 This is a schematic diagram of another structure of the video data processing link provided in an embodiment of this application;
[0016] Figure 7 Another flowchart of the data shaping method provided in the embodiments of this application;
[0017] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] To enable those skilled in the art to better understand the technical solutions in the embodiments of this application, the technical solutions in 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. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art should fall within the protection scope of the embodiments of this application.
[0019] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0020] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0021] It should also be noted that the terms "first, second, and third" used in the embodiments of this application are only used to distinguish similar objects and do not represent a specific order of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0022] Furthermore, in the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0023] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and they all fall within the protection scope of the embodiments of this application.
[0024] When compressing video data, the compression module requires the video data to be arranged in a specific format. For example, the video data must be arranged in specific "blocks" (such as 16x16 pixel macroblocks). Otherwise, the compression module will be unable to compress the data efficiently, affecting the video data compression efficiency and even causing compression failure. Simultaneously, other modules in the data processing chain will also process data based on the most efficient data processing format, leading to inconsistencies in data processing formats between modules. When the format of the video data input to the compression module from its preceding modules is inconsistent with the data processing format required by the compression module, the compression module will be unable to compress the data, resulting in excessive bandwidth and memory consumption.
[0025] Based on the above, some technical solutions may include a shaping module at the front end of the compression module. This shaping module receives video data output from the preceding module and shapes the received video data according to the compression module's data processing format requirements. The shaped video data is then input into the compression module for compression. Specifically, assuming the compression granularity of the compression module is N x M macroblocks (e.g., 16x16 pixels), the functional implementation flow of the shaping module may include:
[0026] First, the shaping module receives video data output by the preceding module in a specific format. For example, the preceding module outputs video data to the shaping module in the form of pixel rows.
[0027] Furthermore, the shaping module caches the received video data.
[0028] Then, the shaping module determines whether the number of lines of the currently received video data has reached the height required for data compression granularity (e.g., 16). If it has, it means the currently received video data has reached the data compression granularity of the compression module. The shaping module then retrieves the corresponding data macroblocks in units of data compression granularity and inputs the video data into the compression module in macroblock format for compression. If the required height has not been reached, it means the currently received video data has not reached the data compression granularity of the compression module. In this case, the shaping module can continue to receive and buffer the video data output from the preceding module.
[0029] However, the above technical solution requires the preceding module to output video data in a specific format. If the data output format of the preceding module changes, the shaping module may think that the cached video data can never reach the data compression granularity of the compression module, thus causing the compression module to fail and resulting in a link disconnection.
[0030] Specifically, assuming the preceding module outputs video data in pixel rows, the way the preceding module outputs video data to the shaping module is: [All data in row 1] -> [All data in row 2] -> [All data in row 3]. Therefore, the shaping module can update the current row number after receiving a complete row of data each time, and determine whether the received video data meets the data compression granularity of the compression module using the method described above.
[0031] However, assuming the preceding module outputs video data to the shaping module in the following manner: [segment A of line 1] -> [segment A of line 2] -> [segment B of line 1] -> [segment A of line 2], or [segment A of line 1] -> [segment B of line 1] -> [segment A of line 2] -> [segment B of line 2] -> [segment C of line 1] -> [segment C of line 2], then the shaping module will receive only a fragment of a complete line each time. This means the shaping module will not receive video data logically recognized as a "complete line," and therefore will be unable to perform line counting. Consequently, the shaping module will never recognize that the received video reaches the data compression granularity of the compression module, preventing the compression module from compressing the data.
[0032] As can be seen, although the above implementation method can achieve data shaping, it requires the preceding modules to output video data in a fixed data output format, which restricts the data processing format of the preceding modules and is not conducive to improving the data processing efficiency of the preceding modules. Furthermore, for modules in the video data processing link that cannot output video data in the corresponding format, such modules will not be able to connect to the compression module, which is not conducive to reducing the bandwidth of the video data processing link and the storage resources occupied by video data.
[0033] To address the aforementioned issues, embodiments of this application provide a data shaping method that can shape video data output by pre-processing modules with different data output formats. Furthermore, this data shaping method is adaptable to pre-processing modules with different data output formats, exhibiting better scene adaptability and reliability.
[0034] The implementation process of the data shaping method provided in the embodiments of this application will be described below with reference to the accompanying drawings.
[0035] Figure 1 This is a schematic diagram of a video data processing link provided in an embodiment of this application. Figure 1 As shown, the video data processing link may include a data processing module 11, a data shaping module 12, a data compression module 13, and a system storage 14. The data processing module 11, the data shaping module 12, and the system storage 14 can be connected via a bus, and the data shaping module 12 is connected to the data compression module 13.
[0036] The output data of the data processing module can be routed to the data shaping module via the bus. The data processing module may include any one or more preceding modules whose data processing order is before the data shaping module. The data shaping module can perform data shaping on the received data based on the data shaping method provided in the embodiments of this application to obtain data that meets the data processing format requirements of the data compression module, and output it to the data compression module; the data compression module can compress the received data and route the compressed data to the system storage via the bus.
[0037] The following section describes the specific implementation of the data shaping method executed by the data shaping module in the above data processing chain.
[0038] Figure 2 This is a flowchart illustrating a data shaping method provided in an embodiment of this application. Figure 2 As shown, the data shaping method provided in this application embodiment may include:
[0039] 101. In response to receiving a video data packet, determine the relative position of each pixel data in the video data packet within the complete video frame.
[0040] In this embodiment, the preceding module can send video data to the data shaping module in the form of data packets. Each video data packet may include, for example, a portion of pixel data from a complete video frame. For any received video data packet, the data shaping module can determine the relative position of each pixel data contained therein within the complete video frame.
[0041] Specifically, the video data packets sent by the preceding module may carry target parameters, such as the relative position of a reference pixel in the video data packet within the complete video frame. The reference pixel could be, for example, the first pixel in the video data packet, or, if the pixels in the video data packet are arranged from left to right, the leftmost pixel. Upon receiving the video data packet, the data shaping module can first read the relative position of the reference pixel in the complete video frame. Then, based on the relative position of the reference pixel in the complete video frame, and the positional relationship between the reference pixel and other pixels in the video data packet, it can determine the relative positions of the other pixels in the video data packet within the complete video frame. The positional relationship between the reference pixel and other pixels in the video data packet can, for example, be determined based on the current data output format of the preceding module.
[0042] 102. Update the data items at the corresponding positions in the status identifier array according to the relative positions of each pixel data in the complete video frame. Each data item in the status identifier array is used to identify the reception status of different pixel data in the complete video frame.
[0043] In this embodiment, the specific implementation of the status flag array can be, for example, a bitmap. The size of the status flag array is related to the specification parameters of the complete video frame. The size of the status flag array can be characterized, for example, by the number of rows and columns of the data items it contains. The specification parameters of the complete video frame refer to the number of rows and columns of pixel data in the complete video frame. A status flag array can be generated based on the specification parameters of the complete video frame. Each data item contained in the status flag array can be used to identify the current reception status of different pixel data in the complete video frame. For example, each data item contained in the status flag array can be a first value (e.g., 0) or a second value (e.g., 1). When it is the first value, it is used to identify the corresponding pixel data as not received; when it is the second value, it is used to identify the corresponding pixel data as received.
[0044] One possible implementation is, such as Figure 3 As shown, the positions of each data item in the status identifier array correspond one-to-one with the positions of each pixel data in the complete video frame. In this implementation, the size of the status identifier array is consistent with the specifications of the complete video frame; that is, the number of rows and columns of the data items in the status identifier array is consistent with the number of rows and columns of the pixel data in the complete video frame. Any data item in the status identifier array can be used to identify the current reception status of the pixel data at the corresponding row and column position in the complete video frame. Therefore, after receiving the video data packet, the data item at the corresponding position in the status identifier array is updated according to the relative position of each pixel data in the complete video frame. Specifically, the data item at the corresponding position in the status identifier array is updated from the unreceived state to the received state based on the relative position of each pixel data in the complete video frame.
[0045] Another possible implementation, such as Figure 4As shown, the positions of each data item in the status identifier array correspond one-to-one with the positions of each pixel group in the complete video frame. In this embodiment, each pixel group includes multiple pixel data, and the number of pixel data in each pixel group can be the same. The number of pixel data in each pixel group is related to the data compression granularity of the data compression module. Specifically, the number of pixel data in each pixel group can be less than the data compression granularity of the data compression module. At the same time, the size of the pixel array formed by N pixel groups can be consistent with the size of the pixel array corresponding to the data compression granularity. That is, N pixel groups can jointly constitute a data compression granularity. N can be an integer greater than 1. The number of pixel data in each pixel group is also related to the specification parameters of the complete video frame. For example, the number of pixel data in each pixel group can be a divisor of the number of columns of pixel data in the complete video frame. In this implementation, the number of rows and columns of the data items in the status identifier array are consistent with the number of rows and columns of the pixel groups in the complete video frame. Any data item in the status identifier array can be used to identify the current reception status of a pixel group at a corresponding row and column position in a complete video frame. That is, for any pixel group, the data item at the corresponding position in the status identifier array can only be updated after the reception status of all pixel data within that group has changed. Therefore, after receiving a video data packet, the data item at the corresponding position in the status identifier array is updated according to the relative position of each pixel data within it in the complete video frame. Specifically, this can be achieved by dividing the pixel data in the video data into multiple pixel groups according to a preset granularity. Then, based on the relative position of each pixel group in the complete video frame, the data item at the corresponding position in the status identifier array is updated from an unreceived state to a received state.
[0046] By implementing the above methods, the size of the status flag array can be reduced, the amount of data can be decreased, and the consumption of computing resources can be reduced.
[0047] 103. Based on the updated status identifier array, determine whether the received pixel data contains the target pixel array. If it does, proceed to step 104; otherwise, continue with step 101.
[0048] 104. The target pixel array is sent to the compression module for data compression.
[0049] In this embodiment, the size of the target pixel array can be flexibly set according to the data compression granularity of the data compression module. When the data compression granularity of the data compression module changes, the size of the target pixel array can change accordingly. For example, assuming the data compression granularity is 16 x 16 pixels, then the target pixel array can be a 16 x 16 pixel array. Determining whether the received pixel data contains the target pixel array means determining whether the received pixel data contains a pixel array that constitutes the data compression granularity of the data compression module. Since the status identifier array indicates the current reception status of each pixel data in a complete video frame, it is possible to determine whether the received pixel data contains the target pixel array based on the status identifier array.
[0050] Specifically, the system can detect whether a target state array exists within the state identifier array. In the target state array, each data item indicates a received state. The size of the target state array is determined by the data compression granularity. The array formed by all the pixel data identified by each data item in the target state array is the target pixel array, and its size is equal to the data compression granularity of the data compression module. The size of the target state array varies depending on the identifier of each data item in the state identifier array. Specifically, when the identifier of each data item is a pixel, the size of the target state array is equal to the size of the data compression granularity. When the identifier of each data item is a group of pixels, the size of the target state array will be smaller than the size of the data compression granularity.
[0051] If the updated status identifier array detects the presence of a target status array, it can be determined that the received pixel data contains the target pixel array; that is, the received pixel data already contains a pixel array that can constitute the data compression granularity. Therefore, the corresponding target pixel array can be sent to the compression module for data compression. If the updated status identifier array does not detect the presence of a target status array, it can be determined that the received pixel data does not contain the target pixel array; that is, the received pixel data does not contain a pixel array that can constitute the data compression granularity. Therefore, step 101 can continue to be executed, receiving new video data packets, buffering new pixel data, and waiting for the data compression granularity to arrive.
[0052] In one possible implementation, a detection window can be used to traverse the state identifier array to detect whether a target state array exists within it. The detection window can select multiple data items in the state identifier array at a time, and the array size formed by all the pixel data identified by these multiple data items is equal to the data compression granularity. For example... Figure 5As shown, the detection window can be moved within the state identifier array according to a preset traversal rule, and each data item falling within the detection window is detected sequentially to traverse the state identifier array. When the receiving status identified by each data item falling within the detection window is "received," the array formed by the data items falling within the detection window can be determined as the target state array. The size of the detection window can be determined based on the data compression granularity. When the data compression granularity of the data compression module changes, the size of the detection window can be changed accordingly. Therefore, for different processing nodes in the video data processing link, different data compression algorithms can be configured specifically, and detection windows of different sizes can be set based on the data compression granularity corresponding to different data compression algorithms. This allows the method to adapt to different data compression algorithms, improve the compression ratio, and reduce the occupation of bandwidth and system storage space.
[0053] In this embodiment, since the determination of whether received pixel data has formed data compression granularity is based on the state identifier array, the detection of a target state array at any position in the state identifier array can be determined as the detection of data compression granularity. Therefore, regardless of the data output format used by the preceding modules, the data shaping module can accurately shape the received video data based on the state identifier array and output video data with the corresponding data compression granularity according to the requirements of the data compression module, thereby enabling the data compression module to complete data compression. Through the above technical solution, the constraints on the data output format of the preceding modules can be greatly reduced, the adaptability of the data shaping scheme to different data output formats can be improved, and this method can be widely applied to different nodes in the video data processing link.
[0054] Figure 6 This is another schematic diagram of the video data processing link provided in the embodiments of this application. For example... Figure 6 As shown, the data shaping module can be connected to a bus, and the data shaping module 12 is also connected to a data compression module 13. The data shaping module 12 may include a data receiving unit 121 and an execution unit 122. The following is based on... Figure 6 The video data processing link structure shown illustrates the specific implementation of the data shaping method executed by the data shaping module.
[0055] Figure 7 Another flowchart of the data shaping method provided in the embodiments of this application. Figure 7 As shown, the data shaping method provided in this application embodiment may include:
[0056] 201. In response to receiving a video data packet, the data receiving unit divides each pixel data into multiple pixel groups according to a preset granularity.
[0057] In this embodiment, the data receiving unit can be used to receive and buffer video data packets sent by the preceding module. Furthermore, each pixel data can be divided into multiple pixel groups according to a preset granularity. In this embodiment, the preset granularity specifies the number of pixel data points that should be included in each pixel group; the preset granularity may be, for example, one pixel or multiple pixels. The value of the preset granularity can be flexibly set based on the needs of the actual scenario.
[0058] 202. The data receiving unit determines the relative position of each pixel group in the complete video frame.
[0059] The video data packet can carry the relative position of the reference pixel data within the complete video frame. In this way, the data receiving unit can determine the relative positions of other pixel data within the complete video frame based on the positional relationship between other pixel data and the reference pixel data in the video data packet. Furthermore, the data receiving unit can determine the relative positions of each pixel group within the complete video frame based on the number of pixel data contained within each pixel group. The relative positions of pixel groups within the complete video frame can, for example, be represented in the form [X1-X2, Y1-Y2], where X1 refers to the column number of the leftmost pixel data, X2 refers to the column number of the rightmost pixel data, Y1 refers to the row number of the topmost pixel data, and Y2 refers to the row number of the bottommost pixel data.
[0060] 203. The data receiving unit sends the relative positions of each pixel group in the complete video frame to the execution unit.
[0061] In this embodiment, the relative position of each pixel group within the complete video frame can serve as an index for each pixel group, allowing the data receiving unit to locate the corresponding pixel group in the cached pixel data. After determining the relative position of each pixel group within the complete video frame, the data receiving unit can also send the relative position information corresponding to each pixel group to the execution unit.
[0062] 204. The execution unit receives the relative positions of each pixel group in the complete video frame.
[0063] 205. The execution unit updates the data items at the corresponding positions in the status identifier array according to the relative positions of each pixel group in the complete video frame.
[0064] The execution unit can be used to update the status flag array according to the relative position of each received pixel group in the complete video frame, and determine whether the currently received pixel data constitutes the data compression granularity of the data compression module based on the status flag array.
[0065] Specifically, the execution unit can maintain a state identifier array, which can be implemented as a bitmap, for example. The function, size, and generation method of the state identifier array can be found in the description of the foregoing embodiments, and will not be repeated here. In this embodiment, for any video frame, if the execution unit has not received the relative position of any pixel group in the complete video frame, all data items in the state identifier array can be used to indicate a non-received state, such as all being 0. After receiving the relative position of any pixel group in the complete video frame, the execution unit can modify the data items in the state identifier array accordingly, updating the non-received state to a received state. Furthermore, when the state of all data items in the state identifier array has been updated to the received state, it indicates that the data receiving unit has received all pixel data of that frame and is about to begin receiving pixel data for the next video frame. In this case, the execution unit can reset the state of all data items in the state identifier array to the initial state, i.e., the non-received state, to indicate the receiving state of each pixel group included in the next video frame, and so on, in a cyclical manner.
[0066] 206. The execution unit uses the detection window to traverse the updated state identifier array and determines whether the target state array exists in the updated state identifier array based on the traversal results. If it exists, the execution unit executes step 207; otherwise, the execution unit continues to execute step 204 to receive the relative positions of each pixel group in the complete video frame.
[0067] 207. The execution unit sends the relative positions of each pixel group identified by the target state array in the complete video frame to the data receiving unit.
[0068] Since each data item in the status identifier array identifies the current reception state of each pixel group in the complete video frame, the execution unit can determine whether the currently received pixel data has formed a data compression granularity through the status identifier array. In this embodiment, the execution unit may, for example, periodically traverse the status identifier array using a detection window according to a set period to determine whether a target status array exists in the status identifier array. Alternatively, the execution unit may traverse the status identifier array using a detection window after each update to determine whether a target status array exists in the status identifier array. The specific implementation method of traversing the status identifier array using a detection window can be referred to the description of the foregoing embodiments, and will not be repeated here.
[0069] If a target state array is detected in the state identifier array, it means that the currently received pixel data has formed the data compression granularity of the data compression module. Then, the execution unit can send the relative position of each pixel group identified by the target state array in the complete video frame to the data receiving unit, that is, send the index of each pixel group identified by the target state array to the data receiving unit.
[0070] 208. The data receiving unit obtains the corresponding pixel groups based on the received relative positions and sends each pixel group to the data compression unit for data compression.
[0071] Since the data receiving unit assigns a corresponding index (i.e., its relative position within the complete video frame) to each received pixel group, it can locate the corresponding pixel group based on the index and send it to the data compression module for compression. This process shapes the video data output from the preceding modules, producing video data in a format that conforms to the requirements of the data compression module. The data compression module then compresses the received video data and routes the compressed data to system storage via the bus.
[0072] In the above technical solution, a data receiving unit can be configured to receive and buffer video data packets sent by the preceding module, and calculate the relative positions of each pixel group contained in the video data packet within the complete video frame. Furthermore, an execution unit can be configured to update the identifier status of data items at corresponding positions in the status identifier array based on the relative positions of the received pixel groups within the complete video frame, and determine, based on the status identifier array, whether the currently received pixel groups have achieved data compression granularity. This technical solution significantly reduces the constraints on the data output format of the preceding module, improves the adaptability of the data shaping scheme to different data output formats, and can be widely applied to different nodes in the video data processing link.
[0073] Figure 8 A schematic diagram of an electronic device according to an embodiment of this application is shown. The electronic device can be used to execute the data shaping method provided in the embodiment of this application. The specific embodiments of this application do not limit the specific implementation of the electronic device.
[0074] like Figure 8 As shown, the electronic device may include: a processor 502, a communications interface 504, a memory 506, and a communications bus 508.
[0075] The processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508. Communication interface 504 is used to communicate with other electronic devices or servers. The processor 502 executes program 510, specifically performing the relevant steps in the above data shaping method embodiments.
[0076] Specifically, program 510 may include program code that includes computer operation instructions.
[0077] Processor 502 may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The smart device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0078] Memory 506 is used to store program 510. Memory 506 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0079] Specifically, program 510 can be used to cause processor 502 to perform the following operations: In an optional implementation, program 510 is further used to cause processor 502 to perform the following operations. The specific implementation of each step in program 510 can be found in the corresponding steps and system descriptions in the above-described data shaping method embodiments, and will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.
[0080] This application also provides a computer program product, including computer instructions that instruct a computing device to perform an operation corresponding to any of the data shaping methods in the above-described plurality of method embodiments. It should be noted that, depending on implementation needs, the various components / steps described in the embodiments of this application can be broken down into more components / steps, or two or more components / steps or parts of the operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this application.
[0081] This application also provides a computer-readable storage medium in which the methods described in this application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code downloaded over a network that is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium. Thus, the methods described herein can be stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as ASIC or FPGA) for such software processing. It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., RAM, ROM, flash memory, etc.) capable of storing or receiving software or computer code that, when accessed and executed by the computer, processor, or hardware, implements the data shaping methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the data shaping methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the data shaping methods shown herein.
[0082] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.
[0083] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0084] Furthermore, it should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used for training the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0085] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0086] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0087] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0088] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0089] The above embodiments are only used to illustrate the embodiments of this application, and are not intended to limit the embodiments of this application. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this application. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this application, and the patent protection scope of the embodiments of this application should be defined by the claims.
Claims
1. A data shaping method, characterized in that, include: In response to receiving a video data packet, determine the relative position of each pixel data in the video data packet within a complete video frame; Based on the relative position of each pixel data in the complete video frame, the data items at the corresponding positions in the status identifier array are updated; each data item in the status identifier array is used to identify the reception status of different pixel data in the complete video frame. Based on the updated status identifier array, after determining that the received pixel data contains the target pixel array, the target pixel array is sent to the data compression module for data compression. The size of the target pixel array is determined according to the data compression granularity.
2. The method according to claim 1, characterized in that, The video data packet carries target parameters, which include the relative position of the reference pixel data in the video data packet within the complete video frame.
3. The method according to claim 2, characterized in that, In response to receiving a video data packet, determining the relative position of each pixel data in the video data packet within a complete video frame includes: In response to receiving a video data packet, determine the relative position of the reference pixel data in the video data packet within a complete video frame; The relative positions of the other pixel data in the complete video frame are determined based on the relative positions of the reference pixel data in the complete video frame and the positional relationships between the reference pixel data and other pixel data in the video data packet.
4. The method according to claim 1, characterized in that, Each data item in the status identifier array is used to identify the reception status of different pixel groups in the complete video frame, and each pixel group contains multiple pixel data.
5. The method according to claim 4, characterized in that, The method further includes: The status identifier array is generated based on the specification parameters of the complete video frame and the number of pixel data contained in each pixel group.
6. The method according to claim 5, characterized in that, Based on the relative position of each pixel data within the complete video frame, the data items at the corresponding positions in the status identifier array are updated, including: According to the preset granularity, the pixel data is divided into multiple pixel groups; Based on the relative position of each pixel group in the complete video frame, the data item at the corresponding position in the status identifier array is updated from the unreceived state to the received state.
7. The method according to claim 1, characterized in that, Based on the updated status identifier array, it is determined that the received pixel data contains the target pixel array, including: The updated state identifier array is checked to see if a target state array exists. The receiving state identified by each data item in the target state array is a received state. The size of the target state array is determined according to the data compression granularity. After detecting the presence of the target state array in the updated state identifier array, it is determined that the received pixel data contains the target pixel array.
8. The method according to claim 7, characterized in that, Detecting whether the target state array exists in the updated state identifier array includes: The updated status identifier array is traversed using a detection window; the size of the detection window is determined based on the data compression granularity. Based on the traversal results, determine whether the target state array exists in the updated state identifier array.
9. An electronic device, characterized in that, include: A computer storage medium configured to store computer program instructions for performing the method as described in any one of claims 1 to 8.
10. A computer storage medium, characterized in that, The computer storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Image processing device and image processing method
CN103238324A
Image processing method and device, electronic equipment and storage medium
CN111127310A