Odd-even field merging method and device based on bit block transmission, terminal, medium and product

By adopting a parity-even-field pixel copy method based on bit block transmission in an embedded system, and using hardware to perform BitBLT operations, the problem of CPU resource occupation when merging the parity-even-field pixel data is solved, the merge speed is improved and the CPU utilization is reduced.

CN119071491AActive Publication Date: 2024-12-03上海先楫半导体科技有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411072813.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-12-03
Estimated Expiration
2044-08-06

Smart Images

  • Figure CN119071491A_ABST
    Figure CN119071491A_ABST
Patent Text Reader

Abstract

The invention provides an odd-even field merging method and device based on bit block transmission, a terminal, a medium and a product, and the method comprises the steps: obtaining an odd field buffer region and an even field buffer region to be merged, and determining a target buffer region; and copying all pixels of the odd field buffer area to the target buffer area by adopting an odd field pixel copying mode based on bit block transmission, and then copying all pixels of the even field buffer area to the target buffer area by adopting an even field pixel copying mode based on bit block transmission so as to obtain merged image data. According to the method, the participation of a CPU is basically not needed, the merging of the pixels can be completed by executing the bit block transmission operation through hardware, the utilization rate of the CPU is greatly reduced, and meanwhile, the merging speed is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of embedded graphics processing technology, and in particular to a method, device, terminal, medium and product for merging odd and even fields based on bit block transfer. Background Art

[0002] When the current image sensor outputs the image data frame, due to the characteristics of the sensor, it will first output all the odd-numbered rows of pixel data, and then output all the even-numbered rows of pixel data. However, there are some problems with this output method. The data received by the display system is pixel data separated by odd and even fields, which cannot be displayed directly. The data separated by odd and even fields needs to be merged and converted into normal data display. Many embedded systems merge the odd and even field pixel data by executing software through the CPU. However, since the image data is generally large, such an operation will occupy a large amount of CPU resources, resulting in low CPU utilization. At present, many embedded MCUs have 2D graphics acceleration functions and support the most basic bit block transfer (BitBLT) function. Summary of the invention

[0003] In view of the shortcomings of the prior art described above, the purpose of the present application is to provide a method, device, terminal, medium and product for merging parity fields based on bit block transfer, which is used to solve the problem in the prior art that the software in an embedded system supporting bit block transfer function will occupy a large amount of CPU when implementing the merging of parity fields.

[0004] To achieve the above-mentioned purpose and other related purposes, the first aspect of the present application provides a method for merging odd and even fields based on bit block transfer, including: obtaining an odd field buffer and an even field buffer to be merged, and determining a destination buffer; using an odd field pixel copy method based on bit block transfer to copy all pixels of the odd field buffer to the destination buffer, and then using an even field pixel copy method based on bit block transfer to copy all pixels of the even field buffer to the destination buffer, so as to obtain merged image data.

[0005] In some embodiments of the first aspect of the present application, the information used to describe the buffer includes: format information, height, width, and line spacing.

[0006] In some embodiments of the first aspect of the present application, an odd field pixel copy method based on bit block transfer is adopted to copy all pixels of the odd field buffer to the destination buffer, including: initializing an odd field source memory address counter, a destination memory address counter and an odd field copy counter; wherein, the method of initializing the odd field source memory address counter, the destination memory address counter and the odd field copy counter includes: setting the odd field source memory address counter to point to the first memory address of the odd field buffer; setting the destination memory address counter to point to the first memory address of the destination buffer; setting the odd field copy counter to 0; and performing multiple odd field copy operations according to the height and line spacing of the odd field buffer by setting the initialized odd field source memory address counter, the destination memory address counter and the odd field copy counter until all pixels of the odd field buffer are completely copied to the destination buffer.

[0007] In some embodiments of the first aspect of the present application, the process of each odd field copy operation includes: copying the odd field pixel data in the memory currently pointed to by the odd field source memory address counter to the memory currently pointed to by the destination memory address counter; wherein the size of the odd field pixel data of this odd field copy is the line spacing of the odd field buffer; after the odd field copy is completed, controlling the current count value of the odd field source memory address counter to increase by the line spacing of the odd field buffer; controlling the current count value of the destination memory address counter to increase by twice the line spacing of the odd field buffer; and controlling the current count value of the odd field copy counter to increase by 1.

