WO2011122285A1 - 画像符号化装置 - Google Patents

画像符号化装置 Download PDF

Info

Publication number
WO2011122285A1
WO2011122285A1 PCT/JP2011/055614 JP2011055614W WO2011122285A1 WO 2011122285 A1 WO2011122285 A1 WO 2011122285A1 JP 2011055614 W JP2011055614 W JP 2011055614W WO 2011122285 A1 WO2011122285 A1 WO 2011122285A1
Authority
WO
WIPO (PCT)
Prior art keywords
encoding
macroblock
macroblocks
code amount
encoded
Prior art date
Application number
PCT/JP2011/055614
Other languages
English (en)
French (fr)
Inventor
長谷川 弘
敏充 達可
武明 小室
Original Assignee
株式会社メガチップス
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社メガチップス filed Critical 株式会社メガチップス
Publication of WO2011122285A1 publication Critical patent/WO2011122285A1/ja

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/152Data rate or code amount at the encoder output by measuring the fullness of the transmission buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/189Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
    • H04N19/192Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding the adaptation method, adaptation tool or adaptation type being iterative or recursive
    • H04N19/194Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding the adaptation method, adaptation tool or adaptation type being iterative or recursive involving only two passes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding

Definitions

  • the present invention relates to an image encoding device that encodes a plurality of image data and outputs one compressed image data.
  • a plurality of cameras may be installed. By monitoring from different angles using a plurality of cameras, it is possible to prevent the generation of blind spots.
  • the video signal generated by each camera is encoded and transmitted because the bandwidth of the transmission path is limited. Since it is necessary to simultaneously display and monitor the video of each camera, it is necessary to multiplex and transmit a plurality of video signals corresponding to each camera.
  • Patent Document 1 discloses a video signal encoding apparatus that converts a plurality of frame videos input from each camera into a single system of compressed data.
  • the video signal encoding apparatus deletes a frame video that is not encoded from a frame video input from each camera, and extracts a frame video to be encoded.
  • the extracted frame images are arranged for each camera.
  • the arranged frame images are encoded in GOP (Group of Pictures) units. Thereby, a plurality of frame images input from each camera are converted into one system of compressed data.
  • GOP Group of Pictures
  • the video signal encoding apparatus extracts a frame video to be encoded.
  • the video signal encoding device cannot generate compressed data until the number of encoding target frame videos that can generate a GOP is extracted.
  • the time (delay) from when the frame video is input to the video signal encoding device to when it is output as one system of compressed data becomes long, it is difficult to transmit the video of each camera in real time. .
  • code amount control is performed in units of GOPs.
  • the generated code amount may momentarily exceed the target code amount.
  • the target code amount is determined by the bandwidth of the transmission path. For this reason, there is a possibility that a transmission delay or the like occurs when the generated code amount greatly exceeds the target code amount.
  • the image encoding device of the present invention is an image encoding device that encodes first to Nth (N is a natural number of 1 or more) image data.
  • the image coding apparatus according to the present invention when k is a natural number from 1 to N, determines the k-th macroblock based on the order information indicating the coding order of the k-th macroblock included in the k-th image data.
  • the quantization parameter determination unit identifies the first number of macroblocks encoded immediately before the encoding target macroblock from the group of encoded macroblocks encoded by the encoding unit, A correction amount of the quantization parameter based on a code amount integration unit that calculates an integrated value of the generated code amount for each number of macroblocks, an integration value, and a target code amount for the first number of macroblocks A correction value determination unit that determines and corrects the quantization parameter based on the correction value.
  • the image coding apparatus performs code amount control in units of the first number of macroblocks. For this reason, it is possible to prevent the bit rate of the compressed data generated by encoding the k-th macroblock from instantaneously greatly exceeding the target bit rate. Therefore, the present invention can suppress transmission delay and the like.
  • the first number of macroblocks includes encoded macroblocks of image data different from the kth image data. For this reason, even if the generated code amount of a coded macroblock of other image data changes greatly, the correction value of the quantization parameter of the encoding target macroblock is changed according to the change of the generated code amount. can do. Therefore, the present invention can flexibly control the bit rate of the compressed data.
  • an object of the present invention is to provide an image encoding apparatus that performs code amount control corresponding to a system for transmitting video in real time.
  • FIG. 1 It is a figure which shows the structure of the image transmission system which concerns on embodiment of this invention. It is a block diagram which shows the functional structure of the image coding apparatus shown in FIG. It is a figure which shows the structure of the macroblock of uncompressed image data. It is a figure which shows the encoding order of a macroblock group. It is a figure which shows the encoding order of a macroblock group. It is a flowchart which shows the flow of encoding of a macroblock. It is the schematic which shows the structure of multiplexed compression data. It is a figure which shows the calculation object of a line generation code amount. It is a figure which shows a correction value determination table. It is a figure which shows the calculation object of a line generation code amount.
  • FIG. 1 is a diagram showing a configuration of an image transmission system according to an embodiment of the present invention.
  • An image transmission system 100 shown in FIG. 1 includes cameras 1a and 1b, an image encoding device 2, and monitoring devices 4a and 4b.
  • the image transmission system 100 is a system that monitors an ATM corner provided in a financial institution store in real time.
  • Cameras 1a and 1b are attached so that ATM corners can be photographed from different angles.
  • the cameras 1a and 1b take pictures of ATM corners and generate uncompressed image data 31a and 31b.
  • the image encoding device 2 is installed at the ATM corner together with the cameras 1a and 1b.
  • the frame of uncompressed image data 31a and 31b is input to the image encoding device 2 in synchronization.
  • the image encoding device 2 encodes and multiplexes the uncompressed image data 31a and 31b to generate multiplexed compressed data 33.
  • the multiplexed compressed data 33 is transmitted to a monitor room that monitors an ATM corner via a wireless communication network or the like.
  • the monitoring devices 4a and 4b are installed in the monitor room and receive the multiplexed compressed data 33.
  • the monitoring devices 4a and 4b perform demultiplexing and decoding processing on the multiplexed compressed data 33, and display images corresponding to the cameras 1a and 1b.
  • the cameras 1a and 1b photograph the same place (ATM corner) from different angles. For this reason, the monitoring devices 4a and 4b display the images of the cameras 1a and 1b in synchronization so that the timing for displaying the images of the cameras 1a and 1b is not shifted.
  • a monitor resident in the monitor room remotely monitors the ATM corner by viewing the images displayed on the monitoring devices 4a and 4b.
  • the description will be focused on the point that the image encoding device 2 encodes the uncompressed image data 31a and 31b and generates the multiplexed compressed data 33, respectively.
  • the macroblocks of the uncompressed image data 31a and 31b are each divided into macroblock groups (hereinafter referred to as “MB groups”) composed of one or more macroblocks based on preset division units.
  • the multiplexed compressed data 33 is generated by alternately encoding the MB group of the uncompressed image data 31a and the MB group of the uncompressed image data 31b.
  • the image encoding device 2 determines a quantization parameter of an encoding target macroblock (hereinafter referred to as an encoding target MB).
  • the quantization parameter is determined based on a target code amount per predetermined number of macroblocks and a total sum of generated code amounts of a predetermined number of macroblocks encoded immediately before encoding of the encoding target MB. That is, the image encoding device 2 executes code amount control in units of a predetermined number of macroblocks when the uncompressed image data 31a and 31b are encoded to generate the multiplexed compressed data 33. Since the code amount control is performed in a unit time shorter than the GOP unit, it is possible to prevent the bit rate of the multiplexed compressed data 33 from exceeding a preset target bit rate.
  • the predetermined number of macroblocks encoded immediately before include the macroblock of the uncompressed image data 31b.
  • the image encoding device 2 uses the code amount of the encoded macroblock of the uncompressed image data 31b. Therefore, the bit rate of the multiplexed compressed data 33 can be stably controlled even if the code amount of the encoded data of the uncompressed image data 31b changes greatly.
  • FIG. 2 is a block diagram illustrating a functional configuration of the image encoding device 2.
  • the image encoding device 2 includes an order determination unit 21, an encoding unit 22, a quantization parameter determination unit 23, a multiplexing unit 24, and a communication unit 25.
  • the order determination unit 21 determines the order of encoding the macroblocks of the uncompressed image data 31a and 31b. Order information 41 is created based on the determined order. The order determination unit 21 outputs the order information 41 to the encoding unit 22 and the multiplexing unit 24.
  • the encoding unit 22 encodes the macroblocks of the uncompressed image data 31a and 31b based on the order information 41 to generate encoded data 32a and 32b.
  • For encoding the uncompressed image data 31a and 31b for example, H.264 is used.
  • An encoding method such as H.264 or MPEG2 is used.
  • the encoding unit 22 outputs the generated code amount Ea of the encoded MB to be encoded to the quantization parameter determining unit 23.
  • the generated code amount Ea is used when determining the quantization parameter QP of the next encoding target MB.
  • the quantization parameter determination unit 23 determines a quantization parameter QP used for quantization of each macroblock of the uncompressed image data 31a and 31b.
  • the quantization parameter determination unit 23 includes a generated code amount integration unit 231, an initial value determination unit 232, and a correction value determination unit 233.
  • the generated code amount accumulation unit 231 accumulates the generated code amounts of a predetermined number of macroblocks encoded immediately before the encoding target MB.
  • the initial value determination unit 232 determines the initial value of the quantization parameter QP of the encoding target MB.
  • the correction value determination unit 233 corrects an initial value based on the target code amount per predetermined number of macroblocks and the integrated value of the generated code amounts of the predetermined number of macroblocks encoded immediately before. Is calculated.
  • the quantization parameter determination unit 23 outputs the sum of the initial value and the correction value to the encoding unit 22 as the quantization parameter QP.
  • the multiplexing unit 24 generates the multiplexed compressed data 33 by arranging the macroblocks of the encoded uncompressed image data 31a and 31b in the encoded order.
  • the communication unit 25 adds an error correction signal to the multiplexed compressed data 33 and performs digital modulation.
  • the communication unit 25 transmits the digitally modulated multiplexed compressed data 33 to the monitoring devices 4a and 4b using wireless communication.
  • the order determination unit 21 determines the order (encoding order) for encoding the macroblocks of the uncompressed image data 31a and 31b. In determining the encoding order, the order determining unit 21 generates a first MB group from the macroblock of the uncompressed image data 31a and a second MB group from the macroblock of the uncompressed image data 31b.
  • FIG. 3 is a diagram showing the configuration of the macroblocks of the uncompressed image data 31a and 31b. As shown in FIG. 3, each frame of the uncompressed image data 31a and 31b is composed of 36 macro blocks. The frame rates of the uncompressed image data 31a and 31b are the same.
  • the uncompressed image data 31a and 31b are composed of 6 macro blocks by 6 horizontal blocks.
  • the macro blocks of the uncompressed image data 31a are assigned numbers Ma0 to Ma35 from the upper left to the lower right.
  • the macro blocks of the uncompressed image data 31b are assigned numbers Mb0 to Mb35 from the upper left to the lower right.
  • a set of six macroblocks arranged in a line in the horizontal direction is called a macroblock line (MB line).
  • the uncompressed image data 31a has MB lines La1, La2, La3, La4, La5 and La6.
  • the uncompressed image data 31b has MB lines Lb1, Lb2, Lb3, Lb4, Lb5, and Lb6.
  • the order determining unit 21 generates the first MB group and the second MB group by dividing the macroblocks of the uncompressed image data 31a and 31b based on a preset division unit. Macroblocks, MB lines, and the like can be used as partition units.
  • each of the macroblocks Ma0 to Ma35 is classified as a first MB group.
  • Each of the macro blocks Mb0 to Mb35 is divided as the second MB group.
  • the MB line is set as the division unit, the MB lines La1 to La6 are each divided as the first MB group.
  • the MB lines Lb1 to Lb6 are each divided as the second MB group.
  • the partition unit may be set so that the MB group is composed of one or more macroblocks. For example, when four macroblocks are set as the division unit, the macroblocks Ma0 to Ma3, Ma4 to Ma7, etc. of the uncompressed image data 31a are classified as the first MB group.
  • the order determining unit 21 determines the encoding order of the MB groups so that the first MB group and the second MB group are alternately encoded after generating the MB group.
  • FIG. 4 is a diagram showing an encoding order when MB groups are generated in units of macroblocks.
  • the order determination unit 21 determines the encoding order so that the macroblocks Ma0, Mb0, Ma1, Mb1, Ma2, Mb2,..., Mb34, Ma35, and Mb35 are encoded in this order. That is, the encoding order is determined so that the macroblock of the uncompressed image data 31a and the macroblock of the uncompressed image data 31b are encoded alternately.
  • FIG. 5 is a diagram showing an encoding order when MB groups are generated in units of MB lines.
  • the order determination unit 21 determines the encoding order such that the MB lines La1, Lb1, La2, Lb2, La3, Lb3,..., La6, Lb6 are encoded in this order. That is, the encoding order is determined so that the MB line of the uncompressed image data 31a and the MB line of the uncompressed image data 31b are encoded alternately.
  • the macroblocks of each MB line are encoded in order from the left (in order of increasing macroblock number).
  • the order determination unit 21 outputs order information 41 indicating the encoding order of the MB group to the encoding unit 22. Based on the order information 41, the encoding unit 22 encodes the macroblocks Ma0 to Ma35 and Mb0 to Mb35 for each MB group.
  • FIG. 6 is a flowchart showing the flow of encoding a macroblock.
  • encoding unit 22 specifies an encoding target MB based on order information 41 (step S1).
  • the quantization parameter determination unit 23 determines whether or not an exception condition is met when determining the quantization parameter QP of the encoding target MB (step S2). If the exception condition is met (Yes in step S2), the quantization parameter QP is determined by executing the exception process (step S10). The exception process determines the quantization parameter QP without using the target code amount per predetermined number of macroblocks and the integrated value of the generated code amount of the macroblock encoded immediately before encoding of the encoding target MB. It is processing to do.
  • the quantization parameter determination unit 23 determines the quantization parameter QP by the processing of steps S3 to S7.
  • the initial value determining unit 232 calculates the initial value of the quantization parameter QP of the encoding target MB (step S3).
  • the correction value determining unit 233 determines the correction value V1 (step S4).
  • the correction value V1 is calculated based on the target code amount of the macroblocks per predetermined number and the integrated value of the generated code amounts of the predetermined number of macroblocks encoded immediately before the encoding target MB.
  • the correction value determination unit 233 determines the correction value V2 based on the activity indicating the complexity of the image of the encoding target MB (step S5).
  • the correction value determination unit 233 determines the correction value V3 based on the generated code amount of the macroblock encoded immediately before among the encoded macroblocks of the uncompressed image data to which the encoding target MB belongs (step). S6).
  • the quantization parameter determination unit 23 determines the quantization parameter QP of the encoding target MB by summing the initial value and the correction values V1, V2, and V3 (step S7).
  • the encoding unit 22 encodes the encoding target MB using the determined quantization parameter QP (step S8).
  • the encoded macroblock is output to the multiplexing unit 24 as encoded data 32a.
  • the encoded macro block is output to the multiplexing unit 24 as encoded data 32b.
  • step S9 If all the macroblocks of the uncompressed image data 31a and 31b have not been encoded (No in step S9), the image encoding device 2 returns to the process of step S1. If encoding of all the macroblocks has been completed (Yes in step S9), the image encoding device 2 ends the processing shown in FIG.
  • the multiplexing unit 24 generates the multiplexed compressed data 33 by arranging the encoded data 32a and 32b in the input order.
  • FIG. 7 is a schematic diagram showing the configuration of the multiplexed compressed data 33.
  • the multiplexed compressed data 33 includes a stream header 34 and stream data Sa and Sb.
  • the stream header 34 includes control information used when reproducing the multiplexed compressed data 33.
  • Stream data Sa corresponds to uncompressed image data 31a, and includes a group header 35a and encoded data 32a.
  • the group header 35a includes identification information of the uncompressed image data 31a and information for specifying the macroblocks constituting the first MB group.
  • the stream data Sb corresponds to the uncompressed image data 31b, and includes a group header 35b and encoded data 32b.
  • the group header 35b includes identification information for the uncompressed image data 31b and information for specifying the macroblocks constituting the second MB group.
  • the multiplexing unit 24 generates stream data Sa and Sb each time the encoded data 32a and 32b are input.
  • the group headers 35a and 35b are created based on the order information 41.
  • the stream data Sa and Sb are sequentially transmitted to the monitoring devices 4a and 4b as multiplexed compressed data 33.
  • the image encoding device 2 can start encoding of the uncompressed image data 31a and 31b if data corresponding to the MB group is input from the uncompressed image data 31a and 31b. Therefore, it is possible to reduce the delay that occurs with the encoding of the uncompressed image data 31a and 31b.
  • the monitoring devices 4a and 4b continuously receive the multiplexed compressed data 33.
  • the monitoring devices 4a and 4b demultiplex the multiplexed compressed data 33 to obtain encoded data 32a and 32b. Which of the cameras 1a and 1b corresponds to the encoded data 32a and 32b can be confirmed based on the group headers 35a and 35b.
  • the monitoring devices 4a and 4b decode the encoded data 32a and 32b in the order of acquisition, and generate decoded data.
  • the monitoring device 4a When the monitoring device 4a is set to display the video of the camera 1a, the monitoring device 4a displays the decoded data corresponding to the camera 1a.
  • the monitoring device 4b When the monitoring device 4b is set to display the video of the camera 1b, the monitoring device 4b displays the decoded data corresponding to the camera 1b.
  • step S3 to S7 see FIG. 6
  • the process of determining the quantization parameter QP (steps S3 to S7, see FIG. 6) will be described in detail for each step.
  • the encoding target MB is the macroblock Ma16.
  • the initial value determination unit 232 calculates the initial value QPi of the quantization parameter QP of the macroblock Ma16 (Step S3).
  • the macroblocks Ma0 to Ma15 are already encoded regardless of the MB group partition unit (see FIGS. 4 and 5).
  • the initial value determination unit 232 identifies a predetermined number (six) of macroblocks Ma10 to Ma15 encoded immediately before the macroblock Ma16 among the encoded macroblocks of the uncompressed image data 31a to which the macroblock Ma16 belongs. To do.
  • the predetermined number (six) is the number of macroblocks of 1 MB line.
  • the initial value determining unit 232 calculates an average value of the quantization parameters QP of the specified macroblocks Ma10 to Ma15, and determines the calculated average value as the initial value QPi.
  • the initial value QPi is a reference value for the quantization parameter QP of the macroblock Ma16.
  • the quantization parameter QP of the macroblock Ma16 is determined.
  • the initial value determination unit 232 is the average value of a predetermined number of macroblocks encoded immediately before the encoding target MB among the encoded macroblocks of the uncompressed image data to which the encoding target MB belongs. Is calculated as the initial value QPi of the encoding target MB.
  • the initial value QPi of the macroblock Ma16 does not change significantly from the quantization parameter QP of the encoded macroblock of the uncompressed image data 31a. Therefore, it is possible to prevent the image quality of the encoded data 32a generated from the uncompressed image data 31a from changing suddenly.
  • step S4 Determination of correction value V1 (step S4) ⁇
  • the correction value determination unit 233 determines the correction value V1 (step S4).
  • the correction value V1 is calculated based on the generated code amount of the encoded macroblock of the uncompressed image data 31a and 31b.
  • the process in step S4 will be described separately when the MB group is configured in units of macroblocks and when configured in units of MB lines.
  • the correction value V1 is an integrated value (line generation code) of the target code amount set per predetermined number (6) of macroblocks and the generated code amount of six macroblocks encoded immediately before the macroblock Ma16. It is determined on the basis of the difference from the amount.
  • the target code amount of macroblocks per predetermined number (six) is referred to as a line target code amount. This is because the predetermined number is set to the number of macro blocks (6) per 1 MB line.
  • the quantization parameter determining unit 23 calculates a target code amount (MB target code amount) per macroblock in advance.
  • the MB target code amount includes the target bit rate TR (36 Mbps, see FIG. 2) of the multiplexed compressed data 33, the frame rate (30 fps) of the uncompressed image data 31a and 31b, and the macroblocks of the uncompressed image data 31a and 31b. Is calculated on the basis of the total number (72).
  • the line target code amount is calculated by multiplying the MB target code amount by the number of macroblocks per MB line (six).
  • the correction value determination unit 233 selects a predetermined number (six) of the macroblocks Ma0 to Ma15 and Mb0 to Mb15 (encoded macroblock group) that have already been encoded, which are encoded immediately before the macroblock Ma16 is encoded. ) Macroblock.
  • FIG. 8 is a diagram illustrating a calculation target of the line generation code amount. As shown in FIG. 8, the six macroblocks encoded immediately before the encoding of the macroblock Ma16 are the macroblocks Ma13, Mb13, Ma14, Mb14, Ma15, and Mb15 in the order of encoding. This is because the macroblock of the uncompressed image data 31a and the macroblock of the uncompressed image data 31b are encoded alternately (see FIG. 4).
  • the calculation target of the line generation code amount changes.
  • the macroblock Mb16 becomes the encoding target MB
  • the macroblocks Ma14 to Ma16 and Mb13 to Mb15 are the targets for calculation of the line generation code amount.
  • the macroblock Ma17 is the encoding target MB
  • the macroblocks Ma14 to Ma16 and Mb14 to Mb16 are targets for calculating the line generation code amount.
  • the ratio between the macroblocks of the uncompressed image data 31a and the macroblocks of the uncompressed image data 31b, which are targets for calculation of the line generation code amount is 1: 1.
  • the generated code amount integrating unit 231 calculates the line generated code amount by integrating the generated code amounts of the macroblocks Ma13 to Ma15 and Mb13 to Mb15.
  • the correction value determination unit 233 calculates a difference value ⁇ B1 obtained by subtracting the line target code amount from the line generation code amount.
  • the correction value determination unit 233 determines the correction value V1 based on the calculated difference value ⁇ B1 and the preset variation value determination table 51.
  • FIG. 9 is a diagram showing the correction value determination table 51.
  • the correction value V1 is set to ⁇ 4. If the difference value ⁇ B1 is equal to or larger than the threshold value Th00 and smaller than the threshold value Th01 ( ⁇ 500 bits), the correction value V1 is set to ⁇ 2. If the difference value ⁇ B1 is equal to or greater than the threshold value Th01 and smaller than the threshold value Th02 (0 bit), the correction value V1 is set to ⁇ 1. If the difference value ⁇ B1 is equal to or greater than the threshold value Th02 and smaller than the threshold value Th03 (500 bits), the correction value V1 is set to +1.
  • the correction value V1 is set to +2. If the difference value ⁇ B1 is equal to or greater than the threshold value Th04, the correction value V1 is set to +4.
  • the correction value determination unit 233 determines the correction value V1 of the macroblock Ma16 using the generated code amount of the encoded macroblock of the uncompressed image data 31b.
  • FIG. 10 is a diagram illustrating a calculation target of the line generation code amount when the MB group is configured in units of MB lines.
  • the correction value determining unit 233 identifies macroblocks Mb10, Mb11, Ma12 to Ma15 as six macroblocks encoded immediately before the macroblock Ma16 becomes the encoding target MB.
  • macroblocks belonging to the same MB line are encoded in order from the smallest number.
  • Ma12 to Ma15 correspond to four of the six macroblocks encoded immediately before the macroblock Ma16 is encoded.
  • the MB line encoded immediately before the MB line La3 is the MB line Lb2.
  • the macroblocks Mb10 and Mb11 of the MB line Lb2 correspond to two of the six macroblocks encoded immediately before the macroblock Ma16.
  • the generated code amount integrating unit 231 calculates the line generated code amount by integrating the generated code amounts of the macroblocks Mb10, Mb11, Ma12 to Ma15 specified by the correction value determining unit 233.
  • the calculation method of the correction value V1 after the line generation code amount is calculated is the same as described above.
  • the correction value V1 of the macroblock Ma16 is determined based on the generated code amount of the encoded macroblock of the uncompressed image data 31a even when the MB group is configured in units of MB lines.
  • the calculation target of the line generation code amount changes.
  • the macroblocks Ma17, Mb12, and Mb13 are specified as encoding target MBs.
  • the calculation target of the line generation code amount is the macro blocks Mb11, Ma12 to Ma16.
  • the calculation target of the line generation code amount is the macroblocks Ma12 to Ma17.
  • the calculation target of the line generation code amount is the macroblocks Ma13 to Ma17, Mb12.
  • the correction value V1 generates the target code amount (line target code amount) per predetermined number of macroblocks and the occurrence of the predetermined number of macroblocks encoded immediately before the encoding target MB is encoded. It is determined based on the integrated value of the code amount (line generation code amount). In the present embodiment, correction is performed based on the amount of generated code generated in units of time shorter than GOP units or frame units. Therefore, since the bit rate of the multiplexed compressed data 33 can be prevented from instantaneously exceeding the target bit rate TR instantaneously, occurrence of transmission delay can be prevented.
  • the correction value V1 of the encoding target MB is determined based on the generated code amount of the encoded macroblock of other uncompressed image data.
  • the bit rate of encoded data generated from one non-compressed image data is low, the bit rate of encoded data generated from the other uncompressed image data can be set high, and the flexible code amount Control becomes possible.
  • correction value V2 is determined based on the activity of the encoding target MB.
  • the correction value determination unit 233 calculates the activity in the upper, lower, left, and right areas of the encoding target MB. Specifically, the activity of an area (upper area) of 4 vertical pixels ⁇ 16 horizontal pixels including the upper side of the encoding target MB is calculated. Similarly, a vertical 4 pixel ⁇ horizontal 16 pixel region including the lower side (lower region), a vertical 16 pixel ⁇ horizontal 4 pixel region including the left side (left region), and a vertical 16 pixel ⁇ horizontal 4 pixel including the right side. Activity in the area (right area) is calculated.
  • the activity is a numerical value indicating the degree of variation in pixel values of pixels existing in each region. For example, the absolute difference value between the average luminance value of all the pixels in a certain region and the luminance value of each pixel can be calculated as an activity.
  • the correction value determination unit 233 selects the minimum activity ACT having the minimum value among the activities in the upper, lower, left, and right areas. Based on the minimum activity ACT and a preset correction value determination table 52, the correction value V2 is determined.
  • FIG. 11 is a diagram showing the correction value determination table 52.
  • the correction value V2 is set to ⁇ 4. If minimum activity ACT is equal to or greater than threshold value Th10 and smaller than threshold value Th11 (5), correction value V2 is set to ⁇ 2. If minimum activity ACT is equal to or greater than threshold value Th11 and is smaller than threshold value Th12 (10), correction value V2 is set to zero. If the minimum activity ACT is equal to or greater than the threshold value Th12 and smaller than the threshold value Th13 (30), the correction value V2 is set to +2. If the minimum activity ACT is equal to or greater than the threshold value Th13, the correction value V2 is set to +4.
  • the correction value determining unit 233 determines the correction value V2 used for correcting the quantization parameter QP based on the minimum activity ACT among the activities in the upper, lower, left, and right regions of the encoding target MB.
  • the activity of the encoding target MB may be used instead of the minimum activity ACT.
  • the correction value determination unit 233 calculates the activity of the entire region of the encoding target MB (vertical 16 pixels ⁇ horizontal 16 pixels) and determines the correction value V2.
  • correction value V3 is determined based on the generated code amount of one macro block encoded immediately before the encoding target MB. The determination of the correction value V3 when the MB group is configured in units of macro blocks will be described.
  • the correction value determination unit 233 uses the generated code amount of the macroblock Ma15 encoded immediately before the macroblock Ma16 among the encoded macroblocks of the uncompressed image data 31a. . That is, the correction value determination unit 233 acquires the generated code amount of the encoded macroblock encoded immediately before among the encoded macroblocks belonging to the same uncompressed image data as the encoding target MB. The correction value determination unit 233 determines the correction value V3 based on the acquired generated code amount (reference generated code amount RA).
  • the correction value determination unit 233 determines the correction value V3 based on the generated code amount (reference generated code amount RA) of the macroblock Ma15 and the preset correction value value determination table 53.
  • FIG. 12 is a diagram showing the variation value determination table 53.
  • the correction value V3 is set to -2.
  • the MB target code amount is the target code amount per macroblock as described above. If reference generated code amount RA is equal to or greater than threshold value Th20 and smaller than threshold value Th21 (MB target code amount), correction value V3 is set to -1. If reference generated code amount RA is equal to or greater than threshold value Th21 and smaller than threshold value Th22 (3/2 of the MB target code amount), correction value V3 is set to +1. If the reference generated code amount RA is equal to or greater than the threshold value Th22, the correction value V3 is set to +2.
  • the correction value determination unit 233 sets the correction value V3 so that the quantization parameter QP increases when the reference generated code amount RA is larger than the MB target code amount. Thereby, the bit rate of the encoded data corresponding to the encoding target MB can be suppressed. If the reference generated code amount RA is smaller than the MB target code amount, the correction value V3 is set so that the quantization parameter QP becomes smaller. Thereby, the image quality of the encoding target MB can be improved.
  • step S7 After determining the correction values V1, V2, and V3 (steps S4 to S6, see FIG. 6), the quantization parameter determination unit 23 adds the correction values V1, V2, and V3 to the initial value QPi calculated by the initial value determination unit 232. Is added as the quantization parameter QP of the encoding target MB (macroblock Ma16) (step S7).
  • the quantization parameter determination unit 23 outputs the quantization parameter QP of the macroblock Ma16 to the encoding unit 22.
  • the encoding unit 22 encodes the macroblock Ma16 using the input quantization parameter QP (step S8).
  • the encoding unit 22 outputs the encoded macroblock Ma16 to the multiplexing unit 24 as encoded data 32a.
  • Step S10 The exception condition determination (step S2) and exception processing (step S10) shown in FIG. 6 will be described in detail below.
  • the exceptional process (step S10) is a process executed when the upper limit comparison code amount may exceed the upper limit set based on the target bit rate.
  • the quantization parameter QP of the encoding target MB is forcibly set without considering the line generation code amount and the minimum activity of the encoding target MB.
  • the upper limit comparison code amount is an integrated value of the generated code amounts of 12 encoded macroblocks encoded immediately before the encoding target MB.
  • the twelve encoded macroblocks correspond to one third of the number of macroblocks (36) of the uncompressed image data 31a and 31b.
  • step S2 will be described by taking as an example a case where the MB group is configured in units of macroblocks. Even when the MB group is configured in units of MB lines, the processes in steps S2 and S10 are similarly executed.
  • the quantization parameter determination unit 23 identifies a macroblock that is a calculation target of the upper limit comparison code amount based on the order information 41 and the position of the encoding target MB.
  • FIG. 13 is a diagram illustrating a calculation target of the upper limit comparison code amount.
  • the calculation targets of the upper limit comparison code amount are the macroblocks Ma15 to Ma20 and the macroblocks Mb14 to Mb19.
  • the calculation targets of the upper limit comparison code amount are the macroblocks Ma27 to Ma32 and Mb27 to Mb32.
  • the ratio between the macroblocks of the uncompressed image data 31a and the macroblocks of the uncompressed image data 31b, which are the targets for calculating the upper limit comparison code amount is 1: 1. It becomes.
  • the ratio of the macro block of the non-compressed image data 31a and the macro block of the non-compressed image data 31b which is the calculation target of the upper limit comparison code amount, similarly to the line generation code amount Changes according to the position of the encoding target MB.
  • the quantization parameter determination unit 23 determines whether or not the encoding process of the uncompressed image data 31a and 31b satisfies the exceptional condition based on the upper limit comparison code amount and the upper limit value (step S2). A method for calculating the upper limit value will be described.
  • the quantization parameter determination unit 23 calculates, as an allowable code amount, a value obtained by multiplying the MB target code amount by the number of macroblocks (12) for which the upper limit comparison code amount is to be calculated.
  • a value obtained by multiplying the allowable code amount by a predetermined coefficient is set in the quantization parameter determination unit 23 as an upper limit value. For example, 0.98 is set as the value of the predetermined coefficient.
  • the quantization parameter determination unit 23 determines that the encoding process does not satisfy the exception condition (No in step S2). In this case, the quantization parameter QP is determined by executing the steps S3 to S7 described above.
  • the quantization parameter determination unit 23 determines that the encoding process satisfies the exception condition (Yes in Step S2), and executes the exception process (Step S10). This is because the bit rate of the multiplexed compressed data 33 may exceed the target bit rate TR.
  • the number of encoded macroblocks encoded immediately before the encoding target MB may be less than twelve.
  • the determination as to whether or not the exception condition is satisfied is performed by comparing the upper limit comparison code amount calculated by the following calculation method with the allowable generated code amount. If the number of encoded macroblocks is four, the upper limit comparison code amount is the sum of the generated code amounts of the four encoded macroblocks.
  • the allowable generated code amount is a value obtained by multiplying the MB target code amount by the number of encoded macroblocks (four). Further, when there is no encoded macroblock (when the macroblock Ma0 is the encoding target MB), the process of step S2 is omitted. This is because the upper limit comparison code amount cannot be calculated.
  • the quantization parameter determination unit 23 obtains the quantization parameter QP of the macroblock Ma7 encoded immediately before the macroblock Ma8 among the encoded macroblocks of the uncompressed image data 31a.
  • the quantization parameter determination unit sets the obtained quantization parameter QP of the macroblock Ma7 to the initial value (forced initial value) of the macroblock Ma8.
  • the quantization parameter determination unit 23 determines a value obtained by adding a preset forced correction value to the forced initial value as the quantization parameter QP of the macroblock Ma8.
  • the quantization parameter determination unit 23 identifies the macroblock encoded immediately before among the macroblocks of the uncompressed image data to which the encoding target MB belongs. To do. A value larger than the quantization parameter QP of the identified macroblock is determined as the quantization parameter QP of the encoding target MB. Thereby, since the amount of codes generated by encoding the encoding target MB can be suppressed, it is possible to prevent the bit rate of the multiplexed compressed data 33 from exceeding the target bit rate.
  • ⁇ Modification 1 ⁇ In the above-described embodiment, an example in which two pieces of image data (uncompressed image data 31a and 31b) are input to the image encoding device 2 has been described. However, the number of uncompressed image data input to the image encoding device 2 may be three or more. In this case, an MB group is generated for each input uncompressed image data. The order determination unit 21 determines the encoding order so that the MB groups of the respective uncompressed image data are encoded in order.
  • the image encoding device 2 inputs the first, second,..., Nth image data.
  • the encoding unit 22 encodes the kth macroblock based on the order information 41 indicating the encoding order of the kth macroblock included in the kth image data.
  • N is a natural number of 1 or more.
  • k is a natural number from 1 to N.
  • the generated code amount accumulating unit 231 calculates the six generated code immediately before the encoding target MB when calculating the line generated code amount used for determining the correction value V1 of the encoding target MB (kth macroblock).
  • the generated code amount of the encoded macroblock is integrated to calculate the line generated code amount.
  • the calculation target of the line generation code amount includes encoded macroblocks of other image data different from the kth image data.
  • the quantization parameter QP of the encoding target MB (kth macroblock) is corrected according to the generated code amount of the six macroblocks encoded immediately before. Therefore, the image encoding device 2 can stably control the bit rate of the multiplexed compressed data 33.
  • the image encoding device 2 may include two encoding units that encode the uncompressed image data 31a and 31b, respectively.
  • FIG. 14 is a block diagram illustrating a functional configuration of the image encoding device 2 according to the second modification of the present embodiment.
  • the image encoding device 2 illustrated in FIG. 14 includes an encoding unit 22a and an encoding unit 22b instead of the encoding unit 22.
  • the encoding units 22a and 22b encode the macroblocks of the uncompressed image data 31a and 31b, respectively, to generate encoded data 32a and 32b.
  • the image encoding device 2 newly includes an output control unit 26 in addition to the encoding units 22a and 22b. Based on the order information 41, the output control unit 26 controls the timing at which the encoding unit 22a outputs the encoded data 32a and the timing at which the encoding unit 22b outputs the encoded data 22b.
  • the multiplexing unit 24 generates the multiplexed compressed data 33 by arranging the encoded data 32a and 32b in the order input from the encoding units 22a and 22b. Since the encoding of the uncompressed image data 31a and 31b is performed in parallel, the delay associated with the encoding of the uncompressed image data 31a and 31b can be shortened.
  • the encoding units 22a and 22b may each encode two macro blocks of uncompressed image data, similarly to the encoding unit 22 (see FIG. 2).
  • the image encoding device 2 shown in FIG. 14 can generate the multiplexed compressed data 33 from the four uncompressed image data.
  • uncompressed image data 31a and 31b with synchronized frames is input from the cameras 1a and 1b to the image encoding device 2 .
  • the image encoding device 2 may generate uncompressed image data 31a and 31b in which frames are synchronized inside the device itself.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

 画像符号化装置(2)は、非圧縮画像データ(31a,31b)を入力する。符号化部(22)は、非圧縮画像データ(31a,31b)のマクロブロックの符号化順序を示す順序情報(41)に基づいて、非圧縮画像データ(31a,31b)のマクロブロックを符号化する。初期値決定部(232)は、符号化対象MBの量子化パラメータ(QP)の初期値を決定する。発生符号量積算部(231)は、符号化対象MBの符号化直前に符号化された所定数のマクロブロックの発生符号量を積算する。補正値決定部(233)は、所定数のマクロブロックあたりの目標符号量と、所定数のマクロブロックの発生符号量の積算値とに基づいて、初期値の補正に用いる補正値(V1)を決定する。初期値と補正値(V1)とが加算されることにより、符号化対象MBの量子化パラメータ(QP)が決定される。

Description

画像符号化装置
 本発明は、複数の画像データを符号化して一つの圧縮画像データを出力する画像符号化装置に関する。
 金融機関の店舗に設けられるATM(Automated Teller Machine)コーナーなどを監視する際に、複数のカメラが設置されることがある。複数のカメラを用いて異なる角度から監視することにより、死角の発生を防ぐことができる。
 各カメラが生成した映像信号は、伝送路の帯域などが制限されているため、符号化された上で伝送される。各カメラの映像を同時に表示させて監視する必要があるため、各カメラに対応する複数の映像信号を多重化して伝送する必要がある。
 下記特許文献1には、各カメラから入力される複数のフレーム映像を1系統の圧縮データに変換する映像信号符号化装置が開示されている。
 特許文献1に係る映像信号符号化装置は、各カメラから入力されるフレーム映像から符号化しないフレーム映像を削除し、符号化対象のフレーム映像を抽出する。抽出されたフレーム映像は、カメラごとに配列される。配列されたフレーム映像は、GOP(Group of Pictures)単位で符号化される。これにより、各カメラから入力される複数のフレーム映像が、1系統の圧縮データに変換される。
特開2005-151485号公報
 上述したように、上記特許文献1に係る映像信号符号化装置は、符号化対象のフレーム映像を抽出する。映像信号符号化装置は、GOPを生成できる数の符号化対象のフレーム映像を抽出するまで、圧縮データを生成することができない。この結果、フレーム映像が映像信号符号化装置に入力されてから1系統の圧縮データとして出力されるまでの時間(遅延)が長くなるため、各カメラの映像をリアルタイムに伝送することが困難である。
 上記特許文献1では、符号量制御をGOP単位で行っている。GOP単位で符号量制御が行われた場合、発生符号量が目標符号量を瞬間的に大きく上回ることがある。目標符号量は、伝送路の帯域などによって決定される。このため、発生符号量が目標符号量を大きく上回ることにより、伝送遅延などが発生するおそれがある。
 本発明の画像符号化装置は、第1~第N(Nは1以上の自然数)画像データを符号化する画像符号化装置である。本発明の画像符号化装置は、kを1からNまでの自然数とした場合において、第k画像データに含まれる第kマクロブロックの符号化順序を示す順序情報に基づいて、第kマクロブロックを符号化する符号化部と、符号化対象マクロブロックの量子化パラメータを決定する量子化パラメータ決定部と、を備える。量子化パラメータ決定部は、符号化部により符号化された符号化済みマクロブロック群の中から、符号化対象マクロブロックの直前に符号化された第1の数のマクロブロックを特定し、第1の数のマクロブロックごとの発生符号量の積算値を算出する符号量積算部と、積算値と、第1の数のマクロブロックあたりの目標符号量とに基づいて、量子化パラメータの補正値を決定し、補正値に基づいて量子化パラメータを補正する補正値決定部と、を備える。
 本発明の画像符号化装置は、第1の数のマクロブロック単位で符号量制御を行う。このため、第kマクロブロックが符号化されて生成される圧縮データのビットレートが、目標ビットレートを瞬間的に大きく超えることを防止することができる。したがって、本発明は、伝送遅延などを抑制することができる。
 符号化対象マクロブロックが第k画像データに含まれる場合、第1の数のマクロブロックは、第k画像データと異なる画像データの符号化済みマクロブロックを含む。このため、他の画像データの符号化済みマクロブロックの発生符号量が大きく変化した場合であっても、符号化対象マクロブロックの量子化パラメータの補正値を、発生符号量の変化に応じて変更することができる。したがって、本発明は、圧縮データのビットレートを柔軟に制御できる。
 それゆえに本発明の目的は、上記問題点に鑑み、映像をリアルタイムに伝送するシステムに対応した符号量制御を行う画像符号化装置を提供することである。
 この発明の目的、特徴、局面、および利点は、以下の詳細な説明と添付図面によって、明白となる。
本発明の実施の形態に係る画像伝送システムの構成を示す図である。 図1に示す画像符号化装置の機能的構成を示すブロック図である。 非圧縮画像データのマクロブロックの構成を示す図である。 マクロブロックグループの符号化順序を示す図である。 マクロブロックグループの符号化順序を示す図である。 マクロブロックの符号化の流れを示すフローチャートである。 多重化圧縮データの構成を示す概略図である。 ライン発生符号量の計算対象を示す図である。 補正値決定テーブルを示す図である。 ライン発生符号量の計算対象を示す図である。 補正値決定テーブルを示す図である。 補正値決定テーブルを示す図である。 上限比較符号量の計算対象を示す図である。 本発明の実施の形態の変形例に係る画像符号化装置の機能的構成を示すブロック図である。
{1.画像伝送システムの全体構成}
 図1は、本発明の実施の形態に係る画像伝送システムの構成を示す図である。図1に示す画像伝送システム100は、カメラ1a,1bと、画像符号化装置2と、監視装置4a,4bとを備える。画像伝送システム100は、金融機関の店舗に設けられたATMコーナーをリアルタイムに監視するシステムである。
 カメラ1a,1bは、ATMコーナーを異なる角度から撮影できるように取り付けられる。カメラ1a,1bは、ATMコーナーの様子を撮影して、非圧縮画像データ31a,31bを生成する。画像符号化装置2は、カメラ1a,1bとともに、ATMコーナーに設置される。画像符号化装置2には、非圧縮画像データ31a,31bのフレームが同期して入力される。画像符号化装置2は、非圧縮画像データ31a,31bの符号化及び多重化を行って、多重化圧縮データ33を生成する。多重化圧縮データ33は、無線通信網などを介して、ATMコーナーを監視するモニタ室へ送信される。
 監視装置4a,4bは、モニタ室に設置され、多重化圧縮データ33を受信する。監視装置4a,4bは、多重化圧縮データ33に対して逆多重化及び復号化処理を行って、カメラ1a,1bに対応する映像を表示する。カメラ1a,1bは、同じ場所(ATMコーナー)を異なる角度から撮影している。このため、カメラ1a,1bの映像を表示するタイミングがずれないように、監視装置4a,4bは、カメラ1a,1bの映像を同期して表示させる。モニタ室に常駐する監視員は、監視装置4a,4bに表示される映像を見ることにより、ATMコーナーを遠隔監視する。
 本実施の形態では、画像符号化装置2が、非圧縮画像データ31a,31bをそれぞれ符号化して、多重化圧縮データ33を生成する点を中心に説明する。
 非圧縮画像データ31a,31bのマクロブロックは、予め設定された区分単位に基づいて、一つ以上のマクロブロックで構成されるマクロブロックグループ(以下、「MBグループ」と呼ぶ。)にそれぞれ区分される。非圧縮画像データ31aのMBグループと、非圧縮画像データ31bのMBグループとが交互に符号化されることにより、多重化圧縮データ33が生成される。
 画像符号化装置2は、符号化対象マクロブロック(以下、符号化対象MBと呼ぶ。)の量子化パラメータを決定する。量子化パラメータは、所定数のマクロブロックあたりの目標符号量と、符号化対象MBの符号化の直前に符号化された所定数のマクロブロックの発生符号量の総和とに基づいて決定される。つまり、画像符号化装置2は、非圧縮画像データ31a,31bを符号化して多重化圧縮データ33を生成するときに、所定数のマクロブロック単位で符号量制御を実行する。GOP単位よりも短い単位時間で符号量制御が行われるため、多重化圧縮データ33のビットレートが、予め設定される目標ビットレートを上回ることを防ぐことができる。
 非圧縮画像データ31aのマクロブロックが符号化対象MBである場合、直前に符号化された所定数のマクロブロックは、非圧縮画像データ31bのマクロブロックを含む。画像符号化装置2は、非圧縮画像データ31aのマクロブロックの量子化パラメータを決定するときに、非圧縮画像データ31bの符号化済みマクロブロックの符号量を利用する。したがって、非圧縮画像データ31bの符号化データの符号量が大きく変化しても、多重化圧縮データ33のビットレートを安定的に制御することができる。
{2.画像符号化装置2の構成}
 図2は、画像符号化装置2の機能的構成を示すブロック図である。図2に示すように、画像符号化装置2は、順序決定部21と、符号化部22と、量子化パラメータ決定部23と、多重化部24と、通信部25とを備える。
 順序決定部21は、非圧縮画像データ31a,31bのマクロブロックを符号化する順序を決定する。順序情報41が、決定された順序に基づいて作成される。順序決定部21は、順序情報41を符号化部22及び多重化部24へ出力する。
 符号化部22は、順序情報41に基づいて、非圧縮画像データ31a,31bのマクロブロックを符号化して符号化データ32a,32bを生成する。非圧縮画像データ31a,31bの符号化には、例えば、H.264あるいはMPEG2などの符号化方式が用いられる。符号化部22は、符号化した符号化対象MBの発生符号量Eaを量子化パメータ決定部23に出力する。発生符号量Eaは、次の符号化対象MBの量子化パラメータQPを決定するときに使用される。
 量子化パラメータ決定部23は、非圧縮画像データ31a,31bの各マクロブロックの量子化に用いられる量子化パラメータQPを決定する。量子化パラメータ決定部23は、発生符号量積算部231と、初期値決定部232と、補正値決定部233とを備える。
 発生符号量積算部231は、符号化対象MBの直前に符号化された所定数のマクロブロックの発生符号量を積算する。初期値決定部232は、符号化対象MBの量子化パラメータQPの初期値を決定する。補正値決定部233は、所定数のマクロブロックあたりの目標符号量と、直前に符号化された所定数のマクロブロックの発生符号量の積算値とに基づいて、初期値の補正に用いる補正値を算出する。量子化パラメータ決定部23は、初期値と補正値との和を、量子化パラメータQPとして符号化部22に出力する。
 多重化部24は、符号化された非圧縮画像データ31a,31bのマクロブロックを符号化された順に配列することにより、多重化圧縮データ33を生成する。
 通信部25は、多重化圧縮データ33に対して誤り訂正信号の付加、及びデジタル変調などを行う。通信部25は、デジタル変調された多重化圧縮データ33を、無線通信を利用して監視装置4a,4bに送信する。
{3.画像符号化装置2の動作}
 以下、画像符号化装置2の動作について詳しく説明する。
{3.1.符号化順序の決定}
 最初に、順序決定部21が、非圧縮画像データ31a,31bの各マクロブロックを符号化する順序(符号化順序)を決定する。符号化順序を決定するにあたり、順序決定部21は、非圧縮画像データ31aのマクロブロックから第1MBグループを、非圧縮画像データ31bのマクロブロックから第2MBグループを生成する。
 図3は、非圧縮画像データ31a,31bのマクロブロックの構成を示す図である。図3に示すように、非圧縮画像データ31a,31bの各フレームは、36個のマクロブロックで構成されている。非圧縮画像データ31a,31bのフレームレートは、同一である。
 非圧縮画像データ31a,31bは、横6個×縦6個のマクロブロックで構成されている。非圧縮画像データ31aのマクロブロックには、左上から右下に向かってMa0~Ma35の番号が付与されている。非圧縮画像データ31bのマクロブロックには、左上から右下に向かってMb0~Mb35の番号が付与されている。
 非圧縮画像データ31a,31bにおいて、横方向に一列に並ぶ6個のマクロブロックの集合を、マクロブロックライン(MBライン)と呼ぶ。非圧縮画像データ31aは、MBラインLa1,La2,La3,La4,La5,La6を有する。非圧縮画像データ31bは、MBラインLb1,Lb2,Lb3,Lb4,Lb5,Lb6を有する。
 順序決定部21は、非圧縮画像データ31a,31bのマクロブロックを予め設定された区分単位に基づいて区分することにより、第1MBグループ及び第2MBグループを生成する。区分単位として、マクロブロック、及びMBラインなどを用いることができる。
 区分単位としてマクロブロックが設定されていた場合、マクロブロックMa0~Ma35のそれぞれが第1MBグループとして区分される。マクロブロックMb0~Mb35のそれぞれが第2MBグループとして区分される。区分単位としてMBラインが設定されていた場合、MBラインLa1~La6が、それぞれ第1MBグループとして区分される。MBラインLb1~Lb6が、それぞれ第2MBグループとして区分される。
 区分単位は、一つ以上のマクロブロックによりMBグループが構成されるように設定されていればよい。たとえば、区分単位として4個のマクロブロックが設定されている場合、非圧縮画像データ31aのマクロブロックMa0~Ma3,Ma4~Ma7などが、第1MBグループとして区分される。
 順序決定部21は、MBグループを生成した後に、第1MBグループと第2MBグループとが交互に符号化されるように、MBグループの符号化順序を決定する。
 図4は、マクロブロック単位でMBグループが生成された場合における符号化順序を示す図である。この場合、順序決定部21は、マクロブロックMa0,Mb0,Ma1,Mb1,Ma2,Mb2,・・・,Mb34,Ma35,Mb35の順に符号化されるように、符号化順序を決定する。つまり、非圧縮画像データ31aのマクロブロックと非圧縮画像データ31bのマクロブロックとが交互に符号化されるように、符号化順序が決定される。
 図5は、MBライン単位でMBグループが生成された場合における符号化順序を示す図である。この場合、順序決定部21は、MBラインLa1,Lb1,La2,Lb2,La3,Lb3,・・・,La6,Lb6の順に符号化されるように、符号化順序を決定する。つまり、非圧縮画像データ31aのMBラインと非圧縮画像データ31bのMBラインとが交互に符号化されるように、符号化順序が決定される。各MBラインのマクロブロックは、左側から順(マクロブロックの番号の小さい順)に符号化される。
{3.2.符号化処理の概略}
 順序決定部21は、MBグループの符号化順序を示す順序情報41を符号化部22へ出力する。符号化部22は、順序情報41に基づいて、マクロブロックMa0~Ma35,Mb0~Mb35をMBグループごとに符号化する。
 図6は、マクロブロックの符号化の流れを示すフローチャートである。図6を参照して、符号化部22は、順序情報41に基づいて、符号化対象MBを特定する(ステップS1)。
 量子化パラメータ決定部23は、符号化対象MBの量子化パラメータQPを決定するにあたり、例外条件に該当するか否かを判定する(ステップS2)。例外条件に該当する場合(ステップS2においてYes)は、量子化パラメータQPは、例外処理(ステップS10)の実行により決定される。例外処理は、所定数のマクロブロックあたりの目標符号量と、符号化対象MBの符号化直前に符号化されたマクロブロックの発生符号量の積算値とを用いることなく、量子化パラメータQPを決定する処理である。
 例外条件に該当しない場合(ステップS2においてNo)、量子化パラメータ決定部23は、ステップS3~S7の処理により量子化パラメータQPを決定する。
 初期値決定部232は、符号化対象MBの量子化パラメータQPの初期値を算出する(ステップS3)。補正値決定部233は、補正値V1を決定する(ステップS4)。補正値V1は、所定数あたりのマクロブロックの目標符号量と、符号化対象MBの直前に符号化された所定数のマクロブロックの発生符号量の積算値とに基づいて算出される。
 補正値決定部233は、符号化対象MBの画像の複雑さを示すアクティビティに基づいて、補正値V2を決定する(ステップS5)。補正値決定部233は、符号化対象MBが属する非圧縮画像データの符号化済みマクロブロックのうち、直前に符号化されたマクロブロックの発生符号量に基づいて、補正値V3を決定する(ステップS6)。量子化パラメータ決定部23は、初期値と、補正値V1,V2,V3とを合計することにより、符号化対象MBの量子化パラメータQPを決定する(ステップS7)。
 符号化部22は、決定された量子化パラメータQPを用いて、符号化対象MBを符号化する(ステップS8)。符号化対象MBがマクロブロックMa0~Ma35のいずれかである場合、符号化されたマクロブロックは、符号化データ32aとして多重化部24に出力される。符号化対象MBがマクロブロックMb0~Mb35のいずれかである場合、符号化されたマクロブロックは、符号化データ32bとして多重化部24に出力される。
 非圧縮画像データ31a,31bの全てのマクロブロックの符号化が終了していなければ(ステップS9においてNo)、画像符号化装置2は、ステップS1の処理に戻る。全てのマクロブロックの符号化が終了したのであれば(ステップS9においてYes)、画像符号化装置2は、図6に示す処理を終了する。
 多重化部24は、符号化データ32a,32bを入力された順に配列することにより、多重化圧縮データ33を生成する。図7は、多重化圧縮データ33の構成を示す模式図である。多重化圧縮データ33は、ストリームヘッダ34と、ストリームデータSa,Sbとを備える。ストリームヘッダ34は、多重化圧縮データ33の再生時に使用する制御情報などを含む。
 ストリームデータSaは、非圧縮画像データ31aに対応し、グループヘッダ35aと符号化データ32aとを含む。グループヘッダ35aは、非圧縮画像データ31aの識別情報と、第1MBグループを構成するマクロブロックを特定する情報とを含む。
 ストリームデータSbは、非圧縮画像データ31bに対応し、グループヘッダ35bと符号化データ32bとを含む。グループヘッダ35bは、非圧縮画像データ31bの識別情報と、第2MBグループを構成するマクロブロックを特定する情報とを含む。
 多重化部24は、符号化データ32a,32bが入力されるたびにストリームデータSa,Sbを生成する。グループヘッダ35a,35bは、順序情報41に基づいて作成される。ストリームデータSa,Sbは、多重化圧縮データ33として監視装置4a,4bへ順次送信される。
 画像符号化装置2は、非圧縮画像データ31a,31bのうちMBグループに対応するデータが入力されていれば、非圧縮画像データ31a,31bの符号化を開始することができる。したがって、非圧縮画像データ31a,31bの符号化に伴って発生する遅延を短縮することができる。
 監視装置4a,4bは、多重化圧縮データ33を継続的に受信する。監視装置4a,4bは、多重化圧縮データ33を逆多重化して、符号化データ32a,32bを取得する。符号化データ32a,32bがカメラ1a,1bのどちらに対応しているかは、グループヘッダ35a,35bに基づいて確認することができる。
 監視装置4a,4bは、符号化データ32a,32bを取得した順に復号化して、復号化したデータを生成する。監視装置4aは、カメラ1aの映像を表示するように設定されている場合、カメラ1aに対応する復号化データを表示する。監視装置4bは、カメラ1bの映像を表示するように設定されている場合、カメラ1bに対応する復号化データを表示する。
 以下、量子化パラメータQPを決定する処理(ステップS3~S7、図6参照)について、ステップごとに詳しく説明する。特に説明のない限り、符号化対象MBは、マクロブロックMa16であると仮定する。
{3.3.初期値QPiの決定(ステップS3)}
 初期値決定部232は、マクロブロックMa16の量子化パラメータQPの初期値QPiを算出する(ステップS3)。マクロブロックMa0~Ma15は、MBグループの区分単位に関係なく、既に符号化されている(図4及び図5参照)。初期値決定部232は、マクロブロックMa16が属する非圧縮画像データ31aの符号化済みマクロブロックのうち、マクロブロックMa16の直前に符号化された所定数(6個)のマクロブロックMa10~Ma15を特定する。所定数(6個)は、1MBラインのマクロブロック数である。初期値決定部232は、特定したマクロブロックMa10~Ma15の量子化パラメータQPの平均値を算出し、算出した平均値を初期値QPiとして決定する。
 初期値QPiは、マクロブロックMa16の量子化パラメータQPの基準となる値である。初期値QPiに補正値V1,V2,V3が加算されることにより、マクロブロックMa16の量子化パラメータQPが決定される。
 このように、初期値決定部232は、符号化対象MBが属する非圧縮画像データの符号化済みのマクロブロックのうち、符号化対象MBの直前に符号化された所定数のマクロブロックの平均値を、符号化対象MBの初期値QPiとして算出する。マクロブロックMa16の初期値QPiが、非圧縮画像データ31aの符号化済みマクロブロックの量子化パラメータQPから大きく変化することがない。したがって、非圧縮画像データ31aから生成される符号化データ32aの画質が急激に変化することを防止することができる。
{3.4.補正値V1の決定(ステップS4)}
 次に、補正値決定部233が、補正値V1を決定する(ステップS4)。補正値V1は、非圧縮画像データ31a,31bの符号化済みマクロブロックの発生符号量に基づいて算出される。ステップS4の処理については、MBグループがマクロブロック単位で構成されているときと、MBライン単位で構成されているときとに分けて説明する。
(MBグループがマクロブロック単位で構成されているとき)
 補正値V1は、所定数(6個)のマクロブロックあたりに設定された目標符号量と、マクロブロックMa16の直前に符号化された6個のマクロブロックの発生符号量の積算値(ライン発生符号量)との差に基づいて決定される。以下、所定数(6個)あたりのマクロブロックの目標符号量を、ライン目標符号量と呼ぶ。所定数が、1MBライン当たりのマクロブロック数(6個)に設定されているためである。
 ライン目標符号量の算出について説明する。量子化パラメータ決定部23は、マクロブロック1個あたりの目標符号量(MB目標符号量)を予め算出しておく。MB目標符号量は、多重化圧縮データ33の目標ビットレートTR(36Mbps、図2参照)と、非圧縮画像データ31a,31bのフレームレート(30fps)と、非圧縮画像データ31a,31bのマクロブロックの総数(72個)に基づいて算出される。MB目標符号量に、1MBラインあたりのマクロブロック数(6個)を乗じることにより、ライン目標符号量が算出される。
 補正値決定部233は、既に符号化されたマクロブロックMa0~Ma15,Mb0~Mb15(符号化済みマクロブロック群)の中から、マクロブロックMa16の符号化直前に符号化された所定数(6個)のマクロブロックを特定する。図8は、ライン発生符号量の計算対象を示す図である。図8に示すように、マクロブロックMa16の符号化直前に符号化された6個のマクロブロックは、符号化された順に、マクロブロックMa13,Mb13,Ma14,Mb14,Ma15,Mb15である。これは、非圧縮画像データ31aのマクロブロックと、非圧縮画像データ31bのマクロブロックとが交互に符号化されるためである(図4参照)。
 符号化対象MBが変化することにより、ライン発生符号量の計算対象が変化する。図8に示すように、マクロブロックMb16が符号化対象MBとなった場合、マクロブロックMa14~Ma16,Mb13~Mb15が、ライン発生符号量の計算対象となる。マクロブロックMa17が符号化対象MBとなった場合、マクロブロックMa14~Ma16,Mb14~Mb16が、ライン発生符号量の計算対象となる。マクロブロック単位でMBグループが構成された場合、ライン発生符号量の計算対象となる非圧縮画像データ31aのマクロブロックと、非圧縮画像データ31bのマクロブロックとの比率は、一対一となる。
 マクロブロックMa16が符号化対象MBであるときの説明に戻る。発生符号量積算部231は、マクロブロックMa13~Ma15,Mb13~Mb15の発生符号量を積算して、ライン発生符号量を算出する。補正値決定部233は、ライン発生符号量からライン目標符号量を差し引いた差分値ΔB1を算出する。
 補正値決定部233は、算出した差分値ΔB1と、予め設定された変動値決定テーブル51とに基づいて、補正値V1を決定する。
 図9は、補正値決定テーブル51を示す図である。図9に示すように、差分値ΔB1がしきい値Th00(-1000ビット)よりも小さければ、補正値V1は、-4に設定される。差分値ΔB1がしきい値Th00以上であり、かつ、しきい値Th01(-500ビット)よりも小さければ、補正値V1は、-2に設定される。差分値ΔB1がしきい値Th01以上であり、かつ、しきい値Th02(0ビット)よりも小さければ、補正値V1は、-1に設定される。差分値ΔB1が、しきい値Th02以上であり、かつ、しきい値Th03(500ビット)よりも小さければ、補正値V1は、+1に設定される。差分値ΔB1が、しきい値Th03以上であり、かつ、しきい値Th04(1000ビット)よりも小さければ、補正値V1は、+2に設定される。差分値ΔB1が、しきい値Th04以上であれば、補正値V1は、+4に設定される。
 このように、補正値決定部233は、非圧縮画像データ31bの符号化済みマクロブロックの発生符号量を用いて、マクロブロックMa16の補正値V1を決定する。
(MBグループがMBライン単位で構成される場合)
 MBグループがMBライン単位で構成されている場合における、補正値V1の決定について説明する。ライン発生符号量の計算対象となるマクロブロックが、MBグループがマクロブロック単位で構成されているときと異なる。図10は、MBグループがMBライン単位で構成されている場合における、ライン発生符号量の計算対象を示す図である。
 図10に示すように、補正値決定部233は、マクロブロックMa16が符号化対象MBとなる直前に符号化された6個のマクロブロックとして、マクロブロックMb10,Mb11,Ma12~Ma15を特定する。MBグループがMBライン単位で構成された場合、同一のMBラインに属するマクロブロックは、番号が小さいものから順に符号化される。MBラインLa3では、Ma12~Ma15が、マクロブロックMa16が符号化される直前に符号化された6個のマクロブロックのうち4個分に該当する。図5に示すように、MBラインLa3の直前に符号化されるMBラインは、MBラインLb2である。このため、MBラインLb2のマクロブロックMb10,Mb11が、マクロブロックMa16の直前に符号化された6個のマクロブロックのうち2個分に該当する。
 発生符号量積算部231は、補正値決定部233が特定したマクロブロックMb10,Mb11,Ma12~Ma15の発生符号量を積算して、ライン発生符号量を算出する。ライン発生符号量が算出された後の、補正値V1の算出方法は、上記と同様である。このように、マクロブロックMa16の補正値V1は、MBグループがMBライン単位で構成されるときも、非圧縮画像データ31aの符号化済みマクロブロックの発生符号量に基づいて決定される。
 符号化対象MBが変化することにより、ライン発生符号量の計算対象が変化する。マクロブロックMa16が符号化された後に、マクロブロックMa17,Mb12,Mb13が、符号化対象MBとして特定される。マクロブロックMa17が符号化対象MBのとき、ライン発生符号量の計算対象は、マクロブロックMb11,Ma12~Ma16である。マクロブロックMb12が符号化対象MBのとき、ライン発生符号量の計算対象は、マクロブロックMa12~Ma17である。マクロブロックMb13が符号化対象MBのとき、ライン発生符号量の計算対象は、マクロブロックMa13~Ma17,Mb12である。MBグループがMBライン単位で構成された場合、ライン発生符号量の計算対象となる非圧縮画像データ31aのマクロブロックと、非圧縮画像データ31bのマクロブロックとの比率が変化する。
 以上のように、補正値V1は、所定数のマクロブロックあたりの目標符号量(ライン目標符号量)と、符号化対象MBが符号化される直前に符号化された所定数のマクロブロックの発生符号量の積算値(ライン発生符号量)とに基づいて決定される。本実施の形態では、GOP単位やフレーム単位より短い時間単位で発生した発生符号量に基づいて補正される。したがって、多重化圧縮データ33のビットレートが、瞬間的に目標ビットレートTRを大きく上回ることを防止できるため、伝送遅延の発生を防ぐことができる。
 符号化対象MBの補正値V1は、他の非圧縮画像データの符号化済みマクロブロックの発生符号量に基づいて決定される。一方の非圧縮画像データから生成された符号化データのビットレートが小さい場合に、他方の非圧縮画像データから生成された符号化データのビットレートを高く設定することが可能となり、柔軟な符号量制御が可能となる。
{3.5.補正値V2の決定(ステップS5)}
 次に、補正値V2の決定処理(ステップS5)について説明する。補正値V2は、符号化対象MBのアクティビティに基づいて決定される。
 補正値決定部233は、符号化対象MBの上下左右の領域のアクティビティを算出する。具体的には、符号化対象MBの上辺を含む縦4画素×横16画素の領域(上側領域)のアクティビティを算出する。同様に、下辺を含む縦4画素×横16画素の領域(下側領域)と、左辺を含む縦16画素×横4画素の領域(左側領域)と、右辺を含む縦16画素×横4画素の領域(右側領域)とにおけるアクティビティがそれぞれ算出される。アクティビティは、各領域に存在する画素の画素値のばらつき度合いを示す数値である。たとえば、ある領域における全画素の画素値の輝度平均値と、各画素の輝度値との差分絶対値を、アクティビティとして算出することができる。
 補正値決定部233は、上下左右の各領域のアクティビティの中で、最小値を有する最小アクティビティACTを選択する。最小アクティビティACTと、予め設定された補正値決定テーブル52とに基づいて、補正値V2が決定される。図11は、補正値決定テーブル52を示す図である。
 図11に示すように、最小アクティビティACTが、しきい値Th10(2)よりも小さければ、補正値V2は、-4に設定される。最小アクティビティACTが、しきい値Th10以上であり、かつ、しきい値Th11(5)よりも小さければ、補正値V2は、-2に設定される。最小アクティビティACTが、しきい値Th11以上であり、かつ、しきい値Th12(10)よりも小さければ、補正値V2は、0に設定される。最小アクティビティACTが、しきい値Th12以上であり、かつ、しきい値Th13(30)よりも小さければ、補正値V2は、+2に設定される。最小アクティビティACTが、しきい値Th13以上であれば、補正値V2は、+4に設定される。
 このように、補正値決定部233は、符号化対象MBの上下左右の領域のアクティビティのうち最小アクティビティACTに基づいて、量子化パラメータQPの補正に用いられる補正値V2を決定する。符号化対象MBの画像の複雑さに応じて量子化パラメータQPを補正することにより、画質を極端に劣化させることなく符号量制御を実行することが可能となる。
 補正値V2の決定において、最小アクティビティACTに代えて、符号化対象MBのアクティビティを用いてもよい。この場合、補正値決定部233は、符号化対象MBの全領域(縦16画素×横16画素)のアクティビティを算出して、補正値V2を決定する。
{3.6.補正値V3の決定(ステップS6)}
 次に、補正値V3の決定処理(ステップS6)について説明する。補正値V3は、符号化対象MBの直前に符号化された一つのマクロブロックの発生符号量に基づいて決定される。マクロブロック単位でMBグループが構成された場合における、補正値V3の決定について説明する。
 図8を参照する。符号化対象MBがマクロブロックMa16であるとする。補正値決定部233は、補正値V3を決定するときに、非圧縮画像データ31aの符号化済みマクロブロックの中で、マクロブロックMa16の直前に符号化されたマクロブロックMa15の発生符号量を用いる。つまり、補正値決定部233は、符号化対象MBと同じ非圧縮画像データに属する符号化済みマクロブロック中で、直前に符号化された符号化済みマクロブロックの発生符号量を取得する。補正値決定部233は、取得した発生符号量(参照発生符号量RA)に基づいて、補正値V3を決定する。
 補正値決定部233は、マクロブロックMa15の発生符号量(参照発生符号量RA)と、予め設定された補正値値決定テーブル53とに基づいて、補正値V3を決定する。図12は、変動値決定テーブル53を示す図である。
 参照発生符号量RAが、しきい値Th20(MB目標符号量の1/2)よりも小さければ、補正値V3は、-2に設定される。MB目標符号量とは、上述したように、マクロブロック1個あたりの目標符号量である。参照発生符号量RAが、しきい値Th20以上であり、かつ、しきい値Th21(MB目標符号量)よりも小さければ、補正値V3は、-1に設定される。参照発生符号量RAが、しきい値Th21以上であり、かつ、しきい値Th22(MB目標符号量の3/2)よりも小さければ、補正値V3は、+1に設定される。参照発生符号量RAが、しきい値Th22以上であれば、補正値V3は、+2に設定される。
 このように、補正値決定部233は、参照発生符号量RAがMB目標符号量よりも大きければ、量子化パラメータQPが大きくなるように、補正値V3を設定する。これにより、符号化対象MBに対応する符号化データのビットレートを抑制することができる。参照発生符号量RAがMB目標符号量よりも小さければ、量子化パラメータQPが小さくなるように、補正値V3を設定する。これにより、符号化対象MBの画質を向上させることができる。
{3.7.量子化パラメータQPの算出(ステップS7)}
 補正値V1,V2,V3を決定した(ステップS4~S6、図6参照)後に、量子化パラメータ決定部23は、初期値決定部232が算出した初期値QPiに、補正値V1,V2,V3を加算した値を、符号化対象MB(マクロブロックMa16)の量子化パラメータQPとして決定する(ステップS7)。
 量子化パラメータ決定部23は、マクロブロックMa16の量子化パラメータQPを符号化部22に出力する。符号化部22は、入力された量子化パラメータQPを用いてマクロブロックMa16を符号化する(ステップS8)。符号化部22は、符号化されたマクロブロックMa16を、符号化データ32aとして多重化部24に出力する。
{3.8.例外処理(ステップS10)}
 以下、図6に示す例外条件の判定(ステップS2)と、例外処理(ステップS10)とについて詳しく説明する。例外処理(ステップS10)は、上限比較符号量が、目標ビットレートに基づいて設定された上限値を超えるおそれがあるときに実行される処理である。例外処理では、符号化対象MBの量子化パラメータQPが、ライン発生符号量や符号化対象MBの最小アクティビティなどを考慮することなく、強制的に設定される。
 上限比較符号量は、符号化対象MBの直前に符号化された12個の符号化済みマクロブロックの発生符号量の積算値である。12個の符号化済みマクロブロックは、非圧縮画像データ31a,31bのそれぞれのマクロブロック数(36個)の1/3に相当する。
 ステップS2の処理について、MBグループがマクロブロック単位で構成されているケースを例に説明する。MBグループがMBライン単位で構成されている場合も、ステップS2,S10の処理は、同様に実行される。
 量子化パラメータ決定部23は、順序情報41と、符号化対象MBの位置とに基づいて、上限比較符号量の計算対象となるマクロブロックを特定する。図13は、上限比較符号量の計算対象を示す図である。MBグループがマクロブロック単位で構成されている場合、非圧縮画像データ31a,31bのマクロブロックは、交互に符号化される(図4参照)。このため、符号化対象MBがマクロブロックMa8である場合、マクロブロックMa2~Ma7,Mb2~Mb7が計算対象となる。発生符号量積算部231は、特定された符号化済みのマクロブロックMa2~Ma7,Mb2~Mb7の発生符号量を積算する。これにより、上限比較符号量が算出される。
 マクロブロックMb20が符号化対象MBである場合、上限比較符号量の計算対象は、マクロブロックMa15~Ma20,マクロブロックMb14~Mb19となる。マクロブロックMa33が符号化対象MBである場合、上限比較符号量の計算対象は、マクロブロックMa27~Ma32,Mb27~Mb32となる。このように、マクロブロック単位でMBグループが構成された場合、上限比較符号量の計算対象となる非圧縮画像データ31aのマクロブロックと、非圧縮画像データ31bのマクロブロックとの比率は、一対一となる。MBグループがMBライン単位で構成された場合、ライン発生符号量と同様に、上限比較符号量の計算対象となる非圧縮画像データ31aのマクロブロックと、非圧縮画像データ31bのマクロブロックとの比率は、符号化対象MBの位置に応じて変化する。
 量子化パラメータ決定部23は、非圧縮画像データ31a,31bの符号化処理が例外条件に該当するか否かを、上限比較符号量と上限値とに基づいて判定する(ステップS2)。上限値の算出方法を説明する。量子化パラメータ決定部23は、上限比較符号量の計算対象となるマクロブロックの数(12個)をMB目標符号量に乗じた値を、許容符号量として算出する。許容符号量に所定の係数を乗じた値が、上限値として量子化パラメータ決定部23に設定される。所定の係数の値は、たとえば、0.98が設定される。
 上限比較符号量が上限値以下である場合、量子化パラメータ決定部23は、符号化処理が例外条件を満たしていないと判定する(ステップS2においてNo)。この場合、上述したステップS3~S7が実行されることにより、量子化パラメータQPが決定される。
 上限比較符号量が上限値よりも大きい場合、量子化パラメータ決定部23は、符号化処理が例外条件を満たしていると判定し(ステップS2においてYes)、例外処理(ステップS10)を実行する。これは、多重化圧縮データ33のビットレートが、目標ビットレートTRを上回る可能性があるためである。
 ステップS2の処理において、符号化対象MBの直前に符号化された符号化済みマクロブロックの数が12個に満たないことがある。この場合、例外条件に該当するか否かの判定(ステップS2)は、下記の計算方法で算出された上限比較符号量と、許容発生符号量とを比較することにより実行される。符号化済みマクロブロックの数が4個であれば、上限比較符号量は、4個の符号化済みマクロブロックの発生符号量の総和となる。許容発生符号量は、MB目標符号量に符号化済みマクロブロックの数(4個)を乗じた値である。また、符号化済みマクロブロックが存在しない場合(マクロブロックMa0が符号化対象MBである場合)、ステップS2の処理は省略される。これは、上限比較符号量を算出することができないためである。
 例外処理(ステップS10)について詳しく説明する。上述のように、符号化対象MBがマクロブロックMa8である。このため、量子化パラメータ決定部23は、非圧縮画像データ31aの符号化済みマクロブロックの中で、マクロブロックMa8の直前に符号化されたマクロブロックMa7の量子化パラメータQPを取得する。量子化パラメータ決定部は、取得したマクロブロックMa7の量子化パラメータQPを、マクロブロックMa8の初期値(強制初期値)に設定する。量子化パラメータ決定部23は、強制初期値に予め設定されている強制補正値を加算した値を、マクロブロックMa8の量子化パラメータQPとして決定する。
 このように、符号化処理が例外条件に該当する場合、量子化パラメータ決定部23は、符号化対象MBが属する非圧縮画像データのマクロブロックの中で、直前に符号化されたマクロブロックを特定する。特定されたマクロブロックの量子化パラメータQPより大きい値が、符号化対象MBの量子化パラメータQPとして決定される。これにより、符号化対象MBの符号化によって発生する符号量を抑制することができるため、多重化圧縮データ33のビットレートが目標ビットレートを超えることを防止することができる。
{変形例1}
 上記実施の形態では、二つの画像データ(非圧縮画像データ31a,31b)が画像符号化装置2に入力される例を説明した。しかし、画像符号化装置2に入力される非圧縮画像データの数は、三つ以上でもよい。この場合、入力された非圧縮画像データごとにMBグループが生成される。順序決定部21は、各非圧縮画像データのMBグループが順番に符号化されるように符号化順序を決定する。
 具体的には、画像符号化装置2は、第1、第2、・・・、第Nの画像データを入力する。符号化部22は、第k画像データに含まれる第kマクロブロックの符号化順序を示す順序情報41に基づいて、第kマクロブロックを符号化する。Nは、1以上の自然数である。kは、1からNまでの自然数である。発生符号量積算部231は、符号化対象MB(第kマクロブロック)の補正値V1の決定に用いるライン発生符号量を計算するときに、符号化対象MBの直前に符号化された6個の符号化済みマクロブロックの発生符号量を積算して、ライン発生符号量を算出する。ライン発生符号量の計算対象には、第k画像データと異なる他の画像データの符号化済みマクロブロックが含まれる。符号化対象MB(第kマクロブロック)の量子化パラメータQPは、直前に符号化された6個のマクロブロックの発生符号量に応じて補正される。したがって、画像符号化装置2は、多重化圧縮データ33のビットレートを安定的に制御できる。
{変形例2}
 上記実施の形態では、一つの符号化部22が、非圧縮画像データ31a,31bのマクロブロックを符号化する例を説明した。しかし、画像符号化装置2は、非圧縮画像データ31a,31bをそれぞれ符号化する二つの符号化部を備えてもよい。
 図14は、本実施の形態の変形例2に係る画像符号化装置2の機能的構成を示すブロック図である。図14に示す画像符号化装置2は、符号化部22に代えて、符号化部22aと、符号化部22bとを備える。符号化部22a,22bは、非圧縮画像データ31a,31bのマクロブロックをそれぞれ符号化して、符号化データ32a,32bを生成する。
 画像符号化装置2は、符号化部22a,22bの他に、出力制御部26を新たに備える。出力制御部26は、順序情報41に基づいて、符号化部22aが符号化データ32aを出力するタイミングと、符号化部22bが符号化データ22bを出力するタイミングとを制御する。多重化部24は、符号化部22a,22bから入力された順に、符号化データ32a,32bを配列して、多重化圧縮データ33を生成する。非圧縮画像データ31a,31bの符号化が並列的に実行されるため、非圧縮画像データ31a,31bの符号化に伴う遅延を短縮することができる。
 符号化部22a,22bは、符号化部22(図2参照)と同様に、二つの非圧縮画像データのマクロブロックをそれぞれ符号化してもよい。この場合、図14に示す画像符号化装置2は、四つの非圧縮画像データから多重化圧縮データ33を生成することができる。
 上記実施の形態では、フレームが同期した非圧縮画像データ31a,31bがカメラ1a,1bから画像符号化装置2に入力される例を説明した。しかし、画像符号化装置2が、自装置の内部で、フレームが同期した非圧縮画像データ31a,31bを生成してもよい。
 この発明を添付図面に示す実施態様について説明したが、この発明は、特に明記した部分を除いては、その詳細な説明の記載をもって制約しようとするものではなく、特許請求の範囲に記載する範囲において広く構成しようとするものである。

Claims (8)

  1.  第1~第N(Nは1以上の自然数)画像データを符号化する画像符号化装置(2)であって、
     kを1からNまでの自然数とした場合において、前記第k画像データに含まれる第kマクロブロックの符号化順序を示す順序情報に基づいて、前記第kマクロブロックを符号化する符号化部(22)と、
     符号化対象マクロブロックの量子化パラメータを決定する量子化パラメータ決定部(23)と、
    を備え、
     前記量子化パラメータ決定部(23)は、
     前記符号化部により符号化された符号化済みマクロブロック群の中から、前記符号化対象マクロブロックの直前に符号化された第1の数のマクロブロックを特定し、前記第1の数のマクロブロックごとの発生符号量の積算値を算出する符号量積算部(231)と、
     前記積算値と、前記第1の数のマクロブロックあたりの目標符号量とに基づいて、前記量子化パラメータの補正値を決定し、前記補正値に基づいて前記量子化パラメータを補正する補正値決定部(233)と、
    を備える。
  2.  請求項1に記載の画像符号化装置(2)において、
     前記量子化パラメータ決定部(23)は、
     前記符号化対象マクロブロックが前記第k画像データに含まれる場合、前記符号化対象マクロブロックの直前に符号化された第2の数の第kマクロブロックを特定し、前記第2の数の第kマクロブロックごとの量子化パラメータの平均値を、初期値として算出する初期値決定部(232)、
    を含み、
     前記量子化パラメータ決定部(23)は、前記初期値と前記補正値とに基づいて前記量子化パラメータを決定する。
  3.  請求項1に記載の画像符号化装置(2)において、
     前記補正値決定部(233)は、前記符号化対象マクロブロックが前記第k画像データに含まれる場合、前記符号化対象マクロブロックの直前に符号化された一つの第kマクロブロックの発生符号量に基づいて、前記補正値を決定する。
  4.  請求項1に記載の画像符号化装置(2)において、
     前記補正値決定部(233)は、前記符号化対象マクロブロックの複雑さを示すアクティビティに基づいて、前記補正値を決定する。
  5.  請求項4に記載の画像符号化装置(2)において、
     前記補正値決定部(233)は、前記符号化対象マクロブロックの上辺、下辺、左辺、及び右辺をそれぞれ含む4つの領域におけるアクティビティを算出し、各領域のアクティビティのうち最小のアクティビティに基づいて、前記補正値を決定する。
  6.  請求項1に記載の画像符号化装置(2)において、
     前記第1の数は、横方向に一列に並ぶマクロブロックのラインを構成するマクロブロックの数である。
  7.  請求項1に記載の画像符号化装置(2)において、
     前記符号量積算部(231)は、前記符号化済みマクロブロック群の中から、前記符号化対象マクロブロックの直前に符号化された第3の数のマクロブロックを特定し、前記第3の数のマクロブロックごとの発生符号量を積算して、上限比較符号量を算出し、
     前記量子化パラメータ決定部(23)は、前記符号化対象マクロブロックが第k画像データに含まれ、かつ前記上限比較符号量が予め設定された上限値よりも大きい場合、前記符号化対象マクロブロックの直前に符号化された一つの第kマクロブロックの量子化パラメータを強制初期値として決定し、
     前記補正値決定部(233)は、予め設定された強制補正値を用いて前記強制初期値を補正する。
  8.  請求項1に記載の画像符号化装置(2)において、
     前記符号化部(22)は、
     前記第1~第N画像データをそれぞれ符号化する第1~第Nの個別符号化部(22a,22b)と、
     前記順序情報に基づいて、第kの符号化部が生成した第kの符号化データの出力タイミングを制御する出力制御部(26)と、
    を含む。
PCT/JP2011/055614 2010-03-31 2011-03-10 画像符号化装置 WO2011122285A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2010-082711 2010-03-31
JP2010082711A JP5451487B2 (ja) 2010-03-31 2010-03-31 画像符号化装置

Publications (1)

Publication Number Publication Date
WO2011122285A1 true WO2011122285A1 (ja) 2011-10-06

Family

ID=44712009

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/055614 WO2011122285A1 (ja) 2010-03-31 2011-03-10 画像符号化装置

Country Status (2)

Country Link
JP (1) JP5451487B2 (ja)
WO (1) WO2011122285A1 (ja)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9350989B2 (en) 2012-12-11 2016-05-24 Megachips Corporation Moving image coding apparatus, code amount control method, and storage medium
CN107547903A (zh) * 2016-06-29 2018-01-05 晨星半导体股份有限公司 压缩影像数据的方法及影像数据压缩系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0316491A (ja) * 1989-06-14 1991-01-24 Matsushita Electric Ind Co Ltd 動画像符号化装置
JPH0418857A (ja) * 1990-04-23 1992-01-23 Ricoh Co Ltd 画像データ圧縮方式
JPH06292180A (ja) * 1993-04-01 1994-10-18 Matsushita Electric Ind Co Ltd 画像圧縮符号化装置
JPH07212755A (ja) * 1994-01-18 1995-08-11 Nippon Telegr & Teleph Corp <Ntt> 画像符号化制御方法
JP2004023606A (ja) * 2002-06-19 2004-01-22 Mitsubishi Electric Corp 画像符号化装置および画像符号化方法
JP2011071778A (ja) * 2009-09-25 2011-04-07 Mega Chips Corp 画像処理装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07284096A (ja) * 1994-04-06 1995-10-27 Nec Corp 多チャンネル画像伝送装置
FR2721787B1 (fr) * 1994-06-22 1996-07-26 Thomson Consumer Electronics Procédé de quantification des coefficients.
JP2907063B2 (ja) * 1995-05-24 1999-06-21 日本ビクター株式会社 総符号量制御を行なう動画像符号化装置
JP3812269B2 (ja) * 2000-02-24 2006-08-23 日本ビクター株式会社 動画像符号化装置及びその方法
JP2004297696A (ja) * 2003-03-28 2004-10-21 Matsushita Electric Ind Co Ltd 映像信号符号化装置
JP3889013B2 (ja) * 2004-05-24 2007-03-07 三菱電機株式会社 動画像符号化装置及び動画像符号化方法
JP2006222626A (ja) * 2005-02-09 2006-08-24 Olympus Corp 動画像伝送装置および動画像伝送システム

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0316491A (ja) * 1989-06-14 1991-01-24 Matsushita Electric Ind Co Ltd 動画像符号化装置
JPH0418857A (ja) * 1990-04-23 1992-01-23 Ricoh Co Ltd 画像データ圧縮方式
JPH06292180A (ja) * 1993-04-01 1994-10-18 Matsushita Electric Ind Co Ltd 画像圧縮符号化装置
JPH07212755A (ja) * 1994-01-18 1995-08-11 Nippon Telegr & Teleph Corp <Ntt> 画像符号化制御方法
JP2004023606A (ja) * 2002-06-19 2004-01-22 Mitsubishi Electric Corp 画像符号化装置および画像符号化方法
JP2011071778A (ja) * 2009-09-25 2011-04-07 Mega Chips Corp 画像処理装置

Also Published As

Publication number Publication date
JP5451487B2 (ja) 2014-03-26
JP2011217085A (ja) 2011-10-27

Similar Documents

Publication Publication Date Title
EP1261208B1 (en) Encoding continuous image data
CN101690190B (zh) 成像设备和成像方法
US6819714B2 (en) Video encoding apparatus that adjusts code amount by skipping encoding of image data
JP6479621B2 (ja) ビデオ符号化方法及びビデオエンコーダシステム
US9854167B2 (en) Signal processing device and moving image capturing device
EP0562787A2 (en) Image coding method and apparatus
US11044437B2 (en) Method and system for combining multiple area-of-interest video codestreams into a combined video codestream
US10475313B2 (en) Image processing system and image decoding apparatus
US20010026587A1 (en) Image encoding apparatus and method of same, video camera, image recording apparatus, and image transmission apparatus
US20100008415A1 (en) Moving picture coding apparatus, method, program, and integrated circuit thereof
US20020057348A1 (en) Video display control method, video display control system, and apparatus employed in such system
US20180077434A1 (en) Video transmission apparatus, video reception apparatus, video transmission method, and video transmission system
JP2008034892A (ja) 多視点画像符号化装置
GB2316568A (en) Coded image bit stream format converter
JP2019140575A (ja) 画像符号化装置及びその制御方法及びプログラム
JP6707334B2 (ja) リアルタイム符号化のための方法及び装置
JP2933132B2 (ja) 多地点テレビ会議制御装置及び画面合成符号化方法
JP2005073218A (ja) 画像処理装置
JP5451487B2 (ja) 画像符号化装置
JP2006222626A (ja) 動画像伝送装置および動画像伝送システム
JP5635673B2 (ja) 画像符号化装置
US8937999B2 (en) Moving image compression encoding apparatus, method, and control program
US9001892B2 (en) Moving image encoder and moving image decoder
JP2006319776A (ja) 画像伝送装置
JP4795141B2 (ja) 映像符号化合成装置、映像符号化合成方法及び映像伝送システム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11762525

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11762525

Country of ref document: EP

Kind code of ref document: A1