Video encoding device and operation method thereof, and vehicle equipped with the video encoding device

By using components such as an image encoding unit and a reference image storage determination unit in the video encoding device to manage the storage and compression of moving image data, the problems of coding efficiency and image quality in small-capacity memories are solved, and high-quality moving image encoding is achieved .

CN111343456BActive Publication Date: 2024-10-11RENESAS ELECTRONICS CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911158718.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-12-18
Filing Date
2019-11-22
Publication Date
2024-10-11
Estimated Expiration
2039-11-22

AI Technical Summary

Technical Problem

It is difficult for existing video encoding devices to achieve high-quality moving image encoding in small-capacity memories, resulting in reduced encoding efficiency and image quality degradation.

Method used

Using an image encoding unit, a local decoding generation unit, a compression unit, an allowable data amount setting unit, a reference image storage determination unit, and an inter prediction unit, the determination is made through predictive coding, reference image generation, compression, data amount management, and motion vector search. Whether to store compressed data to optimize memory usage and ensure high quality encoding.

Benefits of technology

It achieves high-quality moving image coding in a small-capacity memory, maximizes the number of reference images in the reference image memory, suppresses image quality degradation caused by small memory capacity, and improves coding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111343456B_ABST
    Figure CN111343456B_ABST
Patent Text Reader

Abstract

A video encoding device includes: a local decoding generation unit for generating a reference image based on an encoding result of a segmented image; a compression unit for compressing the reference image to generate compressed data; a reference image storage determination unit for determining whether to store the compressed data in a memory; and an inter-frame prediction unit for performing a motion vector search based on the reference image stored in the memory for inter-frame encoding. The reference image storage determination unit sets an allowable data amount for storing the reference image for each determined area of ​​the motion image data, and determines whether to store the compressed data obtained by compressing the reference image in the memory based on the allowable data amount. The inter-frame prediction unit sets the reference image corresponding to the compressed data stored in the memory as a search range for the motion vector search.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] The disclosure of Japanese Patent Application No. 2018-236818 filed on December 18, 2018 including the specification, drawings and abstract is incorporated herein by reference in its entirety. Technical Field

[0003] The present invention relates to a vehicle equipped with a video encoding device and an operating method of the video encoding device, and a vehicle equipped with the video encoding device. For example, the present invention relates to a video encoding device suitable for compressing image data and an operating method thereof, and a vehicle equipped with the video encoding device. Background Art

[0004] An image has a large amount of information, and the image has a strong correlation between pixels close to each other in the same frame or between adjacent frames located at the same coordinates in the frame, so the amount of code is compressed by using this correlation. For example, as a typical international standard, methods for compressing, encoding and decoding moving pictures such as MPEG-2 (ITU-T Rec. H.262 | ISO / IEC13818-2) and MPEG-4 (ISO / IEC 14496-2), H.264 (ITU-T Rec. H.264 | ISO / IEC 14496-10) and H.265 (ISO / IEC23008-2HEVC) are standardized. In these coding schemes, predictive coding is used to reduce the amount of code; and when encoding, the difference between an image predicted by a certain method (predicted image) and an input image is encoded. Conversely, when decoding, a decoded picture is obtained by adding the difference to the predicted image.

[0005] The above-described encoding process is performed on each video picture (frame or field), and blocks obtained by subdividing the picture are processing units.

[0006] Prediction image generation methods are roughly divided into two types. One is a method of performing prediction on the same screen using a single frame (intra-prediction, intra-frame prediction, or intra-screen prediction). The other is a technique of performing prediction by using a frame different from the frame to be encoded (inter-prediction, inter-frame prediction, or inter-picture prediction).

[0007] In inter-frame coding (inter-frame prediction coding), the video coding device performs an orthogonal transform on the difference between the original image of the input coding target frame and the predicted image of the inter-frame prediction, quantizes the result, encodes the variable length, and transmits the result. On the other hand, the video coding device performs inverse quantization and inverse orthogonal transform on the result of the quantization process to generate a reference image (local decoded image), and stores the reference image in a reference frame memory to be used as a predicted image in subsequent inter-coding. That is, the video coding device writes a reference image corresponding to a corresponding image of the coded stream to the memory via a write bus, and reads another reference image written to the memory via a read bus, and encodes the image to be encoded by using it as a reference image for inter-frame prediction.

[0008] As described above, inter-frame coding requires a memory for storing reference images. In this regard, a motion picture coding technology in which the memory capacity that can be used as a reference image memory is limited is disclosed in Japanese Unexamined Patent Application Publication No. 2004 / 266731. The video coding device described in Japanese Unexamined Patent Application Publication No. 2004 / 266731 determines the maximum number of macroblocks used for inter-frame coding within an image frame based on the memory capacity that can be used as a reference image memory, and determines the macroblock positions for intra-frame coding and inter-frame coding at the next frame based on the image data and code amount at the time of the current image code. Furthermore, the video coding device described in Japanese Unexamined Patent Application Publication No. 2004 / 266731 reduces the reference image memory by storing the reference image in the reference image memory only for the macroblock positions determined to be inter-frame coded in the next frame.

[0009] Regarding the above-mentioned problem, a method and apparatus for compressing video data into a smaller size and incorporating additional information into the compressed data using a combination of lossy compression and lossless compression is disclosed in Japanese Unexamined Patent Application Publication No. 2009 / 260977. Summary of the invention

[0010] Since the compression efficiency of inter-frame coding is generally higher than that of intra-frame coding, when the ratio of inter-frame coding is small, the image quality deteriorates at the same compression ratio. In the video encoding device described in Japanese Unexamined Patent Application Publication No. 2004 / 266731, since the maximum number of macroblocks encoded by inter-frame coding is determined in advance, if the reference image memory is small, the maximum number of macroblocks for inter-frame coding is small. Therefore, there is a problem of reduced coding efficiency and reduced image quality.

[0011] On the other hand, in the encoder described in Japanese Unexamined Patent Application Publication No. 2009 / 260977, if the amount of data after compression is within a predetermined allowable range, lossless compression is performed; and if it is outside the allowable range, lossy compression is performed. Further, in the encoder described in Japanese Unexamined Patent Application Publication No. 2009 / 260977, when it is determined that the noise of lossy compression is large, the encoder is not compressed. That is, if Fig. 20 As shown in the processing of the second MB in , in the encoder disclosed in Japanese Unexamined Patent Application Publication No. 2009 / 260977, the maximum data size stored in the memory is the data size when not compressed. Therefore, in the encoder described in Japanese Unexamined Patent Application Publication No. 2009 / 260977, the memory capacity corresponding to the data size when not compressed is ensured as the memory capacity that can be used for one macroblock.

[0012] like Fig. 20 As shown in , when the memory size is large, the reference images of all macroblocks can be stored in the memory without compression. Fig. 20 As shown, when the memory capacity is small, the encoder described in Japanese Unexamined Patent Application Publication No. 2009 / 260977 cannot ensure a memory capacity corresponding to the data size when not compressed for all macroblocks. Therefore, the technology disclosed in Japanese Unexamined Patent Application Publication No. 2009 / 260977 is difficult to apply to a device in which a small-capacity memory can be used to encode moving images.

[0013] The object of the present disclosure is to provide a video encoding device capable of performing high-quality encoding processing using a small-capacity memory such as SRAM (Static Random Access Memory). Other objects and novel features will become apparent from the description of the specification and the accompanying drawings.

[0014] Means of solving the problem

[0015] A motion picture encoding device according to an embodiment includes: an image encoding unit that performs prediction encoding by obtaining a difference between a segmented image to be prediction encoded and a reference image; a local decoding generation unit that generates a reference image based on the encoding result of the segmented image; a compression unit that compresses the reference image to generate compressed data; an allowable data amount setting unit that presets the allowable data amount of compressed data stored in a memory for each determined area of ​​motion picture data; a reference image storage determination unit that determines whether to store the compressed data in the memory; and an inter-frame prediction unit that performs a motion vector search based on a reference image stored in the memory for inter-frame encoding, wherein the reference image storage determination unit determines whether to store the compressed data in the memory based on the allowable data amount and stores the compressed data in the memory based on the determination result, and the compressed data storage determination unit stores the compressed data in the memory. The reference image corresponding to the compressed data stored in the memory is defined as a search range for the motion vector search.

[0016] An operating method of a motion picture encoding device according to another embodiment is an operating method of a motion picture encoding device, the motion picture encoding device including: an image encoding unit that performs predictive encoding by obtaining a difference between a segmented image to be predictively encoded and a reference image; a local decode generation unit that generates a reference image based on the encoding result of the segmented image; a compression unit that compresses the reference image to generate compressed data; an allowable data amount setting unit that presets the allowable data amount of compressed data stored in a memory for each determined area of ​​the motion picture data; a reference image storage determination unit that determines whether to store the compressed data in the memory; and an inter-frame prediction unit that detects a motion vector for inter-frame encoding based on a reference image stored in the memory, wherein the reference image storage determination unit determines whether to store the compressed data in the memory based on the allowable data amount, and the inter-frame prediction unit stores the compressed data in the memory based on a determination result of the reference image storage determination unit that determines whether to store the compressed data in the memory. The reference image corresponding to the compressed data stored in the memory is defined as a search range for motion vector search.

[0017] A vehicle according to another embodiment includes: a camera for outputting motion image data; a motion image encoding device for inputting the motion image data output from the camera; and a memory, the motion image encoding device including: an image encoding unit for performing predictive encoding by determining a difference between a segmented image to be predictively encoded and a reference image; a local decode generation unit for generating a reference image based on the encoding result of the segmented image; a compression unit for compressing the reference image to generate compressed data; an allowable data amount setting unit for setting an allowable data amount of compressed data stored in the memory for each region of the motion image data; a reference image storage determination unit for determining whether to store the compressed data in the memory; and an inter-frame prediction unit for performing a motion vector search based on the reference image stored in the memory for inter-frame encoding; and a reference image storage determination unit for determining whether to store the compressed data in the memory based on the allowable data amount. Based on the determination result that the compressed data is to be stored in the memory, the compressed data is stored in the memory, the inter-frame prediction unit sets the reference image corresponding to the compressed data stored in the memory as a search range for the motion vector search, and the motion image encoding device sets the usage amount of the memory to be variable according to the driving mode.

[0018] According to one embodiment, a video encoding apparatus can perform high-quality encoding using a small-capacity memory. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a block diagram showing an exemplary configuration of a camera module according to the first embodiment.

[0020] Figure 2 is a block diagram showing an exemplary configuration of a semiconductor device including the video encoding apparatus according to the first embodiment.

[0021] Figure 3 is a block diagram showing an exemplary configuration of a video encoding device according to the first embodiment.

[0022] Figure 4 is a block diagram showing an exemplary configuration of a reference image storage determination unit according to the first embodiment.

[0023] Figure 5 : is a diagram showing how the video encoding apparatus according to the first embodiment divides an image of one frame into a plurality of images and encodes the divided images in a determined order.

[0024] Figure 6 is a diagram illustrating an exemplary operation of the video encoding device according to the first embodiment.

[0025] Figure 7is a flowchart showing an exemplary process of determining whether the reference image storage determination unit according to the first embodiment stores compressed data obtained by compressing a reference image in the reference image memory.

[0026] Figure 8 is a diagram showing an exemplary search range when the inter prediction unit according to the first embodiment performs a motion vector search.

[0027] Fig. 9 : is a flowchart showing an exemplary intra-frame and inter-frame coding determination process in the video encoding device according to the first embodiment.

[0028] Fig.10 is a block diagram showing an exemplary configuration of a reference image storage determination unit according to the second embodiment.

[0029] Fig.11 is a flowchart showing an exemplary reference image storage determination process in the video encoding device according to the second embodiment.

[0030] Fig.12 is a block diagram showing an exemplary configuration of a video encoding device according to the third embodiment.

[0031] Fig.13 is a diagram illustrating an exemplary reference image storage result of the video encoding device according to the first embodiment.

[0032] Fig.14 is a diagram illustrating an exemplary operation of the video encoding device according to the third embodiment.

[0033] Fig.15 is a block diagram showing an exemplary configuration of a video encoding device according to the fourth embodiment.

[0034] Fig.16 : is a diagram showing an example of data stored in a complexity storage unit and a replacement information storage unit related to the fourth embodiment.

[0035] Fig.17 is a flowchart showing an exemplary reference image storage determination process in the video encoding device according to the fourth embodiment.

[0036] Fig.18 is a block diagram showing an exemplary configuration of a vehicle control system according to a fifth embodiment.

[0037] Fig.19 is a block diagram showing an exemplary configuration of a camera module according to a fifth embodiment.

[0038] Fig. 20is a diagram showing an exemplary operation when an encoder according to the related art compresses a reference image. DETAILED DESCRIPTION

[0039] For the sake of explanation, the following description and drawings are appropriately omitted and simplified. In addition, the elements described as function blocks for performing various processes in the drawings can be configured as CPU (central processing unit), memory, and other circuits in hardware, and are implemented by programs loaded into the memory in software. Therefore, it should be understood by those skilled in the art that these function blocks can be implemented in various forms by separate hardware, separate software or their combination, and the present invention is not limited to any one of them. In the drawings, the same elements are represented by the same reference numerals, and their repeated description is omitted as required.

[0040] In addition, various types of non-transient computer-readable media can be used to store the program described above and provide it to the computer. Non-transient computer-readable media include various types of tangible storage media. Examples of non-transient computer-readable media include magnetic recording media (e.g., floppy disks, magnetic tapes, hard disk drives), magneto-optical recording media (e.g., magneto-optical disks), CD-ROMs (read-only memory, CD-R, CD-R / W, solid-state memory (e.g., mask ROM, PROM (programmable ROM), EPROM (erasable PROM), flash ROM, RAM (random access memory)). The program can also be provided to the computer via various types of transient computer-readable media. Examples of transient computer-readable media include electrical signals, optical signals, and electromagnetic waves. Transient computer-readable media can provide programs to the computer via wired or wireless communication paths (such as wires and optical fibers).

[0041] First embodiment

[0042] Figure 1 1 is a block diagram showing an exemplary configuration of a camera module 1 according to the first embodiment. The camera module 1 according to the present embodiment is disposed, for example, at the right front, left front, right rear, and left rear of a vehicle, and captures images of the periphery of the vehicle as moving images. Figure 1 As shown, the camera module 1 includes a camera sensor 10 , a camera ISP (Image Signal Processor) 11 , a semiconductor device 12 including a video encoding device, and a transmitter 13 .

[0043] The camera sensor 10 is an image pickup device for picking up a peripheral moving image, and outputs the picked up moving image to the camera ISP 11 .

[0044] The camera ISP 11 receives data photographed by the camera sensor 10, adjusts white balance, corrects distortion, and converts the format of the data, and outputs a moving image to the semiconductor device 12. The processing performed by the camera ISP is not limited to the above example, and may include various processing for moving image data.

[0045] The semiconductor device 12 includes a video encoding device. The semiconductor device 12 generates an encoded stream by encoding an input moving picture to be encoded input from the camera ISP 11. The semiconductor device 12 outputs the generated bit stream to the transmitter 13.

[0046] The transmitter 13 transmits the bit stream to the image decoding device 14 outside the camera module 1 via a wired network or a radio network.

[0047] Figure 1 is a block diagram showing an exemplary configuration of the camera module 1, and the block diagram can be Figure 1 For example, the camera ISP 11 may be included in the semiconductor device 12. A portion of the transmitter 13 may be included in the semiconductor device 12.

[0048] Next, Figure 2 1 is a block diagram showing an exemplary configuration of a semiconductor device 12 including the video encoding apparatus according to the first embodiment. Figure 2 As shown, the semiconductor device 12 includes a CPU 15 , a bus 16 , a ROM 17 , a video encoding device 18 , and an SRAM 19 .

[0049] The CPU 15 reads the program stored in the ROM 17 via the bus 16 and executes the instructions. The CPU 15 can execute the program to write settings into various control registers (not shown) that control the operation of the video encoding device 18, and can also read various registers such as the control registers and read the status register indicating the processing status of the video encoding device 18. The video encoding device 18 can write and read reference images to and from the SRAM 19 via the bus 16.

[0050] Figure 2 1 is a block diagram showing an exemplary configuration of the semiconductor device 12, and the block diagram may be different from the block diagram. Figure 2 In the embodiment of the present invention, the ROM 17 for storing the program executed by the CPU 15 is built in the semiconductor device 12, but a ROM for storing the program may be provided outside the semiconductor device 12.

[0051] Next, Figure 3 is a block diagram showing an exemplary configuration of the video encoding device 18. Figure 3As shown, the video encoding device 18 includes an image input unit 100, an intra-frame prediction unit 101, an inter-frame prediction unit 102, an intra-frame and inter-frame determination unit 103, an orthogonal transformation unit 104, a quantization unit 105, a local decoding generation unit 106, a compression unit 110, a reference image storage determination unit 111, a memory control unit 112, a flag storage unit 114, a reference image existence judgment unit 115, a decompression unit 116, an encoding unit 117, a code amount control unit 118, a subtractor 120, and an adder 121. Figure 3 The reference image memory 113 shown is provided as a part or the entire area of ​​the SRAM 19 .

[0052] The image input unit 100 receives an input moving picture DVin. The image input unit 100 has a function of adjusting a difference between the frequency of the input moving picture DVin and the operating frequency of the video encoding device 18. For example, the image input unit 100 adjusts the frequency gap by providing a buffer for temporarily storing the input moving picture DVin.

[0053] Based on the received input motion picture DVin, the image input unit 100 divides the image to be predictively encoded into blocks of various sizes according to the international standard for motion picture encoding, and transmits the blocks to the intra prediction unit 101, the inter prediction unit 102, and the subtractor 120.

[0054] The intra prediction unit 101 calculates an intra encoding cost required to perform intra encoding on an input image, and transmits it to the intra inter determination unit 103. Further, the intra prediction unit 101 transmits an intra prediction image used for intra prediction to the intra inter determination unit 103.

[0055] The inter-frame prediction unit 102 performs motion estimation. In addition, the inter-frame prediction unit 102 calculates the inter-frame coding cost required for inter-frame coding using the difference between the input image and the reference image based on the result of the motion estimation. In order to calculate the inter-frame coding cost, the inter-frame prediction unit 102 sets the reference image obtained by decompressing the compressed data by the decompression unit 116 as the search range of the motion vector search. Further, the inter-frame prediction unit 102 transmits the reference image whose inter-frame coding cost is minimized as the inter-frame prediction image for inter-frame prediction to the intra-frame inter-frame determination unit 103.

[0056] The intra-frame inter-frame determination unit 103 determines whether to perform intra-frame encoding or inter-frame encoding based on the intra-frame encoding cost transmitted from the intra-frame prediction unit 101, the inter-frame encoding cost transmitted from the inter-frame prediction unit 102, and the reference image existence information about the divided image as the target of the prediction encoding transmitted from the reference image existence judgment unit. The intra-frame inter-frame determination unit 103 transmits the selected prediction image to the subtractor 120 according to the determined prediction mode.

[0057] The subtractor 120 calculates a difference between the input image and the predicted image transmitted from the intra / inter determination unit 103 .

[0058] The orthogonal transform unit (T) 104 performs an orthogonal transform process such as DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform) on the difference image between the input image and the predicted image output by the subtractor 120. For example, if the orthogonal transform of the orthogonal transform unit 104 is DCT, the orthogonal transform unit (T) 104 calculates a DCT coefficient and transmits the DCT coefficient to the quantization unit 105.

[0059] The quantization unit (Q) 105 performs quantization processing on the result of the orthogonal transform processing by the orthogonal transform unit 104. For example, if the orthogonal transform of the orthogonal transform unit 104 is DCT, the quantization unit 105 quantizes the DCT coefficient output from the orthogonal transform unit 104.

[0060] The local decoding unit 106 includes an inverse quantization unit (IQ) 107, an inverse orthogonal transform unit (IT) 108, an adder 121, and a deblocking filter unit 109. The local decoding unit 106 generates a reference image based on the quantization result and the predicted image transmitted from the quantization unit 105, and outputs the reference image to the compression unit 110.

[0061] The inverse quantization unit 107 performs an inverse quantization process on the quantization process result of the quantization unit 105. The inverse orthogonal transformation unit 108 performs an inverse orthogonal transformation process on the inverse quantization process result of the inverse quantization unit 107. For example, if the orthogonal transformation of the orthogonal transformation unit 104 is DCT, the inverse quantization unit 107 performs inverse quantization on the quantized DCT coefficient. The inverse orthogonal transformation unit 108 outputs a difference decoded image by performing inverse DCT on the DCT coefficient inversely quantized by the inverse quantization unit 107.

[0062] The adder 121 adds the difference decoded image and the predicted image transmitted from the inverse orthogonal transform unit 108 , and outputs the addition result to the deblocking filter unit 109 .

[0063] The deblocking filter unit 109 performs a deblocking filter process on the addition result of the adder 121 to generate a reference image. When filtering is turned off in the deblocking filter unit 109, the addition result of the adder 121 is directly output from the deblocking filter unit 109 as a reference image. When filtering is turned on in the deblocking filter unit 109, the result of deblocking filtering the addition result of the adder 121 is output from the deblocking filter unit 109 as a reference image.

[0064] The compression unit 110 losslessly compresses the reference image received from the local decoding generation unit 106 , and outputs the reference image to the reference image storage determination unit 111 .

[0065] The reference image storage determination unit 111 determines whether the compressed data of the reference image received from the compression unit 110 (sometimes referred to as "compressed data of the reference image") is stored in the reference image memory 113. When the compressed data is stored in the reference image memory 113, the reference image storage determination unit 111 requests the memory control unit 112 to write to the reference image memory 113, and transmits the compressed data. The reference image storage determination unit 111 includes an allowable data amount setting unit 141, and is later referred to. Figure 4 The allowable data amount setting unit 141 is described.

[0066] The flag storage unit 114 stores a flag indicating whether compressed data has been stored in the reference image memory 113 based on the determination result of the reference image storage determination unit 111 .

[0067] The memory control unit 112 performs control for writing compressed data to the reference image memory 113 and performs control for reading compressed data from the reference image memory 113 based on a request from a corresponding unit of the video encoding device 18. More specifically, the memory control unit 112 accesses the reference image memory 113 in the SRAM by reading or writing via the bus 16.

[0068] The reference image memory 113 is a storage device for storing compressed data obtained by compressing a reference image.

[0069] The reference image existence judgment unit 115 reads the information on the existence or non-existence of the reference image stored in the flag storage unit 114. If the compressed data of the reference image is stored in the reference image memory 113, the reference image existence judgment unit 115 requests the memory control unit 112 to read the reference image. Based on the request, the memory control unit 112 reads the compressed data of the reference image from the reference image memory 113, and transmits the compressed data to the decompression unit 116 via the reference image existence judgment unit 115.

[0070] The decompression unit 116 performs a decompression process on the compressed data of the reference image read from the reference image memory 113 , and transmits the reference image as a result of the decompression process to the inter prediction unit 102 .

[0071] The encoding unit 117 generates a bit stream BSout by performing an encoding process on the result of the quantization process by the quantization unit 105 .

[0072] The code amount control unit 118 adjusts the quantization scale based on the code amount generated by the encoding unit 117 , and transmits the adjusted quantization scale to the quantization unit 105 .

[0073] Figure 4 is a block diagram showing an exemplary configuration of the reference image storage determination unit 111. Figure 4 As shown, the reference image storage determination unit 111 includes a compressed data amount detection unit 140, an allowable data amount setting unit 141, a stored data amount calculation unit 142, a data amount comparison unit 146, and a storage determination unit 147.

[0074] The compressed data amount detection unit 140 calculates the data size of the compressed data transmitted from the compression unit 110 .

[0075] The allowable data amount setting unit 141 presets the allowable data amount of compressed data to be stored in the reference image memory 113 for each predetermined area (hereinafter sometimes referred to as a "unit area") in the input image. For example, the allowable data amount setting unit 141 is composed of a writable register, and is set by the CPU 15 by executing a driver of the video encoding device 18.

[0076] The unit area can be set arbitrarily. For example, the unit area can be one macroblock row, two macroblock rows, or one coding unit row in MPEG.

[0077] It is also possible to arbitrarily set the allowable data amount 145. For example, a value obtained by dividing the available memory capacity by the number of macroblock lines included in one frame of the input moving picture DVin may be set as the allowable data amount 145 in the allowable data amount setting unit 141.

[0078] The stored data amount calculation unit 142 adds the amount of data stored in the reference image memory 113 (hereinafter referred to as "stored data amount") and the data size of the compressed data for the unit area detected by the compressed data amount detection unit 140, and transmits the result of the addition to the data amount comparison unit 146 as the stored data amount 144. Since the stored data amount 144 is calculated for each unit area, the stored data amount calculation unit 142 is initialized each time the processing of the unit area is started. That is, when the processing of the unit area is started, the stored data amount is initialized to zero.

[0079] The data amount comparison unit 146 compares the allowable data amount 145 set in the allowable data amount setting unit 141 with the stored data amount 144 transmitted from the stored data amount calculation unit 142 , and transmits the comparison result to the storage determination unit 147 .

[0080] The storage determination unit 147 determines whether to store the compressed data in the reference image memory 113 based on the comparison result of the data amount comparison unit 146. If the storage data amount 144 is less than or equal to the allowable data amount 145, the storage determination unit 147 transmits determination result information 148 to the memory control unit 112, the flag storage unit 114, and the storage data amount calculation unit 142 to allow the compressed data to be stored in the reference image memory 113. If the storage determination unit 147 determines that the compressed data of the reference image is to be stored in the reference image memory 113, it also transmits data size information of the data to be stored to the flag storage unit 114. The storage data amount calculation unit 142 holds and stores the storage data amount corresponding to the information indicating that the storage of the compressed data in the reference image memory 113 is permitted.

[0081] On the other hand, when the storage data amount 144 is larger than the allowable data amount 145, the storage determination unit 147 transmits determination result information 148 indicating that storage of compressed data is not permitted in the reference image memory 113 to the memory control unit 112, the flag storage unit 114, and the storage data amount calculation unit 142 based on the comparison result of the data amount comparison unit 146. The storage data amount calculation unit 142 holds and stores the storage data amount corresponding to the information indicating that storage of compressed data is not permitted in the reference image memory 113.

[0082] Next, the operation of the video encoding device 18 is described. Figure 5 1 is a diagram showing how the video encoding device 18 according to the first embodiment divides an image of one frame into a plurality of images and encodes the divided images in a determined order. Figure 5As shown, the image in the frame is divided into a plurality of rectangular blocks. For example, in MPEG, it is generally divided into rectangular blocks called macroblocks (MBs) of 16×16 pixels, and encoding is performed on each macroblock. In one frame, the video encoding device 18 encodes the rectangular blocks in the order of arrows from the upper left to the lower right. In the following, the divided image (i.e., the block to be encoded) that is the target of image prediction encoding is described as a macroblock, but the unit of the block to be divided is not limited to a macroblock. For example, it may be a coding unit, which is a coding processing unit when encoding is performed according to the HEVC standard. When the divided image is a macroblock, from Figure 5 The area surrounded by a bold line in the rectangular block in the third row from the top corresponds to 1 macroblock row. In the following, it is assumed that the unit area is 1 macroblock row.

[0083] return Figure 3 , the encoding operation of the video encoding device 18 is described. The image input unit 100 outputs the macroblock of the input motion picture DVin to be encoded to the intra prediction unit 101, the inter prediction unit 102, and the subtractor 120. Although the detailed operations of the intra prediction unit 101 and the inter prediction unit 102 are described later, the calculated encoding cost and the predicted image are transmitted to the intra inter determination unit 103.

[0084] The intra-frame inter-frame determination unit 103 determines whether to perform intra-frame encoding or inter-frame encoding on the macroblock to be encoded based on the input encoding cost. Then, the intra-frame inter-frame determination unit 103 transmits the predicted image corresponding to the selected encoding method to the subtractor 120. The subtractor 120 calculates the difference between the input image (macroblock to be encoded) and the predicted image, and transmits the difference image to the orthogonal transformation unit 104.

[0085] The orthogonal transform unit 104 performs an orthogonal transform process on the subtraction result calculated by the subtractor 120, and outputs the orthogonal transform result to the quantization unit 105. The quantization unit 105 performs a quantization process on the result of the orthogonal transform process of the orthogonal transform unit 104 according to the quantization scale input from the code amount control unit 118.

[0086] The encoding unit 117 generates a bit stream BSout by performing an encoding process on the result of the quantization process performed by the quantization unit 105 .

[0087] Furthermore, refer to Figure 3, the local decoding operation of the video encoding device 18 is described. The local decoding generation unit 106 performs inverse quantization by the inverse quantization unit 107 and inverse orthogonal transformation by the inverse orthogonal transformation unit 108 on the result of the quantization processing performed by the quantization unit 105 to generate a difference decoded image. The adder 121 adds the decoded difference image and the predicted image. The deblocking filter unit 109 performs deblocking filtering processing on the addition result of the adder 121, generates a reference image, and outputs the reference image to the compression unit 110.

[0088] Next, Figure 3 1. The lossless compression of the reference image performed by the compression unit 110 shown in the embodiment is described. The compression unit 110 receives the reference image and performs lossless compression thereon to generate compressed data. Since the length of the data after compression is variable in the lossless compression, if the processing is performed for each macroblock, the amount of data after compression may increase compared to the amount of data before compression. In this case, the compressed data corresponding to the reference image that has not been read in the reference image memory 113 may be overwritten. Therefore, in order to prevent the overwriting of data, the present embodiment controls whether the compressed data is stored in the reference image memory 113 for each unit area.

[0089] Next, refer to Figure 6 , the storage determination operation in the reference image memory will be described. The video encoding device 18 according to the present embodiment reversibly compresses the reference image for each macroblock, and stores the compressed data obtained by compressing the reference image in the reference image memory 113. Figure 6 FIG. 2 shows an exemplary operation when the unit area is 1 macroblock row. Figure 6 As shown, when the compression unit 110 compresses the reference image corresponding to the first macroblock (MacroBlock, MB) of the macroblock row, the size of the compressed data is reduced from the original data size. However, when the compression unit 110 losslessly compresses the reference image corresponding to the second MB, the size of the compressed data is increased from the original data size. However, since the present embodiment controls the amount of data to be written to the reference image memory 113 so that the amount of data set by the allowable data amount setting unit 141 is not exceeded for each macroblock row, the problem of overwriting data does not arise. Next, when the compression unit 110 stores the compressed data corresponding to xMB in the reference image memory 113, the storage amount set in the allowable data amount setting unit 141 is exhausted. Therefore, the reference image storage determination unit 111 determines that there is no remaining capacity of the reference image memory 113 for subsequent MBs, and does not store the compressed data in the reference image memory 113.

[0090] Figure 71 is a flowchart showing an exemplary process of determining whether the reference image storage determination unit 111 according to the present embodiment stores compressed data obtained by compressing a reference image in the reference image memory 113. The reference image storage determination unit 111 receives the compressed data of the reference image from the compression unit 110 (step S100), and determines whether the compressed data can be stored in the reference image memory 113 (step S101). If there is free space in the reference image memory 113 (step S101: yes), the reference image storage determination unit 111 transmits determination result information indicating that storage can be performed to the flag storage unit 114. The flag storage unit 114 stores a flag (e.g., 1) indicating that the information is stored and the length information of the compressed data (step S102). The reference image storage determination unit 111 also sends determination result information 148 to the memory control unit 112 indicating that storage is ready. The memory control unit 112 stores the compressed data in the reference image memory 113 (step S103), and ends the process (step S104). When the capacity of the reference image memory 113 is insufficient (S101: No), the reference image storage determination unit 111 transmits determination result information indicating that storage cannot be performed to the flag storage unit 114. The flag storage unit 114 stores a flag (e.g., 0) indicating that storage cannot be performed (step S105), and ends the process (step S104).

[0091] Next, the intra-frame and inter-frame coding determination process is described. Figure 3 As shown, the image input unit 100 transmits the input image to the intra prediction unit 101 and the inter prediction unit 102 respectively.

[0092] The intra prediction unit 101 estimates the amount of code when encoding an input image in a plurality of intra modes. The intra prediction unit 101 calculates a cost corresponding to the estimated amount of code, and transmits the lowest cost as the lowest intra encoding cost to the intra inter determination unit 103. The intra prediction unit 101 also transmits the intra predicted image to the intra inter determination unit 103.

[0093] On the other hand, the inter-frame prediction unit 102 requires image data (reference image) of a frame before the current frame in order to detect motion (difference) between the input image and the reference image. Therefore, the reference image existence judgment unit 115 checks whether the reference image is stored in an area (searchable range) to which the macroblock to be encoded can be referred. Then, the inter-frame prediction unit 102 sets the reference image of the searchable range corresponding to the compressed data stored in the reference image memory 113 as the search range for the motion vector search.

[0094] Figure 8 , describe this situation in detail. Figure 8is a diagram showing a search range of a motion vector search by the inter-frame prediction unit 102 according to the present embodiment. Figure 8 In , MB5 corresponds to the MB position to be encoded. If the searchable range is defined as, for example, a maximum of 1MB outside the MB of the encoding position, then when encoding MB5, nine macroblocks MB1-MB9 are the searchable range. Figure 8 In the video encoding device 18 according to the present embodiment, the inter-frame prediction unit 102 receives only the reference image corresponding to the compressed data stored in the reference image memory 113. Figure 8 In this case, the inter prediction unit 102 receives only MB1-MB5 and MB7 and sets them as the search range for the motion vector search.

[0095] Fig. 9 1 is a flowchart showing an exemplary intra-frame inter-frame coding determination process in the video encoding device 18 according to the present embodiment. Since the inter-frame prediction unit 102 performs a motion vector search using a reference image, the reference image existence judgment unit 115 refers to the information stored in the flag storage unit 114, and reads out the information on the existence or non-existence of the reference image, and the information on the macroblocks that can be referenced within the range of the searchable range (step S120). If the reference image is stored in the reference image memory 113 (S121), the reference image existence judgment unit 115 requests the memory control unit 112 to read from the reference image memory 113. The memory control unit 112 reads the compressed data requested to be read from the reference image memory 113, and transmits it to the reference image existence judgment unit 115. The reference image existence judgment unit 115 transmits the read compressed data to the decompression unit 116. The decompression unit 116 decompresses the received compressed data (step S122), and transmits it to the inter-frame prediction unit 102 (step S123). The number of reference images to be transmitted to the inter prediction unit 102 is determined based on the searchable range and the state of the flag stored in the flag storage unit 114. The number of reference images transmitted to the inter prediction unit 102 in step S123 may be one or more and may be greater than one.

