CN114900731B - Video definition switching method and device - Google Patents

Video definition switching method and device Download PDF

Info

Publication number
CN114900731B
CN114900731B CN202210335316.0A CN202210335316A CN114900731B CN 114900731 B CN114900731 B CN 114900731B CN 202210335316 A CN202210335316 A CN 202210335316A CN 114900731 B CN114900731 B CN 114900731B
Authority
CN
China
Prior art keywords
target
domain
video frame
video
center
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210335316.0A
Other languages
Chinese (zh)
Other versions
CN114900731A (en
Inventor
于芹
李小海
陶杰
刘超
季焕文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Migu Cultural Technology Co Ltd
China Mobile Communications Group Co Ltd
Original Assignee
Migu Cultural Technology Co Ltd
China Mobile Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Migu Cultural Technology Co Ltd, China Mobile Communications Group Co Ltd filed Critical Migu Cultural Technology Co Ltd
Priority to CN202210335316.0A priority Critical patent/CN114900731B/en
Publication of CN114900731A publication Critical patent/CN114900731A/en
Application granted granted Critical
Publication of CN114900731B publication Critical patent/CN114900731B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44012Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440263Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the spatial resolution, e.g. for displaying on a connected PDA

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses a video definition switching method and a device, wherein the method comprises the following steps: identifying and determining a target object based on a video frame played by the video, and dividing to obtain a target domain corresponding to the target object in the video frame; the target domain is taken as a rendering center, and the first resolution switching proportion is adjusted according to the distance between each position in the video frame and the rendering center, so that the second resolution switching proportion corresponding to different positions is obtained; the first resolution ratio is preset or determined according to definition selected by a user; and rendering the video frame according to the second resolution switching proportion to finish the definition switching of the video frame. According to the invention, different areas are divided, different rendering is performed according to different distances between different positions in the video frame and the rendering center and different switching proportions of the second resolution, so that the problems of large data volume of the whole pulled video stream, long time consumption of the switching process and the like in the prior art are solved.

Description

Video definition switching method and device
Technical Field
The invention relates to the technical field of computers, in particular to a video definition switching method and device.
Background
When watching video, the user can switch between different definition such as high definition, standard definition, low definition and the like according to watching requirements, network conditions and the like so as to obtain better watching effect. When the definition switching is performed, in the prior art, a video stream corresponding to the definition is acquired from the far end of the server according to the definition selected by the user, then the acquired video stream is decoded at the mobile terminal of the user, and the decoded video stream is displayed to the user.
However, in the prior art, when the definition is switched, the whole video stream needs to be acquired from the far end of the server, especially when the definition is switched from low definition to high definition, the high definition video stream needs to be acquired, the data volume of the pulled video stream is large, the network transmission time is long, after the video stream is pulled, the whole video stream needs to be decoded, the time spent in the processing flow is long, video clamping is easy to be caused, and the user experience is poor.
Disclosure of Invention
The present invention has been made in view of the above problems, and it is an object of the present invention to provide a video sharpness switching method and apparatus that overcomes or at least partially solves the above problems.
According to an aspect of the present invention, there is provided a video sharpness switching method, comprising:
identifying and determining a target object based on a video frame played by the video, and dividing to obtain a target domain corresponding to the target object in the video frame;
the target domain is taken as a rendering center, and the first resolution switching proportion is adjusted according to the distance between each position in the video frame and the rendering center, so that the second resolution switching proportion corresponding to different positions is obtained; the first resolution ratio is preset or determined according to definition selected by a user;
and rendering the video frame according to the second resolution switching proportion to finish the definition switching of the video frame.
According to another aspect of the present invention, there is provided a video sharpness switching apparatus, comprising:
the identification and division module is suitable for identifying and determining a target object based on a video frame played by the video, and dividing the target object into a target domain corresponding to the target object in the video frame;
the switching proportion module is suitable for taking the target domain as a rendering center, and adjusting the first resolution switching proportion according to the distance between each position in the video frame and the rendering center to obtain second resolution switching proportions corresponding to different positions; the first resolution ratio is preset or determined according to definition selected by a user;
and the zone rendering module is suitable for rendering the video frames according to the second resolution switching proportion so as to finish the definition switching of the video frames.
According to still another aspect of the present invention, there is provided an electronic apparatus including: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the video definition switching method.
According to still another aspect of the present invention, there is provided a computer storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the video sharpness switching method described above.
According to the video definition switching method and device, different areas are divided, different rendering is performed according to different second resolution switching proportions according to the distances between different positions in a video frame and a rendering center, and the problems that the overall pulling video stream data amount is large, the switching process is long in time consumption and the like in the prior art are solved.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 shows a flow chart of a video sharpness switching method according to one embodiment of the present invention;
FIG. 2a shows a schematic diagram comprising a target domain;
FIG. 2b shows a schematic diagram containing multiple target domains;
FIG. 2c shows a schematic diagram of a refinement process for target and non-target domains;
FIG. 2d shows a schematic diagram of the coordinate locations of key frames;
FIG. 2e is a schematic diagram showing calculating a second distance between each location in the keyframe and the rendering center;
FIG. 2f shows a schematic diagram of multiple threads simultaneously processing different regions of a keyframe;
fig. 3 shows a functional block diagram of a video sharpness switching apparatus according to one embodiment of the present invention;
fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
First, terms related to one or more embodiments of the present invention will be explained.
A pixel: the method is that a minimum unit in a video frame represented by a digital sequence represents the number of points of a video frame image, and if the size of a video picture is fixed, the higher the resolution is, the more pixels of the unit size are indicated, and the clearer the video picture is; if the resolution is fixed, the larger the video picture size, the fewer pixel points of the unit size, the more blurred the video picture.
Resolution ratio: the definition degree of the video picture detail is determined, and the definition degree is a parameter for measuring the data quantity in the image, namely the pixel value on the unit length and representing the density of the pixel points; the higher the resolution, the more pixels that are contained and the clearer the video picture.
Definition: the definition degree of each detail shadow line and the boundary of the video frame comprises different definition such as high definition, standard definition, low definition and the like, and the different resolution corresponds to the different definition.
Fig. 1 shows a flowchart of a video sharpness switching method according to an embodiment of the present invention. As shown in fig. 1, the video sharpness switching method specifically includes the following steps:
step S101, identifying and determining a target object based on a video frame played by the video, and dividing the target object into target domains corresponding to the target object in the video frame.
And identifying each video frame in the video based on the currently played video, and determining a target object contained in the video frame. The video comprises a plurality of video frames, and preferably, a video frame, i.e. a key frame, which plays a decisive role in a plurality of video frames of the video can be identified. Such as processing the key frame of GOP (Group of Pictures) being played, identifies the target object it contains. GOP (Group of Pictures) is a group of pictures, which is a period of a key frame, is a group of complete video frames, and can be completely played and displayed by one GOP. When the target object is identified, the key frame played by the video is analyzed, the contained target object is determined, including foreground objects, characters and the like, and the target object is identified and determined through a picture identification technology and the like. In the following description, a key frame is taken as an example, and each video frame may be selected for processing according to need in the implementation, which is not limited to the key frame.
The number of the target objects identified from the key frame can be one or more, so that the number of the target objects identified does not exceed a specified threshold, such as 4, for facilitating subsequent processing, and the subsequent partitioning of the key frame is prevented from being excessively complex.
The key frames may be divided into different regions according to the identified target object. The area where the target object is located is a target domain, and the area outside the target domain is a non-target domain. If the target object included in the key frame is identified as a person, as shown in fig. 2a, the region where the person is located is selected as a target domain, and the region other than the person is a non-target domain.
When the identified target object is a plurality of target objects, the plurality of target objects may be prioritized. Specifically, a preset number of key frame combinations before and after the key frame are acquired, for example, 10 key frames before and after the current key frame are acquired respectively, a group of key frame combinations is obtained, the occurrence times of a plurality of target objects in the key frame combinations are counted, the plurality of target objects are ordered according to the occurrence times from high to low, and the target object with the highest priority is determined. As shown in fig. 2b, the target objects included in the key frame include: the person and the mountain are determined, the target domain is the region where the person is located, the region where the mountain is located, and the region outside the person and the mountain is a non-target domain, which can also be called other domains. Counting the times of the people and the mountain in the key frame combination, and sequencing the people and the mountain from high to low according to the times of the people, wherein the times of the people are 8 times, the times of the mountain is 1 time, and the priority of the people is determined to be higher than that of the mountain. The person is a first target object, the mountain is a second target object, the target domain of the person is a first target domain, and the target domain of the mountain is a second target domain. For determining that the target domain with high priority needs to be complete, if the first target domain of the person includes a part of mountain, if the person stands on the mountain, in order to divide the first target domain of the complete person, the mountain on which the person stands may be set in the first target domain. The target objects are subjected to priority ranking, and the target object with the highest priority is determined, so that the target domain where the target object with the highest priority is located is taken as a rendering center, and the rendering effect of diffusion rendering or inward aggregation rendering to different areas of the key frame is realized.
Step S102, the target domain is used as a rendering center, and the first resolution switching proportion is adjusted according to the distance between each position in the video frame and the rendering center, so as to obtain the second resolution switching proportion corresponding to different positions.
The first resolution switching ratio may be preset, for example, according to the history data of the user viewing, the viewing history data statistics of a plurality of users, and the like; alternatively, the first resolution switch ratio may be determined according to a definition selected by the user during viewing. Specifically, according to the definition after the user selects the switching, the corresponding switching resolution can be determined. If the user selects the definition after switching as the standard definition, determining that the switching resolution corresponding to the standard definition is 960×720. And respectively calculating the ratio of the switching resolution in the horizontal direction and the vertical direction to the current video resolution, and taking the maximum value of the two as a first resolution switching ratio. The current video resolution is x y, the switching resolution selected by the user is a x b, and the first resolution switching proportion is as follows: f (a, b) =max (a/x, b/y), if the current video resolution is 1280×960, the switching resolution selected by the user is 960×720, calculating the ratio of the horizontal direction to the vertical direction, and taking the maximum value to obtain a first resolution switching ratio: f (a, b) =max (a/x, b/y) =max (960/1280, 720/960) =75%.
Before performing definition switching rendering on the video, further refining processing is performed on the divided target domain and non-target domain to obtain the target refined domain and the non-target refined domain, so that regional rendering is conveniently performed based on finer grained regions. The refinement treatment sets different refinement granularities according to different domain types, and non-target domains and target domains can be refined by adopting different sizes, so that the target domains are emphasized, the target domains are conveniently rendered in full quantity, and the definition of the target domains is ensured.
When the video is displayed, if the size is fixed, the higher the resolution ratio is, the more pixel points with unit size are indicated, and the clearer the picture is; if the resolution is fixed, the larger the size, the fewer pixel points indicating the unit size, the more blurred the picture. If the video frame size is w×h, the resolution is x×y, and the picture resolution k= (x×y)/(w×h). And when K is larger, the number of pixel points with unit size is larger, K is taken as a thinning factor, and different areas are thinned. Specifically, if the refinement size threshold of the non-target domain is set to be 300mm in the horizontal direction and 300mm in the vertical direction, for K, when K > =1, k=1 is set, so that too small divided areas are prevented, the size of the refinement area is too large, and refinement rendering cannot be achieved during rendering. For the non-target domain refinement process, the number of non-target refinement domains is s1= (((w+300)/300) ((h+300)/300))/K, where the refinement size threshold 300 of the non-target domain may be set according to implementation, for example, according to terminal device information used in implementation, such as model configuration, screen resolution, etc., and is not limited herein. For the target domain, the size of the target domain obtained by dividing is w1×h1, in order to better identify the target domain where the target image is located, the refinement size threshold of the target domain needs to be smaller in granularity, and may be set to a preset proportion of the refinement size threshold of the non-target domain, for example, 1/2, to obtain 150mm in the transverse direction and 150mm in the longitudinal direction, which is illustrated herein, and specifically, the preset proportion may be set according to the implementation situation, which is not limited herein. For the target domain refinement processing, the number of target refinement domains is s2= (((w1+150)/150) ((h1+150)/150))/K. And finishing refining according to the obtained number S2 of the target refining domains and the obtained number S1 of the non-target refining domains, and refining the target domains and the non-target domains in the key frame into a plurality of small areas as shown in 2 c. The middle part is a first target domain where a person is located, the two regions at the lower right part are second target domains where mountain bodies are located, and the target domains are refined according to the number of the target refined domains obtained by calculation of the size, the refined size threshold, the preset proportion, the K and the like of the target domains. The upper left part is a non-target domain, and the number of the non-target refined domains is calculated according to the calculated terminal display size, the refined size threshold, K and the like to refine. Here, when a plurality of target domains are provided, different refinement size thresholds, preset proportions, and the like may be set according to different priorities. The higher the priority the smaller the size of the target refinement domain, the largest the size of the non-target refinement domain.
After refinement processing, further judging the position of the display content of the target object in the target refinement domain, for example, the specific position of limbs, trunk and the like of the person in the target refinement domain, corresponding to the position of each target refinement domain marked by the digital marks such as the numbers 1-13 in fig. 2c, setting any position of the key frame as the target refinement domain containing the display content of the target object as the target point location domain, setting the second resolution switching proportion of the target point location domain as the percentage proportion, namely, switching whatever definition is selected by the user, and ensuring that the display of the person in the target point location domain adopts high definition for rendering. Here, the target object is the target object with the highest priority, so as to ensure that the target object is displayed most clearly.
In the embodiment, when the display content of the target object is not included in any position of the key frame except the region outside the target point position, for the regions, a mode of outwards diffusing by taking the target domain as the center is adopted, and according to different distances between each position in the key frame and the rendering center, the first resolution switching proportion of cutting selected by the user is adjusted, so that different second resolution switching proportions corresponding to different positions are obtained. For the target refinement domain and the non-target refinement domain, the same second resolution switching proportion is adopted in each target refinement domain; the same second resolution switching scale is used in each non-target refinement domain. When different distances between the target refining domain and the rendering center are calculated, confirming the refining domain where the position is located, for example, the position is located in a certain target refining domain or a certain non-target refining domain, and calculating the distance from the center of the target refining domain or the center of the certain non-target refining domain to the rendering center as the distance from the position to the rendering center so as to ensure that the same target refining domain or the non-target refining domain adopts the same second resolution ratio for rendering.
Specifically, for the key frame, the coordinates of each position may be determined first, as shown in fig. 2d, and a coordinate system is established according to the size of the key frame, where the upper left corner coordinate is (0, 0), and the lower right corner coordinate is (w, h), that is, the size width and height of the key frame. The coordinate system can be established by taking the upper left corner as the origin of coordinates as shown in fig. 2d, or can be established by setting different origins of coordinates according to the implementation condition, so as to determine the coordinates of each position in the key frame, thereby facilitating the subsequent calculation of the distance, and the specific coordinate establishment is not limited. In fig. 2d, (c 1, d 1) is the center coordinates of the target domain. Calculating a first distance from the edge position of the key frame to the rendering center by taking the center of the target domain as the rendering center, namely calculating the distances from the upper left corner (0, 0), the lower left corner (0, h), the upper right corner (w, 0) and the lower right corner (w, h) to (c 1, d 1) of the key frame, and takingWherein the maximum distance between the edge position of the key frame and the rendering center is the first distance. I.e. d=max Then respectively calculating the second distance from the center of the target refinement domain or the center of the non-target refinement domain to the rendering center, wherein the different positions in the key frame are located, if the coordinates of the center of any non-target refinement domain in the key frame are (c, d), the second distance is->And correspondingly adjusting the first resolution ratio according to the ratio of the second distance to the first distance to obtain a second resolution ratio of the position in the key frame. Specifically, the following formula can be adopted:
wherein R is a second resolution switching ratio, F (a, b) is a first resolution switching ratio, and D is a first distance.
For ease of understanding, the key frame size is 1280 x 960, the center of the target field is (600, 500), and the five-pointed star region contains the target object as shown in fig. 2 e. Calculate a first distance d=max And (3) taking (600, 500) as a rendering center, and calculating the second distance from the rendering center according to the center of a certain target refinement domain where the position is or the center of a non-target refinement domain when calculating the second distance. As shown in fig. 2e, the rendering center is taken as a center of circle for illustration, and any geometric shape may be selected in the implementation, which is not limited herein. The position is located in circle1And calculating a second distance from the square frame to the rendering center by taking the rendering center as a circle center and taking the second distance as a radius to make a circle to obtain circle1. The second distance from the square frame to the rendering center, that is, the radius of the circle1 circular line, and the distance from any point on the circular line to the rendering center are all radii, for the convenience of calculation, the coordinates on the coordinate axis formed by the dotted line in fig. 2e may be calculated, for example, the coordinates (320, 500) of the intersection point of circle1 and the left dotted line are calculated to obtain the second distance->The first resolution ratio is 75% calculated in step S102, and the second resolution ratio is calculated:
corresponding second distances from circle2, circle3 and circle4 to the rendering center can be calculated respectively to obtain second resolution switching ratios in circle2, circle3 and circle4 circular line areas:
gradually reducing from 100% of the rendering center to 93%,88%,85%,82% and 75% according to the above second resolution switching ratio. Taking 88% as an example, 1.2 dots are discarded every 10 pixel dots, and finally the dot resolution is reduced from 1280×960 to 1126×845. Similarly, when reduced to 75%, resolution was reduced to 960 x 720.
Step S103, the video frames are rendered according to the second resolution switching proportion, so that the definition switching of the video frames is completed.
When the user selects switching definition to switch from high definition to low definition, discarding pixel points in different areas according to a second resolution switching proportion from a target area for the area of the pulled high definition video stream, so as to achieve the smoothness of continuous outward diffusion; and for the region which is not pulled to the video stream, directly switching to the low-definition video stream which is pulled to the region, and rendering.
When the user selects the switching definition to switch from low definition to high definition, according to the second resolution switching proportion, the low pixel point area is continuously subjected to bit supplementing and stream pulling to the target area, so that the smooth effect of continuously and inwards condensing is achieved.
Furthermore, when the pixel points are discarded or the video stream is pulled, the multi-thread mode can be adopted for rendering, so that the rendering speed is improved. Specifically, the video streams of different areas are respectively pulled by using multithreading for processing, one thread processes the video stream of one area, decodes the video stream, discards pixels of the area, and the like, as shown in fig. 2f, thread 1 processes a first target domain, thread 2 processes a partial area of a second target domain (1), thread 3 processes a partial area of the second target domain (2), and thread 4 processes a non-target domain. The multipath threads can process a plurality of areas simultaneously, so that the processing speed is improved, different areas are switched by adopting different definition, a smooth diffusion or aggregation effect is provided for a user, and the user watching experience is improved.
According to the video definition switching method provided by the invention, the rendering speed can be improved by dividing and multiplexing different areas to render simultaneously, and meanwhile, different areas are rendered differently according to different second resolution switching proportions, so that the problems of large data volume of the whole pulled video stream, long time consumption of the switching process and the like in the prior art are solved.
Fig. 3 shows a functional block diagram of a video sharpness switching apparatus according to one embodiment of the present invention. As shown in fig. 3, the video sharpness switching apparatus includes the following modules:
the identification and division module 310 is adapted to identify and determine a target object based on a video frame played by a video, and divide the target object into a target domain corresponding to the target object in the video frame;
the switching proportion module 320 is adapted to adjust the first resolution switching proportion according to the distance between each position in the video frame and the rendering center by taking the target domain as the rendering center, so as to obtain the second resolution switching proportion corresponding to different positions; the first resolution ratio is preset or determined according to definition selected by a user;
the partition rendering module 330 is adapted to render the video frame according to the second resolution switching ratio, so as to complete the definition switching of the video frame.
Optionally, the video frame is a key frame;
the identification partitioning module 310 is further adapted to:
analyzing a key frame of video playing, and identifying a target object contained in the key frame;
dividing the key frame into different areas according to the identified target object; the area where the target object is located is a target domain, and the area outside the target domain is a non-target domain.
Optionally, the apparatus further comprises: the resolution determining module 340 is adapted to determine a corresponding switching resolution according to the definition after the switching selected by the user; and respectively calculating the ratio of the switching resolution in the horizontal direction and the vertical direction to the current video resolution, and taking the maximum value of the two as a first resolution switching ratio.
Optionally, the handover proportion module 320 is further adapted to:
carrying out refinement treatment on the target domain and the non-target domain to obtain a target refinement domain and a non-target refinement domain; wherein, the refinement treatment sets different refinement granularities according to different domain types;
if any position of the video frame is a target refinement domain containing the display content of the target object, setting the position as a target point location domain, and setting a second resolution switching proportion of the target point location domain as a percentage proportion;
if any position of the video frame does not contain the display content of the target object, taking the center of the target domain as a rendering center, calculating a first distance from the edge position of the video frame to the rendering center, and calculating a second distance from the center of the target refinement domain or the center of the non-target refinement domain in the video frame to the rendering center; the first distance is the maximum distance between the edge position of the video frame and the rendering center; and adjusting the first resolution ratio according to the ratio of the second distance to the first distance to obtain a second resolution ratio of the position in the video frame.
Optionally, the partition rendering module 330 is further adapted to:
according to the second resolution switching proportion, respectively pulling video streams of different areas by adopting multithreading to process so as to render the video frames in different areas and finish definition switching; wherein, a thread processes a video stream of an area, decodes the video stream and/or discards pixels of the area.
Optionally, the target object is a plurality of;
optionally, the handover proportion module 320 is further adapted to:
and taking the area where the target object with the highest priority is positioned as a rendering center, and adjusting the first resolution switching proportion according to the distance between each position in the video frame and the rendering center to obtain a second resolution switching proportion corresponding to different positions.
Optionally, the apparatus further comprises: the ordering module 350 is adapted to acquire a preset number of video frame combinations before and after the video frame; counting the occurrence times of a plurality of target objects in the video frame combination; and sequencing the plurality of target objects according to the occurrence times from high to low, and determining the priority of the target objects according to the sequencing.
The above descriptions of the modules refer to the corresponding descriptions in the method embodiments, and are not repeated herein.
The application also provides a non-volatile computer storage medium, which stores at least one executable instruction, and the computer executable instruction can execute the video definition switching method in any of the above method embodiments.
Fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the present invention, and the embodiment of the present invention is not limited to the specific implementation of the electronic device.
As shown in fig. 4, the electronic device may include: a processor 402, a communication interface (Communications Interface) 404, a memory 406, and a communication bus 408.
Wherein:
processor 402, communication interface 404, and memory 406 communicate with each other via communication bus 408.
A communication interface 404 for communicating with network elements of other devices, such as clients or other servers.
The processor 402 is configured to execute the program 410, and may specifically perform relevant steps in the video sharpness switching method embodiment described above.
In particular, program 410 may include program code including computer-operating instructions.
The processor 402 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in the electronic device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
Memory 406 for storing programs 410. Memory 406 may comprise high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
Program 410 may be specifically configured to cause processor 402 to perform the video sharpness switching method of any of the method embodiments described above. The specific implementation of each step in the procedure 410 may refer to the corresponding step and corresponding description in the unit in the above video sharpness switching embodiment, which is not repeated herein. It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus and modules described above may refer to corresponding procedure descriptions in the foregoing method embodiments, which are not repeated herein.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with the teachings herein. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
Various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functions of some or all of the components in a video sharpness switching apparatus according to embodiments of the present invention may be implemented in practice using a microprocessor or Digital Signal Processor (DSP). The present invention can also be implemented as an apparatus or device program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present invention may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or provided in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names.

Claims (10)

1. A video sharpness switching method, comprising:
identifying and determining a target object based on a video frame played by a video, and dividing the target object into target domains corresponding to the target object in the video frame;
the target domain is taken as a rendering center, and a first resolution switching proportion is adjusted according to the distance between each position in the video frame and the rendering center, so that a second resolution switching proportion corresponding to different positions is obtained; the first resolution switching proportion is preset or determined according to definition selected by a user; carrying out refinement treatment on the target domain and the non-target domain to obtain a target refinement domain and a non-target refinement domain; taking the distance from the center of the target refinement domain or the center of the non-target refinement domain to the rendering center as the distance from the position to the rendering center; if any position of the video frame is a target refinement domain containing display content of a target object, setting the position as a target point position domain, and setting a second resolution switching proportion of the target point position domain as a percentage proportion; if any position of the video frame does not contain the display content of the target object, taking the center of the target domain as a rendering center, calculating a first distance from the edge position of the video frame to the rendering center, and calculating a second distance from the center of the target refinement domain or the center of the non-target refinement domain in the video frame to the rendering center; the first distance is the maximum distance between the edge position of the video frame and the rendering center; according to the ratio of the second distance to the first distance, the first resolution switching proportion is adjusted, and a second resolution switching proportion of the position in the video frame is obtained;
and rendering the video frame according to the second resolution switching proportion to finish the definition switching of the video frame.
2. The method of claim 1, wherein the video frame is a key frame;
the video frame identification based on video playing determines a target object, and the dividing to obtain a target domain corresponding to the target object in the video frame further comprises:
analyzing a key frame of video playing, and identifying a target object contained in the key frame;
dividing the key frame into different areas according to the identified target object; the area where the target object is located is a target area, and the area outside the target area is a non-target area.
3. The method of claim 1, wherein determining the first resolution switching ratio based on the user-selected sharpness comprises:
determining corresponding switching resolution according to the definition after switching selected by a user;
and respectively calculating the ratio of the switching resolution to the current video resolution in the horizontal direction and the vertical direction, and taking the maximum value of the ratio as a first resolution switching ratio.
4. The method according to claim 2, wherein the refinement process sets different refinement granularity according to different domain types.
5. The method of claim 1, wherein rendering the video frame at the second resolution switch scale to complete the sharpness switch of the video frame further comprises:
according to the second resolution ratio, respectively pulling video streams of different areas by adopting multithreading to process so as to conduct regional rendering on the video frames and finish definition switching; wherein, a thread processes a video stream of an area, decodes the video stream and/or discards pixels of the area.
6. The method of claim 1, wherein the target object is a plurality of;
the step of using the target domain as a rendering center, and adjusting the first resolution switching ratio according to the distance between each position in the video frame and the rendering center, and obtaining the second resolution switching ratio corresponding to different positions further comprises:
and taking the area where the target object with the highest priority is positioned as a rendering center, and adjusting the first resolution switching proportion according to the distance between each position in the video frame and the rendering center to obtain a second resolution switching proportion corresponding to different positions.
7. The method according to claim 6, wherein determining the priority of the target object comprises:
acquiring video frame combinations of a preset number before and after a video frame;
counting the occurrence times of a plurality of target objects in the video frame combination;
and sequencing the plurality of target objects according to the occurrence times from high to low, and determining the priority of the target objects according to the sequencing.
8. A video sharpness switching apparatus, characterized in that the apparatus comprises:
the identification and division module is suitable for identifying and determining a target object based on a video frame played by a video, and dividing the target object into a target domain corresponding to the target object in the video frame;
the switching proportion module is suitable for taking the target domain as a rendering center, and adjusting the first resolution switching proportion according to the distance between each position in the video frame and the rendering center to obtain a second resolution switching proportion corresponding to different positions; the first resolution switching proportion is preset or determined according to definition selected by a user; carrying out refinement treatment on the target domain and the non-target domain to obtain a target refinement domain and a non-target refinement domain; taking the distance from the center of the target refinement domain or the center of the non-target refinement domain to the rendering center as the distance from the position to the rendering center; if any position of the video frame is a target refinement domain containing display content of a target object, setting the position as a target point position domain, and setting a second resolution switching proportion of the target point position domain as a percentage proportion; if any position of the video frame does not contain the display content of the target object, taking the center of the target domain as a rendering center, calculating a first distance from the edge position of the video frame to the rendering center, and calculating a second distance from the center of the target refinement domain or the center of the non-target refinement domain in the video frame to the rendering center; the first distance is the maximum distance between the edge position of the video frame and the rendering center; according to the ratio of the second distance to the first distance, the first resolution switching proportion is adjusted, and a second resolution switching proportion of the position in the video frame is obtained;
and the partition rendering module is suitable for rendering the video frame according to the second resolution switching proportion so as to finish the definition switching of the video frame.
9. An electronic device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is configured to store at least one executable instruction, where the executable instruction causes the processor to perform operations corresponding to the video sharpness switching method according to any of claims 1-7.
10. A computer storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the video sharpness switching method according to any of claims 1-7.
CN202210335316.0A 2022-03-31 2022-03-31 Video definition switching method and device Active CN114900731B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210335316.0A CN114900731B (en) 2022-03-31 2022-03-31 Video definition switching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210335316.0A CN114900731B (en) 2022-03-31 2022-03-31 Video definition switching method and device

Publications (2)

Publication Number Publication Date
CN114900731A CN114900731A (en) 2022-08-12
CN114900731B true CN114900731B (en) 2024-04-09

Family

ID=82715041

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210335316.0A Active CN114900731B (en) 2022-03-31 2022-03-31 Video definition switching method and device

Country Status (1)

Country Link
CN (1) CN114900731B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117061791B (en) * 2023-10-12 2024-01-26 深圳云天畅想信息科技有限公司 Cloud video frame self-adaptive collaborative rendering method and device and computer equipment
CN117319935B (en) * 2023-11-28 2024-07-23 深圳市碧源达科技有限公司 Data interaction method and system based on Bluetooth positioning

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2596870A1 (en) * 1986-04-08 1987-10-09 Bbc Brown Boveri & Cie DIGITAL MEASURING METHOD FOR THE QUASIALLY ANALOGUE DISPLAY OF MEASURED VALUES AND DEVICE FOR IMPLEMENTING SAID METHOD
US6020893A (en) * 1997-04-11 2000-02-01 Novalogic, Inc. System and method for realistic terrain simulation
WO2017138994A1 (en) * 2016-02-12 2017-08-17 Qualcomm Incorporated Foveated video rendering
CN108089791A (en) * 2017-12-29 2018-05-29 努比亚技术有限公司 Screen resolution method of adjustment, mobile terminal and computer readable storage medium
CN108848414A (en) * 2018-06-26 2018-11-20 曜宇航空科技(上海)有限公司 The switching method and player of a kind of playback method of video, clarity
CN109168078A (en) * 2018-09-10 2019-01-08 苏宁智能终端有限公司 A kind of video definition switching method and device
CN109242943A (en) * 2018-08-21 2019-01-18 腾讯科技(深圳)有限公司 A kind of image rendering method, device and image processing equipment, storage medium
CN109739460A (en) * 2019-01-04 2019-05-10 京东方科技集团股份有限公司 VR display methods and equipment, computer readable storage medium
CN109766011A (en) * 2019-01-16 2019-05-17 北京七鑫易维信息技术有限公司 A kind of image rendering method and device
CN109996115A (en) * 2017-12-29 2019-07-09 深圳华侨城卡乐技术有限公司 Video broadcasting method, storage medium and player based on multiwindow rendering
CN112164016A (en) * 2020-09-23 2021-01-01 京东方科技集团股份有限公司 Image rendering method and system, VR (virtual reality) equipment, device and readable storage medium
CN112465939A (en) * 2020-11-25 2021-03-09 上海哔哩哔哩科技有限公司 Panoramic video rendering method and system
CN113596561A (en) * 2021-07-29 2021-11-02 北京达佳互联信息技术有限公司 Video stream playing method and device, electronic equipment and computer readable storage medium
CN113825020A (en) * 2021-09-18 2021-12-21 北京百度网讯科技有限公司 Video definition switching method, device, equipment, storage medium and program product

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101345379B1 (en) * 2007-06-28 2014-01-22 삼성전자주식회사 Method and apparatus for rendering three dimensional graphics data
IN2013CH03069A (en) * 2013-07-09 2015-08-28 Samsung India Software Operations Pvt Ltd
US10311548B2 (en) * 2017-09-05 2019-06-04 Microsoft Technology Licensing, Llc Scaling render targets to a higher rendering resolution to display higher quality video frames
JP7278766B2 (en) * 2018-12-21 2023-05-22 キヤノン株式会社 Image processing device, image processing method and program

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2596870A1 (en) * 1986-04-08 1987-10-09 Bbc Brown Boveri & Cie DIGITAL MEASURING METHOD FOR THE QUASIALLY ANALOGUE DISPLAY OF MEASURED VALUES AND DEVICE FOR IMPLEMENTING SAID METHOD
US6020893A (en) * 1997-04-11 2000-02-01 Novalogic, Inc. System and method for realistic terrain simulation
WO2017138994A1 (en) * 2016-02-12 2017-08-17 Qualcomm Incorporated Foveated video rendering
CN109996115A (en) * 2017-12-29 2019-07-09 深圳华侨城卡乐技术有限公司 Video broadcasting method, storage medium and player based on multiwindow rendering
CN108089791A (en) * 2017-12-29 2018-05-29 努比亚技术有限公司 Screen resolution method of adjustment, mobile terminal and computer readable storage medium
CN108848414A (en) * 2018-06-26 2018-11-20 曜宇航空科技(上海)有限公司 The switching method and player of a kind of playback method of video, clarity
CN109242943A (en) * 2018-08-21 2019-01-18 腾讯科技(深圳)有限公司 A kind of image rendering method, device and image processing equipment, storage medium
CN109168078A (en) * 2018-09-10 2019-01-08 苏宁智能终端有限公司 A kind of video definition switching method and device
CN109739460A (en) * 2019-01-04 2019-05-10 京东方科技集团股份有限公司 VR display methods and equipment, computer readable storage medium
CN109766011A (en) * 2019-01-16 2019-05-17 北京七鑫易维信息技术有限公司 A kind of image rendering method and device
CN112164016A (en) * 2020-09-23 2021-01-01 京东方科技集团股份有限公司 Image rendering method and system, VR (virtual reality) equipment, device and readable storage medium
CN112465939A (en) * 2020-11-25 2021-03-09 上海哔哩哔哩科技有限公司 Panoramic video rendering method and system
CN113596561A (en) * 2021-07-29 2021-11-02 北京达佳互联信息技术有限公司 Video stream playing method and device, electronic equipment and computer readable storage medium
CN113825020A (en) * 2021-09-18 2021-12-21 北京百度网讯科技有限公司 Video definition switching method, device, equipment, storage medium and program product

Also Published As

Publication number Publication date
CN114900731A (en) 2022-08-12

Similar Documents

Publication Publication Date Title
CN114900731B (en) Video definition switching method and device
US11109029B2 (en) Video enhancement method and device
CN109840491B (en) Video stream playing method, system, computer device and readable storage medium
WO2022001220A1 (en) Method for presenting shared display element in pages, and electronic device and storage medium
CN112182299B (en) Method, device, equipment and medium for acquiring highlight in video
CN112199140A (en) Application frame insertion method and related device
KR101710966B1 (en) Image anti-aliasing method and apparatus
US11810524B2 (en) Virtual reality display device and control method thereof
CN113709560B (en) Video editing method, device, equipment and storage medium
CN110738598A (en) Image adaptation method, electronic device and storage medium
CN112788337A (en) Video automatic motion compensation method, device, equipment and storage medium
CN114845158A (en) Video cover generation method, video publishing method and related equipment
CN114092310A (en) Image rendering method, electronic device and computer-readable storage medium
CN106407009A (en) Picture display method and device
CN114827718A (en) Method and device for self-adaptive alignment display of real-time video screen-combining characters in cloud conference
CN106658095A (en) Webcasting video transmission method, server and user equipment
US10482610B2 (en) Detection of partially motion-blurred video frames
CN112700456A (en) Image area contrast optimization method, device, equipment and storage medium
CN111477183A (en) Reader refresh method, computing device, and computer storage medium
CN116309488A (en) Image definition detection method, device, electronic equipment and readable storage medium
CN104112266B (en) Image edge blurring detecting method and device
CN110941413B (en) Display screen generation method and related device
CN109814703B (en) Display method, device, equipment and medium
CN107977644B (en) Image data processing method and device based on image acquisition equipment and computing equipment
CN110807729B (en) Image data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant