IP Library Granted Patent US 12,597,225
Granted Patent B2
US 12,597,225 · App. 18/299,157 · Granted Apr 7, 2026

Image processing method and apparatus, electronic device, program, and readable storage medium

Inventors: Wensheng Cao (Shenzhen, CN); Wei Cao (Shenzhen, CN); Tangxi Chen (Shenzhen, CN); Lijun Yuan (Shenzhen, CN); Xiaojie Wang (Shenzhen, CN); Chong Zhang (Shenzhen, CN); Meng Zhai (Shenzhen, CN); Xingyuan Zhu (Shenzhen, CN)
Assignee: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
G06V10/54G06T1/20G06T1/60H04N19/186
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 12,597,225
App. No.
18/299,157
Granted
Apr 7, 2026
Kind
B2
Abstract

An image processing method includes: acquiring an image size of an image and original image data of the image; creating a first texture storage area according to the image size, and storing image data of the image into the first texture storage area; creating, according to the image size and a target encoding format, a second texture storage area for storing target image data to be generated, a color encoding format corresponding to the target image data being the target encoding format; and performing, through a shader called by a graphics processor (GPU), encoding format conversion on the original image data stored in the first texture storage area to generate the target image data corresponding to each texture coordinate in the second texture storage area, and storing the target image data corresponding into the each texture coordinate to a corresponding storage location in the second texture storage area.

Claims (72)

1 . An image processing method, performed in an electronic device, comprising:

acquiring an image size of an image and original image data of the image, a color encoding format corresponding to the original image data being a source encoding format;

creating a first texture storage area according to the image size, and storing image data of the image into the first texture storage area;

creating, according to the image size and a target encoding format, a second texture storage area for storing target image data to be generated, a color encoding format corresponding to the target image data being the target encoding format; and

performing, through a shader called by a graphics processor (GPU), encoding format conversion on the original image data stored in the first texture storage area to generate the target image data corresponding to each texture coordinate in the second texture storage area, and storing the target image data corresponding to each texture coordinate into a corresponding storage location in the second texture storage area, comprising, for a texture coordinate in the second texture storage area:

determining, through the shader called by the GPU, a first storage location corresponding to the texture coordinate in the second texture storage area;

determining, according to a storage location correspondence between the first texture storage area and the second texture storage area, a second storage location corresponding to the texture coordinate in the first texture storage area; and

computing, according to the original image data corresponding to the second storage location, the target image data corresponding to the texture coordinate in the second texture storage area, and storing the target image data into the first storage location.

2 . The method according to claim 1 , wherein:

the source encoding format is a red-green-blue (RGB) encoding format, and the target encoding format is a luminance-chrominance (YUV) encoding format; and

the second texture storage area comprises: a first storage area for storing a luminance component of the YUV encoding format and second storage area for storing a chrominance component of the YUV encoding format,

wherein the first storage area and the second storage area are continuous, each luminance component stored in the first storage area corresponds to one first chrominance component and one second chrominance component stored in the second storage area, and the target image data of the first chrominance component and the target image data of the second chrominance component are continuously stored in the second storage area.

3 . The method according to claim 2 , wherein:

a size of the first storage area is the same as the image size;

the second storage area comprises a first sub-area corresponding to the first chrominance component and a second sub-area corresponding to the second chrominance component, the first sub-area and the second sub-area having a same size;

the first storage area, the first sub-area, and the second sub-area have a same aspect ratio, and widths of the first sub-area and the second sub-area are determined by the target encoding format.

4 . The method according to claim 1 , wherein the determining, according to the storage location correspondence between the first texture storage area and the second texture storage area, the second storage location corresponding to the texture coordinate in the first texture storage area comprises:

determining a target storage area that the first storage location belongs in the second texture storage area, the target storage area being one of the first storage area and the second storage area;

converting, according to the storage location correspondence and the target storage area, the texture coordinate into a texture coordinate corresponding to the first texture storage area to obtain a converted texture coordinate; and

determining a second storage location of the converted texture coordinate in the first texture storage area.

5 . The method according to claim 4 , wherein the computing, according to the original image data corresponding to the second storage location, the target image data corresponding to the texture coordinate comprises:

computing, according to the original image data corresponding to the second storage location, the target image data corresponding to the texture coordinate in an image data conversion manner corresponding to the target storage area.

6 . The method according to claim 1 , wherein the performing, through the shader called by the GPU, the encoding format conversion on the original image data stored in the first texture storage area to generate the target image data corresponding to each texture coordinate of the second texture storage area comprises:

performing, through the shader called by the GPU and in a parallel computing manner, encoding format conversion on the original image data stored in the first texture storage area to obtain the target image data corresponding to each texture coordinate.

7 . The method according to claim 1 , wherein the image comprises a virtual scene image in a gaming scene, the electronic device is a user terminal, and the method further comprises:

reading target image data from the second texture storage area;

converting the read target image data into image data to be displayed in the source encoding format; and

displaying the virtual scene image based on the image data to be displayed.

8 . The method according to claim 1 , wherein the image comprises at least one virtual scene image in a cloud game, the electronic device is a cloud game server, and the method further comprises:

reading target image data from the second texture storage area corresponding to each image of the at least one virtual scene image;

performing image encoding processing on the read target image data to obtain a video stream; and

transmitting the video stream to a user terminal, so that the user terminal plays the video stream.

9 . An image processing apparatus, comprising: a processor and a memory, the processor and the memory being interconnected, wherein the memory is configured to store a computer program; and the processor is configured to perform:

acquiring an image size of an image and original image data of the image, a color encoding format corresponding to the original image data being a source encoding format;

creating a first texture storage area according to the image size, and storing image data of the image into the first texture storage area;

creating, according to the image size and a target encoding format, a second texture storage area for storing target image data to be generated, a color encoding format corresponding to the target image data being the target encoding format; and

performing, through a shader called by a graphics processor (GPU), encoding format conversion on the original image data stored in the first texture storage area to generate the target image data corresponding to each texture coordinate in the second texture storage area, and storing the target image data corresponding to each texture coordinate into a corresponding storage location in the second texture storage area, comprising, for a texture coordinate in the second texture storage area:

determining, through the shader called by the GPU, a first storage location corresponding to the texture coordinate in the second texture storage area;

determining, according to a storage location correspondence between the first texture storage area and the second texture storage area, a second storage location corresponding to the texture coordinate in the first texture storage area; and

computing, according to the original image data corresponding to the second storage location, the target image data corresponding to the texture coordinate in the second texture storage area, and storing the target image data into the first storage location.

10 . The apparatus according to claim 9 , wherein:

the source encoding format is a red-green-blue (RGB) encoding format, and the target encoding format is a luminance-chrominance (YUV) encoding format; and

the second texture storage area comprises: a first storage area for storing a luminance component of the YUV encoding format and a second storage area for storing a chrominance component of the YUV encoding format,

wherein the first storage area and the second storage area are continuous, each luminance component stored in the first storage area corresponds to one first chrominance component and one second chrominance component stored in the second storage area, and the target image data of the first chrominance component and the target image data of the second chrominance component are continuously stored in the second storage area.

11 . The apparatus according to claim 10 , wherein:

a size of the first storage area is the same as the image size;

the second storage area comprises a first sub-area corresponding to the first chrominance component and a second sub-area corresponding to the second chrominance component, the first sub-area and the second sub-area having a same size;

the first storage area, the first sub-area, and the second sub-area have a same aspect ratio, and widths of the first sub-area and the second sub-area are determined by the target encoding format.

12 . The apparatus according to claim 9 , wherein the determining, according to the storage location correspondence between the first texture storage area and the second texture storage area, the second storage location corresponding to the texture coordinate in the first texture storage area comprises:

determining a target storage area that the first storage location belongs in the second texture storage area, the target storage area being one of the first storage area and the second storage area;

converting, according to the storage location correspondence and the target storage area, the texture coordinate into a texture coordinate corresponding to the first texture storage area to obtain a converted texture coordinate; and

determining a second storage location of the converted texture coordinate in the first texture storage area.

13 . The apparatus according to claim 12 , wherein the computing, according to the original image data corresponding to the second storage location, the target image data corresponding to the texture coordinate comprises:

computing, according to the original image data corresponding to the second storage location, the target image data corresponding to the texture coordinate in an image data conversion manner corresponding to the target storage area.

14 . The apparatus according to claim 9 , wherein the performing, through the shader called by the GPU, the encoding format conversion on the original image data stored in the first texture storage area to generate the target image data corresponding to each texture coordinate of the second texture storage area comprises:

performing, through the shader called by the GPU and in a parallel computing manner, encoding format conversion on the original image data stored in the first texture storage area to obtain the target image data corresponding to each texture coordinate.

15 . The apparatus according to claim 9 , wherein the image comprises a virtual scene image in a gaming scene, the electronic device is a user terminal, and the method further comprises:

reading target image data from the second texture storage area;

converting the read target image data into image data to be displayed in the source encoding format; and

displaying the virtual scene image based on the image data to be displayed.

16 . The apparatus according to claim 9 , wherein the image comprises at least one virtual scene image in a cloud game, the electronic device is a cloud game server, and the method further comprises:

reading target image data from the second texture storage area corresponding to each image of the at least one virtual scene image;

performing image encoding processing on the read target image data to obtain a video stream; and

transmitting the video stream to a user terminal, so that the user terminal plays the video stream.

17 . A non-transitory computer-readable storage medium, wherein the computer-readable storage medium stores a computer program; and the computer program is executed by a processor to implement:

acquiring an image size of an image and original image data of the image, a color encoding format corresponding to the original image data being a source encoding format;

creating a first texture storage area according to the image size, and storing image data of the image into the first texture storage area;

creating, according to the image size and a target encoding format, a second texture storage area for storing target image data to be generated, a color encoding format corresponding to the target image data being the target encoding format; and

performing, through a shader called by a graphics processor (GPU), encoding format conversion on the original image data stored in the first texture storage area to generate the target image data corresponding to each texture coordinate in the second texture storage area, and storing the target image data corresponding to each texture coordinate into a corresponding storage location in the second texture storage area, comprising, for a texture coordinate in the second texture storage area:

determining, through the shader called by the GPU, a first storage location corresponding to the texture coordinate in the second texture storage area;

determining, according to a storage location correspondence between the first texture storage area and the second texture storage area, a second storage location corresponding to the texture coordinate in the first texture storage area; and

computing, according to the original image data corresponding to the second storage location, the target image data corresponding to the texture coordinate in the second texture storage area, and storing the target image data into the first storage location.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 12, 2026
From: CAO, WENSHENG; CAO, WEI; CHEN, TANGXI; YUAN, LIJUN; WANG, XIAOJIE; ZHANG, CHONG; ZHAI, MENG; ZHU, XINGYUAN
To: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
Reel/Frame 075065/0876 →
Priority Claims (1)
CN 202110655426.0 · Jun 11, 2021 · national
Continuity (2)
Continuation PCTCN2022094621 · May 24, 2022
Related Publication 20230252758A1 · Aug 10, 2023
References Cited (16)
US 5877770A · Hanaoka · 1999 [cited by examiner]
US 10467803B1 · Degtyarev et al. · 2019 [cited by applicant]
US 20040105653A1 · Horiuchi · 2004 [cited by examiner]
US 20050180643A1 · Okada · 2005 [cited by examiner]
US 20180310013A1 · Tanner · 2018 [cited by examiner]
US 20190250773A1 · Miyaki · 2019 [cited by examiner]
US 20210134024A1 · Chakrabarty · 2021 [cited by examiner]
CN 102800122A · 2012 [cited by applicant]
CN 106210883A · 2016 [cited by applicant]
CN 108154539A · 2018 [cited by applicant]
CN 110177287A · 2019 [cited by applicant]
CN 111093096A · 2020 [cited by applicant]
CN 113096233A · 2021 [cited by applicant]
China National Intellectual Property Administration (CNIPA) Office Action 1 for 202110655426.0 Jul. 20, 2021 9 Pages (including translation). [cited by applicant]
The World Intellectual Property Organization (WIPO) International Search Report for PCT/CN2022/094621 Jul. 27, 2022 13 Pages (including translation). [cited by applicant]
Unity-Technologies /com.unity.webrtc. URL:https://github.com/Unity-Technologies/com.unity.webrtc/blob/release/2.4.0-exp.3/Plugin˜/WebRTCPlugin/Codec/SoftwareCodec/SoftwareEncoder.cpp. [cited by applicant]