WO2016011886A1 - Method and apparatus for decoding image - Google Patents

Method and apparatus for decoding image Download PDF

Info

Publication number
WO2016011886A1
WO2016011886A1 PCT/CN2015/083270 CN2015083270W WO2016011886A1 WO 2016011886 A1 WO2016011886 A1 WO 2016011886A1 CN 2015083270 W CN2015083270 W CN 2015083270W WO 2016011886 A1 WO2016011886 A1 WO 2016011886A1
Authority
WO
WIPO (PCT)
Prior art keywords
decoding
gpu
cpu
image
terminal device
Prior art date
Application number
PCT/CN2015/083270
Other languages
French (fr)
Chinese (zh)
Inventor
何正军
陈国权
Original Assignee
阿里巴巴集团控股有限公司
何正军
陈国权
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司, 何正军, 陈国权 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2016011886A1 publication Critical patent/WO2016011886A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/436Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation using parallelised computational arrangements

Definitions

  • S102 Decompose the specified image into multiple decoding tasks.
  • the decoding capability information of the other processor is then calculated and saved locally on the current terminal device.
  • the data table local to the terminal device can be directly queried, and the decoding capability information of the CPU and the GPU when processing the image of the format is obtained, and the decoding task is performed. Allocated.
  • the case of different coding types in the same format is similar, and will not be described in detail here.
  • the plurality of decoding tasks obtained by the previous decomposition can be allocated to the CPU and the GPU for parallel processing.
  • the first number of decoding tasks may be allocated to the CPU according to the total number of decoding tasks and the decoding capability ratio
  • the second number of decoding tasks are allocated to the GPU, where the first number and the second number are The sum of numbers, etc.
  • the ratio between the first number and the second number can be as close as possible or equal to the decoding capability ratio between the CPU and the GPU to improve the accuracy of the synchronization.
  • the encoding type of the specified JPEG image may be acquired, and then determining whether the current terminal device has saved the CPU and the processing of the GPU when processing the encoding type JPEG image
  • the rate information proves that the encoding type image is decoded on the terminal device for the first time. Therefore, all decoding tasks can be assigned to the CPU, that is, all decoding operations of the JPEG image are all After the CPU completes, the task amount of the decoding task can be calculated and the time taken by the CPU to complete the decoding task is recorded.
  • a decoding request receiving unit 301 configured to receive a request for decoding a specified image

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

Disclosed are a method and apparatus for decoding an image. The method comprises: receiving a request for decoding a specified image; decomposing the specified image into a plurality of decoding tasks; determining decoding capability information about a central processing unit (CPU) and a graphics processing unit (GPU) of a current terminal device respectively when decoding the image; and allocating the plurality of decoding tasks to the CPU and the GPU for parallel processing according to a decoding capability ratio between the CPU and the GPU. By means of the present application, the efficiency of decoding an image can be improved.

Description

对图像进行解码的方法及装置Method and device for decoding images 技术领域Technical field
本申请涉及图像解码技术领域,特别是涉及对图像进行解码的方法及装置。The present application relates to the field of image decoding technologies, and in particular, to a method and apparatus for decoding an image.
背景技术Background technique
目前,在很多的移动终端应用程序中,对图像进行解码渲染也是经常用到的处理技术。尤其是淘宝、天猫等用于展示商品的移动应用来说,图片承载了商品非常重要的信息,因为它可以给客户提供非常直观、快捷的信息,而且可以从不同角度展示商品的概貌或者细节信息。但是,由于当前移动设备使用的CPU(一般是ARM)处理能力较PC机等还有一定的差距,再加上移动设备对耗电等方面具有较强的敏感性,因此,如何能够使移动终端应用迅速地将图像进行解码,成为了移动终端应用将其渲染到屏幕过程中非常关键的一环。Currently, in many mobile terminal applications, decoding and rendering of images is also a commonly used processing technique. Especially for mobile applications such as Taobao and Tmall, which display goods, the picture carries very important information of the goods, because it can provide customers with very intuitive and fast information, and can display the details or details of the goods from different angles. information. However, since the CPU (usually ARM) used by mobile devices currently has a certain processing gap compared with PCs, and the mobile device has strong sensitivity to power consumption, how can the mobile terminal be enabled? The application quickly decodes the image and becomes a critical part of the mobile terminal application rendering it to the screen.
基于上述原因,人们一直在寻找各种加速图像处理的方法,然而受到CPU本身在浮点计算能力上的限制,对于那些需要高密度计算的图像处理操作,并没有在处理性能与效率上有明显的进步。随着可编程图形处理器(GPU)在性能上的飞速发展,利用GPU加速图像处理的技术逐渐成为研究热点。GPU是一种专门用于进行图像处理的核心处理器,其相对于显卡的作用,就相当于CPU在整个终端设备中的作用。但是,现有技术中,使用GPU进行解码使得其加速的效率并不能很好地满足期望,主要体现在以下几个方面:For the above reasons, people have been looking for various methods for accelerating image processing. However, due to the limitation of the CPU's floating-point computing power, image processing operations that require high-density calculations are not obvious in processing performance and efficiency. improvement. With the rapid development of programmable graphics processing units (GPUs), the technology of using GPU to accelerate image processing has gradually become a research hotspot. The GPU is a core processor dedicated to image processing. Its function relative to the graphics card is equivalent to the role of the CPU in the entire terminal device. However, in the prior art, the use of the GPU for decoding makes its acceleration efficiency not well met the expectations, mainly in the following aspects:
第一,在GPU上开始进行处理之前,首先需要将数据其写入到GPU的内存上,同时,由于移动应用也无法获知显示时缓存的具体位置,因此,在GPU处理完成之后,CPU主机侧还需要将数据读回到CPU内存中。显而易见,在GPU上进行并行解码产生的加速增益的幅度会被数据输入、输出(IO)降低。First, before starting processing on the GPU, the data needs to be written to the GPU's memory first. At the same time, because the mobile application cannot know the specific location of the cache at the time of display, after the GPU processing is completed, the CPU host side You also need to read the data back into the CPU memory. Obviously, the magnitude of the acceleration gain produced by parallel decoding on the GPU is reduced by data input and output (IO).
第二,在将数据写入到GPU,触发GPU进行解码之后,CPU需要同步等待GPU解码完成,再将解码完成的数据读回到CPU内存。该过程会+导致GPU进行解码的时间内,CPU空闲地等待,最终导致CPU计算能力在这段处理时间上的浪费。 Second, after writing data to the GPU and triggering the GPU to decode, the CPU needs to wait for the GPU decoding to complete, and then read the decoded data back to the CPU memory. This process will cause the CPU to wait idle during the time that the GPU is decoding, eventually resulting in wasted CPU processing power in this processing time.
总之,如何进一步提高图像的解码速率,成为迫切需要本领域技术人员解决的技术问题。In summary, how to further increase the decoding rate of an image becomes a technical problem that is urgently needed by those skilled in the art.
发明内容Summary of the invention
本申请提供了对图像进行解码的方法及装置,能够提高图像的解码效率。The present application provides a method and apparatus for decoding an image, which can improve the decoding efficiency of the image.
本申请提供了如下方案:This application provides the following solutions:
一种对图像进行解码的方法,包括:A method of decoding an image, comprising:
接收对指定图像进行解码的请求;Receiving a request to decode a specified image;
将所述指定图像分解成多条解码任务;Decomposing the specified image into a plurality of decoding tasks;
确定当前终端设备的中央处理器CPU以及图形处理器GPU分别在解码图像时的解码能力信息;Determining decoding capability information of the central processor CPU of the current terminal device and the graphics processor GPU when decoding the image respectively;
根据所述CPU与GPU之间的解码能力比,将所述多条解码任务分配给所述CPU以及GPU进行并行处理。The plurality of decoding tasks are allocated to the CPU and the GPU for parallel processing according to a decoding capability ratio between the CPU and the GPU.
一种对图像进行解码的装置,包括:An apparatus for decoding an image, comprising:
解码请求接收单元,用于接收对指定图像进行解码的请求;a decoding request receiving unit, configured to receive a request to decode the specified image;
解码任务分解单元,用于将所述指定图像分解成多条解码任务;a decoding task decomposition unit, configured to decompose the specified image into a plurality of decoding tasks;
解码能力信息确定单元,用于确定当前终端设备的中央处理器CPU以及图形处理器GPU分别在解码图像时的解码能力信息;a decoding capability information determining unit, configured to determine decoding capability information of a central processing unit CPU and a graphics processing unit GPU of the current terminal device when decoding an image, respectively;
解码任务分配单元,用于根据所述CPU与GPU之间的解码能力比,将所述多条解码任务分配给所述CPU以及GPU进行并行处理。And a decoding task allocation unit, configured to allocate the plurality of decoding tasks to the CPU and the GPU for parallel processing according to a decoding capability ratio between the CPU and the GPU.
根据本申请提供的具体实施例,本申请公开了以下技术效果:According to a specific embodiment provided by the present application, the present application discloses the following technical effects:
通过本申请实施例,可以实现CPU与GPU的联合解码,对两者的解码任务进行分配时,是以各自的解码能力为依据进行分配,并且进一步可以是在CPU侧进行完初步的解码,将单幅图像分解成多条解码任务之后,再以解码任务为单位进行任务量的分配,这样,从任务分配之后,CPU与GPU需要执行的操作步骤都是相同的,只不过按照各自的解码能力分配了不同的任务量,因此,可以最大限度地保证两者解码的同步,避免出现其中一处理器解码完成 之后长时间等待另一处理器解码完成的情况,从而从整体上提高图像的解码效率。Through the embodiment of the present application, joint decoding of the CPU and the GPU can be implemented. When the decoding tasks of the two are allocated, the decoding is performed based on the respective decoding capabilities, and further, the preliminary decoding can be performed on the CPU side. After the single image is decomposed into multiple decoding tasks, the task amount is allocated in units of decoding tasks. Thus, after the task is allocated, the CPU and the GPU need to perform the same operation steps, but according to the respective decoding capabilities. Different tasks are allocated, so the synchronization of the two decodings can be guaranteed to the maximum, and one of the processors can be decoded. After a long wait for another processor to complete the decoding, the decoding efficiency of the image is improved as a whole.
当然,实施本申请的任一产品并不一定需要同时达到以上所述的所有优点。Of course, implementing any of the products of the present application does not necessarily require all of the advantages described above to be achieved at the same time.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments will be briefly described below. Obviously, the drawings in the following description are only some of the present application. For the embodiments, those skilled in the art can obtain other drawings according to the drawings without any creative work.
图1是本申请实施例提供的方法的流程图;1 is a flowchart of a method provided by an embodiment of the present application;
图2时本申请实施例提供的另一方法流程图;FIG. 2 is a flow chart of another method provided by an embodiment of the present application;
图3是本申请实施例提供的装置的示意图。FIG. 3 is a schematic diagram of an apparatus provided by an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application are within the scope of the present disclosure.
在本申请实施例中,为了提高图像解码的效率,可以采用CPU与GPU联合解码的方式。具体实现时,可以将单幅图像分解成多条解码任务,并且可以根据当前终端设备中CPU与GPU在解码图像时的解码能力比,进行解码任务的分配,这样可以尽可能的保障CPU与GPU在解码时的同步,避免其中一个处理器长时间等待另一个处理器对同一幅图像的解码结果的情形,充分利用CPU与GPU的图像解码能力,从而提高终端的的图像解码效率。下面对具体的实现方式进行详细介绍。In the embodiment of the present application, in order to improve the efficiency of image decoding, a method of jointly decoding the CPU and the GPU may be adopted. In a specific implementation, the single image can be decomposed into multiple decoding tasks, and the decoding task can be allocated according to the decoding capability ratio of the CPU and the GPU in the current terminal device when decoding the image, so that the CPU and the GPU can be guaranteed as much as possible. In the synchronization at the time of decoding, the situation in which one processor waits for the decoding result of the same image by another processor for a long time is avoided, and the image decoding capability of the CPU and the GPU is fully utilized, thereby improving the image decoding efficiency of the terminal. The specific implementation is described in detail below.
参见图1,本申请实施例首先提供了一种对图像进行解码的方法,该方法具体可以包括以下步骤: Referring to FIG. 1, the embodiment of the present application first provides a method for decoding an image, and the method may specifically include the following steps:
S101:接收对指定图像进行解码的请求;S101: Receive a request for decoding a specified image.
该步骤中接收到的请求可以是上层代码发送的,例如,浏览器等应用的前端代码等。具体的指定图像一般是指一幅图像,也即,本申请实施例中的各个步骤,描述的是对单张图像进行解码的过程,例如,某商品对象的某个描述图片等。The request received in this step may be sent by an upper layer code, for example, a front end code of an application such as a browser. The specific specified image generally refers to an image, that is, each step in the embodiment of the present application, and describes a process of decoding a single image, for example, a description picture of a certain commodity object.
在实际应用中,该方法可以应用于电子商务交易平台中对商品对象图片的展示过程,或者其他图片相关应用软件、程序等对图片的展示过程。在对商品对象图像进行展示的情况下,客户端可以向服务器发送商品对象的浏览请求,之后可以接收到服务器返回的包含有商品对象图片信息的页面信息,在显示该页面信息的过程中,就可以接收到上层代码对指定图像进行解码的请求,其中,该指定图像就可以是待显示的各个商品对象图片中的其中一个,在页面中包含有多个商品对象图片的情况下,每个商品对象图片都可以按照本申请实施例的方法进行显示。In practical applications, the method can be applied to the process of displaying the image of the product object in the e-commerce transaction platform, or the process of displaying the image by other image-related application software and programs. In the case of displaying the product object image, the client may send a browsing request of the product object to the server, and then may receive the page information of the product object image information returned by the server, and in the process of displaying the page information, The request for decoding the specified image by the upper layer code may be received, wherein the specified image may be one of each product object image to be displayed, and in the case that the page includes multiple product object images, each product The object picture can be displayed according to the method of the embodiment of the present application.
S102:将所述指定图像分解成多条解码任务;S102: Decompose the specified image into multiple decoding tasks.
在接收到解码请求之后,在本申请实施例中,可以首先对图像进行初步的解码,将其分解成多条解码任务。例如,对于JPEG格式的图像而言,可以首先进行MCU解码,这样,可以将一幅图像分解为多个MCU块行,每个MCU块行由多个MCU块组成。这样,就可以以MCU块行为单位在CPU与GPU之间进行解码任务分配。After receiving the decoding request, in the embodiment of the present application, the image may be firstly decoded and decomposed into multiple decoding tasks. For example, for an image of the JPEG format, MCU decoding may be performed first, so that one image may be decomposed into a plurality of MCU block lines, and each MCU block line is composed of a plurality of MCU blocks. In this way, decoding task assignment between the CPU and the GPU can be performed in units of MCU block behavior.
S103:确定当前终端设备的中央处理器CPU以及图形处理器GPU分别在解码图像时的解码能力信息;S103: determining decoding capability information of the central processing unit CPU and the graphics processing unit GPU of the current terminal device when decoding the image respectively;
所谓解码能力信息可以是由多种具体的参数来进行度量,例如,解码速率,或者在解码同一幅图像时的时间,等等。在实际应用中,一般会有多种CPU型号和多种GPU型号,具体到某个终端设备,可能搭载其中某个型号的CPU、某个型号的GPU,其中,CPU与GPU可能是相互独立,还可能集成在一起,等等。另外,不同的终端设备在其他硬件配置上可能也不相同,包括内存大小等等。因此,对于不同的终端设备而言,其CPU、GPU在解码图像时的解码能力上可能是各不相同的。本申请实施例根据当前终端设备的CPU、GPU解码图像时的解码能力,进行解码任务的分配。 The so-called decoding capability information may be measured by a plurality of specific parameters, such as a decoding rate, or a time when decoding the same image, and the like. In practical applications, there are generally a variety of CPU models and a variety of GPU models, specific to a terminal device, may be equipped with one of the models of the CPU, a certain type of GPU, where the CPU and GPU may be independent of each other, It may also be integrated, and so on. In addition, different terminal devices may be different in other hardware configurations, including memory size and the like. Therefore, for different terminal devices, the decoding ability of the CPU and GPU when decoding images may be different. The embodiment of the present application performs the allocation of the decoding task according to the decoding capability of the CPU and GPU of the current terminal device when decoding an image.
需要说明的是,实际应用中的图像一般有多个格式,例如,可以包括JPEG格式、jpg格式、tif格式、bmp格式等等。对于同一终端设备而言,其CPU、GPU在解码不同格式的图像时,可能会具有不同的解码能力,因此,在确定上述解码能力信息时,可以首先确定出指定图像的格式,然后确定当前终端设备的CPU以及GPU分别在解码该格式的图像时的解码能力信息,这样,后续用该信息进行解码任务的分配时,可以更好的实现两个处理器解码的同步。It should be noted that the image in the actual application generally has multiple formats, for example, may include a JPEG format, a jpg format, a tif format, a bmp format, and the like. For the same terminal device, the CPU and GPU may have different decoding capabilities when decoding images of different formats. Therefore, when determining the decoding capability information, the format of the specified image may be first determined, and then the current terminal is determined. The decoding capability information of the CPU and the GPU of the device when decoding the image of the format, respectively, so that the subsequent decoding of the decoding task by the information can better realize the synchronization of the decoding of the two processors.
另外,在同一格式的图像在具体的编码类型上还可能有多种,同一终端设备的CPU、GPU在解码同一图像格式下不同编码类型的图像时,也可能会表现出不同的解码能力。因此,为了进一步提高同步的精度,具体实现时,还可以首先确定出指定图像的格式,然后确定指定图像在该格式中的编码类型,之后可以确定当前终端设备的CPU以及GPU分别在解码该格式下该编码类型的图像时的解码能力信息,这样,就可以利用该信息在CPU与GPU之间进行解码任务的分配。例如,对于JPEG格式的图像而言,IDCT(反向离散余弦变换)方式有低速高精度整数方式、高速次精度整数方式以及快速浮点类型,Upsample又可以分为fullsize、h2v1、h2v2、h2v1_fancy以及h2v2_fancy等等,不同的IDCT、Upsample方式可以组合成多种具体的编码类型。同一CPU或者GPU对不同编码类型的JPEG图像也可能会体现出不同的解码能力,例如解码时的横向采样因子和纵向采样因子会影响IDCT和upsample的处理时间。这样,可以对于JPEG格式的图像而言,可以分配获取当前终端设备在解码具体编码类型的JPEG格式图像时的解码能力信息,并利用该信息进行解码任务的分配。In addition, there may be multiple types of images in the same format. The CPU and GPU of the same terminal device may also exhibit different decoding capabilities when decoding images of different encoding types in the same image format. Therefore, in order to further improve the accuracy of the synchronization, in a specific implementation, the format of the specified image may be first determined, and then the encoding type of the specified image in the format may be determined, and then the CPU and the GPU of the current terminal device may be respectively decoded in the format. The decoding capability information when the image of the encoding type is output, so that the information can be used to allocate the decoding task between the CPU and the GPU. For example, for JPEG format images, the IDCT (Inverse Discrete Cosine Transform) method has a low-speed high-precision integer method, a high-speed sub-precision integer method, and a fast floating-point type. Upsample can be further divided into fullsize, h2v1, h2v2, h2v1_fancy, and H2v2_fancy, etc., different IDCT, Upsample methods can be combined into a variety of specific coding types. The same CPU or GPU may also have different decoding capabilities for JPEG images of different encoding types. For example, the horizontal sampling factor and the vertical sampling factor during decoding may affect the processing time of IDCT and upsample. In this way, for the JPEG format image, the decoding capability information when the current terminal device decodes the JPEG format image of the specific encoding type can be allocated, and the information is used to perform the allocation of the decoding task.
其中,具体在获取当前终端设备的CPU、GPU的解码能力信息时,可以有多种实现方式,下面举例进行介绍。For example, when obtaining the decoding capability information of the CPU and GPU of the current terminal device, there are various implementation manners, which are described in the following examples.
在其中一种实现方式下,考虑到相同型号的终端设备,由于具有相同的硬件配置信息,例如相同型号的CPU、GPU等,其在解码图像时的解码能力一般是相同的。所以,可以预先通过测试等方式建立一个第一数据库,在该第一数据库中保存有多个终端设备的型号与其搭载的CPU以及GPU分别在解码图像时的解码能力信息之间的对应关系,因此,在当前终端设备中接收到解码请求时,就可以首先获取当前终端设备的型号,然后可以利用该型号在前述数据 库中查找到当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息。例如,在实际应用中,该第一数据库的结构可以如以下表1所示:In one implementation, considering the same type of terminal device, since it has the same hardware configuration information, such as the same model of CPU, GPU, etc., its decoding capability when decoding images is generally the same. Therefore, a first database may be established in advance by testing or the like, in which the correspondence between the model of the plurality of terminal devices and the decoding capability information of the CPU and the GPU when the image is decoded is stored in the first database, When receiving the decoding request in the current terminal device, the model of the current terminal device may be obtained first, and then the data may be used in the foregoing model. The library finds the decoding capability information of the CPU of the current terminal device and the GPU when decoding the image, respectively. For example, in practical applications, the structure of the first database can be as shown in Table 1 below:
表1Table 1
Figure PCTCN2015083270-appb-000001
Figure PCTCN2015083270-appb-000001
例如,终端设备型号可以包括iPhone5S 32G、三星S416G等等,在该表1中,用速率来表示解码能力,在实际应用中,也可以用其他参数来表示。For example, the terminal device model may include an iPhone 5S 32G, a Samsung S416G, etc. In the table 1, the decoding capability is expressed by a rate, and in actual applications, other parameters may also be used.
当然,该数据库中还可以保存有各个终端设备的CPU、GPU分别在解码各种格式的图像时对应的解码能力值。此时,第一数据库的结构可以如以下表2所示:Of course, the database may also store the decoding capability values corresponding to the CPU and GPU of each terminal device when decoding images of various formats. At this point, the structure of the first database can be as shown in Table 2 below:
表2Table 2
Figure PCTCN2015083270-appb-000002
Figure PCTCN2015083270-appb-000002
其中,具体的图像格式可以包括JPEG格式、jpg格式、tif格式、bmp格式等等。The specific image format may include a JPEG format, a jpg format, a tif format, a bmp format, and the like.
此外,还可以在第一数据库中保存各格式下不同的编码类型分别对应的解码能力信息,这里不再对具体第一数据库的结构进行介绍。In addition, the decoding capability information corresponding to different coding types in each format may be saved in the first database, and the structure of the specific first database is not introduced here.
需要说明的是,以上表1、表2所示,第一数据库中都是记录了各个终端设备的CPU以及GPU各自的解码能力取值,在实际应用中,由于实际用于进行解码任务分配的信息,是两者的解码能力之间的比值,因此,在第一数据库中也可以直接保存该比值,这样,通过查询该第一数据库,可以直接查询到当前终端设备中,CPU与GPU的解码能力比。例如,此时的第一数据库的结构可以如以下表3所示:It should be noted that, as shown in Table 1 and Table 2 above, the values of the decoding capabilities of the CPU and the GPU of each terminal device are recorded in the first database. In actual applications, the actual allocation is used for decoding task assignment. The information is the ratio between the decoding capabilities of the two. Therefore, the ratio can also be directly saved in the first database. Thus, by querying the first database, the current terminal device can be directly queried to decode the CPU and the GPU. Ability ratio. For example, the structure of the first database at this time can be as shown in Table 3 below:
表3table 3
Figure PCTCN2015083270-appb-000003
Figure PCTCN2015083270-appb-000003
类似的,也可以在数据库中保存各型号的终端设备在处理各格式的图像时,CPU与GPU的解码能力比值,例如,具体的第一数据库的结构可以如以下表4所示:Similarly, the ratio of the decoding capability of the CPU and the GPU when processing the images of each format by the terminal devices of each model can also be stored in the database. For example, the structure of the specific first database can be as shown in Table 4 below:
表4Table 4
Figure PCTCN2015083270-appb-000004
Figure PCTCN2015083270-appb-000004
Figure PCTCN2015083270-appb-000005
Figure PCTCN2015083270-appb-000005
当然,在实际应用中,具体到终端设备中,其CPU、GPU的解码能力可能不仅仅与型号等有关,还可以能与其内存占用情况等有关,因此,通过上述查表的方式获取解码能力信息时,可能并不能很准确的体现出具体的终端设备中CPU、GPU的解码能力。因此,在本申请实施例中,还可以在具体的终端设备中来获取CPU、GPU的解码能力信息。Of course, in practical applications, the decoding capability of the CPU and GPU may be related not only to the model but also to the memory usage of the terminal device. Therefore, the decoding capability information is obtained by the above table lookup method. At the same time, the decoding ability of the CPU and GPU in the specific terminal device may not be accurately reflected. Therefore, in the embodiment of the present application, the decoding capability information of the CPU and the GPU can also be obtained in a specific terminal device.
例如,在其中一种实现方式下,可以预先利用预置的图像对当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息进行测试,并保存测试结果,这样,具体在接收到一个编码请求之后,可以根据该保存的测试结果确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息。具体的,可以预先准备测试专用的JPEG图像(例如,在安装解码器时,该测试专用的JPEG图像可以随着安装包一起被下载到终端设备本地),之后可以在终端设备中,按照步骤S102所述的方式,将预置的图像分解成多条测试用解码任务,然后,分别单独使用CPU、GPU对该专用的JPEG图像进行解码,之后,可以根据全部解码任务的任务量以及各自解码所花费的时间,计算出两者的解码速率,这样,就可以将这种速率信息作为各自的解码能力信息保存在终端设备本地预置的数据表中。进而,在接收到具体的解码请求之后,就可以通过查询该数据表,获取到当前终端设备的CPU以及GPU在解码图像时的解码能力信息。当然,这种专用的JP图像还可以有多个,分别对应不同的格式,同一格式下还可以有多张专用的图像,分别对应不同的编码类型,在测试时,可以分别测试CPU、GPU分别对各个格式或者各个编码类型的图像的解码能力信息,并保存到终端设备中,之后在接收到具体的解码请求后,就可以利用这些在本机测试获取到的数据,来进行解码任务的分配了。For example, in one implementation manner, the decoding capability information of the CPU and the GPU of the current terminal device when decoding the image may be tested in advance using the preset image, and the test result is saved, so that an encoding is received. After the request, the decoding capability information of the current terminal device's CPU and the GPU when decoding the image may be determined according to the saved test result. Specifically, the test-dedicated JPEG image may be prepared in advance (for example, when the decoder is installed, the test-dedicated JPEG image may be downloaded to the terminal device together with the installation package), and then in the terminal device, according to step S102 In the manner described above, the preset image is decomposed into a plurality of test decoding tasks, and then the dedicated JPEG image is decoded by using the CPU and the GPU separately, and then, according to the task amount of each decoding task and the respective decoding stations. The time spent calculating the decoding rates of the two, so that the rate information can be saved as the respective decoding capability information in the data table preset locally by the terminal device. Further, after receiving the specific decoding request, the data of the current terminal device and the decoding capability information of the GPU when decoding the image can be obtained by querying the data table. Of course, there may be more than one dedicated JP image, which corresponds to different formats. In the same format, there may be multiple dedicated images, corresponding to different encoding types. In testing, the CPU and GPU may be tested separately. The decoding capability information of the images of the respective formats or the respective encoding types is saved in the terminal device, and after receiving the specific decoding request, the data acquired in the local test can be utilized to perform the decoding task allocation. It is.
另外,对于移动终端设备而言,如果需要下载额外的测试专用图像,并且额外运行测试程序,对于资源有限的移动终端设备而言,可能会使得移动终端设备的性能受到影响。为此,在本申请实施例中,还可以预先利用实际的解码请求中携带的图像,对当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息进行测试,并保存测试结果,这样,后续再受到新的解码请求时,就可以根据之前已经保存的测试结果确定当前终端设备的CPU以及GPU分别 在解码图像时的解码能力信息。In addition, for the mobile terminal device, if it is necessary to download an additional test-dedicated image and additionally run the test program, the performance of the mobile terminal device may be affected for a mobile terminal device with limited resources. Therefore, in the embodiment of the present application, the decoding capability information of the CPU and the GPU of the current terminal device when decoding the image is respectively tested by using the image carried in the actual decoding request, and the test result is saved, so that When a new decoding request is received, the CPU and GPU of the current terminal device can be determined according to the previously saved test results. Decoding capability information when decoding an image.
例如,在首次接收到解码请求时,由于当前终端设备中还没有获取到关于该设备中的CPU以及GPU在解码能力方面的任何信息,因此,可以在将当前请求中携带的图像分解成多条解码任务后,全部分配给其中一个处理器(例如CPU)进行解码,然后根据解码任务的任务量以及完成解码所花费的时间,计算出该处理器的解码能力信息,并保存到当前终端设备本地。第二次接收到解码请求时,可以在将当前请求中携带的图像分解成多条解码任务后,全部分配给另一个处理器(例如GPU)进行解码,然后根据解码任务的任务量以及完成解码所花费的时间,计算出该另一个处理器的解码能力信息,并保存在当前终端设备本地。这样,从第三次收到解码请求开始,就可以直接查询终端设备本地的数据表,获取CPU以及GPU的解码能力信息,并以此进行解码任务的分配了。For example, when the decoding request is received for the first time, since the current terminal device has not obtained any information about the decoding capability of the CPU and the GPU in the device, the image carried in the current request may be decomposed into multiple pieces. After decoding the task, all of them are allocated to one of the processors (for example, the CPU) for decoding, and then the decoding capability information of the processor is calculated according to the task amount of the decoding task and the time taken to complete the decoding, and is saved to the current terminal device locally. . When the decoding request is received for the second time, after the image carried in the current request is decomposed into multiple decoding tasks, all of them are allocated to another processor (for example, a GPU) for decoding, and then according to the task amount of the decoding task and decoding is completed. The time spent calculating the decoding capability information of the other processor is saved locally on the current terminal device. In this way, from the third time the decoding request is received, the local data table of the terminal device can be directly queried, and the decoding capability information of the CPU and the GPU is obtained, and the decoding task is allocated.
当然,在这种实现方式下,也可以分别按照不同的图像格式、同一格式下不同编码类型,进行解码能力测试。在首次接收到对某格式的图像的解码请求时,可以在将当前请求中携带的该格式的图像分解成多条解码任务后,全部分配给其中一个处理器(例如,CPU)进行解码,然后计算出该处理器的解码能力信息,并保存到当前终端设备本地。第二次接收到对该格式的图像的解码请求时,可以在将当前请求中携带的该格式的图像分解成多条解码任务后,全部分配给另一个处理器(例如,GPU)进行解码,然后计算出该另一个处理器的解码能力信息,并保存在当前终端设备本地。这样,从第三次收到该格式的图像的解码请求开始,就可以直接查询终端设备本地的数据表,获取CPU以及GPU在处理该格式的图像时的解码能力信息,并以此进行解码任务的分配了。对于同一格式下不同编码类型的情况也是类似的,这里不再详述。Of course, in this implementation mode, the decoding capability test may also be performed according to different image formats and different coding types in the same format. When the decoding request for an image of a certain format is received for the first time, the image of the format carried in the current request may be decomposed into a plurality of decoding tasks, all of which are allocated to one of the processors (for example, a CPU) for decoding, and then The decoding capability information of the processor is calculated and saved to the current terminal device local. When the decoding request of the image of the format is received for the second time, the image of the format carried in the current request may be decomposed into multiple decoding tasks, and all of the images are allocated to another processor (for example, a GPU) for decoding. The decoding capability information of the other processor is then calculated and saved locally on the current terminal device. In this way, from the third time that the decoding request of the image of the format is received, the data table local to the terminal device can be directly queried, and the decoding capability information of the CPU and the GPU when processing the image of the format is obtained, and the decoding task is performed. Allocated. The case of different coding types in the same format is similar, and will not be described in detail here.
S104:根据所述CPU与GPU之间的解码能力比,将所述多条解码任务分配给所述CPU以及GPU进行并行处理。S104: Allocate the multiple decoding tasks to the CPU and the GPU for parallel processing according to a decoding capability ratio between the CPU and the GPU.
在获取到CPU与GPU之间的解码能力比之后,就可以以此为依据,将之前分解得到的多条解码任务分配给CPU以及GPU进行并行处理。具体实现时,可以根据解码任务的总条数以及所述解码能力比,向CPU分配第一条数的解码任务,向GPU分配第二条数的解码任务,其中第一条数与第二条数之和等 于解码任务的总条数,第一条数与第二条数之间的比例可以尽可能与CPU、GPU之间的解码能力比相接近或相等,以提高同步的精度。After obtaining the decoding capability ratio between the CPU and the GPU, the plurality of decoding tasks obtained by the previous decomposition can be allocated to the CPU and the GPU for parallel processing. In a specific implementation, the first number of decoding tasks may be allocated to the CPU according to the total number of decoding tasks and the decoding capability ratio, and the second number of decoding tasks are allocated to the GPU, where the first number and the second number are The sum of numbers, etc. For the total number of decoding tasks, the ratio between the first number and the second number can be as close as possible or equal to the decoding capability ratio between the CPU and the GPU to improve the accuracy of the synchronization.
在将CPU中的解码完成后,可以从GPU中读回GPU的解码结果,并将CPU的解码结果与GPU的解码结果进行合并,得到合并的解码结果。并且进一步地,还可合并的结果返回。After the decoding in the CPU is completed, the decoding result of the GPU can be read back from the GPU, and the decoding result of the CPU is combined with the decoding result of the GPU to obtain a combined decoding result. And further, the combined results are returned.
在实际应用中,一般不太可能做到完全同步,这样,CPU在执行完解码之后,GPU有可能尚未完成解码,也有可能已经完成解码,因此,具体在从GPU中读回GPU的解码结果时,CPU可以尝试从GPU读回第二行数的各个MCU块行的解码结果。具体的,可以判断GPU是否已完成解码,如果是,则从GPU中读回GPU的解码结果,否则就可以等待,直到判断出GPU已完成解码时,从GPU中读回GPU对第二行数的MCU块行的解码结果。In practical applications, it is generally not possible to achieve full synchronization. In this way, after the CPU finishes decoding, the GPU may not have completed decoding, and may have completed decoding. Therefore, when reading back the decoding result of the GPU from the GPU. The CPU can attempt to read back the decoding result of each MCU block line of the second line number from the GPU. Specifically, it can be determined whether the GPU has completed decoding, and if so, the GPU decoding result is read back from the GPU, otherwise it can wait until the GPU has completed decoding, and the GPU reads back the second line from the GPU. The decoding result of the MCU block line.
具体在进行解码结果的合并时,主要就是将两者的解码结果按照既定的规则进行保存。所谓的既定的规则主要是根据分配给各自的解码任务在原图像中的位置来确定。因此,具体实现时,可以记录分配给CPU的解码任务与分配给GPU的解码任务在原始指定图像中的相对位置关系信息,这样,根据CPU的解码结果的保存地址以及该相对位置关系,就可以确定出GPU的解码结果的保存地址,并将GPU的解码结果保存到该保存地址,即可完成解码结果的合并。Specifically, when the decoding result is combined, the decoding result of the two is mainly saved according to a predetermined rule. The so-called established rules are mainly determined based on the positions assigned to the respective decoding tasks in the original image. Therefore, in a specific implementation, the relative position relationship information of the decoding task allocated to the CPU and the decoding task assigned to the GPU in the original specified image may be recorded, so that according to the saved address of the decoding result of the CPU and the relative positional relationship, The storage address of the GPU decoding result is determined, and the decoding result of the GPU is saved to the save address, and the decoding result is merged.
例如,假设某JPEG图像共有100个MCU块行,其中60行需要分配给CPU进行解码,40行需要分配给GPU进行解码,则在进行分配时,可以将前60行分配给CPU,后40行分配给GPU,这样,在CPU完成解码并将解码结果保存在某地址之后,可以确定出CPU解码结果保存的结束地址,读回GPU的解码结果后,可以以该结束地址的下一地址单位为起始地址,对GPU的解码结果进行保存,也即,CPU的解码结果与GPU的解码结果在保存地址上保持连续性,这样就实现了CPU与GPU解码结果的合并,合并后的解码结果就可以返回给上层代码,例如,返回给浏览器的显示模块进行渲染、显示等后续操作。For example, suppose a JPEG image has 100 MCU block lines, 60 of which need to be allocated to the CPU for decoding, and 40 lines need to be allocated to the GPU for decoding. When assigning, the first 60 lines can be allocated to the CPU, and the last 40 lines. Assigned to the GPU, so that after the CPU completes the decoding and saves the decoding result in an address, the end address of the CPU decoding result can be determined. After reading back the decoding result of the GPU, the next address unit of the end address can be The starting address is used to save the decoding result of the GPU, that is, the decoding result of the CPU and the decoding result of the GPU are kept in the storage address, thus realizing the combination of the decoding result of the CPU and the GPU, and the combined decoding result is Can be returned to the upper layer code, for example, returned to the browser's display module for rendering, display and other subsequent operations.
为了便于理解,下面的实施例二中,以JPEG图像的解码为例,对本申请 实施例进行进一步详细的介绍。For ease of understanding, in the following second embodiment, taking the decoding of the JPEG image as an example, the present application The examples are described in further detail.
首先对JPEG图像解码的基本操作步骤进行简单的介绍。在进行JPEG图像解码时,首先按照JPEG文件数据存储方式,把要解码的文件的相关信息一一读出,为接下来的解码工作做好准备。由于图像数据流是由MCU组成,而MCU是用数据单元和颜色分量构成,图像数据流是以位(bit)为单位存储信息的,并且内部的数据都是在编码时通过正向离散余弦变换(FDCT)进行时空域向频率域变换而得到的结果,因此,解码时主要就包括以下几个步骤:First, a brief introduction to the basic operation steps of JPEG image decoding is given. When performing JPEG image decoding, first, the related information of the file to be decoded is read one by one according to the JPEG file data storage method, and the next decoding operation is prepared. Since the image data stream is composed of MCUs, and the MCU is composed of data units and color components, the image data stream stores information in units of bits, and the internal data is encoded by forward discrete cosine transform. (FDCT) performs the conversion of the space-time domain to the frequency domain. Therefore, the decoding mainly includes the following steps:
首先需要对JPEG图像进行MCU解码,将JPEG图像解码成若干个MCU块行,每个MCU块行由多个MCU块组成。First, MCU decoding is required for the JPEG image, and the JPEG image is decoded into a plurality of MCU block lines, and each MCU block line is composed of a plurality of MCU blocks.
之后,由于文件中的数据是在编码时通过正向离散余弦变换(FDCT)进行时空域向频率域变换而得到的结果,所以解码时就需要将其反向离散余弦变换(IDCT),也就是把颜色分量单元矩阵中的频率域数值向时空域转换,并且,原来的频率域的矩阵大小为8*8,则经过反向离散余弦变换后,时空域的矩阵仍然是8*8。Then, since the data in the file is the result of transforming the space-time domain to the frequency domain by forward discrete cosine transform (FDCT) at the time of encoding, it is necessary to inverse discrete cosine transform (IDCT) when decoding, that is, The frequency domain values in the color component unit matrix are converted to the space-time domain, and the matrix size of the original frequency domain is 8*8. After the inverse discrete cosine transform, the matrix of the space-time domain is still 8*8.
IDCT之后,还需要进行上采样(upsample)。After IDCT, upsample is also required.
最后,要在屏幕上显示图像,就需要以RGB模式表示图像的颜色。所以,解码时需要把YCrCb模式向RGB模式转换,为便于描述,将该步骤称为YCC2RGB。Finally, to display an image on the screen, you need to represent the color of the image in RGB mode. Therefore, the YCrCb mode needs to be converted to the RGB mode during decoding. For convenience of description, this step is referred to as YCC2RGB.
一般的JPEG图像解码都是包括上述几个主要步骤。在本申请实施例中,采用CPU与GPU联合解码的方式,也即对于同一解码任务,由CPU与GPU来共同完成,各自分担解码任务中的一部分。但是具体解码步骤,仍然是包括上述几个步骤,并且具体每个步骤中的具体实现都不属于本申请实施例的重点,因此,都将不再详述,但是,关于如何进行解码任务的分配,以最终达到最大程度地提高解码效率的目的属于本申请实施例的重点内容,因此,将对该内容进行详细介绍。General JPEG image decoding involves several major steps described above. In the embodiment of the present application, the method of jointly decoding the CPU and the GPU, that is, for the same decoding task, is jointly performed by the CPU and the GPU, and each part of the decoding task is shared. However, the specific decoding steps are still included in the above steps, and the specific implementation in each step is not the focus of the embodiment of the present application. Therefore, no detailed description will be made, but how to perform the decoding task allocation. The purpose of finally achieving the maximum improvement of decoding efficiency belongs to the key content of the embodiment of the present application, and therefore, the content will be described in detail.
参见图2,在对JPEG图像进行解码时,可以包括以下步骤: Referring to FIG. 2, when decoding a JPEG image, the following steps may be included:
S201:接收对指定JPEG图像进行解码的请求;S201: Receive a request for decoding a specified JPEG image;
S202:对所述指定JPEG图像进行MCU解码,得到多个MCU块行,其中,每个MCU块行由多个MCU块组成;S202: performing MCU decoding on the specified JPEG image to obtain multiple MCU block rows, where each MCU block row is composed of multiple MCU blocks;
接收到解码请求之后,可以首先在CPU中对该图像进行MCU解码,全部的MCU解码操作都是在CPU中进行。CPU解码之后,可以得到多个MCU块行,每个MCU块行由多个MCU块组成。这样,就可以以MCU块行为单位在CPU与GPU之间进行解码任务分配。其中,每个MCU块行中具体包括的MCU块的数量,一般是由具体图像的高度、宽度以及横向和纵向采样因子等因素决定的。After receiving the decoding request, the image can be first MCU decoded in the CPU, and all MCU decoding operations are performed in the CPU. After the CPU decodes, multiple MCU block rows can be obtained, and each MCU block row is composed of multiple MCU blocks. In this way, decoding task assignment between the CPU and the GPU can be performed in units of MCU block behavior. The number of MCU blocks specifically included in each MCU block row is generally determined by factors such as the height and width of the specific image and the horizontal and vertical sampling factors.
需要说明的是,在本申请实施例中,解码任务分配的最小粒度是MCU块行,这是因为在GPU中需要进行upsample(上采样)的操作,如果进行处理的数据不是完整的MCU块行,会导致在GPU进行上采样计算的失败。It should be noted that, in the embodiment of the present application, the minimum granularity of the decoding task allocation is an MCU block row, because an upsample (upsampling) operation is required in the GPU, if the processed data is not a complete MCU block row. Will cause a failure in the upsampling calculation on the GPU.
S203:确定当前终端设备的CPU以及GPU分别在解码JPEG图像时的解码能力信息;S203: Determine decoding capability information of the current terminal device CPU and the GPU when decoding the JPEG image respectively;
如实施例一中所述,在确定解码能力信息时,可以有多种方式,其中包括查询预先建立的数据库,或者,使用预置的测试专用图像进行测试,或者,在实际的解码过程中进行测试,等等。在该实施例二中,主要针对在实际解码过程中进行测试的方式下,一种具体的实现方式进行详细介绍。As described in the first embodiment, when determining the decoding capability information, there may be multiple ways, including querying a pre-established database, or using a preset test-specific image for testing, or performing in an actual decoding process. Testing, and more. In the second embodiment, a specific implementation manner is mainly described in the manner of testing in the actual decoding process.
具体的,在接收到对某指定JPEG图像进行解码的请求时,可以获取该指定JPEG图像的编码类型,然后判断当前终端设备中是否已保存有CPU以及GPU在处理该编码类型JPEG图像时的处理速率信息,如果两者都还没有,则证明是首次在该终端设备上对该编码类型的图像解码,因此,可以将全部解码任务分配给CPU,也即该JPEG图像的全部解码操作全部都在CPU上完成,之后可以计算此次解码任务的任务量,并记录CPU完成该解码任务所花费的时间。需要说明的是,由于MCU解码的工作更适合在CPU上进行,因此,在本申请实施例中,后续在使用CPU与GPU联合解码时,可以是在CPU上完成全部的MCU解码操作之后,再向CPU和GPU分配后续的任务。因此,在这里在计算CPU的任务量以及所花费的时间时,都可以是从完成MCU解码之后开始计算,也即,是从完成MCU解码开始到完成全部该解码任务的任 务量以及所花费的时间。之后,根据该任务量与所花费时间之间的比例,就可以计算出CPU在解码该编码类型JPEG图像时的解码速率,并作为CPU在解码该编码类型的JPEG图像时的解码能力信息在当前终端设备中保存。需要说明的是,对于该JPEG图像,在使用CPU进行解码之后,就可以将解码结果返回,后续再接收到其他的解码请求时,如果发现仍然是该编码类型的JPEG图像,则可以直接根据已经保存的信息获取到当前终端设备中的CPU在解码该类型的JPEG图像时的处理速率。Specifically, when receiving the request for decoding a specified JPEG image, the encoding type of the specified JPEG image may be acquired, and then determining whether the current terminal device has saved the CPU and the processing of the GPU when processing the encoding type JPEG image The rate information, if both are not yet, proves that the encoding type image is decoded on the terminal device for the first time. Therefore, all decoding tasks can be assigned to the CPU, that is, all decoding operations of the JPEG image are all After the CPU completes, the task amount of the decoding task can be calculated and the time taken by the CPU to complete the decoding task is recorded. It should be noted that, since the MCU decoding work is more suitable for the CPU, in the embodiment of the present application, after the CPU and the GPU are jointly decoded, the MCU decoding operation may be completed on the CPU. Assign subsequent tasks to the CPU and GPU. Therefore, when calculating the task amount of the CPU and the time spent here, the calculation may be started after the completion of the MCU decoding, that is, from the completion of the MCU decoding to the completion of all the decoding tasks. Traffic and time spent. Then, according to the ratio between the task amount and the elapsed time, the decoding rate of the CPU when decoding the encoding type JPEG image can be calculated, and the decoding capability information of the CPU when decoding the JPEG image of the encoding type is currently Saved in the terminal device. It should be noted that, for the JPEG image, after decoding by using the CPU, the decoding result can be returned, and when another decoding request is received later, if it is found that the JPEG image of the encoding type is still, it can be directly based on the already The saved information acquires the processing rate when the CPU in the current terminal device decodes the JPEG image of the type.
如果在接收到对某指定JPEG图像进行解码的请求,并获取到该图像的编码类型后,发现当前终端设备中仅保存有CPU在对该编码类型的JPEG图像进行解码时的处理速率信息,则证明是第二次在该终端设备中对该编码类型的JPEG图像进行解码。因此,可以使用GPU对该图像进行解码,以测试GPU对该编码类型的JPEG图像进行解码时的处理速率。但在具体实现时,由于CPU更适合进行MCU解码操作,因此,在本申请实施例后续提供的CPU与GPU联合解码的优选方案中,MCU解码操作也全部都是在CPU中来完成。因此,在进行测试时,可以如下进行:首先在CPU中对当前指定JPEG图像进行MCU解码,然后将MCU解码结果发送到GPU,以便GPU在MCU解码结果基础上进行后续的解码操作,包括IDCT、upsample、YCC2RGB等。在GPU解码完成后,CPU再将GPU解码结果读回,然后以计算分配给GPU的解码任务的任务量,并记录GPU执行解码过程所花费的时间;另外,对GPU上的解码时间的测试时,还可加上将MCU解码输出数据写入到GPU内存的时间和最后将解码后的RGB数据读回到CPU内存的IO时间,也就是说,可以计算将解码任务发送给GPU所花费的时间、GPU执行解码过程所花费的时间,以及从GPU读回解码结果所花费的时间之和,然后,根据分配给GPU的解码任务的任务量以及前述时间之和,计算出GPU在解码该编码类型JPEG图像时的处理速率,并作为GPU在解码该编码类型的JPEG图像时的解码能力信息在当前终端设备中保存。If, after receiving the request for decoding a specified JPEG image and obtaining the encoding type of the image, it is found that only the current terminal device stores the processing rate information when the CPU decodes the JPEG image of the encoding type, It is proved that the JPEG image of the encoding type is decoded in the terminal device for the second time. Therefore, the image can be decoded using the GPU to test the processing rate of the GPU when decoding the JPEG image of the encoding type. However, in a specific implementation, the CPU is more suitable for the MCU decoding operation. Therefore, in the preferred scheme of jointly decoding the CPU and the GPU provided by the embodiment of the present application, the MCU decoding operations are all completed in the CPU. Therefore, when testing, the following may be performed: first, performing MCU decoding on the currently specified JPEG image in the CPU, and then transmitting the MCU decoding result to the GPU, so that the GPU performs subsequent decoding operations based on the MCU decoding result, including IDCT, Upsample, YCC2RGB, etc. After the GPU decoding is completed, the CPU reads back the GPU decoding result, and then calculates the task amount of the decoding task allocated to the GPU, and records the time taken by the GPU to perform the decoding process; in addition, when testing the decoding time on the GPU It can also add the time to write the MCU decoded output data to the GPU memory and finally the IO time of reading the decoded RGB data back to the CPU memory, that is, the time taken to send the decoding task to the GPU can be calculated. And the time taken by the GPU to perform the decoding process and the time taken to read back the decoding result from the GPU, and then, according to the task amount of the decoding task allocated to the GPU and the sum of the foregoing times, calculate that the GPU is decoding the encoding type. The processing rate at the time of the JPEG image, and the decoding capability information when the GPU decodes the JPEG image of the encoding type is saved in the current terminal device.
这样,后续再收到关于该编码类型的JPEG图像的解码请求时,就可以直接从当前终端设备中读取出CPU、GPU在解码该编码类型的JPEG图像时的处理速率信息了。 In this way, when the decoding request for the JPEG image of the encoding type is subsequently received, the processing rate information of the CPU and the GPU when decoding the JPEG image of the encoding type can be directly read from the current terminal device.
也就是说,通过上述方式,对于各种编码类型的JPEG图像而言,在前两次进行解码时,都是单独使用CPU、GPU进行解码,以用于测试各自的解码能力,之后再接收到新的JPEG图像时,就可以通过从终端设备中查询的方式来获取CPU、GPU的解码处理速率信息。That is to say, in the above manner, for the JPEG images of various encoding types, when decoding is performed twice before, the CPU and the GPU are separately used for decoding, so as to test the respective decoding capabilities, and then receive them. When a new JPEG image is obtained, the decoding processing rate information of the CPU and the GPU can be obtained by querying from the terminal device.
S204:根据所述MCU块行的总行数以及所述预先获取到的速率比,分别为所述CPU以及GPU分配解码任务,其中,所述CPU的解码任务包括第一行数的MCU块行,GPU的解码任务包括第二行数的MCU块行;S204: The decoding task is allocated to the CPU and the GPU according to the total number of rows of the MCU block row and the pre-acquired rate ratio, where the decoding task of the CPU includes the MCU block row of the first row number. The decoding task of the GPU includes a second row of MCU block lines;
在得到jpeg图片的所有MCU块行之后,可以查询当前终端设备的CPU、GPU的解码速率比,当然,还可以首先确定出当前指定JPEG图像的编码类型,然后查询出该编码类型下CPU、GPU的解码速率比。然后可以根据MCU块行的总行数以及该解码速率比,分别为CPU以及GPU分配解码任务,其中,CPU的解码任务包括第一行数的MCU块行,GPU的解码任务包括第二行数的MCU块行。第一行数与第二行数之和等于MCU块行的总行数,第一行数及第二行数的具体数值就是根据该总行数以及前述解码速率比例确定出来的。例如,在理想的状态下,第一行数与第二行数之比可以刚好等于CPU与GPU之间的解码速率比。当然,在实际应用中,由于总行数不一定能够被整除,因此,第一行数与第二行数之比尽量接近CPU与GPU之间的解码速率比即可。例如,假设CPU与GPU之间的解码速率比为2:1,MCU块行的总行数是90行,则直接将第一行数确定为60,第二行数确定为30即可,但是,如果MCU块行的总行数是91行,由于该行数不能被3整除,因此,可以将第一行数确定为60,第二行数确定为31,或者,第一行数确定为61,第二行数确定为30,等等。After obtaining all the MCU block lines of the jpeg picture, the decoding rate ratio of the CPU and GPU of the current terminal device can be queried. Of course, the encoding type of the currently specified JPEG image can be determined first, and then the CPU and GPU of the encoding type are queried. The decoding rate ratio. Then, the decoding task can be allocated to the CPU and the GPU according to the total number of rows of the MCU block row and the decoding rate ratio, wherein the decoding task of the CPU includes the MCU block row of the first row number, and the decoding task of the GPU includes the second row number. MCU block line. The sum of the first row number and the second row number is equal to the total number of rows of the MCU block row, and the specific values of the first row number and the second row number are determined according to the total number of rows and the aforementioned decoding rate ratio. For example, in an ideal state, the ratio of the first row to the second row may be exactly equal to the decoding rate ratio between the CPU and the GPU. Of course, in practical applications, since the total number of rows may not be divisible, the ratio of the first row to the second row is as close as possible to the decoding rate ratio between the CPU and the GPU. For example, assuming that the decoding rate ratio between the CPU and the GPU is 2:1, and the total number of rows of the MCU block line is 90 lines, the first line number is directly determined to be 60, and the second line number is determined to be 30, however, If the total number of lines of the MCU block line is 91 lines, since the number of lines cannot be divisible by 3, the first line number can be determined to be 60, the second line number is determined to be 31, or the first line number is determined to be 61. The second line number is determined to be 30, and so on.
需要说明的是,在分配解码任务时,一般可以根据各块行在原图像中的位置来进行。例如,在CPU与GPU之间的解码速率比为2:1的情况下,可以将前三分之二的块行分配给CPU,后三分之一的快行分配给GPU,这样,后续在进行解码结果的合并时,直接将GPU的解码结果保存在CPU解码结果所在的地址之后即可。It should be noted that when assigning a decoding task, generally, the position of each block in the original image can be performed. For example, in the case where the decoding rate ratio between the CPU and the GPU is 2:1, the first two-thirds of the block lines can be allocated to the CPU, and the last third of the fast lines are allocated to the GPU, so that the subsequent When merging the decoding results, the GPU decoding result is directly saved after the address where the CPU decoding result is located.
S205:以所述第二行数的MCU块行为参数,以非阻塞方式向所述GPU 发送解码请求,以便所述GPU对所述第二行数的MCU块行进行解码;S205: The GPU is in a non-blocking manner by using the MCU block behavior parameter of the second row number. Transmitting a decoding request, so that the GPU decodes the MCU block row of the second row number;
在确定了需要由GPU进行解码的MCU块行之后,就可以将这些块行发送给GPU,也即以该第二行数的块行为参数,向GPU发送解码请求。需要说明的是,具体在向GPU发送解码请求时,可以以所述第二行数为依据,配置GPU的在不同维度上的工作项的具体数量(具体会因不同的GPU的编程平台的变化而变化,目前主要有基于CUDA或OpenCL这两个)。另外需要说明的是,GPU是在已经进行了MCU解码得到了MCU块行之后的基础上进行后续的解码工作,主要包括IDCT、upsample、YCC2RGB等。其中,发送给GPU的解码请求需要是一种非阻塞式的请求,这样,CPU侧的解码器在发送完该请求之后,不需要等到GPU返回响应,就可以继续执行后续的操作,也即,对第一行数的MCU块行进行解码,并且也是在MCU解码之后,在MCU块行的基础上,执行后续的IDCT、upsample、YCC2RGB等解码操作。也就是说,从CPU完成MCU解码,为CPU和GPU分配了后续的解码任务之后,CPU与GPU需要执行解码的步骤流程都是相同的,这样,由于又是按照各自的解码处理速率进行的任务量分配,因此,可以最大限度的保证CPU与GPU的同步,也即,尽量使得CPU在完成对第一行数的MCU块行解码完成的同时,GPU也对第二行数的MCU块行完成了解码,各自都不需要花费较长时间等待对方完成解码。After the MCU block lines that need to be decoded by the GPU are determined, the block lines can be sent to the GPU, that is, the decoding request is sent to the GPU with the block behavior parameter of the second line number. It should be noted that, when sending a decoding request to the GPU, the specific number of work items of the GPU in different dimensions may be configured based on the second line number (specifically, the programming platform of different GPUs changes) And the change, currently mainly based on CUDA or OpenCL two). In addition, it should be noted that the GPU performs subsequent decoding operations after the MCU decoding has been performed to obtain the MCU block line, and mainly includes IDCT, upsample, YCC2RGB, and the like. The decoding request sent to the GPU needs to be a non-blocking request, so that the decoder on the CPU side can continue to perform subsequent operations after the request is sent, without waiting for the GPU to return a response, that is, The MCU block line of the first line number is decoded, and after the MCU decoding, subsequent decoding operations such as IDCT, upsample, YCC2RGB, and the like are performed on the basis of the MCU block line. That is to say, after the MCU decoding is completed from the CPU, and the subsequent decoding tasks are allocated to the CPU and the GPU, the flow of steps required for the CPU and the GPU to perform decoding is the same, so that the tasks are performed according to the respective decoding processing rates. Quantity allocation, therefore, can maximize the synchronization of the CPU and GPU, that is, try to make the CPU complete the decoding of the MCU block row of the first row, while the GPU also completes the MCU block row of the second row. Knowing the codes, each does not need to take a long time to wait for the other party to complete the decoding.
另外需要说明的是,在MCU解码后的各个步骤中,IDCT一般是最为繁琐和复杂的步骤,为此,在本申请实施例中,在GPU中,针对每一个MCU块都可以同时使用多个线程进行IDCT变换,为此,还可以将每个MCU块进行分组,例如,由于单个MCU矩阵的宽是Hmax*8像素,高是Vmax*8像素,同时,每个MCU又分为若干个数据单元,数据单元的大小一般为8*8,因此可以将每个数据单元分成8个组,每个组8个数据,这样,在GPU中,可以将8组数据分配到8个不同的线程进行同步的IDCT(为保证最优的内存访问效率,一般需要将一个MCU块的8组数据分配给同一个工作组的不同线程进行解码)。但是,考虑到GPU的主要优势在于解码的过程,对于如何进行数据的分组、后续IDCT结果保存地址的计算等而言,都是GPU的弱项,为此,在本申请实施例中,在CPU侧的解码器确定出需要将哪些MCU块行分配给 GPU之后,还可以首先将各个MCU块进行分组,并且,还可以为每个分组计算出一个地址偏移量,这样,在向GPU发送解码请求时,可以将各个MCU块的分组结果以及各组对应的地址偏移量一起发送给GPU。这样,GPU在具体进行解码时,将各个分组的数据分配给各个线程,进行IDCT变换,并且将每组数据的IDCT计算结果按照各自对应的地址偏移量进行保存即可,不需要再重新进行地址计算,提供GPU的解码效率。在GPU对各个MCU块执行完IDCT变换之后,就可以进行后续的upsample、YCC2RGB计算。It should be noted that IDCT is generally the most cumbersome and complicated step in each step after the MCU is decoded. For this reason, in the embodiment of the present application, in the GPU, multiple MCU blocks can be used simultaneously. The thread performs IDCT transformation. For this reason, each MCU block can also be grouped. For example, since the width of a single MCU matrix is Hmax*8 pixels, the height is Vmax*8 pixels, and each MCU is divided into several data. Units, data units are typically 8*8 in size, so each data unit can be divided into 8 groups of 8 data per group, so that in the GPU, 8 sets of data can be distributed to 8 different threads. Synchronous IDCT (To ensure optimal memory access efficiency, it is generally necessary to allocate 8 sets of data of one MCU block to different threads of the same workgroup for decoding). However, in view of the fact that the main advantage of the GPU is the decoding process, it is a weakness of the GPU for how to perform data grouping, calculation of the subsequent IDCT result storage address, and the like. For this reason, in the embodiment of the present application, on the CPU side Decoder determines which MCU block rows need to be assigned to After the GPU, each MCU block can also be first grouped, and an address offset can also be calculated for each packet, so that when a decoding request is sent to the GPU, the grouping result of each MCU block and each group can be The corresponding address offset is sent to the GPU together. In this way, when specifically decoding, the GPU allocates data of each packet to each thread, performs IDCT conversion, and saves the IDCT calculation result of each group of data according to the corresponding address offset, and does not need to be re-executed. Address calculation, providing GPU decoding efficiency. After the GPU performs IDCT transformation on each MCU block, subsequent upsample and YCC2RGB calculations can be performed.
S206:在CPU中对所述第一行数的MCU块行进行解码;S206: Decode, in the CPU, the MCU block row of the first row number;
如前文所述,在向GPU发送了解码请求之后,CPU就可以对第一行数的MCU块行进行解码,具体需要执行的操作也是IDCT、upsample、YCC2RGB这几个步骤的主要操作。As described above, after sending a decoding request to the GPU, the CPU can decode the MCU block row of the first row number, and the specific operations that need to be performed are also the main operations of the steps of IDCT, upsample, and YCC2RGB.
S207:在将所述CPU中的解码完成后,从所述GPU中读取GPU的解码结果;S207: After decoding the CPU is completed, reading a decoding result of the GPU from the GPU.
S208:将所述CPU的解码结果与所述GPU的解码结果进行合并,得到合并后的解码结果。S208: Combine the decoding result of the CPU with the decoding result of the GPU to obtain a combined decoding result.
在读回GPU的解码结果之后,就可以与CPU的解码结果进行合并,这样,就可以得到合并后的解码结果,并且可进一步将合并后的解码结果返回给上层代码。具体在进行解码结果的读回以及合并操作时,可以参见实施例一中步骤S104的介绍,这里不再详述。After reading back the decoding result of the GPU, it can be merged with the decoding result of the CPU, so that the combined decoding result can be obtained, and the combined decoding result can be further returned to the upper layer code. For details, refer to the description of step S104 in the first embodiment, and the detailed description is omitted here.
总之,在本申请实施例中,对于JPEG图像,可以实现CPU与GPU的联合解码,并且对两者的解码任务进行分配时,是以各自的解码能力为依据进行分配,并且是在CPU侧进行完MCU解码之后,以MCU块行为单位进行解码任务的分配,这样,从任务分配之后,CPU与GPU需要执行的操作步骤都是相同的,只不过按照各自的解码能力分配了不同的任务量,因此,可以最大限度地保证两者解码的同步,避免出现其中一方解码完成之后需要等待另一方解码完成的情况,从而从整体上提高JPEG图像的解码效率。In summary, in the embodiment of the present application, for the JPEG image, the joint decoding of the CPU and the GPU can be implemented, and when the decoding tasks of the two are allocated, the allocation is performed based on the respective decoding capabilities, and is performed on the CPU side. After the MCU decodes, the decoding task is allocated in units of MCU block behavior. Thus, after the task assignment, the CPU and the GPU need to perform the same operation steps, but different task amounts are allocated according to the respective decoding capabilities. Therefore, the synchronization of the decoding of the two can be ensured to the utmost, and the situation that one of the parties needs to wait for the decoding of the other party after the decoding is completed is avoided, thereby improving the decoding efficiency of the JPEG image as a whole.
与本申请实施例提供的对JPEG图像进行解码的方法相对应,本申请实施 例还提供了一种对图像进行解码的装置,参见图3,该装置可以包括:Corresponding to the method for decoding a JPEG image provided by the embodiment of the present application, the present application implements The example also provides an apparatus for decoding an image. Referring to FIG. 3, the apparatus may include:
解码请求接收单元301,用于接收对指定图像进行解码的请求;a decoding request receiving unit 301, configured to receive a request for decoding a specified image;
解码任务分解单元302,用于将所述指定图像分解成多条解码任务;Decoding task decomposition unit 302, configured to decompose the specified image into multiple decoding tasks;
解码能力信息确定单元303,用于确定当前终端设备的中央处理器CPU以及图形处理器GPU分别在解码图像时的解码能力信息;The decoding capability information determining unit 303 is configured to determine decoding capability information when the central processing unit CPU of the current terminal device and the graphics processing unit GPU respectively decode the image;
解码任务分配单元304,用于根据所述CPU与GPU之间的解码能力比,将所述多条解码任务分配给所述CPU以及GPU进行并行处理。The decoding task allocation unit 304 is configured to allocate the plurality of decoding tasks to the CPU and the GPU for parallel processing according to a decoding capability ratio between the CPU and the GPU.
其中,所述解码能力信息确定单元303具体可以包括:The decoding capability information determining unit 303 may specifically include:
格式确定子单元,用于确定所述指定图像的格式;a format determining subunit, configured to determine a format of the specified image;
第一能力信息确定子单元,用于确定当前终端设备的CPU以及GPU分别在解码该格式的图像时的解码能力信息。The first capability information determining subunit is configured to determine decoding capability information of the CPU of the current terminal device and the GPU when decoding the image of the format, respectively.
解码能力信息确定单元303具体还可以包括:The decoding capability information determining unit 303 may specifically include:
格式确定子单元,用于确定所述指定图像的格式;a format determining subunit, configured to determine a format of the specified image;
编码类型确定子单元,用于确定所述指定图像在该格式中的编码类型;An encoding type determining subunit, configured to determine an encoding type of the specified image in the format;
第二能力信息确定子单元,用于确定当前终端设备的CPU以及GPU分别在解码该格式下该编码类型的图像时的解码能力信息。The second capability information determining subunit is configured to determine decoding capability information of the CPU of the current terminal device and the GPU when decoding the image of the encoding type in the format, respectively.
具体的,解码能力信息确定单元303具体可以包括:Specifically, the decoding capability information determining unit 303 may specifically include:
终端型号信息获取子单元,用于获取当前终端设备的型号信息;The terminal model information obtaining subunit is configured to obtain model information of the current terminal device;
查询子单元,用于根据所述当前终端设备的型号,查询预先建立的数据库,获取当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息;其中,所述数据库中保存有多个终端设备的型号与其搭载的CPU以及GPU分别在解码图像时的解码能力信息之间的对应关系。The query subunit is configured to query a pre-established database according to the model of the current terminal device, and obtain decoding capability information of the current terminal device CPU and the GPU when decoding the image respectively; wherein the database stores multiple terminals Correspondence between the model of the device and the decoding capability information of the CPU and GPU mounted on the image when decoding the image.
另一种实现方式下,该装置还可以包括:In another implementation, the device may further include:
第一测试单元,用于预先利用预置的图像对当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息进行测试,并保存测试结果;a first test unit, configured to test, in advance, the decoding capability information of the current terminal device CPU and the GPU when decoding the image, and save the test result;
所述解码能力信息确定单元303具体可以用于:The decoding capability information determining unit 303 can be specifically configured to:
根据所述保存的测试结果确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息。Determining, according to the saved test result, decoding capability information of the CPU of the current terminal device and the GPU when decoding the image, respectively.
再一种实现方式下,解码能力信息确定单元303还可以包括: In another implementation, the decoding capability information determining unit 303 may further include:
第二测试单元,用于预先利用解码请求中携带的图像,对当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息进行测试,并保存测试结果;a second test unit, configured to pre-use the image carried in the decoding request, test the decoding capability information of the current terminal device CPU and the GPU when decoding the image, and save the test result;
所述解码能力信息确定单元303具体可以用于:The decoding capability information determining unit 303 can be specifically configured to:
根据所述保存的测试结果确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息。Determining, according to the saved test result, decoding capability information of the CPU of the current terminal device and the GPU when decoding the image, respectively.
具体实现时,解码任务分配单元304具体可以包括:Specifically, the decoding task assignment unit 304 may specifically include:
分配子单元,用于根据解码任务的总条数以及所述解码能力比,向CPU分配第一条数的解码任务,向GPU分配第二条数的解码任务;An allocation subunit, configured to allocate a first number of decoding tasks to the CPU according to the total number of decoding tasks and the decoding capability ratio, and allocate a second number of decoding tasks to the GPU;
解码请求发送子单元,用于以所述第二条数的解码任务为参数,以非阻塞方式向所述GPU发送解码请求,以便所述GPU对所述第二条数的解码任务进行解码;a decoding request sending subunit, configured to send a decoding request to the GPU in a non-blocking manner by using the decoding task of the second number as a parameter, so that the GPU decodes the decoding task of the second number;
解码子单元,用于在CPU中对所述第一条数的解码任务进行解码。And a decoding subunit, configured to decode the decoding task of the first number in the CPU.
在具体实现时,该装置还可以包括:In a specific implementation, the device may further include:
解码结果读回单元,用于在将所述CPU中的解码完成后,从所述GPU中读回GPU的解码结果;a decoding result readback unit, configured to read back a decoding result of the GPU from the GPU after decoding in the CPU is completed;
解码结果合并单元,用于将所述CPU的解码结果与所述GPU的解码结果进行合并,并将合并结果返回。And a decoding result merging unit, configured to combine the decoding result of the CPU with the decoding result of the GPU, and return the combined result.
另外,该装置还可以包括:In addition, the device may further include:
记录单元,用于所述将所述多条解码任务分配给所述CPU以及GPU进行并行处理时,记录分配给CPU的解码任务与所述分配给GPU的解码任务在所述指定图像中的相对位置关系信息;a recording unit, configured to record, when the plurality of decoding tasks are allocated to the CPU and the GPU for parallel processing, record a relative of a decoding task allocated to the CPU and the decoding task allocated to the GPU in the specified image Location relationship information;
所述解码结果合并单元具体可以用于:The decoding result combining unit may be specifically configured to:
根据所述CPU的解码结果的保存地址以及所述相对位置关系,确定所述GPU的解码结果的保存地址,并将所述GPU的解码结果保存到该保存地址。And determining, according to the saved address of the decoding result of the CPU and the relative positional relationship, a save address of the decoding result of the GPU, and saving the decoding result of the GPU to the save address.
其中,所述指定图像包括JPEG格式的图像,所述解码任务分解单元302具体可以用于:The specified image includes an image in a JPEG format, and the decoding task decomposition unit 302 may be specifically configured to:
对所述指定图像进行最小编码单元MCU解码,得到多个MCU块行,将每个MCU块行确定为一条解码任务,每个MCU块行由多个MCU块组成。The specified image is subjected to minimum coding unit MCU decoding to obtain a plurality of MCU block lines, each MCU block line is determined as one decoding task, and each MCU block line is composed of a plurality of MCU blocks.
其中,该装置还可以包括: Wherein, the device may further comprise:
数据组划分单元,用于将分配给GPU处理的每个MCU块分别划分为预置数目的数据组;a data group dividing unit, configured to divide each MCU block allocated to the GPU processing into a preset number of data groups;
地址偏移量计算单元,用于计算获得在GPU中进行反向离散余弦变换IDCT之后,各个数据组对应的计算结果在保存时的地址偏移量;An address offset calculation unit, configured to calculate an address offset of the calculation result corresponding to each data group after the inverse discrete cosine transform IDCT is performed in the GPU;
发送单元,用于在向所述GPU分配解码任务时,还将所述分组信息以及各组对应的地址偏移量信息发送给所述GPU,以便GPU按照所述分组信息,将同一个MCU块分配给多个线程进行IDCT计算,并按照所述地址偏移量进行IDCT计算结果的保存,以用于后续步骤按照地址偏移量读取所述IDCT计算结果,并进行后续解码计算。a sending unit, configured to: when the decoding task is allocated to the GPU, send the group information and the address offset information corresponding to each group to the GPU, so that the GPU sends the same MCU block according to the group information. The IDCT calculation is performed for a plurality of threads, and the IDCT calculation result is saved according to the address offset for subsequent steps to read the IDCT calculation result according to the address offset, and perform subsequent decoding calculation.
在实际应用中,还包括:In practical applications, it also includes:
浏览请求发送单元,用于所述接收对指定图像进行解码的请求之前,向服务器发送商品对象的浏览请求;a browsing request sending unit, configured to send a browsing request of the commodity object to the server before receiving the request for decoding the specified image;
页面信息接收单元,用于接收所述服务器返回的包含有商品对象图片信息的页面信息,在显示该页面信息的过程中,接收所述对指定图像进行解码的请求。The page information receiving unit is configured to receive page information including the product object picture information returned by the server, and receive the request for decoding the specified image in the process of displaying the page information.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。It will be apparent to those skilled in the art from the above description of the embodiments that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM or a disk. , an optical disk, etc., includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统或系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的系统及系统实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术 人员在不付出创造性劳动的情况下,即可以理解并实施。The various embodiments in the specification are described in a progressive manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for a system or system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment. The system and system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie It can be located in one place or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. General skill in the art Personnel can understand and implement without creative work.
以上对本申请所提供的对图像进行解码的方法及装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本申请的限制。 The method and device for decoding an image provided by the present application are described in detail above. The principles and implementation manners of the present application are described in the specific examples. The description of the above embodiments is only used to help understand the present application. The method and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be construed as limiting the application.

Claims (24)

  1. 一种对图像进行解码的方法,其特征在于,包括:A method for decoding an image, comprising:
    接收对指定图像进行解码的请求;Receiving a request to decode a specified image;
    将所述指定图像分解成多条解码任务;Decomposing the specified image into a plurality of decoding tasks;
    确定当前终端设备的中央处理器CPU以及图形处理器GPU分别在解码图像时的解码能力信息;Determining decoding capability information of the central processor CPU of the current terminal device and the graphics processor GPU when decoding the image respectively;
    根据所述CPU与GPU之间的解码能力比,将所述多条解码任务分配给所述CPU以及GPU进行并行处理。The plurality of decoding tasks are allocated to the CPU and the GPU for parallel processing according to a decoding capability ratio between the CPU and the GPU.
  2. 根据权利要求1所述的方法,其特征在于,所述确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息,包括:The method according to claim 1, wherein the determining the decoding capability information of the CPU of the current terminal device and the GPU when decoding the image respectively includes:
    确定所述指定图像的格式;Determining a format of the specified image;
    确定当前终端设备的CPU以及GPU分别在解码该格式的图像时的解码能力信息。Determining decoding capability information of the CPU of the current terminal device and the GPU when decoding the image of the format, respectively.
  3. 根据权利要求1所述的方法,其特征在于,所述确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息,包括:The method according to claim 1, wherein the determining the decoding capability information of the CPU of the current terminal device and the GPU when decoding the image respectively includes:
    确定所述指定图像的格式;Determining a format of the specified image;
    确定所述指定图像在该格式中的编码类型;Determining an encoding type of the specified image in the format;
    确定当前终端设备的CPU以及GPU分别在解码该格式下该编码类型的图像时的解码能力信息。Determining decoding capability information of the CPU of the current terminal device and the GPU when decoding the image of the encoding type in the format, respectively.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息,包括:The method according to any one of claims 1 to 3, wherein the determining the decoding capability information of the CPU of the current terminal device and the GPU when decoding the image respectively includes:
    获取当前终端设备的型号信息;Obtain the model information of the current terminal device;
    根据所述当前终端设备的型号,查询预先建立的数据库,获取当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息;其中,所述数据库中保存有多个终端设备的型号与其搭载的CPU以及GPU分别在解码图像时的解码能力信息之间的对应关系。Querying a pre-established database according to the model of the current terminal device, and acquiring decoding capability information of the current terminal device's CPU and the GPU when decoding the image respectively; wherein the database stores a plurality of terminal device models and the piggybacking The correspondence between the decoding capability information of the CPU and the GPU at the time of decoding the image, respectively.
  5. 根据权利要求1至3任一项所述的方法,其特征在于,还包括:The method according to any one of claims 1 to 3, further comprising:
    预先利用预置的图像对当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息进行测试,并保存测试结果; Pre-using the preset image to test the decoding capability information of the CPU and the GPU of the current terminal device when decoding the image, respectively, and saving the test result;
    所述确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息,包括:The determining the decoding capability information of the CPU of the current terminal device and the GPU when decoding the image respectively includes:
    根据所述保存的测试结果确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息。Determining, according to the saved test result, decoding capability information of the CPU of the current terminal device and the GPU when decoding the image, respectively.
  6. 根据权利要求1至3任一项所述的方法,其特征在于,还包括:The method according to any one of claims 1 to 3, further comprising:
    预先利用解码请求中携带的图像,对当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息进行测试,并保存测试结果;Pre-utilizing the image carried in the decoding request, testing the decoding capability information of the CPU and the GPU of the current terminal device when decoding the image, and saving the test result;
    所述确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息,包括:The determining the decoding capability information of the CPU of the current terminal device and the GPU when decoding the image respectively includes:
    根据所述保存的测试结果确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息。Determining, according to the saved test result, decoding capability information of the CPU of the current terminal device and the GPU when decoding the image, respectively.
  7. 根据权利要求1所述的方法,其特征在于,所述根据所述CPU与GPU之间的解码能力比,将所述多条解码任务分配给所述CPU以及GPU进行并行处理,包括:The method according to claim 1, wherein the assigning the plurality of decoding tasks to the CPU and the GPU for parallel processing according to a decoding capability ratio between the CPU and the GPU comprises:
    根据解码任务的总条数以及所述解码能力比,向CPU分配第一条数的解码任务,向GPU分配第二条数的解码任务;Allocating a first number of decoding tasks to the CPU according to the total number of decoding tasks and the decoding capability ratio, and allocating a second number of decoding tasks to the GPU;
    以所述第二条数的解码任务为参数,以非阻塞方式向所述GPU发送解码请求,以便所述GPU对所述第二条数的解码任务进行解码;Decoding, by the decoding task of the second number, a decoding request to the GPU in a non-blocking manner, so that the GPU decodes the decoding task of the second number;
    在CPU中对所述第一条数的解码任务进行解码。The first number of decoding tasks are decoded in the CPU.
  8. 根据权利要求7所述的方法,其特征在于,还包括:The method of claim 7 further comprising:
    在将所述CPU中的解码完成后,从所述GPU中读回GPU的解码结果;After decoding in the CPU is completed, reading back the decoding result of the GPU from the GPU;
    将所述CPU的解码结果与所述GPU的解码结果进行合并,并将合并结果返回。Combining the decoding result of the CPU with the decoding result of the GPU, and returning the combined result.
  9. 根据权利要求8所述的方法,其特征在于,所述将所述多条解码任务分配给所述CPU以及GPU进行并行处理时,还包括:The method according to claim 8, wherein when the plurality of decoding tasks are allocated to the CPU and the GPU for parallel processing, the method further includes:
    记录分配给CPU的解码任务与所述分配给GPU的解码任务在所述指定图像中的相对位置关系信息;Recording relative position relationship information of the decoding task assigned to the CPU and the decoding task assigned to the GPU in the specified image;
    所述将所述CPU的解码结果与所述GPU的解码结果进行合并,包括:The combining the decoding result of the CPU with the decoding result of the GPU includes:
    根据所述CPU的解码结果的保存地址以及所述相对位置关系,确定所述 GPU的解码结果的保存地址,并将所述GPU的解码结果保存到该保存地址。Determining the storage address according to the storage address of the decoding result of the CPU and the relative positional relationship The save address of the decoding result of the GPU, and the decoding result of the GPU is saved to the save address.
  10. 根据权利要求1所述的方法,其特征在于,所述指定图像包括JPEG格式的图像,所述将所述指定图像分解成多条解码任务,包括:The method according to claim 1, wherein the specified image comprises an image in a JPEG format, and the decomposing the specified image into a plurality of decoding tasks comprises:
    对所述指定图像进行最小编码单元MCU解码,得到多个MCU块行,将每个MCU块行确定为一条解码任务,每个MCU块行由多个MCU块组成。The specified image is subjected to minimum coding unit MCU decoding to obtain a plurality of MCU block lines, each MCU block line is determined as one decoding task, and each MCU block line is composed of a plurality of MCU blocks.
  11. 根据权利要求10所述的方法,其特征在于,还包括:The method of claim 10, further comprising:
    将分配给GPU处理的每个MCU块分别划分为预置数目的数据组;Dividing each MCU block allocated to the GPU processing into a preset number of data groups;
    计算获得在GPU中进行反向离散余弦变换IDCT之后,各个数据组对应的计算结果在保存时的地址偏移量;Calculating the address offset of the calculation result corresponding to each data group after the inverse discrete cosine transform IDCT is performed in the GPU;
    在向所述GPU分配解码任务时,还将所述分组信息以及各组对应的地址偏移量信息发送给所述GPU,以便GPU按照所述分组信息,将同一个MCU块分配给多个线程进行IDCT计算,并按照所述地址偏移量进行IDCT计算结果的保存,以用于后续步骤按照地址偏移量读取所述IDCT计算结果,并进行后续解码计算。When the decoding task is allocated to the GPU, the packet information and the corresponding address offset information of each group are also sent to the GPU, so that the GPU allocates the same MCU block to multiple threads according to the group information. The IDCT calculation is performed, and the IDCT calculation result is saved according to the address offset for the subsequent step to read the IDCT calculation result according to the address offset, and perform subsequent decoding calculation.
  12. 根据权利要求1至3任一项所述的方法,其特征在于,所述接收对指定图像进行解码的请求之前,还包括:The method according to any one of claims 1 to 3, further comprising: before receiving the request for decoding the specified image, the method further comprising:
    向服务器发送商品对象的浏览请求;Sending a browse request for the commodity object to the server;
    接收所述服务器返回的包含有商品对象图片信息的页面信息,在显示该页面信息的过程中,接收所述对指定图像进行解码的请求。Receiving page information including the product object picture information returned by the server, and receiving the request for decoding the specified image in the process of displaying the page information.
  13. 一种对图像进行解码的装置,其特征在于,包括:An apparatus for decoding an image, comprising:
    解码请求接收单元,用于接收对指定图像进行解码的请求;a decoding request receiving unit, configured to receive a request to decode the specified image;
    解码任务分解单元,用于将所述指定图像分解成多条解码任务;a decoding task decomposition unit, configured to decompose the specified image into a plurality of decoding tasks;
    解码能力信息确定单元,用于确定当前终端设备的中央处理器CPU以及图形处理器GPU分别在解码图像时的解码能力信息;a decoding capability information determining unit, configured to determine decoding capability information of a central processing unit CPU and a graphics processing unit GPU of the current terminal device when decoding an image, respectively;
    解码任务分配单元,用于根据所述CPU与GPU之间的解码能力比,将所述多条解码任务分配给所述CPU以及GPU进行并行处理。And a decoding task allocation unit, configured to allocate the plurality of decoding tasks to the CPU and the GPU for parallel processing according to a decoding capability ratio between the CPU and the GPU.
  14. 根据权利要求13所述的装置,其特征在于,所述解码能力信息确定单元包括:The apparatus according to claim 13, wherein the decoding capability information determining unit comprises:
    格式确定子单元,用于确定所述指定图像的格式; a format determining subunit, configured to determine a format of the specified image;
    第一能力信息确定子单元,用于确定当前终端设备的CPU以及GPU分别在解码该格式的图像时的解码能力信息。The first capability information determining subunit is configured to determine decoding capability information of the CPU of the current terminal device and the GPU when decoding the image of the format, respectively.
  15. 根据权利要求13所述的装置,其特征在于,所述解码能力信息确定单元包括:The apparatus according to claim 13, wherein the decoding capability information determining unit comprises:
    格式确定子单元,用于确定所述指定图像的格式;a format determining subunit, configured to determine a format of the specified image;
    编码类型确定子单元,用于确定所述指定图像在该格式中的编码类型;An encoding type determining subunit, configured to determine an encoding type of the specified image in the format;
    第二能力信息确定子单元,用于确定当前终端设备的CPU以及GPU分别在解码该格式下该编码类型的图像时的解码能力信息。The second capability information determining subunit is configured to determine decoding capability information of the CPU of the current terminal device and the GPU when decoding the image of the encoding type in the format, respectively.
  16. 根据权利要求13至15任一项所述的装置,其特征在于,所述解码能力信息确定单元包括:The apparatus according to any one of claims 13 to 15, wherein the decoding capability information determining unit comprises:
    终端型号信息获取子单元,用于获取当前终端设备的型号信息;The terminal model information obtaining subunit is configured to obtain model information of the current terminal device;
    查询子单元,用于根据所述当前终端设备的型号,查询预先建立的数据库,获取当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息;其中,所述数据库中保存有多个终端设备的型号与其搭载的CPU以及GPU分别在解码图像时的解码能力信息之间的对应关系。The query subunit is configured to query a pre-established database according to the model of the current terminal device, and obtain decoding capability information of the current terminal device CPU and the GPU when decoding the image respectively; wherein the database stores multiple terminals Correspondence between the model of the device and the decoding capability information of the CPU and GPU mounted on the image when decoding the image.
  17. 根据权利要求13至15任一项所述的装置,其特征在于,还包括:The device according to any one of claims 13 to 15, further comprising:
    第一测试单元,用于预先利用预置的图像对当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息进行测试,并保存测试结果;a first test unit, configured to test, in advance, the decoding capability information of the current terminal device CPU and the GPU when decoding the image, and save the test result;
    所述解码能力信息确定单元具体用于:The decoding capability information determining unit is specifically configured to:
    根据所述保存的测试结果确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息。Determining, according to the saved test result, decoding capability information of the CPU of the current terminal device and the GPU when decoding the image, respectively.
  18. 根据权利要求13至15任一项所述的装置,其特征在于,还包括:The device according to any one of claims 13 to 15, further comprising:
    第二测试单元,用于预先利用解码请求中携带的图像,对当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息进行测试,并保存测试结果;a second test unit, configured to pre-use the image carried in the decoding request, test the decoding capability information of the current terminal device CPU and the GPU when decoding the image, and save the test result;
    所述解码能力信息确定单元具体用于:The decoding capability information determining unit is specifically configured to:
    根据所述保存的测试结果确定当前终端设备的CPU以及GPU分别在解码图像时的解码能力信息。Determining, according to the saved test result, decoding capability information of the CPU of the current terminal device and the GPU when decoding the image, respectively.
  19. 根据权利要求13所述的装置,其特征在于,所述解码任务分配单元包括: The apparatus according to claim 13, wherein the decoding task allocation unit comprises:
    分配子单元,用于根据解码任务的总条数以及所述解码能力比,向CPU分配第一条数的解码任务,向GPU分配第二条数的解码任务;An allocation subunit, configured to allocate a first number of decoding tasks to the CPU according to the total number of decoding tasks and the decoding capability ratio, and allocate a second number of decoding tasks to the GPU;
    解码请求发送子单元,用于以所述第二条数的解码任务为参数,以非阻塞方式向所述GPU发送解码请求,以便所述GPU对所述第二条数的解码任务进行解码;a decoding request sending subunit, configured to send a decoding request to the GPU in a non-blocking manner by using the decoding task of the second number as a parameter, so that the GPU decodes the decoding task of the second number;
    解码子单元,用于在CPU中对所述第一条数的解码任务进行解码。And a decoding subunit, configured to decode the decoding task of the first number in the CPU.
  20. 根据权利要求19所述的装置,其特征在于,还包括:The device according to claim 19, further comprising:
    解码结果读回单元,用于在将所述CPU中的解码完成后,从所述GPU中读回GPU的解码结果;a decoding result readback unit, configured to read back a decoding result of the GPU from the GPU after decoding in the CPU is completed;
    解码结果合并单元,用于将所述CPU的解码结果与所述GPU的解码结果进行合并,并将合并结果返回。And a decoding result merging unit, configured to combine the decoding result of the CPU with the decoding result of the GPU, and return the combined result.
  21. 根据权利要求20所述的装置,其特征在于,还包括:The device according to claim 20, further comprising:
    记录单元,用于所述将所述多条解码任务分配给所述CPU以及GPU进行并行处理时,记录分配给CPU的解码任务与所述分配给GPU的解码任务在所述指定图像中的相对位置关系信息;a recording unit, configured to record, when the plurality of decoding tasks are allocated to the CPU and the GPU for parallel processing, record a relative of a decoding task allocated to the CPU and the decoding task allocated to the GPU in the specified image Location relationship information;
    所述解码结果合并单元具体用于:The decoding result combining unit is specifically configured to:
    根据所述CPU的解码结果的保存地址以及所述相对位置关系,确定所述GPU的解码结果的保存地址,并将所述GPU的解码结果保存到该保存地址。And determining, according to the saved address of the decoding result of the CPU and the relative positional relationship, a save address of the decoding result of the GPU, and saving the decoding result of the GPU to the save address.
  22. 根据权利要求13所述的装置,其特征在于,所述指定图像包括JPEG格式的图像,所述解码任务分解单元具体用于:The device according to claim 13, wherein the specified image comprises an image in a JPEG format, and the decoding task decomposition unit is specifically configured to:
    对所述指定图像进行最小编码单元MCU解码,得到多个MCU块行,将每个MCU块行确定为一条解码任务,每个MCU块行由多个MCU块组成。The specified image is subjected to minimum coding unit MCU decoding to obtain a plurality of MCU block lines, each MCU block line is determined as one decoding task, and each MCU block line is composed of a plurality of MCU blocks.
  23. 根据权利要求22所述的装置,其特征在于,还包括:The device according to claim 22, further comprising:
    数据组划分单元,用于将分配给GPU处理的每个MCU块分别划分为预置数目的数据组;a data group dividing unit, configured to divide each MCU block allocated to the GPU processing into a preset number of data groups;
    地址偏移量计算单元,用于计算获得在GPU中进行反向离散余弦变换IDCT之后,各个数据组对应的计算结果在保存时的地址偏移量;An address offset calculation unit, configured to calculate an address offset of the calculation result corresponding to each data group after the inverse discrete cosine transform IDCT is performed in the GPU;
    发送单元,用于在向所述GPU分配解码任务时,还将所述分组信息以及各组对应的地址偏移量信息发送给所述GPU,以便GPU按照所述分组信息, 将同一个MCU块分配给多个线程进行IDCT计算,并按照所述地址偏移量进行IDCT计算结果的保存,以用于后续步骤按照地址偏移量读取所述IDCT计算结果,并进行后续解码计算。a sending unit, configured to: when the decoding task is allocated to the GPU, send the group information and the address offset information corresponding to each group to the GPU, so that the GPU follows the grouping information, Allocating the same MCU block to multiple threads for IDCT calculation, and saving the IDCT calculation result according to the address offset, for subsequent steps to read the IDCT calculation result according to the address offset, and performing subsequent Decoding calculation.
  24. 根据权利要求13至15任一项所述的装置,其特征在于,还包括:The device according to any one of claims 13 to 15, further comprising:
    浏览请求发送单元,用于所述接收对指定图像进行解码的请求之前,向服务器发送商品对象的浏览请求;a browsing request sending unit, configured to send a browsing request of the commodity object to the server before receiving the request for decoding the specified image;
    页面信息接收单元,用于接收所述服务器返回的包含有商品对象图片信息的页面信息,在显示该页面信息的过程中,接收所述对指定图像进行解码的请求。 The page information receiving unit is configured to receive page information including the product object picture information returned by the server, and receive the request for decoding the specified image in the process of displaying the page information.
PCT/CN2015/083270 2014-07-25 2015-07-03 Method and apparatus for decoding image WO2016011886A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410360745.9 2014-07-25
CN201410360745.9A CN105338358B (en) 2014-07-25 2014-07-25 The method and device that image is decoded

Publications (1)

Publication Number Publication Date
WO2016011886A1 true WO2016011886A1 (en) 2016-01-28

Family

ID=55162498

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/083270 WO2016011886A1 (en) 2014-07-25 2015-07-03 Method and apparatus for decoding image

Country Status (2)

Country Link
CN (1) CN105338358B (en)
WO (1) WO2016011886A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107506176A (en) * 2016-06-14 2017-12-22 华为技术有限公司 A kind of method and apparatus for determining decoding task

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105787987B (en) * 2016-03-15 2019-07-30 广州爱九游信息技术有限公司 A kind of Texture Processing Methods and electronic equipment
CN105893908B (en) * 2016-03-31 2018-06-08 青岛海信移动通信技术股份有限公司 Two-dimension code image recognition methods and device
CN105959704B (en) * 2016-04-29 2019-04-05 珠海全志科技股份有限公司 Inverse quantization inverse transform method and device, HEVC coding/decoding method and equipment
CN105898321B (en) * 2016-04-29 2019-04-05 珠海全志科技股份有限公司 Motion compensation process and device, HEVC coding/decoding method and equipment
CN106375682B (en) * 2016-08-31 2020-02-18 深圳市大疆灵眸科技有限公司 Image processing method and device, movable equipment, unmanned aerial vehicle remote controller and system
CN107105119A (en) * 2017-04-12 2017-08-29 青岛海信电器股份有限公司 It is a kind of to be used for the image transfer method and device of source device and target device
CN108990112B (en) * 2017-05-31 2021-01-15 华为技术有限公司 Task processing method and communication device in communication network
CN107809643B (en) * 2017-11-13 2020-11-20 苏州浪潮智能科技有限公司 Image decoding method, device and medium
CN108366288A (en) * 2018-03-01 2018-08-03 厦门普杰信息科技有限公司 A kind of efficient decoding and playback method and system for HD video
CN109451322B (en) * 2018-09-14 2021-02-02 北京航天控制仪器研究所 Acceleration implementation method of DCT (discrete cosine transform) algorithm and DWT (discrete wavelet transform) algorithm based on CUDA (compute unified device architecture) for image compression
CN110324629B (en) * 2019-06-27 2021-04-09 北京奇艺世纪科技有限公司 Image transcoding method and device and electronic equipment
CN110933364A (en) * 2019-10-25 2020-03-27 深圳市道通智能航空技术有限公司 Omnidirectional visual obstacle avoidance implementation method, system, device and storage medium
CN110636327B (en) * 2019-10-28 2022-02-01 成都超有爱科技有限公司 Video caching method and device, electronic equipment and storage medium
CN112165572A (en) * 2020-09-10 2021-01-01 Oppo(重庆)智能科技有限公司 Image processing method, device, terminal and storage medium
CN112911337B (en) * 2021-01-28 2023-06-20 北京达佳互联信息技术有限公司 Method and device for configuring video cover pictures of terminal equipment
CN116401070A (en) * 2023-06-06 2023-07-07 昆山嘉提信息科技有限公司 Multi-MCU data parallel processing method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080056348A1 (en) * 2006-08-31 2008-03-06 Ati Technologies, Inc Decoding method and system for highly compressed video data
CN101754013A (en) * 2008-11-28 2010-06-23 汤姆森许可贸易公司 Method for video decoding supported by graphics processing unit
CN102036043A (en) * 2010-12-15 2011-04-27 成都市华为赛门铁克科技有限公司 Video data processing method and device as well as video monitoring system
CN102143386A (en) * 2010-01-28 2011-08-03 复旦大学 Streaming media server acceleration method based on graphics processing unit
CN102467415A (en) * 2010-11-03 2012-05-23 大唐移动通信设备有限公司 Service facade task processing method and equipment
CN102929718A (en) * 2012-09-17 2013-02-13 江苏九章计算机科技有限公司 Distributed GPU (graphics processing unit) computer system based on task scheduling
CN103713949A (en) * 2012-10-09 2014-04-09 鸿富锦精密工业(深圳)有限公司 System and method for dynamic task allocation

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007295392A (en) * 2006-04-26 2007-11-08 Toshiba Corp Information processing apparatus, decoding processing method, and program
CN103260021B (en) * 2012-02-21 2016-08-03 腾讯科技(深圳)有限公司 A kind of video encoding/decoding method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080056348A1 (en) * 2006-08-31 2008-03-06 Ati Technologies, Inc Decoding method and system for highly compressed video data
CN101754013A (en) * 2008-11-28 2010-06-23 汤姆森许可贸易公司 Method for video decoding supported by graphics processing unit
CN102143386A (en) * 2010-01-28 2011-08-03 复旦大学 Streaming media server acceleration method based on graphics processing unit
CN102467415A (en) * 2010-11-03 2012-05-23 大唐移动通信设备有限公司 Service facade task processing method and equipment
CN102036043A (en) * 2010-12-15 2011-04-27 成都市华为赛门铁克科技有限公司 Video data processing method and device as well as video monitoring system
CN102929718A (en) * 2012-09-17 2013-02-13 江苏九章计算机科技有限公司 Distributed GPU (graphics processing unit) computer system based on task scheduling
CN103713949A (en) * 2012-10-09 2014-04-09 鸿富锦精密工业(深圳)有限公司 System and method for dynamic task allocation

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107506176A (en) * 2016-06-14 2017-12-22 华为技术有限公司 A kind of method and apparatus for determining decoding task
CN107506176B (en) * 2016-06-14 2019-07-12 华为技术有限公司 A kind of method and apparatus of determining decoding task
US10886948B2 (en) 2016-06-14 2021-01-05 Huawei Technologies Co., Ltd. Method for determining a decoding task and apparatus

Also Published As

Publication number Publication date
CN105338358B (en) 2018-12-28
CN105338358A (en) 2016-02-17

Similar Documents

Publication Publication Date Title
WO2016011886A1 (en) Method and apparatus for decoding image
CN108206937B (en) Method and device for improving intelligent analysis performance
WO2017211190A1 (en) Data processing method and device
WO2018072638A1 (en) Method and device for presenting animation image on mobile device
JP2018534607A (en) Efficient display processing using prefetch
US20130063473A1 (en) System and method for layering using tile-based renderers
US11727632B2 (en) Shader binding management in ray tracing
WO2021258512A1 (en) Data aggregation processing apparatus and method, and storage medium
WO2019127773A1 (en) Method and apparatus for processing sales of insurance product, storage medium, and terminal
CN116662038B (en) Industrial information detection method, device, equipment and medium based on shared memory
CN113778604A (en) Display method and device of operation interface, electronic equipment and storage medium
CN117058288A (en) Graphics processor, multi-core graphics processing system, electronic device, and apparatus
US10929079B2 (en) Video display method, electronic device and computer program product
US20160171750A1 (en) Techniques for enhancing multiple view performance in a three dimensional pipeline
Chen et al. Integrating an e-book software with vector graphic technology on cloud platform
CN113286174B (en) Video frame extraction method and device, electronic equipment and computer readable storage medium
WO2023143545A1 (en) Resource processing method and apparatus, electronic device, and computer-readable storage medium
WO2019114044A1 (en) Image processing method and device, electronic apparatus, and computer readable storage medium
CN113377548B (en) Identification generation method, device, computer equipment and storage medium
US7487516B1 (en) Desktop composition for incompatible graphics applications
US9646570B2 (en) Mechanism for facilitating improved copying of graphics data on computing devices
WO2020114375A1 (en) Two-dimensional code generation and identification methods and devices
CN115809956B (en) Graphics processor performance analysis method, device, computer equipment and storage medium
CN115712580B (en) Memory address allocation method, memory address allocation device, computer equipment and storage medium
JP2013539577A (en) Interrupt-based command processing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15825472

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15825472

Country of ref document: EP

Kind code of ref document: A1