Content aware video resizing

In accordance with some embodiments, jitter accompanying video resizing, can be reduced or even eliminated by analyzing the content that is to be depicted and resizing based on the nature of the content being depicted. As a result, dominant objects in one frame can be handled in a way that reduces or eliminates video jitter or sliding.

BACKGROUND

This relates generally to video resizing.

In video resizing, the size of the depicted frame is changed from its original format. For example, the aspect ratio of width to height may be changed. One common resizing changes the aspect ratio from a 4:3 ratio to a 16:9 ratio.

Sometimes, video resizing causes video jitter or slide. In video jitter or slide as a result of resizing, one or more frames may not be aligned with previous or subsequent frames making it appear that depicted objects are moving. This can create a blurred motion effect for objects that, in fact, are not moving from one frame to the next.

DETAILED DESCRIPTION

In accordance with some embodiments, jitter accompanying video resizing, can be reduced or even eliminated by analyzing the content that is to be depicted and resizing based on the nature of the content being depicted. As a result, dominant objects in one frame can be handled in a way that reduces or eliminates video jitter or sliding.

When a given device, such as a display, receives video, it can analyze the aspect ratio of the received information and compare it to the characteristics of that receiving device. For example, a certain display with a certain aspect ratio may realize that the aspect ratio of the received video is inconsistent with the aspect ratio of that display. Then the receiving device may determine that it would be advantageous to add or delete columns or add or delete rows from the original video to conform to the aspect ratio of the target screen. For example, 254 columns may be added to convert a 4:3 video at 640:480 pixels for display on a 16:9 screen at 854:480. The same techniques can be applied to adding rows and to deleting rows and columns. If the target device resolution is 1920:1080 instead of 854:480, then the source video can also be upscaled before it is sent. Alternatively, the target device may upscale the video.

Referring toFIG. 1, a video frame showing a person holding a microphone.FIG. 2is an energy plot for that frame showing energy on the vertical axis for each column of video across the frame on the horizontal axis. The energy, indicated at B, for the foreground depicted object A, is much higher than in the rest of the scene. Thus the object A, shown inFIG. 1is a dominant depicted object. Generally the higher the energy, the more important is the particular row or column of pixels to the overall depiction. Energy measures how much content may be found along any given vertical row (or column) in the picture relative to other rows (or columns) depicted in the picture. Thus in accordance with some embodiments, rows (or columns) with more energy are changed less often during resizing.

According to some embodiments, the sequence shown inFIG. 3may be implemented in software, firmware and/or hardware. In software and firmware embodiments it may be implemented using computer executed instructions stored in one or more non-transitory computer readable media such as magnetic, optical, or semiconductor storages. For example, one typical storage that may be used is the system memory. However any storage may be used either including stand alone storage or storage associated with a processor-based device.

The sequence shown inFIG. 3begins by analyzing the video's aspect ratio as indicated in block12. The video's aspect ratio is a current depicted aspect ratio of the frame in terms of width over height. This aspect ratio information may be encoded with the video in a known way so that it can be extracted. Then a frame from the existing video is captured as indicated in block14.

Next, an edge detection and edge comparison is done as indicated in block16. This enables dominant or higher energy objects within the scene to be identified relative to background.

If this is the first frame of video, then no edge comparison is available from a previous frame. The edge comparison may be skipped or the next frame can be captured, the edges detected and the edge comparisons made. In this case, the edge comparison results will be the same for the first two frames.

Any of a variety of different edge detection techniques may be used. A Sobel kernel edge detection uses few processing resources and can be performed quickly. The Sobel kernel also inherently eliminates some noise. Any of a wide variety of different edge detection techniques may be used instead including the Prewitt compass edge detector and the Roberts Cross operator. In some cases, the video compression technique may include edge detection information that can be used instead of or in addition to a Sobel kernel.

Using a detected edge from two successive frames, the edges can be compared, for example as |E1−E2| where E1 is the current frame's edge detection result and E2 is the last frame's edge detection result. The edge comparison effectively tracks movements or changes in the video between frames. These areas of high movement tend to be the areas which users focus on. Accordingly, distortion in those areas is the most objectionable.

While the edge comparison is effective for a sequence of frames of a continuous scene, the edge comparison is not effective when there is a change of scene. In a change of scene or a change of camera view, edges will move drastically to a different part of the frame.

The edge comparison result may be used to calculate the energy of each column (block18). In a simple example, the absolute value of the edge comparison may be used so that for each pixel, Ei,j=|E1i,.j−E2i,j|, where i and j indicate the row and column of the respective pixel. To calculate the energy of the row, the Ei,jvalues for each pixel in a column can simply be added. This can be expressed mathematically as a sum of all pixels in column (or row) j from i=0 to “height” as follows:
f(j)=Σi=0heightf(i,j)  Eq. 1
where f(j) is the energy of column j, f(i,j) is the pixel value in the edge comparison result of row i, column j (indicated as the edge comparison result Ei.jabove), and height is the maximum or top row in the video frame.

One purpose of the energy calculation is to reduce video jitter or sliding. To reduce jitter or slide, the rows/columns of the relevant frames within the same scene are not stretched. For example, in each frame, a column i may be chosen to stretch. Then, in another frame with the same dominant object, it is advantageous to choose that same column i to stretch. Otherwise there is a possibility that viewers will see jitter or sliding.

However if there is a scene change, it is unlikely that viewers would notice any video jitter or sliding regardless of which column was stretched. Thus a check at diamond20determines whether there has been a scene change relative to a prior scene. Any conventional scene change detection technique can be used.

Energy_sum is a sum of energy of a sequence of video frames before the current frame. It is a primary value of zero. Energy_current is the energy of the current frame. Thus the energy_sum for a picture is a summation of the energy. It is the sum of the energy of scene M and scene M starts back from frame J and continues to frame K. If there is no scene change (diamond20), then the energy_sum is set equal to energy_sum plus energy_current at block34and the flow iterates. This is to make sure that when the row with the smallest energy is deleted, it is the smallest relative to the whole sequence of frames, not just the lowest in one frame.

As shown inFIG. 4, each energy picture relates to a sequence of frames within the same scene. For example, energy picture 1 is a sequence of frames with substantially the same scene and it contains frames 1 through N, while energy picture 2 contains frames N+1 to M.

If there is no scene change, the energy value determined in Equation 1 may be used directly to select columns or rows to stretch or expand (block22). The adjustment at block22reduces video jittering caused by frequently changing the columns that are selected. In order to prevent video jitter, the energy adjustment operation reduces the chance that different columns (or rows) are selected in each frame. It adds a kind of memory or momentum that resists change. As a result, the selected columns (or rows) in one frame should be selected for the next frame.

Next, the row or column number is added to a process list as indicated in block24. The purpose of the process list is to keep track of what columns were stretched in previous frames. The process list is a list that stores column identifiers for columns that need to be stretched as shown inFIG. 5. The process list is a list of the columns (or rows) which were selected for stretching. A process list may simply be a list of the previously selected columns (or rows). Selected and unselected columns or rows may be stored as a row in a table identified with a frame number from the video sequence.

The resizing video source can find one column (or row) that has the lowest energy value at block22and thus has the least effect on jitter. This column (or row) may be the one with the least amount of edge movement, subject to the adjustment using the process list. Any of a variety of techniques can be used to find the lowest value. In one example, heap sort is used to get the smallest value of the energy map. After making the selection, the selected column or row is added to the process list (block24). The process list keeps track of number of columns or rows that need to be modified.

The selection process at block22may repeat as long as more columns or rows are needed (diamond26) to reach the intended number of columns or rows. In one example, 254 columns are to be added to the frame to resize it from 640 columns to 854. In order to add 254 columns, 254 columns of the frame are selected and these are doubled to form an additional 254 columns. There will be 386 columns that are not selected.

After each column is selected at block22and added to the process list (block24), before another column is selected a further energy adjustment may be made at block36. In brief, the energy map is adjusted based on the selected column to reduce the likelihood that the same column is added to the process list twice and to reduce the likelihood that the columns next to the selected column are chosen. Since each stretch destroys frame content, it is better to avoid stretching adjacent or neighboring continuous columns.

The energy adjustment at block36considers the selected column and then scales the energy of the column on either side of the selected column. This reduces the chance that the adjacent columns will also be selected. However, if the energy of the other columns is still high, the adjacent columns may still be selected. The likelihood of their selection can be adjusted by a scaling factor. This adjustment allows the flow to find the next higher level of energy to identify the next least most energy row or column to delete.

The energy adjustment is diagrammed inFIG. 7. The top row142of values represents an energy value list for the current frame. In this example, Column has been selected for the process list with an energy value of f(i), the lowest energy value of the remaining columns at block22. Accordingly, the energy of the column on the left column i−1 and column i+1 on the right of the selected column is raised to a higher value. This reduces their chance of also being selected for stretching. The higher value can be determined simply by multiplying the existing value f(i−1), f(i+1) by a scaling factor or ratio. A factor in the range of 1.5 to 2.0 has been found to be suitable as a rate. The larger the scaling factor, the more the column selection will be distributed throughout the frame. The higher values are shown in the modified energy table144.

The energy adjustment may be expressed mathematically as follows:
f(i−1)=f(i−1)+rate×f(i)
f(i+1)=f(i+1)+rate×f(i)  Eq. 2
where i is the column to be stretched, f(i) is the energy of the column, f(i−1 and f(i+1 are the energies of the columns that neighbor column i and rate is the weighting factor for increasing the energy of adjacent columns.

After enough columns or rows have been selected at block26, then, at block28, the selected columns or rows are divided into two or more columns or rows for the present example, or if instead the resized frame is to be smaller, then the columns or rows may be deleted. This is described in more detail below. In one example, a column is converted into two columns. The pixel values for each pixel of the column are averaged between the selected column and the column on either side. More sophisticated averaging, interpolation, or pixel estimation techniques may be used, if desired.

One example of the stretching process may be further described as follows. First a selected column is chosen from the process list of the current frame. The column is used to create two columns. If the selected column is column M, then the two new columns that take its place can be referred to as M′ and M.″

If M′ is to the left of M″, then the pixel values for M′ may be taken as the pixel values for the original M column adjusted using the pixel values of Column L or, as illustrated inFIG. 8, M−1 immediately to the right of Column M. A simple way to adjust the pixel value is to use an average of the adjacent pixel values as the adjustment. This can be shown mathematically as follows:
f(M′,y)=0.5(f(M−1,y)+f(M,y))
f(M″,y)=0.5(f(M+1,y)+f(M,y))  Eq. 3
where f(M′,y) and f(M″,y) are pixel values in new picture row y, column M′ and column M″ are the two new columns derived from column M, column M−1 is the column to the left of column M, e.g. column L, and column M+1 is the column to the right of column M, e.g. column N. While Equation 3 shows an average, the average may be weighted so that the original values are more important. For example f(M′y)=0.4 f(M−1,y)+0.6 Ff(M,y), uses a 60/40 weighting emphasizing the original value over the neighboring value. As a further alternative, other techniques may be used to determine pixel values based on additional nearby pixels in the same or in prior and later frames. The particular approach to determining the pixel value in the newly created columns may be adapted to suit different implementations of complexity and video types.

As shown inFIG. 8, the process list120is applied to the current video frame in order to stretch the picture by creating two columns of pixels in the place of one column, in this case Column M. As seen in the table126of pixel values for the current frame, column M has values 20, 10, and 130 in a particular part of the column. The column to the left, M−1 has values of 100, 50, 130 and the column to the right, M+1, has values of 200, and 70. In the stretched video frame pixel table128, column M is replaced by two columns labeled M′, M″. The pixel values are the averages of the column M values with the values on either side. So, for example, for M′ the average of 20 and 100 is 60. 60 replaces 100 as the pixel value for the top pixel shown into the diagram ofFIG. 8. Similarly, for Column M″, the average of 20 and 200 is 110. 110 becomes the pixel value of the top pixel in column M″ for the stretched image128ofFIG. 8.

It may be noted, considering the top line of pixel values for the three columns of the original source frame126, there is a big change in column M from the adjacent columns. The original row sequence in table126is 100, 20, 200. In the stretched video frame128, the sequence is 100, 60, 110, 200. As a result the information of column M of pixel value 20 is diluted by the neighboring pixel values. This creates a smooth transition for the additional columns but information about the change in value is lost. In other words, this edge in the image will become softened. Since this information is not about a moving edge, the loss of the information will be less noticeable to the viewer. The energy adjustment performed after each column selection at318reduces the loss of data caused by the averaging of pixel values by reducing the number of adjacent rows that will be averaged for stretching. As an alternative to the process diagrammed inFIG. 8and shown in Equation 3, the selected column may simply be replicated. Instead of two columns with averaged values, there are then two columns with same pixel values as the original selected column, 20, 10, 130.

Pixel values are referred to herein as having a single numerical value such as 100, 20, or 200. Pixel values are referred to in this way in order to simplify the description. The pixel values referred to herein are for brightness at a particular position in an image defined by row and column. While some types of video sequences may have a single value for each pixel, typically, there will be multiple values corresponding to RGB, YUV, or some other type of color system. The pixel values may be combined with neighboring pixels in space or time to support some type of video compression including interlacing. Accordingly, a value for a particular pixel as used herein, may refer to a single component at a particular row or column, or it may refer to a value with 2, 3, or 4 color components, depending on the nature of the source video.

At block28, all the frames within the same scene are processed using the process list. Frames are processed as indicated inFIGS. 5 and 6. Scene 1 contains frames 1 through N from process list 1 and scene 2 contains frames N+1 to frame M in process list 2. Each process list is related to a sequence of frames with the same scene. Frames with the same scene are processed in the same way to make sure to reduce jitter or sliding. So this is the step where additions or deletions are made to achieve the new aspect ratio.

After all of the selected columns in the process list120have been stretched at block28, the process ofFIG. 3sends the resized video frame to the receiving display device at block30. If this is not the end of the video at diamond32, then the process list is cleared (block38) and energy-sum is initialized (block40) and stored for use in the next video frame and a new video frame is captured for processing (at block14). If it is the last frame of the video, then the process ends.

Referring toFIG. 9, there are at least two ways to make a source video match a target aspect ratio. For example, if the original video has a ratio of width to height less than the target ratio, then the original video can be resized either by adding more columns or by deleting rows. For example, consider a video of (640:480) (aspect ratio 4:3) that is to be resized to an aspect ratio of 16:9. It can be changed to a size of (854:480) with 254 columns added or be changed to a size of (640:360) with 120 rows deleted. On the other hand, to convert a video with an aspect ratio of 16:9 to 4:3, either rows can be added or columns can be deleted. By first analyzing which way to resize, the most important information can be protected from loss.

FIG. 9shows a process at block12for determining how to resize the video before sending to a receiving device. At210, the sender receives the target resolution and aspect ratio. At212, the resolution and aspect ratio of the source video is compared to that for the target device. If it is smaller, then the number of columns and rows to be added to resize the source or original video for the target device is determined.

At214, the number of columns, Na, that would need to be added for the target device is compared to the number of rows, Nd, that would need to be added. The number of rows is weighted by a factor, r1, in a direct comparison, however, alternatively, the number of columns may be weighted instead of or in addition to weighting the number of rows. The weight factor biases the comparison in favor of adding columns instead of deleting rows. The factor is based on empirical studies of human perception of what is considered more pleasing. If at214, the number of columns is less than the weighted number of rows, then at218it is determined that columns will be added. If the number of columns to be added is greater than the number of rows to be deleted at214, then it will be determined that rows should be deleted (block216). The comparison is to determine how to make the smallest change to the original video by making the smallest change. The weighting factor will bias the decision in favor of adding instead of deleting if the two numbers are close.

Similarly, if the original video is larger than the target video at212, then the number of rows, Ma, that would have to be deleted is compared at220to the number of columns, Md, that would have to be added. As at214, the number of rows is weighted by a factor, r2, to compensate for human perception. If the weighted number of rows is greater, then at222it is determined to delete columns at222. Similarly if the number of columns is greater, then it is determined to add rows at224.

The weighting factors can be determined in a variety of different ways and can reflect a comparison of the distortion Dr1 of deleting a row versus the distortion Dc1 of adding a column. The distortion values can be determined by observation and measurement. The weighting factor r1 may then be expressed as a ratio Dr1/Dr2. The factor can be scaled to achieve the desired results. Similarly the weighting factor r2 for adding rows and deleting columns can be determined as a ratio Dr2/Dc2 of the distortion of adding a row compared to deleting a column.

The operations ofFIG. 9may be performed each time a video request is received or each time a source video is received in a different format. Alternatively, the results of a process like that shown inFIG. 9may be stored in a lookup table. The most common video formats and display device formats may be stored in a lookup table, so that each time the sender is presented with these common formats, the number of columns or rows to be added or deleted may be determined quickly. For example, the conversion from 4:3 VGA resolution to 16:9 WVGA resolution represents common aspect ratios and the result of adding 254 rows can be stored in the lookup table. This allows the sender to act more quickly. The sender may use the lookup table exclusively and present best matches or it may use the lookup table for common scenarios and then apply a process such as that ofFIG. 8for special cases.

FIG. 10illustrates an embodiment of a system300. In embodiments, system300may be a media system although system300is not limited to this context. For example, system300may be incorporated into a personal computer (PC), laptop computer, ultra-laptop computer, tablet, touch pad, portable computer, handheld computer, palmtop computer, personal digital assistant (PDA), cellular telephone, combination cellular telephone/PDA, television, smart device (e.g., smart phone, smart tablet or smart television), mobile internet device (MID), messaging device, data communication device, and so forth.

In embodiments, system300comprises a platform302coupled to a display320. Platform302may receive content from a content device such as content services device(s)330or content delivery device(s)340or other similar content sources. A navigation controller350comprising one or more navigation features may be used to interact with, for example, platform302and/or display320. Each of these components is described in more detail below.

Processor310may be implemented as Complex Instruction Set Computer (CISC) or Reduced Instruction Set Computer (RISC) processors, x86 instruction set compatible processors, multi-core, or any other microprocessor or central processing unit (CPU). In embodiments, processor310may comprise dual-core processor(s), dual-core mobile processor(s), and so forth. The processor may implement the sequence ofFIG. 3together with memory312.

Graphics subsystem315may perform processing of images such as still or video for display. Graphics subsystem315may be a graphics processing unit (GPU) or a visual processing unit (VPU), for example. An analog or digital interface may be used to communicatively couple graphics subsystem315and display320. For example, the interface may be any of a High-Definition Multimedia Interface, DisplayPort, wireless HDMI, and/or wireless HD compliant techniques. Graphics subsystem315could be integrated into processor310or chipset305. Graphics subsystem315could be a stand-alone card communicatively coupled to chipset305.

In embodiments, display320may comprise any television type monitor or display. Display320may comprise, for example, a computer display screen, touch screen display, video monitor, television-like device, and/or a television. Display320may be digital and/or analog. In embodiments, display320may be a holographic display. Also, display320may be a transparent surface that may receive a visual projection. Such projections may convey various forms of information, images, and/or objects. For example, such projections may be a visual overlay for a mobile augmented reality (MAR) application. Under the control of one or more software applications316, platform302may display user interface322on display320.

In embodiments, content services device(s)330may be hosted by any national, international and/or independent service and thus accessible to platform302via the Internet, for example. Content services device(s)330may be coupled to platform302and/or to display320. Platform302and/or content services device(s)330may be coupled to a network360to communicate (e.g., send and/or receive) media information to and from network360. Content delivery device(s)340also may be coupled to platform302and/or to display320.

In embodiments, content services device(s)330may comprise a cable television box, personal computer, network, telephone, Internet enabled devices or appliance capable of delivering digital information and/or content, and any other similar device capable of unidirectionally or bidirectionally communicating content between content providers and platform302and/display320, via network360or directly. It will be appreciated that the content may be communicated unidirectionally and/or bidirectionally to and from any one of the components in system300and a content provider via network360. Examples of content may include any media information including, for example, video, music, medical and gaming information, and so forth.

In embodiments, platform302may receive control signals from navigation controller350having one or more navigation features. The navigation features of controller350may be used to interact with user interface322, for example. In embodiments, navigation controller350may be a pointing device that may be a computer hardware component (specifically human interface device) that allows a user to input spatial (e.g., continuous and multi-dimensional) data into a computer. Many systems such as graphical user interfaces (GUI), and televisions and monitors allow the user to control and provide data to the computer or television using physical gestures.

Movements of the navigation features of controller350may be echoed on a display (e.g., display320) by movements of a pointer, cursor, focus ring, or other visual indicators displayed on the display. For example, under the control of software applications316, the navigation features located on navigation controller350may be mapped to virtual navigation features displayed on user interface322, for example. In embodiments, controller350may not be a separate component but integrated into platform302and/or display320. Embodiments, however, are not limited to the elements or in the context shown or described herein.

In embodiments, drivers (not shown) may comprise technology to enable users to instantly turn on and off platform302like a television with the touch of a button after initial boot-up, when enabled, for example. Program logic may allow platform302to stream content to media adaptors or other content services device(s)330or content delivery device(s)340when the platform is turned “off.” In addition, chip set305may comprise hardware and/or software support for 5.1 surround sound audio and/or high definition 7.1 surround sound audio, for example. Drivers may include a graphics driver for integrated graphics platforms. In embodiments, the graphics driver may comprise a peripheral component interconnect (PCI) Express graphics card.

In various embodiments, any one or more of the components shown in system300may be integrated. For example, platform302and content services device(s)330may be integrated, or platform302and content delivery device(s)340may be integrated, or platform302, content services device(s)330, and content delivery device(s)340may be integrated, for example. In various embodiments, platform302and display320may be an integrated unit. Display320and content service device(s)330may be integrated, or display320and content delivery device(s)340may be integrated, for example. These examples are not meant to limit the invention.

As described above, system300may be embodied in varying physical styles or form factors.FIG. 11illustrates embodiments of a small form factor device400in which system300may be embodied. In embodiments, for example, device400may be implemented as a mobile computing device having wireless capabilities. A mobile computing device may refer to any device having a processing system and a mobile power source or supply, such as one or more batteries, for example.

The processor310may communicate with a camera322and a global positioning system sensor320, in some embodiments. A memory312, coupled to the processor310, may store computer readable instructions for implementing the sequences shown inFIG. 2in software and/or firmware embodiments.

As shown inFIG. 11, device400may comprise a housing402, a display404, an input/output (I/O) device406, and an antenna408. Device400also may comprise navigation features412. Display404may comprise any suitable display unit for displaying information appropriate for a mobile computing device. I/O device406may comprise any suitable I/O device for entering information into a mobile computing device. Examples for I/O device406may include an alphanumeric keyboard, a numeric keypad, a touch pad, input keys, buttons, switches, rocker switches, microphones, speakers, voice recognition device and software, and so forth. Information also may be entered into device400by way of microphone. Such information may be digitized by a voice recognition device. The embodiments are not limited in this context.

The graphics processing techniques described herein may be implemented in various hardware architectures. For example, graphics functionality may be integrated within a chipset. Alternatively, a discrete graphics processor may be used. As still another embodiment, the graphics functions may be implemented by a general purpose processor, including a multicore processor.