[0008] In some embodiments of the first aspect of the present application, an even field pixel copy method based on bit block transfer is adopted to copy all pixels of the even field buffer to the destination buffer, including: initializing an even field source memory address counter, a destination memory address counter and an even field copy counter; wherein, the method of initializing the even field source memory address counter, the destination memory address counter and the even field copy counter includes: setting the even field source memory address counter to point to the memory first address of the even field buffer; setting the destination memory address counter to point to the destination starting address of the even field copy; the destination starting address of the even field copy is the address after the memory first address of the destination buffer plus the line spacing of the odd field buffer; setting the even field copy counter to 0; according to the height and line spacing of the even field buffer, performing multiple even field copy operations by setting the initialized even field source memory address counter, the destination memory address counter and the even field copy counter until all pixels of the even field buffer are completely copied to the destination buffer.

[0009] In some embodiments of the first aspect of the present application, the process of each even field copy operation includes: copying the even field pixel data in the memory currently pointed to by the even field source memory address counter to the memory currently pointed to by the destination memory address counter; wherein the size of the even field pixel data of this even field copy is the line spacing of the even field buffer; after the even field copy is completed, controlling the current count value of the even field source memory address counter to increase by the line spacing of the even field buffer; controlling the current count value of the destination memory address counter to increase by twice the line spacing of the even field buffer; and controlling the current count value of the even field copy counter to increase by 1.

[0010] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present application provides an odd-even field merging device based on bit block transfer, including: an acquisition module, used to acquire the odd field buffer and the even field buffer to be merged, and determine the destination buffer; a merging module, connected to the acquisition module, used to adopt the odd field pixel copy method based on bit block transfer to copy all pixels of the odd field buffer to the destination buffer, and then adopt the even field pixel copy method based on bit block transfer to copy all pixels of the even field buffer to the destination buffer, so as to obtain merged image data.

[0011] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the parity field merging method based on bit block transfer is implemented.

[0012] To achieve the above-mentioned purpose and other related purposes, the fourth aspect of the present application provides a computer program product, which includes a computer program code. When the computer program code is executed on a computer, the computer implements the parity field merging method based on bit block transfer.

[0013] To achieve the above-mentioned purpose and other related purposes, the fifth aspect of the present application provides an electronic terminal, including a memory, a processor and a computer program stored in the memory; the processor executes the computer program to implement the parity field merging method based on bit block transfer.

[0014] As described above, the parity field merging method, device, terminal, medium and product based on bit block transfer of the present application have the following beneficial effects:

[0015] The method of the present application basically does not require CPU participation, and pixel merging can be completed by executing bit block transfer operations through hardware, which greatly reduces the CPU usage and improves the merging speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1It is a flowchart of a method for merging parity fields based on bit block transfer in one embodiment of the present application.

[0017] Figure 2 Shown is a schematic diagram of buffer description information in an embodiment of the present application.

[0018] Figure 3 Shown is a schematic diagram of the odd field pixel data copy process in an embodiment of the present application.

[0019] Figure 4 Shown is a schematic diagram of the odd field pixel data copy effect in an embodiment of the present application.

[0020] Figure 5 Shown is a schematic diagram of the even field pixel data copy process in one embodiment of the present application.

[0021] Figure 6 Shown is a schematic diagram of the even field pixel data copy effect in one embodiment of the present application.

[0022] Figure 7 It is a schematic diagram of the structure of a parity field merging device based on bit block transfer in one embodiment of the present application.

[0023] Figure 8 Shown is a schematic diagram of the structure of an electronic terminal in one embodiment of the present application. DETAILED DESCRIPTION

[0024] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0025] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference.

[0026] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" represent examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0027] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc or abc, where a, b, c can be single or multiple.

[0028] Before further describing the present invention in detail, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are applicable to the following interpretations:

[0029] <1> CPU (Central Processing Unit): The CPU is responsible for executing instructions in the program and processing data.

[0030] <2> BitBLT (Bit Block Transfer): BitBLT is a technique used in computer graphics to efficiently move or copy pixel data between memory or display devices. BitBLT is a low-level operation that is usually implemented by graphics hardware or the graphics subsystem of the operating system.

[0031] The present application provides a method, device, terminal, medium and product for merging odd and even fields based on bit block transfer, the method comprising: obtaining an odd field buffer and an even field buffer to be merged, and determining a destination buffer; using an odd field pixel copy method based on bit block transfer to copy all pixels of the odd field buffer to the destination buffer, and then using an even field pixel copy method based on bit block transfer to copy all pixels of the even field buffer to the destination buffer to obtain merged image data. The method of the present application basically does not require CPU participation, and pixel merging can be completed by hardware executing a bit block transfer operation, which greatly reduces CPU usage and improves the merging speed.

[0032] To facilitate understanding of the embodiments of the present application, first Figure 1 Detailed description. Figure 1 The flowchart of a method for merging odd and even fields based on bit block transfer in an embodiment of the present invention is shown. The method for merging odd and even fields based on bit block transfer in this embodiment mainly includes the following steps:

[0033] Step S11: Obtain the odd field buffer and the even field buffer to be merged, and determine the destination buffer.

[0034] It should be understood that the method of the present invention is applied to a receiving device. When the transmission device outputs an image frame to the receiving device, it first outputs all odd-numbered pixel images and then outputs all even-numbered pixel images. Therefore, the receiving device receives two buffers, namely an odd field buffer and an even field buffer, stores the two buffers, and then merges the two buffers.

[0035] It should also be understood that the destination buffer is used to store the merged result of the odd field buffer and the even field buffer.

[0036] In a specific embodiment, the output device is a camera or an encoder, and the receiving device is an MCU (Microcontroller Unit). The camera or encoder transmits, and the MCU stores the received odd field buffer and even field buffer locally, and then merges the two buffers.

[0037] In one embodiment, if Figure 2 As shown, the information used to describe the buffer includes: format information, height (height), width (width) and line spacing (stride).

[0038] It should be understood that the image buffer is a continuous piece of memory. The height is used to describe the number of pixels occupied by the height of the image in the buffer, and the unit is pixel; the width is used to describe the number of pixels occupied by the width of the image in the buffer, and the unit is pixel; the stride is used to describe the size of the memory occupied by the buffer, and the unit is generally bytes.

[0039] Step S12: Using a bit block transfer-based odd field pixel copying method to copy all pixels in the odd field buffer to the destination buffer, and then using a bit block transfer-based even field pixel copying method to copy all pixels in the even field buffer to the destination buffer to obtain merged image data.

[0040] Specifically, an odd field pixel copying method based on bit block transfer is adopted to copy the pixels of the odd field buffer to the destination buffer. After all the pixels in the odd field buffer are completely copied to the destination buffer, an even field pixel copying method based on bit block transfer is adopted to copy the pixels of the even field buffer to the destination buffer that already contains all the pixels of the odd field buffer. When all the pixels of the even field buffer are completely copied to the destination buffer, the destination buffer now contains all the pixels of the odd field buffer and all the pixels of the even field buffer, and the order of each pixel is consistent with that in the image frame. Therefore, when all the pixels are copied to the destination buffer, the merged image data can be obtained.

[0041] In one embodiment, an odd field pixel copy method based on bit block transfer is adopted to copy all pixels of the odd field buffer to the destination buffer, including: initializing an odd field source memory address counter, a destination memory address counter and an odd field copy counter; wherein, the method of initializing the odd field source memory address counter, the destination memory address counter and the odd field copy counter includes: setting the odd field source memory address counter to point to the first memory address of the odd field buffer; setting the destination memory address counter to point to the first memory address of the destination buffer; setting the odd field copy counter to 0; and performing multiple odd field copy operations according to the height and line spacing of the odd field buffer by setting the initialized odd field source memory address counter, the destination memory address counter and the odd field copy counter until all pixels of the odd field buffer are completely copied to the destination buffer.

