This invention relates generally to video processing and, in particular, to parallel video effects and mix trees.
Video production switchers provide a function which layers multiple video sources. Each video source is associated with an alpha source which defines transparent areas of the video source on the top over lower layers. The base layer or the base source is called the background. Traditionally, the background is not associated with any alpha. It can be thought of as a fully visible layer which blocks any scenes behind it.
Conventional cascaded or sequential processing of video effects such as layering can entail significant delay.
According to an aspect of the present disclosure, an apparatus includes video data mixing modules to mix video data inputs. The video data mixing modules include a video data mixing module to mix video data inputs in parallel according to a mix parameter signal associated with one of the video data inputs and to provide a parallel mixed video data output, and a video data mixing module to further mix the parallel mixed video data output with a further video data input according to a composite mix parameter signal. The composite mix parameter signal corresponds to a product of mix parameter signals that are based on mix parameter signals respectively associated with multiple video data inputs.
The apparatus could also include a composite mix parameter signal computation module to compute the composite mix parameter signal. The composite mix parameter signal computation module is coupled to the video data mixing module that is to further mix the parallel mixed video data output with a further video data input.
The video data mixing modules could include video data mixing modules to mix respective pairs of video data inputs in parallel and to provide respective parallel mixed video data outputs, and video data mixing modules for each of multiple video effects levels, to further mix video data inputs in accordance with respective composite mix parameter signals. The video data mixing modules at levels above a first level of the video effects levels are coupled to receive and further mix respective pairs of the parallel mixed video data outputs.
The mix parameter signals respectively associated with multiple video data inputs could be alpha signals, in which case the composite mix parameter signal could correspond to a product of complementary alpha signals that are complements of the alpha signals.
In an embodiment, the video data mixing modules include a respective video data mixing module for each node in a binary tree, to mix two video data input signals that include respective video data output signals from two child nodes in the binary tree. Each respective video data mixing module could then calculate a video data output signal for its node in the binary tree by adding the video data output signal from one of the two child nodes in the binary tree to a weighted video data output signal from the other one of the two child nodes. The weighted video data output signal could be weighted by a complement of an alpha signal associated with the one of the two child nodes.
The video data mixing modules could include video data mixing modules to mix video data inputs at respective nodes in the binary tree according to respective composite mix parameter signals. The respective composite mix parameter signal for each video data mixing module for a node in the binary tree could correspond to a product of a complementary alpha signal from one of the two child nodes of the node and a complementary alpha signal from the other one of the two child nodes.
As noted above, the mix parameter signals respectively associated with multiple video data inputs could be alpha signals. The apparatus could also include pre-shaper devices coupled to the video data mixing modules, to receive respective video source signals and associated alpha signals, and to provide products of the respective video source signals and associated alpha signals as video data input signals.
Each of the video data mixing modules could include an A/B mix effect device.
Some embodiments include a composite mix parameter signal computation module to compute the composite mix parameter signal. The composite mix parameter signal computation module is coupled to the video data mixing module that is to further mix the parallel mixed video data output with a further video data input. In embodiments in which the mix parameter signals respectively associated with multiple video data inputs are alpha signals, the composite mix parameter signal computation module could include multiple adders to compute the complements of the alpha signals. The composite mix parameter signal computation module could also or instead include multipliers to compute products of the complementary alpha signals.
The composite mix parameter signal could correspond to a product of two of the complementary alpha signals that are respective complements of two of the alpha signals. In this case, the composite mix parameter signal computation module could include a first adder to compute a sum of the two of the alpha signals, a multiplier to compute a product of the two alpha signals, and a second adder to compute the composite mix parameter signal by subtracting the product from the sum.
In some embodiments, the apparatus also includes a first truncation module and a second truncation module. The first truncation module is coupled to the video data mixing module that is to further mix the parallel mixed video data output with a further video data input, to truncate the composite mix parameter signal based on an error and to provide a truncated composite mix parameter signal to the video data mixing module that is to further mix the parallel mixed video data output with a further video data input. The second truncation module is coupled to the video data mixing module that is to further mix the parallel mixed video data output with a further video data input, to truncate, based on the error, a further video data output signal from the video data mixing module that is to further mix the parallel mixed video data output with a further video data input.
A method of mixing video data inputs is also provided, and involves mixing video data inputs in parallel according to mix parameter signals associated with one of the video data inputs, to provide a parallel mixed video data output, and further mixing the parallel mixed video data output with a further video data input according to a composite mix parameter signal. The composite mix parameter signal corresponds to a product of mix parameter signals that are based on mix parameter signals respectively associated with multiple video data inputs.
The mixing could involve mixing respective pairs of video data inputs in parallel, to provide respective parallel mixed video data outputs, and the further mixing could then involve further mixing respective pairs of the parallel mixed video data outputs modules in accordance with respective composite mix parameter signals.
As noted above, the mix parameter signals respectively associated with multiple video data inputs could be alpha signals, and the composite mix parameter signal could correspond to a product of complementary alpha signals that are complements of the alpha signals.
The mixing and the further mixing could involve respective mix operations for each node in a binary tree, to mix two video data input signals that comprise respective video data output signals from two child nodes in the binary tree. Each respective mix operation could involve calculating a video data output signal for its node in the binary tree by adding the video data output signal from one of the two child nodes in the binary tree to a weighted video data output signal from the other one of the two child nodes.
A method could also involve truncating the composite mix parameter signal based on an error to generate a truncated composite mix parameter signal, in which case the further mixing could involve further mixing the parallel mixed video data output with the further video data input according to the truncated composite mix parameter signal. In some embodiments, the method further includes truncating, based on the error, a further video data output signal from the further mixing.
An apparatus according to another aspect includes video data mixing modules to mix video data inputs in parallel at one or more levels of a multi-level mix tree. The video data mixing modules include one or more video data mixing modules at each of the one or more levels to further mix parallel mixed video data outputs at the one or more levels with other video data inputs according to a respective composite mix parameter signal for each of the one or more video data mixing modules. A respective first truncation module is coupled to each of the one or more video data mixing modules, to truncate the respective composite mix parameter signal for each of the one or more video data mixing modules based on a number of levels in the multi-level mix tree and an error tolerance and to provide a respective truncated composite mix parameter signal to each of the one or more video data mixing modules. A respective second truncation module is coupled to each of the one or more video data mixing modules, to truncate respective video data output signals from each of the one or more video data mixing modules.
The respective second truncation module could include a truncation module to truncate a video data output signal from one of the one or more video data mixing modules to a fractional precision based on the number of levels in the multi-level mix tree and the error tolerance.
The respective second truncation module could also include a rounding module to round a video data output signal, from a top level video data mixing module at a top level of the mix tree, to an integer value.
In some embodiments, a rounding module is coupled to a top level video data mixing module at a top level of the mix tree, to round a video data output signal from the top level video data mixing module to an integer value.
A method in accordance with yet another aspect involves mixing video data inputs in parallel at one or more levels of a multi-level mix tree, with the mixing involving further mixing parallel mixed video data outputs at the one or more levels with other video data inputs according to one or more respective composite mix parameter signals; truncating the one or more respective composite mix parameter signals based on a number of levels in the multi-level mix tree and an error tolerance to generate one or more respective truncated composite mix parameter signals for the further mixing, with the further mixing involving further mixing the parallel mixed video data outputs at the one or more levels with the other video data inputs according to the one or more respective truncated composite mix parameter signals; and truncating one or more respective video data output signals from the further mixing to a fractional precision based on the number of levels in the multi-level mix tree and the error tolerance.
The multi-level mix tree could include L levels, where 2L−1<N≦2L and N is a number of source signals to be mixed in the mix tree, and the error tolerance could be 2−M bits error. In this case, the fractional precision could be a lesser of L+M bits and a maximum number of bits.
With M=2, the method could include rounding a mix output from a top level of the mix tree to an integer value, or rounding a mix output from the further mixing to an integer value.
Other aspects and features of embodiments of the present disclosure may become apparent to those ordinarily skilled in the art upon review of the following description.
Examples of embodiments of the invention will now be described in greater detail with reference to the accompanying drawings.
Such video layering is illustrative of a type of video processing to which embodiments of the present disclosure could be applied.
One possible way to implement video layering such as shown in
The A/B mix effect is expressed in such a formula as:
O
mix=(1−α)A+αB, where αε[0,1] Eq. 1-1
The A/B mix effect has following properties.
Another style of expression of the A/B mix effect is as follows:
O
mix
=Aα′+{circumflex over (B)}, where α′=(1−α) and {circumflex over (B)}=αB Eq. 1-2
Eq. 1-2 is called the shaped style of A/B mix effect because the new upper layer video source B is pre-multiplied or pre-shaped by its associated alpha channel ahead of the mix operation, while the bottom layer video source A is multiplied or weighted by layer B's complementary alpha, α′. This shaped style of A/B mix effect is useful for further layering-related mathematic derivations set out herein.
When multiple video sources are layered through cascaded A/B mix effects, the resultant output can be expressed in a formula:
where
Omix is output of cascaded A/B mix processes,
B is a base layer or background,
Fi is a foreground video source at layer i
{circumflex over (F)}i is a preshaped foreground video at layer i
αi is the mixing alpha at layer i, associated with Fi
α′i is a complementary alpha equal to (1−αi).
In Eq. 1-3, all layers except the base layer or background are referred to as foreground.
A graph or binary tree is used to describe Eq. 1-3, as illustrated in
As shown, the example binary tree 300 includes a background video source B, and n foreground video sources F1 through Fn each having an associated alpha channel. The A/B mix operators 302, 304, 305, 306, 308, 310, 312, and any further mix operators between 310 and 312, perform A/B mixing on their video input data. The A/B mix operator 302 receives two video sources B and F1, and each subsequent A/B mix operator in the example binary tree receives as its video input data one video source Fi and one output from a lower layer A/B mix operator. The output Omix is the final output from the last A/B mix operator 312 in the example binary tree 300.
In a production switcher, the video layering process may group multiple video sources into different levels which include
The following notes elaborate on each group in more detail.
Background could be constructed by mixing or blending a video from a preset bus into a video from a program bus. If the video on the program bus is black, then the mixing process is called “fade to black”. Control signals for such a background mix operation are generally provided by a specific pattern generator inside a video production switcher regardless of associated alpha channels from either the preset bus or the program bus. In other words, the control signals might have nothing to do with any attribute from the source videos. However, some production switchers introduce associated alpha channels for background mixing, such as Digital Video Effect (DVE) wipe.
A key is an independent video layer with multiple effects on the top over a background or other keys. These effects could include, for example, any one or more of drop shadow, border frame, crop/mask, lighting, resizing, and possibly others. More effects are still under consideration and development in the industry. Keying is a process which forms a key before it is applied, and then adds the key on the top of background or the other keys. For example, keying could include modifying a video source for any one or more of color correction, matte fill, and lighting, and/or modifying the associated alpha channel for any one or more of effects such as mask, gain, and clip.
A traditional definition for a key is different from that in the preceding paragraph. A traditional key is a signal constructed from attributes of a source video or an external signal. A key signal is equivalent to an alpha channel associated with video B in NB mix effect. Key fill is a term referred to as video B but may be a matte color instead of the original video source. With techniques advancing and more complicated effects being involved, the concept of key evolves into an independent video layer itself as defined in the preceding paragraph, rather than just a control signal from attributes of source videos.
MLE is an independent composite layer constructed from a background and one or more keys. Generally, one MLE re-enters to video source buses such as program/preset bus or key buses as a single video source but without an alpha channel or with a virtual alpha channel of full transparency to the video.
The latest designs for layering processes may provide more effects such as background formed with associated alpha channels such as “DVE wipe” or MLE re-entry with a composite of all associated alphas such as “layer-mode MLE”, and so on.
Although a key layer is independent, it could be formed by multiple layers except that each layer inside a multi-layer key is ordered in a fixed or pre-defined priority. Normally, these inside layers are not allowed to switch order. On the other hand, an MLE could allow multiple keys to switch layer priorities, and multiple MLEs could also or instead switch overall MLE priorities relative to each other.
A binary tree of cascaded mix processes, expressed in Eq. 1-3 and illustrated in
The minimum number of layers in this example is 4×4×4=26, and the maximum layers is 8×8×8=29. In the future, the number of keys and the number of MLEs could be even higher. If each layer mix requires 4 or 5 pixel samples to implement Eq. 1-1, then the maximum number of calculation cycles could be beyond 211=2048, which is close to a High Definition (HD) horizontal resolution of 2200 pixels. However, according to SMPTE RP168-2009 from the Society of Motion Picture & Television Engineers (SMPTE), a switch position shall keep a variation within a half of an HD line. A cascade tree may produce a process delay beyond this requirement from SMPTE RP168-2009.
A parallel structure for a mix tree as disclosed herein could not only reduce the number of stages and the corresponding delays, but could also take advantage of advanced parallel computing techniques. For instance, if a full parallel structure is used, processing stages could be reduced from 29=512 for a cascade mix tree to just 9 for a parallel structure as described below.
Although parallel structures are useful for implementing mix trees, a parallel structure could introduce concerns regarding calculation precision and data accuracy, as discussed below. Fortunately, advanced processing techniques provide computing devices with floating-point arithmetic units or wider-bit fixed-point arithmetic units sufficient to alleviate such concerns.
With reference to Eq. 1-3, in order to simplify derivations the following are defined:
Then, Eq. 1-3 can be re-written as:
O
mix=( . . . ((( . . . ((Bα′1+{circumflex over (F)}1)α′2+{circumflex over (F)}2) . . . )α′2
where {circumflex over (F)}i=Fiαi, iε[1, 2L−1].
{circumflex over (F)}i is the shaped style of A/B mix defined in Eq. 1-2.
Defining the first segment of the mix tree in Eq. 2-1 as a background OL−1,1 at the second level (L−1):
O
L−1,1=( . . . ((Bα′1+{circumflex over (F)}1)α′2+{circumflex over (F)}2)α′3+ . . . )α′2
The subscript notation i,j means node j at level i. Using this notation, Eq. 2-1 becomes:
Define the second segment of the mix tree in Eq. 2-1 as a foreground OL−1,2 relative to the background OL−1,1:
O
L−1,2=( . . . (({circumflex over (F)}2
Then, Eq. 2-3 as well as Eq. 2-1 simplify to:
Further splits in level (L−1) produce the level (L−2) of A/B mixes. For instance, OL−1,1 splits into OL−2,1 and OL−2,2 such that:
Similarly, OL−1,2 splits into OL−2,3 and OL−2,4 such that:
If such split actions are repeated until reaching to all sources from B to Fn, then a parallel binary tree is completed. This binary tree has 2L−1 nodes at level l. Data at each node is formed using data from two lower-level children nodes. For instance, video data output from a node at level (l+1) is expressed such that
O
l+1,i
=O
l,2i-1×α′l,2i+Ol,2i, Eq. 2-8
where i=1, 2, . . . , 2L−l−1l=0, 1, . . . , L
For convenience, Ol,2i-1 is referred to as video output from an odd child node and Ol,2i is referred to as video output from an even child node in terms of video data Ol+1,i from a node i at level (l+1).
Eq. 2-8 includes a composite of complementary alphas at level l which can be expressed in alphas at lower level (l−1) such that:
where i=1, 2, . . . , 2L−1-1, l=0, 1, . . . ,L
Eq. 2-9 illustrates that:
General complementary alpha and composite complementary alpha expressions are populated in Table 1 below.
In order to easily understand the composite alphas, Table 2 lists all alpha indices for complementary alphas and composite complementary alphas from an instance of 5 levels or 32 video layers.
As discussed above, the upper A/B mix node data are formed from lower node data in a parallel binary tree, and composite complementary alphas are also formed from lower node complementary alphas. The complementary alphas carry on through the binary tree from bottom to top. These carry-on complementary alphas could raise a question of precision in a parallel mix tree due to limited alpha precisions. Although the traditional cascade A/B mix tree employs limited precision of alpha, using a unit with a 10-bit fractional part in decimal precision for instance, the alpha is not carried on to the following A/B mix layers and therefore no error spreads due to limited precision. In contrast, truncation errors due to limited precision could propagate in a parallel A/B mix tree.
Consider an example in which each A/B mix has a truncation error εi at layer i and the final result Omix has a total error Ev in N layers of a mix tree. Due to truncation rather than rounding, the total error Ev is subtracted from Omix to produce the real result, such that
In order to find the maximum error, consider an example in which all layers have the same maximum truncation error £ and all layers have the same complementary alpha value α′. Eq. 2-10 then produces the total error
Now suppose that a carry-on alpha is in the worst case where all complementary alphas are carried on through a mix tree to the top layer such that
where N is the number of layers
When implementing Eq. 2-12, truncation error εi is introduced to layer i. Due to the truncation, the total error Eα is subtracted from to α′mix to produce the final result such that
In order to find the maximum error, further consider an example in which each layer has the same maximum truncation error ε and each layer uses the same complementary alpha value α′. The total error in Eq. 2-13 is expressed such that
Eq. 2-14 is similar to Eq. 2-11, and both are shown in
Eq. 2-11 and Eq. 2-14 disclose that the total accumulated error monotonically increases with complementary alpha values and hence the maximum error occurs at maximum complementary alpha value (unit of alpha) such that
E
max
=Nε, if α′=1 Eq. 2-15
α′=1 means that each upper layer is transparent to lower layers and so the lower layers' errors are visible. In contrast, a′=0 means that each upper layer blocks lower layers and also prevents error propagation from the lower layers. If the total error is limited to a certain value such as 2−M in terms of a unit, then Emax≦2−M and the maximum truncation error ε in each layer follows
where 2L−1<N≦2L.
Eq. 2-16 can be interpreted as a general target or guide for each layer truncation to sustain a certain calculation accuracy. This target defines each layer truncation with the number of fraction bits equal to (L+M). According to Eq. 2-16, M=0 means a 1-bit error and M=2 means a quarter-bit error. A quarter-bit error might be chosen for certain applications, for example, in which after rounding to integer is applied to the end video mixing result, an error-free Omix is produced for the case where all layers are from identical video sources, such that
└Omix−Emax+0.5┘=└Omix−0.25+0.5┘=└Omix+0.25┘=Omix, Eq. 2-17
where └ ┘ is truncation to integer
A quarter-bit error might be preferred, for example, to give more guard margin to a system than a half-bit error.
In order to verify the above analysis on the total error from Eq. 2-11 and Eq. 2-14, C programs were used to sweep parameters and find the maximum error. C-Code 2-1 below lists C code where 3 parameters, including video data, direct alpha value, and number of additional fraction bits, are swept in ranges, one after the other.
Note that:
C-Code 2-2: Example Parallel Implementation of Mix Tree
Example sweep results are plotted in
Note that:
From these sweep results, it can be observed that:
Quarter-bit error or error tolerance as discussed above is intended solely for illustrative purposes. Other errors or error tolerances are possible. A maximum error or error tolerance could be chosen for video effects and mix processing, and fractional precision could then be set based on the error or error tolerance. For different error or error tolerances, there could be different fractional precisions. For example, for the same L, a lower error or error tolerance (higher M) involves a higher fractional precision (L+M), and conversely a lower fractional precision can be used under a higher error tolerance (lower M) condition.
In some embodiments, when a maximum error or error tolerance is chosen, the same fixed fractional precision is used for video effects and mix processing. Other embodiments could support different maximum errors or error tolerances and different fractional precisions for different video effects, for example. It is also contemplated that maximum error or error tolerance values, fractional precisions, or both could be changed, as configuration settings for instance. This could enable changes to maximum error or error tolerance, for particular video effects or mix processing or for a video effects or mix processing system as a whole, by changing settings for maximum error or error tolerance and/or for fractional precision. Error or error tolerance settings, fractional precision settings, or both types of settings, could be configured in registers or other types of memory, for example. As discussed herein in terms of an (L+M) target, fractional precision could be calculated from maximum error or error tolerance, and therefore configuration settings could include either or both of error/tolerance settings and fractional precision settings.
Full parallel structures might use higher precisions for A/B mix calculations to avoid accumulated errors. The more layers and the higher the number of levels that a mix tree involves, the higher precisions the mix tree should use and the higher the implementation cost. A tradeoff between performance and implementation cost is a partially parallel structure within a main cascade tree. For instance, a main trunk in a mix tree could still be a cascade structure while multiple branches could be paralleled to reduce electronic delays.
A parallel pair could be considered a simplest instance of a partial parallel structure. In order to clarify the mathematical meaning, Eq. 2-1 is re-written as:
where O2i:2i+1={circumflex over (F)}2iα2i+1+{circumflex over (F)}2i+1, α′2i:2i+1=α′2iα′2i+1, n=2L−1, i=0, 1, . . . , n−1
Note that the notation of subscript i:j means the output data from sources from i to j. This is different from previous subscript notation i,j which means node j at level i.
A parallel pair in the example structure of
The example parallel structure 1300 is a partial parallel structure, since it combines parallel structures in the form of parallel pairs and cascaded mix operators 1306, 1310, 1314, and 1318.
In a more general sense, each of the mix operators shown in
The example structure 1300 has a parallel pair at each of a number of levels providing one video data input to a cascaded mix operator 1306, 1310, 1314, and 1318. For a full parallel implementation, there might still be multiple levels, but with more than one parallel pair at each level, to implement the example binary tree in
A parallel quad is a sub-parallel structure with four video sources. In order to clarify the mathematical meaning, Eq. 2-1 is re-written as:
where O4i:4i+3=O4i:4i+1α′4i+2:4i+3+O4i+2:4i+3, α′4i:4i+1=α′4i:4i+1α′4i+2:4i+3, n=2L−2, i=0, 1, . . . n−1.
In the example structure 1400, each parallel quad includes two parallel pairs. The parallel pairs mixed by the A/B mix operators 1402 and 1404 are further mixed according to a composite mix parameter by the A/B mix operator 1406. Similarly, the parallel pairs mixed by the A/B mix operators 1408 and 1410 are further mixed according to a composite mix parameter by the A/B mix operator 1412. Another parallel quad is formed by the mix operators 1418 and 1420, which provide video data inputs to the mix operator 1422 for further mixing in accordance with its composite mix parameter signal. The mix operators 1406 and 1412 provide video data inputs to the mix operator 1414, which mixes its video data inputs according to a further composite mix parameter. The output Omix is the final output from the last A/B mix operator 1424 in the example structure 1400.
The mix operators 1414, 1416, and 1424 are cascaded, and accordingly the example structure 1400 is a further example of a partial parallel structure.
In some embodiments, there may be combinations of various parallel structures, depending on such characteristics as the number of video sources and the mix effect features.
In the example structure 1500 shown in
With reference to
In the example structure 1700 in
Combinations of various sub-parallel structures may give asymmetric structures, and therefore delay elements could be implemented in shorter branches to provide delay compensation. For example, the branches with the single background source in
Derivations provided above for various parallel structures use the shaped style of A/B mix operation because of its relatively simple implementation. Therefore each video source could be pre-shaped by multiplying the video source data with its associated alpha data prior to mixing with another video source or video data input. Such a pre-shaping function could be implemented in pre-shaper device.
Generally, a video source could, but need not necessarily, have an explicitly and externally defined associated alpha channel. If a video source does not have a defined alpha channel, then an associated alpha channel of unity values could be assumed. For example, the pure background B herein has an associated alpha with a value of 1.
Composite complementary alpha in Eq. 2-9 is expressed as a multiplication chain or product of complementary alphas. It could be implemented in binary form by:
The following paragraphs elaborate on alpha-related calculation devices.
1. Direct-Form Alpha Vs. Complementary Alpha
A direct-form alpha is represented by a symbol a while a complementary alpha is represented by a symbol a′ in all equations herein. Complementary alpha is mathematically the complement of alpha because α+α′≡1.
Other integer/fraction combinations for α are possible. In some implementations, variables might be represented with 10-bit integer parts, and for alpha additional fractional bits could be added. An alpha value with 10-bit additional fractional precision could thus have 20 bits in total, including a 10-bit “integer” part and a 10-bit additional fractional part. In this example, although part of the 20-bit alpha value is referred to as an integer part, the entire 20-bit value could be interpreted as specifying a fractional value between 0 and 1. This could provide for 10-bit precision source alpha values, with additional fractional precision of 10 bits, for example.
Eq. 2-9 expresses a fuzzy logic-AND, equivalent to a bit-by-bit product in the case of binary representations, applied to all complementary alphas from child nodes.
Fuzzy logic-AND of two complementary alphas can be expressed in direct-form alphas but with fuzzy logic-OR operation such that
α′i:i+1=α′i;α′i+1=(1−αi)(1−αi+1)=1−(αi+αi+1−αiαi+1)=1−αi:i+1 Eq. 2-20
where αi:i+1=αi+αi+1−αiαi+1
A truncator 2208 could also be provided in some embodiments, to maintain a certain fractional precision and to avoid multiplication chain overflow.
It should be noted that truncation might not be provided in every embodiment. For example, if calculation devices work with floating-point units, then truncation devices need not be used.
As noted above, a rounding operation applied to the final mix result Omix, expressed in Eq. 2-17, could play a key role in a parallel structure to compensate for truncation errors from each layer.
The final mix output with total truncation error is fed into the adder 2252 of the example rounding device 2250, and 0.5 is added to the final mix output. The output from the adder 2252 is truncated to integer by the truncator 2254.
The final mix result Omix to which rounding is applied is the mix result from a parallel structure, which includes a carry-on alpha which defines boundaries and transparency to the composite video image so as to layer the composite video over other video sources. In a full parallel structure depicted in
Digital video effect (DVE) is a specific application of video layering techniques which follows general A/B mix/effect rules but with unknown background or unknown lower/previous layers. In order to clarify the relationship between a DVE function and a mix tree, Eq. 1-3 is re-written to describe behaviors of a key combiner inside DVE such as:
where
O
B=( . . . ((B+F1α1)α′2+F2α2)α′3+ . . . )α′n+Fnαn=(( . . . ({circumflex over (F)}1α′2+{circumflex over (F)}2)α′3+ . . . )α′n−1+{circumflex over (F)}n−1)α′n+{circumflex over (F)}n
O
dve=( . . . ((Fn−1αn+1)α′n+2+Fn+2αn+2) . . . )α′n+k+Fn+kαn+k=( . . . ({circumflex over (f)}n+1α′n+2+{circumflex over (F)}n+2) . . . +{circumflex over (F)}n+k−1)α′n+k{circumflex over (F)}n+k
α′dve=α′n+1α′n+2 . . . α′n+k−1α′n+k
A swap of two adjacent video layers could use a wipe/dissolve transition to accomplish a seamless switch. Wipe is an effect whereby an upper layer A is partially replaced by a lower layer B in terms of varying geometric areas over time. Dissolve is an effect whereby an upper layer A is partially replaced by a lower layer B in terms of varying video intensity over time. A traditional wipe/dissolve uses two branches of mix trees to blend outputs from them. One mix tree is called a program branch and the other is called a preview branch. Both wipe and dissolve could use an A/B mix operation with unshaped style, for example, to transition program into preview.
In order to clarify the behaviors of wipe and dissolve mathematically, the program output Opgm in a mix tree branch is expressed by:
O
pgm=( . . . (((((Bα′0{circumflex over (F)}0)α′1+ . . . )α′i−1+{circumflex over (F)}i−1)α′i+{circumflex over (F)}i)α′i+1+{circumflex over (F)}i+1)α′i+2+ . . . {circumflex over (F)}n−1)α′n+{circumflex over (F)}n Eq. 3-2
In the preview output Opvw in a mix tree branch, consider an example of a layer source {circumflex over (F)}j replacing {circumflex over (F)}i such that:
O
pvw=( . . . (((((Bα′0+{circumflex over (f)}0)α′1+ . . . )α′i−1+{circumflex over (F)}i−1)α′i+1+{circumflex over (F)}i+1)α′i+{circumflex over (F)}i)α′i+2+ . . . {circumflex over (F)}n−1)α′n+{circumflex over (F)}n Eq. 3-3
A wipe pattern wi is applied to Opgm and Opvw in order to mix Fi and Fi+1 such that
Eq. 3-4 can be further re-organized such that:
Eq. 3-5 exposes the following properties:
O
i,i+1
=V(αi+αi+1−αiαi+1)=Vαi:i+1
This property illustrates how a parallel structure performs a seamless keying effect.
The traditional concept of an MLE only deals with output of multi-layered videos as an independent video without associated alpha. In other words, if an MLE output is layered on the top of others, this MLE blocks all others' visibilities. A layer mode of MLE carries on all video-layer-associated alphas through a mix tree and constructs a composite alpha as an MLE-associated alpha. This MLE-associated alpha is used to layer its MLE on the top of other MLEs or lower video layers. Because of those carried-on alphas, a layer mode MLE forms a parallel structure. Mathematical expressions are explained as follows. Assume that there are:
Based on these assumptions, Eq. 1-3 can be written as:
After re-organizing Eq. 3-7, a cascade structure for multiple MLEs is expressed as:
The parallel structures described herein are applicable to various types of video sources or video data input, including multiple MLEs. For example, one or more video sources could be replaced by an MLE output with an MLE-associated composite alpha in a full parallel structure such as shown in
Embodiments are described herein primarily in terms of A/B mix operators or more generally video data mixing modules. Such modules, and/or other components, could make use of multi-core processing devices such as one or more General Purpose Graphic Processing Units (GPGPUs) and/or one or more Field Programmable Gate Arrays (FPGAs). Although parallel structures can introduce accuracy concerns if truncation occurs in parallel branches, advanced techniques in GPGPUs and FPGAs can provide an array of floating point Arithmetic Logic Units (ALUs) or wide-bit Digital Signal Processing (DSP) units and hence provide high calculation precisions to implement parallel structures.
In general, hardware, firmware, components which execute software, or some combination thereof might be used in implementing the composite mix parameter computation module 2702, the video data mixing modules 2704, the truncator(s) 2706, the truncator(s) 2708, and/or the rounding device 2710. Electronic devices that might be suitable for implementing any or all of these components include, among others, microprocessors, microcontrollers, Programmable Logic Devices (PLDs), GPGPUs and/or FPGAs as noted above, Application Specific Integrated Circuits (ASICs), and other types of “intelligent” integrated circuits. For instance, implementation options could include one or more of parallel multi-cores in a GPGPU, parallel multi-kernels in an FPGA, multiple processing cores in a Central Processing Unit (CPU), and/or multiple processing cores in an ASIC.
As described herein, the video data mixing modules 2704 include one or more modules to mix video data inputs according to respective composite mix parameter signals. Not every video data mixing module 2704 would use a composite mix parameter signal, but at least one video data mixing module uses a composite mix parameter signal. In
The composite mix parameter signal computation module 2702 represents a possible implementation of a module to compute the composite mix parameter signals for the video data mixing modules 2704 that use them. Each composite mix parameter signal corresponds to a product of mix parameter signals that are based on mix parameter signals respectively associated with multiple video data inputs, as described herein. The composite mix parameter signal computation module 2702 could include, for example, adders to compute the complements of alpha signals in the manner shown in
Examples of truncator(s) 2706 used in computation of mix parameter signals are shown in
Although the composite mix parameter signal computation module 2702 and the video data mixing modules 2704 are shown separately in
Separate inputs for the mix parameter signals and video sources are also shown in
Also, although
The video data mixing modules 2704 could include video data mixing modules to mix respective pairs of video data inputs in parallel, according to a mix parameter signal associated with one of the video data inputs of each pair, and to provide respective parallel mixed video data outputs. There could also be one or more video data mixing modules, for each of multiple video effects levels for example, to further mix parallel mixed video data outputs with other video data inputs in accordance with respective composite mix parameter signals. In an embodiment, a composite mix parameter signal corresponds to a product of mix parameter signals that are based on mix parameter signals respectively associated with multiple video data inputs.
The video data mixing modules at each level above a first level could be coupled to receive and further mix respective pairs of the parallel mixed video data outputs in some embodiments.
The mix parameter signals respectively associated with multiple video data inputs could be alpha signals. The composite mix parameter signal could then correspond to a product of complementary alpha signals that are complements of the alpha signals.
For a binary tree implementation, the video data mixing modules 2704 include a respective video data mixing module for each node in a binary tree, to mix two video data input signals that include respective video data output signals from two child nodes in the binary tree. With reference to
A video data mixing module 2704 for a node in a binary tree calculates a video data output signal for its node by adding the video data output signal from one of the two child nodes in the binary tree to a weighted video data output signal from the other one of the two child nodes. The weighted video data output signal is weighted in some embodiments by a complement of an alpha signal associated with the one of the two child nodes.
Video data mixing modules that mix video data inputs at respective nodes in a binary tree above the lowest video source signal level perform mix operations according to respective composite mix parameter signals. The composite mix parameter signal for each video data mixing module for a node in the binary tree corresponds to a product of a complementary alpha signal from one of the two child nodes of the node and a complementary alpha signal from the other one of the two child nodes.
There could be additional components in some embodiments.
Pre-shaper devices could be coupled to the video data mixing modules 2704 to receive respective video source signals and associated alpha signals, and to provide products of the respective video source signals and associated alpha signals as video data input signals.
Truncation modules such as truncators could also or instead be respectively coupled to the composite mix parameter computation module 2702 and any of the video data mixing modules 2704, to truncate composite mix parameter signals and video data output signals from the video data mixing modules based on an error. In one embodiment, a first truncation module such as a truncator 2706 is coupled to a video data mixing module 2704 that is to further mix a parallel mixed video data output with a further video data input in accordance with a composite mix parameter signal. The first truncation module is configured or otherwise operable to truncate the composite mix parameter signal from the composite mix parameter computation module 2702 based on an error, and to provide a truncated composite mix parameter signal to the video data mixing module that is to further mix the parallel mixed video data output with a further video data input. Mixing by the video data mixing module is then based on the truncated composite mix parameter signal.
A second truncation module such as a truncator 2708 could be coupled to a video data mixing module 2704 that is to further mix the parallel mixed video data output with a further video data input, to truncate a further video data output signal from that video data mixing module based on the error.
For example, the video data mixing modules 2704 could mix video data inputs in parallel at one or more levels of a multi-level mix tree. The video data mixing modules 2704 include one or more video data mixing modules at each of the one or more levels to further mix parallel mixed video data outputs at the one or more levels with other video data inputs according to a respective composite mix parameter signal for each of the one or more video data mixing modules. A respective first truncation module such as a truncator 2706 could be coupled to each of the one or more video data mixing modules, to truncate the respective composite mix parameter signal for each of the one or more video data mixing modules based on a number of levels in the multi-level mix tree and an error tolerance and to provide a respective truncated composite mix parameter signal to each of the one or more video data mixing modules. A respective second truncation module such as a truncator 2708 could be respectively coupled to each of the one or more video data mixing modules 2704 that is to perform further mixing, to truncate video data output signals from each of the one or more video data mixing modules to a fractional precision based on the number of levels in the multi-level mix tree and the error tolerance. Quarter-bit error tolerances and an (L+M) fractional precision criterion are noted above, although other error tolerances and precisions are possible.
Thus, truncation could be applied to both composite mix parameter signals and to mix outputs.
Rounding could also be applied, to a final mix output or to one or more intermediate parallel mixed video data outputs. For example, a rounding module such as a rounding device 2250 (
Other variations are also possible.
Embodiments are described above primarily in terms of tree structures and apparatus. Methods are also contemplated.
The example method 2800 relates to mixing video data inputs, and involves mixing video data inputs in parallel at 2802, according to mix parameter signals associated with one of the video data inputs, to provide a parallel mixed video data output. The parallel mixed video data output is further mixed with a further video input at 2804 according to a composite mix parameter signal. The composite mix parameter signal corresponds to a product of mix parameter signals that are based on mix parameter signals respectively associated with multiple video data inputs, and computation of the composite mix parameter signal is shown at 2803.
Optionally, the composite mix parameter signal and the video data outputs from 2802 and 2804 could be truncated at 2805, 2806, and 2808, based on an error or an error tolerance. Truncation at 2805, 2806, and 2808 could also be based on the number of levels in a multi-level mixing structure or operation.
In some embodiments, rounding to integer is applied at 2810 to a mix output, which could be a final mix output or, in the case of a partial parallel structure, to an intermediate mix output from mixing that involves a composite mix parameter signal. In a multi-level mix tree, for example, rounding could be applied to a mix output from the top level of the mix tree or to mix outputs from further mixing of parallel mixed video data output signals at one or more lower levels in the tree.
The method 2800 shown in
For instance, there could be multiple mixing operations at 2802 and/or multiple further mixing operations at 2804 involving multiple composite mix parameter signals. These and other variations could be apparent from the apparatus drawings and descriptions herein, for example.
What has been described is merely illustrative of the application of principles of embodiments of the present disclosure. Other arrangements and methods can be implemented by those skilled in the art.
For example, the divisions of functions represented in the drawings which show binary trees, parallel structures, and apparatus are solely for illustrative purposes. Other embodiments could include fewer, more, and/or different components than explicitly shown, interconnected in a similar or different order. Methods could similarly include fewer, more, and/or different operations performed in a similar or different manner than explicitly shown in
In addition, although described primarily in the context of apparatus and methods, other implementations are also contemplated, as instructions stored on a non-transitory computer-readable medium, for example.
The present application is related to U. S. patent application Ser. No. ______, entitled “TRANSFER OF VIDEO AND RELATED DATA OVER SERIAL DATA INTERFACE (SDI) LINKS”, filed concurrently herewith and incorporated herein by reference.