CN114900731A - Video definition switching method and device - Google Patents

Video definition switching method and device Download PDF

Info

Publication number
CN114900731A
CN114900731A CN202210335316.0A CN202210335316A CN114900731A CN 114900731 A CN114900731 A CN 114900731A CN 202210335316 A CN202210335316 A CN 202210335316A CN 114900731 A CN114900731 A CN 114900731A
Authority
CN
China
Prior art keywords
target
video frame
video
switching
rendering
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.)
Granted
Application number
CN202210335316.0A
Other languages
Chinese (zh)
Other versions
CN114900731B (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.)
China Mobile Communications Group Co Ltd
MIGU Culture Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
MIGU Culture Technology 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 China Mobile Communications Group Co Ltd, MIGU Culture Technology Co Ltd filed Critical China Mobile Communications Group 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

Images

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, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44012Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 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, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 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, rendering scenes according to MPEG-4 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

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 a video, and dividing to obtain a target domain corresponding to the target object in the video frame; adjusting 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 to obtain second resolution switching proportions corresponding to different positions; wherein, the first resolution switching proportion is preset or determined according to the definition selected by the user; and rendering the video frame according to the second resolution switching proportion so as to complete the definition switching of the video frame. According to the invention, different rendering is carried out according to different second resolution switching proportions by dividing different areas and according to the distances between different positions and the rendering center in the video frame, so that the problems of large overall video stream data pulling quantity, long switching process time consumption 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 videos, a user can switch between different definitions such as high definition, standard definition and low definition according to watching needs, network conditions and the like so as to obtain a better watching effect. When performing definition switching, the prior art acquires a video stream with a corresponding definition from a server far end according to the definition selected by a user, then decodes the acquired video stream at a mobile terminal of the user, and displays the decoded video stream to the user.
However, in the prior art, when the definition is switched, the entire video stream needs to be acquired from the far end of the server, and particularly when the definition is switched from the low definition to the 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 entire video stream also needs to be decoded, the time spent on the processing flow is long, video blocking is easily caused, and the user experience is poor.
Disclosure of Invention
In view of the above, the present invention is proposed 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, including:
identifying and determining a target object based on a video frame played by a video, and dividing to obtain a target domain corresponding to the target object in the video frame;
adjusting 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 to obtain second resolution switching proportions corresponding to different positions; wherein, the first resolution switching proportion is preset or determined according to the definition selected by the user;
and rendering the video frame according to the second resolution switching proportion so as to complete 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 a video, and dividing to obtain a target domain corresponding to the target object in the video frame;
the switching proportion module is suitable for adjusting the first resolution switching proportion by taking the target domain as a rendering center 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; wherein, the first resolution switching proportion is preset or determined according to the definition selected by the user;
and the partition rendering module is suitable for rendering the video frame according to the second resolution switching proportion so as to complete the definition switching of the video frame.
According to still another aspect of the present invention, there is provided an electronic apparatus including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication 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 at least one executable instruction stored therein, the executable instruction 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 rendering is performed according to different second resolution switching proportions by dividing different areas and according to the distances between different positions and rendering centers in the video frame, and the problems that the video stream data volume is large, the switching process consumes long time and the like in the prior art are solved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
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 refer to like parts throughout the drawings. In the drawings:
fig. 1 shows a flow diagram of a video sharpness switching method according to an embodiment of the present invention;
FIG. 2a shows a schematic diagram containing a target domain;
FIG. 2b shows a schematic diagram containing a plurality of target domains;
FIG. 2c is a diagram illustrating a refinement process for the target domain and the non-target domain;
FIG. 2d shows a schematic of the coordinate locations of the keyframes;
FIG. 2e is a schematic diagram illustrating the calculation of second distances between locations in the keyframe and the rendering center;
FIG. 2f is a schematic diagram showing multiple threads processing different regions of a key frame simultaneously;
fig. 3 shows a functional block diagram of a video sharpness switching apparatus according to an 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, the noun terms to which one or more embodiments of the present invention relate are explained.
Pixel: the method is characterized in that the method is a minimum unit in a video frame represented by a digital sequence, the minimum unit represents the point number of a video frame image, and if the size of a video picture is fixed, the higher the resolution is, the more pixel points of the unit size are, and the clearer the video picture is; if the resolution is fixed, the larger the video picture size is, the fewer the pixel points in the unit size are, and the more blurred the video picture is.
Resolution ratio: the fineness of the video picture details is determined, the fineness is a parameter for measuring the data volume in the image, the pixel value on the unit length is used for representing the density of the pixel points; the higher the resolution, the more pixels are contained and the sharper the video picture.
Definition: the definition of each detail shadow and its boundary of the video frame includes different definitions such as high definition, standard definition, low definition, etc. and different resolutions correspond to different definitions.
Fig. 1 shows a flow chart of a video sharpness switching method according to an embodiment of the present invention. As shown in fig. 1, the video definition switching method specifically includes the following steps:
step S101, identifying and determining a target object based on a video frame played by a video, and dividing to obtain a target domain 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, the video frame which plays a decisive role, namely the key frame, in a plurality of video frames of the video can be identified. Such as processing the key frames of the gop (groups of pictures) being played, and identifying the target objects contained therein. GOP (group of pictures), which is a group of pictures, is a period of key frames, and is a group of complete video frames, and a GOP can be completely played and displayed. When the target object is identified, the contained target object, such as a foreground object, a person and the like, is determined by analyzing the key frame of the video playing, and the target object is identified and determined by the picture identification technology and the like. In the following description, the key frame is taken as an example, and in the specific implementation, each video frame can be selected and processed as needed, and the method is not limited to the key frame.
The number of the target objects identified from the key frame can be one or more, and for the convenience of subsequent processing, the number of the identified target objects does not exceed a specified threshold, such as 4, so that the subsequent partitioning of the key frame is avoided from being too complex.
The key frames may be divided into different regions according to the identified target object. The region of the target object is a target region, and the region outside the target region is a non-target region. If the target object included in the identified key frame is a person, as shown in fig. 2a, the area where the person is located is selected as the target area, and the area outside the person is selected as the non-target area.
When there are a plurality of identified 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 obtained, for example, 10 key frames before and after the current key frame are obtained, a group of key frame combinations are obtained, the occurrence times of a plurality of target objects in the key frame combinations are counted, the plurality of target objects are sorted 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 contained in the key frame include: the method comprises the steps of determining a character and a mountain, determining a target domain as a region where the character is located, determining a region where the mountain is located, and determining regions outside the character and the mountain as non-target domains, wherein the regions can also be called other domains. Counting the times of the characters and the mountains appearing in the key frame combination, and determining that the priority of the characters is higher than that of the mountains according to the sequence of the times of the characters and the mountains from high to low, wherein the times of the characters and the mountains are 8 and 1, respectively. The character is a first target object, the mountain is a second target object, the target domain of the character is a first target domain, and the target domain of the mountain is a second target domain. For example, when the first target domain of the character includes a partial mountain, for example, the character stands on the mountain, the mountain on which the character stands may be set in the first target domain to divide the first target domain of the complete character. And performing priority sequencing on the target objects, and determining the target object with the highest priority so as to realize diffusion rendering or inward aggregation rendering effect to different areas of the key frame by taking the target domain where the target object with the highest priority is located as a rendering center.
And S102, with the target domain as a rendering center, 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 switching ratio may be preset, for example, the first resolution switching ratio is preset according to the historical data viewed by the users, statistics of the viewing historical data of a plurality of users, and the like; alternatively, the first resolution switching ratio may be determined according to the sharpness selected by the user during the viewing process. Specifically, according to the definition of the user after selecting the switch, the corresponding switch resolution can be determined. And if the definition after the user selects the switching is the standard definition, determining that the switching resolution corresponding to the definition of the standard definition is 960 x 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 ratio as the first resolution switching ratio. The current video resolution is x y, the switching resolution selected by the user is a b, and the switching proportion of the first resolution is as follows: f (a, b) ═ max (a/x, b/y), if the current video resolution is 1280 × 960, the switching resolution 960 × 720 selected by the user, calculates the ratio of the horizontal direction to the vertical direction, and takes the maximum value to obtain the first resolution switching ratio: f (a, b) ═ max (a/x, b/y) ═ max (960/1280, 720/960) ═ 75%.
Before the video is subjected to definition switching rendering, the divided target domain and the divided non-target domain are further refined to obtain a target refined domain and a non-target refined domain, and the regional rendering based on the finer granular domain is facilitated. The thinning processing sets different thinning granularities according to different domain types, thinning can be carried out on non-target domains and target domains by adopting different sizes, the target domains are highlighted, the full-amount rendering of the target domains is facilitated, and the definition of the target domains is guaranteed.
When the video is displayed, if the size is fixed, the higher the resolution is, the more the pixel points in the unit size are, and the clearer the picture is; if the resolution is fixed, the larger the size is, the fewer the pixel points in the unit size are, and the more blurred the picture is. For example, the video frame size is w × h, the resolution is x × y, and the picture resolution K is (x × y)/(w × h). And when the K is larger, more pixel points expressing the unit size are provided, and the K is used as a thinning factor to thin different regions. Specifically, if the refinement size threshold of the non-target domain is set to be 300mm in the transverse direction and 300mm in the vertical direction, for K, when K > is 1, K is set to be 1, so that the situation that the divided area is too small, the size of the refinement area is too large, and refinement rendering cannot be performed during rendering is prevented. For the non-target domain thinning processing, the number of the non-target thinned domains obtained is S1 ═ (((w +300)/300) × ((h +300)/300))/K, where the thinned size threshold 300 of the non-target domains can be set according to the implementation, such as the terminal device information used according to the implementation, such as the model configuration, the screen resolution, and the like, 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 refined size threshold of the target domain needs to be smaller in granularity, and may be set to a preset proportion of the refined size threshold of the non-target domain, such as 1/2, to obtain 150mm in the transverse direction and 150mm in the longitudinal direction, which is for illustration, specifically, the preset proportion may be set according to the implementation situation, and is not limited herein. For the target domain thinning processing, the number of target thinned domains obtained is S2 ═ (((w1+150)/150) ((h1+ 150)/150))/K. And finishing the thinning processing according to the obtained number S2 of the target thinning domains and the number S1 of the non-target thinning domains, and thinning the target domain and the non-target domain in the key frame into a plurality of small regions as shown in 2 c. The middle part is a first target domain where the person is located, the two lower right parts are second target domains where the mountain is located, and the number of the target refining domains of each target domain is calculated according to the size of the target domain, a refining size threshold, a preset proportion, K and the like to refine. The upper left part is a non-target domain, and the number of the non-target refined domains is obtained by calculation according to the terminal display size obtained by calculation, the refined size threshold value, K and the like for refinement. Here, when there are a plurality of target domains, different refinement size thresholds, preset ratios, and the like may be set according to different priorities. The higher the priority of the target domain is, the smaller the size of the target refinement domain is, and the size of the non-target refinement domain is the largest.
After the thinning processing, the positions of the display contents of the target object in the target thinning domain are further judged, for example, the specific positions of the limbs, the trunk and the like of the person in the target thinning domain correspond to the positions of the target thinning domain marked by numbers 1-13 in fig. 2c, any position of the key frame is the target thinning domain containing the display contents of the target object, the target point position is set, the second resolution switching proportion of the target point position is set to be a hundred percent proportion, namely, no matter what definition is selected by a user for switching, the high definition rendering is adopted for the display of the person in the target point position is ensured. Here, the target object is the target object with the highest priority, so as to ensure that the target object is displayed most clearly.
When the regions other than the target point location area, that is, any position of the key frame does not include the display content of the target object, for these regions, the embodiment adopts a mode of outward diffusion with the target area as the center, and adjusts the first resolution switching ratio selected and cut by the user according to different distances between each position in the key frame and the rendering center, so as to obtain different second resolution switching ratios corresponding to different positions. For the target thinning domain and the non-target thinning domain, the same second resolution switching proportion is adopted in each target thinning domain; the same second resolution switching ratio is used in each non-target refinement domain. When different distances from the rendering center are calculated, the thinning domain where the position is located is confirmed, for example, the position is located in a certain target thinning domain or a certain non-target thinning domain, and the distance from the center of the target thinning domain or the center of the non-target thinning domain to the rendering center is calculated to be used as the distance from the position to the rendering center, so that the same second resolution switching ratio is adopted for rendering in the same target thinning domain or the same non-target thinning domain.
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, for example, the coordinates at the upper left corner are (0, 0), and the coordinates at the lower right corner are (w, h), that is, the size width and height of the key frame. The coordinate system may be as in FIG. 2d, in the upper left cornerFor the establishment of the coordinate origin, different coordinate origins can be set according to the implementation situation to establish a coordinate system, the coordinates of each position in the key frame are determined, the subsequent distance calculation is convenient, and the establishment of specific coordinates is not limited. In FIG. 2d, (c1, d1) is the center coordinate of the target domain. And taking the center of the target domain as a rendering center, calculating a first distance from the edge position of the key frame to 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), the lower right corner (w, h) to (c1, d1) of the key frame, and taking the maximum distance from the edge position of the key frame to the rendering center as the first distance. I.e. D ═ max
Figure BDA0003576574140000071
Figure BDA0003576574140000072
Then, respectively calculating a second distance from the center of the target refinement domain or the center of the non-target refinement domain to the rendering center, where different positions in the key frame are located, for example, the coordinates of the center of any non-target refinement domain in the key frame are (c, d), and the second distance is (c, d)
Figure BDA0003576574140000073
And correspondingly adjusting the first resolution switching proportion according to the ratio of the second distance to the first distance to obtain the second resolution switching proportion of the position in the key frame. Specifically, the following formula can be used:
Figure BDA0003576574140000074
wherein R is the second resolution switching ratio, F (a, b) is the first resolution switching ratio, and D is the first distance.
For ease of understanding, the key frame size is 1280 × 960, and the target domain center is (600, 500) for example, and as shown in fig. 2e, the five-pointed star region includes the target object. Calculating the first distance D ═ max
Figure BDA0003576574140000081
Figure BDA0003576574140000082
And (600, 500) is taken as a rendering center, and when the second distance is calculated, the second distance to the rendering center is calculated according to the center of a certain target refinement domain where the position is located or the center of a non-target refinement domain where the position is located. As shown in fig. 2e, the rendering center is taken as a circle center for illustration, and any geometric shape may be selected in the specific implementation, which is not limited herein. And calculating a second distance from the square frame to the rendering center, wherein the second distance can be a circle with the rendering center as a circle center and the second distance as a radius to obtain circle 1. The second distance from the square box to the rendering center, i.e. the radius of the circular line of circle1, the distance from any point on the circular line to the rendering center is the radius, for the convenience of calculation, the coordinate on the coordinate axis formed by the dotted lines on fig. 2e can be taken for calculation, for example, the coordinate (320, 500) of the intersection point of the dotted line on circle1 and the left dotted line is taken, and the second distance is calculated to be
Figure BDA0003576574140000083
The first resolution switching ratio is calculated to obtain a second resolution switching ratio according to 75% calculated in step S102:
Figure BDA0003576574140000084
correspondingly, second distances from circular lines of circle2, circle3 and circle4 to the rendering center can be respectively calculated, and second resolution switching ratios in circular line areas of circle2, circle3 and circle4 are obtained:
Figure BDA0003576574140000085
Figure BDA0003576574140000086
Figure BDA0003576574140000087
the second resolution switching ratio is gradually decreased from 100% of the rendering center to 93%, 88%, 85%, 82%, 75% in sequence. Taking 88% as an example, 1.2 dots are discarded per 10 pixel dots, and finally the dot resolution is reduced from 1280 x 960 to 1126 x 845. By analogy, when it falls to 75%, the resolution falls to 960 × 720.
And step S103, rendering the video frame according to the second resolution switching ratio to finish the definition switching of the video frame.
When the user selects the switching definition to switch from high definition to low definition, discarding pixel points in different areas according to a second resolution switching ratio from a target area to an area of the pulled high definition video stream to achieve smooth continuous outward diffusion; and for the area which is not pulled to the video stream, directly switching to the low-definition video stream which is pulled to the area for rendering.
When the user selects the switching definition to switch from low definition to high definition, according to the second resolution switching proportion, the complementary bit is continuously carried out from the low pixel point region to the target region to pull the stream, and the smooth effect of continuous inward condensation is achieved.
Furthermore, when the pixel points are discarded or the video stream is pulled, the rendering can be performed in a multi-thread mode, and the rendering speed is improved. Specifically, multiple threads are adopted to respectively pull video streams in different areas for processing, one thread processes the video stream in one area, decodes the video stream, discards pixel points in the area, and the like, as shown in fig. 2f, a thread 1 processes a first target area, a thread 2 processes a partial area of a second target area (1), a thread 3 processes a partial area of the second target area (2), and a thread 4 processes a non-target area. The multi-path thread can process a plurality of areas simultaneously, processing speed is improved, different areas are switched by different definitions, a smooth diffusion or condensation effect is provided for a user, and viewing experience of the user is improved.
According to the video definition switching method provided by the invention, the rendering speed can be improved by performing multi-path simultaneous rendering on different areas, and meanwhile, different rendering is performed on different areas according to different second resolution switching proportions, so that the problems that the video stream data volume is large and the switching process consumes long time in the prior art are solved.
Fig. 3 shows a functional block diagram of a video sharpness switching apparatus according to an embodiment of the present invention. As shown in fig. 3, the video definition 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 to obtain 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 to obtain second resolution switching proportions corresponding to different positions; wherein, the first resolution switching proportion is preset or determined according to the definition selected by the user;
and the partition rendering module 330 is adapted to render the video frame according to the second resolution switching ratio 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 key frames played by the video, and identifying target objects contained in the key frames;
dividing the key frame into different areas according to the identified target object; the region of the target object is a target region, and the region outside the target region is a non-target region.
Optionally, the apparatus further comprises: the resolution determination module 340 is adapted to determine a corresponding switching resolution according to the definition of the user after selecting the switching; 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 the first resolution switching ratio.
Optionally, the switching ratio module 320 is further adapted to:
thinning the target domain and the non-target domain to obtain a target thinned domain and a non-target thinned domain; wherein, the thinning treatment sets different thinning granularities according to different domain types;
if any position of the video frame is a target thinning domain containing the display content of the target object, setting the position as a target point bit domain, and setting the second resolution switching proportion of the target point bit domain as a hundred percent proportion;
if any position of the video frame does not contain the display content of the target object, calculating a first distance from the edge position of the video frame to a rendering center by taking the center of the target domain as the rendering center, and calculating a second distance from the center of a target refinement domain or the center of a non-target refinement domain where the position is located 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 switching proportion according to the ratio of the second distance to the first distance to obtain the second resolution switching proportion of the position in the video frame.
Optionally, the partition rendering module 330 is further adapted to:
according to a second resolution switching ratio, adopting multiple threads to respectively pull the video streams in different areas for processing so as to perform regional rendering on the video frames and finish definition switching; wherein, a thread processes a video stream of a region, decodes the video stream and/or discards pixel points of the region.
Optionally, the target object is multiple;
optionally, the switching ratio module 320 is further adapted to:
and taking the area where the target object with the highest priority is located 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.
Optionally, the apparatus further comprises: a sorting module 350 adapted to obtain a preset number of combinations of video frames before and after a video frame; counting the occurrence times of a plurality of target objects in a video frame combination; and sequencing the target objects according to the occurrence times from high to low, and determining the priority of the target objects according to the sequencing.
The 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, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the video definition switching method in any method embodiment.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.
As shown in fig. 4, the electronic device may include: a processor (processor)402, a Communications Interface 404, a memory 406, and a Communications bus 408.
Wherein:
the processor 402, communication interface 404, and memory 406 communicate with each other via a 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 the relevant steps in the above-described video sharpness switching method embodiment.
In particular, program 410 may include program code comprising computer operating instructions.
The processor 402 may be a central processing unit CPU or an application Specific Integrated circuit asic or one or more Integrated circuits configured to implement embodiments of the present invention. The electronic device comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 406 for storing a program 410. Memory 406 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 410 may be specifically configured to enable the processor 402 to execute the video sharpness switching method in any of the method embodiments described above. For specific implementation of each step in the program 410, reference may be made to corresponding steps and corresponding descriptions in units in the foregoing video definition switching embodiment, which are not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, 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 interpreted as reflecting an intention that: that the invention as claimed 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 device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. 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. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements 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 included in other embodiments, rather than other features, 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.
The 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 a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement 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. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or 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 can be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (10)