[0042] In one embodiment, the process of each odd field copy operation includes: copying the odd field pixel data in the memory currently pointed to by the odd field source memory address counter to the memory currently pointed to by the destination memory address counter; wherein the size of the odd field pixel data of this odd field copy is the line spacing of the odd field buffer; after the odd field copy is completed, controlling the current count value of the odd field source memory address counter to increase by the line spacing of the odd field buffer; controlling the current count value of the destination memory address counter to increase by twice the line spacing of the odd field buffer; and controlling the current count value of the odd field copy counter to increase by 1.

[0043] It should be noted that the line spacing of the odd field buffer area is increased by two times by controlling the current count value of the destination memory address counter to realize the interlaced writing of odd field pixels.

[0044] The following will be combined with the attached Figure 3 And attached Figure 4 The specific process of copying pixels from the odd field buffer to the destination buffer is explained:

[0045] Before copying begins, set the odd field source memory address counter to the memory first address of the odd field buffer; set the destination memory address counter to the memory first address of the destination buffer; set the odd field copy counter to 0. Then follow the steps below: Figure 3 The process shown starts copying. First, the odd field pixel data in the memory of the odd field source memory address counter is copied to the memory pointed to by the destination memory address counter; the size of the copied odd field pixel data is the line spacing size of the odd field buffer. Through this operation, a row of pixel data in the odd field buffer is copied to the destination buffer. Then control the current count value of the odd field source memory address counter to increase the line spacing of the odd field buffer, control the current count value of the destination memory address counter to increase by twice the line spacing of the odd field buffer; control the current count value of the current destination memory address counter to increase by twice the line spacing of the odd field buffer; control the current count value of the odd field copy counter to increase by 1. Determine whether the odd field copy counter is less than the image height of the odd field buffer. If less than, repeat the above process. When the value of the odd field copy counter is equal to the height of the odd field buffer, it means that all pixels in the odd field buffer are copied and the copying ends. The destination buffer after the copy is completed is as follows Figure 4 As shown in the figure, it can be seen that all odd field pixel data are copied to the destination buffer.

[0046] In one embodiment, an even field pixel copy method based on bit block transfer is adopted to copy all pixels of the even field buffer to the destination buffer, including: initializing an even field source memory address counter, a destination memory address counter and an even field copy counter; wherein, the method of initializing the even field source memory address counter, the destination memory address counter and the even field copy counter includes: setting the even field source memory address counter to point to the memory first address of the even field buffer; setting the destination memory address counter to point to the destination starting address of the even field copy; the destination starting address of the even field copy is the address after the memory first address of the destination buffer is added to the line spacing of the odd field buffer; setting the even field copy counter to 0; according to the height and line spacing of the even field buffer, performing multiple even field copy operations by setting the initialized even field source memory address counter, the destination memory address counter and the even field copy counter until all pixels of the even field buffer are completely copied to the destination buffer.

[0047] In one embodiment, the process of each even field copy operation includes: copying the even field pixel data in the memory currently pointed to by the even field source memory address counter to the memory currently pointed to by the destination memory address counter; wherein the size of the even field pixel data of this even field copy is the line spacing of the even field buffer; after the even field copy is completed, controlling the current count value of the even field source memory address counter to increase by the line spacing of the even field buffer; controlling the current count value of the destination memory address counter to increase by twice the line spacing of the even field buffer; and controlling the current count value of the even field copy counter to increase by 1.

[0048] The following will be combined with the attached Figure 5 And attached Figure 6 The specific process of copying pixels from the even field buffer to the destination buffer is explained:

