The disclosure relates generally to methods and apparatus for compressing and/or decompressing video information, and more particularly to methods and apparatus for transcoding video information.
Video information typically requires high bandwidth and video is typically compressed prior to being stored or sent wirelessly. Transcoding is a process of decoding information from a compressed format/resolution/bit rate and re-encoding it into another compressed video format/resolution/bit rate. Transcoding can be employed, for example, where a network element such as a web server, or other device, encodes video in one format but the receiving device, such as a smart phone, only supports a lower bit rate compression algorithm such as according to the H.264 standard. For example, for video conferencing, the video may be initially encoded as an MJPEG but the receiving device may only display the information in an H.264 format. Accordingly, gateway elements such as servers or other transcoding apparatus decode the initially encoded video into decoded video. Once the video is decoded, it is then re-encoded using a different encoding format.
Accordingly, there exists a need that overcomes one or more of the above drawbacks.
The embodiments will be more readily understood in view of the following description when accompanied by the below figures and wherein like reference numerals represent like elements, wherein:
As set forth in certain embodiments below, a tile store operation is performed such that a pixel block is stored continuously as a linear line store operation so that line fetching can occur for the block based re-encoding operation. Certain embodiments provide for a method and apparatus that populates a linear line store of memory with tile data from one data block that contains information for multiple display lines and performs a line fetch operation to retrieve data for re-encoding. The line fetched data may be reformatted into block data for reencoding. Among other advantages, the encoder for re-encoding will obtain the uncompressed data in the same tiled format but based on linear memory addresses reads such that the data is more localized and less transactions are required to retrieve the data thereby improving memory use bandwidth.
In one disclosed example, a method and apparatus for transcoding video data decodes video that is encoded in the first format and produces decoded data blocks that include decoded tile data such that each decoded block includes pixel data for multiple display lines. The method and apparatus performs a linear write operation on the decoded data block by controlling storing of the decoded data block rows in consecutive linear addresses in memory such that one line of memory comprises decoded data for multiple display lines from the same block. The method and apparatus fetches the line of memory and translates the line of memory back into the original decoded data block format for re-encoding such that the block of data includes data for multiple display lines. The method and apparatus re-encodes the video data to the second format using the decoded data block that was translated from the fetched line of memory.
In one example, a decoder writes out uncompressed data in a tiled format into memory and an encoder is used to re-encode the uncompressed data in a tile format by reading the uncompressed data in the same tiled format using memory line fetches. This can greatly reduce the memory read bandwidth requirement compared with prior systems. In one example, uncompressed data output from a decoder is stored in a 16×16 tiled format for luma data and in an 8×8 tiled format for chroma data assuming a 4:2:0 chroma subsampling. As such, a method and apparatus stores data the way the decoder decodes the data instead of in a way that a user typically sees the data on a display. The method and apparatus may be employed in any suitable device such as a media gateway, within wireless user equipment such as a smart phone, as part of a video teleconferencing system, or in any other suitable device or system that employs transcoding. Transcoding may be used where different video data compression formats are employed so that different codecs or devices using different compression standards or ratios may provide compressed data for each other or within the device itself.
In one example, a system is disclosed where an apparatus for transcoding video data from a first format to a second format includes a video decoder that decodes video data that is encoded in the first format and produces at least one decoded data block wherein the decoded data block includes decoded data block for multiple display lines. A linear memory address data block populator performs a linear write operation on the decoded data block from the decoded data block by controlling storing of the decoded data block in consecutive linear addresses in memory. A line of memory includes decoded data for multiple display lines from the same block as opposed to data for a single display line from multiple blocks. For re-encoding, a data block populator performs memory line fetches and fetches the line of memory and translates the line of memory back into a decoded data block format (tile format) for re-encoding in a second format. Hence, the block of data includes data block for multiple display lines from a memory line fetch operation. An encoder then re-encodes the video data using the tile formatted data. In one example, the transmitter sends the re-encoded video in the second format to a display device. The display device may include a decoder that decodes the re-encoded video in the second format and displays the decoded video.
In one example, controlling the storing of the decoded data block in consecutive linear addresses in memory is performed by assigning sequential memory addresses to each byte of a decoded data block. In another example, a controller may be employed to determine whether a transcode mode has been selected. If the transcode mode has been selected, the controller causes the decoded data block to be stored in scattered memory addresses, such as non-sequential addresses or uses conventional tile write mode in memory. However, if the controller determines that transcoding is to be performed, then the controller selects the linear write mode so that one block is written as a line of memory. Accordingly, a tile write mode may be employed by the transcoder depending upon whether transcoding is to occur.
In this example, the user equipment 206 includes any suitable wireless communication circuitry and includes a decoder 208, a processor 210, associated memory 212 and a display 214. In this example, it is assumed that the user equipment 206 employs a decoder 208 whose decoding format is different from the format of the video data from the video source 204. This may occur, for example, where a video is in a MPEG format but the wireless device or user equipment 206 utilizes a lower resolution video system such that the video data must be transcoded from a first format to a second format. In this example, the transcoder 202 performs the transcoding operation, however as noted above, the transcoding operation may occur in the video source, in the user equipment or in any other suitable device.
Generally, in operation, the transcoder 202 will obtain a decoded data block or tile containing pixel information for multiple display lines and store tile data from the block in a same line of memory. When the re-encoding occurs, the single line of memory is then reformatted back into a data block which is then used by an encoder to re-encode the decoded data in the second format. If no transcoding needs to be performed, then the conventional linear single data line approach may be employed wherein a line of memory contains data for a single display line from multiple decoded data blocks.
Referring to
In operation, referring to
This is also illustrated in
To re-encode the data in the second format, the transcoder module 310 via the block data populator 318 fetches the line of memory and translates the line of memory back into the decoded data block 320 for re-encoding in a second format. The data block 320 includes data block for multiple display lines.
As shown in block 604, the method includes fetching the line of memory 101 and translating the line of memory back into the decoded data block 320 for re-encoding in a second format wherein the block of data is data block for multiple display lines. This is performed, for example, by the block data populator 318. As shown in block 606, the method includes re-encoding the video data to the second format using the decoded data block that was translated from the fetched line of memory which in this example is performed by the video encoder 306. Populating the memory with the decoded data block in consecutive linear addresses in the memory includes assigning sequential memory addresses to each byte in the decoded data block. [The re-encoded information that is encoded in the second format 308 may then be sent via a suitable transmitter 324 such as a wireless transmitter, wired transmitter or may be further processed as desired. Where the transcoder 202 is employed as part of a multi-media gateway having accessibility to the Internet or other network, the transmitter may be any suitable Internet communication interface. In an alternative embodiment where the transcoder 202 is employed in a wireless network element or in another wireless device, the transmitter 324 may be a wireless transmitter.
Referring also to
In this example, a controller 700 determines whether a transcode mode has been selected based, in this example, on mode data 300 which may come from an application, driver, user interface or any other source indicating that transcoding of the encoded data in the first format is to be performed. For example, if the video is to be sent to a device having a different compression codec for example, transcoding may be employed. However, if the device is also able to playback the decoded video that was decoded from the encoded video in the first format, then the decoded data block 320 can be employed for output to a display without any transcoding. As such, the controller 700 controls a memory address calculator 702 that provides write command information 704, address information 706 and data 708 to the memory 106 via memory controller 316. The memory address calculator 702 is controlled through control data 710 either to write the decoded block data 320 in consecutive linear addresses when transcoding, or in scattered memory addresses as in the prior art when no transcoding is necessary. The controller 700 also indicates whether the memory address calculator 702 should be writing luma or chroma data indicated by control data 712. For example, if the controller 700 determines that transcoding is to occur, then the controller 700 selects between a linear write mode (for transcoding) of the decoded data block or a tile write mode (for video playback) based on the mode data 300. The memory address calculator 702 will perform a linear write operation on the decoded data block from the decoded data block 320 into memory 106. In a video playback mode or non-transcode mode, the memory address calculator 702 is controlled to scatter the block data in memory using offsets as known in the art. In one example, as part of transcoding, the linear write operation stores 16×16 luma block data as a set of consecutive linear addresses and stores 8×8 chroma block data as a set of consecutive linear addresses.
Referring to
Among other advantages, the encoder for re-encoding will obtain the uncompressed data in the same tiled format but based on linear memory addresses reads such that the data is more localized and fewer transactions are required to retrieve the data thereby improving memory use bandwidth.
The disclosed integrated circuit designs may be employed in any suitable apparatus including but not limited to, for example, printers, high definition televisions, handheld devices such as smart phones, tablets, portable devices such as laptops or any other suitable device. Such devices may include for example, a display that is operatively coupled to the integrated circuit where the integrated circuit may be, for example, a GPU, CPU or any other suitable processing circuitry that provides image data for output on one or more displays. Such an apparatus may employ the integrated circuit as noted above including the transcoder 202 and if desired, one or more of the decoder and memory encoder as described as well as any of the one or more described configurations.
Also, integrated circuit design systems (e.g., work stations including, as known in the art, one or more processors, associated memory in communication via one or more buses or other suitable interconnect and other known peripherals) are known that create wafers with integrated circuits based on executable instructions stored on a computer readable medium such as but not limited to CDROM, RAM, other forms of ROM, hard drives, distributed memory, etc. The instructions may be represented by any suitable language such as but not limited to hardware descriptor language (HDL), Verilog or other suitable language. As such, the logic and circuits described herein may also be produced as integrated circuits by such systems using the computer readable medium with instructions stored therein. For example, an integrated circuit with the aforedescribed logic and structure may be created using such integrated circuit fabrication systems. In such a system, the computer readable medium stores instructions executable by one or more integrated circuit design systems that causes the one or more integrated circuit design systems to produce an integrated circuit. The integrated circuit includes logic operative to transcode video data from a first format to a second format comprising decoding video that is encoded in the first format and producing at least one decoded data block that comprises decoded data for multiple display lines, performing a linear write operation on the decoded data block by controlling storing of the decoded data block in consecutive linear addresses in memory such that a line of memory comprises decoded data for multiple display lines, fetching the line of memory and translating the line of memory back into the decoded data block for re-encoding in the second format wherein the block of data comprises data for multiple display lines, and re-encoding the video data to the second format using the decoded data block that was translated from the fetched line of memory and other of the operations set forth herein as desired.
The above detailed description of the invention and the examples described therein have been presented for the purposes of illustration and description only and not by limitation. It is therefore contemplated that the present invention cover any and all modifications, variations or equivalents that fall within the spirit and scope of the basic underlying principles disclosed above and claimed herein.