⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tmn5.mht

📁 H263 码率控制的标准算法 TMN5, rate control method for h.263
💻 MHT
📖 第 1 页 / 共 4 页
字号:
From: <由 Microsoft Internet Explorer 5 保存>
Subject: RATE CONTROL AND QUANTIZATION CONTROL
Date: Thu, 5 Jul 2007 14:58:35 +0800
MIME-Version: 1.0
Content-Type: multipart/related;
	type="text/html";
	boundary="----=_NextPart_000_0000_01C7BF14.F644E5B0"
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180

This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C7BF14.F644E5B0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: file://D:\RATE CONTROL AND QUANTIZATION CONTROL.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from =
url=3D(0048)http://www.mpeg.org/MPEG/MSSG/tm5/Ch10/Ch10.html =
--><HTML><HEAD><TITLE>RATE CONTROL AND QUANTIZATION CONTROL</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3DISO-8859-1">
<META content=3D"MSHTML 6.00.2900.2873" name=3DGENERATOR></HEAD>
<BODY bgColor=3D#ffffff>
<H1>10 RATE CONTROL AND QUANTIZATION CONTROL<BR></H1>
<P>This section describes the procedure for controlling the bit-rate of =
the Test=20
Model by adapting the macroblock quantization parameter=20
<I><B>quantizer_scale</I></B>. The algorithm works in three-steps:<BR>
<P><B>1 Target bit allocation</B>: this step estimates the number of =
bits=20
available to code the next picture. It is performed before coding the=20
picture.<BR>
<P><B>2 Rate control</B>: by means of a "virtual buffer", this step sets =
the=20
reference value of the quantization parameter for each macroblock.<BR>
<P><B>3 Adaptive quantization</B>: this step modulates the reference =
value of=20
the quantization parameter according to the spatial activity in the =
macroblock=20
to derive the value of the quantization parameter, mquant, that is used =
to=20
quantize the macroblock.<BR>
<H2>Step 1 - Bit Allocation</H2>
<H3>Complexity estimation<BR></H3>
<P>After a picture of a certain type (I, P, or B) is encoded, the =
respective=20
"global complexity measure" (Xi, Xp, or Xb) is updated as:=20
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00001.gif"></CENTER>
<P>where Si, Sp, Sb are the number of bits generated by encoding this =
picture=20
and Qi, Qp and Qb are the average quantization parameter computed by =
averaging=20
the actual quantization values used during the encoding of the all the=20
macroblocks, including the skipped macroblocks.<BR>
<P>Initial values=20
<P>Xi =3D (160 * <B>bit_rate</B>) / 115=20
<P>Xp =3D (60 * <B>bit_rate)</B> / 115=20
<P>Xb =3D (42 * <B>bit_rate</B>) / 115<BR>
<P><B>bit_rate </B>is measured in bits/s.<BR>
<H3>Picture Target Setting</H3>
<P>The target number of bits for the next picture in the Group of =
pictures (Ti,=20
Tp, or Tb) is computed as:=20
<P><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00002.gif"><BR><BR><BR>
<P><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00003.gif"><BR><BR><BR>
<P><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00004.gif"><BR><BR>
<P>Where:=20
<P>Kp and Kb are "universal" constants dependent on the quantization =
matrices.=20
For the matrices specified in sections 7.1 and 7.2 Kp =3D 1.0 and Kb =3D =
1.4.<BR>
<P>R is the remaining number of bits assigned to the GROUP OF PICTURES. =
R is=20
updated as follows:<BR>
<P>After encoding a picture , R =3D R - Si,p,b<BR>
<P>Where is Si,p,b is the number of bits generated in the picture just =
encoded=20
(picture type is I, P or B).<BR>
<P>Before encoding the first picture in a GROUP OF PICTURES (an =
I-picture):<BR>
<P>R =3D G + R=20
<P>G =3D <B>bit_rate</B> * N / <B>picture_rate</B>=20
<P>N is the number of pictures in the GROUP OF PICTURES. <BR>
<P>At the start of the sequence R =3D 0.<BR>
<P>Np and Nb are the number of P-pictures and B-pictures remaining in =
the=20
current GROUP OF PICTURES in the encoding order. <BR>
<CENTER>
<TABLE border=3D1>
  <TBODY>
  <TR>
    <TD>
      <CENTER>I </CENTER></TD>
    <TD>
      <CENTER>B</CENTER></TD>
    <TD>
      <CENTER>B</CENTER></TD>
    <TD>
      <CENTER>P</CENTER></TD>
    <TD>
      <CENTER>B</CENTER></TD>
    <TD>
      <CENTER>B</CENTER></TD>
    <TD>
      <CENTER>P</CENTER></TD>
    <TD>
      <CENTER>B</CENTER></TD>
    <TD>
      <CENTER>B</CENTER></TD>
    <TD>
      <CENTER>P</CENTER></TD>
    <TD>
      <CENTER>B</CENTER></TD>
    <TD>
      <CENTER>B</CENTER></TD>
    <TD>
      <CENTER>P</CENTER></TD></TR>
  <TR>
    <TD colSpan=3D6></TD>
    <TD>R-bits</TD></TR>
  <TR>
    <TD colSpan=3D6></TD>
    <TD>Np =3D 3</TD>
    <TD></TD>
    <TD>
  <TR>
    <TD colSpan=3D6></TD>
    <TD>Nb =3D 4</TD></TR></TBODY></TABLE></CENTER>