[0049] The pixel copy of the even field buffer is performed after the pixel copy of the odd field buffer is completed. Figure 4 As shown, the odd field buffer already has all the pixel data. Before the even field exchange zone copy begins, set the destination memory address counter to point to the destination start address of the even field copy; the destination start address of the even field copy is the address of the memory first address of the destination buffer plus the line spacing of the odd field buffer; set the even field copy counter to 0. Then follow Figure 5 The process shown starts copying. First, the even field pixel data in the memory of the even field source memory address counter is copied to the memory pointed to by the destination memory address counter; the size of the copied even field pixel data is the line spacing size of the even field buffer. Through this operation, a row of pixels in the even field buffer is copied to the destination buffer. Then the current count value of the even field source memory address counter is controlled to increase the line spacing of the even field buffer, and the current count value of the destination memory address counter is controlled to increase twice the line spacing of the even field buffer; the even field copy counter is controlled to increase by 1. Determine whether the even field copy counter is less than the image height of the even field buffer. If it is less, repeat the above process. When the value of the even field copy counter is equal to the height of the even field buffer, it means that all pixels in the even field buffer are copied, and the copying ends. The destination buffer after the copy is completed is as follows Figure 6 As shown in the figure, it can be seen that both odd field pixel data and even field pixel data are copied to the destination buffer.

[0050] It should be noted that the merging method of the present invention does not require CPU participation in the merging process, and the pixel merging can be completed by executing the BitBLT operation through hardware, which greatly reduces the CPU usage and improves the merging speed.

[0051] It should also be noted that by controlling the current count value of the destination memory address counter to increase by two times the line spacing of the even field buffer, interlaced writing of even field pixels can be achieved.

[0052] Figure 7 is a schematic block diagram of a parity field merging device based on bit block transfer provided in an embodiment of the present application. Figure 7 As shown, the parity field merging device 7 based on bit block transfer includes:

[0053] An acquisition module 71 is used to acquire an odd field buffer and an even field buffer to be merged, and determine a destination buffer;

[0054] The merging module 72 is connected to the acquisition module 71, and is used to adopt an odd field pixel copying method based on bit block transfer to copy all pixels of the odd field buffer to the destination buffer, and then adopt an even field pixel copying method based on bit block transfer to copy all pixels of the even field buffer to the destination buffer to obtain merged image data.

[0055] It should be understood that the specific process of each module executing the above corresponding steps has been described in detail in the above method embodiment, and for the sake of brevity, it will not be repeated here.

[0056] It should also be understood that the division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0057] In one embodiment, the information used to describe the buffer includes: format information, height, width, and line spacing.

[0058] In one embodiment, an odd field pixel copy method based on bit block transfer is adopted to copy all pixels of the odd field buffer to the destination buffer, including: initializing an odd field source memory address counter, a destination memory address counter and an odd field copy counter; wherein, the method of initializing the odd field source memory address counter, the destination memory address counter and the odd field copy counter includes: setting the odd field source memory address counter to point to the first memory address of the odd field buffer; setting the destination memory address counter to point to the first memory address of the destination buffer; setting the odd field copy counter to 0; and performing multiple odd field copy operations according to the height and line spacing of the odd field buffer by setting the initialized odd field source memory address counter, the destination memory address counter and the odd field copy counter until all pixels of the odd field buffer are completely copied to the destination buffer.

[0059] In one embodiment, the process of each odd field copy operation includes: copying the odd field pixel data in the memory currently pointed to by the odd field source memory address counter to the memory currently pointed to by the destination memory address counter; wherein the size of the odd field pixel data of this odd field copy is the line spacing of the odd field buffer; after the odd field copy is completed, controlling the current count value of the odd field source memory address counter to increase by the line spacing of the odd field buffer; controlling the current count value of the destination memory address counter to increase by twice the line spacing of the odd field buffer; and controlling the current count value of the odd field copy counter to increase by 1.

[0060] In one embodiment, an even field pixel copy method based on bit block transfer is adopted to copy all pixels of the even field buffer to the destination buffer, including: initializing an even field source memory address counter, a destination memory address counter and an even field copy counter; wherein, the method of initializing the even field source memory address counter, the destination memory address counter and the even field copy counter includes: setting the even field source memory address counter to point to the memory first address of the even field buffer; setting the destination memory address counter to point to the destination starting address of the even field copy; the destination starting address of the even field copy is the address after the memory first address of the destination buffer is added to the line spacing of the odd field buffer; setting the even field copy counter to 0; according to the height and line spacing of the even field buffer, performing multiple even field copy operations by setting the initialized even field source memory address counter, the destination memory address counter and the even field copy counter until all pixels of the even field buffer are completely copied to the destination buffer.

