Systems and methods for allocating bits to macroblocks within a picture depending on the motion activity of macroblocks as calculated by an L1 norm of the residual signals of the macroblocks
AssigneeIntervideo, Inc.
InventorsLifeng Zhao, Ioannis Katsavounidis, Kuo-Wei Hsu
Life of this patent
Estimating the term…
Abstract
The invention is related to methods and apparatus that can advantageously be used in a video encoder to improve picture quality, to improve the speed of encoding, and the like. One embodiment of the invention advantageously computes activity measures using an efficient L1-norm, which can advantageously be relatively quickly computed by selected microprocessors. Another embodiment of the invention advantageously allocates bits to macroblocks of a picture based at least in part on the motion activities of the macroblocks.
Claims5
A method of allocating bits to macroblocks of a picture in a video encoding process, where the bits are allocated at least in part according to a motion activity of the macroblocks, the method comprising the steps of:
- a. receiving a first group of pictures, each picture of said first group of pictures being selected from a group consisting of an I-picture, a P-picture, and a B-picture, wherein the macroblocks of an I-picture are intra coded, the macroblocks of a P-picture are either intra coded or forward predictively coded, and the macroblocks of a B-picture are either intra coded, or forward predictively coded, or backward predictively coded, or interpolated;
- b. retrieving a picture mode of said first group of pictures, said picture mode defining a sequence of said I-pictures, P-pictures, and B-pictures in said first group of pictures;
- c. determining a number Np, Nb of each of said P-pictures and B-pictures, respectively, in said first group of pictures to be encoded;
- d. calculating values of complexity estimators Xi, Xp, Xb for each of said I-pictures, P-pictures, and B-pictures, respectively, in said first group of pictures;
- e. calculating a number R of bits allocated to said first group of pictures to be encoded remaining after encoding a respective I-picture, P-picture or B-picture, wherein R=Rprev−Si,p,b,
- the Rprev being a number of bits allocated to said first group of pictures prior to encoding of said respective I-picture, P-picture, or B-picture, and the Si,p,b being a number of bits used to encode said respective I-picture, P-picture, or B-picture, respectively;
- and
- f. calculating an initial target number of bits Ti, Tp, Tb for each I-picture, P-picture, and B-picture, respectively, to be encoded in said first group of pictures, wherein
- T
- i
- =
- max
-
- {
- (
- R
- (
- 1
- _
- +
- N
- p
-
- X
- p
- X
- i
-
- K
- p
- +
- N
- b
-
- X
- b
- X
- i
-
- K
- b
- )
- )
- ,
- (
- bit_rate
- 8
- ·
- picture_rate
- )
- }
- T
- p
- =
- max
-
- {
- (
- R
- (
- N
- p
- +
- N
- b
-
- K
- p
-
- X
- b
- K
- b
-
- X
- p
- )
- )
- ,
- (
- bit_rate
- 8
- ·
- picture_rate
- )
- }
- T
- b
- =
- max
-
- {
- (
- R
- (
- N
- b
- +
- N
- p
-
- K
- b
-
- X
- p
- K
- p
-
- X
- b
- )
- ,
- bit_rate
- 8
- ·
- picture_rate
- }
- wherein bit_rate corresponds to a bit rate of a data transmission channel,
- wherein picture_rate corresponds to a number of pictures per second transmitted via said data transmission channel, and
- wherein Kp and Kb are universal constants depending on quantization matrices for the P-pictures and B-pictures, respectively, to be encoded;
- allocating a respective virtual buffer for each of said I-pictures, P-pictures and B-pictures in said first group of pictures;
- calculating virtual buffer fullness dji, djp, and djb of each of said respective virtual buffer for said I-pictures, P-pictures, and B-pictures, wherein j is a number of a macroblock being encoded;
- and
- updating a respective virtual buffer fullness dji, djp, and djb in accordance with
- d
- j
- i
- =
- d
- o
- i
- +
- B
- j
- -
- 1
- -
- (
- T
- i
- ·
- Mact_sum
- j
- -
- 1
- MACT
- )
- ;
- d
- j
- p
- =
- d
- 0
- p
- +
- B
- j
- -
- 1
- -
- (
- T
- p
- ·
- Mact_sum
- j
- -
- 1
- MACT
- )
- ;
- and
- d
- j
- b
- =
- d
- o
- b
- +
- B
- j
- -
- 1
- -
- (
- T
- b
- ·
- Mact_sum
- j
- -
- 1
- MACT
- )
- ,
- wherein d0i, d0p, and djb correspond to said respective virtual buffer fullness prior to encoding of the jth macroblock,
- wherein Bj−1 corresponds to a number of bits used to encode macroblocks prior to encoding said jth macroblock,
- wherein Ti corresponds to the target bit allocation for a next picture to be encoded when the picture is the I-picture that starts a group of pictures, Tp corresponds to the target bit allocation for a next picture to be encoded when the next picture is a P-picture, and Tb corresponds to the target bit allocation for a next picture to be encoded when the next picture is a B-picture,
- wherein the variable MACT represents the sum of the motion activity of all of the macroblocks in the pictures of the first group of pictures, and wherein the variable Mact_sumj−1 corresponds to the sum of the motion activity of the macroblocks in the picture that have been encoded.
A method of allocating bits to macroblocks of a picture in a video encoding process, where the bits are allocated at least in part according to a motion activity of the macroblocks, the method comprising the steps of:
- a. receiving a first group of pictures, each picture of said first group of pictures being selected from a group consisting of an I-picture, a P-picture, and a B-picture, wherein the macroblocks of an I-picture are intra coded, the macroblocks of a P-picture are either intra coded or forward predictively coded, and the macroblocks of a B-picture are either intra coded, or forward predictively coded, or backward predictively coded, or interpolated;
- b. retrieving a picture mode of said first group of pictures, said picture mode defining a sequence of said I-pictures, P-pictures, and B-pictures in said first group of pictures;
- c. determining a number Np, Nb of each of said P-pictures and B-pictures, respectively, in said first group of pictures to be encoded;
- d. calculating values of complexity estimators Xi, Xp, Xb for each of said I-pictures, P-pictures, and B-pictures, respectively, in said first group of pictures;
- e. calculating a number R of bits allocated to said first group of pictures to be encoded remaining after encoding a respective I-picture, P-picture or B-picture, wherein R=Rprev−Si,p,b,
- the Rprev being a number of bits allocated to said first group of pictures prior to encoding of said respective I-picture, P-picture, or B-picture, and the Si,p,b being a number of bits used to encode said respective I-picture, P-picture, or B-picture, respectively;
- and
- f. calculating an initial target number of bits Ti, TP, Tb for each I-picture, P-picture, and B-picture, respectively, to be encoded in said first group of pictures, wherein
- T
- i
- =
- max
-
- {
- (
- R
- (
- 1
- _
- +
- N
- p
-
- X
- p
- X
- i
-
- K
- p
- +
- N
- b
-
- X
- b
- X
- i
-
- K
- b
- )
- )
- ,
- (
- bit_rate
- 8
- ·
- picture_rate
- )
- }
- T
- p
- =
- max
-
- {
- (
- R
- (
- N
- p
- +
- N
- p
-
- K
- p
-
- X
- b
- K
- b
-
- X
- p
- )
- )
- ,
- (
- bit_rate
- 8
- ·
- picture_rate
- )
- }
- T
- b
- =
- max
-
- {
- R
- (
- N
- b
- +
- N
- p
-
- K
- b
-
- X
- p
- K
- p
-
- X
- b
- )
- ,
- bit_rate
- 8
- ·
- picture_rate
- }
- wherein bit_rate corresponds to a bit rate of a data transmission channel,
- wherein picture_rate corresponds to a number of pictures per second transmitted via said data transmission channel, and
- wherein Kp and Kb are universal constants depending on quantization matrices for the P-pictures and B-pictures, respectively, to be encoded;
- allocating a respective virtual buffer for each of said I-pictures, P-pictures and B-pictures in said first group of pictures;
- calculating virtual buffer fullness dji, djp, and djb of each of said respective virtual buffer for said I-pictures, P-pictures, and B-pictures, wherein j is a number of a macroblock being encoded;
- and
- updating a respective virtual buffer fullness dji, djp,and djb in accordance with
- d
- j
- i
- =
- d
- o
- i
- +
- B
- j
- -
- 1
- -
- (
- α
- i
-
- T
- i
- ·
- (
- j
- -
- 1
- )
- MB_cnt
- +
- (
- 1
- -
- α
- i
- )
-
- T
- i
- ·
- Mact_sum
- j
- -
- 1
- MACT
- )
- ;
- d
- j
- p
- =
- d
- o
- p
- +
- B
- j
- -
- 1
- -
- (
- α
- p
-
- T
- p
- ·
- (
- j
- -
- 1
- )
- MB_cnt
- +
- (
- 1
- -
- α
- p
- )
-
- T
- p
- ·
- Mact_sum
- j
- -
- 1
- MACT
- )
- ;
- and
- d
- j
- b
- =
- d
- o
- b
- +
- B
- j
- -
- 1
- -
- (
- α
- b
-
- T
- b
- ·
- (
- j
- -
- 1
- )
- MB_cnt
- +
- (
- 1
- -
- α
- b
- )
-
- T
- b
- ·
- Mact_sum
- j
- -
- 1
- MACT
- )
- ;
- wherein the variables dji, djp, and djb represent a respective virtual buffer fullness for I-pictures, for P-pictures, and for B-pictures, respectively,
- wherein the variable j represents the number of the encoded macroblock,
- wherein Bj−1 corresponds to the number of bits used to encode the macroblocks up to but not including the j-th macroblock,
- wherein Ti corresponds to the target bit allocation for the next picture to be encoded when the picture is the I-picture that starts a group of pictures, Tp corresponds to the target bit allocation for a next picture to be encoded when the next picture is a P-picture, and Tb corresponds to the target bit allocation for a next picture to be encoded when the next picture is a B-picture,
- wherein the variable MACT represents the sum of the motion activity of all of the macroblocks in said first group of pictures,
- wherein the variable Mact_sumj−1 corresponds to the sum of the motion activity of the macroblocks in the picture that have been encoded, and MB_cnt corresponds to the number of macroblocks in the picture, and
- wherein ai, ap, and ab correspond to weighting factors for allocation of bits to macroblocks within I-pictures, P-pictures, and B-pictures, respectively.
Dependencies are inferred from the claim text.