1. A method for video sharpness switching, the method comprising:
identifying and determining a target object based on a video frame played by a video, and dividing to obtain a target domain corresponding to the target object in the video frame;
taking the target domain as a rendering center, and adjusting a 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;
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 identifying and determining of the target object based on the video frame played by the video, and the dividing to obtain the target domain corresponding to the target object in the video frame further comprises:
analyzing a key frame played by a video, and identifying a target object contained in the key frame;
dividing the key frame into different areas according to the identified target object; the region of the target object is a target region, and the region outside the target region is a non-target region.
3. The method of claim 1, wherein determining the first resolution switching ratio according to the sharpness selected by the user specifically comprises:
determining corresponding switching resolution according to the definition of the user after selecting switching;
and respectively calculating the ratio of the switching resolution ratio in the horizontal direction and the vertical direction to the current video resolution ratio, and taking the maximum value of the two as a first resolution ratio.
4. The method of claim 2, wherein the adjusting the first resolution switching ratio according to the distance between each position in the video frame and the rendering center with the target domain as the rendering center to obtain the second resolution switching ratio corresponding to different positions further comprises:
thinning the target domain and the non-target domain to obtain a target thinned domain and a non-target thinned domain; wherein the refinement processing 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 bit domain, and setting the second resolution switching proportion of the target point bit domain as a hundred percent 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 a target refinement domain or a non-target refinement domain where the position in the video frame is located 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 switching proportion according to the ratio of the second distance to the first distance to obtain the second resolution switching proportion of the position in the video frame.
5. The method of claim 1, wherein rendering the video frame at the second resolution switching ratio to complete the sharpness switching of the video frame further comprises:
according to the second resolution switching ratio, adopting multiple threads to respectively pull the video streams in different areas for processing so as to perform regional rendering on the video frames and finish definition switching; wherein, a thread processes a video stream of a region, decodes the video stream and/or discards pixel points of the region.
6. The method of claim 1, wherein the target object is plural;
the step of adjusting the first resolution switching ratio according to the distance between each position in the video frame and the rendering center by using the target domain as the rendering center to obtain the second resolution switching ratio corresponding to different positions further includes:
and taking the area where the target object with the highest priority is located 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.
7. The method of claim 6, wherein determining the priority of the target object specifically 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 target objects from high to low according to the occurrence times, and determining the priority of the target objects according to the sequencing.
8. 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 a video, and dividing to obtain a target domain corresponding to the target object in the video frame;
the switching proportion module is suitable for adjusting a 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 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;
and the partition rendering module is suitable for rendering the video frame according to the second resolution switching proportion so as to complete the definition switching of the video frame.
9. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the video definition switching method according to any one of claims 1-7.
10. A computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to perform operations corresponding to the video sharpness switching method according to any one 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 true CN114900731A (en) 2022-08-12
CN114900731B 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)

