The present invention relates to a watermark embedding method and, more particularly, to a method for efficiently embedding a watermark into a video stream within a short time.
The conventional server-based watermark embedder inserts a watermark in units of segments. In the conventional server-based watermark embedder, 1 bit of a watermark corresponds to the length of a segment, which elongates the time for extracting a watermark. For example, when a segment lasts 4 seconds, and at least 40 bits are employed without involving an error correcting code (ECC), data has to be inserted for over at least 160 seconds. Thus the time required for embedding and detecting a watermark is elongated, causing a large burden on both the encoder and the decoder.
To solve the technical problem above, an object of the present invention according to one aspect is to provide a method and an apparatus for performing encoding and embedding a watermark which generate a predetermined number of tiles sharing no data with each other to increase an amount of embedded watermarks.
To achieve the object above, a watermark embedding method in a watermark embedding apparatus according to one aspect of the present invention may include inputting a video frame; generating at least two tiles by spatially dividing the video frame; and embedding watermark information to each of the at least two tiles.
The embedding watermark information to each of at least two tiles may include embedding different watermark information to each of the at least two tiles.
Each of the at least two files may be encoded independently and may not form a reference relationship with the other tile.
The inputting a video frame may include inputting a plurality of video frames continuously in time, at least part of the plurality of input video frames is divided into at least two tiles, and each tile divided from a video frame may belong to one of a first and a second tile group.
A tile belonging to the first tile group in a first video frame may be encoded to form a reference relationship with tiles belonging to the first tile group before or after the first video frame but not to form a reference relationship with tiles belonging to the second tile group.
A video stream associated with tiles belonging to the first tile group and a video stream associated with tiles belonging to the second tile group may be processed in parallel by using different processors.
When the video frame is a pre-encoded video stream, the watermark embedding method may include decoding the pre-encoding video stream, extracting a portion having a reference relationship with other tile groups from the decoded video stream, removing a reference relationship of the extracted portion, and re-encoding the extracted portion in a tile-independent manner by removing a reference relationship with tiles of the other tile group.
A scene cut frame which does not reference a previous video frame may not be divided into tiles but may be referenced commonly by different tiles of a video frame referencing the scene cut frame.
When the video frame is a B frame, watermark information composed of a smaller number of bits than a reference value may be embedded while, when the video frame is an I frame, watermark information composed of a larger number of bits than a reference value may be embedded.
When the amount of information of the video frame is less than a first reference value, watermark information composed of a smaller number of bits than a second reference value is embedded while, when the amount of information of the video frame is larger than the first reference value, watermark information composed of a larger number of bits than the second reference value may be embedded.
The at least two tiles may be associated with the HEVC (High Efficiency Video Coding) standard.
In dividing the at least two tiles, the watermark embedding method may further include determining a tile size and a tile structure by estimating at least one of complexity and decoding time for each tile.
In dividing the at least two tiles, tile division may be performed in a direction of allocating an equal amount of task for processors corresponding to the respective tiles by taking into account at least one of complexity and decoding time for each tile.
To achieve the object above, a watermark embedding apparatus according to one aspect of the present invention may include an input unit inputting a video frame and a controller generating at least two tiles by spatially dividing the video frame and embedding watermark information to each of the at least two tiles.
The controller includes at least two processors, and each of the at least two tiles may be processed in parallel by the corresponding one of the at least two processors.
According to a watermark embedding method and an apparatus of the present invention, particularly, the amount of embedded server-based watermarks may be increased several times.
The present invention may be modified in various ways and may have various embodiments, where specific embodiments will be described in detail with reference to appended drawings.
However, it should be understood that the appended drawings are not intended to limit the present invention to specific embodiments but include all of modifications, equivalents or substitutes described by the technical principles and belonging to the technical scope of the present invention.
The terms such as first and second may be used to describe various elements, but the elements may not be limited by the terms. The terms are introduced only to distinguish one element from the others. For example, without departing from the technical scope of the present invention, a first element may be called a second element, and similarly, the second element may be called the first element. The term of and/or includes a combination of a plurality of related described items or any of a plurality of related described items.
If an element is said to be “linked” or “connected” to other element, the former may be linked or connected to the other element directly, but it should be understood that another element may be present between the two elements. On the other hand, if an element is said to be “directly linked” or “directly connected” to other element, it should be understood that there is no other element present between the two elements.
The terms used in the present invention have been introduced only to describe specific embodiments and are not intended to limit the technical scope of the present invention. A singular expression should be understood to indicate a plural expression unless otherwise explicitly stated. The term of “include” or “have” is used to indicate existence of an embodied feature, number, step, operation, element, component, or a combination thereof; and should not be understood to preclude the existence or possibility of adding one or more other features, numbers, steps, operations, elements, components, or a combination thereof.
Unless defined otherwise, all of the terms used in this document, including technical or scientific ones, provide the same meaning as understood generally by those skilled in the art to which the present invention belongs. Those terms defined in ordinary dictionaries should be interpreted to have the same meaning as conveyed by a related technology in the context. And unless otherwise defined explicitly in the present invention, those terms should not be interpreted to have ideal or excessively formal meaning.
In what follows, preferred embodiments of the present invention will be described in detail with reference to appended drawings. In describing the present invention, to facilitate the overall understanding, the same reference symbols are used for the same elements of the appended drawings, and repeated descriptions of the same elements will be omitted.
Throughout the document, a watermark embedding apparatus may be called an encoder, transcoder, and/or watermark embedder. Also, a watermark embedding apparatus may be implemented by various types of devices such as a personal computer (PC); notebook computer; personal digital assistant (PDA); portable multimedia player (PMP); playstation portable (PSP); wireless communication terminal; smartphone; server terminal including a TV application server and a service server; user terminal; or other device including a communication device such as communication modem for performing communication with a wired or wireless communication network, memory for storing various programs and data for encoding or decoding a video frame or for inter- or intra-prediction for encoding or decoding, and microprocessor for executing programs and performing calculations and control.
Also, a video encoded into a bit stream by a watermark embedding apparatus is transmitted in real-time or non-real time to a watermark detection apparatus (or video decoding apparatus) through a wired or wireless communication network such as the Internet, short range wireless communication network, wireless LAN, Wibro network, or mobile communication network or through various communication interfaces such as a cable and universal serial bus (USB); the original video is recovered and played as the transmitted bit stream is decoded.
In general, a video may be constructed by a series of pictures or frames, where each frame may be divided into predetermined regions such as units or blocks. When a video frame is divided into blocks, the divided blocks may be classified into intra-blocks and inter-blocks according to an employed encoding method. An intra-block refers to a block encoded by using an intra-prediction coding method, where intra-prediction encoding refers to a method which predicts pixels of a current block within a current picture for which encoding is being performed by using the pixels of restored blocks from encoding and decoding in a previous frame, generates a predicted block, and encodes disparities from the pixels of the current block. An inter-block refers to a block encoded by using inter-prediction coding, where inter-prediction encoding refers to a method which predicts a current block within a current picture by referencing one or more previous or future pictures, generates a predicted block, and encodes disparities from the current block. At this time, the frame referenced for encoding or decoding a current picture is called a reference frame. Also, it should be understood by those skilled in the art to which the present invention belongs that the term of “picture” used in the following descriptions may be substituted for by other terms having an equivalent meaning such as an image or a frame. Also, it should be understood by those skilled in the art to which the present invention belongs that a picture referenced in the present invention refers to a restored picture. Also, data related to a picture, image and/or frame may be called a video stream and/or a bit stream.
Furthermore, the term of block may be a concept including a coding tree unit (CTU), coding unit (CU), prediction unit (PU), and transform unit (TU) of the HEVC standard. For example, when a CTU is 64×64, the CTU may be divided into four 32×32 blocks for encoding, where each 32×32 block may correspond to a CU.
Also, tiles are a new feature of the HEVC standard, introduced to support encoding and decoding. Tiles represent regions divided from a frame in units of CTUs. In other words, tiles refer to regions which may be encoded or decoded simultaneously. When tiles are used, bits generated separately from divided regions are expressed by sub-bit streams, and the start position of each sub-bit stream is transmitted through a slice header. Therefore, when tiles are employed, entropy decoding part may also be processed in parallel.
Referring to
Tile is a spatial unit defined by column boundaries and row boundaries. A tile may change the order of performing LCUs to the raster order within the tile. Therefore, in a memory-constrained environment, a wider range of motion search may be allowed than a slice-based frame division under the same conditions. However, it should be clearly understood by those skilled in the art that a parallel processing-based watermark embedding method of the present invention may also be applied to slice-based encoding.
Tiles may be set as independent and dependent tiles. Since an independent tile performs an encoding task such as encoding prediction and entropy coding independently in units of tiles as in a slice, it may be suitable for multi-core based parallelism by dividing video frames. However, since both the encoding prediction and entropy coding may be performed across tile boundaries in the case of dependent tiles, reduction in compression performance is small, but parallel processing of dependent tiles is difficult to implement.
According to an embodiment of the present invention, it is preferable for a watermark embedding apparatus to use independent tiles. Independent tiles may be processed in parallel, and encoding may be performed independently within a single tile. At this time, complete parallel processing may be made possible by not allowing a reference relationship with other tiles.
And a watermark embedding apparatus according to an embodiment of the present invention may embed watermark information to each tile within one video frame. At this time, the embedded watermark information may be composed of at least one bit or more. If one video frame is divided into four tiles, and watermark information of 1 bit is embedded into each tile, four bits of watermark information may be embedded into one video frame.
The watermark embedding apparatus may divide a video frame into tiles of an equal size or different sizes. At this time, by estimating complexity and/or decoding time for each tile, size and structure of each tile and the number of tiles may be determined. At this time, the watermark embedding apparatus may perform division of a video frame into tiles in a direction of allocating an equal amount of task to each core by taking into account determination criteria of the tile division.
According to an embodiment of the present invention, complexity of each tile is estimated, and based on the estimation, the number of tiles to be allocated to each core and tile structure may be controlled by taking into account load balance and coding efficiency. At this time, from the relationship between the amount of encoded bits of a CTU and decoding time, complexity and/or decoding time may be estimated.
Referring to
According to an embodiment of the present invention, the watermark embedding apparatus may use a mode determining module in units of tiles to speed up efficient encoding and process tiles in parallel by allocating threads to cores.
As shown in
Referring to
Referring to
Referring to
According to another embodiment of the present invention, tiles in a tile group are provided to and encoded by the core corresponding to the tile group. The data encoded in units of tiles by each core is provided to a single module where watermark embedding may be performed by batch processing. In other words, embedding of a watermark may be performed in parallel by a plurality of processors or by one processor in a sequential manner.
Referring to
The scene cut frame may become a reference frame. A frame preceding or succeeding the scene cut frame may be set as a subframe. A subframe may be divided into tile into which data of 0 to n−1 may be inserted. The scene cut frame may be used as a reference frame, which is used to control data related to encoding of the scene cut frame to be shared among the cores processing tiles.
Referring to
At this time, the amount of information of an embedded watermark does not necessarily correspond to the amount of information of an input video frame but may be related to the type of the input video frame. In other words, in the case of a B frame which does not hold much information, a watermark of a relatively small number of bits is inserted while, in the case of an I frame or a P frame which holds a large amount of information, it is possible to increase a detection rate by inserting a watermark of a large number of bits. At this time, CBFM may also be employed in a similar manner.
Referring to
The memory 820 may store commands related to the functions performed in the controller 830. Also, the memory 820 may store a target video data and/or a bit stream for which watermark embedding has been completed. Moreover, the memory may store data related to the respective functions.
The communication unit 810 and the memory 820 performs the function of inputting video data to be processed by the controller 830 by taking into account an input of video data obtained from other device to the controller 830 or an input of pre-stored video data to the controller 830, which may be called an input unit.
The controller 830 may include a processor which performs encoding and watermark embedding. The controller 830 may include a pre-processing unit 832 which performs pre-processing for encoding and cores 834-1, . . . , 834-n.
The pre-processing unit 832 performs pre-processing for watermark embedding. The pre-processing unit 832 performs preparation for tile division and performs tile division. The pre-processing unit 832 may determine size of a tile and an encoding mode of a tile. Then the pre-processing unit 832 partitions a video frame to generate tiles. Divided tiles are provided to the cores 834-1, . . . , 834-n. At this time, if an input video frame is an already encoded video frame, the pre-processing unit 832 decodes the input video frame and determines whether a reference relationship exists with a tile belonging to other tile group. Then the pre-processing unit 830 extracts a portion having a reference relationship, deletes the corresponding data, and allocates the input video frame to cores 834-1, . . . , 834-n so that re-encoding may be performed.
The cores 834-1, . . . , 834-n perform encoding of tiles independently and in parallel. At this time, it is preferable for the cores 834-1, . . . , 834-n to perform encoding by excluding the reference relationship to other tile group as much as possible. And the cores 834-1, . . . , 834-n may insert a watermark to each tile of encoded data. An inserted watermark includes at least one bit of information or more. Depending on the situation, data for which encoding of each tile has been completed through a plurality of cores 834-1, . . . , 834-n may be provided to one processor, after which the processor may insert watermark information to each tile.
The user interface 840 includes an input device receiving a user input and/or an input/output device outputting data. The user interface 840 may include an input device such as a mouse, keyboard, and touchpad; and an output device such as a monitor, TV, and touch screen. The user may modify various configuration information of the watermark embedding apparatus and play encoded data by using the user interface 840.
Although the present invention has been described with reference to appended drawings and embodiments, the technical scope of the present invention is not limited by what is claimed by the drawings or embodiments. And it should be understood by those skilled in the art that various modifications and variations of the present invention may be made without departing from the technical principles and scope specified by the appended claims below.