Video frame rendering method and device, electronic equipment, readable storage medium and program product
By responding to user operations, calculating target vertices and texture coordinates, and re-drawing video frames, the problem of insufficient video rendering clarity in mobile devices is solved, and higher video rendering clarity is achieved.
Patent Information
- Application Number
- CN202411659532.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-20
AI Technical Summary
In scenarios such as video conferencing, due to the small screen of the mobile device, users need to zoom, drag and other operations to see the video content shared by the screen, resulting in insufficient clarity of the video rendering and intensifying the degree of blur.
A video frame rendering method is provided. In response to user's operations, by obtaining display morphological changes information, the target vertex coordinates and target texture coordinates of the video frame to be rendered are calculated, and the video frame is re-drawn to improve rendering clarity.
By calculating the target vertex coordinates and texture coordinates in real time and re-drawing the video frame, the problem of insufficient video rendering is solved and the clarity of video rendering is significantly improved.
Smart Images

Figure CN119520899A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a video frame rendering method, device, electronic device, computer-readable storage medium and computer program product. Background Art
[0002] With the development of image processing and Internet technology, video content can be shared to multiple terminals for different users to watch in scenarios such as video conferencing. For example, when a participant starts screen sharing of desktop or document content, other participants can pull the video stream shared by the host.
[0003] For example, on mobile devices, due to their small screens, users often need to zoom, drag, and perform other operations to clearly see the video content shared on the screen. In current technologies, such operations by users often cause the video content rendered on the screen to become blurred, resulting in insufficient video rendering clarity. Summary of the invention
[0004] Based on this, it is necessary to provide a video frame rendering method, device, electronic device, computer-readable storage medium and computer program product to address the above technical problems.
[0005] In a first aspect, the present application provides a video frame rendering method, comprising:
[0006] In response to an operation for changing a display form of a video, obtaining target vertex coordinates and target texture coordinates corresponding to a video frame to be rendered according to display form change information;
[0007] The to-be-rendered video frame is rendered according to the target vertex coordinates and the target texture coordinates.
[0008] In one of the embodiments, the method of obtaining target vertex coordinates and target texture coordinates corresponding to the video frame to be rendered according to the display form change information includes: obtaining the overlapping part of the texture coordinate system and the vertex coordinate system after the display form change according to the display form change information; obtaining the target vertex coordinates according to the position of the overlapping part in the vertex coordinate system, and obtaining the target texture coordinates according to the position of the overlapping part in the texture coordinate system.
[0009] In one of the embodiments, obtaining the overlapping part of the texture coordinate system and the vertex coordinate system after the display morphology change according to the display morphology change information includes: updating the coordinates of the texture coordinate system according to the display morphology change information to obtain the texture coordinate system after the display morphology change; obtaining the overlapping part according to the boundary range of the texture coordinate system after the display morphology change and the boundary range of the vertex coordinate system.
[0010] In one embodiment, the operation includes scaling and / or displacement operation; the display morphology change information includes scaling information and / or displacement information; the updating of the texture coordinate system according to the display morphology change information to obtain the texture coordinate system after the display morphology change includes: scaling and / or displacement processing of the texture coordinate system according to the scaling information and / or displacement information to obtain the texture coordinate system after the display morphology change.
[0011] In one of the embodiments, scaling and / or displacing the texture coordinate system according to the scaling information and / or displacement information to obtain the texture coordinate system after the display morphology changes includes: obtaining a transformation matrix including the scaling information and / or displacement information according to the scaling information and / or displacement information; and obtaining the texture coordinate system after the display morphology changes according to the transformation matrix and the texture coordinate system.
[0012] In one of the embodiments, rendering the video frame to be rendered according to the target vertex coordinates and the target texture coordinates includes: using an open graphics library to render the video frame to be rendered according to the target vertex coordinates and the target texture coordinates.
[0013] In a second aspect, the present application further provides a video frame rendering device, comprising:
[0014] An acquisition module, configured to respond to an operation for changing a display form of a video and acquire target vertex coordinates and target texture coordinates corresponding to a video frame to be rendered according to display form change information;
[0015] A rendering module is used to render the to-be-rendered video frame according to the target vertex coordinates and the target texture coordinates.
[0016] In a third aspect, the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0017] In response to an operation for changing a display form of a video, target vertex coordinates and target texture coordinates corresponding to a to-be-rendered video frame are acquired according to display form change information; and the to-be-rendered video frame is rendered according to the target vertex coordinates and target texture coordinates.
[0018] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0019] In response to an operation for changing a display form of a video, target vertex coordinates and target texture coordinates corresponding to a to-be-rendered video frame are acquired according to display form change information; and the to-be-rendered video frame is rendered according to the target vertex coordinates and target texture coordinates.
[0020] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0021] In response to an operation for changing a display form of a video, target vertex coordinates and target texture coordinates corresponding to a to-be-rendered video frame are acquired according to display form change information; and the to-be-rendered video frame is rendered according to the target vertex coordinates and target texture coordinates.
[0022] The above-mentioned video frame rendering method, device, electronic device, computer-readable storage medium and computer program product, in response to an operation for changing the display form of a video, obtains the target vertex coordinates and target texture coordinates corresponding to the video frame to be rendered according to the display form change information, and renders the video frame to be rendered according to the target vertex coordinates and target texture coordinates. This scheme can calculate the target vertex coordinates and target texture coordinates corresponding to the video frame to be rendered in real time according to the operation for changing the display form of a video triggered by a user, and redraw the video frame to be rendered according to the target vertex coordinates and target texture coordinates, thereby improving the clarity of video rendering. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0024] FIG1 is a diagram of an application environment of a video frame rendering method according to an embodiment;
[0025] FIG2 is a schematic diagram of a flow chart of a video frame rendering method in one embodiment;
[0026] FIG3 is a schematic diagram of a vertex coordinate system in one embodiment;
[0027] FIG4 is a schematic diagram of a texture coordinate system in one embodiment;
[0028] FIG5 is a schematic diagram of a rendering method in an embodiment;
[0029] FIG6 is a schematic diagram of a texture coordinate system after display morphology changes in one embodiment;
[0030] FIG7 is a schematic diagram of the position of the overlapping portion in the vertex coordinate system in one embodiment;
[0031] FIG8 is a schematic diagram of the position of the overlapping portion in the texture coordinate system in one embodiment;
[0032] FIG9 is a schematic diagram of a texture coordinate system after displaying a morphological change in another embodiment;
[0033] FIG10 is a schematic diagram of the position of the overlapping portion in the vertex coordinate system in another embodiment;
[0034] FIG11 is a schematic diagram of the position of overlapping parts in a texture coordinate system in another embodiment;
[0035] FIG12 is a structural block diagram of a video frame rendering device in one embodiment;
[0036] FIG. 13 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with 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.
[0038] Glossary of terms related to this application:
[0039] OpenGL (Open Graphics Library): is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. This interface consists of nearly 350 different function calls, used to draw simple graphics to more complex three-dimensional scenes. Efficient implementations of OpenGL (using graphics acceleration hardware) exist in Windows, some UNIX platforms, and Mac OS. Among them, OpenGL ES (OpenGL for Embedded Systems) is a subset of the OpenGL 3D graphics API, designed for embedded devices such as mobile phones, PDAs, and game consoles.
[0040] Texture: A texture is an OpenGL buffer used to store the color component values of an image, which controls the color of each pixel in a rendered triangle.
[0041] OpenGL video rendering: Render the texture to the view. The texture coordinates determine which part of the texture is rendered, and the vertex coordinates determine where to render to the view.
[0042] In the related art, for example, in Android mobile devices, due to their small screens, users often need to zoom, drag, and other operations to see the video content shared on the screen clearly. The Android platform provides some views that support zooming and dragging, such as TextureView (a view that can output the content stream as an external texture on it), and the video content played on TextureView can be scaled through the TextureView#setTransform(Matrix matrix) interface. However, since the scaling is implemented by the application programming interface provided by the view, the video content will not be redrawn after scaling, so even if the video content shared by the streaming end is clear, the existing content is originally blurred due to the size of the view, and the blurriness of the content after scaling will be aggravated. For example, the video content resolution is 2K, but the size of the rendering view is 640×360. Due to the small size of the rendering view, the 2K resolution video stream rendered to the view will also become blurred. If it is enlarged based on the view, the blurriness will be aggravated.
[0043] In this regard, an embodiment of the present application provides a video frame rendering method, which can calculate the target vertex coordinates and target texture coordinates corresponding to the video frame to be rendered in real time according to the operation triggered by the user to change the display form of the video, and redraw the video frame to be rendered according to the target vertex coordinates and target texture coordinates, thereby improving the clarity of the video rendering, solving the above-mentioned problem of video blur, and improving the clarity of the video rendering on the streaming end.
[0044] The video frame rendering method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be integrated on the server, or it can be placed on the cloud or other network servers. Among them, the terminal can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides cloud computing services. Among them, the terminal can pull the video stream shared in the video conference from the server, and the terminal can be used to execute the video frame rendering method of the present application to improve the clarity of the video rendering on the stream pulling end.
[0045] The video frame rendering method of the present application is described below in conjunction with various embodiments and corresponding drawings.
[0046] In an exemplary embodiment, as shown in FIG2 , a video frame rendering method is provided. The method may be executed by the terminal in FIG1 , and the method may include the following steps:
[0047] Step S201 , in response to an operation for changing a display form of a video, obtaining target vertex coordinates and target texture coordinates corresponding to a video frame to be rendered according to display form change information.
[0048] The display form of the video refers to the form in which the video is displayed on the screen. The display form of the video may include display position, display size, etc.
[0049] Among them, changing the display form of the video may include changing the display position, display size, etc. of the video.
[0050] The operation for changing the display form of the video may include a zoom operation, a displacement operation, etc. The zoom operation may be used to change the display size of the video, and the displacement operation may be used to change the display position of the video. As an implementation method, the operation for changing the display form of the video may be triggered on the screen of the terminal, which may be a gesture operation, or may be triggered by voice, which may be a voice command.
[0051] The display form change information refers to information used to indicate what kind of changes have been made to the display form of the video. The display form change information may include scaling information, displacement information, and the like.
[0052] The vertex coordinates corresponding to the video frame determine the position of the view View where the video frame is rendered. Therefore, the target vertex coordinates indicate the position of the view View where the video frame to be rendered is rendered.
[0053] The texture coordinates corresponding to the video frame determine which part of the texture corresponding to the video frame needs to be rendered. Thus, the target texture coordinates indicate which part of the texture corresponding to the video frame to be rendered is rendered.
[0054] In this step, the terminal can respond to the operation triggered by the user to change the display form of the video, and obtain the target vertex coordinates and target texture coordinates corresponding to the video frame to be rendered according to the display form change information, so as to determine the position of the view View and the part of the texture corresponding to the video frame to be rendered, thereby avoiding the problem of decreased video clarity caused by the application programming interface provided by the view View in the related technology, for example, not redrawing the video content after scaling.
[0055] Step S202: Render the video frame to be rendered according to the target vertex coordinates and the target texture coordinates.
[0056] In this step, the terminal can render the video frame to be rendered on the screen according to the target vertex coordinates and the target texture coordinates. The video frame to be rendered may include a video frame after the user triggers the above operation for changing the display form of the video, that is, the video frame acted on by the operation may be the video frame to be rendered.
[0057] As an implementation method, rendering the video frame to be rendered according to the target vertex coordinates and the target texture coordinates in step S202 may include: using an open graphics library to render the video frame to be rendered according to the target vertex coordinates and the target texture coordinates. This embodiment can use the open graphics library OpenGL to render the video frame to be rendered according to the target vertex coordinates and the target texture coordinates, and is thus applicable to systems or platforms such as Windows, some UNIX platforms, and Mac OS.
[0058] The video frame rendering method of the above embodiment, in response to the operation for changing the display form of the video, obtains the target vertex coordinates and target texture coordinates corresponding to the video frame to be rendered according to the display form change information, and renders the video frame to be rendered according to the target vertex coordinates and target texture coordinates. This solution can calculate the target vertex coordinates and target texture coordinates corresponding to the video frame to be rendered in real time according to the operation for changing the display form of the video triggered by the user, and redraw the video frame to be rendered according to the target vertex coordinates and target texture coordinates, thereby improving the clarity of video rendering.
[0059] In an exemplary embodiment, obtaining target vertex coordinates and target texture coordinates corresponding to the to-be-rendered video frame according to the display form change information in step S201 may include:
[0060] According to the display morphology change information, the overlapping part of the texture coordinate system and the vertex coordinate system after the display morphology change is obtained; the target vertex coordinates are obtained according to the position of the overlapping part in the vertex coordinate system, and the target texture coordinates are obtained according to the position of the overlapping part in the texture coordinate system.
[0061] The solution of this embodiment is described in conjunction with FIG. 3 to FIG. 11 .
[0062] In the embodiment of the present application, the relevant coordinates are expressed in the following manner: (left, top, right, bottom).
[0063] FIG3 shows a vertex coordinate system, which may be a vertex coordinate system of an open graphics library OpenGL. The vertex coordinate system is represented by a black solid line frame, which mainly describes the position of the view View where the video content (video frame) is rendered. The vertex coordinate system may take the center of the view View as the origin, the right side as the positive direction of the X axis, and the top side as the positive direction of the Y axis. For the convenience of description, the vertex coordinate system is normalized.
[0064] Among them, a texture coordinate system is shown in Figure 4, which can be a texture coordinate system of the open graphics library OpenGL. Among them, the texture coordinate system is represented by a black dotted line frame, which mainly describes which part of the texture corresponds to the rendered video frame. The texture coordinate system can take the lower left corner as the origin, the right as the positive direction of the X axis, and the top as the positive direction of the Y axis. For the convenience of description, the texture coordinate system is normalized.
[0065] Based on this, according to the vertex coordinate system shown in Figure 3 and the texture coordinate system shown in Figure 4, a rendering method is shown in Figure 5. This rendering method takes the terminal in vertical screen state as an example, and renders the texture corresponding to the video frame completely in the center, wherein the texture corresponding to the video frame is completely displayed in the middle position of the view View. At this time, the texture coordinates are (0, 1, 1, 0), and the vertex coordinates are (-1, 0.25, 1, -0.25).
[0066] Based on this, in this embodiment, after the user triggers the operation for changing the display form of the video, the terminal obtains the overlapping part of the texture coordinate system and the vertex coordinate system after the display form change according to the display form change information. That is, unlike the texture corresponding to the video frame being completely displayed in the middle of the view View, it is necessary to make corresponding changes to the display of the texture corresponding to the video frame at this time. Since the texture coordinate system undergoes a corresponding display form change, the overlapping part of the texture coordinate system and the vertex coordinate system after the display form change can be determined first. Figure 6 shows a texture coordinate system after the display form change. As an example, the texture coordinate system after the display form change can be compared with the texture coordinate system before the display form change. The texture is magnified by, for example, twice the center of the texture as the origin. Therefore, the overlapping part of the texture coordinate system and the vertex coordinate system after the display form change is shown in grayscale.
[0067] Based on this, in this embodiment, the terminal can obtain the target vertex coordinates according to the position of the overlapping part in the vertex coordinate system, and can also obtain the target texture coordinates according to the position of the overlapping part in the texture coordinate system.
[0068] FIG7 shows the position of the overlapping part in the vertex coordinate system. It can be seen that the position of the overlapping part in the vertex coordinate system is the vertex coordinate to be rendered, that is, the target vertex coordinate. In FIG7 , the target vertex coordinate is (-1, 0.5, 1, -0.5).
[0069] FIG8 shows the position of the overlapping part in the texture coordinate system. It can be seen that the position of the overlapping part in the texture coordinate system is the texture coordinate to be rendered, that is, the target texture coordinate. In FIG8 , the target texture coordinate is (0.25, 1, 0.75, 0).
[0070] As another example, Figure 9 shows another texture coordinate system after the display morphology changes. Compared with the texture coordinate system before the display morphology changes, the texture coordinate system after the display morphology changes may be slid / dragged / displaced to the position shown in Figure 9, and the overlapping part of the texture coordinate system after the display morphology changes and the vertex coordinate system is still shown in grayscale.
[0071] The position of the overlapping part in the vertex coordinate system is shown in Fig. 10 , and the position of the overlapping part in the vertex coordinate system is the vertex coordinate to be rendered, that is, the target vertex coordinate. In Fig. 10 , the target vertex coordinate is (-1, 1, 0, 0).
[0072] The position of the overlapping part in the texture coordinate system is shown in FIG11 , and the position of the overlapping part in the texture coordinate system is the texture coordinate to be rendered, that is, the target texture coordinate. In FIG11 , the target texture coordinate is (0.75, 1, 1, 0).
[0073] In an exemplary embodiment, the method of acquiring the overlapping portion of the texture coordinate system and the vertex coordinate system after the display form change according to the display form change information in the above embodiment may include:
[0074] The texture coordinate system is updated according to the display form change information to obtain the texture coordinate system after the display form change; and the overlapping part is obtained according to the boundary range of the texture coordinate system after the display form change and the boundary range of the vertex coordinate system.
[0075] In this embodiment, the terminal can update the coordinates of the texture coordinate system according to the display form change information, re-determine its relative position with the vertex coordinate system, and obtain the texture coordinate system after the display form changes. As described above, the texture coordinate system and the vertex coordinate system each have a boundary range, and the texture coordinate system and the vertex coordinate system after the display form changes can be drawn in the same coordinate system using two rectangular frames (black solid line frame and black dotted line frame) as shown in Figure 6 or Figure 9, thereby determining the relative position of the texture coordinate system and the vertex coordinate system after the display form changes and obtaining the overlapping part of the texture coordinate system and the vertex coordinate system after the display form changes according to the boundary range of the two rectangular frames (such as the gray part shown in Figure 6 or Figure 9). As an example, as shown in Figure 6 or Figure 9, for the overlapping part, the larger value of the coordinates of the black solid line border and the black dotted line border on the left (negative direction of the X-axis) (the boundary range of the two on the left) can be taken as the coordinate representation of the left side of the overlapping part, and the smaller value of the coordinates of the two on the top (positive direction of the Y-axis) (the boundary range of the two on the top) can be taken as the coordinate representation of the top of the overlapping part, and so on. The coordinate representation of the overlapping part can be obtained.
[0076] In an exemplary embodiment, the operation for changing the display form of the video may include a zoom operation and / or a displacement operation; the display form change information may include zoom information and / or displacement information. That is, the operation for changing the display form of the video may be a zoom operation, or a displacement operation, or a zoom operation and a displacement operation, and accordingly, the display form change information may be zoom information, or a displacement information, or a zoom information and a displacement information. Based on this, in the above embodiment, updating the coordinates of the texture coordinate system according to the display form change information to obtain the texture coordinate system after the display form change may include: performing zoom processing and / or displacement processing on the texture coordinate system according to the zoom information and / or displacement information to obtain the texture coordinate system after the display form change.
[0077] In this embodiment, the terminal can scale the texture coordinate system according to the scaling information to obtain the texture coordinate system after the display form changes, and the terminal can also perform displacement processing on the texture coordinate system according to the displacement information to obtain the texture coordinate system after the display form changes. The terminal can also scale the texture coordinate system according to the scaling information and perform displacement processing on the texture coordinate system according to the displacement information to obtain the texture coordinate system after the display form changes, which can be applied to the scaling and displacement (or dragging / sliding) processing of the video.
[0078] In an exemplary embodiment, the scaling and / or displacement processing is performed on the texture coordinate system according to the scaling information and / or displacement information to obtain the texture coordinate system after the display form is changed, which may include:
[0079] According to the scaling information and / or displacement information, a transformation matrix including the scaling information and / or displacement information is obtained; according to the transformation matrix and the texture coordinate system, a texture coordinate system after the display morphology is changed is obtained.
[0080] In this embodiment, the texture coordinate system can be scaled and / or displaced by a transformation matrix containing scaling information and / or displacement information to obtain a texture coordinate system after the display form is changed. As an example, the transformation matrix containing scaling information and displacement information can be expressed as:
[0081]
[0082] Among them, sx represents the scaling factor (scaling information) on the X axis, sy represents the scaling factor (scaling information) on the Y axis, tx represents the displacement distance (displacement information) on the X axis, and ty represents the displacement distance (displacement information) on the Y axis. According to the transformation matrix, the texture coordinate system can be scaled and displaced to obtain the texture coordinate system after the display form changes.
[0083] On the whole, the solution of the present application can use the open graphics library OpenGL to redraw / render video frames according to, for example, the scaled target vertex coordinates and target texture coordinates to improve video clarity. It can also implement scaling / displacement processing based on a 3×3 transformation matrix, and provide video content scaling / sliding (displacement) functions for controls that do not support scaling and sliding (such as Android's SurfaceView).
[0084] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0085] Based on the same inventive concept, the embodiment of the present application also provides a video frame rendering device for implementing the video frame rendering method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more video frame rendering device embodiments provided below can refer to the limitations of the video frame rendering method above, and will not be repeated here.
[0086] In an exemplary embodiment, as shown in FIG12 , a video frame rendering device is provided, and the device 1200 may include:
[0087] The acquisition module 1201 is used to respond to the operation for changing the display form of the video and acquire the target vertex coordinates and the target texture coordinates corresponding to the video frame to be rendered according to the display form change information;
[0088] The rendering module 1202 is used to render the to-be-rendered video frame according to the target vertex coordinates and the target texture coordinates.
[0089] In an exemplary embodiment, the acquisition module 1201 is used to obtain the overlapping part of the texture coordinate system and the vertex coordinate system after the display morphology change according to the display morphology change information; obtain the target vertex coordinates according to the position of the overlapping part in the vertex coordinate system, and obtain the target texture coordinates according to the position of the overlapping part in the texture coordinate system.
[0090] In an exemplary embodiment, the acquisition module 1201 is used to update the coordinates of the texture coordinate system according to the display form change information to obtain the texture coordinate system after the display form change; and obtain the overlapping part according to the boundary range of the texture coordinate system after the display form change and the boundary range of the vertex coordinate system.
[0091] In an exemplary embodiment, the operation includes scaling and / or displacement operations; the display morphology change information includes scaling information and / or displacement information; the acquisition module 1201 is used to scale and / or displace the texture coordinate system according to the scaling information and / or displacement information to obtain the texture coordinate system after the display morphology change.
[0092] In an exemplary embodiment, the acquisition module 1201 is used to obtain a transformation matrix containing the scaling information and / or displacement information according to the scaling information and / or displacement information; and obtain a texture coordinate system after the display morphology is changed according to the transformation matrix and the texture coordinate system.
[0093] In an exemplary embodiment, the rendering module 1202 is used to render the to-be-rendered video frame according to the target vertex coordinates and the target texture coordinates using the open graphics library.
[0094] Each module in the above video frame rendering device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in the electronic device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0095] In an exemplary embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG13. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a video frame rendering method is implemented. The display unit of the electronic device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.
[0096] Those skilled in the art will understand that the structure shown in FIG. 13 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0097] In one embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0098] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0099] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0100] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0101] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0102] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0103] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A video frame rendering method, characterized in that: The method comprises: In response to an operation for changing a display form of a video, obtaining target vertex coordinates and target texture coordinates corresponding to a video frame to be rendered according to display form change information; The to-be-rendered video frame is rendered according to the target vertex coordinates and the target texture coordinates.
2. The method according to claim 1, characterized in that The step of obtaining target vertex coordinates and target texture coordinates corresponding to the video frame to be rendered according to the display form change information includes: According to the display form change information, the overlapping part of the texture coordinate system and the vertex coordinate system after the display form change is obtained; The target vertex coordinates are obtained according to the position of the overlapping part in the vertex coordinate system, and the target texture coordinates are obtained according to the position of the overlapping part in the texture coordinate system.
3. The method according to claim 2, characterized in that The step of obtaining the overlapping portion of the texture coordinate system and the vertex coordinate system after the display form change according to the display form change information includes: updating the texture coordinate system according to the display form change information to obtain the texture coordinate system after the display form change; The overlapping portion is obtained according to the boundary range of the texture coordinate system after the display form change and the boundary range of the vertex coordinate system.
4. The method according to claim 3, characterized in that: The operation includes scaling and / or displacement operation; the display form change information includes scaling information and / or displacement information; The updating of the texture coordinate system according to the display form change information to obtain the texture coordinate system after the display form change includes: The texture coordinate system is scaled and / or displaced according to the scaling information and / or displacement information to obtain a texture coordinate system after the display morphology is changed.
5. The method according to claim 4, characterized in that The scaling and / or displacement processing is performed on the texture coordinate system according to the scaling information and / or displacement information to obtain the texture coordinate system after the display form is changed, including: Obtaining a transformation matrix including the scaling information and / or the displacement information according to the scaling information and / or the displacement information; According to the transformation matrix and the texture coordinate system, a texture coordinate system after the display morphology is changed is obtained.
6. The method according to any one of claims 1 to 5, characterized in that The step of rendering the to-be-rendered video frame according to the target vertex coordinates and the target texture coordinates includes: The video frame to be rendered is rendered using an open graphics library according to the target vertex coordinates and the target texture coordinates.
7. A video frame rendering device, characterized in that: The device comprises: An acquisition module, configured to respond to an operation for changing a display form of a video and acquire target vertex coordinates and target texture coordinates corresponding to a video frame to be rendered according to display form change information; A rendering module is used to render the to-be-rendered video frame according to the target vertex coordinates and the target texture coordinates.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
OpenGL ES based VR set-top box animation production enabling method and system
CN108805964A
Live broadcast image rendering method and device in mobile terminal and storage medium
CN109302618A
VR-based video rendering method and device, electronic equipment and storage medium
CN111754614A
Video and three-dimensional scene fusion method and device, electronic equipment and storage medium
CN112489225A
Image deformation method, device and equipment and readable storage medium
CN114913060A