WO2014067138A1 - 图像处理方法、装置及计算机可读介质 - Google Patents

图像处理方法、装置及计算机可读介质 Download PDF

Info

Publication number
WO2014067138A1
WO2014067138A1 PCT/CN2012/084014 CN2012084014W WO2014067138A1 WO 2014067138 A1 WO2014067138 A1 WO 2014067138A1 CN 2012084014 W CN2012084014 W CN 2012084014W WO 2014067138 A1 WO2014067138 A1 WO 2014067138A1
Authority
WO
WIPO (PCT)
Prior art keywords
calculated
component values
pixels
pixel point
values need
Prior art date
Application number
PCT/CN2012/084014
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to CN201280003357.4A priority Critical patent/CN103918007A/zh
Priority to PCT/CN2012/084014 priority patent/WO2014067138A1/zh
Publication of WO2014067138A1 publication Critical patent/WO2014067138A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4015Image demosaicing, e.g. colour filter arrays [CFA] or Bayer patterns
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths

Definitions

  • the present invention relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, and computer readable medium. Background technique
  • Computer image processing is generally performed in units of pixels. However, for an image, the number of pixels is usually very large, such as the resolution is
  • the 1089p HD image has 1920 X 1080 pixels, which makes processing a lot of pixels of an image very computationally intensive.
  • the pixel color representation mainly has two formats, namely RGB and YUV, where RGB is the abbreviation of three primary colors red, green and blue, and YUV stands for brightness (Luminance or Luma), respectively. Hue and saturation.
  • RGB is the abbreviation of three primary colors red, green and blue
  • YUV stands for brightness (Luminance or Luma), respectively. Hue and saturation.
  • image processing such as image encoding, image preprocessing to convert RGB format to YUV format is required.
  • the image preprocessing of the existing RGB format to YUV format is usually performed in the CPU of the central processing unit, and the conventional method is: the traversal of each pixel by serial to complete the conversion of the Y component; and for the U and V components, Conversion is required at pixels at specific locations (usually the intersection of odd rows and columns).
  • the Y component value is calculated for each pixel, and only the pixel points at a specific position need to calculate the U and V component values, because the serial traversal of all the pixel points and the calculation of the 11 and V component values are satisfied.
  • an embodiment of the present invention provides an image processing method, including: starting N threads to respectively calculate Y component values of N pixel points of an image to be processed;
  • the N threads determine, according to the positions of the N pixel points, the positions of the pixel points that need to calculate 1; V component values;
  • the N threads respectively calculate the positions of the pixel points of the U and V component values according to the need, and calculate the U and V component values of the pixel points for which the U and V component values need to be calculated;
  • N is a positive integer.
  • the N threads determine a location of the pixel point at which the U, V component values need to be calculated based on a sampling format of the pixel YUV component.
  • a second possible implementation manner when the pixel format of the U, V component value needs to be calculated based on a sampling format of the 4:2:0 YUV component In the position, the pixel position corresponding to the U and V component values and the pixel points corresponding to the pixel points for which the U and V component values need to be calculated are satisfied in the following positional relationship:
  • Ux and Vx represent the abscissa of the pixel point for which the U and V component values need to be calculated
  • Uy and Vy represent the ordinate of the pixel point for which the U and V component values need to be calculated
  • Yx represents the U and V.
  • Yy represents the ordinate of the pixel point corresponding to the pixel point where the U and V component values need to be calculated
  • is the left shift operator.
  • the pixel point and the N of the U and V component values need to be calculated.
  • the pixel corresponding to the U and V component values is calculated, and the pixel position corresponding to ⁇ satisfies the following positional relationship:
  • Ux and Vx represent the abscissa of the pixel point for which the U and V component values need to be calculated
  • Uy and Vy represent the ordinate of the pixel point for which the U and V component values need to be calculated
  • Yx represents the U and V.
  • Yy represents the ordinate of the pixel point corresponding to the pixel point for which the U and V component values need to be calculated
  • is the left shift operator.
  • an embodiment of the present invention provides an apparatus, including: a starting unit, configured to start N threads to respectively calculate Y component values of N pixel points of an image to be processed;
  • a determining unit configured to determine, by using the N threads, a position of a pixel point that needs to calculate a U and V component value according to positions of the N pixel points, and a calculating unit, configured to use the N threads according to the The position of the pixel point of the U and V component values needs to be calculated, and the U and V component values of the pixel points for which the U and V component values need to be calculated are calculated;
  • N is a positive integer.
  • the determining unit is specifically configured to determine, according to a sampling format of a pixel YUV component, the position of the pixel to which the V component value is located.
  • the determining unit is specifically configured to determine, when the sampling format is based on a 4:2:0 YUV component, the required calculation U, When the position of the pixel point of the V component value is calculated, the pixel point and the N pixel point of the U and V component values need to be calculated.
  • the pixel positions corresponding to the pixel points for which the U and V component values are to be calculated satisfy the following positional relationship:
  • Ux and Vx represent the abscissa of the pixel point for which the U and V component values need to be calculated
  • Uy and Vy represent the ordinate of the pixel point for which the U and V component values need to be calculated
  • Yx represents the U and V.
  • Yy represents the ordinate of the pixel point corresponding to the pixel point where the U and V component values need to be calculated
  • is the left shift operator.
  • the determining unit is specifically configured to determine, when the sampling format is based on a 4:2:2 YUV component, the required calculation U, When the position of the pixel point of the V component value is calculated, the U, V component value and the pixel point corresponding to the pixel point corresponding to the U and V component values in the N pixel points need to be calculated as follows: :
  • Ux and Vx represent the abscissa of the pixel point for which the U and V component values need to be calculated
  • Uy and Vy represent the ordinate of the pixel point for which the U and V component values need to be calculated
  • Yx represents the U and V.
  • Yy represents the ordinate of the pixel point corresponding to the pixel point where the U and V component values need to be calculated
  • is the left shift operator.
  • an embodiment of the present invention provides an image processing apparatus, including a central processing unit and a memory, wherein the memory stores a computer to execute an instruction, and the central processing unit is connected to the memory through a communication bus, when the image processing The machine executes instructions that cause the image processing apparatus to perform any of the methods described in the first aspect of the invention.
  • an embodiment of the present invention provides a computer readable medium, where the computer readable medium includes computer execution instructions, when the central processor of the computer executes the computer execution instruction, the computer execution instruction is used to enable The computer performs any of the methods described in the first aspect of the invention.
  • the method and apparatus of the embodiments of the present invention reduce the time used for image processing by performing parallel processing on the image format conversion, thereby improving the execution efficiency.
  • FIG. 1 is a flowchart of an image processing method according to Embodiment 1 of the present invention.
  • FIG. 2 is a logic diagram of an image processing method according to Embodiment 1 of the present invention
  • FIG. 3 is another logic diagram of an image processing method according to Embodiment 1 of the present invention
  • FIG. 4 is a block diagram showing the structure of an image processing apparatus according to Embodiment 2 of the present invention.
  • FIG. 5 is a schematic diagram showing a system architecture of an application hardware environment of the image processing apparatus of Embodiment 3;
  • Figure 7 is a schematic diagram showing the system architecture of the application hardware environment of the image processing apparatus of Embodiment 4.
  • Fig. 8 is a timing chart showing image processing in the scene of the fourth embodiment. detailed description
  • the core of the graphics card is the Graphic Processing Unit (GPU).
  • GPU Graphic Processing Unit
  • CUDA Compute Unified Device Architecture
  • CUDA Compute Unified Device Architecture
  • the method of this embodiment is based on a graphics card that is equipped with a CUDA architecture.
  • the RGB image is converted to a YUV image.
  • the image processing method of this embodiment includes the steps of:
  • the N threads determine, according to the positions of the processed N pixel points, the positions of the pixels that need to calculate the value of the V component;
  • the N threads respectively calculate the positions of the pixel points of the U and V component values according to the needs, and calculate the U and V component values of the pixel points that need to be calculated by the V component value; wherein, N is a positive integer, preferably The number of threads that can be executed in parallel, such as the maximum parallel processing power supported by graphics cards based on the CUDA architecture.
  • the maximum number of parallel threads supported by the graphics card of the CUDA architecture is N.
  • the method of parallel processing N pixels by N threads maximizes the time of image processing and improves the execution efficiency of image processing.
  • the N threads are performed at the second time. Parallel processing of the next set of N pixels, and so on, until all pixel points are processed. If the number of unprocessed pixels is less than N, for example, M, the processing of the remaining M pixels can be performed in parallel by any of the N threads.
  • N is equal to 1080, at this time, processing. However, if the graphics card supports only 1000 threads in parallel, then N is equal to 1000.
  • step S2 the position of the pixel point at which the U, V component values need to be calculated is determined based on the sampling format of the pixel YUV component.
  • each pixel has a Y component value, every 2x2.
  • the pixels (four adjacent pixels in two rows and two columns) share a value of 1; V component.
  • each pixel point for calculating the Y component value satisfies the following positional relationship with another pixel point that needs to calculate 1;
  • Ux and Vx represent the abscissa of the pixel point where the U and V component values need to be calculated
  • Uy and Vy represent the ordinate of the pixel point where the U and V component values need to be calculated
  • Yx represents the value of the U and V component to be calculated.
  • Yy represents the ordinate of the pixel corresponding to the pixel of the image in which the U and V component values need to be calculated
  • is the left shift operator, which is equivalent in the operation.
  • V 0.877 ( R - ⁇ );
  • R, G, and ⁇ are the red component value, the green component value, and the blue component value of the pixel points on the RGB image to be processed, respectively.
  • the image processing method of the embodiment of the present invention will be further described by taking the sampling format of the YUV component as 4:2:2 as an example.
  • each pixel point has a Y component value, and each 1x2 pixel points (two pixels adjacent to each row and two pixels) share a 1 ;, V component value.
  • each of the pixel points for calculating the Y component value and the pixel point corresponding to the Y component of the pixel to calculate the U and V components satisfy the following positional relationship:
  • the process of the finite thread (T1 - T8) for the first row of pixels is taken as an example (the dotted line in the figure represents the correspondence between the thread and the pixel):
  • the coordinates are (0,0)
  • the position coordinates of the pixel corresponding to the U and V component values corresponding to the pixel point can be obtained (shown in FIG. 3
  • the coordinates are (1,0) pixels).
  • the positional relationship between the ⁇ component pixel points and the pixel points that need to be calculated 1 and V component values can be reasonably calculated according to the sampling rule, thereby parallel calculation of the Y, ⁇ , V component values.
  • the method of the embodiment of the present invention can also be performed by parallel processing of the CPU.
  • the method of the embodiment of the present invention reduces the time used for image processing by parallel processing of the image format, and improves the execution efficiency.
  • the method of the present invention can be executed by a graphics card based on the CUDA architecture without occupying CPU resources. Thereby releasing limited CPU computing resources.
  • the embodiment further provides an image processing apparatus based on the above method.
  • the apparatus includes: a starting unit 100, a determining unit 200, and a calculating unit 300.
  • the apparatus includes: a starting unit 100, a determining unit 200, and a calculating unit 300.
  • the starting unit 100 is configured to start N threads to calculate a Y component value of N pixels of the image to be processed
  • a determining unit 200 configured to determine, by using the N threads, the positions of the pixel points that need to calculate the U and V component values according to the positions of the N pixel points respectively;
  • the calculating unit 300 is configured to calculate the U and V component values of the pixel points of the V component value by using the N threads to calculate the positions of the pixel points of the U and V component values according to the needs.
  • the apparatus of the embodiment of the present invention reduces the time used for image processing by parallel processing of the image format conversion, thereby improving the execution efficiency.
  • the determining unit 200 of the embodiment of the present invention is specifically configured to determine a position of the pixel point that needs to calculate U and V component values based on a sampling format of a pixel YUV component.
  • the determining unit 200 is specifically configured to calculate the U and V component values when determining the position of the pixel point that needs to calculate the U and V component values based on the sampling format of the 4:2:0 YUV component.
  • the pixel position and the pixel points corresponding to the pixel points for which the U and V component values need to be calculated among the N pixel points satisfy the following positional relationship:
  • Ux and Vx represent the abscissa of the pixel point for which the U and V component values need to be calculated
  • Uy and Vy represent the ordinate of the pixel point for which the U and V component values need to be calculated
  • Yx represents the U and V.
  • Yy represents the ordinate of the pixel point corresponding to the pixel point where the U and V component values need to be calculated
  • is the left shift operator.
  • the calculating unit 300 is specifically configured to: when determining the position of the pixel point that needs to calculate the U and V component values based on the sampling format of the 4:2:2 YUV component, the U and V need to be calculated. The following positional relationship is satisfied between the pixel points of the component values and the pixel points corresponding to the pixel points for which the U and V component values need to be calculated among the N pixel points:
  • Ux and Vx represent the abscissa of the pixel point for which the U and V component values need to be calculated
  • Uy and Vy represent the ordinate of the pixel point for which the U and V component values need to be calculated
  • Yx represents the U and V.
  • Yy represents the ordinate of the pixel point corresponding to the pixel point where the U and V component values need to be calculated
  • is the left shift operator.
  • the apparatus of the embodiment of the present invention performs parallel processing on the image format conversion, and calculates the position of the pixel point of the U and V components corresponding to the Y component corresponding to the Y component while processing the pixel component Y component value in parallel according to the YUV format. And calculating the values of the U and V components according to the positions of the pixel points where the U and V components are calculated, which reduces the time used for image processing and improves the execution efficiency.
  • Embodiment 3 of the present invention provides an embodiment of image processing in a virtual machine scenario.
  • the virtual machine 580a, 580b ... 580n is executed on the server 501.
  • the server 501 running the virtual machine mainly includes a hardware platform 550, a virtual machine monitor platform 551, and a virtual machine execution space 552.
  • the hardware platform 550 includes a service
  • the hard disk 560, the CPU 561, the video card 562, the network card 563, the memory RAM 564, and the like in the physical structure of the device 501.
  • the virtual machine monitor platform 551 and the virtual machine execution space 552 provide a hardware platform and a software platform of the virtual machine, respectively.
  • the virtual machine monitor platform 551 includes a plurality of virtual machine monitors 570a, 570b ... 570n.
  • the virtual machine monitor platform 551 is an intermediate layer between the physical hardware and the virtual machine and is responsible for coordinating the access of each virtual machine to the server hardware.
  • a virtual hardware platform 571 of a virtual machine (VM) 580a is implemented in a virtual machine monitor (VMM) 570a.
  • the virtual hardware platform 571 includes a virtual hard disk 572, a CPU 573, a memory RAM 574, a graphics card 575, a network card 576, and the like.
  • the software system of virtual machine 580a runs on virtual hardware platform 571.
  • the virtual machine execution space 552 runs a plurality of virtual machines 580a, 580b ...
  • the guest operating system 581 runs in the virtual machine 580a, the guest operating system 581 includes a device driver layer 582, the graphics card driver 583 is installed, and The network card driver 584 or the like, when the user accesses the virtual machine on the server 501 at the client, the virtual machine 580a is assigned to the user of the client.
  • the desired image data is sent to the graphics card 575 through the graphics command interface 586, and then the image data is processed by the server 501 graphics card 562.
  • the virtual machine 580a needs to display an image, and the image display request instruction is sent from the virtual machine to the server 501 running the virtual machine;
  • the server 501 schedules the video card resource, and acquires the image data requested by the user from the graphics card 562;
  • the server 501 again schedules the video card 562 to start the pre-processing of the image encoding to the Y U V format.
  • the graphics card 562 starts a large number of concurrent threads, using one pixel corresponding to one.
  • the calculation of the gamma component value is performed for each pixel in the image (the processing efficiency is high because a large number of threads are executed concurrently on the graphics card).
  • For each thread in addition to calculating the ⁇ component value, it is also based on the currently processed pixel.
  • the position of the point calculates the position coordinates of another pixel point that needs to be calculated for the U and V component values, and finds the pixel point that needs to calculate the U and V component values according to the calculated position coordinate, and calculates the Y component value at the current pixel point.
  • the U and V component values of the found pixel points are calculated in the thread; for details, refer to the description of Embodiment 1 of the present invention.
  • the embodiment of the present invention further includes: after the image format conversion, copying the converted YUV image to an encoding hardware, that is, an image encoder; the image encoder performs image encoding on the converted YUV image; and the image encoder will encode the completed image.
  • the server 501 performs subsequent processing; the server 501 passes the encoded image to the client of the virtual machine 580a, and displays the image to the user.
  • the server 501 shown in FIG. 5 includes a CPU 561 and a memory 564.
  • the connection diagram used in this embodiment omits the connection relationship of some components, but those skilled in the art can understand that, in order to achieve the object of the present invention.
  • the server structure diagram actually has a connection relationship between components in order to implement communication.
  • the CPU 561 and the memory 564 are connected by a bus, and the memory 564 stores computer execution instructions.
  • the CPU 561 executes computer instructions stored in the memory 564 to cause the server 501 to execute the steps described in the embodiment of the present invention.
  • the embodiment of the present invention is specifically implemented by the parallel processing capability of the graphics card 562 of the server 501.
  • the computer instructions executed by the CPU 561 and stored in the memory 564 may be stored in a computer readable medium.
  • the type of the computer readable medium is not specifically limited in the present invention.
  • the server performs parallel processing on the image format conversion, and calculates the position of the pixel point of the U and V components corresponding to the Y component corresponding to the Y component while processing the pixel component Y component value in parallel according to the YUV format. And calculating the U according to the position of the pixel point where the U and V components are calculated.
  • the value of the V component reduces the time used for image processing and improves execution efficiency.
  • the remote desktop connection refers to a remote computer logging in to another computer, remotely controlling the login computer, such as the remote desktop connection service provided by Microsoft®.
  • the remote computer is called a remote terminal, and the computer that is remotely controlled by the login is called a server.
  • the main structure of the server 700 includes a central processing unit CPU 710, a memory 720, a graphics card 730, and a network card 740.
  • the steps of performing image processing in the scenario of the embodiment of the present invention are as shown in FIG. 8:
  • the server 700 needs to display an image, and the image display request command is sent from the remote terminal to the server 700 that controls the operation of the remote terminal;
  • the server 700 schedules the video card 730 resource, and acquires the image data requested by the user from the graphics card 730;
  • the server 700 again schedules the graphics card 730 to start the conversion process to the Y U V format before the image encoding;
  • the graphics card 730 starts a large number of concurrent threads, and performs a YUV format conversion process by using one pixel corresponding to one processing thread: Calculating the Y component value for each pixel in the image (because a large number of threads are concurrent on the graphics card) Execution, so the processing efficiency is very high), for each thread, in addition to calculating the Y component value, it is also necessary to calculate the position coordinates of another pixel point that needs to be calculated for the U and V component values according to the position of the currently processed pixel point.
  • the subsequent steps of the embodiment of the present invention include: after the image format conversion, copying the converted YUV image back to the host; the host performs image encoding on the converted YUV image; and the host transmits the encoded image. To the remote terminal, the image is displayed to the user through the remote terminal.
  • the server 700 shown in FIG. 7 includes a CPU 710 and a memory 720.
  • the components used in this embodiment omits some components, but those skilled in the art can understand that, in order to achieve the object of the present invention, Based on the server structure diagram shown in FIG. 7, each specific component actually included in the server 700 is determined, and a connection relationship exists between the specific components for implementing communication.
  • the CPU 710 and the memory 720 are connected by a bus, and the memory 720 stores computer execution instructions.
  • the CPU 710 executes computer instructions stored in the memory 720, so that the server 700 performs the steps described in the embodiment of the present invention. .
  • the embodiment of the present invention is specifically implemented by the parallel processing capability of the graphics card 730 of the server 700.
  • the computer instructions stored in the memory 720, which are executed by the CPU 710, may be stored in a computer readable medium, and the type of the computer readable medium is not specifically limited.
  • the server of the embodiment of the present invention performs parallel processing on the image format conversion, and calculates the position of the pixel point of the U and V components corresponding to the Y component corresponding to the Y component while processing the pixel component Y component value in parallel according to the YUV format. And calculating the values of the U and V components according to the positions of the pixel points where the U and V components are calculated, which reduces the time used for image processing and improves the execution efficiency.
  • the graphics card that can be used for the parallel processing of the pixel points in the above embodiments of the present invention can also be replaced by a central processing unit having multi-thread parallel processing capability.
  • a central processing unit having multi-thread parallel processing capability For the specific embodiment, refer to the embodiments of the present invention. The description of the processing manner is not repeated herein.

Landscapes

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

Abstract

本发明提供了一种图像处理方法、装置及计算机可读介质,涉及图像处理技术领域。该方法包括:启动N个线程分别计算待处理图像的N个像素点的Y分量值;所述N个线程分别根据所述N个像素点的位置,确定需要计算U、V分量值的像素点的位置;所述N个线程分别根据所述需要计算U、V分量值的像素点的位置,计算所述需要计算U、V分量值的像素点的U、V分量值;其中,N为正整数。本发明的方法、装置及计算机可读介质能够节省图像处理的时间,执行效率非常高。

Description

图像处理方法、 装置及计算机可读介质 技术领域
本发明涉及图像处理技术领域, 尤其涉及一种图像处理方 法、 装置及计算机可读介质。 背景技术
计算机图像处理普遍以像素点为单位来进行。 然而, 对于 一个图像而言, 像素点的数量通常非常巨大, 比如分辨率是
1089p的高清图像的像素点就有 1920 X 1080个,这使得对一个图 像的所有像素点进行处理需要非常巨大的运算量。
另一方面, 在图像领域, 像素点颜色的表示方式主要上有 两种格式、 即 RGB和 YUV, 其中 RGB是三原色红、 绿、 蓝的缩 写, YUV是分别代表明亮度( Luminance或 Luma )、 色调和饱和 度。 在许多图像处理中, 比如图像编码等, 需要进行将 RGB格 式转换为 YUV格式的图像预处理。
现有的 RGB格式转 YUV格式的图像预处理通常在中央处 理器 CPU中执行, 并且传统的方法是: 通过串行遍历每个像素 点来完成 Y分量的转换; 而对于 U、 V分量, 则需要在特定位置 (通常为奇数行列的交叉位置) 的像素点上进行转换。 换句话 说, 每个像素点都要计算 Y分量值, 而只有特定位置的像素点 才需要计算 U、 V分量值, 由于是串行遍历所有像素点且11、 V 分量值的计算是针对满足一定条件的像素点进行的, 导致该方 法的实现代码中出现了大量的分支, 所以该方法的执行效率非 常低。 发明内容 有鉴于此,本发明实施例提供了一种图像处理方法及装置, 可以尽量节省图像处理的时间并提高执行效率。
第一方面, 本发明实施例提供了一种图像处理方法, 包括: 启动 N个线程分别计算待处理图像的 N个像素点的 Y分量 值;
所述 N个线程分别根据所述 N个像素点的位置,确定需要计 算1;、 V分量值的像素点的位置;
所述 N个线程分别根据所述需要计算 U、 V分量值的像素点 的位置, 计算所述需要计算 U、 V分量值的像素点的 U、 V分量 值;
其中 N为正整数。
结合第一方面, 在第一种可能的实施方式中, 所述 N个线 程基于像素点 YUV分量的采样格式确定所述需要计算 U、V分量 值的像素点的位置。
结合第一方面的第一种可能的实施方式, 在第二种可能的 实施方式中, 当基于 4:2:0的 YUV分量的采样格式确定所述需要 计算 U、 V分量值的像素点的位置时, 所述需要计算 U、 V分量 值的像素点和所述 N个像素点中与所述需要计算 U、 V分量值的 像素点对应的像素点之间满足如下位置关系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy = ( Yy << 1 ) + 1,
其中, Ux、 Vx表示所述需要计算 U、 V分量值的像素点的 横坐标, Uy、 Vy表示所述需要计算 U、 V分量值的像素点的纵 坐标, Yx表示与所述需要计算 U、 V分量值的像素点对应的像 素点的横坐标, Yy表示与所述需要计算 U、 V分量值的像素点 对应的像素点的纵坐标, <<为左移运算符。
结合第一方面的第一种可能的实施方式, 在第三种可能的 实施方式中, 当基于 4:2:2的 YUV分量的采样格式确定所述需要 计算 U、 V分量所在的像素点的位置时, 所述需要计算 U、 V分 量值的像素点和所述 N个像素点中与所述需要计算 U、 V分量值 的像素, ^对应的像素点之间满足如下位置关系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy =Yy,
其中, Ux、 Vx表示所述需要计算 U、 V分量值的像素点的 横坐标, Uy、 Vy表示所述需要计算 U、 V分量值的像素点的纵 坐标, Yx表示与所述需要计算 U、 V分量值的像素点对应的像 素点的横坐标, Yy表示所述与所述需要计算 U、 V分量值的像 素点对应的像素点的纵坐标, <<为左移运算符。
第二方面, 本发明实施例提供了一种装置, 包括: 启动单元,用于启动 N个线程分别计算待处理图像的 N个像 素点的 Y分量值;
确定单元,用于利用所述 N个线程分别根据所述 N个像素点 的位置, 确定需要计算 U、 V分量值的像素点的位置; 以及 计算单元, 用于利用所述 N个线程分别根据所述需要计算 U、 V分量值的像素点的位置, 计算所述需要计算 U、 V分量值 的像素点的 U、 V分量值;
其中, N为正整数。
结合第二方面, 在第一种可能的实施方式中, 所述确定单 元具体用于基于像素点 YUV分量的采样格式确定所述需要计 算1;、 V分量值在的像素点的位置。
结合第二方面的第一种可能的实施方式, 在第二种可能的 实施方式中, 所述确定单元具体用于当基于 4:2:0的 YUV分量的 采样格式确定所述需要计算 U、 V分量值的像素点的位置时, 所 述需要计算 U、 V分量值的像素点和所述 N个像素点中与所述需 要计算 U、 V分量值的像素点对应的像素点之间满足如下位置关 系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy = ( Yy << 1 ) + 1,
其中, Ux、 Vx表示所述需要计算 U、 V分量值的像素点的 横坐标, Uy、 Vy表示所述需要计算 U、 V分量值的像素点的纵 坐标, Yx表示与所述需要计算 U、 V分量值的像素点对应的像 素点的横坐标, Yy表示与所述需要计算 U、 V分量值的像素点 对应的像素点的纵坐标, <<为左移运算符。
结合第二方面的第一种可能的实施方式, 在第三种可能的 实施方式中, 所述确定单元具体用于当基于 4:2:2的 YUV分量的 采样格式确定所述需要计算 U、 V分量值的像素点的位置时, 所 述需要计算 U、 V分量值和所述 N个像素点中与所述需要计算 U、 V分量值的像素点对应的像素点之间满足如下位置关系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy =Yy,
其中, Ux、 Vx表示所述需要计算 U、 V分量值的像素点的 横坐标, Uy、 Vy表示所述需要计算 U、 V分量值的像素点的纵 坐标, Yx表示与所述需要计算 U、 V分量值的像素点对应的像 素点的横坐标, Yy表示与所述需要计算 U、 V分量值的像素点 对应的像素点的纵坐标, <<为左移运算符。
第三方面, 本发明实施例提供了一种图像处理装置, 包括 中央处理器和存储器, 所述存储器存储计算机执行指令, 所述 中央处理器与所述存储器通过通信总线连接, 当所述图像处理 机执行指令, 使得所述图像处理装置执行发明内容第一方面所 述的任一方法。 第四方面, 本发明实施例提供了一种计算机可读介质, 所 述计算机可读介质包含计算机执行指令, 当计算机的中央处理 器执行所述计算机执行指令时, 所述计算机执行指令用于使计 算机执行发明内容第一方面所述的任一方法。
本发明实施例的方法及装置通过对图像格式的转换进行并 行处理, 降低了图像处理所使用的时间, 提高了执行效率。 附图说明
图 1为本发明实施例 1的图像处理方法的流程图;
图 2为本发明实施例 1的图像处理方法的一种逻辑示意图; 图 3为本发明实施例 1的图像处理方法的另一种逻辑示意 图;
图 4为本发明实施例 2的图像处理装置的结构框图;
图 5为实施例 3的图像处理装置的应用硬件环境的系统架构 示意图;
图 6为在实施例 3的场景下进行图像处理的时序图;
图 7为实施例 4的图像处理装置在的应用硬件环境的系统架 构示意图;
图 8为在实施例 4的场景下进行图像处理的时序图。 具体实施方式
本发明提出的图像处理方法及装置, 结合附图及实施例详 细说明如下。
随着计算机的飞速发展, 作为计算机的组件之一的显卡的 计算能力也正在飞速增长, 目前显卡的运算能力已经完全超越 了 CPU。 显卡的核心是图像处理单元( Graphic Processing Unit , GPU ) , 为了能够充分利用 GPU的运算能力, 已知有为 GPU配套 一个并行框架、 即计算标准设备架构 ( Compute Unified Device Architecture , CUDA ) , 以释放 GPU的运算能力, 从而能够不占 用 CPU资源来进行诸如将 RGB图像转换为 YUV图像的图像处 理。 由于在 CUDA架构下, 显卡所具有的大量处理核心被规划 为大量并发线程的计算资源, 可以以并行的方式进行例如图像 编码等的之前所需要进行的处理,进而降低了处理所需的时间。
实施例 1
本实施例的方法基于配套了 CUDA架构的显卡, 进行将
RGB图像转换为 YUV图像的处理。
如图 1所示, 本实施例的图像处理方法包括步骤:
S 1,启动 N个线程分别计算待处理的 R G B图像的 N个像素点 的 Y分量值;
52 , 该 N个线程分别根据所处理的 N个像素点的位置, 确定 需要计算1;、 V分量值的像素点的位置; 以及
53 , 该 N个线程分别根据需要计算 U、 V分量值的像素点的 位置, 计算该需要计算1;、 V分量值的像素点的 U、 V分量值; 其中, N为正整数, 优选为能够并行执行的线程数量, 例 如基于 CUDA架构的显卡所支持的最大并行处理能力, CUDA 架构的显卡所支持的最大并行线程数为 N。 在本实施例的方法 中, 以 N个线程对 N个像素点进行并行处理的方式, 最大化的减 少图像处理的时间, 提高图像处理的执行效率。
需要说明的是, 在待处理图像的像素点的数量大于 N的情 况下, 在第一时刻完成以 N个线程对 N个像素点进行并行处理 后,在第二时刻进行以该 N个线程对下一组 N个像素点的并行处 理, 以此类推, 直至处理完全部像素点。 若未处理的像素点的 个数小于N, 例如 M, 则可由该 N个线程中的任意 M个线程来并 行执行剩余 M个像素点的处理。 以待处理的图像为包括 1920 1080个像素点的高清图像为 例, 在显卡支持并行 1080线程的情况下, N等于 1080, 此时, 处理。 然而, 如果显卡最多仅支持并行 1000个线程, 则 N等于 1000, 先由该 1000个线程执行 2073 ( = (1920 x 1080) / 1000」) 次处理 后,再由该 1000个进程中的任意 600= 1920 x 1080 - 2073 x 1000个线程对 剩余的像素点进行并行处理。
此外, 在步骤 S2中, 该需要计算 U、 V分量值的像素点的位 置基于像素点 YUV分量的采样格式确定。
以对 YUV进行采样的采样格式为 4:2:0的图像为例, 如图 2 所示, 在 4:2:0的 YUV分量的采样格式中, 每个像素点一个 Y分 量值, 每 2x2个像素点 (每两行两列相邻的 4个像素点) 共享一 个1;、 V分量值。 对于图 2所示的图像, 每个计算 Y分量值的像 素点与需要计算1;、 V分量的另一像素点之间满足如下位置关 系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy = ( Yy << 1 ) + 1,
其中, Ux、 Vx表示需要计算 U、 V分量值的像素点的横坐 标, Uy、 Vy表示需要计算 U、 V分量值的像素点的纵坐标, Yx 表示与该需要计算 U、 V分量值的像的像素点对应的像素点的横 坐标, Yy表示与该需要计算 U、 V分量值的像的像素点对应的 像素点的纵坐标, <<为左移运算符, 在运算过程中相当于坐标 值乘以 2, 也即 Ux = Vx =Yx X 2+ 1 ; Uy = Vy =Yy χ 2+ 1。
继续如图 2所示, 以针对第一行像素点的有限的线程 ( T1 -T8 ) 的处理过程为例 ( 图中虚线代表线程与像素点的对 应): 对于左上角的像素点 (坐标为 ( 0,0 ) ), 计算该像素点的 Y 分量值之后, 按照上述位置关系式可以得出该像素点对应的需 要计算 U、 V分量值的像素点的位置坐标 (图 2中所示为坐标为 ( 1 , 1 ) 的像素点;)。
需要说明的是, Y、 U以及 V分量值的计算可采用本领域所 熟知的方法, 计算公式分别为:
Y=0.30R+0.59G+0.11B ;
U=0.493 ( Β - Υ );
V=0.877 ( R - Υ );
其中, R、 G、 Β分别为待处理的 RGB图像上的像素点的红 色分量值、 绿色分量值以及蓝色分量值。
再以 YUV分量的采样格式为 4:2:2为例来进一步说明本发 明实施例的图像处理方法。
如图 3所示, 在 4:2:2的 YUV分量的采样格式中, 每个像素 点一个 Y分量值, 每 1x2个像素点 (每一行两列相邻的 2个像素 点) 共享一个1;、 V分量值。 对于图 3所示的图像, 每个计算 Y 分量值的像素点和与该像素点 Y分量对应的需要计算 U、 V分量 的像素点之间满足如下位置关系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy = Yy。
继续如图 3所示, 以针对第一行像素点的有限的线程 ( T1 -T8 ) 的处理过程为例 ( 图中虚线代表线程与像素点的对 应): 对于左上角的像素点 (坐标为 ( 0,0 ) ), 计算该像素点的 Y 分量值之后, 按照上述位置关系式可以得出该像素点对应的需 要计算 U、 V分量值的像素点的位置坐标 (图 3中所示为坐标为 ( 1 ,0 ) 的像素点)。
对于其它采样格式的 YUV图像, 可以合理地根据采样规则 来推算 γ分量像素点与需要计算1;、 V分量值的像素点之间的位 置关系, 从而为 Y、 υ、 V分量值的并行计算提供基础。 本发明实施例的方法,也可以通过 CPU的并行处理来执行。 本发明实施例的方法通过对图像格式的转换进行并行处 理, 降低了图像处理所使用的时间, 提高了执行效率; 此外, 本发明的方法能够由基于 CUDA架构的显卡执行, 不占用 CPU 资源, 从而释放有限的 CPU计算资源。
实施例 2
本实施例还提供了一种基于上述方法的图像处理装置, 如 图 4所示, 该装置包括: 启动单元 100、 确定单元 200以及计算单 元 300。 具言之:
启动单元 100, 用于启动 N个线程计算该待处理图像的 N个 像素点的 Y分量值;
确定单元 200, 用于利用该 N个线程分别才 据该 N个像素点 的位置, 确定需要计算 U、 V分量值的像素点的位置;
计算单元 300,用于利用该 N个线程分别根据该需要计算 U、 V分量值的像素点的位置, 计算该需要计算1;、 V分量值的像素 点的 U、 V分量值。
本发明实施例的装置通过对图像格式的转换进行并行处 理, 降低了图像处理所使用的时间, 提高了执行效率。
进一步地,本发明实施例的确定单元 200具体用于基于像素 点 YUV分量的采样格式确定所述需要计算 U、V分量值的像素点 的位置。 其中一种情况为确定单元 200具体用于当基于 4:2:0的 YUV分量的采样格式确定所述需要计算 U、V分量值的像素点的 位置时, 所述需要计算 U、 V分量值的像素点和所述 N个像素点 中与所述需要计算 U、 V分量值的像素点对应的像素点之间满足 如下位置关系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy = ( Yy << 1 ) + 1, 其中, Ux、 Vx表示所述需要计算 U、 V分量值的像素点的 横坐标, Uy、 Vy表示所述需要计算 U、 V分量值的像素点的纵 坐标, Yx表示与所述需要计算 U、 V分量值的像素点对应的像 素点的横坐标, Yy表示与所述需要计算 U、 V分量值的像素点 对应的像素点的纵坐标, <<为左移运算符。
另一种实施场景中, 计算单元 300具体用于当基于 4:2:2的 YUV分量的采样格式确定所述需要计算 U、V分量值的像素点的 位置时, 所述需要计算 U、 V分量值的像素点和所述 N个像素点 中与所述需要计算 U、 V分量值的像素点对应的像素点之间满足 如下位置关系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy =Yy,
其中, Ux、 Vx表示所述需要计算 U、 V分量值的像素点的 横坐标, Uy、 Vy表示所述需要计算 U、 V分量值的像素点的纵 坐标, Yx表示与所述需要计算 U、 V分量值的像素点对应的像 素点的横坐标, Yy表示与所述需要计算 U、 V分量值的像素点 对应的像素点的纵坐标, <<为左移运算符。
本发明实施例的装置通过对图像格式的转换进行并行处 理, 并根据 YUV采用格式在并行处理像素点 Y分量值的同时计 算 Y分量对应的需要计算的 U、 V分量的所在的像素点的位置, 并根据需要计算的 U、 V分量的所在的像素点的位置计算该 U、 V分量的值, 降低了图像处理所使用的时间, 提高了执行效率。
实施例 3
本发明实施例 3提供了一种在虚拟机场景下图像处理的实 施例, ^口图 5所示, 务器 501上运行虚 以机 580a、 580b ...580n。 运行虚拟机的服务器 501主要包括硬件平台 550、 虚拟机监视器 平台 551和虚拟机执行空间 552。 其中, 硬件平台 550中包括服务 器 501物理结构中的硬盘 560、 CPU 561、 显卡 562、 网卡 563、 以及存储器 R A M 564等。虚拟机监视器平台 551和虚拟机执行空 间 552分别提供了虚拟机的硬件平台和软件平台。虚拟机监视器 平台 551包含了多个虚拟机监视器 570a、 570b ...570η , 虚拟机监 视器平台 551是物理硬件和虚拟机之间的中间层,负责协调各个 虚拟机对服务器硬件的访问。 虚拟机监视器 ( VMM ) 570a中实 现虚拟机 ( VM ) 580a的虚拟硬件平台 571, 虚拟硬件平台 571 中包含了虚拟出来的硬盘 572、 CPU 573、 存储器 RAM 574、 显 卡 575和网卡 576等。 虚拟机 580a的软件系统运行在虚拟硬件平 台 571上。 虚拟机执行空间 552中运行了多个虚拟机 580a、 580b ...580η , 客户操作系统 581运行于虚拟机 580a中, 客户操作 系统 581包含了一个设备驱动层 582, 安装了显卡驱动 583、 以及 网卡驱动 584等,当用户在客户端访问服务器 501上的虚拟机时, 虚拟机 580a分配给该客户端的用户。
当客户端访问虚拟机 580a时, 虚拟机 580a需要进行图像处 理时, 通过图形指令接口 586将所需图像数据发送到显卡 575, 然后将图像数据由服务器 501显卡 562处理。
如图 6所示,图 5所示的系统依照实施例 1中的图像处理方法 进行图像编码处理的过程如下:
A1. 用户操作虚拟机 580a, 虚拟机 580a需要显示图像, 图 像显示请求指令从虚拟机发送至该虚拟机运行的服务器 501 ;
A2. 服务器 501收到该图像显示请求指令后, 调度显卡资 源, 向显卡 562获取用户所请求的图像数据;
A3. 获取该图像数据完成后, 服务器 501再次调度显卡 562 , 开始进行图像编码前的转换为 Y U V格式的预处理;
A4. 显卡 562启动大量并发线程, 采用一个像素点对应一 像中的每个像素点都进行 γ分量值的计算 ( 由于是显卡上大量 线程并发执行, 所以处理效率很高), 对每个线程而言, 除了计 算 Υ分量值, 还根据当前处理的像素点的位置计算出需要进行 U、 V分量值计算的另一像素点的位置坐标, 并根据计算出的位 置坐标找到需要计算 U、 V分量值的该像素点, 在当前像素点 Y 分量值计算的线程中就计算出所找到的像素点的 U、 V分量值; 具体可以参见本发明实施例 1的描述。 本发明实施例后续还包 括: 图像格式转换后, 将转换得到的 YUV图像拷贝到编码硬件 即图像编码器; 图像编码器对转换后的 YUV图像进行图像编 码; 图像编码器将编码完成后的图像返回给服务器 501, 由服务 器 501做后续处理; 服务器 501将编码后的图像传递给虚拟机 580a的客户端, 显示图像给用户。
本发明实施例中, 图 5所示的服务器 501包括 CPU 561和存 储器 564, 本实施例中所使用的图附省略了部分组件的连接关 系, 但是本领域技术人员可以理解, 为了实现本发明目的, 图 5 所示服务器结构图中实际上各组件之间为实现通信存在连接关 系。 其中, CPU 561和存储器 564通过总线连接, 存储器 564中 存储计算机执行指令, 当服务器 501运行时, CPU 561执行存储 在存储器 564中的计算机指令, 使服务器 501执行本发明实施例 中所描述的步骤。本发明实施例中具体是通过服务器 501的显卡 562的并行处理能力来实现的。 其中, CPU 561执行的存储在存 储器 564中的该计算机指令, 可以存储在计算机可读介质中, 对 计算机可读介质的类型本发明不作具体限定。
本发明实施例服务器通过对图像格式的转换进行并行处 理, 并根据 YUV采用格式在并行处理像素点 Y分量值的同时计 算 Y分量对应的需要计算的 U、 V分量的所在的像素点的位置, 并根据需要计算的 U、 V分量的所在的像素点的位置计算该 U、 V分量的值, 降低了图像处理所使用的时间, 提高了执行效率。 实施例 4
本实施例提供了一种在远程桌面连接环境中的应用。 所述 远程桌面连接是指远程计算机登陆到另一台计算机, 远程控制 登陆的计算机, 如微软 ®公司提供的远程桌面连接服务。 这里 称远程计算机为远程终端, 称被登陆远程控制的计算机为服务 器。 如图 7所示, 为服务器 700的主要结构, 包括中央处理器 CPU 710、 存储器 720、 显卡 730和网卡 740。 在本发明实施例场景下 进行图像处理的步骤如图 8所示:
B 1. 用户操作远程终端, 服务器 700需要显示图像, 图像显 示请求指令从远程终端发送至控制该远程终端运行的服务器 700;
B2. 服务器 700收到该请求指令后, 调度显卡 730资源, 向 显卡 730获取用户所请求的图像数据;
B3. 获取该图像数据完成后,服务器 700再次调度显卡 730, 开始进行图像编码前的向 Y U V格式的转换处理;
B4. 显卡 730启动大量并发线程,采用一个像素点对应一个 处理线程的处理方式执行 YUV格式的转换处理: 对图像中的每 个像素点都进行 Y分量值的计算 (由于是显卡上大量线程并发 执行, 所以处理效率很高), 对每个线程而言, 除了计算 Y分量 值, 还需要根据当前处理的像素点的位置计算出需要进行 U、 V 分量值计算的另一像素点的位置坐标, 并根据计算出的位置坐 标找到需要计算1;、 V分量值的该像素点, 在当前像素点 Y分量 值计算的线程中就计算出所找到的像素点的1;、 V分量值; 具体 描述可以参见本发明实施例 1。 本发明实施例后续步骤包括: 图像格式转换后, 将转换得到的 YUV图像拷贝回主机; 主机 对转换后的 YUV图像进行图像编码; 主机将编码后的图像传递 给远程终端, 通过该远程终端显示图像给用户。
本发明实施例中, 图 7所示的 务器 700包括 CPU 710和存 储器 720, 本实施例中所使用的图附省略了部分组件, 但是本领 域技术人员可以理解, 为了实现本发明目的, 可以在图 7所示服 务器结构图基础上, 确定服务器 700实际包括的各具体组件, 以 及各具体组件之间为实现通信存在连接关系。 其中, CPU 710 和存储器 720通过总线连接,存储器 720中存储计算机执行指令, 当服务器 700运行时, CPU 710执行存储在存储器 720中的计算 机指令, 使服务器 700执行本发明实施例中所描述的步骤。 本发 明实施例中具体是通过服务器 700的显卡 730的并行处理能力来 实现的。 其中, CPU 710执行的存储在存储器 720中的该计算机 指令, 可以存储在计算机可读介质中, 对计算机可读介质的类 型本发明不作具体限定。
本发明实施例的服务器通过对图像格式的转换进行并行处 理, 并根据 YUV采用格式在并行处理像素点 Y分量值的同时计 算 Y分量对应的需要计算的 U、 V分量的所在的像素点的位置, 并根据需要计算的 U、 V分量的所在的像素点的位置计算该 U、 V分量的值, 降低了图像处理所使用的时间, 提高了执行效率。
本发明上述各实施例中描述的可以实现对像素点进行并行 处理的显卡, 也可以用具有多线程并行处理能力的中央处理器 来代替, 具体实施例方式可以参见本发明中各实施例对显卡处 理方式的描述, 本发明实施例在此不再赘述。
以上实施方式仅用于说明本发明,而并非对本发明的限制, 有关技术领域的普通技术人员, 在不脱离本发明的精神和范围 的情况下, 还可以做出各种变化和变型, 因此所有等同的技术 方案也属于本发明的范畴, 本发明的专利保护范围应由权利要 求限定。

Claims

权 利 要 求 书
1、 一种图像处理方法, 其特征在于, 包括:
启动 N个线程分别计算待处理图像的 N个像素点的 Y分量 值;
所述 N个线程分别根据所述 N个像素点的位置,确定需要计 算1;、 V分量值的像素点的位置;
所述 N个线程分别根据所述需要计算 U、 V分量值的像素点 的位置, 计算所述需要计算 U、 V分量值的像素点的 U、 V分量 值;
其中, N为正整数。
2、 如权利要求 1所述的方法, 其特征在于, 所述 N个线程 基于像素点 YUV分量的采样格式确定所述需要计算 U、V分量值 的像素点的位置。
3、 如权利要求 2所述的方法, 其特征在于, 当基于 4:2:0的 YUV分量的采样格式确定所述需要计算 U、V分量值的像素点的 位置时, 所述需要计算 U、 V分量值的像素点和所述 N个像素点 中与所述需要计算 U、 V分量值的像素点对应的像素点之间满足 如下位置关系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy = ( Yy << 1 ) + 1,
其中, Ux、 Vx表示所述需要计算 U、 V分量值的像素点的 横坐标, Uy、 Vy表示所述需要计算 U、 V分量值的像素点的纵 坐标, Yx表示与所述需要计算 U、 V分量值的像素点对应的像 素点的横坐标, Yy表示与所述需要计算 U、 V分量值的像素点 对应的像素点的纵坐标, <<为左移运算符。
4、 如权利要求 2所述的方法, 其特征在于, 当基于 4:2:2的 YUV分量的采样格式确定所述需要计算 U、V分量值的像素点的 位置时, 所述需要计算 U、 V分量值的像素点和所述 N个像素点 中与所述需要计算 U、 V分量值的像素点对应的像素点之间满足 如下位置关系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy =Yy,
其中, Ux、 Vx表示所述需要计算 U、 V分量值的像素点的 横坐标, Uy、 Vy表示所述需要计算 U、 V分量值的像素点的纵 坐标, Yx表示与所述需要计算 U、 V分量值的像素点对应的像 素点的横坐标, Yy表示与所述需要计算 U、 V分量值的像素点 对应的像素点的纵坐标, <<为左移运算符。
5、 一种图像处理装置, 其特征在于, 包括: 启动单元, 用 于启动 N个线程分别计算待处理图像的 N个像素点的 Y分量值; 确定单元,用于利用所述 N个线程分别根据所述 N个像素点 的位置, 确定需要计算 U、 V分量值的像素点的位置; 以及
计算单元, 用于利用所述 N个线程分别根据所述需要计算 U、 V分量值的像素点的位置, 计算所述需要计算 U、 V分量值 的像素点的 U、 V分量值;
其中, N为正整数。
6、 如权利要求 5所述的装置, 其特征在于, 所述确定单元 具体用于基于像素点 YUV分量的采样格式确定所述需要计算 U、 V分量值的像素点的位置。
7、 如权利要求 6所述的装置, 其特征在于, 所述确定单元 具体用于当基于 4:2:0的 YUV分量的采样格式确定所述需要计 算1;、 V分量值的像素点的位置时, 需要计算1;、 V分量值的像 素点和所述 N个像素点中与所述需要计算 U、 V分量值的像素点 对应的像素点之间满足如下位置关系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy = ( Yy << 1 ) + 1, 其中, Ux、 Vx表示所述需要计算 U、 V分量值的像素点的 横坐标, Uy、 Vy表示所述需要计算 U、 V分量值的像素点的纵 坐标, Yx表示与所述需要计算 U、 V分量值的像素点对应的像 素点的横坐标, Yy表示与所述需要计算 U、 V分量值的像素点 对应的像素点的纵坐标, <<为左移运算符。
8、 如权利要求 6所述的装置, 其特征在于, 所述确定单元 具体用于当基于 4:2:2的 YUV分量的采样格式确定所述需要计 算1;、 V分量值的像素点的位置时, 所述需要计算 U、 V分量值 的像素点和所述 N个像素点中与所述需要计算 U、 V分量值的像 素点对应的像素点之间满足如下位置关系:
Ux = Vx = ( Yx << 1 ) + 1,
Uy = Vy =Yy,
其中, Ux、 Vx表示所述需要计算 U、 V分量值的像素点的 横坐标, Uy、 Vy表示所述需要计算 U、 V分量值的像素点的纵 坐标, Yx表示与所述需要计算 U、 V分量值的像素点对应的像 素点的横坐标, Yy表示与所述需要计算 U、 V分量值的像素点 对应的像素点的纵坐标, <<为左移运算符。
9、 一种图像处理装置, 其特征在于, 包括中央处理器和存 储器, 所述存储器存储计算机执行指令, 所述中央处理器与所 述存储器通过通信总线连接, 当所述图像处理装置运行时, 所 得所述图像处理装置执行权利要求 1至 4任一所述的方法。
10、 一种计算机可读介质, 其特征在于, 所述计算机可读 介质包含计算机执行指令, 当计算机的中央处理器执行所述计 算机执行指令时, 所述计算机执行指令用于使计算机执行权利 要求 1至 4任一所述的方法。
PCT/CN2012/084014 2012-11-02 2012-11-02 图像处理方法、装置及计算机可读介质 WO2014067138A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201280003357.4A CN103918007A (zh) 2012-11-02 2012-11-02 图像处理方法、装置及计算机可读介质
PCT/CN2012/084014 WO2014067138A1 (zh) 2012-11-02 2012-11-02 图像处理方法、装置及计算机可读介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/084014 WO2014067138A1 (zh) 2012-11-02 2012-11-02 图像处理方法、装置及计算机可读介质

Publications (1)

Publication Number Publication Date
WO2014067138A1 true WO2014067138A1 (zh) 2014-05-08

Family

ID=50626357

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/084014 WO2014067138A1 (zh) 2012-11-02 2012-11-02 图像处理方法、装置及计算机可读介质

Country Status (2)

Country Link
CN (1) CN103918007A (zh)
WO (1) WO2014067138A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111626938A (zh) * 2020-06-04 2020-09-04 Oppo广东移动通信有限公司 图像插值方法、图像插值装置、终端设备及存储介质
CN113538215A (zh) * 2021-06-11 2021-10-22 展讯半导体(成都)有限公司 图像格式的转换方法、装置及系统、电子设备及存储介质

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102118624A (zh) * 2011-03-08 2011-07-06 天脉聚源(北京)传媒科技有限公司 一种从rgb色彩空间到yuv色彩空间的图像转换方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5838299A (en) * 1995-05-03 1998-11-17 Apple Computer, Inc. RGB/YUV video convolution system
CN101415117B (zh) * 2008-11-18 2010-06-09 浙江大学 基于gpgpu的高真实感图像的传输方法
CN101867833A (zh) * 2010-06-12 2010-10-20 北京东方艾迪普科技发展有限公司 一种视频图像格式转换方法和装置

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102118624A (zh) * 2011-03-08 2011-07-06 天脉聚源(北京)传媒科技有限公司 一种从rgb色彩空间到yuv色彩空间的图像转换方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SHAO, DAN ET AL.: "Inter-transformation between YUV and RGB", JOURNAL OF CHANGCHUN UNIVERSITY, vol. 14, August 2004 (2004-08-01), pages 51 - 53 *
SHEN, JUN ET AL.: "YUV in Computer Systems", COMPUTER ENGINEERING, vol. 26, January 2000 (2000-01-01), pages 94 - 96 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111626938A (zh) * 2020-06-04 2020-09-04 Oppo广东移动通信有限公司 图像插值方法、图像插值装置、终端设备及存储介质
CN111626938B (zh) * 2020-06-04 2023-04-07 Oppo广东移动通信有限公司 图像插值方法、图像插值装置、终端设备及存储介质
CN113538215A (zh) * 2021-06-11 2021-10-22 展讯半导体(成都)有限公司 图像格式的转换方法、装置及系统、电子设备及存储介质
CN113538215B (zh) * 2021-06-11 2022-12-27 展讯半导体(成都)有限公司 图像格式的转换方法、装置及系统、电子设备及存储介质

Also Published As

Publication number Publication date
CN103918007A (zh) 2014-07-09

Similar Documents

Publication Publication Date Title
US9786255B2 (en) Dynamic frame repetition in a variable refresh rate system
US9427665B2 (en) Game providing server
KR20160145809A (ko) 분할된 디스플레이를 구동하는 다수의 디스플레이 파이프라인들
TWI550557B (zh) 視訊資料壓縮格式
EP3972253A1 (en) Image rendering and encoding method, and related apparatus
US20230040777A1 (en) Method and apparatus for displaying virtual landscape picture, storage medium, and electronic device
US9858889B2 (en) Color compensation circuit, display apparatus, and color compensation method
US10237563B2 (en) System and method for controlling video encoding using content information
CN112835730A (zh) 图像存储、内存分配、图像合成方法、装置、设备及介质
CN114968152B (zh) 减少virtio-gpu额外性能损耗的方法
CN114567784B (zh) 一种用于飞腾显卡的vpu视频解码输出方法及系统
US20120218292A1 (en) System and method for multistage optimized jpeg output
WO2014067138A1 (zh) 图像处理方法、装置及计算机可读介质
US9250683B2 (en) System, method, and computer program product for allowing a head to enter a reduced power mode
TW200414754A (en) System and method for processing memory with YCbCr 4:2:0 planar video data format
WO2024022391A1 (zh) 多媒体数据传输方法、装置、电子设备及存储介质
CN108509112B (zh) 菜单的显示方法及装置、显示设备及存储介质
KR20210032857A (ko) 전자 장치 및 그 제어 방법
CN111683077B (zh) 虚拟现实设备及数据的处理方法
KR20150019315A (ko) 물리적으로 망 분리된 컴퓨터들을 하나의 모니터 화면에서 제어하는 방법 및 그 보안 시스템
CN117453170B (zh) 一种显示控制方法、装置及存储介质
WO2024041246A1 (zh) 基于中心凹原则的图像处理系统、方法及存储介质
WO2023087827A1 (zh) 渲染方法及装置
WO2024109247A1 (zh) 图像处理方法及装置
US11622113B2 (en) Image-space function transmission

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: 12887395

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: 12887395

Country of ref document: EP

Kind code of ref document: A1