This application claims priority from GB 0622488.5 filed Nov. 10, 2006.
This invention relates to a method and apparatus for determining resolution of encoding for a previous image compression operation.
Image compression systems are now well established in the delivery and storage of media.
One of the fundamental processes for compressing video is to sub-sample an image horizontally to reduce a number of pels representing the image. This reduces high spatial frequency information as well as reducing overheads of encoding extra groups of information called macroblocks.
In modern broadcast scenarios it is common practice to encode media at one physical location and transmit it to one or possibly many other points for onward distribution. This process is referred to as contribution and distribution. This ‘concatenation’ of compression systems is widespread and is well known to cause a gradual decrease in the quality of the delivered media.
In this example image media from a remote site 100 is compressed by an encoder 11 for transmission 12 to a central receiving site. The compressed encoded media may be stored or decoded 13 at the central receiving site, processed 14 and re-encoded 15 for onward distribution 16. At any number of downstream sites the video may be decoded 17 and processed 18 to suit local requirements before being re-encoded 19 yet again for distribution to end viewers 101.
At early links in the chain the image is usually encoded at full resolution to maintain quality, however as the media progresses downstream a number of links involved rises and a cost associated with this rises. As a result it is common for the later stages of the chain to sub-sample the video as well as compress it more harshly.
If a step in the chain compresses the video in sub-sampled format it becomes redundant and wasteful to re-encode the video at a higher resolution downstream of this point. Since this information that the video has been sub-sampled is not carried explicitly in a data stream that carries the video, measurements must be made if the previous encoded resolution (PER) is to be obtained. Hence it is advantageous to be able to measure PER.
Knowledge of this parameter also allows a video to be processed for other reasons such as removal of block artifacts, since the PER determines the location spatially of these block edges.
It is an object of the present invention at least partially to meet this requirement in the prior art.
According to the invention there is provided a method of determining a previously encoded resolution of blocking of a decompressed video signal comprising the steps of: detecting edges in a sample of the decompressed signal; determining whether an edge exists at each horizontal position along each video line in turn; outputting a signal when an edge is detected; counting picture elements along a video scan line of the sample of the decompressed signal; enabling at least one accumulator at intervals along the video scan line corresponding to at least one anticipated previously encoded resolution respectively, such that the at least one accumulator is incremented by the signal output when an edge is detected at the at least one anticipated resolution; and analysing contents of the at least one accumulator to determine a likelihood that the decompressed video signal was encoded with any of the at least one anticipated previously encoded resolutions.
Advantageously, the step of detecting edges comprises detecting vertical edges.
Advantageously, the step of detecting edges comprises using a Laplacian of Gaussian function.
Conveniently, the step of enabling at least one accumulator comprises decoding an output of the counter to trigger the at least one accumulator at respective anticipated resolutions.
Advantageously, the method comprises triggering a further accumulator when an edge is detected other than at an expected previously encoded resolution and subtracting the count of the further accumulator from each other accumulator value.
According to a second aspect of the invention, there is provided an apparatus arranged to determine a previously encoded resolution of blocking of a decompressed video signal comprising: edge detecting means arranged input a sample of the decompressed video signal and to detect edges in the sample; edge recognition means arranged to receive an input from the edge detecting means and to determine whether an edge exists at each horizontal position along each video line in turn and to output a signal when an edge is detected; counter means arranged to count picture elements along a video scan line of the sample of the decompressed signal; decoder means arranged to receive an input from the counter and to enable at least one accumulator at intervals along the video scan line corresponding to at least one anticipated previously encoded resolution respectively, such that the at least one accumulator is incremented by the signal output when an edge is detected at the at least one anticipated resolution; and analysing means arranged to analyse contents of the at least one accumulator to determine a likelihood that the decompressed video signal was encoded with any of the at least one anticipated previously encoded resolutions.
Advantageously the edge detector means is arranged to detect vertical edges.
Advantageously, the edge detector means comprises a Laplacian of Gaussian filter.
Conveniently, the decoder means is arranged to decode an output of the counter to trigger the at least one accumulator at respective anticipated resolutions.
Advantageously, the apparatus comprises a further accumulator arranged to be triggered when an edge is detected other than at an expected previously encoded resolution.
Conveniently, the analysing means is arranged to subtract the count of the further accumulator from each other accumulator value.
According to a third aspect of the invention, there is provided a computer readable medium comprising code means for performing all the steps of the method described above when the program is run on one or more computers.
Other aspects and features of the present invention will become apparent to those ordinarily skilled in the art upon review of the following description of specific embodiments of the invention in conjunction with the accompanying figures.
Embodiments of the present invention will now be described, by way of example only, with reference to the accompanying drawings, in which:
Throughout the description, identical reference numerals are used to identify like parts.
Referring to
A video image entering at an input 20 is processed by an edge detection algorithm in the vertical edge detector 22. This can be any suitable algorithm, however an optimum choice is an algorithm chosen and tuned to seek out vertical block edges. One highly suitable filter is the Laplacian of Gaussian function.
Advantageously this filter produces separated data sets for horizontal and vertical edges, allowing vertical edges to be processed separately.
The edge recognition function or module 23 receives edge information from the edge detector 22 and produces a Boolean decision 24 whether an edge exists at each horizontal position along each video line in turn of the input video signal.
The incoming video signal is also input in parallel to the counter 26 which counts along an active part of a video line. This count is decoded by a decoder 27 such that a group of trigger signals 28 is created. These trigger signals 28 increment an array of accumulators 25 if the Boolean output 24 for the current horizontal offset indicates presence of an edge.
One or more of the accumulators 25 may be triggered at any time. The system contains a separate accumulator for each anticipated previous encoded resolution. One further accumulator is included in the system and is enabled by the decoder 27 if no other accumulator is enabled at a given offset, to count edges detected which are located at points other than those foreseen at expected resolutions.
In summary, each of the accumulators is associated with one of a number of anticipated horizontal resolutions. Each accumulator is enabled at each of the horizontal points along the line where, if the image were encoded at that resolution, a block edge might be expected to form. Since blocking edges occur at the edges of macroblocks, detecting edges at positions expected to be macroblock edges triggers an accumulator set for that expected resolution.
The additional accumulator counts a number of times that edges appear to occur at spatial locations not associated with block edges of any of the anticipated sub-sampled resolutions.
After a statistically suitable number of lines have been assessed, usually one whole image, the values in the accumulators are examined via an output path 29. The analysis is shown in formula 1.
Where,
The result of this analysis produces a figure for each of the anticipated previously encoded resolutions. While it can generally be assumed that the largest number indicates block edges occurring at the most likely resolution, some degree of hysteresis needs to be applied since some source images may contain information that gives an erroneous result.
This hysteresis is generally advantageous since in real broadcast chains it is rare for the resolution to change and resolution changes never occur on a picture-by-picture basis.
By subtracting the un-associated edge count from each accumulator value, the picture activity, or the high frequency information that may be wrongly identified as edges, can be compensated for and a more reliable result obtained. While the PER can be determined based from a knowledge of which accumulator has a highest number a measure of the confidence that the decision is correct is gained from the ratio of the accumulated values, as follows.
A video signal compressed with a low quantiser, i.e. only slightly compressed, tends to have firstly more high frequency data and secondly more random noise. Both of these cause an increase in a number of false matches when seeking block edges. By subtracting the number of edges found “off grid” a common offset applied to all the counts is removed and the ratio between the counts becomes more meaningful and more immune to such noise.
In determining an indication of the PER there is thereby also provided an indication of a level confidence whether the indication is correct or whether default action should be taken. The level of confidence influences a hysteresis decision when deciding whether to change the PER choice. That is, the resolution is left unchanged unless there is a sufficient degree of certainty that a change should be made. For example, no change is made in the resolution until a distinct indication of a change has been indicated for more than one frame. Thus the ratio may be compared with a confidence threshold and the resolution remain unchanged unless the ratio exceeds the threshold. Since a change of image content may produce a rather indeterminate result, addition of such hysteresis before accepting a resolution change adds robustness to a system using the invention
Alternative embodiments of the invention can be implemented as a computer program product for use with a computer system, the computer program product being, for example, a series of computer instructions stored on a tangible data recording medium, such as a diskette, CD-ROM, ROM, or fixed disk, or embodied in a computer data signal, the signal being transmitted over a tangible medium or a wireless medium, for example microwave or infrared. The series of computer instructions can constitute all or part of the functionality described above, and can also be stored in any memory device, volatile or non-volatile, such as semiconductor, magnetic, optical or other memory device.
Although the present invention has been described with reference to preferred embodiments, workers skilled in the art will recognize that changes may be made in form and detail without departing from the spirit and scope of the invention.
| Number | Date | Country | Kind |
|---|---|---|---|
| 0622488.5 | Nov 2006 | GB | national |