IP Library Granted Patent US 11,240,503
Granted Patent B2
US 11,240,503 · App. 17/117,142 · Granted Feb 1, 2022

Method for optimizing two-pass coding

Inventors: Ce Zhu (Chengdu, CN); Hongwei Guo (Chengdu, CN); Yuyang Liu (Chengdu, CN); Mao Ye (Chengdu, CN)
Assignee: UNIVERSITY OF ELECTRONIC SCIENCE AND TECHNOLOGY OF CHINA
H04N19/124H04N19/147H04N19/177H04N19/52
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,240,503
App. No.
17/117,142
Granted
Feb 1, 2022
Kind
B2
Abstract

A method for optimizing a second coding is provided. The method includes: Setting a quantization parameter of a start frame of a video sequence according to a range of an input quantization parameter QP 0 of a coder; performing first coding with a simplified method, and calculating a frame-level temporal impact factor k i of a current frame and a block-level temporal impact factor k B,j of all 16×16 pixel blocks in the current frame; restoring reference list information of the coder after the first coding is completed, and then determining whether a scene is switched; and performing the second coding by setting quantization parameters with different strategies according to whether the scene is switched.

Claims (219)

1. A method for optimizing a two-pass coding, comprising the following steps:

S 1 : setting a start frame of a video sequence as a frame I with a level set to Level 0, wherein the frame I is used as a separate Group of Pictures (GOP); optimizing the start frame, wherein the start frame is the frame I, setting a quantization parameter QP I of the frame I according to a range of an input quantization parameter QP 0 of a coder:

Q

P

I

=

{

Q

P

0

-

4

,

QP

0

>

34

Q

P

0

-

3

,

29

<

Q

P

0

34

Q

P

0

-

2

,

24

<

QP

0

29

;

Q

P

0

-

1

,

19

<

Q

P

0

24

Q

P

0

,

Q

P

0

19

S 2 : reading in a frame to be coded of the GOP by the coder;

S 3 : a first coding: performing the first coding on a current frame by using a default quantization parameter QP HM,i set by an High efficiency video coding (HEVC), and obtaining a frame-level temporal impact factor k i of the current frame and a block-level temporal impact factor k B,j of 16×16 pixel blocks in the current frame:

k

i

=

D

i

D

i

MCP

;

k

B

,

j

=

D

B

,

j

D

B

,

j

MCP

;

wherein D i and D i MCP are respectively a coding distortion and a motion compensation prediction error of the current frame; and D B,j and D B,j MCP are respectively a coding distortion and a motion compensation prediction error of a jth 16×16 pixel blocks in the current frame;

S 4 : restoring reference list information of the coder after the first coding is completed, wherein the first coding does not output a code stream of the current frame or store a reconstructed image; after the first coding, resetting a linked image list in the coder to a state before the current frame is coded, comprising restoring a reference frame identifier in the linked image list;

S 5 : determining whether a scene is switched, if the scene is switched, performing step S 6 , if the scene is not switched, performing step S 7 ; a determination method is: if p i >4 p and p i >10, a scene switching occurs in the current frame, wherein p i is an average motion compensation prediction absolute error of the current frame, and p is an a mean value of the average motion compensation prediction absolute error of previous six frames;

S 6 : setting a quantization parameter of the current frame as QP i =QP 0 , then performing the two-pass coding, and outputting the code stream and storing the reconstructed image in a default way of the coder, entering step S 8 ;

S 7 : setting the quantization parameter of the current frame as

Q

P

i

=

{

QP

HM

,

i

+

Round

(

10

×

k

i

-

5

)

,

k

i

>

0.75

QP

HM

,

i

,

else

,

wherein QP HM,i is the quantization parameter of the current frame set in an original coder, and Round(⋅) is a rounding operator;

after a frame-level Lagrangian multiplier λ p is calculated through QP i , obtaining a Lagrangian multiplier λ n and a quantization parameter QP n for coding each Coding tree unit (CTU) of the CTUs in the current frame by the following formulas:

w

n

=

1

M

j

=

0

M

(

1

+

k

B

,

j

)

;

w

¯

=

1

N

n

=

1

N

w

n

;

W

n

=

W

n

w

¯

;

λ

n

=

λ

P

W

n

;

Q

P

n

=

4.2005

×

ln

(

λ

n

)

+

1

3

.7122

;

wherein M is a number of the 16×16 pixel blocks comprised in an nth CTU of the CTUs, N is a number of the CTUs in a coded frame, w n , w and W n are intermediate variables;

coding the each CTU in the current frame by using the Lagrangian multiplier λ n and the quantization parameter QP n , and outputting the code stream and storing the reconstructed image in the default way of the coder;

S 8 : determining whether the coded frame is a last frame of the video sequence, if the coded frame is the last frame of the video sequence, then ending the two-pass coding; if the coded frame is not the last frame of the video sequence, continuing to determine whether the coded frame is the last frame in a current GOP, if the coded frame is the last frame in the current GOP, then performing step S 2 , if the coded frame is not the last frame in the current GOP, performing step S 3 .

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 14, 2020
From: ZHU, CE; GUO, HONGWEI; LIU, YUYANG; YE, MAO
To: UNIVERSITY OF ELECTRONIC SCIENCE AND TECHNOLOGY OF CHINA
Reel/Frame 054643/0401 →
Priority Claims (1)
CN 201911292705.4 · Dec 16, 2019 · national
Continuity (1)
Related Publication 20210185318A1 · Jun 17, 2021