[0096] The inter-frame prediction unit 102 estimates the amount of code in inter-frame coding based on the difference between the input image and the reference image for each reference image included in the search range of the motion vector search, and calculates the inter-frame coding cost corresponding to the estimated amount of code. The inter-frame prediction unit 102 also calculates the minimum inter-frame coding cost among the calculated one or more inter-frame coding costs, and transmits the minimum inter-frame coding cost to the intra-frame inter-frame determination unit. Further, the inter-frame prediction unit 102 transmits the inter-frame prediction image to the intra-frame inter-frame determination unit 103.

[0097] The intra-frame inter-frame determination unit 103 compares the minimum intra-frame coding cost and the minimum inter-frame coding cost, determines the prediction mode with lower coding cost, transmits the inter-frame prediction image as a prediction image to the subtractor 120 (step S124), and ends the intra-frame inter-frame coding determination process (step S125).

[0098] On the other hand, if the reference image is not stored in the reference image memory 113 within the range of the searchable range (step S121: No), the reference image existence judgment unit 115 transmits an instruction to force the execution of intra-frame coding to the intra-frame inter-frame determination unit 103 (step S126). The intra-frame inter-frame determination unit 103 receives the information instructing the forced execution of intra-frame coding, decides to execute intra-frame coding on the macroblock to be encoded, transmits the intra-frame prediction image as the prediction image to the subtractor 120 (step S127), and ends the intra-frame inter-frame coding determination process (step S125).

[0099] According to the first embodiment, the video encoding device 18 includes a compression unit 110 that losslessly compresses a reference image to generate compressed data, an allowable data amount setting unit 141, and a reference image storage determination unit 111. Therefore, the reference image storage determination unit 111 can determine whether to store compressed data obtained by compressing the reference image by the compression unit 110 in the reference image memory 113 based on the allowable data amount set in the allowable data amount setting unit 141. Therefore, even when the memory capacity that can be used as the reference image memory 113 is small, the number of reference images stored in the reference image memory 113 can be increased according to the compression result of the compression unit 110. As a result, the number of reference images stored in the reference image memory 113 can be maximized, and encoding can be performed while suppressing the degradation of image quality caused by the small memory capacity.

[0100] Typically, a vehicle-mounted camera module is waterproof because the camera is located outside the vehicle. Therefore, the interior of the camera module mounted on the vehicle is sealed and easily heated. Therefore, in a video encoding device for encoding a moving image input from a vehicle-mounted camera, it is difficult to have a large-capacity DRAM (dynamic random access memory) outside the video encoding device due to heat and space issues, and it is also difficult to have an SRAM with a capacity comparable to that of the DRAM inside the video encoding device from the perspective of cost and circuit size. Therefore, the video encoding device 18 according to the present embodiment, which can encode moving images using a small-capacity memory, can be optimally applied to a camera module mounted on a vehicle.

[0101] Modification example of the first embodiment

[0102] In the above description, the series of operations of the motion picture encoding device 12 has been described with a focus on one MB. However, the video encoding device 18 can operate so that the above series of processes are performed in parallel in a pipeline manner for multiple MBs. As a result, the process of the motion picture encoding device 12 can be improved.

[0103] Second embodiment

[0104] Next, a second embodiment is described. Fig.10 1 is a block diagram showing an exemplary configuration of a reference image storage determination unit 111B according to the second embodiment. Fig.10 As shown, the reference image storage determination unit described in the first embodiment (see Figure 4 ), the reference image storage determination unit 111B further includes a complexity threshold setting unit 201, a complexity detection unit 202, and a complexity comparison unit 203. Other configurations and operations are the same as those of the reference image storage determination unit 111 described in the first embodiment, and therefore, the same components are denoted by the same reference numerals, and repeated descriptions are omitted.

[0105] The second embodiment is different from the first embodiment in that, when the reference image storage determination unit 111B determines whether to store compressed data in the reference image memory 113, it also adds the complexity of the reference image corresponding to the compressed data to the criterion.

[0106] Herein, the complexity of an image is a parameter indicating local unevenness. For example, as an example of a parameter indicating complexity, the parameter "spatial activity" and step 3 of the MPEG-2 rate control model TM5 can be cited.

[0107] The spatial activity of a macroblock j consisting of four luminance subblocks (n=1-4) of a frame structure and four luminance subblocks (n=5-8) of a field structure is expressed by Equation 1.

[0108] [Equation 1]

[0109]

[0110] [Equation 2]

[0111]

[0112] [Equation 3]

[0113]

[0114] Represents one of the pixel values ​​in the original 8x8 block.

[0115] Represents the average value of the pixels in the original 8x8 block.

[0116] represents the variance. Therefore, the spatial activity of a macroblock is a parameter that represents the variation of the pixel values ​​in the macroblock.

[0117] Generally, when the complexity of an image is high, intra-frame coding is preferred from the perspective of coding efficiency. Therefore, when judging whether to store compressed data in the reference image memory 113, the reference image storage determination unit 111B according to the second embodiment estimates whether the segmented image (e.g., macroblock) to be encoded is intra-frame coded or inter-frame coded in the next frame based on the complexity of the reference image corresponding to the compressed data. Herein, the reference image storage determination unit 111B estimates, rather than determines, whether intra-frame coding or inter-frame coding is to be performed. That is, when the complexity of the reference image is large, it is determined that the compressed data corresponding to the reference image is not stored in the reference image memory 113, thereby indirectly facilitating the intra-frame inter-frame determination unit 103 to determine that intra-frame coding is to be performed. Ultimately, intra-frame coding or inter-frame coding is determined by the determination result of the intra-frame inter-frame determination unit 103.

[0118] like Fig.10 As shown, in the second embodiment, in addition to the compression unit 110, the local decoding generation unit 106 also transmits the reference image to the complexity detection unit 202.

[0119] If the complexity of the reference image is greater than a predetermined threshold value (hereinafter sometimes referred to as "complexity threshold value"), the reference image storage determination unit 111B determines not to store the compressed data in the reference image memory 113. The complexity threshold value setting unit 201 is configured to set the complexity threshold value. For example, the complexity threshold value setting unit 201 is composed of a writable register that is set by the CPU 15 by executing a driver of the video encoding device 18.

[0120] The complexity detection unit receives and analyzes the reference image from the local decoding generation unit 106, and calculates the complexity of the reference image.

[0121] The complexity comparison unit 203 compares the complexity threshold value set in the complexity threshold value setting unit 201 with the complexity of the reference image calculated by the complexity detection unit 202 , and outputs the comparison result to the storage determination unit 147 .

[0122] Fig.11 : is a flowchart showing an exemplary reference image storage determination process in the video encoding device 18 according to the second embodiment.

[0123] like Fig.11 As shown, when the compressed data to be determined for storage is input to the reference image storage determination unit 111B (step S200), the complexity comparison unit 203 compares the complexity of the reference image with a predetermined complexity threshold value (step S201). If the complexity of the reference image is greater than the complexity threshold value (S201: No), the compressed data corresponding to the reference image is not stored in the reference image memory 113. That is, regardless of the magnitude relationship between the allowable data amount and the storage data amount, the storage determination unit 147 does not store the compressed data corresponding to the reference image in the reference image memory 113. The storage determination unit 147 transmits information indicating that the compressed data is not stored in the reference image memory 113 as determination result information 148 to the memory control unit 112, the flag storage unit 114, and the storage data amount calculation unit 142. In this case, the memory control unit 112 does not store the compressed data in the reference image memory 113. The flag storage unit 114 stores a flag (e.g., 0) indicating that storage cannot be performed. The stored data amount calculation unit 142 holds and stores the stored data amount according to the information indicating that the compressed data is not stored in the reference image memory 113 (step S206). After the processing of the memory control unit 112, the flag storage unit 114, and the stored data amount calculation unit 142, the processing of the reference image storage determination unit 111B ends (step S205).

[0124] On the other hand, when the complexity of the reference image is equal to or less than the threshold value (step S201: Yes), the storage determination unit 147 determines whether to store the compressed data in the reference image memory 113 based on the comparison result of the data amount comparison unit 146. That is, the data amount comparison unit 146 compares the allowable data amount set in the allowable data amount setting unit 141 with the storage data amount transferred from the storage data amount calculation unit 142 in step S203.

[0125] When the storage data amount is equal to or less than the allowable data amount, that is, when there is a remaining memory amount (S203: Yes), the storage determination unit 147 transmits information indicating that the compressed data is permitted to be stored in the reference image memory 113 to the memory control unit 112, the flag storage unit 114, and the storage data amount calculation unit 142 as the determination result information 148. The memory control unit 112 stores the compressed data in the reference image memory 113. The flag storage unit 114 stores a flag (e.g., 1) indicating that the reference image has been stored and the length data of the compressed data. The storage data amount calculation unit 142 stores and holds the storage data amount 144 as the storage data amount (step S204). After the processing of the memory control unit 112, the flag storage unit 114, and the storage data amount calculation unit 142, the processing of the reference image storage determination unit 111B ends (step S205).

[0126] When the storage data amount is greater than the allowable data amount (step S203: No), the storage determination unit 147 transmits information indicating that the compressed data is not permitted to be stored in the reference image memory 113 to the memory control unit 112, the flag storage unit 114, and the storage data amount calculation unit 142 as the determination result information 148 (step S206). According to the second embodiment, compared with the reference image storage determination unit 111 of the first embodiment, the reference image storage determination unit 111B further includes a complexity threshold setting unit 201, a complexity detection unit 202, and a complexity comparison unit 203. Therefore, when the complexity comparison unit 203 outputs a comparison result indicating that the complexity of the reference image detected by the complexity detection unit 202 is greater than the complexity threshold set in the complexity threshold setting unit 201, the reference image storage determination unit 111B determines that the compressed data corresponding to the reference image is not stored in the reference image memory 113. Therefore, the video encoding device 18 can optimize the reference images to be stored in the reference image memory 113 by not storing reference images with greater complexity, which are not suitable for inter-frame coding, in the reference image memory 113. That is, the video encoding device 18 can store only reference images estimated to be suitable for inter-frame prediction in the reference image memory 113. As a result, the encoding rate of the video encoding device 18 can be improved, and the image quality can be improved.

[0127] Third embodiment

[0128] Next, a third embodiment is described The third embodiment is different from the first embodiment in that it has an intra refresh function and makes the size of an intra refresh target area (hereinafter referred to as "intra refresh area") variable.

[0129] Generally, there is a function called intra refresh. This function forces intra coding to a fixed area whose position changes for each frame, thereby preventing the propagation of prediction errors between frames and improving image quality. In the third embodiment, the size of the intra refresh area is changed according to the number of reference images that cannot be stored in the reference image memory 113.

[0130] Fig.12 1 is a block diagram showing an exemplary configuration of a video encoding device according to the third embodiment. Fig.12 As shown, the third embodiment is different from the first embodiment (see Figure 3 and Figure 4 ) is different from the reference image storage determination unit 111C in that the reference image storage determination unit 111C includes a non-stored image counting unit 301, the video encoding device 18 includes an intra refresh area determination unit 302, and a control signal 303 is transmitted from the intra refresh area determination unit 302 to the storage determination unit 147. Other configurations and operations are the same as those of the video encoding device 18 and the reference image storage determination unit 111 described in the first embodiment, and therefore, the same reference numerals are assigned to the same configurations, and repeated descriptions are omitted.

[0131] The unstored image count unit 301 counts the number of reference images whose compressed data cannot be stored in the reference image memory 113. The unstored image count unit 301 is initialized before starting the encoding process of the unit area or when the encoding process of the unit area is completed.

[0132] In the present embodiment, the video encoding device 18 further includes an intra refresh area determination unit 302. In the subsequent frame, the intra refresh area determination unit 302 determines the size and position of the intra refresh area to be forced to perform intra encoding. The intra refresh area determination unit 302 adjusts the size of the intra refresh area based on the number of divided images (e.g., macroblocks) transmitted from the unstored image counting unit 301 and that cannot be stored in the reference image memory 113.

[0133] Fig.13 is a diagram illustrating an exemplary reference image storage result of the video encoding device 18 according to the first embodiment. Figure 5 As shown in FIG. 1 , the segmented image (rectangular block) is encoded from left to right in the same row. Therefore, when the unit area is 1 macroblock line (1MBL), as shown in FIG. Fig.13As shown, the MB located on the left side of the macroblock row can easily store the compressed data obtained by compressing the reference image in the reference image memory 113. On the other hand, in the MB located on the right side of the macroblock row, the compressed data obtained by compressing the reference image is hardly stored in the reference image memory 113. Therefore, when only the remaining memory capacity of the reference image is used as a criterion for determining whether to store the reference image in the reference image memory 113, there is a problem that the position of the MB that can be inter-coded within one frame is deviated. The video encoding device 18 according to the third embodiment solves the problem of biasing the position of the MB that can be coded by inter-coding by variably controlling the intra refresh area.

[0134] Fig.14 is a diagram illustrating an exemplary operation of the video encoding device 18 according to the third embodiment. In the video encoding device 18 according to the present embodiment, the unstored image counting unit 301 receives the determination result information 148 output from the storage determination unit 147. If the determination result information 148 is notified that the compressed data is not stored in the reference image memory 113, the unstored image counting unit 301 counts. For example, when the unit area is 1 macroblock row, the unstored image counting unit 301 counts the number of MBs that cannot be stored in the reference image memory 113. When the processing of the unit area is completed, the unstored image counting unit 301 transmits the sum of the number of MBs that are not stored to the intra refresh area determination unit 302.

[0135] The intra refresh region determination unit 302 determines the size of the intra refresh region based on the sum of the number of MBs that are not stored. For example, when there are MBs that are not stored, the size of the intra refresh region increases. On the contrary, when there are no MBs that are not stored, the size of the intra refresh region may be reduced. The intra refresh region determination unit 302 transmits the determined size and position of the intra refresh region to the storage determination unit 147 as a control signal 303.

[0136] When the compressed data is included in the intra refresh area, the storage determination unit 147 determines not to store the compressed data in the reference image memory 113. On the other hand, when the compressed data is not included in the intra refresh area, the storage determination unit 147 determines whether to store the compressed data in the reference image memory 113 based on the comparison result output by the data amount comparison unit 146.

[0137] According to the third embodiment, the video encoding device 18 further includes a non-stored image counting unit 301 and an intra refresh area determination unit 302. The intra refresh area determination unit 302 determines the size of the intra refresh area according to the number of MBs counted by the non-stored image counting unit 301 that cannot be stored in the reference image memory 113. Therefore, the size of the intra refresh area can be changed according to the number of images not stored in the reference image memory 113. The compressed data corresponding to the reference image of the divided image (e.g., MB) in the intra refresh area does not need to be stored in the reference image memory 113. Therefore, in the video encoding device 18 according to the third embodiment, the number of compressed data (the number of reference images) stored in the reference image memory 113 can be reduced by adjusting the size of the intra refresh area. As a result, the shortage of the remaining capacity of the reference image memory 113 at the right end of the frame (the right end of the unit area) can be reduced. Further, since the position of the intra refresh area is different for each frame, the deviation of the position of the intra-coded and inter-coded macroblocks can be eliminated for the entire frame. In this way, the video encoding device 18 according to the third embodiment can eliminate the deviation of the positions of intra-coded macroblocks and inter-coded macroblocks, and can improve image quality.

[0138] Fourth embodiment

[0139] Next, the fourth embodiment is described. In order to optimize the reference images stored in the reference image memory 113, the fourth embodiment is different from the first to third embodiments in that even if a reference image is already stored in the reference image memory, the reference image is replaced by a more appropriate reference image.

[0140] Fig.15 1 is a block diagram showing an exemplary configuration of a video encoding device according to the fourth embodiment. The video encoding device 18 according to the fourth embodiment is different from the reference image storage determination unit 111B described in the second embodiment (see Fig.10 ) is that the reference image storage determination unit 111D further includes a complexity storage unit 401 and a replacement information storage unit 402. Other configurations and operations are the same as those of the reference image storage determination unit 111B described in the second embodiment, and therefore, the same reference numerals are assigned to the same configurations, and repeated descriptions are omitted.

[0141] When compressed data corresponding to a reference image is stored in the reference image memory 113, the complexity storage unit 401 stores the complexity of the corresponding reference image.

[0142] After storing the compressed data corresponding to the reference image in the reference image memory 113, the storage determination unit 147 replaces the compressed data stored in the reference image memory 113 when a more appropriate reference image appears.

[0143] When the storage determination unit 147 performs a process of replacing a reference image, the replacement information storage unit 402 stores information of the reference image before replacement and information of the reference image after replacement.

[0144] Fig.16 4 is a diagram showing an example of data stored in the complexity storage unit 401 and the replacement information storage unit 402 according to the present embodiment. In the present embodiment, the unit area is described as 1 macroblock line (MBL). For example, possible values ​​of complexity are assumed to be 0 to 63.

[0145] The complexity storage unit 401 stores the macroblock number of the compressed data stored in the reference image memory 113 and the complexity of the reference image. Fig.16 In the complexity storage unit 401, stored are: a reference image of macroblock number 1 with complexity 10, a reference image of macroblock number 2 with complexity 12, a reference image of macroblock number 3 with complexity 18, a reference image of macroblock number 5 with complexity 28, and a reference image of macroblock number 7 with complexity 22 which has been stored in the reference memory 113.

[0146] Fig.17 4 is a flowchart showing an exemplary reference image storage determination process in the video encoding device 18 according to the fourth embodiment. Fig.17 As shown, when the reference image and the compressed data are entered into the reference image storage determination unit 111D (step S400), the complexity comparison unit 203 compares the complexity of the reference image with a predetermined threshold value (step S401). If the complexity of the reference image is greater than the complexity threshold value (step S401: No), the storage determination unit 147 determines not to store the compressed data in the reference image memory 113 (step S402). That is, regardless of the magnitude relationship between the allowable data amount and the storage data amount, the storage determination unit 147 determines not to store the compressed data in the reference image memory 113. The storage determination unit 147 transmits information indicating that the compressed data is not stored in the reference image memory 113 to the memory control unit 112, the flag storage unit 114, and the storage data amount calculation unit 142 as the determination result information 148.

[0147] On the other hand, when the complexity of the reference image is equal to or less than the complexity threshold value (step S401: Yes), the data amount comparison unit 146 compares the allowable data amount set in the allowable data amount setting unit 141 with the storage data amount transmitted from the storage data amount calculation unit 142 (step S403). When the storage data amount is equal to or less than the allowable data amount, that is, when there is a remaining memory capacity (step S403: Yes), the storage determination unit 147 transmits the determination result information 148 for storing compressed data in the reference image memory 113 to the memory control unit 112, the flag storage unit 114, and the storage data amount calculation unit 142 based on the comparison result of the data amount comparison unit 146 (step S404), and ends the storage determination process (step S409).

[0148] On the other hand, if the amount of stored data is greater than the allowable amount of data (step S403: No), the storage determination unit 147 reads the complexity of the stored segmented image (e.g., macroblock) from the complexity storage unit 401 (step S405). Herein, it is determined whether the compressed data to be stored is referred to as CDnew, the reference image corresponding to CDnew is referred to as RPnew, the stored compressed data is referred to as CDold, and the reference image corresponding to CDold is referred to as RPold. If a reference image RPold having a complexity greater than that of RPnew is not found (step S406: No), the storage determination unit 147 determines that the compressed data CDnew is not stored in the reference image memory 113 (step S402).

[0149] If a reference image RPold having a greater complexity than the complexity of the reference image RPnew is found (step S406: yes), the storage determination unit 147 compares the data sizes of the compressed data CDnew and the compressed data CDold (step S407). When the data amount of the compressed data CDnew is larger than the data amount of the stored compressed data CDold, the memory capacity of the reference image memory 113 is insufficient. Therefore, the storage determination unit 147 determines that the compressed data CDnew is not stored in the reference image memory 113 (step S402). On the other hand, when the data amount of the compressed data CDnew is equal to or smaller than the data amount of the stored compressed data CDold, the storage determination unit 147 writes information indicating that the reference image is to be replaced into the replacement information storage unit 402 (step S408). Next, the storage determination unit 147 transmits information indicating that the compressed data CDnew is to be stored in the reference image memory 113 as the determination result information 148 to the memory control unit 112, the flag storage unit 114, and the storage data amount calculation unit 142 (step S404), and ends the process (step S409).

[0150] Whenever compressed data is replaced for all MBs of 1 MBL or after compressed data storage determination is completed, the storage determination unit 147 transfers the information stored in the replacement information storage unit 402 to the flag storage unit 114 and updates the information stored in the flag storage unit 114 .

[0151] When a plurality of reference images RPold having a greater complexity than that of the reference image RPnew is found in step S406, the storage determination unit 147 compares the data amount of the stored compressed data having the largest data amount among the plurality of replacement candidates with the data amount of the compressed data CDnew in step S407, and makes the stored compressed data having the largest data amount a replacement target. When a plurality of reference images RPold having a greater complexity than that of the reference image RPnew is found, the storage determination unit 147 may search for compressed data CDold having a data amount equal to or less than the data amount of the compressed data CDnew in descending order of the complexity of the reference images RPold.

[0152] The complexity value stored in the complexity storage unit 401 may be simplified according to the size of the complexity storage unit 401. This case is illustrated when the possible value of the complexity is 0 to 63. In this case, for example, when the complexity is 0 to 15, the value C of the picture complexity stored in the complexity storage unit 401 is 0; when the complexity is 16 to 31, the value C is 1; when the complexity is 32 to 47, the value C is 2; and when the complexity is 48 to 63, the value C is 3.

[0153] In this way, by setting the same value C for a certain range of complexity, the number of bits required for expressing the complexity in the complexity storage unit 401 can be reduced. Therefore, the size of the circuit required for the complexity storage unit 401 can be reduced. In addition, if the possible value of the complexity is made small to 0 to 63, the time required to search for the stored compressed data CDold to be replaced increases. Therefore, by reducing the possible value of the complexity, such as the value C, the time required to search for the stored reference image RPold and the compressed data CDold can be reduced. Therefore, the throughput of the reference image storage determination unit 111D can be improved.

[0154] According to the fourth embodiment, compared with the reference image storage determination unit 111B of the second embodiment, the reference image storage determination unit 111D further includes a complexity storage unit 401 and a replacement information storage unit 402. Therefore, the video encoding device 18 can replace the reference image to be stored as needed based on the data size and complexity of the compressed data of the reference image, and can further optimize the data size. As a result, the video encoding device 18 can further improve the encoding efficiency and image quality.

[0155] Fifth embodiment

[0156] The fifth embodiment is a vehicle on which the video encoding device 18 related to the first to fourth embodiments is mounted. In the vehicle according to the present embodiment, the video encoding device 18 variably adjusts the memory use according to the driving mode of the vehicle.

[0157] Fig.18 1 is a block diagram showing an exemplary configuration of a vehicle control system in which the video encoding device 18 is installed. The video encoding device installed on the present embodiment switches whether to losslessly compress a reference image used for inter-frame prediction according to a driving mode.

[0158] like Fig.18 As shown, a vehicle control system 501 is installed on a vehicle 500. The vehicle control system 501 includes one or more camera modules 1E, a vehicle control unit 502, a driving mode determination unit 503, an in-vehicle network 505, and a semiconductor device 506.

[0159] The vehicle 500 includes at least two different driving modes. That is, the vehicle 500 includes a manual driving mode for humans as a first driving mode and an automatic driving mode as a second driving mode. Fig.18 In the embodiment, four camera modules 1E are provided at the front right, front left, rear right, and rear left of the vehicle 500, but the number of camera modules provided in the vehicle 500 is not limited to four.

[0160] The vehicle control unit 502 performs various controls of the vehicle. For example, the vehicle control unit controls the gear position and the travel speed of the vehicle 500.

[0161] The driving mode determination unit 503 determines whether the driving mode of the vehicle 500 is a manual driving mode or an automatic driving mode based on the vehicle control data 504 output from the vehicle control unit 502. Herein, the vehicle control information 504 may be, but is not limited to, driving mode control instruction information provided by the driver of the vehicle 500 to the vehicle 500. For example, the vehicle control information 504 may be gear information of the vehicle 500, speed information of the vehicle 500, or a driving place (e.g., on a highway).

[0162] The in-vehicle network 505 may be a wired network or a radio network.

[0163] The semiconductor device 506 also includes a CPU 507 , a video decoder 508 , a graphic processor 509 , an image recognition unit 510 , a bus 512 , and a DDR memory controller 513 .

[0164] The CPU 507 executes a program, and controls the entire semiconductor device 506 .

[0165] The video decoder 508 decodes the bit stream BSout received from the camera module 1E.

[0166] The graphic processor 509 performs image processing on the image decoded by the video decoder 508. For example, the graphic processor 509 performs enlargement and reduction processing on the image decoded by the video decoder 508.

[0167] The image recognition unit 510 performs image recognition processing based on the image decoded by the video decoder 508. For example, the image recognition unit 510 recognizes other vehicles, people, traffic lights, and road signs, and writes the image recognition result to the DDR memory 514 via the DDR memory controller 513.

[0168] The DDR memory controller 513 receives a write request to the DDR memory 514 and a read request from the DDR memory 514 from a bus master (eg, the CPU 507 or the image recognition unit 510 ), and controls write access to the DDR memory 514 and read access to the DDR memory 514 .

[0169] The DDR memory 514 is a solid-state storage device that stores programs to be processed by the CPU 507 , data input to the video decoder 508 , the graphic processor 509 , and the image recognition unit 510 , temporary data, and processing results.

[0170] Fig.19 1E is a block diagram showing an exemplary configuration of a camera module 1E according to the present embodiment. In the present embodiment, the semiconductor device 12 does not have a built-in SRAM, and a DDR memory 514 is used as a storage device.

[0171] When the vehicle 500 according to the present embodiment travels in the automatic driving mode, it is necessary to control the vehicle 500 after recognizing the surrounding conditions (e.g., driving lanes, signals, road signs, other vehicles, and pedestrians) of the vehicle 500. Therefore, the vehicle control unit 502 and the semiconductor device 506 need to perform a large amount of information processing and use a large amount of memory on the DDR memory 514.

[0172] On the other hand, when the driver drives in the manual driving mode, the driver of the vehicle 500 himself recognizes the surrounding conditions of the vehicle 500. Therefore, the vehicle control unit 502 and the semiconductor device 506 use only a small amount of DDR memory 514 compared to the automatic driving mode.

[0173] The video encoding device 18 according to the present embodiment can variably adjust the capacity of the DDR memory to be used according to the driving mode of the vehicle. For example, the video encoding device 18 can turn on and off the function of losslessly compressing the reference image according to the driving mode of the vehicle. The video encoding device 18 can also adjust the number of reference images stored in the DDR memory 514 according to the amount of available memory.

[0174] When lossless compression is turned off, the memory capacity of the reference image memory is large, so that reference images can be stored for all segmented images (e.g., macroblocks). The video encoding device 18 can optimally select macroblocks to be intra-frame encoded or inter-frame encoded without being limited by the memory capacity. Therefore, the encoding efficiency is improved and the image quality is improved. On the other hand, when the function of lossless compression of the reference image is turned on, because the memory capacity cannot be fully ensured, the reference image storage determination unit 111 in the video encoding device 18 determines whether to store the compressed data of the reference image in the reference image memory 113 based on the determination method related to the first embodiment to the fourth embodiment. Therefore, the video encoding device 18 can encode the input motion picture DVin while suppressing the degradation of image quality. That is, since the vehicle 500 has the driving mode determination unit 503, the video encoding device 18 can be made to perform optimal motion image encoding according to the driving mode of the vehicle 500.

[0175] Although the invention made by the present invention has been specifically described based on the above-mentioned embodiment, the present invention is not limited to the described embodiment, and various modifications can be made without departing from the gist thereof. For example, the third embodiment can be combined with the second embodiment, the fourth embodiment, or the fifth embodiment.

[0176] Further, in the description of the first embodiment 4, when the encoding process of the unit region (e.g., MBL) is performed, the reference image is stored in the reference image memory 113 for each of the divided images (e.g., MB). However, the reference image may be stored in the reference image memory 113, for example, after determining whether all the divided images (e.g., all MBs) included in the unit region are stored in the reference image memory 113, all the divided images may be stored in the unit region. That is, the storage of the reference images in the reference image memory 113 may be performed collectively after determining whether all MBs in 1MBL may be stored in the reference image memory 113.

Claims

1. A video encoding device for encoding video data, the video encoding device comprising: an image encoding unit for performing predictive encoding by obtaining a difference between a divided image to be subjected to predictive encoding and a reference image; A local decoding generation unit, configured to generate the reference image based on the encoding result of the segmented image; A compression unit, configured to losslessly compress the reference image to generate compressed data; an allowable data amount setting unit for setting in advance an allowable data amount of the compressed data stored in the memory for each predetermined area of ​​the video data; a storage data amount calculation unit, configured to calculate a storage data amount of the predetermined area required when the compressed data in the memory is stored; a comparing unit, configured to compare the allowable data amount with the stored data amount and output a comparison result; a reference image storage determination unit for determining whether to store the compressed data in the memory based on the comparison result, and for storing the compressed data in the memory based on: 1) a determination result for storing the compressed data in the memory, 2) complexity of the reference image to be stored in the memory, and 3) a predetermined threshold value of the complexity of the reference image, wherein the complexity is a parameter indicating local unevenness of the video data; as well as An inter-frame prediction unit is used to perform a motion vector search for inter-frame encoding based on the reference image stored in the memory, wherein the inter-frame prediction unit searches the reference image corresponding to the compressed data stored in the memory as a search range for the motion vector search.

2. The video encoding device according to claim 1, further comprising: a flag storage unit storing a flag indicating whether the compressed data is stored in the memory; a reference image existence determination unit, which determines whether the reference image is stored in the memory based on the flag; as well as a decompression unit, expanding the compressed data stored in the memory, wherein the reference image existence judgment unit reads the reference image information stored in the flag storage unit regarding whether the reference image exists, and When the reference image information indicates that the compressed data is stored in the memory, the reference image existence judgment unit reads the compressed data from the memory and transfers the compressed data to the decompression unit, and the decompression unit transfers the reference image generated by decompressing the compressed data to the inter-frame prediction unit.

3. The video encoding device according to claim 1, further comprising: An intra-frame prediction unit, used for calculating a first coding cost required for intra-frame coding of the segmented image; as well as an intra-frame and inter-frame determining unit, configured to determine whether the segmented image is encoded by intra-frame coding or inter-frame coding, wherein the intra prediction unit transmits the first coding cost to the intra and inter determination unit, wherein the inter-frame prediction unit calculates a second encoding cost required for inter-frame encoding using a difference between the segmented image and the reference image, and the second encoding cost is transmitted to the intra-frame inter-frame determination unit, and The intra-frame inter-frame determination unit determines whether the divided image is encoded by intra-frame encoding or inter-frame encoding based on a cost comparison result of the first encoding cost and the second encoding cost.

4. The video encoding device according to claim 3, The reference image existence judgment unit determines whether the reference image is stored in an area where the reference image can be referenced to perform inter-frame encoding on the segmented image based on the reference image information, and when there is no reference image to be referenced in the area, the reference image existence judgment unit transmits instruction information to perform intra-frame encoding to the intra-frame and inter-frame determination unit.

5. The video encoding device according to claim 3, wherein the intra-frame prediction unit estimates multiple code amounts required to encode the segmented image in multiple intra-frame modes, calculates multiple encoding costs based on the estimated multiple code amounts, and transmits the minimum encoding cost among the multiple encoding costs as the first encoding cost to the intra-frame inter-frame determination unit.

6. The video encoding device according to claim 3, wherein the inter-frame prediction unit estimates multiple code amounts required to encode the segmented image through inter-frame encoding based on the difference between the segmented image and each reference image in a plurality of reference images, and the plurality of reference images can be referenced to encode the segmented image, and the inter-frame prediction unit calculates multiple encoding costs based on the estimated multiple code amounts, and transmits the minimum encoding cost among the multiple encoding costs as the second encoding cost to the intra-frame inter-frame determination unit.

7. A video encoding device according to claim 1, wherein the reference image storage determination unit searches for additional compressed data stored in the memory based on the comparison result and the complexity comparison result obtained by comparing the complexity of the reference image with the predetermined threshold value of the complexity, and replaces the additional compressed data with the compressed data based on the complexity of the reference image, the complexity of the additional compressed data, the data amount of the compressed data corresponding to the reference image, and the data amount of the additional compressed data.

8. The video encoding device according to claim 1, wherein the predetermined area is a macroblock row, and wherein the allowable data amount is predetermined for each of a plurality of macroblock rows included in the video data.

9. An operating method of a video encoding device, the operating method comprising: performing predictive encoding by obtaining a difference between a segmented image to be subjected to predictive encoding and a reference image; generating the reference image based on the encoding result of the segmented image; losslessly compressing the reference image to generate compressed data; setting in advance an allowable data amount of the compressed data stored in the memory for each predetermined area of ​​the video data; calculating a storage data amount of the predetermined area required when the compressed data in the memory is stored; comparing the allowable data amount with the stored data amount and outputting a comparison result; determining whether to store the compressed data in the memory based on the comparison result, and storing the compressed data in the memory based on: 1) a determination result for storing the compressed data in the memory, 2) complexity of the reference image to be stored in the memory, and 3) a predetermined threshold value of the complexity of the reference image, wherein the complexity is a parameter indicating local unevenness of the video data; as well as A motion vector search is performed based on the reference image stored in the memory for inter-frame encoding, wherein the reference image corresponding to the compressed data stored in the memory is searched as a search range for the motion vector search.