Video rotating and overturning method and device, chip and storage medium
By using two sets of line caches and two frame caches in the video rotation and flip circuit, the problem of high storage space and power consumption in the prior art is solved, and the efficiency of video rotation and flip is achieved.
Patent Information
- Application Number
- CN202411405024.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2024-11-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing video rotation and flip method uses 4 frame caches, resulting in large storage space and high power consumption.
Using two sets of line caches and two frame caches, the input video stream is stored in the line cache in a ping-pong selection mode through the line cache write controller, and the video stream is bitmap transmission operation, rotation or flipped through the line cache read controller. After storage in the frame cache.
Without losing the quality of dynamic video image, reduce storage space and reduce power consumption.
Smart Images

Figure CN118921524A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a video rotation and flipping method, device, chip and storage medium. Background Art
[0002] The rotation and flipping method used in existing conventional dynamic video transmission is based on bit blit of four frame buffers in memory. The entire image is divided into regions, and then a part of the bitmap of each region is copied to another bitmap for screen display or print output.
[0003] Figure 1a Schematic diagram of a scene applicable to the video rotation and flipping method in the prior art, such as Figure 1a As shown, the frame timing is divided into two time zones, a and b, with the frame being full or empty as the boundary. In time zone a, the input video stream of the current frame is stored in the first frame buffer through ping-pong selection; at the same time, the frame data in the second frame buffer is transferred through a bitmap operation, rotated or flipped by region, and then copied and stored in the fourth frame buffer; at the same time, the frame data in the third frame buffer is output to the subsequent logic in the form of a video stream through ping-pong selection. In time zone b, the input video stream of the current frame is stored in the second frame buffer through ping-pong selection; at the same time, the frame data in the first frame buffer is transferred through a bitmap operation, rotated or flipped by region, and then copied and stored in the third frame buffer; at the same time, the frame data in the fourth frame buffer is output to the subsequent logic in the form of a video stream through ping-pong selection.
[0004] However, existing video rotation and flipping methods use four frame buffers, which takes up a lot of storage space and power consumption. Summary of the invention
[0005] The present invention provides a video rotation and flipping method, device, chip and storage medium, which can reduce storage space and power consumption without losing dynamic video image quality.
[0006] According to one aspect of the present invention, a video rotation and flipping method is provided, which is applied to a video rotation and flipping circuit, wherein the video rotation and flipping circuit includes two sets of line buffers, two frame buffers, a line buffer write controller, and a line buffer read controller; the method includes:
[0007] The input video stream is stored in the corresponding row cache in a ping-pong selection manner through the row cache write controller;
[0008] The video stream in the line buffer is subjected to a bitmap transfer operation, rotated or flipped, and then stored in a corresponding frame buffer through a line buffer read controller.
[0009] Optionally, the input video stream is stored in the corresponding row cache in a ping-pong selection manner through the row cache write controller, including:
[0010] Dividing the row timing corresponding to the video rotation and flipping circuit into a first row time region and a second row time region;
[0011] In the first line time region, the input video stream is stored in the cache unit of the first line cache in a ping-pong selection manner through the line cache write controller;
[0012] In the second row time zone, the input video stream is stored in the cache unit of the second row cache in a ping-pong selection manner through the row cache write controller.
[0013] Optionally, performing a bitmap transfer operation on the video stream in the line buffer, rotating or flipping the video stream in the line buffer and storing the video stream in the corresponding frame buffer through the line buffer read controller includes:
[0014] In the first line time region, the video stream in the second line buffer is subjected to a bitmap transfer operation, rotated or flipped, and then stored in the first frame buffer or the second frame buffer through the line buffer read controller;
[0015] In the second line time zone, the video stream in the first line buffer is subjected to a bitmap transfer operation, rotated or flipped, and then stored in the first frame buffer or the second frame buffer through the line buffer read controller.
[0016] Optionally, performing a bitmap transfer operation on the video stream in the line buffer, rotating or flipping the video stream in the line buffer and storing the video stream in the corresponding frame buffer through the line buffer read controller includes:
[0017] Dividing the frame timing corresponding to the video rotation and flipping circuit into a first frame time region and a second frame time region;
[0018] The video stream in the line buffer is subjected to a bitmap transfer operation, rotation or flipping through a line buffer read controller, and then stored in a frame buffer matching the frame time region in a ping-pong selection manner.
[0019] Optionally, the video stream in the line cache is subjected to a bitmap transfer operation, rotation or flipping through a line cache read controller, and then stored in a frame cache matching the frame time region in a ping-pong selection manner, including:
[0020] In the first frame time region, the video stream in the line buffer is subjected to a bitmap transfer operation, rotation or flipping through the line buffer read controller, and then stored in the first frame buffer in a ping-pong selection manner;
[0021] In the second frame time region, the video stream in the line buffer is subjected to a bitmap transfer operation, rotation or flipping through the line buffer read controller, and then stored in the second frame buffer in a ping-pong selection manner.
[0022] Optionally, after storing in a frame buffer matching the frame time region in a ping-pong selection manner, the method further includes:
[0023] The frame data in another frame buffer is output to the subsequent logic in a ping-pong selection manner.
[0024] Optionally, the frame data in another frame buffer is output to a subsequent logic in a ping-pong selection manner, including:
[0025] In the first frame time region, the frame data in the second frame buffer is output to the subsequent logic in a ping-pong selection manner;
[0026] In the second frame time region, the frame data in the first frame buffer is output to the subsequent logic in a ping-pong selection manner.
[0027] According to another aspect of the present invention, a video rotation and flipping device is provided, which is applied to a video rotation and flipping circuit, wherein the video rotation and flipping circuit comprises two sets of line buffers, two frame buffers, a line buffer write controller and a line buffer read controller; the device comprises:
[0028] The video stream storage module is used to store the input video stream into the corresponding row cache in a ping-pong selection manner through the row cache write controller;
[0029] The video stream processing module is used to perform a bitmap transfer operation on the video stream in the line buffer through a line buffer read controller, and then rotate or flip the video stream and store it in a corresponding frame buffer.
[0030] According to another aspect of the present invention, a chip is provided, the chip comprising:
[0031] The video rotation and flipping circuit according to any embodiment of the present invention;
[0032] at least one processor; and
[0033] a memory communicatively connected to the at least one processor; wherein,
[0034] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the video rotation and flipping method described in any embodiment of the present invention.
[0035] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the video rotation and flipping method described in any embodiment of the present invention when executed.
[0036] The technical solution provided by the embodiment of the present invention deploys two groups of line caches and two frame caches in a video rotation and flipping circuit, stores the input video stream in a ping-pong selection manner in the corresponding line cache through a line cache write controller, and performs a bitmap transfer operation on the video stream in the line cache through a line cache read controller, and then stores it in the corresponding frame cache after rotation or flipping. Compared with the method of using four frame caches in the video rotation and flipping circuit in the prior art, the storage space can be reduced and the power consumption can be reduced without losing the quality of dynamic video images.
[0037] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1a It is a schematic diagram of a scene to which the video rotation and flipping method in the prior art is applicable;
[0040] Figure 1b is a flow chart of a video rotation and flipping method provided according to an embodiment of the present invention;
[0041] Figure 1c is a schematic diagram of a scenario applicable to a video rotation and flipping method provided in an embodiment of the present invention;
[0042] Figure 2a is a flow chart of another video rotation and flipping method provided according to an embodiment of the present invention;
[0043] Figure 2b is a schematic diagram of a scenario applicable to another video rotation and flipping method provided by an embodiment of the present invention;
[0044] Figure 3a is a flow chart of another video rotation and flipping method provided according to an embodiment of the present invention;
[0045] Figure 3b is a schematic diagram of a scenario applicable to another video rotation and flipping method provided by an embodiment of the present invention;
[0046] Figure 3c is a method logic flow chart of a row cache write controller provided according to an embodiment of the present invention;
[0047] Figure 3d is a flow chart of a method for a line cache read controller to rotate a video stream by 90° according to an embodiment of the present invention;
[0048] Figure 3e is a flow chart of a method for a line cache read controller to rotate a video stream by 270° according to an embodiment of the present invention;
[0049] Figure 3f It is a flow chart of a method for a line cache read controller to flip a video stream up and down according to an embodiment of the present invention;
[0050] Figure 3g It is a flow chart of a method for a line cache read controller to flip a video stream left and right according to an embodiment of the present invention;
[0051] Figure 3h It is a flow chart of a method for a line cache read controller to simultaneously flip (rotate 180°) a video stream up and down and left and right according to an embodiment of the present invention;
[0052] Figure 4 is a structural schematic diagram of a video rotation and flipping device provided according to an embodiment of the present invention;
[0053] Figure 5 It is a schematic diagram of the structure of a chip for implementing the video rotation and flipping method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0055] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0056] Figure 1b A flowchart of a video rotation and flipping method provided in an embodiment of the present invention. This embodiment can be applied to the situation where a video stream is rotated and flipped during dynamic video stream transmission. The method can be executed by a video rotation and flipping device, and the video rotation and flipping device can be applied to a video rotation and flipping circuit in a chip. Figure 1c The schematic diagram of the scene applicable to the video rotation and flipping method in this embodiment is as follows. The video rotation and flipping circuit includes two sets of line buffers, two frame buffers, a line buffer write controller (line buffer writectrl) and a line buffer read controller (line buffer read ctrl). The method includes:
[0057] Step 110 : The input video stream is stored in the corresponding row cache in a ping-pong selection manner through the row cache write controller.
[0058] In this embodiment, each group of line cache may include n (n>1) cache units. After receiving the input video stream, the line cache write controller may select the cache units to be stored in the line cache through ping-pong.
[0059] Step 120 : Perform a bitmap transfer operation on the video stream in the line buffer, rotate or flip it, and then store it in the corresponding frame buffer through the line buffer read controller.
[0060] In this embodiment, the line buffer read controller can perform a bitmap transfer operation on the video stream in the line buffer, rotate or flip the rows or columns, and then copy and store them in the corresponding frame buffer.
[0061] The technical solution provided by the embodiment of the present invention deploys two groups of line caches and two frame caches in a video rotation and flipping circuit, stores the input video stream in a ping-pong selection manner in the corresponding line cache through a line cache write controller, and performs a bitmap transfer operation on the video stream in the line cache through a line cache read controller, and then stores it in the corresponding frame cache after rotation or flipping. Compared with the method of using four frame caches in the video rotation and flipping circuit in the prior art, the storage space can be reduced and the power consumption can be reduced without losing the quality of dynamic video images.
[0062] Figure 2a A flowchart of another video rotation and flipping method provided by an embodiment of the present invention, such as Figure 2a As shown, the method includes:
[0063] Step 210: Divide the row timing corresponding to the video rotation and flipping circuit into a first row time region and a second row time region.
[0064] In this embodiment, the row timing may be divided into a first row time zone (time zone x) and a second row time zone (time zone y), with the n-row cache unit being full or empty as the boundary.
[0065] Step 220: In the first row time zone, the input video stream is stored in the cache unit of the first row cache in a ping-pong selection manner through the row cache write controller; and the video stream in the second row cache is bitmap transferred, rotated or flipped, and then stored in the first frame cache or the second frame cache through the row cache read controller.
[0066] In this embodiment, Figure 2b It can be a schematic diagram of a scenario to which the video rotation and flipping method in this embodiment is applicable, such as Figure 2b As shown, the video rotation and flipping circuit may include two sets of line buffers (first line buffer and second line buffer) and two frame buffers (first frame buffer and second frame buffer). The first line buffer may include n buffer units (buffer1_line_0, buffer1_line_1...buffer1_line_n-1), and the second line buffer may include n buffer units (buffer2_line_0, buffer2_line_1...buffer2_line_n-1).
[0067] In time zone x, the row cache write controller can store the current n rows of input video streams into the cache unit of the first row cache through ping-pong selection. At the same time, the video stream in the second row cache can be copied and stored in the first frame cache or the second frame cache after being rotated or flipped through the bitmap transfer operation, row or column division of the row cache read controller.
[0068] Step 230: In the second row time zone, the input video stream is stored in the cache unit of the second row cache in a ping-pong selection manner through the row cache write controller; and the video stream in the first row cache is bitmap transferred, rotated or flipped, and then stored in the first frame cache or the second frame cache through the row cache read controller.
[0069] In this embodiment, if Figure 2b As shown, in time zone y, the row cache write controller can store the current n rows of input video streams in the cache unit of the second row cache through ping-pong selection. At the same time, the video stream in the first row cache can be rotated or flipped through the bitmap transfer operation, row or column of the row cache read controller, and then copied and stored in the first frame cache or the second frame cache.
[0070] The technical solution provided by the embodiment of the present invention divides the row timing corresponding to the video rotation and flipping circuit into a first row time area and a second row time area. In the first row time area, the input video stream is stored in the cache unit of the first row cache in a ping-pong selection manner through a row cache write controller; the video stream in the second row cache is bitmap transferred, rotated or flipped, and then stored in the first frame cache or the second frame cache through a row cache read controller. In the second row time area, the input video stream is stored in the cache unit of the second row cache in a ping-pong selection manner through a row cache write controller; the video stream in the first row cache is bitmap transferred, rotated or flipped, and then stored in the first frame cache or the second frame cache through a row cache read controller. This technical means can achieve the reduction of storage space and power consumption without losing the dynamic video image quality during the video rotation and flipping process.
[0071] On the basis of the above embodiment, the video stream in the line cache is subjected to a bitmap transfer operation, rotation or flipping, and then stored in the corresponding frame cache through a line cache read controller, including: dividing the frame timing corresponding to the video rotation and flipping circuit into a first frame time area and a second frame time area; after the video stream in the line cache is subjected to a bitmap transfer operation, rotation or flipping, the video stream is stored in a frame cache matching the frame time area in a ping-pong selection manner through a line cache read controller. After being stored in a frame cache matching the frame time area in a ping-pong selection manner, the frame data in another frame cache is also output to a subsequent logic in a ping-pong selection manner.
[0072] In a specific embodiment, the frame timing can be divided into a first frame time region (time region a) and a second frame time region (time region b), with the frame being full or empty as the boundary. The line cache read controller performs a bitmap transfer operation, rotation or flipping on the video stream in the line cache, and can store it in a frame cache matching the frame time region (time region a or time region b) in a ping-pong selection manner.
[0073] Figure 3a A flowchart of another video rotation and flipping method provided by an embodiment of the present invention, such as Figure 3a As shown, the method includes:
[0074] Step 310: divide the row timing corresponding to the video rotation and flipping circuit into a first row time region and a second row time region; divide the frame timing corresponding to the video rotation and flipping circuit into a first frame time region and a second frame time region.
[0075] Step 320: In the first row time zone, the input video stream is stored in the cache unit of the first row cache in a ping-pong selection manner through the row cache write controller; and the video stream in the second row cache is bitmap transferred, rotated or flipped, and then stored in the first frame cache or the second frame cache through the row cache read controller.
[0076] Step 330: In the second row time zone, the input video stream is stored in the cache unit of the second row cache in a ping-pong selection manner through the row cache write controller; and the video stream in the first row cache is bitmap transferred, rotated or flipped, and then stored in the first frame cache or the second frame cache through the row cache read controller.
[0077] Step 340: In the first frame time region, the video stream in the row cache is subjected to a bitmap transfer operation, rotation or flipping through a row cache read controller, and then stored in the first frame cache in a ping-pong selection manner; the frame data in the second frame cache is output to a subsequent logic device in a ping-pong selection manner.
[0078] In this embodiment, Figure 3b It can be a schematic diagram of a scenario to which the video rotation and flipping method in this embodiment is applicable, such as Figure 3b As shown, in time region a, the input video of the current frame is read out from the row cache and stored in the first frame cache in a ping-pong selection manner through the bitmap transfer operation of the row cache read controller; at the same time, the frame data in the second frame cache is output to the subsequent logic in a ping-pong selection manner.
[0079] Step 350, within the second frame time area, through the row cache read controller, the video stream in the row cache is subjected to bitmap transfer operation, rotation or flipping, and then stored in the second frame cache in a ping-pong selection manner, and the frame data in the first frame cache is output to the subsequent logic in a ping-pong selection manner.
[0080] In time region b, the input video of the current frame is read out from the row cache and stored in the second frame cache in a ping-pong selection manner through the bitmap transfer operation of the row cache read controller; at the same time, the frame data in the first frame cache is output to the subsequent logic in a ping-pong selection manner.
[0081] The technical solution provided by the embodiment of the present invention divides the row timing into a first row time area and a second row time area; divides the frame timing into a first frame time area and a second frame time area. In the first row time area, the row cache write controller stores the input video stream in a ping-pong selection manner in a cache unit of the first row cache; the row cache read controller performs a bitmap transfer operation, rotates or flips the video stream in the second row cache and stores it in the first frame cache or the second frame cache. In the second row time area, the row cache write controller stores the input video stream in a ping-pong selection manner in a cache unit of the second row cache; the row cache read controller performs a bitmap transfer operation, rotates or flips the video stream in the first row cache The video stream in the row cache is subjected to a bitmap transfer operation, rotation or flipping operation through a row cache read controller in the first frame time zone, and then stored in the first frame cache in a ping-pong selection manner; the frame data in the second frame cache is output to the subsequent logic in a ping-pong selection manner, and in the second frame time zone, the video stream in the row cache is subjected to a bitmap transfer operation, rotation or flipping operation through a row cache read controller, and then stored in the second frame cache in a ping-pong selection manner. The technical means of outputting the frame data in the first frame cache to the subsequent logic in a ping-pong selection manner can reduce the storage space and power consumption without losing the dynamic video image quality during the video rotation and flipping process.
[0082] Based on the above embodiments, Figure 3c The method logic flow chart of a row cache write controller in this embodiment can be as follows: Figure 3c As shown, after receiving the input video stream, the row cache write controller can determine whether the first row cache is written. If not, it writes in the order of cache unit addresses from 0 to n-1 (hactive is the row cache RAM depth). If yes, it starts writing the second row cache. After the row cache is full, the corresponding write flag is set to 1, otherwise it is set to 0.
[0083] The row cache read controller is usually set to 6 working modes: rotate 90°, rotate 180°, rotate 270°, flip up and down, mirror, and flip up and down, left and right at the same time. Among them, flip up and down, left and right at the same time is equivalent to rotating 180°, so the row cache read controller can actually be divided into 5 operating modes. Rotating 90° and rotating 270° will swap the width o_hactive and height o_vactive of the output video with those of the input video.
[0084] Figure 3d This is a flow chart of a method for a line cache read controller to rotate a video stream by 90° in this embodiment (hcnt_start is an initial output vector); Figure 3e This is a flow chart of a method for a line cache read controller to rotate a video stream by 270° in this embodiment; Figure 3f This is a flow chart of a method for a line buffer read controller to flip a video stream up and down in this embodiment; Figure 3g This is a flow chart of a method for a line buffer read controller to flip a video stream left and right in this embodiment; Figure 3h This is a flow chart of a method for a line cache read controller in this embodiment to simultaneously flip (rotate 180°) a video stream up and down and left and right.
[0085] Figure 4 The present invention provides a schematic diagram of the structure of a video rotation and flipping device according to an embodiment of the present invention. The device is applied to a video rotation and flipping circuit of a chip. The video rotation and flipping circuit includes two sets of line buffers, two frame buffers, a line buffer write controller, and a line buffer read controller. Figure 4 As shown, the device includes: a video stream storage module 410 and a video stream processing module 420.
[0086] The video stream storage module 410 is used to store the input video stream into the corresponding row cache in a ping-pong selection manner through the row cache write controller;
[0087] The video stream processing module 420 is used to perform a bitmap transfer operation on the video stream in the line buffer through a line buffer read controller, and then rotate or flip the video stream and store it in a corresponding frame buffer.
[0088] The technical solution provided by the embodiment of the present invention deploys two groups of line caches and two frame caches in a video rotation and flipping circuit, stores the input video stream in a ping-pong selection manner in the corresponding line cache through a line cache write controller, and performs a bitmap transfer operation on the video stream in the line cache through a line cache read controller, and then stores it in the corresponding frame cache after rotation or flipping. Compared with the method of using four frame caches in the video rotation and flipping circuit in the prior art, the storage space can be reduced and the power consumption can be reduced without losing the quality of dynamic video images.
[0089] Based on the above embodiment, the video stream storage module 410 includes:
[0090] A row timing division unit, used for dividing the row timing corresponding to the video rotation and flipping circuit into a first row time region and a second row time region;
[0091] A first line time storage unit is used to store the input video stream in a cache unit of the first line cache in a ping-pong selection manner through a line cache write controller within a first line time region;
[0092] The second line time storage unit is used to store the input video stream in the cache unit of the second line cache in a ping-pong selection manner through the line cache write controller in the second line time area.
[0093] The video stream processing module 420 includes:
[0094] A first line time processing unit is used to perform a bitmap transfer operation, rotate or flip the video stream in the second line buffer and store it in the first frame buffer or the second frame buffer through the line buffer read controller in the first line time region;
[0095] A second line time processing unit is used to perform a bitmap transfer operation, rotate or flip the video stream in the first line buffer and store it in the first frame buffer or the second frame buffer through the line buffer read controller in the second line time region;
[0096] A frame timing division unit is used to divide the frame timing corresponding to the video rotation and flipping circuit into a first frame time area and a second frame time area, and perform a bitmap transfer operation, rotation or flipping on the video stream in the line cache through a line cache read controller, and then store it in a frame cache matching the frame time area in a ping-pong selection manner;
[0097] A frame data output unit, for outputting frame data in another frame buffer to a subsequent logic device in a ping-pong selection manner after storing the frame data in a frame buffer matching the frame time region in a ping-pong selection manner;
[0098] A first frame time processing unit is used to perform a bitmap transfer operation, rotation or flipping on the video stream in the line buffer in the first frame time region through the line buffer read controller, and store it in the first frame buffer in a ping-pong selection manner; and output the frame data in the second frame buffer to the subsequent logic in a ping-pong selection manner;
[0099] The second frame time processing unit is used to perform bitmap transfer operation, rotation or flipping on the video stream in the row cache in the second frame time area through the row cache read controller, and store it in the second frame cache in a ping-pong selection manner; and output the frame data in the first frame cache to the subsequent logic in a ping-pong selection manner.
[0100] The above device can execute the methods provided by all the above embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not fully described in the embodiments of the present invention, please refer to the methods provided by all the above embodiments of the present invention.
[0101] Figure 5 FIG. 1 is a schematic diagram showing the structure of a chip 10 that can be used to implement an embodiment of the present invention, wherein the chip includes a video rotation and flipping circuit as described in any embodiment of the present invention. Figure 5 As shown, the chip 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the chip 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0102] A number of components in the chip 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the chip 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0103] The processor 11 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the video rotation and flipping method.
[0104] In some embodiments, the video rotation and flipping method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the chip 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the video rotation and flipping method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the video rotation and flipping method in any other appropriate manner (e.g., by means of firmware).
[0105] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0106] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0107] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0108] To provide interaction with a user, the systems and techniques described herein may be implemented on a chip having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the chip. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0109] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0110] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0111] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0112] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A video rotation and flipping method, It is characterized in that Applied to a video rotation and flipping circuit, the video rotation and flipping circuit includes two sets of line buffers, two frame buffers, a line buffer write controller and a line buffer read controller; the method includes: The input video stream is stored in the corresponding row cache in a ping-pong selection manner through the row cache write controller; The video stream in the line buffer is subjected to a bitmap transfer operation, rotated or flipped, and then stored in a corresponding frame buffer through a line buffer read controller.
2. The method according to claim 1, It is characterized in that The input video stream is stored in the corresponding row cache in a ping-pong selection manner through the row cache write controller, including: Dividing the row timing corresponding to the video rotation and flipping circuit into a first row time region and a second row time region; In the first line time region, the input video stream is stored in the cache unit of the first line cache in a ping-pong selection manner through the line cache write controller; In the second row time zone, the input video stream is stored in the cache unit of the second row cache in a ping-pong selection manner through the row cache write controller.
3. The method according to claim 2, It is characterized in that The video stream in the line buffer is subjected to a bitmap transfer operation, rotated or flipped, and then stored in a corresponding frame buffer through a line buffer read controller, including: In the first line time region, the video stream in the second line buffer is subjected to a bitmap transfer operation, rotated or flipped, and then stored in the first frame buffer or the second frame buffer through the line buffer read controller; In the second line time zone, the video stream in the first line buffer is subjected to a bitmap transfer operation, rotated or flipped, and then stored in the first frame buffer or the second frame buffer through the line buffer read controller.
4. The method according to claim 1, It is characterized in that The video stream in the line buffer is subjected to a bitmap transfer operation, rotated or flipped, and then stored in a corresponding frame buffer through a line buffer read controller, including: Dividing the frame timing corresponding to the video rotation and flipping circuit into a first frame time region and a second frame time region; The video stream in the line buffer is subjected to a bitmap transfer operation, rotation or flipping through a line buffer read controller, and then stored in a frame buffer with a matching frame time region in a ping-pong selection manner.
5. The method according to claim 4, It is characterized in that Through the line cache read controller, the video stream in the line cache is subjected to a bitmap transfer operation, rotated or flipped, and then stored in a frame cache matching the frame time region in a ping-pong selection manner, including: In the first frame time region, the video stream in the line buffer is subjected to a bitmap transfer operation, rotation or flipping through the line buffer read controller, and then stored in the first frame buffer in a ping-pong selection manner; In the second frame time region, the video stream in the line buffer is subjected to a bitmap transfer operation, rotation or flipping through the line buffer read controller, and then stored in the second frame buffer in a ping-pong selection manner.
6. The method according to claim 4, It is characterized in that After being stored in a frame buffer with frame time region matching in a ping-pong selection manner, it also includes: The frame data in another frame buffer is output to the subsequent logic in a ping-pong selection manner.
7. The method according to claim 6, It is characterized in that Output the frame data in another frame buffer to the subsequent logic in a ping-pong selection mode, including: In the first frame time region, the frame data in the second frame buffer is output to the subsequent logic in a ping-pong selection manner; In the second frame time region, the frame data in the first frame buffer is output to the subsequent logic in a ping-pong selection manner.
8. A video rotation and flipping device, It is characterized in that Applied to a video rotation and flipping circuit, the video rotation and flipping circuit includes two sets of line buffers, two frame buffers, a line buffer write controller and a line buffer read controller; the device includes: The video stream storage module is used to store the input video stream into the corresponding row cache in a ping-pong selection manner through the row cache write controller; The video stream processing module is used to perform a bitmap transfer operation on the video stream in the line buffer through a line buffer read controller, and then rotate or flip the video stream and store it in a corresponding frame buffer.
9. A chip, It is characterized in that The chip comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the video rotation and flipping method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the video rotation and flipping method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Semiconductor integrated circuit for displaying image
CN101996550A
Rapid self-adaptive frame rate conversion device and method
CN105872432A
Image rotation data processing device and display terminal
CN113126858A
Video data control circuit, drive method thereof, and display device and electronic device having video data control circuit
JP2007334323A
Image processing apparatus, image processing method, and display unit
JP2019168670A