[0061] In one embodiment, the process of each even field copy operation includes: copying the even field pixel data in the memory currently pointed to by the even field source memory address counter to the memory currently pointed to by the destination memory address counter; wherein the size of the even field pixel data of this even field copy is the line spacing of the even field buffer; after the even field copy is completed, controlling the current count value of the even field source memory address counter to increase by the line spacing of the even field buffer; controlling the current count value of the destination memory address counter to increase by twice the line spacing of the even field buffer; and controlling the current count value of the even field copy counter to increase by 1.

[0062] Figure 8 is a schematic block diagram of an electronic terminal provided in an embodiment of the present application. Figure 8As shown, the electronic terminal includes: at least one processor 801, a memory 802, at least one network interface 803 and a user interface 805. The various components in the device are coupled together through a bus system 808. It can be understood that the bus system 804 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 804 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 8 In the specification, various buses are labeled as bus systems.

[0063] The user interface 805 may include a display, a keyboard, a mouse, a trackball, a click gun, keys, buttons, a touch pad or a touch screen.

[0064] It is understood that the memory 802 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM) or a programmable read-only memory (PROM). By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memory described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable categories of memory.

[0065] The memory 802 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic terminal 800. Examples of these data include: any executable program used to operate on the electronic terminal 800, such as an operating system 8021 and an application 8022; the operating system 8021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application 8022 can include various applications, such as a media player (Media Player), a browser (Browser), etc., for implementing various application services. The parity field merging method based on bit block transfer provided in the embodiment of the present invention can be included in the application 8022.

[0066] The method disclosed in the above embodiment of the present invention can be applied to the processor 801, or implemented by the processor 801. The processor 801 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 801 or the instruction in the form of software. The above processor 801 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 801 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general processor 801 can be a microprocessor or any conventional processor, etc. In combination with the steps of the accessory optimization method provided in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0067] In an exemplary embodiment, the electronic terminal 800 may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD) to execute the aforementioned method.

[0068] According to the method provided in the embodiment of the present application, the present application also provides a computer program product, which includes: a computer program code, when the computer program code is run on a computer, the computer executes Figure 1 The parity field merging method based on bit block transfer in the illustrated embodiment.

[0069] According to the method provided in the embodiment of the present application, the present application also provides a computer-readable storage medium, which stores a program code, and when the program code is run on a computer, the computer executes Figure 1 The parity field merging method based on bit block transfer in the illustrated embodiment.

[0070] The terms "component", "module", "system", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program and / or a computer. By way of illustration, both applications running on a computing device and a computing device can be components. One or more components may reside in a process and / or an execution thread, and a component may be located on a computer and / or distributed between two or more computers. In addition, these components may be executed from various computer-readable media having various data structures stored thereon. Components may, for example, communicate through local and / or remote processes according to signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and / or a network, such as the Internet interacting with other systems through signals).

[0071] Those of ordinary skill in the art will appreciate that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0072] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0073] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0074] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0075] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0076] In the above embodiments, the functions of each functional unit can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions (programs). When loading and executing computer program instructions (programs) on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integrations. Available media may be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., high-density digital video discs (DVDs), or semiconductor media (e.g., solid state disks (SSDs), etc.).

[0077] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0078] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0079] In summary, the present application provides a method, device, terminal, medium and product for merging odd and even fields based on bit block transfer, the method comprising: obtaining an odd field buffer and an even field buffer to be merged, and determining a destination buffer; using an odd field pixel copy method based on bit block transfer to copy all pixels of the odd field buffer to the destination buffer, and then using an even field pixel copy method based on bit block transfer to copy all pixels of the even field buffer to the destination buffer to obtain merged image data. The method of the present application basically does not require CPU participation, and pixel merging can be completed by hardware executing bit block transfer operations, which greatly reduces CPU usage and improves the merging speed. Therefore, the present application effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.

[0080] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A parity field merging method based on bit block transfer, characterized in that: include: Obtain the odd field buffer and the even field buffer to be merged, and determine the destination buffer; An odd field pixel copy method based on bit block transfer is adopted to copy all pixels of the odd field buffer to the destination buffer, and then an even field pixel copy method based on bit block transfer is adopted to copy all pixels of the even field buffer to the destination buffer to obtain merged image data.

