# US 12,003,743 B2 · Video stream decoding method and apparatus, terminal device, and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,003,743 B2
- Document ID: US12003743B2
- Status: Granted
- Kind: B2
- Application number: 17/500,884
- Filed: 2021-10-13
- Published: 2022-02-03
- Granted: 2024-06-04
- Earliest claimed: 2019-07-15
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Jiangyun Mao; Tao Yang; Zhibo Chen
- Web page: https://patentgrep.com/patent/US12003743B2

## CPC

- H04N 19/42: characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation (H04N19/635 takes precedence)
- G06T 1/20: Processor architectures; Processor configuration, e.g. pipelining
- H04N 7/181: {for receiving images from a plurality of remote sources}
- H04N 19/119: Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
- H04N 19/127: Prioritisation of hardware or computational resources
- H04N 19/156: Availability of hardware or computational resources, e.g. encoding based on power-saving criteria
- H04N 19/172: the region being a picture, frame or field
- H04N 19/179: the unit being a scene or a shot
- H04N 19/436: using parallelised computational arrangements
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

A video stream decoding method is provided. The video stream decoding method is performed by a terminal device. The method includes receiving a plurality of video streams from a monitoring device; generating a plurality of threads in a thread pool corresponding to a graphics processing unit (GPU); and transmitting, according to the plurality of threads, the plurality of video streams to the GPU for video decoding processing to obtain a plurality of pieces of decoded video data.

## Claims

### Claim 1

A video stream decoding method, performed by a terminal device, the video stream decoding method comprising:
receiving a plurality of video streams from a monitoring device;
generating a plurality of threads in a thread pool corresponding to a graphics processing unit (GPU), comprising:
obtaining a video stream quantity of the plurality of video streams; and
generating threads in the thread pool corresponding to the GPU, a quantity of the threads being the same as the video stream quantity; and
transmitting, according to the plurality of threads, the plurality of video streams to the GPU for video decoding processing to obtain a plurality of pieces of decoded video data.

### Claim 2 (depends on 1)

The video stream decoding method according to claim 1, wherein the transmitting, according to the plurality of threads, the plurality of video streams to the GPU for video decoding processing to obtain a plurality of pieces of decoded video data comprises:
allocating one thread in the plurality of threads for each video stream in the plurality of video streams in a one-to-one correspondence;
identifying a thread among the plurality of threads as a target thread, and inputting a target video stream into the GPU by using the target thread, the target video stream being a video stream corresponding to the target thread among the plurality of video streams; and
decoding the target video stream by using the GPU to obtain target decoded video data.

### Claim 3 (depends on 2)

The video stream decoding method according to claim 2, wherein the decoding the target video stream by using the GPU to obtain target decoded video data comprises:
sequentially using each frame of image in the target video stream as a target image, and decoding the target image by using the GPU; and
determining to frame-skip the target image when the target image does not comprise a preset type of object.

### Claim 4 (depends on 2)

The video stream decoding method according to claim 2, wherein the method further comprises:
restarting the target thread, inputting the target video stream into the GPU by reusing the target thread when the target video stream needs to be replayed, and decoding the target video stream by using the GPU to obtain the target decoded video data.

### Claim 5 (depends on 2)

The video stream decoding method according to claim 2, wherein the method further comprises:
collecting the target thread when decoding of the target video stream ends and the target video stream does not need to be replayed.

### Claim 6 (depends on 1)

The video stream decoding method according to claim 1, wherein the terminal device further comprises memories, and the method further comprises:
identifying respective memories corresponding to the plurality of pieces of decoded video data; and
outputting the plurality of pieces of decoded video data to the memories by using the GPU.

### Claim 7 (depends on 6)

The video stream decoding method according to claim 6, wherein the plurality of pieces of decoded video data comprise first decoded video data and second decoded video data, and the identifying respective memories corresponding to the plurality of pieces of decoded video data comprises: identifying a first memory corresponding to the first decoded video data; and identifying a second memory corresponding to the second decoded video data; and
the outputting the plurality of pieces of decoded video data to the memories by using the GPU comprises: outputting the first decoded video data to the first memory and outputting the second decoded video data to the second memory.

### Claim 8 (depends on 7)

The video stream decoding method according to claim 7, wherein the plurality of pieces of decoded video data comprises the first decoded video data and the second decoded video data.

### Claim 9 (depends on 7)

The video stream decoding method according to claim 7, wherein the plurality of pieces of decoded video data further comprises third decoded video data, and the identifying respective memories corresponding to the plurality of pieces of decoded video data further comprises: identifying a third memory corresponding to the third decoded video data; and
the outputting the plurality of pieces of decoded video data to the memories by using the GPU further comprises: outputting the third decoded video data to the third memory.

### Claim 10 (depends on 6)

The video stream decoding method according to claim 6, wherein the memories comprise at least one of a system memory, a shared memory, or a disk.

### Claim 11 (depends on 6)

The video stream decoding method according to claim 6, wherein the outputting the plurality of pieces of decoded video data to the memories by using the GPU comprises:
obtaining address codes of the memories corresponding to the plurality of pieces of decoded video data;
performing a memory map according to the address codes to determine target memories corresponding to the plurality of pieces of decoded video data; and
outputting the plurality of pieces of decoded video data to the target memories.

### Claim 12

A video stream decoding apparatus, comprising a memory and a processor, the memory storing computer-readable instructions, the computer-readable instructions, when executed by the processor, causing the processor to:
receive a plurality of video streams from a monitoring device;
generate a plurality of threads in a thread pool corresponding to a graphics processing unit (GPU), comprising:
obtaining a video stream quantity of the plurality of video streams; and
generating threads in the thread pool corresponding to the GPU, a quantity of the threads being the same as the video stream quantity; and
transmit, according to the plurality of threads, the plurality of video streams to the GPU for video decoding processing to obtain a plurality of pieces of decoded video data.

### Claim 13 (depends on 12)

The video stream decoding apparatus according to claim 12, wherein the processor is further configured to allocate one thread in the plurality of threads for each video stream in the plurality of video streams in a one-to-one correspondence; take a thread among the plurality of threads as a target thread, and input a target video stream into the GPU by using the target thread, the target video stream being a video stream corresponding to the target thread among the plurality of video streams; and decode the target video stream by using the GPU to obtain target decoded video data.

### Claim 14 (depends on 13)

The video stream decoding apparatus according to claim 13, wherein the processor is further configured to sequentially use each frame of image in the target video stream as a target image, and decode the target image by using the GPU; and determine to frame-skip the target image when the target image does not comprise a preset type of object.

### Claim 15 (depends on 13)

The video stream decoding apparatus according to claim 13, wherein the processor is further configured to restart the target thread, input the target video stream into the GPU by reusing the target thread, and decode the target video stream by using the GPU to obtain the target decoded video data when decoding of the target video stream ends and the target video stream needs to be replayed.

### Claim 16

A non-transitory computer readable storage medium storing computer-readable instructions, the computer-readable instructions, when executed by one or more processors, causing the one or more processors to perform operations of a video stream decoding method, the video stream decoding method comprising:
receiving a plurality of video streams from a monitoring device;
generating a plurality of threads in a thread pool corresponding to a graphics processing unit (GPU), comprising:
obtaining a video stream quantity of the plurality of video streams; and
generating threads in the thread pool corresponding to the GPU, a quantity of the threads being the same as the video stream quantity; and
transmitting, according to the plurality of threads, the plurality of video streams to the GPU for video decoding processing to obtain a plurality of pieces of decoded video data.