Cited By (2)

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

Citations (18)

* 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
US20090002387A1 (en) * 2007-06-28 2009-01-01 Samsung Electronics Co., Ltd. Method and apparatus for rendering three dimensional graphics data
US20150015789A1 (en) * 2013-07-09 2015-01-15 Samsung Electronics Co., Ltd. Method and device for rendering selected portions of video in high resolution
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
US20190073747A1 (en) * 2017-09-05 2019-03-07 Microsoft Technology Licensing, Llc Scaling render targets to a higher rendering resolution to display higher quality video frames
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
US20200202496A1 (en) * 2018-12-21 2020-06-25 Canon Kabushiki Kaisha Image processing apparatus, image processing method and storage medium
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

Patent Citations (18)

* 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
US20090002387A1 (en) * 2007-06-28 2009-01-01 Samsung Electronics Co., Ltd. Method and apparatus for rendering three dimensional graphics data
US20150015789A1 (en) * 2013-07-09 2015-01-15 Samsung Electronics Co., Ltd. Method and device for rendering selected portions of video in high resolution
WO2017138994A1 (en) * 2016-02-12 2017-08-17 Qualcomm Incorporated Foveated video rendering
US20190073747A1 (en) * 2017-09-05 2019-03-07 Microsoft Technology Licensing, Llc Scaling render targets to a higher rendering resolution to display higher quality video frames
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
US20200202496A1 (en) * 2018-12-21 2020-06-25 Canon Kabushiki Kaisha Image processing apparatus, image processing method and 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
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

Cited By (3)

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

Also Published As

Publication number Publication date
CN114900731B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
CN114900731A (en) Video definition switching method and device
WO2020108081A1 (en) Video processing method and apparatus, and electronic device and computer-readable medium
US9652829B2 (en) Video super-resolution by fast video segmentation for boundary accuracy control
CN110377263B (en) Image synthesis method, image synthesis device, electronic equipment and storage medium
CN109729405B (en) Video processing method and device, electronic equipment and storage medium
CN109660821B (en) Video processing method and device, electronic equipment and storage medium
CN111277779A (en) Video processing method and related device
CN112203034B (en) Frame rate control method and device and electronic equipment
US20020122045A1 (en) Font anti-aliasing system
CN110399842A (en) Method for processing video frequency, device, electronic equipment and computer readable storage medium
WO2020108010A1 (en) Video processing method and apparatus, electronic device and storage medium
CN110796664A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN114845158A (en) Video cover generation method, video publishing method and related equipment
CN111259907A (en) Content identification method and device and electronic equipment
CN106446889B (en) A kind of local recognition methods of logo and device
US11810524B2 (en) Virtual reality display device and control method thereof
CN109587561A (en) Method for processing video frequency, device, electronic equipment and storage medium
CN113810755B (en) Panoramic video preview method and device, electronic equipment and storage medium
CN110519530B (en) Hardware-based picture-in-picture display method and device
CN110941413B (en) Display screen generation method and related device
CN113613024A (en) Video preprocessing method and device
CN113077533A (en) Image fusion method and device and computer storage medium
CN111050221A (en) Method and system for acquiring focus of multi-picture navigation interface of set top box
US7447349B2 (en) Method and a system for processing digital images
CN117221504B (en) Video matting 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