A screen mirroring method, terminal, and storage medium
By detecting the image type and applying screen content encoding technology, computer-generated images are encoded, which solves the problem of poor processing of text-type content in the prior art, and achieves efficient and low-latency screen projection effect.
Patent Information
- Application Number
- CN202210439660.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-25
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-04-25
AI Technical Summary
The existing screen projection technology does not work well for text content during the encoding process, resulting in loss of detail and ringing effects, and usually requires the sacrificing bandwidth to ensure clarity, making it difficult to achieve low latency and stable data transmission.
By detecting the image type of the screen image frame to be projected, if an image is generated for a computer, screen content encoding is adopted, including intra-block copy, palette mode, and transformation skip tools, to generate image-encoded data and transmit it to the screen projection device.
The encoding coding rate is reduced, the accurate restoration of screen image frames is ensured, the screen projection effect is improved, the detail loss and ringing effect are avoided, and low-latency and stable data transmission is achieved.
Smart Images

Figure CN114786015B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of communication technologies, and in particular, to a screen mirroring method, a terminal, and a storage medium. Background Art
[0002] Currently, screen mirroring technology has gradually become one of the main technologies for realizing interconnection and interoperability between devices. Screen mirroring technology can display the content of a terminal on various large-screen devices such as TVs, computers, tablets, and in-vehicle screens, bringing a better display experience and interactivity.
[0003] For screen mirroring technology, the screen content of a terminal is usually encoded by a standard video encoding technology within the range allowed by the Wi-Fi bandwidth and then transmitted. The currently commonly used standard video encoding does not work well for screen content, especially text content, which contains a large amount of high-frequency textures. After adopting the general encoding mode, details will be lost, and ringing effects are likely to occur. In order to maintain the clarity of the screen mirroring content, the bandwidth has to be sacrificed, but this usually brings pressure to the transmission and cannot achieve low-latency and stable data transmission. Summary of the Invention
[0004] Embodiments of the present application provide a screen mirroring method, a terminal, and a storage medium, which not only reduce the encoding bit rate but also can ensure that the screen image frames can be accurately restored, improving the screen mirroring effect of the screen image frames.
[0005] The technical solution of the embodiments of the present application is implemented as follows:
[0006] Embodiments of the present application provide a screen mirroring method, including:
[0007] When the screen mirroring function is turned on, detecting the image type of the screen image frame to be screen mirrored;
[0008] When the image type of the screen image frame is a computer-generated image, performing screen content encoding on the screen image frame to obtain image encoding data of the screen image frame;
[0009] Transmitting the image encoding data to a screen mirroring device for the screen mirroring device to display the screen image frame corresponding to the image encoding data.
[0010] In the above method, the detecting the image type of the screen image frame to be screen mirrored includes:
[0011] Monitoring the working state of the decoder corresponding to the screen image frame;
[0012] When the working state of the decoder is called, determining that the image type of the screen image frame is a natural image;
[0013] When the working state of the decoder is not called, determine that the image type of the screen image frame is a computer-generated image.
[0014] In the above method, the screen content encoding of the screen image frame to obtain the image encoding data of the screen image frame includes:
[0015] Divide the screen image frame into multiple coding blocks;
[0016] For each coding block in the multiple coding blocks, call the intra-block copy tool to perform intra-block copy processing to obtain corresponding intra-prediction data, and determine the corresponding intra-prediction data as the corresponding data to be encoded;
[0017] And / or, for each coding block in the multiple coding blocks, call the palette mode tool to generate a corresponding palette table, and determine the corresponding palette table as the corresponding data to be encoded; each palette table includes the index relationship of the color components of the pixel points within a coding block;
[0018] And / or, for each coding block in the multiple coding blocks, encode the corresponding data to be encoded using a preset coding standard and a transform skip tool to obtain corresponding encoded data; the transform skip tool instructs to skip the frequency domain transform operation in the preset coding standard;
[0019] Based on the coding data corresponding to each coding block in the multiple coding blocks, determine the image coding data of the screen image frame.
[0020] In the above method, for each coding block in the multiple coding blocks, calling the intra-block copy tool to perform intra-block copy processing and determining the corresponding intra-prediction data includes:
[0021] For the current block in the multiple coding blocks, call the intra-block copy tool to search for a prediction block corresponding to the current block from the already encoded coding blocks in the multiple coding blocks; the current block is any unencoded coding block;
[0022] Based on the prediction block found, copy the prediction for the current block to determine the intra-prediction data corresponding to the current block.
[0023] In the above method, for each coding block in the multiple coding blocks, calling the palette module tool to generate a corresponding palette table includes:
[0024] Call the palette module tool to respectively count the pixel color distribution in each coding block in the multiple coding blocks to obtain the pixel color distribution result corresponding to each coding block;
[0025] For each of the multiple coding blocks, a corresponding color palette table is established according to the corresponding pixel color distribution result.
[0026] In the above method, before transmitting the image coding data to the screen mirroring device, the method further includes:
[0027] Establish a Wi-Fi connection with the screen mirroring device;
[0028] The transmitting the image coding data to the screen mirroring device includes:
[0029] Transmit the image coding data to the screen mirroring device through the Wi-Fi transmission protocol.
[0030] In the above method, after detecting the image type of the screen image frame to be screen mirrored when the screen mirroring function is turned on, the method further includes:
[0031] When the image type of the screen image frame is a natural image, encode the screen image frame using a preset coding standard to obtain the standard coding data of the screen image frame;
[0032] Transmit the standard coding data to the screen mirroring device for the screen mirroring device to display the screen image frame corresponding to the standard coding data.
[0033] An embodiment of the present application provides a terminal, including:
[0034] A detection module, configured to detect the image type of the screen image frame to be screen mirrored when the screen mirroring function is turned on;
[0035] An encoding module, configured to perform screen content encoding on the screen image frame when the image type of the screen image frame is a computer-generated image to obtain the image coding data of the screen image frame;
[0036] A communication module, configured to transmit the image coding data to the screen mirroring device for the screen mirroring device to display the screen image frame corresponding to the image coding data.
[0037] An embodiment of the present application provides a terminal, including: a processor, a memory, and a communication bus;
[0038] The communication bus is used to implement a communication connection between the processor and the memory;
[0039] The processor is configured to execute one or more computer programs stored in the memory to implement the above screen mirroring method.
[0040] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above screen mirroring method is implemented.
[0041] An embodiment of the present application provides a screen mirroring method, a terminal, and a storage medium. The screen mirroring method includes: when the screen mirroring function is turned on, detecting the image type of the screen image frame to be mirrored; when the image type of the screen image frame is a computer-generated image, performing screen content encoding on the screen image frame to obtain image encoding data of the screen image frame; and transmitting the image encoding data to a screen mirroring device for the screen mirroring device to display the screen image frame corresponding to the image encoding data. The technical solution provided by the embodiment of the present application applies the screen content encoding function to the scenario of terminal screen mirroring, adaptively calls the screen content encoding function according to the image type of the screen image frame actually to be mirrored, thereby not only reducing the encoding bit rate, but also ensuring that the screen image frame can be accurately restored and improving the screen mirroring effect of the screen image frame. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a schematic flowchart of a screen mirroring method provided by an embodiment of the present application;
[0043] Figure 2 is a schematic diagram of the principle of an exemplary intra-frame block copy provided by an embodiment of the present application;
[0044] Figure 3 is a schematic flowchart of an exemplary process for establishing a color palette table provided by an embodiment of the present application;
[0045] Figure 4 is a schematic flowchart of an exemplary process for screen image frame screen mirroring provided by an embodiment of the present application;
[0046] Figure 5 is a schematic diagram of the structure of a terminal provided by an embodiment of the present application Figure 1 ;
[0047] Figure 6 is a schematic diagram of the structure of a terminal provided by an embodiment of the present application Figure 2 。 DETAILED DESCRIPTION OF THE EMBODIMENTS
[0048] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] The technical solution of the present application and how the technical solution of the present application solves the above technical problems will be specifically described below through embodiments in combination with the accompanying drawings. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0050] In addition, the technical solutions described in the embodiments of the present application can be arbitrarily combined without conflict.
[0051] The embodiment of the present application provides a screen mirroring method, which is applied to a terminal. Specifically, the terminal can be any type of electronic device such as a mobile phone or a tablet computer, and the embodiment of the present application does not make any limitations.
[0052] Figure 1 It is a schematic flowchart of a screen mirroring method provided by an embodiment of the present application. As Figure 1 shown, in the embodiment of the present application, the screen mirroring method executed by the terminal mainly includes the following steps:
[0053] S101. When the screen mirroring function is turned on, detect the image type of the screen image frame to be screen mirrored.
[0054] In the embodiment of the present application, when the screen mirroring function is turned on, the terminal can detect the image type of the screen image frame to be screen mirrored.
[0055] It should be noted that, in the embodiment of the present application, the screen image frame to be screen mirrored can be an image frame in the video to be screen mirrored, specifically one or more image frames, which can be presented on the display screen of the terminal. The specific screen image frame can be determined according to actual needs and application scenarios, and the embodiment of the present application does not make any limitations.
[0056] It should be noted that, in the embodiment of the present application, the terminal can be configured with a button for controlling the turning on and off of the screen mirroring function, or the display screen of the terminal can present an icon for controlling the turning on and off of the screen mirroring function. The user can control the turning on or off of the screen mirroring function by operating the button or touching the icon.
[0057] Specifically, in the embodiment of the present application, the terminal detects the image type of the screen image frame to be screen mirrored, including: monitoring the working state of the decoder corresponding to the screen image frame; when the working state of the decoder is called, determining that the image type of the screen image frame is a natural image; when the working state of the decoder is not called, determining that the image type of the screen image frame is a computer-generated image.
[0058] It should be noted that in the embodiments of the present application, the terminal includes a decoder. The terminal calls the screen image frame. Specifically, the screen image frame can be presented on the display screen. During this period, the terminal can monitor the working state of the decoder and determine the image type of the screen image frame according to whether the decoder is called.
[0059] It should be noted that in the embodiments of the present application, the image type can include two types. One is a natural image, and the other is a computer-generated image. Among them, the natural image can be an image frame of a natural video played by a video application software, and can include images captured by a camera. The computer-generated image can be various graphics, text images, etc. generated by the terminal system, usually images generated by calculation. Compared with natural images, computer-generated images have characteristics such as no noise, discrete hues, delicate lines, and sharp edges.
[0060] It can be understood that in the embodiments of the present application, when a natural image is called, there is often a process of calling the decoding ability. Therefore, the terminal can know the image type of the screen image frame by monitoring the decoding information. Specifically, that is, monitoring whether the decoder is called. If the decoder has been called, the screen image frame is a natural image. If not, the screen image frame is a computer-generated image.
[0061] S102. When the image type of the screen image frame is a computer-generated image, perform screen content encoding on the screen image frame to obtain the image encoding data of the screen image frame.
[0062] In the embodiments of the present application, when the image type of the screen image frame is a computer-generated image, the terminal performs screen content encoding on the screen image frame to obtain the image encoding data of the screen image frame.
[0063] It should be noted that in the embodiments of the present application, if the image type of the screen image frame is a computer-generated image, the terminal performs screen content encoding on the screen image frame. This is because computer-generated images have characteristics such as no noise, discrete hues, delicate lines, and sharp edges. If direct general standard video encoding is performed on them, the detailed parts will be lost, and ringing effects are likely to occur. However, screen content encoding can make better use of the characteristics of computer-generated images to avoid the loss of image details and ringing effects.
[0064] Specifically, in the embodiments of the present application, the terminal performs screen content encoding on the screen image frame to obtain the image encoding data of the screen image frame, including: dividing the screen image frame into multiple coding blocks; for each coding block among the multiple coding blocks, invoking an intra-block copy tool to perform intra-block copy processing to obtain corresponding intra-prediction data, and determining the corresponding intra-prediction data as the corresponding data to be encoded; and / or, for each coding block among the multiple coding blocks, invoking a palette mode tool to generate a corresponding palette table, and determining the corresponding palette table as the corresponding data to be encoded; each palette table includes the index relationship of the color components of the pixel points within a coding block; and / or, for each coding block among the multiple coding blocks, encoding the corresponding data to be encoded by using a preset coding standard and a transform skip tool to obtain the corresponding encoded data; the transform skip tool instructs to skip the frequency domain transform operation in the preset coding standard; based on the coding data corresponding to each coding block among the multiple coding blocks, determining the image encoding data of the screen image frame.
[0065] It should be noted that, in the embodiments of the present application, the terminal can divide the screen image frame into multiple coding blocks, and the size of each coding block is the same. For each coding block, one or more of the following processes are performed: intra-block copy processing, generation of a palette table, and skipping of the frequency domain transform. Among them, the tools for implementing the above three screen content encoding methods include: an intra-block copy tool, a palette mode tool, and a transform skip tool, which are the key technologies for improving the coding compression ability. These tools can not only be used in the coding tools of the H.265 coding standard, but also be adapted to the coding tools of the H.264 coding standard, so as to integrate the screen content encoding function as a practical software coding ability.
[0066] Specifically, in the embodiments of the present application, for each coding block among the multiple coding blocks, invoking an intra-block copy tool to perform intra-block copy processing to obtain corresponding intra-prediction data, including: for the current block among the multiple coding blocks, invoking an intra-block copy tool to search for the prediction block corresponding to the current block from the already encoded coding blocks among the multiple coding blocks; the current block is any unencoded coding block; based on the reference block found, performing predictive copy prediction on the current block to determine the intra-prediction data corresponding to the current block.
[0067] Figure 2 This is a schematic diagram of the principle of an exemplary intra-block copy provided by the embodiments of the present application. As Figure 2As shown, in the embodiments of the present application, for a current block, the terminal can search among the encoded blocks to find the corresponding predicted block for copy prediction and determine the corresponding data to be encoded. In the figure, the filled part of the line represents the area covered by the encoded blocks, and the unfilled part represents the area covered by the unencoded blocks. Specifically, the unfilled small square is the current block, and the filled small square is the predicted block corresponding to the current block. BV is the block vector of the current block relative to the predicted block. Among them, the data to be encoded can specifically include the difference data between two blocks and the block vector of the current block relative to the predicted block.
[0068] It can be understood that in the embodiments of the present application, if the image type of the screen image frame is a computer-generated image, the correlation within the screen image frame is relatively high. Therefore, performing an intra-block copy operation using the intra-block copy tool can not only effectively achieve data compression and reduce the data that needs to be encoded, but also ensure the accurate restoration of the screen image frame.
[0069] It should be noted that in the embodiments of the present application, if the terminal fails to search for the predicted block corresponding to the current block, the data to be encoded corresponding to it can actually be the image data contained in the current block.
[0070] Specifically, in the embodiments of the present application, for each of the multiple encoded blocks, the terminal calls the palette module tool to generate a corresponding palette table, including: for each of the multiple encoded blocks, calling the palette module tool to respectively count the pixel color distribution in each encoded block to obtain the pixel color distribution result corresponding to each encoded block; for each of the multiple encoded blocks, establishing a corresponding palette table according to the corresponding pixel color distribution result.
[0071] It should be noted that in the embodiments of the present application, the principle of the palette mode is adapted to the image type of computer-generated images. Since the color content of this type of image is computationally generated and the colors are limited, the palette mode can be used to record color values in an enumerated form and establish a palette table. Specifically, as Figure 3 shown, the terminal can first analyze the pixel color distribution in the encoded block. For example, use the histogram statistics method to perform pixel color distribution statistics, and then establish a palette table according to the statistical situation. The palette table includes the index relationship of the color components of the pixel points, and finally encodes the palette table into a syntax element for the subsequent projection device to complete image color restoration.
[0072] It should be noted that in the embodiments of the present application, the terminal specifically counts the color components of the pixel points in the encoded block to establish a corresponding palette table.
[0073] Specifically, in the embodiments of the present application, the terminal can call the transformation skip tool to skip the frequency domain transformation operation that needs to be performed before normal encoding. Since the screen image frame is a computer-generated image, the differences in its statistical characteristics of natural images, mainly the differences in noise and edge information, result in the fact that spatial transformation does not bring compression advantages in some cases. Therefore, the frequency domain transformation operation in the preset encoding standard can be skipped. Specifically, quantization and entropy encoding can be directly performed on the data to be encoded.
[0074] It should be noted that, in the embodiments of the present application, the preset encoding standard is the criterion that needs to be followed for encoding, which can be preset according to actual requirements and application scenarios. Specifically, the preset encoding standard can be selected from two encoding standards, H.264 and H.265. Of course, the preset encoding standard can also be other specific encoding standards, which are not limited in the embodiments of the present application.
[0075] It should be noted that, in the embodiments of the present application, the terminal can determine the image encoding data based on the encoding data corresponding to each of the multiple encoding blocks.
[0076] It can be understood that, in the embodiments of the present application, for the screen image frame with the image type of computer-generated image, the terminal adopts the encoding method of screen content encoding and calls the above tool for encoding. While retaining the detailed information of the image to a certain extent, it can compress the data that needs to be encoded, thereby not only reducing the encoding bit rate, but also ensuring that the screen image frame can be accurately restored and improving the screen projection effect of the screen image frame.
[0077] S103. Transmit the image encoding data to the screen projection device for the screen projection device to display the screen image frame corresponding to the image encoding data.
[0078] In the embodiments of the present application, when the terminal obtains the image encoding data, it can transmit the image encoding data to the screen projection device.
[0079] It should be noted that, in the embodiments of the present application, the screen projection device can specifically be any electronic device equipped with a display screen, and the specific screen projection device is not limited in the embodiments of the present application.
[0080] It can be understood that, in the embodiments of the present application, the image encoding data carries the image data of the screen image frame. When the terminal transmits the image encoding data to the screen projection device, the screen projection device can decode the image encoding data to restore the screen image frame, and the screen projection device can then realize the display of the screen image frame, that is, complete the screen projection of the screen image frame.
[0081] It should be noted that in the embodiments of the present application, before the terminal transmits the image coding data to the screen mirroring device, the following steps may also be performed: establishing a Wi-Fi connection with the screen mirroring device. Correspondingly, when the terminal transmits the image coding data to the screen mirroring device, it includes: transmitting the image coding data to the screen mirroring device through the Wi-Fi transmission protocol.
[0082] It should be noted that in the embodiments of the present application, the terminal can not only transmit the image coding data to the screen mirroring device through the Wi-Fi transmission protocol, but also implement the transmission of the image coding data through other wireless communication technologies. For example, the terminal can pre-establish a Bluetooth connection with the screen mirroring device, and thus transmit the image coding data to the screen mirroring device through the Bluetooth transmission protocol. The specific transmission method of the image coding data can be set according to actual requirements and application scenarios, and the embodiments of the present application do not make any limitations.
[0083] It should be noted that in the embodiments of the present application, after detecting the image type of the screen image frame to be screen-mirrored when the screen mirroring function is turned on, the following steps may also be performed: when the image type of the screen image frame is a natural image, encoding the screen image frame using a preset encoding standard to obtain the standard encoding data of the screen image frame; transmitting the standard encoding data to the screen mirroring device for the screen mirroring device to display the screen image frame corresponding to the standard encoding data.
[0084] It can be understood that in the embodiments of the present application, if the image type of the screen image frame is a natural image, the terminal can directly encode the screen image frame using a preset encoding standard. This is because natural images usually contain noise, and the tones are generally continuous and have complex textures. It is difficult to optimize the effect by the screen content encoding method, and instead, it will increase the calculation amount.
[0085] It should be noted that in the embodiments of the present application, when the terminal encodes the screen image frame using a preset encoding standard, its specific encoding steps are different from the above screen content encoding and follow the encoding steps set by the standard.
[0086] It should be noted that in the embodiments of the present application, the same as the above method of transmitting the image coding data, if the terminal encodes the screen image frame using a preset encoding standard to obtain the standard encoding data, the terminal can also transmit the standard encoding data to the screen mirroring device through the Wi-Fi transmission protocol or other wireless communication technologies. Similarly, the screen mirroring device can decode the standard encoding data, restore the screen image frame, and display the screen image frame.
[0087] Figure 4 This is a schematic flow diagram of an exemplary screen image frame screen mirroring provided by the embodiments of the present application. As Figure 4As shown, in an embodiment of the present application, after the terminal activates the screen mirroring function, it can select an encoding standard according to requirements to obtain a preset encoding standard. The selectable encoding standards can specifically include two encoding standards, H.264 and H.265. Of course, it can also be extended to include other encoding standards. After that, the terminal performs image type detection on the screen image frames, and then, according to the detection results, when the image type is computer-generated image, it selects to activate the screen content encoding function and calls relevant tools for encoding, which can achieve a lower bit rate and higher quality. When the image type is natural image, it selects to activate the normal encoding function, that is, directly encodes using the preset encoding standard. Finally, the terminal transmits the encoded data to the screen mirroring device through the Wi-Fi transmission protocol, and the screen mirroring device can use this data to display the screen image frames.
[0088] An embodiment of the present application provides a screen mirroring method applied to a terminal, including: detecting the image type of the screen image frame to be screen mirrored when the screen mirroring function is enabled; when the image type of the screen image frame is a computer-generated image, performing screen content encoding on the screen image frame to obtain image encoding data of the screen image frame; and transmitting the image encoding data to a screen mirroring device for the screen mirroring device to display the screen image frame corresponding to the image encoding data. The screen mirroring method provided by the embodiment of the present application applies the screen content encoding function to the scenario of terminal screen mirroring, adaptively calls the screen content encoding function according to the image type of the screen image frame to be screen mirrored actually required, thereby not only reducing the encoding bit rate, but also ensuring that the screen image frame can be accurately restored and improving the screen mirroring effect of the screen image frame.
[0089] An embodiment of the present application provides a terminal. Figure 5 The following is a structural schematic diagram of a terminal provided by an embodiment of the present application Figure 1 As Figure 5 shown, in an embodiment of the present application, the terminal includes:
[0090] A detection module 501, configured to detect the image type of the screen image frame to be screen mirrored when the screen mirroring function is enabled;
[0091] An encoding module 502, configured to perform screen content encoding on the screen image frame to obtain image encoding data of the screen image frame when the image type of the screen image frame is a computer-generated image;
[0092] A communication module 503, configured to transmit the image encoding data to a screen mirroring device for the screen mirroring device to display the screen image frame corresponding to the image encoding data.
[0093] In an embodiment of the present application, the detection module 501 is further configured to monitor the working state of the decoder corresponding to the screen image frame; when the working state of the decoder is called, determine that the image type of the screen image frame is a natural image; when the working state of the decoder is not called, determine that the image type of the screen image frame is a computer-generated image.
[0094] In an embodiment of the present application, the encoding module 502 is further configured to divide the screen image frame into multiple encoding blocks; for each encoding block in the multiple encoding blocks, call the intra-block copy tool to perform intra-block copy processing to obtain corresponding intra-prediction data, and determine the corresponding intra-prediction data as the corresponding data to be encoded; and / or, for each encoding block in the multiple encoding blocks, call the palette mode tool to generate a corresponding palette table, and determine the corresponding palette table as the corresponding data to be encoded; each palette table includes the index relationship of the color components of the pixel points within an encoding block; and / or, for each encoding block in the multiple encoding blocks, encode the corresponding data to be encoded using a preset encoding standard and a transform skip tool to obtain corresponding encoded data; the transform skip tool instructs to skip the frequency domain transform operation in the preset encoding standard; determine the encoded data corresponding to each encoding block in the multiple encoding blocks as the image encoding data.
[0095] In an embodiment of the present application, the encoding module 502 is further configured to, for the current block in the multiple encoding blocks, call the intra-block copy tool to search for the prediction block corresponding to the current block from the encoded encoding blocks in the multiple encoding blocks; the current block is any unencoded encoding block; perform copy prediction on the current block based on the searched prediction block to determine the intra-prediction data corresponding to the current block.
[0096] In an embodiment of the present application, the encoding module 502 is further configured to call the palette module tool to respectively count the pixel color distribution in each encoding block in the multiple encoding blocks to obtain the pixel color distribution result corresponding to each encoding block; for each encoding block in the multiple encoding blocks, establish a corresponding palette table according to the corresponding pixel color distribution result.
[0097] In an embodiment of the present application, the communication module 503 is further configured to establish a Wi-Fi connection with the screen mirroring device; transmit the image encoding data to the screen mirroring device through the Wi-Fi transmission protocol.
[0098] In an embodiment of the present application, the encoding module 502 is further configured to, when the image type of the screen image frame is a natural image, encode the screen image frame using a preset encoding standard to obtain the standard encoding data of the screen image frame.
[0099] The communication module 503 is further configured to transmit the standard encoded data to the screen mirroring device for the screen mirroring device to display the screen image frame corresponding to the standard encoded data.
[0100] Figure 6 The structural schematic diagram of a terminal provided by an embodiment of the present application Figure 2 . As Figure 6 shown, the terminal includes: a processor 601, a memory 602, and a communication bus 603;
[0101] The communication bus 603 is used to implement the communication connection between the processor 601 and the memory 602;
[0102] The processor 601 is configured to execute one or more computer programs stored in the memory 602 to implement the above screen mirroring method.
[0103] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above screen mirroring method is implemented. The computer-readable storage medium may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or it may also be a device including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.
[0104] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories and optical memories, etc.) containing computer-usable program codes.
[0105] This application is described with reference to the schematic flow diagrams and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each process and / or block in the schematic flow diagrams and / or block diagrams, and the combination of processes and / or blocks in the schematic flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices generate means for implementing the functions specified in one or more of the processes and / or blocks in the schematic flow Figure 1 one or more of the processes Figure 1 or blocks specified in one or more of the blocks
[0106] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in one or more of the processes and / or blocks in the schematic flow Figure 1 one or more of the processes Figure 1 or blocks specified in one or more of the blocks
[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more of the processes and / or blocks in the schematic flow Figure 1 one or more of the processes Figure 1 or blocks specified in one or more of the blocks
[0108] As described above, it is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claimed rights.
Claims
1. A screen mirroring method, characterized in that, applied to a terminal, including: When the screen mirroring function is turned on, detecting the image type of the screen image frame to be mirrored; When the image type of the screen image frame is a computer-generated image, performing screen content encoding on the screen image frame to obtain image encoding data of the screen image frame; Transmitting the image encoding data to a screen mirroring device for the screen mirroring device to display the screen image frame corresponding to the image encoding data; The detecting the image type of the screen image frame to be mirrored includes: Monitoring the working state of the decoder corresponding to the screen image frame; When the working state of the decoder is called, determining that the image type of the screen image frame is a natural image; When the working state of the decoder is not called, determining that the image type of the screen image frame is a computer-generated image.
2. The method according to claim 1, characterized in that, The performing screen content encoding on the screen image frame to obtain image encoding data of the screen image frame includes: Dividing the screen image frame into multiple coding blocks; For each coding block in the multiple coding blocks, calling an intra-block copy tool to perform intra-block copy processing to obtain corresponding intra-prediction data, and determining the corresponding intra-prediction data as corresponding data to be encoded; And / or, for each coding block in the multiple coding blocks, calling a palette mode tool to generate a corresponding palette table, and determining the corresponding palette table as corresponding data to be encoded; each palette table includes an index relationship of color components of pixel points within a coding block; And / or, for each coding block in the multiple coding blocks, encoding the corresponding data to be encoded by using a preset coding standard and a transform skip tool to obtain corresponding encoded data; the transform skip tool instructs to skip the frequency domain transform operation in the preset coding standard; Based on the encoded data corresponding to each coding block in the multiple coding blocks, determining the image encoding data of the screen image frame.
3. The method according to claim 2, characterized in that, The for each coding block in the multiple coding blocks, calling an intra-block copy tool to perform intra-block copy processing to obtain corresponding intra-prediction data includes: For the current block in the multiple coding blocks, calling the intra-block copy tool to search for a prediction block corresponding to the current block from the already encoded coding blocks in the multiple coding blocks; the current block is any unencoded coding block; Based on the prediction block found, copying and predicting the current block to determine the intra-prediction data corresponding to the current block.
4. The method according to claim 2, characterized in that, The for each coding block in the multiple coding blocks, calling a palette module tool to generate a corresponding palette table includes: Calling the palette module tool to respectively count the pixel color distribution conditions within each coding block in the multiple coding blocks to obtain a pixel color distribution result corresponding to each coding block; For each coding block in the multiple coding blocks, establishing a corresponding palette table according to the corresponding pixel color distribution result.
5. The method according to claim 1, wherein, before transmitting the image encoding data to the screen mirroring device, the method further includes: establishing a Wi-Fi connection with the screen mirroring device; transmitting the image encoding data to the screen mirroring device, including: transmitting the image encoding data to the screen mirroring device through a Wi-Fi transmission protocol.
6. The method according to claim 1, wherein, after detecting the image type of the screen image frame to be screen mirrored when the screen mirroring function is turned on, the method further includes: when the image type of the screen image frame is a natural image, encoding the screen image frame using a preset encoding standard to obtain standard encoding data of the screen image frame; transmitting the standard encoding data to the screen mirroring device for the screen mirroring device to display the screen image frame corresponding to the standard encoding data.
7. A terminal, wherein, comprising: a detection module, configured to detect the image type of the screen image frame to be screen mirrored when the screen mirroring function is turned on; wherein, detecting the image type of the screen image frame to be screen mirrored includes: monitoring the working state of the decoder corresponding to the screen image frame; when the working state of the decoder is called, determining that the image type of the screen image frame is a natural image; when the working state of the decoder is not called, determining that the image type of the screen image frame is a computer-generated image; an encoding module, configured to perform screen content encoding on the screen image frame when the image type of the screen image frame is a computer-generated image to obtain image encoding data of the screen image frame; a communication module, configured to transmit the image encoding data to the screen mirroring device for the screen mirroring device to display the screen image frame corresponding to the image encoding data.
8. A terminal, wherein, comprising: a processor, a memory and a communication bus; the communication bus is configured to implement a communication connection between the processor and the memory; the processor is configured to execute one or more computer programs stored in the memory to implement the screen mirroring method according to any one of claims 1-6.
9. A computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, it implements the screen mirroring method according to any one of claims 1-6.
Citation Information
Patent Citations
Method and device for detecting screen content in coding process
CN113949870A