2. The parity field merging method based on bit block transfer according to claim 1, characterized in that: The information used to describe the buffer includes: format information, height, width, and line spacing.

3. The parity field merging method based on bit block transfer according to claim 2, characterized in that: Adopting a bit block transfer-based odd field pixel copying method to copy all pixels of the odd field buffer to the destination buffer, including: Initialize an odd field source memory address counter, a destination memory address counter, and an odd field copy counter; wherein the method of initializing the odd field source memory address counter, the destination memory address counter, and the odd field copy counter comprises: setting the odd field source memory address counter to point to the first memory address of the odd field buffer; setting the destination memory address counter to point to the first memory address of the destination buffer; and setting the odd field copy counter to 0; According to the height and line spacing of the odd field buffer, multiple odd field copy operations are performed by setting the initialized odd field source memory address counter, destination memory address counter and odd field copy counter until all pixels of the odd field buffer are completely copied to the destination buffer.

4. The parity field merging method based on bit block transfer according to claim 3, characterized in that: The process of each odd field copy operation includes: Copy the odd field pixel data in the memory currently pointed to by the odd field source memory address counter to the memory currently pointed to by the destination memory address counter; wherein the size of the odd field pixel data of this odd field copy is the line spacing of the odd field buffer; After the odd field copy is completed, the current count value of the odd field source memory address counter is controlled to increase the line spacing of the odd field buffer; the current count value of the destination memory address counter is controlled to increase twice the line spacing of the odd field buffer; the current count value of the odd field copy counter is controlled to increase by 1.

5. The parity field merging method based on bit block transfer according to claim 2, characterized in that: Adopting an even field pixel copying method based on bit block transfer to copy all pixels of the even field buffer to the destination buffer, including: Initialize an even field source memory address counter, a destination memory address counter, and an even field copy counter; wherein the method of initializing the even field source memory address counter, the destination memory address counter, and the even field copy counter comprises: setting the even field source memory address counter to point to the memory head address of the even field buffer; setting the destination memory address counter to point to the destination start address of the even field copy; the destination start address of the even field copy is the address obtained by adding the line spacing of the odd field buffer to the memory head address of the destination buffer; setting the even field copy counter to 0; According to the height and line spacing of the even field buffer, multiple even field copy operations are performed by setting the initialized even field source memory address counter, destination memory address counter and even field copy counter until all pixels of the even field buffer are completely copied to the destination buffer.

6. The parity field merging method based on bit block transfer according to claim 5, characterized in that: The process of each even field copy operation includes: Copying the even field pixel data in the memory currently pointed to by the even field source memory address counter to the memory currently pointed to by the destination memory address counter; wherein the size of the even field pixel data of this even field copy is the line spacing of the even field buffer; After the even field copy is completed, the current count value of the even field source memory address counter is controlled to increase the line spacing of the even field buffer; the current count value of the destination memory address counter is controlled to increase twice the line spacing of the even field buffer; the current count value of the even field copy counter is controlled to increase by 1.

7. A parity field merging device based on bit block transfer, characterized in that: include: An acquisition module, used for acquiring the odd field buffer and the even field buffer to be merged, and determining the destination buffer; A merging module is connected to the acquisition module and is used to copy all pixels of the odd field buffer to the destination buffer by adopting an odd field pixel copying method based on bit block transfer, and then copy all pixels of the even field buffer to the destination buffer by adopting an even field pixel copying method based on bit block transfer, so as to obtain merged image data.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. A computer program product, characterized in that The computer program product includes a computer program code, and when the computer program code is executed on a computer, the computer is enabled to implement the method according to any one of claims 1 to 6.

10. An electronic terminal comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Hidden caption displaying method and system for digital TV

    CN104754397A

  • Image processing method and device, terminal equipment and storage medium

    CN111915673A

  • Camera image processing method and device, storage medium and electronic equipment

    CN116437211A

  • Odd-even field image data interlaced acquisition method, device, system and chip

    CN118381990A

  • Method and apparatus for addressing multiple frame buffers

    US6411302B1