<P>
<CENTER><B>Figure 10.1 - Example of Remaining pictures in GOP at frame=20
7</B></CENTER>
<H2>Step 2 - Rate Control<BR></H2>
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00005.gif"><BR></CENTER>
<P>
<CENTER><B>Figure 10.2 : Rate Control for P-pictures <BR></B></CENTER>
<P>Before encoding macroblock j (j &gt;=3D 1), compute the fullness of =
the=20
appropriate virtual buffer:<BR>
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00006.gif"></CENTER>
<P>or=20
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00007.gif"></CENTER>
<P>or=20
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00008.gif"></CENTER>
<P>=85depending on the picture type.<BR>
<P>where=20
<P><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00009.gif">are=20
initial fullnesses of virtual buffers - one for each picture type.<BR>
<P>Bj is the number of bits generated by encoding all macroblocks in the =
picture=20
up to and including j.<BR>
<P>MB_cnt is the number of macroblocks in the picture. <BR>
<P><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00010.gif">=20
are the fullnesses of virtual buffers at macroblock j- one for each =
picture=20
type.<BR>
<P>The final fullness of the virtual buffer (<IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00011.gif">:=20
j =3D MB_cnt) is used as <IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00012.gif">=20
for encoding the next picture of the same type.<BR>
<P>Next compute the reference quantization parameter Qj for macroblock j =
as=20
follows:=20
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00013.gif"></CENTER>
<P>where the "reaction parameter" r is given by=20
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00014.gif"><BR></CENTER>
<P>and dj is the fullness of the appropriate virtual buffer.<BR>
<P>The initial value for the virtual buffer fullness is:=20
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00015.gif"></CENTER>
<H2>Step 3 - Adaptive Quantization<BR></H2>
<P>Compute a spatial activity measure for the macroblock j from the four =

luminance frame-organised sub-blocks (n=3D1..4) <U>and</U> the four =
luminance=20
field-organised sub-blocks (n=3D5..8) using the intra (i.e. original) =
pixel=20
values:<BR>
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00016.gif"></CENTER>
<P>where=20
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00017.gif"></CENTER>
<P>and=20
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00018.gif"><BR></CENTER>
<P>and Pk are the sample values in the n-th original 8*8 block.<BR>
<P>Normalise actj:<BR>
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00019.gif"><BR></CENTER>
<P>avg_act is the average value of actj the last picture to be encoded. =
On the=20
first picture, avg_act =3D 400.<BR>
<P>Obtain mquantj as:=20
<P>
<CENTER><IMG=20
src=3D"file:///D:/RATE%20CONTROL%20AND%20QUANTIZATION%20CONTROL.files/IMG=
00020.gif"></CENTER>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -