Other features and advantages of the present invention will become apparent in the following detailed description of the preferred embodiment with reference to the accompanying drawings, of which:
Referring to
The computation control unit 10 is connected electrically to the first, second, third, fourth, fifth, and sixth processing units 11˜16, receives the pixels of the reference block and the data outputted by the entropy decoder 91, suitably arranges the pixels of the reference block in sequence according to the data outputted by the entropy decoder 91 into a first pixel signal in1 and a second pixel signal in2, outputs the same to the first, second, third, fourth, fifth, and sixth processing units 11˜16 sequentially in units of cycles, receives the first pixel signal in1, and first, second and fourth output signals out1, out2, out4 respectively outputted from the first, second and fourth processing units 11, 12, 14, and adds an integer value to the first, second and fourth output signals out1, out2, out4 and makes a right shift operation thereafter.
The sixth processing unit 16 receives the first pixel signal in1 and the second pixel signal in2, and is controlled by the computation control unit 10 to use one of the first pixel signal in1 and the second pixel signal in2 as the value of a sixth output signal out6 to be outputted thereby during a next cycle.
The fifth processing unit 15 receives the first pixel signal in, the second pixel signal in2, and the sixth output signal out6, and is controlled by the computation control unit 10 to execute one of the two operations set forth below and to use the operation result as the value of a fifth output signal out5 to be outputted thereby during a next cycle.
The first operation is to multiply the first pixel value in1 or the second pixel value in2 by an integer value.
The second operation is to multiply the first pixel signal in1 or the second pixel signal in2 by an integer value, and then add the sixth output signal out6.
The fourth processing unit 14 receives the first pixel signal in, the second pixel signal in2, and the fifth output signal out5, and is controlled by the computation control unit 10 to calculate a computation result of multiplying the first pixel signal in1 or the second pixel value in2 by an integer value and then adding the fifth output signal out5, and to use the computation result as the value of the fourth output signal out4 during a next cycle.
The third processing unit 13 receives the first pixel signal in, the second pixel signal in2, and the fourth output signal out4, and is controlled by the computation control unit 10 to execute one of the two operations set forth below and to use the operation result as the value of a third output signal out3 to be outputted thereby during a next cycle.
The first operation is to multiply the first pixel signal in1 or the second pixel signal in2 by an integer value.
The second operation is to multiply the first pixel signal in1 or the second pixel signal in2 by an integer value, and then add the fourth output signal out4.
The second processing unit 12 receives the second output signal out2, the first pixel signal in, the second pixel signal in2, and the third output signal out3, and is controlled by the computation control unit 10 to execute one of the three operations set forth below, and to use the operation result as the value of the second output signal out2 during a next cycle.
The first operation is to multiply the first pixel signal in1 or the second pixel signal in2 by an integer value and then add the third output signal out3.
The second operation is to multiply the first pixel signal in1 or the second pixel signal in2 by an integer value and then add the second output signal out2.
The third operation is to output the first pixel signal in1.
The first processing unit 11 receives the value of the first output signal out1 outputted thereby in a previous cycle, the first pixel signal in, the second pixel signal in2, and the second output signal out2, and is controlled by the computation control unit 10 to execute one of the two operations set forth below and to use the operation result as the value of the first output signal out1.
The first operation is to multiply the first pixel signal in1 or the second pixel signal in2 by an integer value and then add the value of the first output signal out1 in the previous cycle.
The second operation is to multiply the first pixel signal in1 or the second pixel signal in2 by an integer value and then add the second output signal out2.
The first processing unit 11 includes a register 111, a multiplier 112, an adder 113, and a multiplexer 114. The second processing unit 12 includes a register 121, a multiplier 122, an adder 123, a first multiplexer 124, and a second multiplexer 125.
The third processing unit 13 includes a register 131, a multiplier 132, an adder 133, and a multiplexer 134. The fourth processing unit 14 includes a register 141, a multiplier 142, and an adder 143.
The fifth processing unit 15 includes a register 151, a multiplier 152, an adder 153, and a multiplexer 154.
The sixth processing unit 16 includes a register 161 and a multiplexer 162.
The register 111, 121, 131, 141, 151, 161 of each of the first to sixth processing units 11≠16 has an output end and an input end, and the data at the output end is equivalent to the data at the input end during the previous cycle. Besides, the signals at the output ends of the respective registers 121, 131, 141, 151, 161 of the second to sixth processing units 12˜16 are the second to sixth output signals out2, out3, out4, out5, out6, respectively.
The multiplier 112, 122, 132, 142, 152 of each of the first to fifth processing units 11˜15 has a first input end, a second input end, and an output end. The first input end and the second input end respectively receive the values of the first pixel signal in1 and the second pixel signal in2 outputted by the computation control unit 10, and the multiplier 112, 122, 132, 142, 152 is controlled by the computation control unit 10 to complete the computation result of multiplying the value at the first input end or the second input end by an integer value within a cycle and to provide the computation result at the output end.
The adder 113, 123, 133, 143, 153 of each of the first to fifth processing units 11˜15 has a first input end, a second input end, and an output end, completes the computation result of adding up the values at the first input end and the second input end within a cycle, and provides the sum at the output end.
The multiplexer 114, 124, 125, 134, 154, 162 of each of the processing units 11, 12, 13, 15, 16 has a first input end, a second input end, and an output end, and is controlled by the computation control unit 10 to send the value at one of the input ends thereof to the output end.
The first input end and the second input end of the multiplexer 162 of the sixth processing unit 16 respectively receive the values of the first pixel signal in1 and the second pixel signal in2 outputted by the computation control unit 10, and the output end of the multiplexer 162 is connected electrically to the input end of the register 161.
The output end of the multiplier 152 of the fifth processing unit 15 is connected electrically to the first input end of the adder 153 and the first input end of the multiplexer 154. The second input end of the adder 153 is connected electrically to the output end of the register 161 of the sixth processing unit 16. The output end of the adder 153 is connected electrically to the second input end of the multiplexer 154. The output end of the multiplexer 154 is connected electrically to the input end of the register 151.
The output end of the multiplier 142 of the fourth processing unit 14 is connected electrically to the first input end of the adder 143. The second input end of the adder 143 is connected electrically to the output end of the register 151 of the fifth processing unit 15. The output end of the adder 143 is connected electrically to the input end of the register 141.
The output end of the multiplier 132 of the third processing unit 13 is connected electrically to the first input end of the adder 133 and the first input end of the multiplexer 134. The second input end of the adder 133 is connected electrically to the output end of the register 141 of the fourth processing unit 14. The output end of the adder 133 is connected electrically to the second input end of the multiplexer 134. The output end of the multiplexer 134 is connected electrically to the input end of the register 131.
The output end of the multiplier 122 of the second processing unit 12 is connected electrically to the first input end of the adder 123. The second input end of the adder 123 is connected electrically to the output end of the second multiplexer 125. The output end of the adder 123 is connected electrically to the second input end of the first multiplexer 124. The first input end of the first multiplexer 124 receives the first pixel signal in1 outputted from the computation control unit 10, and the output end of the first multiplexer 124 is connected electrically to the input end of the register 121. The second input end and the first input end of the second multiplexer 125 are connected electrically to the output end of the register 121 and the output end of the register 131 of the third processing unit 13, respectively.
The output end of the multiplier 112 of the first processing unit 11 is connected electrically to the first input end of the adder 113. The second input end of the adder 113 is connected electrically to the output end of the multiplexer 114. The second input end and the first input end of the multiplexer 114 are connected electrically to the output end of the register 111 and the output end of the register 121 of the second processing unit 12, respectively. The output end of the adder 113 is connected electrically to the input end of the register 111 and the computation control unit 10. The signal from the output end of the adder 113 is the first output signal out1.
The data outputted by the entropy decoder 91 include the type and size of the macroblock to be predicted, the static image in which the reference block is located, and motion vectors. When the reference block and the macroblock to be predicted are in the same static image, the computation control unit 10 and the first to sixth processing units 11˜16 as a whole use intra prediction to calculate the pixel values to be predicted. On the other hand, when the reference block and the macroblock to be predicted do not belong to the same static image, the computation control unit 10 and the first to sixth processing units 11˜16 as a whole use inter prediction to calculate the pixel values to be predicted.
Intra Prediction of 4×4 Luminance Macroblock
Referring to
Intra Prediction of 4×4 Luminance Macroblock (Mode 0)
Referring to
Therefore, for mode 0 of intra prediction, the computation control unit 10 directly receives data of the first pixel signal in1, and directly uses the received value of the first pixel signal in1 as the value of the pixel to be predicted. In addition, the value of the first pixel signal in1 is set to be equal to the value of the pixel h0 so as to obtain the values of the pixels pred[0,0]˜pred[0,3] to be predicted. The value of the first pixel signal in1 is set to be equal to the value of the pixel h1 so as to obtain the values of the pixels pred[1,0]˜pred[1,3] to be predicted. The value of the first pixel signal in1 is set to be equal to the value of the pixel h2 so as to obtain the values of the pixels pred[2,0]˜pred[2,3] to be predicted. The value of the first pixel signal in1 is set to be equal to the value of the pixel h3 so as to obtain the values of the pixels pred[3,0]˜pred[3,3] to be predicted.
Intra Prediction of 4×4 Luminance Macroblock (Mode 1)
Referring to
For mode 1, the computation control unit 10 directly receives data of the first pixel signal in1, and directly uses the received value of the first pixel signal in1 as the value of the pixel to be predicted. The value of the first pixel signal in1 is set to be equal to the value of the pixel v0 so as to obtain the values of the pixels pred[0,0]˜pred[3,0] to be predicted. The value of the first pixel signal in1 is set to be equal to the value of the pixel v1 so as to obtain the values of the pixels pred[0,1]˜pred[3,1] to be predicted. The value of the first pixel signal in1 is set to be equal to the value of the pixel v2 so as to obtain the values of the pixels pred[0,2]˜pred[3,2] to be predicted. The value of the first pixel signal in1 is set to be equal to the value of the pixel v3 so as to obtain the values of the pixels pred[0,3]˜pred[3,3] to be predicted.
Intra Prediction of 4×4 Luminance Macroblock (Mode 3)
Referring back to
pred[0,0]=(h0+2×h1+h2+2)>2 equation (3-1)
pred[1,0]=pred[0,1]=(h1+2×h2+h3+2)>>2 equation (3-2)
pred[2,0]=pred[1,1]=pred[0,2]=(h2+2×h3+h4+2)>>2 equation (3-3)
pred[3,0]=pred[2,1]=pred[1,2]=pred[0,3]=(h3+2×h4+h5+2)>>2 equation (3-4)
pred[3,1]=pred[2,2]=pred[1,3]=(h4+2×h5+h6+2)>±2 equation (3-5)
pred[3,2]=pred[2,3]=(h5+2×h6+h7+2)>>2 equation (3-6)
pred[3,3]=(h6+3×h7)>±2 equation (3-7)
Referring to both
The computation control unit 10 also sets the multipliers 112, 122, 132 of the first processing unit 11, the second processing unit 12, and the third processing unit 13 to receive the data of the first pixel signal in, and to multiply the data of the first pixel signal in1 by 1, 2, and 1, respectively.
Referring to
During the first cycle, the computation control unit 10 sends the pixel h0 to the multipliers 112, 122, 132 of the first to third processing units 11, 12, 13. The multipliers 112, 122, 132 multiply the pixel h0 by 1, 2, and 1, respectively. Therefore, the value of the first output signal out1 is h0, and the registers 121, 131 of the second and third processing units 12, 13 respectively store the values 2×h0 and h0 therein to be outputted during the next cycle. Thus, the second and the third processing units 12, 13 do not output any signal at this time.
During the second cycle, the computation control unit 10 sends the pixel h1 to the multipliers 112, 122, 132 of the first to third processing units 11, 12, 13. The second and third output signals out2, out3 are data temporarily stored in the registers 121, 131 of the second and third processing units 12, 13 during the previous cycle, and are, therefore, 2×h0 and h0. The data inputted into the registers 121, 131 of the second and third processing units 12, 13 during the second cycle are 2×h1+h0 and h1, respectively.
During the third cycle, the computation control unit 10 sends the pixel h2 to the multipliers 112, 122, 132 of the first to third processing units 11, 12, 13. The value of the second output signal out2 is 2×h1+h0, and is sent to the second input end of the adder 113 of the first processing unit 11. The data at the first input end of the adder 113 of the first processing unit 11 is h2. Therefore, the value of the first output signal out1 is equal to h2+2×h1+h0. The computation control unit 10 receives the first output signal out1 which, after adding 2 and making a logic right shift of 2 bits, is equal to the value of the pixel pred[0,0] to be predicted in the equation (3-1). At this time, the data temporarily stored in the register 121 of the second processing unit 12 is 2×h2+h1.
During the fourth cycle, the first pixel signal in1 of the computation control unit 10 is equal to the value of the pixel h3. At this time, since the value of the second output signal out2 is equal to 2×h2+h1, and is sent to the second input end of the adder 113 of the first processing unit 11, and the first input end of the adder 113 of the first processing unit 11 is equal to h3, the value of the first output signal out1 is equal to h3+2×h2+h1. After the computation control unit 10 adds 2 to the first output signal out1 and makes a right shift of 2 bits, the value of the first output signal out1 will be equal to the value of the pixels to be predicted pred[1,0] and pred[0 μl] in the equation (3-2).
In the same manner, the first to third processing units 11, 12, 13 and the computation control unit 10 can calculate the values of the pixels to be predicted pred[2, 0], pred[3,0], pred[3,1], pred[3,2], and pred[3,3] in the corresponding equations (3-3) to (3-7) in sequence during the following fifth to ninth cycles, as shown in Table 1.
Intra Prediction of 4×4 Luminance Macroblock (Mode 4)
Referring back to
pred[0,3]=(v3+2×v2+v1+2)>>2 equation (4-1)
pred[0,2]=pred[1,3]=(v2+2×v1+v0+2)>>2 equation (4-2)
pred[0,1]=pred[1,2]=pred[2,3]=(v1+2×v0+Q+2)>>2 equation (4-3)
pred[0,0]=pred[1,1]=pred[2,2]=pred[3,3](v0+2×Q+h0+2)>2 equation (4-4)
pred[1,0]=pred[2,1]=pred[3,2]=(Q+2×h0+h1+2)>>2 equation (4-5)
pred[2,0]=pred[3,1]=(h0+2×h1+h2+2)>>2 equation (4-6)
pred[3,0]=(h1+2×h2+h3)>>2 equation (4-7)
The computation control unit 10 sets the first to third processing units 11, 12, 13 to have the same manner of connection as in mode 3, and further sets the multipliers 112, 122, 132 of the first to third processing units 11, 12, 13 to multiply the first pixel signal in1 of the computation control unit 10 by 1, 2 and 1, respectively. The computation control unit 10 also arranges the pixels Q, h0˜h3 and v0˜v3 of the reference block in an order as shown in Table 2, which are outputted thereby in sequence as the respective values of the first pixel signal in1 during the first to ninth cycles. The computation control unit 10 receives the first output signal out1 during the third to ninth cycles, adds 2 thereto, and makes a logic right shift of 2 bits to obtain the pixels to be predicted in the corresponding equations (4-1)˜(4-7).
Intra Prediction of 4×4 Luminance Macroblock (Mode 5)
Referring back to
pred[0,1]=(h0+2×h1+h2+2)>>2 equation (5-1)
pred[1,1]=pred[0,3]=(h1+2×h2+h3+2)>>2 equation (5-2)
pred[2,1]=pred[1,3]=(h2+2×h3+h4+2)>>2 equation (5-3)
pred[3,1]=pred[2,3]=(h3+2×h4+h5+2)>>2 equation (5-4)
pred[3,3]=(h4+2×h5+h6+2)>>2 equation (5-5)
pred[3,2]=(h4+h5+1)>>1 equation (5-6)
pred[3,0]=pred[2,2]=(h3+h4+1)>>1 equation (5-7)
pred[2,0]=pred[1,2]=(h2+h3+1)>>1 equation (5-8)
pred[1,0]=pred[0,2]=(h1+h2+1)>>1 equation (5-9)
pred[0,0]=(h1+h0+1)>>1 equation (5-10)
During the first to seventh cycles, the computation control unit 10 sets the first to third processing units 11, 12, 13 to have the same manner of connection as in mode 3, further sets the multipliers 112, 122, 132 of the first to third processing units 11, 12, 13 to multiply the first pixel signal in1 of the computation control unit 10 by 1, 2 and 1, respectively, arranges the pixels h0˜h6 of the reference block in an order as shown in Table 3, and outputs the same in sequence as the respective values of the first pixel signal in1 during the first to seventh cycles. The computation control unit 10 receives the first output signal out1 during the third to seventh cycles, adds 2 thereto, and makes a logic right shift of 2 bits to obtain the pixels to be predicted in the corresponding equations (5-1) to (5-5).
Referring to
As shown in Table 3, the computation control unit 10 also uses the pixels h5˜h0 as the values of the first pixel signal in1 during the eighth to thirteen cycles. Therefore, the first output signal out1 and the second output signal out2 are as shown in Table 3. During the ninth to thirteenth cycles, the computation control unit 10 adds 1 to the value of the first output signal out1 and makes a logic right shift of 2 bits to obtain the pixel to be predicted in the corresponding equations (5-6) to (5-10). The computation control unit 10 will not use the value of the first output signal out1 in the eighth cycle.
Intra Prediction of 4×4 Luminance Macroblock (Mode 6)
Referring back to
pred[0,0]=pred[2,1]=(Q+v0+1)>>1 equation (6-1)
pred[0,1]=pred[2,2]=(v0+v1+1)>>1 equation (6-2)
pred[0,2]=pred[2,3]=(v1+v2+1)>>1 equation (6-3)
pred[0,3]=(v2+v3+1)>>1 equation (6-4)
pred[1,3]=(v3+2×v2+v1+2)>>2 equation (6-5)
pred[1,2]=pred[3,3]=(v2+2×v1+v0+2)>>2 equation (6-6)
pred[1,1]=pred[3,2]=(v1+2×v0+Q+2)>>2 equation (6-7)
pred[1,0]=pred[3,1]=(v0+2×Q+h0+2)>>2 equation (6-8)
pred[2,0]=(Q+2×h0+h+2)>>2 equation (6-9)
pred[3,0]=(h0+2×h1+h2+2)>>2 equation (6-10)
Referring to Table 4, the computation control unit 10 arranges the pixels Q, h0˜h2 and v0˜v3 in an order as shown therein for output during the first to twelfth cycles, and controls the first, second and third processing units 11, 12, 13 such that the first, second and third processing units 11, 12, 13 correspond to the manner of connection shown in
Intra Prediction of 4×4 Luminance Macroblock (Mode 7)
Referring back to
pred[0,0]=pred[1,2]=(Q+h+1)>>1 equation (7-1)
pred[1,0]=pred[2,2]=(h0+h1+1)>>1 equation (7-2)
pred[2,0]=pred[3,2]=(h1+h2+1)>>1 equation (7-3)
pred[3,0]=(h2+h3+1)>>1 equation (7-4)
pred[3,1]=(h1+2×h2+h3+2)>>2 equation (7-5)
pred[2,1]=pred[3,3]=(h0+2×h1+h2+2)>>2 equation (7-6)
pred[1,1]=pred[2,3]=(Q+2×h0+h1+2)>>2 equation (7-7)
pred[0,1]=pred[1,3]=(v0+2×Q+h0+2)>>2 equation (7-8)
pred[0,2]=(v1+2×v0+Q+2)>>2 equation (7-9)
pred[0,3]=(v2+2×v1+v0+2)>>2 equation (7-10)
Referring to Table 5, the computation control unit 10 arranges the pixels Q, h0˜h2 and v0˜v3 in an order as shown therein for output during the first to twelfth cycles, and controls the first, second and third processing units 11, 12, 13 such that the processing units 11, 12, 13, correspond to the manner of connection shown in
Intra Prediction of 4×4 Luminance Macroblock (Mode 8)
Referring back to
pred[1,0]=(v0+2×v1+v2+2)>>2 equation (8-1)
pred[1,1]=pred[3,0]=(v1+2×v2+v3+2)>>2 equation (8-2)
pred[1,2]=pred[3,1]=(v2+3×v3+2)>>2 equation (8-3)
pred[2,2]=pred[3,2]=pred[0,3]=pred[1,3]=pred[2,3]=pred[3,3]=v3 equation (8-4)
pred[0,2]=pred[2,1]=(v2+v3+1)>>1 equation (8-5)
pred[0,1]=pred[2,0]=(v1+v2+1)>>1 equation (8-6)
pred[0,0]=(v0+v1+1)>>1 equation (8-7)
Referring to Table 6, the computation control unit 10 arranges the pixels v0˜v3 in the manner as shown therein for output during the first to ninth cycles, and controls the first, second and third processing units 11, 12, 13 such that the processing units 11, 12, 13 correspond to the manner of connection shown in
It is noted that since the computation control unit 10 also receives the first pixel signal in1 outputted thereby, the computation control unit 10 uses the pixel v3 as the value of the first pixel signal in1 during the sixth cycle. In particular, the computation control unit 10 calculates the pixel value to be predicted without using the value of the first output signal out1, but instead uses the value of the first pixel signal in1 directly as the value of the pixel to be predicted in equation (8-4).
Intra Prediction of 4×4 Luminance Macroblock (Dc Mode)
Referring back to
pred[x,y]=(h0+h1+h2+h3+v0+v1+v2+v3+4)>>3 equation (9-1)
If the pixels h0˜-h7 do not exist and the pixels v0˜v3 exist, the relation between the value of the pixel pred[x,y] to be predicted and the pixels v0˜v3 is expressed in the following equation (9-2):
pred[x,y]=(v0+v1+v2+v3+2)>>2 equation (9-2)
If the pixels v0˜v3 do not exist and the pixels h0˜h3 exist, the relation between the value of the pixel pred[x,y] to be predicted and the pixels h˜h3 is expressed in the following equation (9-3):
pred[x,y]=(h0+h1+h2+h3+2)>>2 equation (9-3)
If none of pixels h0˜h7 and v0˜v7 are present, the pixel pred[x,y] to be predicted is 128.
Referring to
The computation control unit 10 uses the pixel h0 as the first pixel signal in1 in the first cycle, which becomes the first output signal out1 after being subjected to computation via the multiplier 112 and the adder 113 of the first processing unit 11. During the second cycle, the computation control unit 10 uses the pixel h1 as the first pixel signal in, and sends the same through the multiplier 112 of the first processing unit 11 to the first input end of the adder 113 of the first processing unit 11. At this time, the data at the second input end of the adder 113 of the first processing unit 11 is the data at the output end of the register 11 of the first processing unit 11, and is equal to the value of the first output signal out1 in the first cycle and is equal to h0. Therefore, the data at the output end of the adder 113 of the first processing unit 11 is h0+h1. In the same manner, the computation control unit 10 will use the pixels h2, h3, v0˜v3 sequentially as the value of the first pixel signal in1 in each of the subsequent cycles. When the computation control unit 10 outputs the pixel v3, the data at the second input end of the adder 113 of the first processing unit 11 will be equal to h0+h1+h2+h3+v0+v1+v2. Therefore, the first output signal out1 is equal to h0+h1+h2+h3+v0+v1+v2+v3. It is known from equation (9-1) that the computation control unit 10 can obtain the values of all the pixels to be predicted by adding 4 to the first output signal out1 and making three logic right shifts.
When the pixels h0˜h3 do not exist and the pixels v0˜v3 exist, the computation control unit 10 outputs the pixels v0˜v3 sequentially and respectively during the first to fourth cycles in a similar fashion, and can obtain the values of the pixels to be predicted during the fourth cycle after adding 2 to the value of the first output signal out1 (equal to sum of the pixels v0˜v3) and making two logic right shifts. On the other hand, when the pixels v0˜v3 do not exist and the pixels h0˜h3 exist, the computation control unit 10 outputs the pixels h0˜h3 sequentially and respectively during the first four cycles, and can obtain the values of the pixels to be predicted by adding 2 to the sum of the pixels h0˜h3 and making a logic right shift of 2 bits.
When the computation control unit 10 detects that none of the pixels h˜h3 and v0˜v3 exist, the computation control unit 10 directly uses 128 as the value of the pixel to be predicted.
Intra Prediction of 8×8 Luminance Macroblock
When the macroblock to be predicted is an 8×8 luminance macroblock and the computation control unit 10 uses intra prediction to calculate the values of the pixels to be predicted, for the 8×8 luminance macroblock, the computation control unit 10 can use mode 0, mode 1, modes 3˜8, and DC mode of intra prediction to calculate the values of the pixels to be predicted, and the method of calculation is similar to that for 4×4 luminance macroblocks.
Intra Prediction of 16×16 Luminance Macroblock
When the macroblock to be predicted is a 16×16 luminance macroblock and the computation control unit 10 uses intra prediction to calculate the values of the pixels to be predicted, for the 16×16 luminance macroblock, the computation control unit 10 can use the vertical mode, the horizontal mode, the DC mode, or the plane mode to obtain the same.
Intra Prediction of 16×16 Luminance Macroblock (Vertical, Horizontal, DC Modes)
The processing in the vertical mode, horizontal mode, and DC mode correspond respectively to mode 0, mode 1, and DC mode of intra prediction used to calculate 4×4 luminance macroblocks. Besides, when the DC mode is used for calculation, the computation control unit 10 also sets the first to sixth processing units 11˜16 to have the same manner of connection as shown in
Intra Prediction of 16×16 Luminance Macroblock (Plane Mode)
Referring to
pred[x,y]=clipY[(a+b×(x−7)+c×(y−7)+16)>>5]=clipY[(M+bx+cy)>>5] equation (10-1)
M=a−7b−7c+16 equation (10-2)
a=16×(p[−1,15]+p[15,−1]) equation (10-3)
b=(5×H+32)>>6 equation (10-4)
c=(5×V+32)>>6 equation (10-5)
where “clipY” is to limit the value of [(a+b×(x−7)+c×(y−7)+16)>>5] between an upper limit and a lower limit, and the upper limit and the lower limit are related to the resolution of these pixels and are defined in the H.264 standard.
From equations (10-1) and (10-2), it can be known that if the “clipY” operation is ignored first, the value of the pixel pred[0,0] at the upper leftmost corner of the 16×16 luminance macroblock to be predicted is equal to M>>5, the values of two adjacent pixels to be predicted in the horizontal rightwise direction are incremented by b, and the values of two adjacent pixels to be predicted in the vertical downward direction are incremented by c. Therefore, the pixel values of the macroblock to be predicted will be such as that shown in
H in equation (10-6) can be expressed as follows:
The pixels p[−1,−1]˜p[15,−1] of the reference block in equation (10-8) will be multiplied respectively by 1.8. For example, pixel p[13,−1] will be multiplied by 6. However, in order to ensure that the multipliers 112, 122, 132, 142, 152 of the first to fifth processing units 11˜15 can complete the multiplication operation within a cycle's time, the operation of multiplying p[13,−1] by 6 is decomposed into two logic left shift operations in equation (10-9). The two logic left shift operations are to use the pixel p[13,−1] as the operand and to shift left 1 bit and 2 bits, respectively, which is equivalent to multiplying the pixel p[3,1] by 2 and 4, respectively. The sum of the two logic left shift operations is equal to the product of multiplying the pixel p[13,−1] by 6.
The operations of multiplying the other pixels of the reference block respectively by 3˜8 in equation (10-8) are also expressed in sums of a plurality of logic left shift operations in equation (10-9). Equation (10-9) includes 24 logic left shift operations using the pixels p[−1,−1]˜p[15,−1] of the reference block as operands. The parameter V in equation (10-7) may also be expressed in the same way as 24 logic left shift operations using the pixels p[−1,−1]˜p[−1,15] of the reference block as operands.
Referring to
The computation control unit 10 arranges the pixels p[−1,−1]˜p[15,−1] of the reference block in the order of the operands of the equation (10-9), and outputs the same in sequence to the multiplier 112 of the first processing unit 11 as the first pixel signal in1 during the first to twenty-fourth cycles. The computation control unit 10 sets the multiplier 112 of the first processing unit 11 to correspond to the logic left shift operation of each operand in each cycle. After twenty-four cycles, the first output signal out1 will be equal to the parameter H. The computation control unit 10 can also use the pixels p[−1,−1]˜p[−1,15] of the reference block as the second pixel signal in2, and the output end of the adder 123 of the second processing unit 12 can obtain the parameter V in the same way after 24 cycles.
The computation control unit 10 receives the first and second output signals out1, out2, multiplies the first and second output signals out1, out2 by 5, adds 32 to each, and makes a logic right shift operation of 6 bits to obtain b and c in equation (10-4) and equation (10-5). Then, the computation control unit 10 uses b and c as the first and second pixel signals in1, in2, sends the same to the multipliers 112, 122 of the first and second processing units 11, 12 for multiplying b and c by −7, respectively, and receives the values of the first and second output signals out1, out2 (respectively equal to −7b and −7c). Subsequently, the computation control unit 10 uses three cycles to send the pixels p[−1,15] and p[15,−1] to the first processing unit 11 in a similar manner so as to calculate the value of parameter a in equation (10-2). After obtaining the values of parameters a, −7b, and −7c, the computation control unit 10 further uses 3 cycles to send the parameters a, −7b, and −7c to the first processing unit 11 so as to calculate the value of parameter M in equation (10-2). Lastly, the values of b and c are sent to the first processing unit 11 in 256 (16×16) cycles so as to increment the value of the parameter M by b and c to thereby obtain a 16×16 luminance macroblock corresponding to
Intra Prediction of 16×16 Chrominance Macroblock
When intra prediction is used, the equations for calculating the pixels of the 16×16 chrominance macroblock to be predicted are the same as those for calculating the pixels of the 16×16 luminance macroblock. Therefore, the computation control unit 10 sets the elements of the first to sixth processing units 11˜16 to have the same manner of connection as those for calculating the 16×16 luminance macroblock. Chrominance macroblocks of other sizes that are to be predicted are similar to the 16×16 chrominance macroblock, and they differ only in the size of the macroblock. Thus, the connective relationship between the computation control unit 10 and the first to sixth processing units 11˜16 will not be described in detail herein for the sake of brevity.
Inter Prediction of Luminance Macroblock
Referring to
The pixel which the motion vector points to is the pixel value at the upper leftmost corner of the macroblock to be predicted, and may be a full-pel pixel or a sub-pel pixel. The x- and y-coordinate values of the full-pel pixel are integer values, and the value of one of the x- and y-coordinates of the sub-pel pixel is a non-integer value. The sub-pel pixel includes a half-pel pixel and a quarter-pel pixel. The x-coordinate or y-coordinate of the half-pel pixel is in the middle of two full-pels. Pixels whose x-coordinate or y-coordinate falls into other situations are quarter-pel pixels.
The size of the reference block is correlated to the size and type of the macroblock to be predicted, and whether the pixel which the motion vector points to is a full-pel pixel or a sub-pel pixel. The correlation is defined under the H.264 standard. The following description is first directed to the scenario in which the macroblock to be predicted is a 4×4 luminance macroblock.
Inter Prediction of Luminance Macroblock (where the x- and y-Coordinates are Integers)
When the pixel which the motion vector points to is a full-pel, the computation control unit 10 directly uses the pixel which the motion vector points to as the value of the upper leftmost corner of the 4×4 macroblock to be predicted, with the pixel values that are 1 to 3 pixels downward and rightward from the pixel which the motion vector points to corresponding directly to the other pixel values of the macroblock to be predicted according to the positions thereof.
Inter Prediction of Luminance Macroblock (where the x-Coordinate is a Sub-Pel, and the y-Coordinate is a Full-Pel)
When the x-coordinate of the pixel to which the motion vector points to is in the middle of two full-pels, and the y-coordinate thereof is an integer, such as the pixel q00 in
q00=clipY{(q00—1+16)>>5} equation (11-1)
q00—1=(p[0,0]−5×p[1,0]+20×p[2,0]+20×p[3,0]−5×p[4,0]+p[5,0]) equation (11-2)
The computation control unit 10 calculates the values of the pixels q10, q20, and q30 that are 1 to 3 pixels rightwise from the pixel q00 to serve as the values of the first row of pixels of the luminance macroblock to be predicted, and further calculates the values of the pixels q01, q11, q21 and q31 that are respectively 1 pixel downward from the pixels q00, q10, q20, and q30 to serve as the values of the second row of pixels of the luminance macroblock to be predicted. Similarly, the third and fourth rows of pixels of the macroblock to be predicted are pixels q02, q12, q22, q32, q03, q13, q23, and q33 which are respectively two and three pixels downward from the pixels q00, q10, q20, and q30. The pixels q00, q10, q20, q30, q01, q11, q21, q31, q02, q12, q22, q32, q03, q13, q23, and q33 have to be calculated according to the values of the pixels p[0,0]˜p[8,0], p[0,1]˜p[8,1], p[0,2]˜p[8,2], and p[0,3]˜p[8,3] using equations like equations (11-1) and (11-2). Thus, the reference block is 9×4.
Referring to
Referring to
In
Referring to both
Accordingly, during the fifth cycle, the computation control unit 10 sets the multiplexer 162 of the sixth processing unit 16 to receive the value p[0,1] of the second pixel signal in2, and further sets the multipliers 112, 122, 132, 142, 152 of the first to fifth processing units 11˜15 to receive the value p[4,0] of the first pixel signal in1 so as to enable the multiplier 152 of the fifth processing unit 15 to calculate the value of −5×p[4,0].
During the sixth cycle, the computation control unit 10 uses the pixels p[5,0] and p[1,1] as the first pixel signal in1 and the second pixel signal in2, respectively, sets the multiplexer 162 of the sixth processing unit 16 and the multiplier 152 of the fifth processing unit 15 to receive the second pixel signal in2, and further sets the multipliers 112, 122, 132, 142 of the first to fourth processing units 11˜14 to receive the first pixel signal in1. After the sixth cycle, the computation control unit 10 receives the data outputted by the adder 113 of the first processing unit 11, adds 16 thereto, and makes a logic right shift of 5 bits, thereby obtaining the pixels q00, q10, q20, q30, q01, q11, q21, q31, q02, q12, q22, q32, q03, q13, q23, and q33, in sequence.
Inter Prediction of Luminance Macroblock (where the x and y-Coordinates are Non-Integers)
When both the x-coordinate and the y-coordinate of the half-pel pixel which the motion vector points to are in the middle of two full-pels, such as pixel r00 in
r00=clipY{(r00—1+512)>>10} equation (11-3)
r00—1=(q00−5×q01+20×q02+20×q03−5×q04+q05) equation (11-4)
The pixels q00, q01, q02, q03, q04, and q05 are sub-pels, and can be calculated by referring to pixels p[0,0]˜p[5,0], p[0,1]˜p[5,1], p[0,2]˜p[5,2], p[0,3]˜p[5,3], p[0,4]˜p[5,4] and p[0,5]˜p[5,5] and by performing interpolation using equations similar to equations (11-1) and (11-2).
The computation control unit 10 further needs to calculate the pixels that are 1 to 3 pixels from the pixels r00, r01, r02, and r03 in an x direction to serve as the first to third rows of pixel values of the 4×4 macroblock to be predicted.
Therefore, the computation control unit 10 uses a 9×9 reference block to calculate the 4×4 macroblock to be predicted. The reference block includes the pixels p[x,y] where x=0˜8 and y=0˜8. The computation control unit 10 first uses the pixels in the odd-number row and the pixels in the even-number row of the 9×9 reference block as the first and second pixel signals in1, in2, respectively, and arranges the same in a manner similar to that shown in
Subsequently, the computation control unit 10 uses the pixels in the odd-number rows and the pixels in the even-number rows of the 4×9 macroblock as the first and second pixel signals in1, in2, and likewise arranges the same in a manner similar to that shown in
Thus, referring to
Inter Prediction of Luminance Macroblock (where the x-Coordinate is an Integer, and the y-Coordinate is a Non-Integer)
When the motion vector points to a half-pel pixel whose x-coordinate is an integer and whose y-coordinate is between two full-pels, such as pixel s00 in
s00=clipY{(s00—1+16)>>5} equation (11-5)
s00—1=(p[2,1]−5×p[2,2]+20×p[2,3]+20×p[2,4]−5×p[2,5]+p[2,6] equation (11-6)
Since the calculation to obtain the pixel pointed to by the motion vector involves use of three adjacent full-pel pixels thereabove and three adjacent full-pel pixels therebelow, and equations (11-5) and (11-6), the reference block includes 4×9 pixels. The computation control unit 10 sends the pixels in each row of the reference block to the first to sixth processing units 11˜16, and executes one interpolation using equations (11-5) and (11-6) to thereby obtain the macroblock to be predicted.
Interprediction of Luminance Macroblock (Quarter-Pel)
When the motion vector points to a quarter-pel pixel, such as pixel t00 in
t00=(q02+r00+1)>>1
Therefore, the computation control unit 10 needs to calculate the value of the pixel too according to the values of the pixels q02 and r00, and the method for calculating pixels q02 and r00 is as described hereinabove.
When the computation control unit 10 uses inter prediction to calculate luminance macroblocks of other sizes, the calculation is similar to that described hereinabove, with the difference residing in the sizes of the macroblocks.
Inter Prediction of Chrominance Macroblock
When the computation control unit 10 uses inter prediction to calculate a chrominance macroblock, since the pixels of the chrominance macroblock in the x and y directions are only half of those of the luminance macroblock, the following description is directed to the calculation of a 2×2 chrominance macroblock corresponding to a 4×4 luminance macroblock. The pixel value which the motion vector points to is likewise equivalent to the pixel at the upper leftmost corner of the macroblock to be predicted.
When the pixel which the motion vector points to is a sub-pel, such as pixel q[0,0] in
The pixel q[0,0] must be calculated according to the pixels r00r01 using the following equations (12-1) to (12-3):
q[0,0]{[dy×r01+(8−dy)×r00]>>3} equation (12-1)
r00=dx×p[1,0]+(8−dx)×p[0,0] equation (12-2)
r01=dx×p[1,1]+(8−dx)×p[0,1] equation (12-3)
The pixel q[1,0] must be calculated according to the pixels r10, r11 using the following equations (12-4) to (12-6):
q[1,0]={[dy×r11+(8−dy)×r10]>>3} equation (12-4)
r10=dx×p[2,0]+(8−dx)×p[1.0] equation (12-5)
r11=dx×p[2,1]+(8−dx)×p[1,1] equation (12-6)
When both dx and dy are 0, the pixel which the motion vector points to is a full-pel. The 2×2 reference block having the pixel which the motion vector points to as the upper leftmost pixel is the chrominance macroblock to be predicted.
Referring to
In the preferred embodiment of this invention, the computation control unit 10 uses the pixels of the Cr reference block and the Cb reference block as the first pixel signal in1 and the second pixel signal in2, respectively. The second and third processing units 12, 13 receive the first pixel signal in1 to calculate the Cr macroblock to be predicted. The third and fourth processing units 13, 14 receive the second pixel signal in2 to calculate the Cb macroblock to be predicted.
Referring to
Referring to
The computation control unit 10 uses the pixels of the Cr reference block as the second pixel signal in2, and outputs the same to the fourth and fifth processing units 14, 15 in a manner similar to the processing of the Cb reference block, thereby obtaining the Cr macroblock to be predicted.
It is noted that, in
In sum, compared with the conventional prediction module 97 (see
While the present invention has been described in connection with what is considered the most practical and preferred embodiment, it is understood that this invention is not limited to the disclosed embodiment but is intended to cover various arrangements included within the spirit and scope of the broadest interpretation so as to encompass all such modifications and equivalent arrangements.
Number | Date | Country | Kind |
---|---|---|---|
095127991 | Jul 2006 | TW | national |