WO2022028283A1 - Image frame coding method, object search method, computer device, and storage medium - Google Patents

Image frame coding method, object search method, computer device, and storage medium Download PDF

Info

Publication number
WO2022028283A1
WO2022028283A1 PCT/CN2021/108842 CN2021108842W WO2022028283A1 WO 2022028283 A1 WO2022028283 A1 WO 2022028283A1 CN 2021108842 W CN2021108842 W CN 2021108842W WO 2022028283 A1 WO2022028283 A1 WO 2022028283A1
Authority
WO
WIPO (PCT)
Prior art keywords
encoding
image frame
processing
data blocks
data
Prior art date
Application number
PCT/CN2021/108842
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 WO2022028283A1 publication Critical patent/WO2022028283A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/189Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
    • H04N19/196Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding being specially adapted for the computation of encoding parameters, e.g. by averaging previously computed encoding parameters

Definitions

  • the present application relates to the technical field of data processing, and in particular, to an image frame encoding method, an image search method, an object search method, a computer device, and a computer-readable storage medium.
  • video technology is developing rapidly and is widely used.
  • video images are encoded and then used in various video application scenarios.
  • Video coding refers to converting the original video format file into another video format file by performing discrete cosine transform, quantization and entropy coding on the video image frame. Its purpose is to improve the compression rate of the video as much as possible and reduce the volume of the video file under the premise of ensuring the encoding quality.
  • the present application is made to provide an image processing method, an image search method, an object search method, a computer device, and a computer-readable storage medium that overcome the above problems or at least partially solve the above problems.
  • an image frame encoding method comprising:
  • the encoding processing unit Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units are synchronized perform processing;
  • the target image frame is encoded according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • a video encoding method comprising:
  • the encoding processing unit Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the image frame, and in a partial time period during which the multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
  • the encoding result of the video is obtained according to the encoding result of the image frame.
  • a video encoding method comprising:
  • the plurality of first data blocks are input in batches into four encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed.
  • the four encoding processing units respectively perform the quantization parameter calculation in the determination process of the encoding parameter of the image frame according to the reading step, the information acquisition step, the quantization parameter and the information calculation step, and the quantization parameter and the information write step, in During a part of the time period when the four encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
  • the encoding result of the video is obtained according to the encoding result of the image frame.
  • an image frame processing method comprising:
  • the multiple first data blocks are input in batches into multiple processing units that are executed in sequence; after the processing unit performs the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed, so
  • the processing unit correspondingly executes one or more steps in the processing process of the target image frame, and in a partial time period during which the multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously.
  • an image frame processing method is provided, applied to a software service platform, including:
  • the encoding processing unit Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units are synchronized perform processing;
  • the encoding result of the target video is provided based on the software service client.
  • an image frame encoding system including a frame division module, a plurality of encoding processing units and encoding modules executed in sequence;
  • the frame dividing unit configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of encoding processing units in batches;
  • the encoding processing unit is configured to correspondingly execute one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed.
  • For the processing of the data block in a part of the time period when the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
  • the encoding unit is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • a chip based on a field programmable logic gate array comprising a frame division module, a plurality of encoding processing units and encoding modules executed in sequence;
  • the frame dividing unit configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of encoding processing units in batches;
  • the encoding processing unit is configured to correspondingly execute one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed.
  • For the processing of the data block in a part of the time period when the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
  • the encoding unit is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • an electronic device comprising: a processor; and
  • a memory having executable code stored thereon which, when executed, causes the processor to perform a method as described in any of the above.
  • one or more machine-readable media having executable code stored thereon which, when executed, causes a processor to perform a method as described in any of the above.
  • a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the image frame is divided into data.
  • the block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time.
  • the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced.
  • the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
  • FIG. 1 shows a schematic diagram of a video encoding process implemented based on an FPGA in an embodiment of the present application
  • FIG. 2 shows a flowchart of an embodiment of an image frame encoding method according to Embodiment 1 of the present application
  • FIG. 3 shows a flowchart of an embodiment of an image frame encoding method according to Embodiment 2 of the present application
  • FIG. 4 shows a flowchart of an embodiment of an image frame encoding method according to Embodiment 3 of the present application
  • FIG. 5 shows a flowchart of an embodiment of a video coding method according to Embodiment 4 of the present application
  • FIG. 6 shows a flowchart of an embodiment of a video coding method according to Embodiment 5 of the present application.
  • FIG. 7 shows a flowchart of an embodiment of an image frame processing method according to Embodiment 6 of the present application.
  • FIG. 8 shows a structural block diagram of an embodiment of an image frame encoding apparatus according to Embodiment 7 of the present application.
  • FIG. 9 shows a structural block diagram showing an embodiment of a video encoding apparatus according to Embodiment 8 of the present application.
  • FIG. 10 shows a structural block diagram of an embodiment of a video encoding apparatus according to Embodiment 9 of the present application.
  • FIG. 11 shows a structural block diagram of an embodiment of an image frame processing apparatus according to Embodiment 10 of the present application.
  • FIG. 12 shows a structural block diagram of an embodiment of an image frame encoding system according to Embodiment 11 of the present application.
  • FIG. 13 shows a structural block diagram of a chip embodiment based on a field programmable logic gate array according to Embodiment 12 of the present application;
  • the encoding parameter is used to encode the video data, and may specifically include data such as frame type and quantization parameter (Quantization Parameter, QP).
  • quantization Parameter QP
  • the quantization parameter has an important influence on the video quality. For each coding object, the smaller the quantization parameter is, the higher the quantization accuracy is, and the video quality will be correspondingly better, but at the same time, the bandwidth cost of the encoder will also increase. big. Therefore, by reasonably allocating quantization parameters, bandwidth costs can be saved while ensuring video quality. For example, important regions in the video can be allocated smaller quantization parameters, and unimportant regions can be allocated larger quantization parameters.
  • selecting a suitable set of coding parameters for the encoder plays an important role in improving the video quality and controlling the compression rate of the coding.
  • the embodiment of the present application adopts the CUTREE (block tree) algorithm to calculate the coding parameters.
  • the basic principle of the CUTREE algorithm is to allocate a reasonable amount of information to each block by analyzing the relative information amount of each block of the current image frame and other image frames.
  • the coding parameters of the CUTREE algorithm can greatly improve the video quality.
  • the embodiments of the present application use multiple encoding processing units to perform the encoding parameter determination process in the processing process of the CUTREE algorithm, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the encoding processing unit is the main body of each unit that processes different steps. From the application level, it can be understood as a pipeline that performs functions corresponding to each step, and the process of determining encoding parameters is allocated to multiple pipelines with sequential execution.
  • the process of determining the encoding parameters may be divided into four steps: a parameter reading step, an information amount acquisition step, a data calculation step, and a data exchange step.
  • the parameter reading step and the information amount obtaining step are used to determine the basis data used in the calculation of encoding parameters
  • the data calculation step completes the calculation of the encoding parameters
  • the data exchange step saves the encoding parameters for subsequent encoding calls.
  • encoding processing units are respectively used to perform the above steps.
  • four encoding processing units may be set to perform the above four steps respectively. It can be understood that, in the specific implementation, there may be different step division methods for the process of determining the encoding parameters, and the number of encoding processing units may also be set according to actual requirements.
  • the image frame is divided into data blocks. Since the data blocks corresponding to the currently processed image frame and the reference image frame are involved, the current image frame to be processed corresponds to the first data block. block, which corresponds the reference image frame to the second data block.
  • the first data blocks are input in batches into multiple encoding processing units executed in sequence, and after processing by the multiple encoding processing units, encoding parameters corresponding to the data blocks can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit processes the data blocks entered in the same batch at the same time, and before a data block is processed by multiple encoding processing units, the processing of the next data block in the encoding processing unit is started, so that the The processing of multiple batches of data blocks can be performed simultaneously.
  • the coding processing unit is designed to execute the processing of the next batch of data blocks after processing the previous batch of data blocks, and execute the processing part in multiple coding processing units. During the time period, at least two encoding processing units perform processing synchronously.
  • the processing time of multiple data blocks corresponding to the target image frame to be processed in the encoding processing unit is, the processing time of the first data block in all encoding processing units is the same as the processing time of the other encoding processing units.
  • the summation of the sum of the processing time of the first data block in the last coding processing unit greatly improves the processing efficiency compared with the frame-by-frame processing method.
  • the embodiment of the present application can greatly shorten the time spent for determining the encoding parameters, and improve the efficiency of video encoding (compared with the prior art, the comparison shows that the time is increased by several times) ), while reducing the processing delay of the data block. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the target image frame can be expressed as the difference between the target image frame and a certain image frame as the reference image frame.
  • the difference of the image content between the two (which can be expressed as the amount of information transmitted), on the contrary, the target image frame is obtained according to the difference of the image content and the reference image frame. Therefore, when the target image frame is divided into data blocks, a specific area of the target image frame can be divided into a plurality of first data blocks, wherein the target area is the content of the target image frame that changes relative to the reference image frame. area.
  • the above-mentioned inputting the first data blocks into the encoding processing unit in batches can be multiple data blocks as a batch, or a data block as a batch, which can achieve the effect of simultaneously processing data blocks of different batches .
  • time is wasted. Therefore, one data block is used as a batch, and multiple data blocks are The first data block is input to the data processing unit one by one for data processing, which can better improve processing efficiency.
  • the coding system using this structure can save 10%-15% of the coding bit rate on average under the premise of the same video quality.
  • the video encoding process also needs to update the total amount of information of the reference image frame in real time to ensure the information of the reference image frame used by each encoding unit.
  • the quantity is the latest accurate data.
  • the processing process of the CUTREE algorithm is divided into two parts. One is to determine the coding parameters (mainly quantization parameters), and calculate the quantization parameters of the first data block according to the information amount and related information of the current first data block. The second is the amount of superimposed information.
  • the total amount of information of the second data block can also be called the amount of CUTREE information, which is different from the amount of information in the traditional sense. The more times a block is superimposed, the greater the amount of information. The smaller the value, the higher the importance of this block, and the need for high-quality encoding.
  • the above encoding processing unit may also correspondingly execute one or more steps in the process of determining the total information content of the reference image frame of the target image frame, and the parameter reading step and the information content obtaining step may also correspond to reading the reference image frame.
  • the information determines the basis data used, and the data interaction step is also used to save the reference information for invoking during encoding.
  • the calculation of the total information amount of the reference frame can be performed before the determination of the coding parameters, and the execution order can also be set according to actual needs.
  • the embodiments of the present application can be deployed on a processing chip, for example, an FPGA (Field Programmable Gate Array, programmable logic device) chip, and the chip can be further deployed on a video encoding device.
  • a processing chip for example, an FPGA (Field Programmable Gate Array, programmable logic device) chip
  • the chip can be further deployed on a video encoding device.
  • the device has certain computing capabilities, and the device can It is a user-side terminal, conventional server, cloud server, cloud host, virtual center, etc.
  • the video encoded by the chip can be further transmitted over the network and used for terminal playback and video processing of video applications.
  • FIG. 1 a schematic diagram of implementing a video encoding process based on an FPGA in an embodiment of the present application is shown.
  • Four encoding processing units are deployed on the FPGA chip, namely the first encoding processing unit, the second encoding processing unit, the third encoding processing unit and the fourth encoding processing unit, respectively corresponding to the parameter reading in the process of determining the encoding parameters steps, information acquisition steps, data calculation steps, and data interaction steps.
  • the target image frame input to the FPGA chip is first divided into multiple first data blocks.
  • the video frame is divided into five first data blocks, namely CU0, CU1, CU2, CU3 and CU4.
  • the five first data blocks are input into multiple encoding processing units in batches, and after the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed.
  • the first data block CU0 ranked first enters the first encoding processing unit to perform the parameter reading step. At this time, other encoding processing units have no processing tasks.
  • CU0 is processed by the first encoding processing unit, Continue to enter the second encoding processing unit for processing, and the idle first encoding processing unit continues to process CU1.
  • the processing procedure is to sequentially enter each encoding processing unit for processing, and for each encoding processing unit, the processing procedure is to sequentially process each CU, and continue processing the next CU after processing the previous CU.
  • the CU obtains the encoding parameters corresponding to the respective pairs, and further obtains the encoding result of the image frame according to the encoding result of each CU according to the encoding parameter.
  • each coding unit processes different data blocks at the same time. For example, CU4 is processed in the first coding processing unit, CU3 is processed in the second coding processing unit, CU2 is processed in the third coding unit, and CU1 is processed in the fourth coding unit. deal with.
  • the total processing time is the sum of the following two: the processing time of CU0 in the four encoding processing units, and the sum of the processing time of CU1, CU2, CU3 and CU4 in the fourth encoding processing unit. Compared with the method of processing each data block sequentially, the processing time is saved. Assuming that the processing time of each data block in the encoding processing unit is the same, which is X duration, the example takes 8X duration, while frame-by-frame processing takes 20X duration.
  • FIG. 2 a flowchart of an embodiment of an image frame encoding method according to Embodiment 1 of the present application is shown, and the method may specifically include the following steps:
  • Step 101 Divide the target image frame into a plurality of first data blocks.
  • a data block CU is a smaller coding unit divided from an image frame.
  • the division effect can be set according to actual needs, including the size, shape, area, and number of data blocks of each data block. For example, it can be divided into 8x8 or 16x16 data blocks. It is also possible to first divide a larger data block, and further divide the larger data block into smaller data blocks.
  • the specific division method can be selected according to actual requirements, for example, a quad-tree division method can be used.
  • the image area of complex details can be divided into smaller data block sizes, while the image areas of simple parts can be divided into larger data block sizes.
  • the process of dividing the data block it can also be determined with reference to rate-distortion optimization. For a larger data block, it can be divided into smaller data blocks. In this process, the rate-distortion cost of the larger data block and the sum of the rate-distortion cost of the smaller data block will be calculated. If the latter is small, it will be Divide into smaller data blocks.
  • Step 102 Input the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit executes the processing of the previous batch of first data blocks, executes the next batch of first data blocks Block processing, the encoding processing unit correspondingly performs one or more steps in the process of determining the encoding parameters of the target image frame.
  • the processing units execute processing synchronously.
  • the encoding processing unit processes the data blocks entered in the same batch at the same time. Before a data block is processed by multiple encoding processing units, the processing of the next data block in the encoding processing unit is started, that is, the processing of multiple batches of data blocks. Processing can be performed simultaneously.
  • the first data blocks are input into the encoding processing unit in batches, which may be multiple data blocks as one batch, or one data block as one batch.
  • the coding processing unit is designed to process the next batch of data blocks after processing the previous batch of data blocks. Compared with the frame-by-frame processing method, the processing efficiency is greatly improved.
  • control signals can also be used to ensure that the encoding processing units are independent of each other and work uninterruptedly.
  • Step 103 Encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • Each first data block may be encoded by using an encoding parameter, and an encoding result of the target image frame may be obtained according to the encoding result of each data block.
  • a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the image frame is divided into data.
  • the block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time.
  • the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced.
  • the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
  • FIG. 3 a flowchart of an embodiment of an image frame encoding method according to Embodiment 2 of the present application is shown, and the method may specifically include the following steps:
  • Step 201 Divide a specific area of the target image frame into a plurality of first data blocks, where the target area is an area where the content of the target image frame changes relative to the reference image frame.
  • the target image frame can be represented as the image content difference between the target image frame and a certain image frame as the reference image frame.
  • the target image frame is divided into data blocks.
  • the content of the target image frame changes relative to the reference image frame, it can be determined, and the changed area is further divided into a plurality of first data blocks.
  • Step 202 inputting the plurality of first data blocks into a data processing unit one by one for data processing; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, performs the processing of the next batch of the first data blocks,
  • the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units execute synchronously. deal with.
  • Using one data block as a batch can improve processing efficiency better than multiple data blocks as a batch.
  • Step 203 Encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the image frame is divided into data.
  • the block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time.
  • the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced.
  • the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
  • FIG. 4 a flowchart of an embodiment of an image frame encoding method according to Embodiment 3 of the present application is shown, and the method may specifically include the following steps:
  • Step 301 Divide the target image frame into a plurality of first data blocks.
  • Step 302 Input the multiple first data blocks in batches into multiple encoding processing units that are executed in sequence; after the encoding processing unit executes the processing of the previous batch of first data blocks, executes the next batch of first data Block processing, the data processing unit corresponds to the parameter reading step, the information amount acquisition step, the data calculation step, and the data exchange step in the process of determining the encoding parameters of the target image frame. During a part of the time period during which the unit performs processing, at least two encoding processing units perform processing synchronously.
  • Step 303 Encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • each encoding processing unit is specifically determined, and the encoding parameter determination process is divided into a parameter reading step, an information amount acquisition step, a data calculation step, and a data exchange step.
  • the number of encoding processing units and the specific processing content can be set according to actual needs, and one encoding processing unit can process one or more of the steps. For example, three encoding processing units are designed, the first encoding processing unit handles the parameter reading step and the information amount acquisition step, the second encoding processing unit handles the data calculation step, and the third encoding processing unit handles the data interaction step.
  • the parameter reading step includes: reading a prediction parameter of the first data block, where the prediction parameter includes a prediction direction and a prediction cost in the encoding process of the target image frame.
  • the prediction direction may be intra-frame prediction or inter-frame prediction, or may be intra-frame prediction combined with inter-frame prediction, and the prediction cost measures the deviation data caused in the encoding prediction process.
  • Prediction of image frames is a compression process used in the encoding process, which can be divided into intra-frame prediction and inter-frame prediction, which can also be called inter-frame coding and intra-frame coding.
  • Intra-frame prediction is based on the fact that due to the strong correlation between pixels in the same image, the correlation between pixels can be used for compression coding. For example, a certain pixel is used as a reference pixel, and the difference between other pixels and the reference pixel is used to express other pixels, so as to compress other pixels. For example, when sending data, the actual pixel X (current value) and the reference pixel (predicted value) are subtracted, the difference value is transmitted, and the receiving end obtains the actual pixel according to the sum of the difference value and the reference pixel.
  • Inter-frame prediction is based on the strong correlation between the two image frames before and after the video.
  • the reference image frame can be an image frame that is closest to the target image frame in a certain direction.
  • the difference value of the image frame is used to express the target image frame, so as to compress the image frame.
  • the step of obtaining the information amount includes: according to the information amount storage address of the first data block, obtaining the initial information amount of the first data block from a corresponding memory according to the first data block.
  • the prediction cost and the encoding frame rate of a data block are used to obtain the intra-frame information amount of the first data block; the total information amount of the first data block is determined according to the intra-frame information amount and the initial information amount.
  • the prediction cost can be multiplied by the encoding frame rate to obtain the intra-frame information amount of the first data block, and then the intra-frame information amount is added to the initial information amount to obtain the total information amount of the first data block.
  • the initial information amount of the image frame is used to calculate the total information amount. If other frames refer to the current image frame, they will be superimposed on the information amount of this frame. Therefore, in the process of CUTREE calculation, the information amount of each frame is It keeps increasing until the superposition process ends, and the total amount of information is obtained, which is used to derive the quantization parameters.
  • the initial information amount of the image frame can be calculated in advance by the number of pixels and the number of distinguishable colors in the image.
  • the data calculation step includes: determining a code corresponding to the first data block according to the read total information amount, prediction direction and prediction cost of the first data block parameter. Taking the prediction direction as intra-frame prediction and the encoding parameter as the quantization parameter as an example, the prediction cost is the intra-frame prediction cost.
  • the quantization parameters can be obtained by predicting the cost coefficient and taking the logarithm of the result.
  • the parameter reading step includes: acquiring an information storage address of the first data block according to the position of the first data block in the image. First, the position of the data block in the image is determined, and the information storage address of the first data block can be determined according to the mapping relationship between the position and the information storage address.
  • the coding parameter determination process can also be implemented by a plurality of coding processing units.
  • the above encoding processing unit may also correspondingly execute one or more steps in the process of determining the total information content of the reference image frame of the target image frame, and the parameter reading step and the information content obtaining step may also correspond to reading the reference image frame.
  • the information determines the basis data used, and the data interaction step is also used to save the reference information for invoking during encoding.
  • the step of obtaining the information amount may further include: determining the amount of information transferred between the target image frame and the reference image frame according to the total information amount of the first data block.
  • the information content acquisition step can also obtain one of the basis for calculating the total information content of the reference frame, that is, the total information content of the first data block of the target image frame, and further determine the target image according to the total information content of the first data block.
  • the amount of information transferred between the frame and the reference image frame that is, the amount of difference information between the two.
  • the data calculation step further includes: acquiring the initial information amount of the second data block in the reference image frame; superimposing the transfer information amount of the first data block to the initial information amount of the second data block in the reference image frame , to obtain the total information amount of the second data block in the reference image frame. Since the transfer information amount is also the difference information amount between the target image frame and the reference image frame, the transfer information amount can be superimposed on the initial information amount of the reference image frame to obtain the information of the second data block in the reference image frame. total amount of information.
  • the parameter reading step includes: reading a prediction cost coefficient.
  • the prediction cost coefficient is a coefficient for the prediction cost, that is, the prediction deviation or the coding deviation, which can be preset, or the prediction cost coefficient set corresponding to the range can be determined according to the numerical range of the prediction cost.
  • the determining the amount of information transferred between the target image frame and the reference image frame according to the initial information amount of the first data block includes: according to the first data block The prediction cost of the data block and the encoding frame rate are used to obtain the intra-frame information amount of the first data block; the total information amount of the first data block is determined according to the intra-frame information amount and the initial information amount; The amount of information and the prediction cost coefficient determine the amount of conveyed information for the first data block.
  • the specific calculation formula can be set according to actual needs, and the calculation process of the data is a well-known technology in the art, which will not be repeated here.
  • the parameter reading step further includes: determining the amount of information to be superimposed in the reference image frame according to the position of the first data block in the target image frame and the motion vector The location of the second data block.
  • the motion vector (MotionVector, MV) here represents the relative displacement between the first data block and the second data block with the highest matching degree in the reference image frame during the inter-frame coding process. Therefore, according to the first data block in the The position in the target image is combined with the relative displacement represented by the motion vector to determine the position of the second data block corresponding to the first data block in the reference image frame.
  • the data interaction step includes: storing the encoding parameters in a corresponding storage unit for subsequent invocation during encoding.
  • the data exchange step includes: transferring the total amount of information of the second data block in the reference image frame to other encoding processing units used in association, and updating other encoding processing units in time
  • the data used ensures that the data used by other encoding processing units is the latest and accurate data, and avoids that when the total information amount of the second data block in the reference image frame is accessed from the storage location, the data in the memory is not updated in time and the encoding processing unit is stopped.
  • a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the image frame is divided into data.
  • the block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time.
  • the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced.
  • the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
  • FIG. 5 a flowchart of an embodiment of a video coding method according to Embodiment 4 of the present application is shown, and the method may specifically include the following steps:
  • Step 401 Divide the target image frame in the video into a plurality of first data blocks.
  • Step 402 Input the multiple first data blocks into multiple encoding processing units that are executed in sequence; after the encoding processing unit performs the processing of the previous batch of first data blocks, executes the next batch of first data blocks Block processing, the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the image frame.
  • Step 403 Encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • Step 404 Obtain the encoding result of the video according to the encoding result of the target image frame.
  • a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the image frame is divided into data.
  • the block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time.
  • the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced.
  • the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
  • FIG. 6 a flowchart of an embodiment of a video coding method according to Embodiment 5 of the present application is shown, and the method may specifically include the following steps:
  • Step 501 Divide a specific area of a target image frame in the video into a plurality of first data blocks, where the target area is an area where the content of the target image frame changes relative to the reference image frame.
  • Step 502 Input the multiple first data blocks in batches into four encoding processing units that are executed in sequence; after the encoding processing unit performs the processing of the previous batch of first data blocks, executes the next batch of first data
  • the processing of the block, the four encoding processing units respectively perform the calculation of the quantization parameter in the process of determining the encoding parameter of the image frame according to the reading step, the information content acquisition step, the quantization parameter and the information content calculation step, and the quantization parameter and the information content write. step.
  • Step 503 Encode the target image frame according to the encoding parameters corresponding to the four first data blocks respectively.
  • Step 504 Obtain the encoding result of the video according to the encoding result of the target image frame.
  • a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the image frame is divided into data.
  • the block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time.
  • the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced.
  • the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
  • FIG. 7 a flowchart of an embodiment of an image frame processing method according to Embodiment 6 of the present application is shown, and the method may specifically include the following steps:
  • Step 601 Divide the target image frame into a plurality of first data blocks.
  • Step 602 Input the plurality of first data blocks in batches into a plurality of processing units that are executed in sequence.
  • the processing unit executes the processing of the next batch of first data blocks after processing the previous batch of the first data blocks, and the processing unit correspondingly executes one or more steps in the processing process of the target image frame.
  • a plurality of processing units are used to perform the processing process of the target image frame, a single processing unit performs one or more steps in the processing process, the image frame is divided into data blocks, and multiple processing units that are executed sequentially are input in batches.
  • the processing unit can obtain processing results. Since the processing unit can perform the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that multiple encoding processing units perform processing synchronously.
  • the processing of batch data blocks can be carried out at the same time. Compared with the sequential execution of video frames, the processing time can be greatly shortened and the processing efficiency of video frames can be improved. Resource multiplexing is performed, which can reduce chip area, reduce hardware overhead, reduce hardware cost, and facilitate hardware implementation.
  • the multi-processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different processing systems for use, and the processing unit can be configured to be compatible with other processing procedures, thereby realizing the optimization of multiple processing procedures and improving the performance of the processing.
  • the processing efficiency of the system is highly versatile, and can be copied to different processing systems for use, and the processing unit can be configured to be compatible with other processing procedures, thereby realizing the optimization of multiple processing procedures and improving the performance of the processing. The processing efficiency of the system.
  • the image frame processing method in the embodiment of the present application can be applied to video processing, and further can be applied to a software service SaaS (Software-as-a-Service) platform, which is provided as a video processing service oriented to various software.
  • SaaS Software-as-a-Service
  • SaaS provides software services through the network
  • platform providers deploy application software on their own servers
  • platform customers (such as software service providers) can order required software services from the platform through the Internet according to actual needs, and further through the Internet Access to the services provided by the platform.
  • the specific implementation process can include:
  • Step 1 Obtain at least one target video submitted through the software service client.
  • Step 2 Divide the image frame of the target video into a plurality of first data blocks.
  • Step 3 Input the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence. After the encoding processing unit performs the processing of the previous batch of first data blocks, the processing of the next batch of first data blocks is performed, and the encoding processing unit correspondingly performs one of the processes of determining the encoding parameters of the target image frame. or in a plurality of steps, in a partial period of time during which the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously.
  • Step 4 Encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • Step 5 Obtain an encoding result of the target video according to encoding results of multiple image frames.
  • Step 6 Provide the encoding result of the target video based on the software service client.
  • a plurality of processing units are used to perform the processing process of the target image frame, a single processing unit performs one or more steps in the processing process, the image frame is divided into data blocks, and multiple processing units that are executed sequentially are input in batches.
  • the processing unit can obtain processing results. Since the processing unit can perform the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that multiple encoding processing units perform processing synchronously.
  • the processing of batch data blocks can be carried out at the same time. Compared with the sequential execution of video frames, the processing time can be greatly shortened and the processing efficiency of video frames can be improved. Resource multiplexing is performed, which can reduce chip area, reduce hardware overhead, reduce hardware cost, and facilitate hardware implementation.
  • the multi-processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different processing systems for use, and the processing unit can be configured to be compatible with other processing procedures, thereby realizing the optimization of multiple processing procedures and improving the performance of the processing.
  • the processing efficiency of the system is highly versatile, and can be copied to different processing systems for use, and the processing unit can be configured to be compatible with other processing procedures, thereby realizing the optimization of multiple processing procedures and improving the performance of the processing. The processing efficiency of the system.
  • FIG. 14 a schematic diagram of an image frame encoding process is shown, which specifically includes the following steps:
  • the CUTREE control unit starts the first-stage pipeline, and reads the information of the current CU from the CU parameter memory according to the current CU position of the target image frame, including motion vector, prediction type, intra-frame prediction cost, inter-frame cost coefficient, etc.
  • the first-level pipeline calculates the information storage address of the current CU in the memory according to the position of the current CU in the image; according to the position of the current CU in the image and the motion vector of the current CU, calculates the difference between the current CU and the current CU in the image frame.
  • the information storage address of the CU corresponding to the current CU.
  • the second-stage pipeline reads the initial information amount of the reference image frame from the information amount memory of the reference image frame according to the information amount storage address of the CU in each reference frame; according to the information amount storage address of the current CU, from the current The information amount memory of the CU reads the information amount of the current CU.
  • the second-stage pipeline multiplies the CU intra-frame prediction cost by the encoding frame rate to obtain the CU intra-frame information amount, and adds the CU intra-frame information amount to the current CU information amount read from the information amount memory of the current frame. , get the sum of the current CU information.
  • the second-stage pipeline multiplies the sum of the current CU information amount by the CU's inter-frame cost coefficient to obtain the current CU's transfer information amount. After the calculation is completed, the control unit starts the third-stage pipeline.
  • the third-stage pipeline obtains the initial information volume of 4 CUs of each reference frame from the reference frame information volume memory, and superimposes the transfer information volume of the current CU calculated by the second-stage pipeline to 4 in each reference frame. On the initial amount of information of the CU.
  • the third-stage pipeline divides the total information amount of the current CU by the intra-frame prediction cost of the current CU, and takes the logarithm of the result to obtain the quantization parameter.
  • the fourth-stage pipeline writes the quantization parameter QP into the quantization parameter QP memory, and writes the total information amount of the CU in each reference frame after the third-stage pipeline is updated into the reference frame information amount memory.
  • the fourth-level pipeline can feed back the result of the total information amount of the reference frame CU to the third-level pipeline, so as to ensure the third-level pipeline.
  • the amount of CU information required by the stage pipeline is the latest result, so as to avoid the pipeline stall caused by the untimely update of memory data when different pipelines access the same address.
  • each data block in each image frame corresponds to a CUTREE amount of information, and the initial amount of CUTREE information of each block (can be set according to actual needs), stored in in memory.
  • the reference frame of F1 is F0
  • find the four blocks in F0 according to the motion vector and read the information amount of these four blocks from the memory, such as K0, K1, K2, K3, set (A+B) ⁇ C is divided into four parts, superimposed on K0, K1, K2, K3, to obtain the total amount of information corresponding to the four data blocks of F0, and then update it to the memory of the F0 frame.
  • the quantization parameter of each block in F0 to F9 can be calculated.
  • FIG. 8 a structural block diagram of an embodiment of an image frame encoding apparatus according to Embodiment 7 of the present application is shown, which may specifically include:
  • a data block dividing unit 701 configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks in batches to a plurality of encoding processing units that are executed in sequence;
  • the encoding processing unit 702 is configured to perform one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after performing the processing of the previous batch of first data blocks. processing of blocks;
  • the encoding unit 703 is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • the data block dividing unit is specifically configured to divide a specific area of the target image frame into a plurality of first data blocks, and the target area is the target image The area where the content of the frame changes relative to the reference image frame.
  • the data block dividing unit is specifically configured to: input the plurality of first data blocks one by one into a data processing unit to perform data processing.
  • the plurality of data processing units include a parameter reading unit, an information amount acquisition unit, a data calculation unit, and a data interaction unit.
  • the parameter reading unit is specifically configured to read the prediction parameter of the first data block; the prediction parameter includes the prediction direction and prediction in the encoding process of the target image frame cost.
  • the information amount obtaining unit is specifically configured to obtain the initial information amount of the first data block from the corresponding memory according to the information amount storage address of the first data block; and, according to the prediction cost and the encoding frame rate of the first data block, obtain the intra-frame information amount of the first data block; determine the total amount of the first data block according to the intra-frame information amount and the initial information amount amount of information.
  • the data calculation unit is specifically configured to determine, according to the read total information amount, prediction direction and prediction cost of the first data block, the data for the first data block the corresponding encoding parameters.
  • the parameter obtaining unit is specifically configured to obtain the information storage address of the first data block according to the position of the first data block in the image.
  • the encoding processing unit is further configured to perform one or more steps in the process of determining the total information content of the reference image frame of the target image frame. unit, further configured to determine the amount of information transferred between the target image frame and the reference image frame according to the total amount of information of the first data block;
  • the data calculation unit is further configured to obtain the initial information amount of the second data block in the reference image frame; and superimpose the transfer information amount of the first data block to the initial information amount of the second data block in the reference image frame to obtain The total amount of information of the second data block in the reference image frame.
  • the parameter reading unit is configured to read the prediction cost coefficient
  • the transfer information amount determination subunit is configured to determine the transfer information amount of the first data block according to the total information amount of the first data block and the prediction cost coefficient.
  • the parameter reading unit is further configured to determine the information to be superimposed in the reference image frame according to the position of the first data block in the target image frame and the motion vector The position of the second data block of the amount.
  • the data interaction unit is configured to store the encoding parameter in a corresponding storage unit for subsequent invocation during encoding.
  • the data exchange unit is configured to transmit the total amount of information of the second data block in the updated reference image frame to other encoding processing units used in association.
  • a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the image frame is divided into data.
  • the block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time.
  • the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced.
  • the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
  • FIG. 9 a structural block diagram of an embodiment of a video encoding apparatus according to Embodiment 8 of the present application is shown, which may specifically include:
  • a data block dividing unit 801 configured to divide the target image frame in the video into a plurality of first data blocks, and input the plurality of first data blocks in batches into a plurality of encoding processing units executed in sequence;
  • the encoding processing unit 802 is configured to perform one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after performing the processing of the previous batch of first data blocks. processing of blocks;
  • An image frame encoding unit 803, configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively;
  • the video encoding unit 804 is configured to obtain the encoding result of the video according to the encoding result of the target image frame.
  • a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the image frame is divided into data.
  • the block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time.
  • the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced.
  • the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
  • FIG. 10 a structural block diagram of an embodiment of a video encoding apparatus according to Embodiment 9 of the present application is shown, which may specifically include:
  • the data block dividing unit 901 is used to divide a specific area of the target image frame in the video into a plurality of first data blocks, and input the plurality of first data blocks in batches into four encoding processing units that are executed in sequence , the target area is the area where the content of the target image frame changes relative to the reference image frame;
  • Four encoding processing units 902 are used to respectively perform the quantization parameter calculation in the process of determining the encoding parameters of the image frame according to the reading step, the information content acquisition step, the quantization parameter and the information content calculation step, and the quantization parameter and the information content write. Step, the encoding processing unit performs the processing of the first data block of the next batch after the processing of the first data block of the previous batch is performed;
  • An image frame encoding unit 903 configured to encode the target image frame according to encoding parameters corresponding to the four first data blocks respectively;
  • the video encoding unit 904 is configured to obtain the encoding result of the video according to the encoding result of the target image frame.
  • a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the image frame is divided into data.
  • the block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit can perform the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when the four encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that the The processing of multiple batches of data blocks can be performed at the same time.
  • the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced.
  • the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
  • FIG. 11 a structural block diagram of an embodiment of an image frame processing apparatus according to Embodiment 10 of the present application is shown, which may specifically include:
  • a data block dividing unit 1001 configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of processing units that are executed in sequence;
  • the processing unit 1002 is configured to execute one or more steps in the processing process of the target image frame, and obtain the processing result. After the processing unit has executed the processing of the first data blocks of the previous batch, execute the next batch of data blocks. Processing of the first data block.
  • a plurality of processing units are used to perform the processing process of the target image frame, a single processing unit performs one or more steps in the processing process, the image frame is divided into data blocks, and multiple processing units that are executed sequentially are input in batches.
  • the processing unit can obtain processing results. Since the processing unit can perform the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that multiple encoding processing units perform processing synchronously.
  • the processing of batch data blocks can be carried out at the same time. Compared with the sequential execution of video frames, the processing time can be greatly shortened and the processing efficiency of video frames can be improved. Resource multiplexing is performed, which can reduce chip area, reduce hardware overhead, reduce hardware cost, and facilitate hardware implementation.
  • the multi-processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different processing systems for use, and the processing unit can be configured to be compatible with other processing procedures, thereby realizing the optimization of multiple processing procedures and improving the performance of the processing.
  • the processing efficiency of the system is highly versatile, and can be copied to different processing systems for use, and the processing unit can be configured to be compatible with other processing procedures, thereby realizing the optimization of multiple processing procedures and improving the performance of the processing. The processing efficiency of the system.
  • FIG. 12 a structural block diagram of an embodiment of an image frame encoding system according to Embodiment 11 of the present application is shown, including a frame dividing unit 1101, a plurality of encoding processing units 1102 and encoding units 1103 executed in sequence;
  • the frame dividing unit 1101 is configured to divide the target image frame into multiple first data blocks, and input the multiple first data blocks into multiple encoding processing units in batches;
  • the encoding processing unit 1102 is configured to perform one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed. processing of a data block;
  • the image frame encoding unit 1103 is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the image frame is divided into data.
  • the block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time.
  • the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced.
  • the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
  • FIG. 13 shows a structural block diagram of a chip embodiment based on a field programmable logic gate array according to the twelfth embodiment of the present application, including a frame dividing unit 1201, a plurality of encoding processing units 1202 executed in sequence, and an image Frame encoding unit 1203;
  • the frame dividing unit 1201 is configured to divide the target image frame into multiple first data blocks, and input the multiple first data blocks into multiple encoding processing units in batches;
  • the encoding processing unit 1202 is configured to perform one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after processing the previous batch of first data blocks. processing of a data block;
  • the image frame encoding unit 1203 is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process.
  • the image frame is divided into data.
  • the block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters.
  • the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time.
  • the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced.
  • the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
  • the corresponding occupied chip area is only 1800 LUTs, which is convenient for hardware implementation.
  • the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
  • Embodiments of the present disclosure may be implemented as a system in a desired configuration using any suitable hardware, firmware, software, or any combination thereof.
  • FIG. 15 schematically illustrates an exemplary system (or apparatus) 1300 that may be used to implement various embodiments described in this disclosure.
  • FIG. 15 illustrates an exemplary system 1300 having one or more processors 1302, a system control module (chipset) coupled to at least one of the processor(s) 1302 1304 , system memory 1306 coupled to system control module 1304 , non-volatile memory (NVM)/storage 1308 coupled to system control module 1304 , one or more inputs/outputs coupled to system control module 1304 device 1310, and a network interface 1312 coupled to the system control module 1306.
  • system control module chipset
  • NVM non-volatile memory
  • the processor 1302 may include one or more single-core or multi-core processors, and the processor 1302 may include any combination of general-purpose processors or special-purpose processors (eg, graphics processors, application processors, baseband processors, etc.).
  • the system 1300 can function as a browser as described in the embodiments of the present application.
  • system 1300 may include one or more computer-readable media having instructions (eg, system memory 1306 or NVM/storage device 1308 ) and in combination with the one or more computer-readable media configured to One or more processors 1302 that execute instructions to implement modules to perform the actions described in this disclosure.
  • processors 1302 that execute instructions to implement modules to perform the actions described in this disclosure.
  • system control module 804 may include any suitable interface controller to provide at least one of the processor(s) 1302 and/or any suitable device or component in communication with the system control module 1304 any appropriate interface.
  • System control module 1304 may include a memory controller module to provide an interface to system memory 1306 .
  • the memory controller modules may be hardware modules, software modules, and/or firmware modules.
  • System memory 1306 may be used, for example, to load and store data and/or instructions for system 1300 .
  • system memory 1306 may include any suitable volatile memory, eg, suitable DRAM.
  • system memory 1306 may include double data rate type quad synchronous dynamic random access memory (DDR4 SDRAM).
  • system control module 1304 may include one or more input/output controllers to provide interfaces to NVM/storage device 1308 and input/output device(s) 1310 .
  • NVM/storage 1308 may be used to store data and/or instructions.
  • NVM/storage 1308 may include any suitable non-volatile memory (eg, flash memory) and/or may include any suitable non-volatile storage device(s) (eg, one or more hard drives (HDD), one or more compact disc (CD) drives and/or one or more digital versatile disc (DVD) drives).
  • HDD hard drives
  • CD compact disc
  • DVD digital versatile disc
  • NVM/storage device 1308 may include storage resources that are physically part of the device on which system 1300 is installed, or it may be accessed by the device without necessarily being part of the device. For example, NVM/storage device 1308 may be accessed via input/output device(s) 1310 over a network.
  • Input/output device(s) 1310 may provide an interface for system 1300 to communicate with any other suitable device, and input/output device(s) 1310 may include communication components, audio components, sensor components, and the like.
  • Network interface 1312 may provide an interface for system 1300 to communicate over one or more networks, system 1300 may interface with one or more of one or more wireless network standards and/or protocols in accordance with any of one or more wireless network standards and/or protocols.
  • Components communicate wirelessly, eg, by accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, or 5G, or a combination thereof.
  • At least one of the processor(s) 1302 may be packaged with the logic of one or more controllers (eg, memory controller modules) of the system control module 1304 .
  • at least one of the processor(s) 1302 may be packaged with logic of one or more controllers of the system control module 1304 to form a system-in-package (SiP).
  • SiP system-in-package
  • at least one of the processor(s) 1302 may be integrated on the same die with the logic of one or more controllers of the system control module 1304 .
  • at least one of the processor(s) 1302 may be integrated on the same die with logic of one or more controllers of the system control module 1304 to form a system-on-chip (SoC).
  • SoC system-on-chip
  • system 1300 may be, but is not limited to, a browser, workstation, desktop computing device, or mobile computing device (eg, laptop computing device, handheld computing device, tablet computer, netbook, etc.). In various embodiments, system 1300 may have more or fewer components and/or different architectures. For example, in some embodiments, system 1300 includes one or more cameras, keyboards, liquid crystal display (LCD) screens (including touchscreen displays), non-volatile memory ports, multiple antennas, graphics chips, application specific integrated circuits ( ASIC) and speakers.
  • LCD liquid crystal display
  • ASIC application specific integrated circuits
  • the display screen may be implemented as a touch screen display to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel.
  • the touch sensor may not only sense the boundaries of a touch or swipe action, but also identify the duration and pressure associated with the touch or swipe action.
  • Embodiments of the present application further provide a non-volatile readable storage medium, where one or more modules (programs) are stored in the storage medium.
  • the terminal device can make the terminal The device executes the instructions (instructions) of each method step in the embodiment of the present application.
  • a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the method according to the embodiments of the present application when the processor executes the computer program .
  • a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements one or more of the methods according to the embodiments of the present application.
  • an image frame encoding method is provided, and example 1 includes:
  • the encoding processing unit Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units are synchronized perform processing;
  • the target image frame is encoded according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • Example 2 includes the method of Example 1, wherein the dividing the target image frame into a plurality of first data blocks includes:
  • a specific area of the target image frame is divided into a plurality of first data blocks, and the target area is an area where the content of the target image frame changes relative to the reference image frame.
  • Example 3 includes the method of Example 1, wherein the inputting the plurality of first data blocks into the data processing unit in batches for data processing includes:
  • the plurality of first data blocks are input into the data processing unit one by one for data processing.
  • Example 4 includes the method described in Example 1, wherein the data processing unit correspondingly executes the parameter reading step, the information amount acquisition step, the data calculation step, and the data exchange step in the process of determining the encoding parameters of the target image frame.
  • Example 5 includes the method of Example 1, wherein the information amount obtaining step includes:
  • the information amount storage address of the first data block obtain the initial information amount of the first data block from the corresponding memory
  • the total information amount of the first data block is determined according to the intra-frame information amount and the initial information amount.
  • Example 6 includes the method of Example 5, the parameter reading step comprising:
  • the prediction parameters include the prediction direction and the prediction cost in the encoding process of the target image frame.
  • Example 7 includes the method of Example 6, the data computing step comprising:
  • the coding parameter corresponding to the first data block is determined according to the read total information amount, prediction direction and prediction cost of the first data block.
  • Example 8 includes the method of Example 5, the parameter reading step comprising:
  • the information storage address of the first data block is obtained according to the position of the first data block in the image.
  • Example 9 includes the method of Example 6, wherein the encoding processing unit further correspondingly performs one or more steps in the process of determining the total information content of the reference image frame of the target image frame;
  • the step of obtaining the amount of information further includes:
  • the data calculation step also includes:
  • the transfer information amount of the first data block is superimposed on the initial information amount of the second data block in the reference image frame to obtain the total information amount of the second data block in the reference image frame.
  • Example 10 includes the method of Example 9, the parameter reading step further comprising:
  • the determining the amount of information transferred between the target image frame and the reference image frame according to the total information amount of the first data block includes:
  • the transfer information amount of the first data block is determined according to the total information amount of the first data block and the prediction cost coefficient.
  • Example 11 includes the method of Example 9, the parameter reading step further comprising:
  • the position of the second data block of the amount of information to be superimposed in the reference image frame is determined.
  • Example 12 includes the method of Example 4, wherein the data interaction step includes:
  • the encoding parameters are stored in the corresponding storage unit for subsequent encoding.
  • Example 13 includes the method of Example 9, wherein the data interaction step includes:
  • the total amount of information of the second data block in the reference image frame is passed to other encoding processing units used in association.
  • Example 14 includes:
  • the encoding processing unit Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the image frame, and in a partial time period during which the multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
  • the encoding result of the video is obtained according to the encoding result of the image frame.
  • Example 15 includes:
  • the plurality of first data blocks are input in batches into four encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed.
  • the four encoding processing units respectively perform the quantization parameter calculation in the determination process of the encoding parameter of the image frame according to the reading step, the information content acquisition step, the quantization parameter and the information content calculation step, and the quantization parameter and the information content write step, in During a part of the time period when the four encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
  • the encoding result of the video is obtained according to the encoding result of the image frame.
  • Example 16 includes:
  • the multiple first data blocks are input in batches into multiple processing units that are executed in sequence; after the processing unit performs the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed, so
  • the processing unit correspondingly executes one or more steps in the processing process of the target image frame, and in a partial time period during which the multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously.
  • Example 17 includes:
  • the encoding processing unit Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units are synchronized perform processing;
  • the encoding result of the target video is provided based on the software service client.
  • Example 18 includes a frame division module, a plurality of encoding processing units and encoding modules executed in sequence;
  • the frame dividing unit configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of encoding processing units in batches;
  • the encoding processing unit is configured to correspondingly execute one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed.
  • For the processing of the data block in a part of the time period when the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
  • the encoding unit is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • Example 19 includes a frame division module, a plurality of encoding processing units executed in sequence, and an encoding module;
  • the frame dividing unit configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of encoding processing units in batches;
  • the encoding processing unit is configured to correspondingly execute one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed.
  • For the processing of the data block in a part of the time period when the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
  • the encoding unit is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  • example 20 includes: a processor;
  • a memory having executable code stored thereon which, when executed, causes the processor to perform the method of any of Examples 1-17.
  • one or more machine-readable media are provided, on which executable codes are stored, and when the executable codes are executed, cause the processor to execute any one of Examples 1-17. method described in item.

Landscapes

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

Abstract

Disclosed by embodiments of the present application are an image frame coding method, an object search method, a computer device, and a storage medium. The image frame coding method comprises: dividing a target image frame into a plurality of first data blocks; splitting the plurality of first data blocks into batches and inputting said blocks into a plurality of coding units which operate in sequence; at least two coding units synchronously perform processing within a portion of time segments when the plurality of coding units are performing processing; and performing coding on the target image frame according to coding parameters respectively corresponding to the plurality of first data blocks. Compared to a manner of sequential operation using video frames as units, the present method can greatly reduce time spent on coding parameter determination, improve video coding efficiency, and also reduce data block processing delay. Due to the manner in which the plurality of coding units run in parallel allowing for resource reuse on a hardware unit, chip size can be reduced, hardware overhead can be lowered, hardware costs can be reduced, and hardware implementation is facilitated.

Description

图像帧编码方法、对象搜索方法、计算机设备、存储介质Image frame encoding method, object search method, computer device, storage medium
本申请要求2020年08月03日递交的申请号为202010768892.5、发明名称为“图像帧编码方法、对象搜索方法、计算机设备、存储介质”中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on August 3, 2020 with the application number of 202010768892.5 and the title of the invention as "image frame encoding method, object search method, computer equipment, and storage medium", the entire contents of which are incorporated herein by reference Applying.
技术领域technical field
本申请涉及数据处理技术领域,具体涉及一种图像帧编码方法、一种图像搜索方法、一种对象搜索方法、一种计算机设备、一种计算机可读存储介质。The present application relates to the technical field of data processing, and in particular, to an image frame encoding method, an image search method, an object search method, a computer device, and a computer-readable storage medium.
背景技术Background technique
当前视频技术发展迅速且应用广泛,在对视频进行网络传输时,基于带宽限制和节省流量的目的,视频图像都是经过编码,然后用于各种不同的视频应用场景。At present, video technology is developing rapidly and is widely used. When video is transmitted over the network, for the purpose of bandwidth limitation and traffic saving, video images are encoded and then used in various video application scenarios.
视频编码是指通过对视频图像帧进行离散余弦变换、量化和熵编码等处理,将原始视频格式的文件转换成另一种视频格式文件。其目的是保证编码质量的前提下,尽可能提高视频的压缩率,减小视频文件的体积。Video coding refers to converting the original video format file into another video format file by performing discrete cosine transform, quantization and entropy coding on the video image frame. Its purpose is to improve the compression rate of the video as much as possible and reduce the volume of the video file under the premise of ensuring the encoding quality.
因此,通过视频预分析,选择合适的对提升视频质量和控制视频压缩率有着重要的作用。Therefore, through video pre-analysis, selecting the appropriate one plays an important role in improving the video quality and controlling the video compression rate.
发明内容SUMMARY OF THE INVENTION
鉴于上述问题,提出了本申请以便提供一种克服上述问题或者至少部分地解决上述问题的图像处理方法、图像搜索方法、对象搜索方法以及计算机设备、计算机可读存储介质。In view of the above problems, the present application is made to provide an image processing method, an image search method, an object search method, a computer device, and a computer-readable storage medium that overcome the above problems or at least partially solve the above problems.
依据本申请的一个方面,提供了一种图像帧编码方法,包括:According to one aspect of the present application, an image frame encoding method is provided, comprising:
将目标图像帧划分为多个第一数据块;dividing the target image frame into a plurality of first data blocks;
将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units are synchronized perform processing;
根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The target image frame is encoded according to encoding parameters corresponding to the plurality of first data blocks respectively.
依据本申请的一个方面,提供了一种视频编码方法,包括:According to one aspect of the present application, a video encoding method is provided, comprising:
将视频中的目标图像帧划分为多个第一数据块;dividing the target image frame in the video into a plurality of first data blocks;
将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元 执行处理的部分时间段内,至少两个编码处理单元同步执行处理;Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the image frame, and in a partial time period during which the multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码;encoding the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively;
根据所述图像帧的编码结果得到所述视频的编码结果。The encoding result of the video is obtained according to the encoding result of the image frame.
依据本申请的一个方面,提供了一种视频编码方法,包括:According to one aspect of the present application, a video encoding method is provided, comprising:
将视频中的目标图像帧的特定区域划分为多个第一数据块,所述目标区域为所述目标图像帧相对于参考图像帧发生内容变化的区域;Dividing a specific area of the target image frame in the video into a plurality of first data blocks, and the target area is an area where the content of the target image frame changes relative to the reference image frame;
将所述多个第一数据块分批输入按序执行的四个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,四个编码处理单元分别执行图像帧的编码参数的确定过程中的量化参数计算依据读取步骤、信息量获取步骤、量化参数和信息量计算步骤、以及量化参数和信息量写入步骤,在所述四个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;The plurality of first data blocks are input in batches into four encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed. , the four encoding processing units respectively perform the quantization parameter calculation in the determination process of the encoding parameter of the image frame according to the reading step, the information acquisition step, the quantization parameter and the information calculation step, and the quantization parameter and the information write step, in During a part of the time period when the four encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
根据四个第一数据块分别对应的编码参数,对所述目标图像帧进行编码;encoding the target image frame according to encoding parameters corresponding to the four first data blocks respectively;
根据所述图像帧的编码结果得到所述视频的编码结果。The encoding result of the video is obtained according to the encoding result of the image frame.
依据本申请的一个方面,提供了一种图像帧处理方法,包括:According to an aspect of the present application, an image frame processing method is provided, comprising:
将目标图像帧划分为多个第一数据块;dividing the target image frame into a plurality of first data blocks;
将所述多个第一数据块分批输入按序执行的多个处理单元;所述处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述处理单元对应执行所述目标图像帧的处理过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理。The multiple first data blocks are input in batches into multiple processing units that are executed in sequence; after the processing unit performs the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed, so The processing unit correspondingly executes one or more steps in the processing process of the target image frame, and in a partial time period during which the multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously.
依据本申请的一个方面,提供了一种图像帧处理方法,应用于软件服务平台,包括:According to one aspect of the present application, an image frame processing method is provided, applied to a software service platform, including:
获取通过软件服务客户端提交的至少一个目标视频;Obtain at least one target video submitted through the software service client;
将目标视频的图像帧划分为多个第一数据块;dividing the image frame of the target video into a plurality of first data blocks;
将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units are synchronized perform processing;
根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码;encoding the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively;
根据多个图像帧的编码结果得到所述目标视频的编码结果;Obtain the encoding result of the target video according to the encoding results of a plurality of image frames;
基于所述软件服务客户端提供所述目标视频的编码结果。The encoding result of the target video is provided based on the software service client.
依据本申请的一个方面,提供了一种图像帧编码系统,包括帧划分模块、按序执行的多个编码处理单元和编码模块;According to an aspect of the present application, an image frame encoding system is provided, including a frame division module, a plurality of encoding processing units and encoding modules executed in sequence;
所述帧划分单元,用于将目标图像帧划分为多个第一数据块,并将所述多个第一数据块分批输入多个编码处理单元;the frame dividing unit, configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of encoding processing units in batches;
所述编码处理单元,用于对应执行所述目标图像帧的编码参数的确定过程中的一个 或多个步骤,并在执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;The encoding processing unit is configured to correspondingly execute one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed. For the processing of the data block, in a part of the time period when the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
所述编码单元,用于根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The encoding unit is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
依据本申请的一个方面,提供了一种基于现场可编程逻辑门阵列的芯片,包括帧划分模块、按序执行的多个编码处理单元和编码模块;According to one aspect of the present application, a chip based on a field programmable logic gate array is provided, comprising a frame division module, a plurality of encoding processing units and encoding modules executed in sequence;
所述帧划分单元,用于将目标图像帧划分为多个第一数据块,并将所述多个第一数据块分批输入多个编码处理单元;the frame dividing unit, configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of encoding processing units in batches;
所述编码处理单元,用于对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,并在执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;The encoding processing unit is configured to correspondingly execute one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed. For the processing of the data block, in a part of the time period when the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
所述编码单元,用于根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The encoding unit is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
依据本申请的一个方面,提供了一种电子设备,包括:处理器;和According to one aspect of the present application, there is provided an electronic device, comprising: a processor; and
存储器,其上存储有可执行代码,当所述可执行代码被执行时,使得所述处理器执行如上述任一项所述的方法。A memory having executable code stored thereon which, when executed, causes the processor to perform a method as described in any of the above.
依据本申请的一个方面,提供了一个或多个机器可读介质,其上存储有可执行代码,当所述可执行代码被执行时,使得处理器执行如上述任一项所述的方法。According to one aspect of the present application, there is provided one or more machine-readable media having executable code stored thereon which, when executed, causes a processor to perform a method as described in any of the above.
依据本申请实施例,采用多个编码处理单元执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤,针对图像帧计算编码参数时,将图像帧划分为数据块,分批输入按序执行的多个编码处理单元,可得到编码参数,进而利用编码参数对图像帧进行编码。由于编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率,同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. When calculating encoding parameters for an image frame, the image frame is divided into data. The block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters. Since the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time. Compared with the sequential execution of video frames, the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
并且,本申请实施例的多编码处理单元处理方案通用性强,可以复制到不同的编码系统使用,并且可以将编码处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够 更明显易懂,以下特举本申请的具体实施方式。The above description is only an overview of the technical solution of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the description, and in order to make the above-mentioned and other purposes, features and advantages of the present application more obvious and easy to understand , and the specific embodiments of the present application are listed below.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are for purposes of illustrating preferred embodiments only and are not to be considered limiting of the application. Also, the same components are denoted by the same reference numerals throughout the drawings. In the attached image:
图1示出了本申请实施例基于FPGA实现视频编码过程的示意图;1 shows a schematic diagram of a video encoding process implemented based on an FPGA in an embodiment of the present application;
图2示出了根据本申请实施例一的一种图像帧编码方法实施例的流程图;FIG. 2 shows a flowchart of an embodiment of an image frame encoding method according to Embodiment 1 of the present application;
图3示出了根据本申请实施例二的一种图像帧编码方法实施例的流程图;FIG. 3 shows a flowchart of an embodiment of an image frame encoding method according to Embodiment 2 of the present application;
图4示出了根据本申请实施例三的一种图像帧编码方法实施例的流程图;FIG. 4 shows a flowchart of an embodiment of an image frame encoding method according to Embodiment 3 of the present application;
图5示出了根据本申请实施例四的一种视频编码方法实施例的流程图;FIG. 5 shows a flowchart of an embodiment of a video coding method according to Embodiment 4 of the present application;
图6示出了根据本申请实施例五的一种视频编码方法实施例的流程图;FIG. 6 shows a flowchart of an embodiment of a video coding method according to Embodiment 5 of the present application;
图7示出了根据本申请实施例六的一种图像帧处理方法实施例的流程图;FIG. 7 shows a flowchart of an embodiment of an image frame processing method according to Embodiment 6 of the present application;
图8示出了根据本申请实施例七的一种图像帧编码装置实施例的结构框图;8 shows a structural block diagram of an embodiment of an image frame encoding apparatus according to Embodiment 7 of the present application;
图9示出了示出了根据本申请实施例八的一种视频编码装置实施例的结构框图;FIG. 9 shows a structural block diagram showing an embodiment of a video encoding apparatus according to Embodiment 8 of the present application;
图10示出了根据本申请实施例九的一种视频编码装置实施例的结构框图;FIG. 10 shows a structural block diagram of an embodiment of a video encoding apparatus according to Embodiment 9 of the present application;
图11示出了根据本申请实施例十的一种图像帧处理装置实施例的结构框图;FIG. 11 shows a structural block diagram of an embodiment of an image frame processing apparatus according to Embodiment 10 of the present application;
图12示出了根据本申请实施例十一的一种图像帧编码系统实施例的结构框图;12 shows a structural block diagram of an embodiment of an image frame encoding system according to Embodiment 11 of the present application;
图13示出了根据本申请实施例十二的一种基于现场可编程逻辑门阵列的芯片实施例的结构框图;13 shows a structural block diagram of a chip embodiment based on a field programmable logic gate array according to Embodiment 12 of the present application;
图14示出了图像帧编码流程的示意图;14 shows a schematic diagram of an image frame encoding process;
图15示出了可被用于实现本公开中所述的各个实施例的示例性系统。15 illustrates an exemplary system that may be used to implement various embodiments described in this disclosure.
具体实施方式detailed description
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly understood, and will fully convey the scope of the present disclosure to those skilled in the art.
为使本领域技术人员更好的理解本申请的方案,如下对本申请涉及到的概念进行解释:In order to make those skilled in the art better understand the solutions of the present application, the concepts involved in the present application are explained as follows:
编码参数用于对视频数据进行编码,具体可以包括帧类型、量化参数(Quantization Parameter,QP)等数据。其中,量化参数对视频质量具有重要的影响,对于每个编码对象而言,量化参数越小,量化精度越高,视频质量也会相应更佳,但同时会使得编码器 的带宽成本也将增大。因此,通过合理地分配量化参数,从而保证视频质量的同时,节约带宽成本,例如,可以为视频中重要区域分配较小的量化参数,不重要区域分配较大的量化参数。The encoding parameter is used to encode the video data, and may specifically include data such as frame type and quantization parameter (Quantization Parameter, QP). Among them, the quantization parameter has an important influence on the video quality. For each coding object, the smaller the quantization parameter is, the higher the quantization accuracy is, and the video quality will be correspondingly better, but at the same time, the bandwidth cost of the encoder will also increase. big. Therefore, by reasonably allocating quantization parameters, bandwidth costs can be saved while ensuring video quality. For example, important regions in the video can be allocated smaller quantization parameters, and unimportant regions can be allocated larger quantization parameters.
基于编码参数的重要性,通过对待编码视频进行预分析,为编码器选择合适的一组编码参数,对提升视频质量,控制编码的压缩率有重要的作用。Based on the importance of the coding parameters, pre-analysis of the video to be coded, selecting a suitable set of coding parameters for the encoder plays an important role in improving the video quality and controlling the compression rate of the coding.
本申请实施例采用CUTREE(区块树)算法来进行编码参数的计算,CUTREE算法的基本原理是通过分析当前图像帧每个区块与其他图像帧的相对信息量,为每个区块分配合理的编码参数,CUTREE的算法对视频质量具有较大提升。The embodiment of the present application adopts the CUTREE (block tree) algorithm to calculate the coding parameters. The basic principle of the CUTREE algorithm is to allocate a reasonable amount of information to each block by analyzing the relative information amount of each block of the current image frame and other image frames. The coding parameters of the CUTREE algorithm can greatly improve the video quality.
通常使用CUTREE算法时,需要计算当前图像帧和参考图像帧之前的相对关系,导致迭代次数太多,运算量太大,逐个图像帧进行计算时处理速度较慢,无法实时处理高分辨率的视频,并且硬件实现时会造成比较大的资源消耗,成本较高。Usually when using the CUTREE algorithm, it is necessary to calculate the relative relationship between the current image frame and the reference image frame, resulting in too many iterations, too much computation, slow processing speed when calculating one image frame by one, and unable to process high-resolution video in real time , and the hardware implementation will cause relatively large resource consumption and high cost.
针对上述问题,本申请实施例对CUTREE算法的处理过程中采用多个编码处理单元级执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤。编码处理单元是处理不同步骤的各个单位主体,从应用层面可以理解为执行各步骤对应功能的流水线,将编码参数的确定过程分配到多个具有先后顺序的流水线上执行。In view of the above problems, the embodiments of the present application use multiple encoding processing units to perform the encoding parameter determination process in the processing process of the CUTREE algorithm, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. The encoding processing unit is the main body of each unit that processes different steps. From the application level, it can be understood as a pipeline that performs functions corresponding to each step, and the process of determining encoding parameters is allocated to multiple pipelines with sequential execution.
一种可选的实施例中,可以将编码参数的确定过程划分为参数读取步骤、信息量获取步骤、数据计算步骤、以及数据交互步骤这四个步骤。其中,参数读取步骤和信息量获取步骤用于确定编码参数计算时所用到的依据数据,数据计算步骤完成编码参数的计算,数据交互步骤将编码参数进行保存用于后续编码时调用。具体实现中,分别采用编码处理单元执行上述各个步骤,例如一种实现方式中,可以设置四个编码处理单元分别执行上述四个步骤。可以理解的是,具体实现中,针对编码参数的确定过程可以有不同的步骤划分方式,也可以根据实际需求设置编码处理单元的个数。In an optional embodiment, the process of determining the encoding parameters may be divided into four steps: a parameter reading step, an information amount acquisition step, a data calculation step, and a data exchange step. The parameter reading step and the information amount obtaining step are used to determine the basis data used in the calculation of encoding parameters, the data calculation step completes the calculation of the encoding parameters, and the data exchange step saves the encoding parameters for subsequent encoding calls. In a specific implementation, encoding processing units are respectively used to perform the above steps. For example, in an implementation manner, four encoding processing units may be set to perform the above four steps respectively. It can be understood that, in the specific implementation, there may be different step division methods for the process of determining the encoding parameters, and the number of encoding processing units may also be set according to actual requirements.
针对待处理的图像帧计算编码参数时,将图像帧划分为数据块,由于涉及到当前处理的图像帧和参考图像帧分别对应的数据块,因此将当前待处理的图像帧对应至第一数据块,将参考图像帧对应至第二数据块。将第一数据块分批输入按序执行的多个编码处理单元,在多个编码处理单元处理后可得到数据块对应的编码参数,进而利用编码参数对图像帧进行编码。When calculating the encoding parameters for the image frame to be processed, the image frame is divided into data blocks. Since the data blocks corresponding to the currently processed image frame and the reference image frame are involved, the current image frame to be processed corresponds to the first data block. block, which corresponds the reference image frame to the second data block. The first data blocks are input in batches into multiple encoding processing units executed in sequence, and after processing by the multiple encoding processing units, encoding parameters corresponding to the data blocks can be obtained, and then the image frames are encoded by using the encoding parameters.
本申请实施例中,编码处理单元在同一时间处理同一批次进入的数据块,在一个数据块经过多个编码处理单元处理完毕之前,即开启下一数据块在编码处理单元的处理,因此使得多批数据块的处理可以同时进行。为使得多批数据块的处理的同时处理达到更高效率,设计编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,。可以理解的是,在这种处理模式下,待处理的目标图像帧对应的多个数据块在编码处理单元的处理时间为,排序最前的第一数据块在所有编码处理单元的处理时间与其他第一 数据块在最后一个编码处理单元的处理时间之和的加和,相比于逐帧处理的方式,大大提高了处理效率。In the embodiment of the present application, the encoding processing unit processes the data blocks entered in the same batch at the same time, and before a data block is processed by multiple encoding processing units, the processing of the next data block in the encoding processing unit is started, so that the The processing of multiple batches of data blocks can be performed simultaneously. In order to make the processing of multiple batches of data blocks more efficient, the coding processing unit is designed to execute the processing of the next batch of data blocks after processing the previous batch of data blocks, and execute the processing part in multiple coding processing units. During the time period, at least two encoding processing units perform processing synchronously. It can be understood that in this processing mode, the processing time of multiple data blocks corresponding to the target image frame to be processed in the encoding processing unit is, the processing time of the first data block in all encoding processing units is the same as the processing time of the other encoding processing units. The summation of the sum of the processing time of the first data block in the last coding processing unit greatly improves the processing efficiency compared with the frame-by-frame processing method.
由此可见,相比于以视频帧为单位顺序执行的方式,本申请实施例可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率(与现有技术的比对显示提高数倍),同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。It can be seen that, compared with the sequential execution method in units of video frames, the embodiment of the present application can greatly shorten the time spent for determining the encoding parameters, and improve the efficiency of video encoding (compared with the prior art, the comparison shows that the time is increased by several times) ), while reducing the processing delay of the data block. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
由于视频中的图像帧之间存在运动相关性,也即是图像帧之间存在部分变化的内容以及部分相同的内容,因此可以将目标图像帧表示为与作为参考图像帧的某个图像帧之间的图像内容差异(可以表示为传递信息量),反之,根据该图像内容差异与参考图像帧得到目标图像帧。因此,在对目标图像帧进行数据块的划分时,可以将所述目标图像帧的特定区域划分为多个第一数据块,其中,目标区域是目标图像帧相对于参考图像帧发生内容变化的区域。Since there is motion correlation between the image frames in the video, that is, there are partially changed contents and partially the same contents among the image frames, the target image frame can be expressed as the difference between the target image frame and a certain image frame as the reference image frame. The difference of the image content between the two (which can be expressed as the amount of information transmitted), on the contrary, the target image frame is obtained according to the difference of the image content and the reference image frame. Therefore, when the target image frame is divided into data blocks, a specific area of the target image frame can be divided into a plurality of first data blocks, wherein the target area is the content of the target image frame that changes relative to the reference image frame. area.
上述将第一数据块分批次输入编码处理单元,可以是多个数据块作为一个批次,也可以是一个数据块作为一个批次,均可以达到不同批次的数据块同时执行处理的效果。在多个数据块进入编码处理单元进行处理时,由于在先处理完的数据块需要等待在后处理完的数据块,从而造成时间浪费,因此,使用一个数据块作为一个批次,将多个第一数据块逐个输入数据处理单元进行数据处理,可以更好地提高处理效率。The above-mentioned inputting the first data blocks into the encoding processing unit in batches can be multiple data blocks as a batch, or a data block as a batch, which can achieve the effect of simultaneously processing data blocks of different batches . When multiple data blocks enter the encoding processing unit for processing, since the previously processed data blocks need to wait for the later processed data blocks, time is wasted. Therefore, one data block is used as a batch, and multiple data blocks are The first data block is input to the data processing unit one by one for data processing, which can better improve processing efficiency.
相比于没有采用CUTREE技术的方案,可以显著提升视频质量,减少编码码率。经统计,采用该结构的编码系统,在同等视频质量的前提下,可以平均节省10%-15%的编码码率。Compared with the solution without CUTREE technology, it can significantly improve the video quality and reduce the coding rate. According to statistics, the coding system using this structure can save 10%-15% of the coding bit rate on average under the premise of the same video quality.
上面描述了通过多个编码处理单元实现编码参数的确定过程,视频编码的过程除了使用编码参数,还需要实时更新参考图像帧的总信息量,以保证各个编码单元所使用的参考图像帧的信息量为最新的准确数据。相应的,CUTREE算法的处理过程分为两部分,其一是确定编码参数(主要是量化参数),根据当前的第一数据块的信息量和相关信息,计算得到第一数据块的量化参数。其二是叠加信息量,需要确定第一数据块的传递信息量,并根据运动矢量,将第一数据块的传递信息量,叠加到参考图像帧对应的第二数据块的初始信息量,得到第二数据块的总信息量,也可以称之为CUTREE信息量,不同于传统意义上的信息量,如果一个区块被叠加的次数越多,则信息量就越大,相应确定的量化参数就越小,代表这个区块重要程度高,需要采用高质量的编码。The above describes the process of determining the encoding parameters through multiple encoding processing units. In addition to using the encoding parameters, the video encoding process also needs to update the total amount of information of the reference image frame in real time to ensure the information of the reference image frame used by each encoding unit. The quantity is the latest accurate data. Correspondingly, the processing process of the CUTREE algorithm is divided into two parts. One is to determine the coding parameters (mainly quantization parameters), and calculate the quantization parameters of the first data block according to the information amount and related information of the current first data block. The second is the amount of superimposed information. It is necessary to determine the amount of information transmitted in the first data block, and according to the motion vector, superimpose the amount of transmitted information in the first data block to the initial amount of information in the second data block corresponding to the reference image frame. The total amount of information of the second data block can also be called the amount of CUTREE information, which is different from the amount of information in the traditional sense. The more times a block is superimposed, the greater the amount of information. The smaller the value, the higher the importance of this block, and the need for high-quality encoding.
因此,上述编码处理单元还可以对应执行所述目标图像帧的参考图像帧的总信息量确定过程中的一个或多个步骤,参数读取步骤和信息量获取步骤还对应读取参考图像帧的信息确定所用到的依据数据,数据交互步骤还用于保存参考真的信息量以供编码时调用。Therefore, the above encoding processing unit may also correspondingly execute one or more steps in the process of determining the total information content of the reference image frame of the target image frame, and the parameter reading step and the information content obtaining step may also correspond to reading the reference image frame. The information determines the basis data used, and the data interaction step is also used to save the reference information for invoking during encoding.
其中,参考帧的总信息量的计算可以在编码参数的确定之前执行,还可以根据实际 需要设定执行顺序。Wherein, the calculation of the total information amount of the reference frame can be performed before the determination of the coding parameters, and the execution order can also be set according to actual needs.
在具体实现中,还可以使用本申请的上述多编码处理单元的执行模式实现其它计算过程,具体实现过程与上述执行过程类似,此处不再赘述。In specific implementation, other calculation processes may also be implemented by using the execution mode of the above-mentioned multi-coding processing unit of the present application, and the specific implementation process is similar to the above-mentioned execution process, which will not be repeated here.
本申请实施例可以部署在处理芯片上,例如可以是FPGA(Field Programmable Gate Array,可编程逻辑器件)芯片,该芯片可以进一步部署在视频编码设备上,该设备具有一定的计算能力,该设备可以是用户侧终端、常规服务器、云服务器、云主机、虚拟中心等。经过该芯片编码后的视频可以进一步进行网络传输,用于视频应用的终端播放、视频处理等作用。The embodiments of the present application can be deployed on a processing chip, for example, an FPGA (Field Programmable Gate Array, programmable logic device) chip, and the chip can be further deployed on a video encoding device. The device has certain computing capabilities, and the device can It is a user-side terminal, conventional server, cloud server, cloud host, virtual center, etc. The video encoded by the chip can be further transmitted over the network and used for terminal playback and video processing of video applications.
如下结合一个具体的应用示例进行说明,参考图1,示出了本申请实施例基于FPGA实现视频编码过程的示意图。该FPGA芯片上部署有四个编码处理单元,即第一编码处理单元、第二编码处理单元、第三编码处理单元和第四编码处理单元,分别对应执行编码参数的确定过程中的参数读取步骤、信息量获取步骤、数据计算步骤、以及数据交互步骤。The following description will be given with reference to a specific application example. Referring to FIG. 1 , a schematic diagram of implementing a video encoding process based on an FPGA in an embodiment of the present application is shown. Four encoding processing units are deployed on the FPGA chip, namely the first encoding processing unit, the second encoding processing unit, the third encoding processing unit and the fourth encoding processing unit, respectively corresponding to the parameter reading in the process of determining the encoding parameters steps, information acquisition steps, data calculation steps, and data interaction steps.
输入FPGA芯片的目标图像帧,首先切分为多个第一数据块,如图将视频帧切分为五个第一数据块,分别为CU0、CU1、CU2、CU3以及CU4。将五个第一数据块分批输入多个编码处理单元,前一批第一数据块的处理后,执行下一批第一数据块的处理。如图1所示,排序最前的第一数据块CU0进入第一编码处理单元执行参数读取步骤,在此时间其他编码处理单元均未有处理任务,CU0在第一编码处理单元处理完后,继续进入第二编码处理单元进行处理,空闲下来的第一编码处理单元则继续处理CU1。针对各CU,其处理过程是依次进入各编码处理单元进行处理,针对各编码处理单元,其处理过程是依次处理各CU,并在处理完前一CU后继续处理下一CU。CU在所有编码处理单元处理完毕后,得到各自对对应的编码参数,在依据编码参数对各CU的编码结果,可以进一步得到图像帧的编码结果。The target image frame input to the FPGA chip is first divided into multiple first data blocks. As shown in the figure, the video frame is divided into five first data blocks, namely CU0, CU1, CU2, CU3 and CU4. The five first data blocks are input into multiple encoding processing units in batches, and after the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed. As shown in FIG. 1 , the first data block CU0 ranked first enters the first encoding processing unit to perform the parameter reading step. At this time, other encoding processing units have no processing tasks. After CU0 is processed by the first encoding processing unit, Continue to enter the second encoding processing unit for processing, and the idle first encoding processing unit continues to process CU1. For each CU, the processing procedure is to sequentially enter each encoding processing unit for processing, and for each encoding processing unit, the processing procedure is to sequentially process each CU, and continue processing the next CU after processing the previous CU. After all the encoding processing units have finished processing, the CU obtains the encoding parameters corresponding to the respective pairs, and further obtains the encoding result of the image frame according to the encoding result of each CU according to the encoding parameter.
在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从图1可看出,在除去CU0在第一编码处理单元以及CU4在第四编码单元的处理之外,各编码单元针对不同数据块的处理过程同时进行,比如CU4在第一编码处理单元处理的同时,CU3在第二编码处理单元处理,CU2在第三编码单元处理,CU1在第四编码单元处理。总的处理时长是如下两者加和:CU0在四个编码处理单元的处理时间,以及,CU1、CU2、CU3和CU4在第四编码处理单元的处理时间之和。相比于各个数据块先后处理的方式节省了处理时间。假设各个数据块在编码处理单元的处理时间相同,均为X时长,则该示例所耗费8X时长,而逐帧处理则耗费20X时长。During a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously. As can be seen from FIG. 1 , after excluding the processing of CU0 in the first encoding processing unit and CU4 in the fourth encoding unit In addition, each coding unit processes different data blocks at the same time. For example, CU4 is processed in the first coding processing unit, CU3 is processed in the second coding processing unit, CU2 is processed in the third coding unit, and CU1 is processed in the fourth coding unit. deal with. The total processing time is the sum of the following two: the processing time of CU0 in the four encoding processing units, and the sum of the processing time of CU1, CU2, CU3 and CU4 in the fourth encoding processing unit. Compared with the method of processing each data block sequentially, the processing time is saved. Assuming that the processing time of each data block in the encoding processing unit is the same, which is X duration, the example takes 8X duration, while frame-by-frame processing takes 20X duration.
需要说明的是,提供上述应用示例的目的是便于理解本申请实施例提供的所述方法,而并非用于限定所述方法。It should be noted that the purpose of providing the above application examples is to facilitate the understanding of the methods provided in the embodiments of the present application, but is not intended to limit the methods.
接下来描述本申请的各个实施例。Next, various embodiments of the present application are described.
参照图2,示出了根据本申请实施例一的一种图像帧编码方法实施例的流程图,该方法具体可以包括以下步骤:Referring to FIG. 2, a flowchart of an embodiment of an image frame encoding method according to Embodiment 1 of the present application is shown, and the method may specifically include the following steps:
步骤101,将目标图像帧划分为多个第一数据块。Step 101: Divide the target image frame into a plurality of first data blocks.
数据块CU是从图像帧中划分出来的更小编码单元。可以根据实际需要设定划分效果,包括各个数据块的尺寸、形状、区域以及数据块的个数等,例如,可以划分为8x8或16x16的数据块。还可以先划分出较大的数据块,进一步将较大的数据块划分为较小的数据块。具体的划分方法可以根据实际需求选择,例如可以采用四叉树分割法。A data block CU is a smaller coding unit divided from an image frame. The division effect can be set according to actual needs, including the size, shape, area, and number of data blocks of each data block. For example, it can be divided into 8x8 or 16x16 data blocks. It is also possible to first divide a larger data block, and further divide the larger data block into smaller data blocks. The specific division method can be selected according to actual requirements, for example, a quad-tree division method can be used.
为了更好的适应图像细节,可以将复杂细节的图像区域划分较小的数据块尺寸,而简单部的图像区域划分较大的数据块尺寸。In order to better adapt to the image details, the image area of complex details can be divided into smaller data block sizes, while the image areas of simple parts can be divided into larger data block sizes.
在数据块的划分过程中还可以参考率失真优化来决定。对于一个较大的数据块可以划分为较小的数据块,在这个过程中会计算较大数据块的率失真代价,和较小数据块的率失真代价之和,如果后者小,则会进行较小数据块的划分。In the process of dividing the data block, it can also be determined with reference to rate-distortion optimization. For a larger data block, it can be divided into smaller data blocks. In this process, the rate-distortion cost of the larger data block and the sum of the rate-distortion cost of the smaller data block will be calculated. If the latter is small, it will be Divide into smaller data blocks.
步骤102,将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理。Step 102: Input the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit executes the processing of the previous batch of first data blocks, executes the next batch of first data blocks Block processing, the encoding processing unit correspondingly performs one or more steps in the process of determining the encoding parameters of the target image frame. The processing units execute processing synchronously.
编码处理单元在同一时间处理同一批次进入的数据块,在一个数据块经过多个编码处理单元处理完毕之前,即开启下一数据块在编码处理单元的处理,也即是多批数据块的处理可以同时进行。The encoding processing unit processes the data blocks entered in the same batch at the same time. Before a data block is processed by multiple encoding processing units, the processing of the next data block in the encoding processing unit is started, that is, the processing of multiple batches of data blocks. Processing can be performed simultaneously.
将第一数据块分批次输入编码处理单元,可以是多个数据块作为一个批次,也可以是一个数据块作为一个批次。The first data blocks are input into the encoding processing unit in batches, which may be multiple data blocks as one batch, or one data block as one batch.
为使得多批数据块的处理的同时处理达到更高效率,设计编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理。相比于逐帧处理的方式,大大提高了处理效率。In order to achieve higher efficiency in the simultaneous processing of multiple batches of data blocks, the coding processing unit is designed to process the next batch of data blocks after processing the previous batch of data blocks. Compared with the frame-by-frame processing method, the processing efficiency is greatly improved.
具体实现中,还可以通过控制信号来保证各编码处理单元互相独立,且不间断的工作。In specific implementation, control signals can also be used to ensure that the encoding processing units are independent of each other and work uninterruptedly.
步骤103,根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。Step 103: Encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
可以采用编码参数对各个第一数据块进行编码,根据各个数据块的编码结果得到目标图像帧的编码结果。Each first data block may be encoded by using an encoding parameter, and an encoding result of the target image frame may be obtained according to the encoding result of each data block.
依据本申请实施例,采用多个编码处理单元执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤,针对图像帧计算编码参数时,将图像帧划分为数据块,分批输入按序执行的多个编码处理单元,可得到编码参数,进而利用编码参数对图像帧进行编码。由于编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理 单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率,同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. When calculating encoding parameters for an image frame, the image frame is divided into data. The block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters. Since the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time. Compared with the sequential execution of video frames, the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
并且,本申请实施例的多编码处理单元处理方案通用性强,可以复制到不同的编码系统使用,并且可以将编码处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
参照图3,示出了根据本申请实施例二的一种图像帧编码方法实施例的流程图,该方法具体可以包括以下步骤:Referring to FIG. 3, a flowchart of an embodiment of an image frame encoding method according to Embodiment 2 of the present application is shown, and the method may specifically include the following steps:
步骤201,将所述目标图像帧的特定区域划分为多个第一数据块,所述目标区域为所述目标图像帧相对于参考图像帧发生内容变化的区域。Step 201: Divide a specific area of the target image frame into a plurality of first data blocks, where the target area is an area where the content of the target image frame changes relative to the reference image frame.
基于视频中的图像帧之间存在运动相关性,可以将目标图像帧表示为与作为参考图像帧的某个图像帧之间的图像内容差异,相应的,在对目标图像帧进行数据块的划分时,可以确定目标图像帧相对于参考图像帧发生内容变化的区域,进一步将变化的区域划分为多个第一数据块。Based on the motion correlation between the image frames in the video, the target image frame can be represented as the image content difference between the target image frame and a certain image frame as the reference image frame. Correspondingly, the target image frame is divided into data blocks. When the content of the target image frame changes relative to the reference image frame, it can be determined, and the changed area is further divided into a plurality of first data blocks.
步骤202,将所述多个第一数据块逐个输入数据处理单元进行数据处理;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理。 Step 202, inputting the plurality of first data blocks into a data processing unit one by one for data processing; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, performs the processing of the next batch of the first data blocks, The encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units execute synchronously. deal with.
使用一个数据块作为一个批次,相比于多个数据块作为一个批次,可以更好地提高处理效率。Using one data block as a batch can improve processing efficiency better than multiple data blocks as a batch.
步骤203,根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。Step 203: Encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
依据本申请实施例,采用多个编码处理单元执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤,针对图像帧计算编码参数时,将图像帧划分为数据块,分批输入按序执行的多个编码处理单元,可得到编码参数,进而利用编码参数对图像帧进行编码。由于编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率,同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. When calculating encoding parameters for an image frame, the image frame is divided into data. The block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters. Since the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time. Compared with the sequential execution of video frames, the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
并且,本申请实施例的多编码处理单元处理方案通用性强,可以复制到不同的编码系统使用,并且可以将编码处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
参照图4,示出了根据本申请实施例三的一种图像帧编码方法实施例的流程图,该方法具体可以包括以下步骤:Referring to FIG. 4 , a flowchart of an embodiment of an image frame encoding method according to Embodiment 3 of the present application is shown, and the method may specifically include the following steps:
步骤301,将目标图像帧划分为多个第一数据块。Step 301: Divide the target image frame into a plurality of first data blocks.
步骤302,将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述数据处理单元对应执行所述目标图像帧的编码参数的确定过程中的参数读取步骤、信息量获取步骤、数据计算步骤、以及数据交互步骤,在所述四个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理。Step 302: Input the multiple first data blocks in batches into multiple encoding processing units that are executed in sequence; after the encoding processing unit executes the processing of the previous batch of first data blocks, executes the next batch of first data Block processing, the data processing unit corresponds to the parameter reading step, the information amount acquisition step, the data calculation step, and the data exchange step in the process of determining the encoding parameters of the target image frame. During a part of the time period during which the unit performs processing, at least two encoding processing units perform processing synchronously.
步骤303,根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。Step 303: Encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
本实施例中具体确定了各个编码处理单元的处理内容,将编码参数的确定过程划分为参数读取步骤、信息量获取步骤、数据计算步骤、以及数据交互步骤。编码处理单元的个数以及具体执行的处理内容可以根据实际需要设定,一个编码处理单元可以处理其中一个或多个步骤。例如,设计三个编码处理单元,第一编码处理单元处理参数读取步骤和信息量获取步骤,第二编码处理单元处理数据计算步骤,第三编码处理单元处理数据交互步骤。In this embodiment, the processing content of each encoding processing unit is specifically determined, and the encoding parameter determination process is divided into a parameter reading step, an information amount acquisition step, a data calculation step, and a data exchange step. The number of encoding processing units and the specific processing content can be set according to actual needs, and one encoding processing unit can process one or more of the steps. For example, three encoding processing units are designed, the first encoding processing unit handles the parameter reading step and the information amount acquisition step, the second encoding processing unit handles the data calculation step, and the third encoding processing unit handles the data interaction step.
在本申请的一种可选实施例中,所述参数读取步骤包括:读取所述第一数据块的预测参数,所述预测参数包含目标图像帧编码过程中的预测方向和预测代价。其中,预测方向可以是帧内预测或帧间预测,还可以是帧内预测结合帧间预测,预测代价则衡量了编码预测过程中导致的偏差数据。In an optional embodiment of the present application, the parameter reading step includes: reading a prediction parameter of the first data block, where the prediction parameter includes a prediction direction and a prediction cost in the encoding process of the target image frame. The prediction direction may be intra-frame prediction or inter-frame prediction, or may be intra-frame prediction combined with inter-frame prediction, and the prediction cost measures the deviation data caused in the encoding prediction process.
图像帧的预测是在编码过程中采用的一种压缩处理,可以分为帧内预测和帧间预测,也可以称之为帧间编码和帧内编码。帧内预测基于由于同一幅图像中像素之间较强的相关性,可以利用像素间的相关性进行压缩编码。例如,以某个像素作为参考像素,将其他像素与该参考像素的差值来替代表达其他像素,从而可以起到对其他像素进行压缩的作用。例如,在发送数据时,把实际像素X(当前值)和参考像素(预测值)相减,传送差值,接收端根据差值和参考像素的加和,得到实际像素。帧间预测则是基于视频中前后两个图像帧之间具有较强的相关性,例如,参考图像帧可以是在某个方向上距离目标图像帧最近的一个图像帧,采用目标图像帧与参考图像帧的差值来表达目标图像帧,从而起到压缩图像帧的作用。Prediction of image frames is a compression process used in the encoding process, which can be divided into intra-frame prediction and inter-frame prediction, which can also be called inter-frame coding and intra-frame coding. Intra-frame prediction is based on the fact that due to the strong correlation between pixels in the same image, the correlation between pixels can be used for compression coding. For example, a certain pixel is used as a reference pixel, and the difference between other pixels and the reference pixel is used to express other pixels, so as to compress other pixels. For example, when sending data, the actual pixel X (current value) and the reference pixel (predicted value) are subtracted, the difference value is transmitted, and the receiving end obtains the actual pixel according to the sum of the difference value and the reference pixel. Inter-frame prediction is based on the strong correlation between the two image frames before and after the video. For example, the reference image frame can be an image frame that is closest to the target image frame in a certain direction. The difference value of the image frame is used to express the target image frame, so as to compress the image frame.
本申请的一种可选实施例中,所述信息量获取步骤包括:根据所述第一数据块的信息量存储地址,从对应存储器获取所述第一数据块的初始信息量根据所述第一数据块的预测代价和编码帧率,得到所述第一数据块的帧内信息量;根据所述帧内信息量和初始信息量确定所述第一数据块的总信息量。例如,可以是预测代价乘以编码帧率得到第一数据块的帧内信息量,再将帧内信息量加上初始信息量,得到第一数据块的总信息量。In an optional embodiment of the present application, the step of obtaining the information amount includes: according to the information amount storage address of the first data block, obtaining the initial information amount of the first data block from a corresponding memory according to the first data block. The prediction cost and the encoding frame rate of a data block are used to obtain the intra-frame information amount of the first data block; the total information amount of the first data block is determined according to the intra-frame information amount and the initial information amount. For example, the prediction cost can be multiplied by the encoding frame rate to obtain the intra-frame information amount of the first data block, and then the intra-frame information amount is added to the initial information amount to obtain the total information amount of the first data block.
其中,图像帧的初始信息量用于计算总信息量,其他帧如果引用当前图像帧,就会 叠加到这一帧的信息量上,所以在CUTREE计算的过程中,每一帧的信息量是不断增大,直到叠加过程结束,得到总信息量,用于推导量化参数。Among them, the initial information amount of the image frame is used to calculate the total information amount. If other frames refer to the current image frame, they will be superimposed on the information amount of this frame. Therefore, in the process of CUTREE calculation, the information amount of each frame is It keeps increasing until the superposition process ends, and the total amount of information is obtained, which is used to derive the quantization parameters.
图像帧的初始信息量可以预先通过图像的像素数量和可分辨的色彩数量计算得到。The initial information amount of the image frame can be calculated in advance by the number of pixels and the number of distinguishable colors in the image.
本申请的一种可选实施例中,所述数据计算步骤包括:根据读取的所述第一数据块的总信息量、预测方向和预测代价确定用于所述第一数据块对应的编码参数。以预测方向为帧内预测、编码参数为量化参数为例,预测代价为帧内预测代价,将第一数据块的总信息量乘以编码帧率系数,除以该第一数据块的帧内预测代价系数,并对结果取log对数,即可得到量化参数。In an optional embodiment of the present application, the data calculation step includes: determining a code corresponding to the first data block according to the read total information amount, prediction direction and prediction cost of the first data block parameter. Taking the prediction direction as intra-frame prediction and the encoding parameter as the quantization parameter as an example, the prediction cost is the intra-frame prediction cost. The quantization parameters can be obtained by predicting the cost coefficient and taking the logarithm of the result.
本申请的一种可选实施例中,所述参数读取步骤包括:所述根据所述第一数据块在图像中的位置在获取所述第一数据块的信息量存储地址。首先确定数据块在图像中的位置,根据位置与信息量存储地址的映射关系,可以确定第一数据块的信息量存储地址。In an optional embodiment of the present application, the parameter reading step includes: acquiring an information storage address of the first data block according to the position of the first data block in the image. First, the position of the data block in the image is determined, and the information storage address of the first data block can be determined according to the mapping relationship between the position and the information storage address.
由于视频编码的过程除了使用编码参数,还需要依据参考图像帧的信息量,因此,还可以通过多个编码处理单元实现编码参数的确定过程。Since the video coding process needs to use the coding parameters as well as the information amount of the reference image frame, the coding parameter determination process can also be implemented by a plurality of coding processing units.
因此,上述编码处理单元还可以对应执行所述目标图像帧的参考图像帧的总信息量确定过程中的一个或多个步骤,参数读取步骤和信息量获取步骤还对应读取参考图像帧的信息确定所用到的依据数据,数据交互步骤还用于保存参考真的信息量以供编码时调用。Therefore, the above encoding processing unit may also correspondingly execute one or more steps in the process of determining the total information content of the reference image frame of the target image frame, and the parameter reading step and the information content obtaining step may also correspond to reading the reference image frame. The information determines the basis data used, and the data interaction step is also used to save the reference information for invoking during encoding.
相应的,所述信息量获取步骤还可以包括:根据所述第一数据块的总信息量确定所述目标图像帧与参考图像帧之间的传递信息量。信息量获取步骤还可以获取用于计算参考帧的总信息量的依据之一,也即是目标图像帧的第一数据块的总信息量,进一步根据第一数据块的总信息量确定目标图像帧与参考图像帧之间的传递信息量,也即是两者之间的差异信息量。Correspondingly, the step of obtaining the information amount may further include: determining the amount of information transferred between the target image frame and the reference image frame according to the total information amount of the first data block. The information content acquisition step can also obtain one of the basis for calculating the total information content of the reference frame, that is, the total information content of the first data block of the target image frame, and further determine the target image according to the total information content of the first data block. The amount of information transferred between the frame and the reference image frame, that is, the amount of difference information between the two.
相应的,所述数据计算步骤还包括:获取参考图像帧中第二数据块的初始信息量;将所述第一数据块的传递信息量叠加至参考图像帧中第二数据块的初始信息量,获得所述参考图像帧中第二数据块的总信息量。由于传递信息量也是目标图像帧与参考图像帧之间的差异信息量,因此,可以将传递信息量叠加至参考图像帧的初始信息量之上,得到所述参考图像帧中第二数据块的总信息量。Correspondingly, the data calculation step further includes: acquiring the initial information amount of the second data block in the reference image frame; superimposing the transfer information amount of the first data block to the initial information amount of the second data block in the reference image frame , to obtain the total information amount of the second data block in the reference image frame. Since the transfer information amount is also the difference information amount between the target image frame and the reference image frame, the transfer information amount can be superimposed on the initial information amount of the reference image frame to obtain the information of the second data block in the reference image frame. total amount of information.
本申请的一种可选实施例中,所述参数读取步骤包括:读取预测代价系数。预测代价系数为针对预测代价,也即是预测偏差或是编码偏差的系数,可以预先设定,也可以根据预测代价的数值范围确定对应该范围设定的预测代价系数。In an optional embodiment of the present application, the parameter reading step includes: reading a prediction cost coefficient. The prediction cost coefficient is a coefficient for the prediction cost, that is, the prediction deviation or the coding deviation, which can be preset, or the prediction cost coefficient set corresponding to the range can be determined according to the numerical range of the prediction cost.
相应的,本申请的一种可选实施例中,所述根据所述第一数据块的初始信息量确定所述目标图像帧与参考图像帧之间的传递信息量包括:根据所述第一数据块的预测代价和编码帧率,得到所述第一数据块的帧内信息量;根据所述帧内信息量和初始信息量确定所述第一数据块的总信息量;根据所述总信息量和预测代价系数确定所述第一数据块 的传递信息量。其中具体的计算公式可以根据实际需求设定,且该数据的计算过程为本领域的公知技术,此处不再赘述。Correspondingly, in an optional embodiment of the present application, the determining the amount of information transferred between the target image frame and the reference image frame according to the initial information amount of the first data block includes: according to the first data block The prediction cost of the data block and the encoding frame rate are used to obtain the intra-frame information amount of the first data block; the total information amount of the first data block is determined according to the intra-frame information amount and the initial information amount; The amount of information and the prediction cost coefficient determine the amount of conveyed information for the first data block. The specific calculation formula can be set according to actual needs, and the calculation process of the data is a well-known technology in the art, which will not be repeated here.
本申请的一种可选实施例中,所述参数读取步骤还包括:根据所述第一数据块在目标图像帧中的位置以及所述运动矢量,确定参考图像帧中待叠加信息量的第二数据块的位置。此处的运动矢量(MotionVector,MV)表示帧间编码过程中,第一数据块与其参考图像帧图像中的匹配度最高的第二数据块之间的相对位移,因此,根据第一数据块在目标图像中的位置结合运动矢量表征的相对位移,可以确定参考图像帧中与第一数据块对应的第二数据块的位置。In an optional embodiment of the present application, the parameter reading step further includes: determining the amount of information to be superimposed in the reference image frame according to the position of the first data block in the target image frame and the motion vector The location of the second data block. The motion vector (MotionVector, MV) here represents the relative displacement between the first data block and the second data block with the highest matching degree in the reference image frame during the inter-frame coding process. Therefore, according to the first data block in the The position in the target image is combined with the relative displacement represented by the motion vector to determine the position of the second data block corresponding to the first data block in the reference image frame.
本申请的一种可选实施例中,所述数据交互步骤包括:将所述编码参数存储至对应的存储单元,以供后续编码时调用。In an optional embodiment of the present application, the data interaction step includes: storing the encoding parameters in a corresponding storage unit for subsequent invocation during encoding.
本申请的一种可选实施例中,所述数据交互步骤包括:将所述参考图像帧中第二数据块的总信息量传递至关联使用的其他编码处理单元,以及时更新其他编码处理单元所使用的数据,保证其他编码处理单元所用的数据是最新的准确数,避免从存储位置访问参考图像帧中第二数据块的总信息量时,存储器数据更新不及时导致得到编码处理单元停顿。In an optional embodiment of the present application, the data exchange step includes: transferring the total amount of information of the second data block in the reference image frame to other encoding processing units used in association, and updating other encoding processing units in time The data used ensures that the data used by other encoding processing units is the latest and accurate data, and avoids that when the total information amount of the second data block in the reference image frame is accessed from the storage location, the data in the memory is not updated in time and the encoding processing unit is stopped.
依据本申请实施例,采用多个编码处理单元执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤,针对图像帧计算编码参数时,将图像帧划分为数据块,分批输入按序执行的多个编码处理单元,可得到编码参数,进而利用编码参数对图像帧进行编码。由于编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率,同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. When calculating encoding parameters for an image frame, the image frame is divided into data. The block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters. Since the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time. Compared with the sequential execution of video frames, the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
并且,本申请实施例的多编码处理单元处理方案通用性强,可以复制到不同的编码系统使用,并且可以将编码处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
参照图5,示出了根据本申请实施例四的一种视频编码方法实施例的流程图,该方法具体可以包括以下步骤:Referring to FIG. 5 , a flowchart of an embodiment of a video coding method according to Embodiment 4 of the present application is shown, and the method may specifically include the following steps:
步骤401,将视频中的目标图像帧划分为多个第一数据块。Step 401: Divide the target image frame in the video into a plurality of first data blocks.
步骤402,将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行图像帧的编码参数的确定过程中的一个或多个步骤。Step 402: Input the multiple first data blocks into multiple encoding processing units that are executed in sequence; after the encoding processing unit performs the processing of the previous batch of first data blocks, executes the next batch of first data blocks Block processing, the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the image frame.
步骤403,根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。Step 403: Encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
步骤404,根据所述目标图像帧的编码结果得到所述视频的编码结果。Step 404: Obtain the encoding result of the video according to the encoding result of the target image frame.
依据本申请实施例,采用多个编码处理单元执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤,针对图像帧计算编码参数时,将图像帧划分为数据块,分批输入按序执行的多个编码处理单元,可得到编码参数,进而利用编码参数对图像帧进行编码。由于编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率,同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. When calculating encoding parameters for an image frame, the image frame is divided into data. The block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters. Since the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time. Compared with the sequential execution of video frames, the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
并且,本申请实施例的多编码处理单元处理方案通用性强,可以复制到不同的编码系统使用,并且可以将编码处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
参照图6,示出了根据本申请实施例五的一种视频编码方法实施例的流程图,该方法具体可以包括以下步骤:Referring to FIG. 6 , a flowchart of an embodiment of a video coding method according to Embodiment 5 of the present application is shown, and the method may specifically include the following steps:
步骤501,将视频中的目标图像帧的特定区域划分为多个第一数据块,所述目标区域为所述目标图像帧相对于参考图像帧发生内容变化的区域。Step 501: Divide a specific area of a target image frame in the video into a plurality of first data blocks, where the target area is an area where the content of the target image frame changes relative to the reference image frame.
步骤502,将所述多个第一数据块分批输入按序执行的四个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,四个编码处理单元分别执行图像帧的编码参数的确定过程中的量化参数计算依据读取步骤、信息量获取步骤、量化参数和信息量计算步骤、以及量化参数和信息量写入步骤。Step 502: Input the multiple first data blocks in batches into four encoding processing units that are executed in sequence; after the encoding processing unit performs the processing of the previous batch of first data blocks, executes the next batch of first data The processing of the block, the four encoding processing units respectively perform the calculation of the quantization parameter in the process of determining the encoding parameter of the image frame according to the reading step, the information content acquisition step, the quantization parameter and the information content calculation step, and the quantization parameter and the information content write. step.
步骤503,根据四个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。Step 503: Encode the target image frame according to the encoding parameters corresponding to the four first data blocks respectively.
步骤504,根据所述目标图像帧的编码结果得到所述视频的编码结果。Step 504: Obtain the encoding result of the video according to the encoding result of the target image frame.
依据本申请实施例,采用多个编码处理单元执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤,针对图像帧计算编码参数时,将图像帧划分为数据块,分批输入按序执行的多个编码处理单元,可得到编码参数,进而利用编码参数对图像帧进行编码。由于编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率,同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. When calculating encoding parameters for an image frame, the image frame is divided into data. The block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters. Since the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time. Compared with the sequential execution of video frames, the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
并且,本申请实施例的多编码处理单元处理方案通用性强,可以复制到不同的编码系统使用,并且可以将编码处理单元配置为兼容其他处理过程,从而实现了多个处理过 程的优化处理,提高了系统的处理效率。In addition, the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
参照图7,示出了根据本申请实施例六的一种图像帧处理方法实施例的流程图,该方法具体可以包括以下步骤:Referring to FIG. 7 , a flowchart of an embodiment of an image frame processing method according to Embodiment 6 of the present application is shown, and the method may specifically include the following steps:
步骤601,将目标图像帧划分为多个第一数据块。Step 601: Divide the target image frame into a plurality of first data blocks.
步骤602,将所述多个第一数据块分批输入按序执行的多个处理单元。所述处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述处理单元对应执行所述目标图像帧的处理过程中的一个或多个步骤。Step 602: Input the plurality of first data blocks in batches into a plurality of processing units that are executed in sequence. The processing unit executes the processing of the next batch of first data blocks after processing the previous batch of the first data blocks, and the processing unit correspondingly executes one or more steps in the processing process of the target image frame.
依据本申请实施例,采用多个处理单元执行目标图像帧的处理过程,单个处理单元执行处理过程中的一个或多个步骤,将图像帧划分为数据块,分批输入按序执行的多个处理单元,可得到处理结果。由于处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩处理过程耗费的时间,提高了视频帧的处理效率,由于多处理单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of processing units are used to perform the processing process of the target image frame, a single processing unit performs one or more steps in the processing process, the image frame is divided into data blocks, and multiple processing units that are executed sequentially are input in batches. The processing unit can obtain processing results. Since the processing unit can perform the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that multiple encoding processing units perform processing synchronously. The processing of batch data blocks can be carried out at the same time. Compared with the sequential execution of video frames, the processing time can be greatly shortened and the processing efficiency of video frames can be improved. Resource multiplexing is performed, which can reduce chip area, reduce hardware overhead, reduce hardware cost, and facilitate hardware implementation.
并且,本申请实施例的多处理单元处理方案通用性强,可以复制到不同的处理系统使用,并且可以将处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different processing systems for use, and the processing unit can be configured to be compatible with other processing procedures, thereby realizing the optimization of multiple processing procedures and improving the performance of the processing. The processing efficiency of the system.
本申请实施例的图像帧处理方法可以应用于视频处理,进一步可以应用于软件服务SaaS(Software-as-a-Service,软件即服务)平台,提供为一种面向各种软件的视频处理服务。The image frame processing method in the embodiment of the present application can be applied to video processing, and further can be applied to a software service SaaS (Software-as-a-Service) platform, which is provided as a video processing service oriented to various software.
SaaS通过网络提供软件服务,平台供应商将应用软件统一部署在自己的服务器上,平台客户(例如提供软件的服务商)可以根据实际需求,通过互联网向平台定购所需的软件服务,进一步通过互联网获得平台提供的服务。SaaS provides software services through the network, platform providers deploy application software on their own servers, platform customers (such as software service providers) can order required software services from the platform through the Internet according to actual needs, and further through the Internet Access to the services provided by the platform.
具体实现过程可以包括:The specific implementation process can include:
步骤1、获取通过软件服务客户端提交的至少一个目标视频。Step 1. Obtain at least one target video submitted through the software service client.
步骤2、将目标视频的图像帧划分为多个第一数据块。Step 2: Divide the image frame of the target video into a plurality of first data blocks.
步骤3、将所述多个第一数据块分批输入按序执行的多个编码处理单元。所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理。Step 3: Input the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence. After the encoding processing unit performs the processing of the previous batch of first data blocks, the processing of the next batch of first data blocks is performed, and the encoding processing unit correspondingly performs one of the processes of determining the encoding parameters of the target image frame. or in a plurality of steps, in a partial period of time during which the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously.
步骤4、根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。Step 4: Encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
步骤5、根据多个图像帧的编码结果得到所述目标视频的编码结果。Step 5: Obtain an encoding result of the target video according to encoding results of multiple image frames.
步骤6、基于所述软件服务客户端提供所述目标视频的编码结果。Step 6: Provide the encoding result of the target video based on the software service client.
依据本申请实施例,采用多个处理单元执行目标图像帧的处理过程,单个处理单元执行处理过程中的一个或多个步骤,将图像帧划分为数据块,分批输入按序执行的多个处理单元,可得到处理结果。由于处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩处理过程耗费的时间,提高了视频帧的处理效率,由于多处理单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of processing units are used to perform the processing process of the target image frame, a single processing unit performs one or more steps in the processing process, the image frame is divided into data blocks, and multiple processing units that are executed sequentially are input in batches. The processing unit can obtain processing results. Since the processing unit can perform the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that multiple encoding processing units perform processing synchronously. The processing of batch data blocks can be carried out at the same time. Compared with the sequential execution of video frames, the processing time can be greatly shortened and the processing efficiency of video frames can be improved. Resource multiplexing is performed, which can reduce chip area, reduce hardware overhead, reduce hardware cost, and facilitate hardware implementation.
并且,本申请实施例的多处理单元处理方案通用性强,可以复制到不同的处理系统使用,并且可以将处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different processing systems for use, and the processing unit can be configured to be compatible with other processing procedures, thereby realizing the optimization of multiple processing procedures and improving the performance of the processing. The processing efficiency of the system.
为使本领域技术人员更好地理解本申请,以下通过具体的示例对本申请的一种图像帧编码方法进行说明,其中各级流水线也即是按序执行的编码处理单元。参考图14,示出了图像帧编码流程的示意图,具体包括如下步骤:In order for those skilled in the art to better understand the present application, an image frame encoding method of the present application is described below with specific examples, wherein the pipelines at all levels are encoding processing units executed in sequence. Referring to FIG. 14, a schematic diagram of an image frame encoding process is shown, which specifically includes the following steps:
1、CUTREE控制单元启动第一级流水线,根据目标图像帧的当前CU位置,从CU参数存储器中读出当前CU的信息,包含运动矢量、预测类型、帧内预测代价、帧间代价系数等。1. The CUTREE control unit starts the first-stage pipeline, and reads the information of the current CU from the CU parameter memory according to the current CU position of the target image frame, including motion vector, prediction type, intra-frame prediction cost, inter-frame cost coefficient, etc.
2、第一级流水线根据当前CU在图像中的位置,计算当前CU在存储器中的信息量存储地址;根据当前CU在图像中的位置和当前CU的运动矢量,计算每个参考图像帧中与上述当前CU对应的CU的信息量存储地址。2. The first-level pipeline calculates the information storage address of the current CU in the memory according to the position of the current CU in the image; according to the position of the current CU in the image and the motion vector of the current CU, calculates the difference between the current CU and the current CU in the image frame. The information storage address of the CU corresponding to the current CU.
3、第一级流水线操作结束后,开始处理下一个CU,同时控制单元启动第二级流水线。3. After the first-stage pipeline operation is completed, the processing of the next CU starts, and the control unit starts the second-stage pipeline at the same time.
4、第二级流水线根据每个参考帧中CU的信息量存储地址,读取参考图像帧的信息量存储器中读取参考图像帧的初始信息量;根据当前CU的信息量存储地址,从当前CU的信息量存储器读取当前CU的信息量。4. The second-stage pipeline reads the initial information amount of the reference image frame from the information amount memory of the reference image frame according to the information amount storage address of the CU in each reference frame; according to the information amount storage address of the current CU, from the current The information amount memory of the CU reads the information amount of the current CU.
5、第二级流水线将CU帧内预测代价乘以编码帧率,得到CU的帧内信息量,将CU帧内信息量加上从当前帧的信息量存储器中读出的当前CU的信息量,得到当前CU信息量总和。5. The second-stage pipeline multiplies the CU intra-frame prediction cost by the encoding frame rate to obtain the CU intra-frame information amount, and adds the CU intra-frame information amount to the current CU information amount read from the information amount memory of the current frame. , get the sum of the current CU information.
6、第二级流水线将当前CU信息量总和乘以CU的帧间代价系数,得到当前CU的传递信息量,计算完毕后控制单元启动第三级流水线。6. The second-stage pipeline multiplies the sum of the current CU information amount by the CU's inter-frame cost coefficient to obtain the current CU's transfer information amount. After the calculation is completed, the control unit starts the third-stage pipeline.
7、第三级流水线从参考帧信息量存储器中得到每个参考帧的4个CU的初始信息量,并将第二级流水线计算的当前CU的传递信息量叠加到每个参考帧中4个CU的初始信息量上。7. The third-stage pipeline obtains the initial information volume of 4 CUs of each reference frame from the reference frame information volume memory, and superimposes the transfer information volume of the current CU calculated by the second-stage pipeline to 4 in each reference frame. On the initial amount of information of the CU.
8、第三级流水线根据当前CU的总信息量,除以当前CU的帧内预测代价,并对结 果取log对数,得到量化参数。8. The third-stage pipeline divides the total information amount of the current CU by the intra-frame prediction cost of the current CU, and takes the logarithm of the result to obtain the quantization parameter.
9、第四级流水线将量化参数QP写入到量化参数QP存储器中,并将第三级流水线更新后每个参考帧中CU的总信息量写入参考帧信息量存储器。9. The fourth-stage pipeline writes the quantization parameter QP into the quantization parameter QP memory, and writes the total information amount of the CU in each reference frame after the third-stage pipeline is updated into the reference frame information amount memory.
10、如果第三级流水线所需要的参考帧中CU的总信息量来源于第四级流水线,第四级流水线可以将参考帧CU的总信息量结果反馈到第三级流水线,从而保证第三级流水线所需的CU信息量是最新的结果,从而避免不同流水线访问同一地址时,存储器数据更新不及时导致的流水线停顿。10. If the total amount of information of the CU in the reference frame required by the third-level pipeline comes from the fourth-level pipeline, the fourth-level pipeline can feed back the result of the total information amount of the reference frame CU to the third-level pipeline, so as to ensure the third-level pipeline. The amount of CU information required by the stage pipeline is the latest result, so as to avoid the pipeline stall caused by the untimely update of memory data when different pipelines access the same address.
如下提供一个具体的计算示例:A specific calculation example is provided as follows:
假设有10帧图像,假设为F0....F9,每一图像帧中每个数据块都对应一个CUTREE信息量,每个块的CUTREE的初始信息量(可以根据实际需要设置),存储在存储器中。Assuming that there are 10 frames of images, assuming F0....F9, each data block in each image frame corresponds to a CUTREE amount of information, and the initial amount of CUTREE information of each block (can be set according to actual needs), stored in in memory.
在确定量化参数的过程中,计算F1时,对F1中的每个数据块,读出存储器中这个块的初始信息量A(设置为0),并且根据这个块的帧内预测代价和编码帧率,计算帧内信息量B,然后将A加上B之后得到该数据块的总信息量。In the process of determining the quantization parameter, when calculating F1, for each data block in F1, read the initial information amount A of this block in the memory (set to 0), and according to the intra-frame prediction cost of this block and the coded frame rate, calculate the amount of information B in the frame, and then add A to B to get the total amount of information in the data block.
将总信息量乘以帧间代价系数C,得到结果(A+B)×C,为当前块的传递总信息量。Multiply the total amount of information by the inter-frame cost coefficient C to obtain the result (A+B)×C, which is the total amount of information transmitted in the current block.
假设F1的参考帧是F0,根据运动矢量找到F0中四个区块,从存储器中读出这四个区块的信息量,比如是K0,K1,K2,K3,将(A+B)×C分成四部分,叠加到K0,K1,K2,K3上,得到F0的四个数据块分别对应的总信息量,再将其更新到F0帧的存储器中。Assuming that the reference frame of F1 is F0, find the four blocks in F0 according to the motion vector, and read the information amount of these four blocks from the memory, such as K0, K1, K2, K3, set (A+B)× C is divided into four parts, superimposed on K0, K1, K2, K3, to obtain the total amount of information corresponding to the four data blocks of F0, and then update it to the memory of the F0 frame.
然后开始计算F2,F2如果同时参考F0和F1,那么F2计算完毕,F0和F1中每个区块的信息量也会更新。依次类推,当F0-F9都计算完毕。Then start to calculate F2. If F2 refers to F0 and F1 at the same time, then the calculation of F2 is completed, and the information amount of each block in F0 and F1 will also be updated. And so on, when F0-F9 are all calculated.
可以在计算完各数据块的总信息量后,开始计算F0至F9中,每个区块的量化参数。After calculating the total information amount of each data block, the quantization parameter of each block in F0 to F9 can be calculated.
比如开始计算F0中一个区块的量化参数,首先从存储器中读出总信息量(经过了F1...F9叠加),将这个总信息量乘以编码帧率系数,再除以这个块的帧内代价系数,最后取对数LOG,得到量化参数。For example, to start calculating the quantization parameter of a block in F0, first read the total amount of information from the memory (after the superposition of F1...F9), multiply the total amount of information by the encoding frame rate coefficient, and divide by the block's Intra-frame cost coefficient, and finally take the logarithm LOG to get the quantization parameter.
参照图8,示出了根据本申请实施例七的一种图像帧编码装置实施例的结构框图,具体可以包括:Referring to FIG. 8 , a structural block diagram of an embodiment of an image frame encoding apparatus according to Embodiment 7 of the present application is shown, which may specifically include:
数据块切分单元701,用于将目标图像帧划分为多个第一数据块,并将所述多个第一数据块分批输入按序执行的多个编码处理单元;a data block dividing unit 701, configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks in batches to a plurality of encoding processing units that are executed in sequence;
编码处理单元702,用于对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,并在执行完前一批第一数据块的处理后,执行下一批第一数据块的处理;The encoding processing unit 702 is configured to perform one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after performing the processing of the previous batch of first data blocks. processing of blocks;
编码单元703,用于根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The encoding unit 703 is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
本申请的一种可选的实施例中,所述数据块切分单元,具体用于将所述目标图像帧的特定区域划分为多个第一数据块,所述目标区域为所述目标图像帧相对于参考图像帧发生内容变化的区域。In an optional embodiment of the present application, the data block dividing unit is specifically configured to divide a specific area of the target image frame into a plurality of first data blocks, and the target area is the target image The area where the content of the frame changes relative to the reference image frame.
本申请的一种可选的实施例中,所述数据块切分单元,具体用于:将所述多个第一数据块逐个输入数据处理单元进行数据处理。In an optional embodiment of the present application, the data block dividing unit is specifically configured to: input the plurality of first data blocks one by one into a data processing unit to perform data processing.
本申请的一种可选的实施例中,多个数据处理单元包括参数读取单元、信息量获取单元、数据计算单元、以及数据交互单元。In an optional embodiment of the present application, the plurality of data processing units include a parameter reading unit, an information amount acquisition unit, a data calculation unit, and a data interaction unit.
本申请的一种可选的实施例中,所述参数读取单元,具体用于读取所述第一数据块的预测参数;所述预测参数包含目标图像帧编码过程中的预测方向和预测代价。In an optional embodiment of the present application, the parameter reading unit is specifically configured to read the prediction parameter of the first data block; the prediction parameter includes the prediction direction and prediction in the encoding process of the target image frame cost.
本申请的一种可选的实施例中,所述信息量获取单元,具体用于根据所述第一数据块的信息量存储地址,从对应存储器获取所述第一数据块的初始信息量;以及,根据所述第一数据块的预测代价和编码帧率,得到所述第一数据块的帧内信息量;根据所述帧内信息量和初始信息量确定所述第一数据块的总信息量。In an optional embodiment of the present application, the information amount obtaining unit is specifically configured to obtain the initial information amount of the first data block from the corresponding memory according to the information amount storage address of the first data block; and, according to the prediction cost and the encoding frame rate of the first data block, obtain the intra-frame information amount of the first data block; determine the total amount of the first data block according to the intra-frame information amount and the initial information amount amount of information.
本申请的一种可选的实施例中,所述数据计算单元,具体用于根据读取的所述第一数据块的总信息量、预测方向和预测代价确定用于所述第一数据块对应的编码参数。In an optional embodiment of the present application, the data calculation unit is specifically configured to determine, according to the read total information amount, prediction direction and prediction cost of the first data block, the data for the first data block the corresponding encoding parameters.
本申请的一种可选的实施例中,所述参数获取单元,具体用于所述根据所述第一数据块在图像中的位置在获取所述第一数据块的信息量存储地址。In an optional embodiment of the present application, the parameter obtaining unit is specifically configured to obtain the information storage address of the first data block according to the position of the first data block in the image.
本申请的一种可选的实施例中,所述编码处理单元还用于对应执行所述目标图像帧的参考图像帧的总信息量确定过程中的一个或多个步骤,所述信息量获取单元,还用于根据所述第一数据块的总信息量确定所述目标图像帧与参考图像帧之间的传递信息量;In an optional embodiment of the present application, the encoding processing unit is further configured to perform one or more steps in the process of determining the total information content of the reference image frame of the target image frame. unit, further configured to determine the amount of information transferred between the target image frame and the reference image frame according to the total amount of information of the first data block;
所述数据计算单元,还用于获取参考图像帧中第二数据块的初始信息量;将所述第一数据块的传递信息量叠加至参考图像帧中第二数据块的初始信息量,获得所述参考图像帧中第二数据块的总信息量。The data calculation unit is further configured to obtain the initial information amount of the second data block in the reference image frame; and superimpose the transfer information amount of the first data block to the initial information amount of the second data block in the reference image frame to obtain The total amount of information of the second data block in the reference image frame.
本申请的一种可选的实施例中,所述参数读取单元,用于读取预测代价系数;In an optional embodiment of the present application, the parameter reading unit is configured to read the prediction cost coefficient;
所述传递信息量确定子单元,用于根据第一数据块的总信息量和预测代价系数确定所述第一数据块的传递信息量。The transfer information amount determination subunit is configured to determine the transfer information amount of the first data block according to the total information amount of the first data block and the prediction cost coefficient.
本申请的一种可选的实施例中,所述参数读取单元,还用于根据所述第一数据块在目标图像帧中的位置以及所述运动矢量,确定参考图像帧中待叠加信息量的第二数据块的位置。In an optional embodiment of the present application, the parameter reading unit is further configured to determine the information to be superimposed in the reference image frame according to the position of the first data block in the target image frame and the motion vector The position of the second data block of the amount.
本申请的一种可选的实施例中,所述数据交互单元,用于将所述编码参数存储至对应的存储单元,以供后续编码时调用。In an optional embodiment of the present application, the data interaction unit is configured to store the encoding parameter in a corresponding storage unit for subsequent invocation during encoding.
本申请的一种可选的实施例中,所述数据交互单元,用于将更新的参考图像帧中第二数据块的总信息量传递至关联使用的其他编码处理单元。In an optional embodiment of the present application, the data exchange unit is configured to transmit the total amount of information of the second data block in the updated reference image frame to other encoding processing units used in association.
依据本申请实施例,采用多个编码处理单元执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤,针对图像帧计算编码参数时,将图像帧划分为数据块,分批输入按序执行的多个编码处理单元,可得到编码参数,进而利用编码参数对图像帧进行编码。由于编码处理单元在处理完前一批数据块后即可执行下 一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率,同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. When calculating encoding parameters for an image frame, the image frame is divided into data. The block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters. Since the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time. Compared with the sequential execution of video frames, the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
并且,本申请实施例的多编码处理单元处理方案通用性强,可以复制到不同的编码系统使用,并且可以将编码处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
参照图9,示出了根据本申请实施例八的一种视频编码装置实施例的结构框图,具体可以包括:Referring to FIG. 9 , a structural block diagram of an embodiment of a video encoding apparatus according to Embodiment 8 of the present application is shown, which may specifically include:
数据块切分单元801,用于将视频中的目标图像帧划分为多个第一数据块,并将所述多个第一数据块分批输入按序执行的多个编码处理单元;a data block dividing unit 801, configured to divide the target image frame in the video into a plurality of first data blocks, and input the plurality of first data blocks in batches into a plurality of encoding processing units executed in sequence;
编码处理单元802,用于对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,并在执行完前一批第一数据块的处理后,执行下一批第一数据块的处理;The encoding processing unit 802 is configured to perform one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after performing the processing of the previous batch of first data blocks. processing of blocks;
图像帧编码单元803,用于根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码;An image frame encoding unit 803, configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively;
视频编码单元804,用于根据所述目标图像帧的编码结果得到所述视频的编码结果。The video encoding unit 804 is configured to obtain the encoding result of the video according to the encoding result of the target image frame.
依据本申请实施例,采用多个编码处理单元执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤,针对图像帧计算编码参数时,将图像帧划分为数据块,分批输入按序执行的多个编码处理单元,可得到编码参数,进而利用编码参数对图像帧进行编码。由于编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率,同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. When calculating encoding parameters for an image frame, the image frame is divided into data. The block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters. Since the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time. Compared with the sequential execution of video frames, the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
并且,本申请实施例的多编码处理单元处理方案通用性强,可以复制到不同的编码系统使用,并且可以将编码处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
参照图10,示出了根据本申请实施例九的一种视频编码装置实施例的结构框图,具体可以包括:Referring to FIG. 10 , a structural block diagram of an embodiment of a video encoding apparatus according to Embodiment 9 of the present application is shown, which may specifically include:
数据块切分单元901,用于将视频中的目标图像帧的特定区域划分为多个第一数据块,并将所述多个第一数据块分批输入按序执行的四个编码处理单元,所述目标区域为所述目标图像帧相对于参考图像帧发生内容变化的区域;The data block dividing unit 901 is used to divide a specific area of the target image frame in the video into a plurality of first data blocks, and input the plurality of first data blocks in batches into four encoding processing units that are executed in sequence , the target area is the area where the content of the target image frame changes relative to the reference image frame;
四个编码处理单元902,用于分别执行图像帧的编码参数的确定过程中的量化参数计算依据读取步骤、信息量获取步骤、量化参数和信息量计算步骤、以及量化参数和信息量写入步骤,所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理;Four encoding processing units 902 are used to respectively perform the quantization parameter calculation in the process of determining the encoding parameters of the image frame according to the reading step, the information content acquisition step, the quantization parameter and the information content calculation step, and the quantization parameter and the information content write. Step, the encoding processing unit performs the processing of the first data block of the next batch after the processing of the first data block of the previous batch is performed;
图像帧编码单元903,用于根据四个第一数据块分别对应的编码参数,对所述目标图像帧进行编码;An image frame encoding unit 903, configured to encode the target image frame according to encoding parameters corresponding to the four first data blocks respectively;
视频编码单元904,用于根据所述目标图像帧的编码结果得到所述视频的编码结果。The video encoding unit 904 is configured to obtain the encoding result of the video according to the encoding result of the target image frame.
依据本申请实施例,采用多个编码处理单元执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤,针对图像帧计算编码参数时,将图像帧划分为数据块,分批输入按序执行的多个编码处理单元,可得到编码参数,进而利用编码参数对图像帧进行编码。由于编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在四个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率,同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. When calculating encoding parameters for an image frame, the image frame is divided into data. The block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters. Since the encoding processing unit can perform the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when the four encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that the The processing of multiple batches of data blocks can be performed at the same time. Compared with the sequential execution of video frames, the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
并且,本申请实施例的多编码处理单元处理方案通用性强,可以复制到不同的编码系统使用,并且可以将编码处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
参照图11,示出了根据本申请实施例十的一种图像帧处理装置实施例的结构框图,具体可以包括:Referring to FIG. 11 , a structural block diagram of an embodiment of an image frame processing apparatus according to Embodiment 10 of the present application is shown, which may specifically include:
数据块切分单元1001,用于将目标图像帧划分为多个第一数据块,并将所述多个第一数据块分批输入按序执行的多个处理单元;a data block dividing unit 1001, configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of processing units that are executed in sequence;
处理单元1002,用于对应执行所述目标图像帧的处理过程中的一个或多个步骤,并获得处理结果,所述处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理。The processing unit 1002 is configured to execute one or more steps in the processing process of the target image frame, and obtain the processing result. After the processing unit has executed the processing of the first data blocks of the previous batch, execute the next batch of data blocks. Processing of the first data block.
依据本申请实施例,采用多个处理单元执行目标图像帧的处理过程,单个处理单元执行处理过程中的一个或多个步骤,将图像帧划分为数据块,分批输入按序执行的多个处理单元,可得到处理结果。由于处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩处理过程耗费的时间,提高了视频帧的处理效率,由于多处理单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of processing units are used to perform the processing process of the target image frame, a single processing unit performs one or more steps in the processing process, the image frame is divided into data blocks, and multiple processing units that are executed sequentially are input in batches. The processing unit can obtain processing results. Since the processing unit can perform the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that multiple encoding processing units perform processing synchronously. The processing of batch data blocks can be carried out at the same time. Compared with the sequential execution of video frames, the processing time can be greatly shortened and the processing efficiency of video frames can be improved. Resource multiplexing is performed, which can reduce chip area, reduce hardware overhead, reduce hardware cost, and facilitate hardware implementation.
并且,本申请实施例的多处理单元处理方案通用性强,可以复制到不同的处理系统使用,并且可以将处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different processing systems for use, and the processing unit can be configured to be compatible with other processing procedures, thereby realizing the optimization of multiple processing procedures and improving the performance of the processing. The processing efficiency of the system.
参照图12,示出了根据本申请实施例十一的一种图像帧编码系统实施例的结构框图,包括帧划分单元1101、按序执行的多个编码处理单元1102和编码单元1103;12 , a structural block diagram of an embodiment of an image frame encoding system according to Embodiment 11 of the present application is shown, including a frame dividing unit 1101, a plurality of encoding processing units 1102 and encoding units 1103 executed in sequence;
所述帧划分单元1101,用于将目标图像帧划分为多个第一数据块,并将所述多个第一数据块分批输入多个编码处理单元;The frame dividing unit 1101 is configured to divide the target image frame into multiple first data blocks, and input the multiple first data blocks into multiple encoding processing units in batches;
所述编码处理单元1102,用于对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,并在执行完前一批第一数据块的处理后,执行下一批第一数据块的处理;The encoding processing unit 1102 is configured to perform one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed. processing of a data block;
所述图像帧编码单元1103,用于根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The image frame encoding unit 1103 is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
依据本申请实施例,采用多个编码处理单元执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤,针对图像帧计算编码参数时,将图像帧划分为数据块,分批输入按序执行的多个编码处理单元,可得到编码参数,进而利用编码参数对图像帧进行编码。由于编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率,同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. When calculating encoding parameters for an image frame, the image frame is divided into data. The block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters. Since the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time. Compared with the sequential execution of video frames, the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
并且,本申请实施例的多编码处理单元处理方案通用性强,可以复制到不同的编码系统使用,并且可以将编码处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
参照图13,示出了根据本申请实施例十二的一种基于现场可编程逻辑门阵列的芯片实施例的结构框图,包括帧划分单元1201、按序执行的多个编码处理单元1202和图像帧编码单元1203;Referring to FIG. 13, it shows a structural block diagram of a chip embodiment based on a field programmable logic gate array according to the twelfth embodiment of the present application, including a frame dividing unit 1201, a plurality of encoding processing units 1202 executed in sequence, and an image Frame encoding unit 1203;
所述帧划分单元1201,用于将目标图像帧划分为多个第一数据块,并将所述多个第一数据块分批输入多个编码处理单元;The frame dividing unit 1201 is configured to divide the target image frame into multiple first data blocks, and input the multiple first data blocks into multiple encoding processing units in batches;
所述编码处理单元1202,用于对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,并在执行完前一批第一数据块的处理后,执行下一批第一数据块的处理;The encoding processing unit 1202 is configured to perform one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after processing the previous batch of first data blocks. processing of a data block;
所述图像帧编码单元1203,用于根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The image frame encoding unit 1203 is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
依据本申请实施例,采用多个编码处理单元执行编码参数的确定过程,单个编码处理单元执行编码参数确定过程中的一个或多个步骤,针对图像帧计算编码参数时,将图像帧划分为数据块,分批输入按序执行的多个编码处理单元,可得到编码参数,进而利用编码参数对图像帧进行编码。由于编码处理单元在处理完前一批数据块后即可执行下一批数据块的处理,在多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理,从而使得多批数据块的处理可以同时进行,相比于以视频帧为单位顺序执行的方式,可以大大缩短编码参数确定所耗费的时间,提高了视频编码的效率,同时降低了数据块的处理延迟。由于多编码单元并行运行的方式对硬件单元进行了资源复用,可以减小芯片面积,减少硬件开销,降低硬件成本,便于硬件实现。According to the embodiment of the present application, a plurality of encoding processing units are used to perform the encoding parameter determination process, and a single encoding processing unit performs one or more steps in the encoding parameter determination process. When calculating encoding parameters for an image frame, the image frame is divided into data. The block is input in batches to multiple encoding processing units executed in sequence, and encoding parameters can be obtained, and then the image frames are encoded by using the encoding parameters. Since the encoding processing unit can execute the processing of the next batch of data blocks after processing the previous batch of data blocks, in a part of the time period when multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously, so that The processing of multiple batches of data blocks can be performed at the same time. Compared with the sequential execution of video frames, the time spent for determining coding parameters can be greatly shortened, the efficiency of video coding is improved, and the processing delay of data blocks is reduced. Since the hardware units are multiplexed in a way of running multiple coding units in parallel, the chip area can be reduced, the hardware overhead and the hardware cost can be reduced, and the hardware implementation can be facilitated.
采用该复用结构的FPGA实现方案中,由于将存储器和计算单元进行了细颗粒度复用,对应占用的芯片面积仅为1800LUT,便于硬件实现。In the FPGA implementation scheme using this multiplexing structure, due to the fine-grained multiplexing of the memory and the computing unit, the corresponding occupied chip area is only 1800 LUTs, which is convenient for hardware implementation.
并且,本申请实施例的多编码处理单元处理方案通用性强,可以复制到不同的编码系统使用,并且可以将编码处理单元配置为兼容其他处理过程,从而实现了多个处理过程的优化处理,提高了系统的处理效率。In addition, the multi-coding processing unit processing solution of the embodiment of the present application is highly versatile, and can be copied to different coding systems for use, and the coding processing unit can be configured to be compatible with other processing processes, thereby realizing the optimization of multiple processing processes. The processing efficiency of the system is improved.
对于装置和系统实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the apparatus and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for related parts.
本公开的实施例可被实现为使用任意适当的硬件,固件,软件,或及其任意组合进行想要的配置的系统。图15示意性地示出了可被用于实现本公开中所述的各个实施例的示例性系统(或装置)1300。Embodiments of the present disclosure may be implemented as a system in a desired configuration using any suitable hardware, firmware, software, or any combination thereof. FIG. 15 schematically illustrates an exemplary system (or apparatus) 1300 that may be used to implement various embodiments described in this disclosure.
对于一个实施例,图15示出了示例性系统1300,该系统具有一个或多个处理器1302、被耦合到(一个或多个)处理器1302中的至少一个的系统控制模块(芯片组)1304、被耦合到系统控制模块1304的系统存储器1306、被耦合到系统控制模块1304的非易失性存储器(NVM)/存储设备1308、被耦合到系统控制模块1304的一个或多个输入/输出设备1310,以及被耦合到系统控制模块1306的网络接口1312。For one embodiment, FIG. 15 illustrates an exemplary system 1300 having one or more processors 1302, a system control module (chipset) coupled to at least one of the processor(s) 1302 1304 , system memory 1306 coupled to system control module 1304 , non-volatile memory (NVM)/storage 1308 coupled to system control module 1304 , one or more inputs/outputs coupled to system control module 1304 device 1310, and a network interface 1312 coupled to the system control module 1306.
处理器1302可包括一个或多个单核或多核处理器,处理器1302可包括通用处理器或专用处理器(例如图形处理器、应用处理器、基频处理器等)的任意组合。在一些实施例中,系统1300能够作为本申请实施例中所述的浏览器。The processor 1302 may include one or more single-core or multi-core processors, and the processor 1302 may include any combination of general-purpose processors or special-purpose processors (eg, graphics processors, application processors, baseband processors, etc.). In some embodiments, the system 1300 can function as a browser as described in the embodiments of the present application.
在一些实施例中,系统1300可包括具有指令的一个或多个计算机可读介质(例如,系统存储器1306或NVM/存储设备1308)以及与该一个或多个计算机可读介质相合并被配置为执行指令以实现模块从而执行本公开中所述的动作的一个或多个处理器1302。In some embodiments, system 1300 may include one or more computer-readable media having instructions (eg, system memory 1306 or NVM/storage device 1308 ) and in combination with the one or more computer-readable media configured to One or more processors 1302 that execute instructions to implement modules to perform the actions described in this disclosure.
对于一个实施例,系统控制模块804可包括任意适当的接口控制器,以向(一个或多个)处理器1302中的至少一个和/或与系统控制模块1304通信的任意适当的设备或组件提供任意适当的接口。For one embodiment, the system control module 804 may include any suitable interface controller to provide at least one of the processor(s) 1302 and/or any suitable device or component in communication with the system control module 1304 any appropriate interface.
系统控制模块1304可包括存储器控制器模块,以向系统存储器1306提供接口。存 储器控制器模块可以是硬件模块、软件模块和/或固件模块。 System control module 1304 may include a memory controller module to provide an interface to system memory 1306 . The memory controller modules may be hardware modules, software modules, and/or firmware modules.
系统存储器1306可被用于例如为系统1300加载和存储数据和/或指令。对于一个实施例,系统存储器1306可包括任意适当的易失性存储器,例如,适当的DRAM。在一些实施例中,系统存储器1306可包括双倍数据速率类型四同步动态随机存取存储器(DDR4SDRAM)。 System memory 1306 may be used, for example, to load and store data and/or instructions for system 1300 . For one embodiment, system memory 1306 may include any suitable volatile memory, eg, suitable DRAM. In some embodiments, system memory 1306 may include double data rate type quad synchronous dynamic random access memory (DDR4 SDRAM).
对于一个实施例,系统控制模块1304可包括一个或多个输入/输出控制器,以向NVM/存储设备1308及(一个或多个)输入/输出设备1310提供接口。For one embodiment, system control module 1304 may include one or more input/output controllers to provide interfaces to NVM/storage device 1308 and input/output device(s) 1310 .
例如,NVM/存储设备1308可被用于存储数据和/或指令。NVM/存储设备1308可包括任意适当的非易失性存储器(例如,闪存)和/或可包括任意适当的(一个或多个)非易失性存储设备(例如,一个或多个硬盘驱动器(HDD)、一个或多个光盘(CD)驱动器和/或一个或多个数字通用光盘(DVD)驱动器)。For example, NVM/storage 1308 may be used to store data and/or instructions. NVM/storage 1308 may include any suitable non-volatile memory (eg, flash memory) and/or may include any suitable non-volatile storage device(s) (eg, one or more hard drives ( HDD), one or more compact disc (CD) drives and/or one or more digital versatile disc (DVD) drives).
NVM/存储设备1308可包括在物理上作为系统1300被安装在其上的设备的一部分的存储资源,或者其可被该设备访问而不必作为该设备的一部分。例如,NVM/存储设备1308可通过网络经由(一个或多个)输入/输出设备1310进行访问。NVM/storage device 1308 may include storage resources that are physically part of the device on which system 1300 is installed, or it may be accessed by the device without necessarily being part of the device. For example, NVM/storage device 1308 may be accessed via input/output device(s) 1310 over a network.
(一个或多个)输入/输出设备1310可为系统1300提供接口以与任意其他适当的设备通信,输入/输出设备1310可以包括通信组件、音频组件、传感器组件等。网络接口1312可为系统1300提供接口以通过一个或多个网络通信,系统1300可根据一个或多个无线网络标准和/或协议中的任意标准和/或协议来与无线网络的一个或多个组件进行无线通信,例如接入基于通信标准的无线网络,如WiFi、2G、3G、4G或5G,或它们的组合进行无线通信。Input/output device(s) 1310 may provide an interface for system 1300 to communicate with any other suitable device, and input/output device(s) 1310 may include communication components, audio components, sensor components, and the like. Network interface 1312 may provide an interface for system 1300 to communicate over one or more networks, system 1300 may interface with one or more of one or more wireless network standards and/or protocols in accordance with any of one or more wireless network standards and/or protocols. Components communicate wirelessly, eg, by accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, or 5G, or a combination thereof.
对于一个实施例,(一个或多个)处理器1302中的至少一个可与系统控制模块1304的一个或多个控制器(例如,存储器控制器模块)的逻辑封装在一起。对于一个实施例,(一个或多个)处理器1302中的至少一个可与系统控制模块1304的一个或多个控制器的逻辑封装在一起以形成系统级封装(SiP)。对于一个实施例,(一个或多个)处理器1302中的至少一个可与系统控制模块1304的一个或多个控制器的逻辑集成在同一模具上。对于一个实施例,(一个或多个)处理器1302中的至少一个可与系统控制模块1304的一个或多个控制器的逻辑集成在同一模具上以形成片上系统(SoC)。For one embodiment, at least one of the processor(s) 1302 may be packaged with the logic of one or more controllers (eg, memory controller modules) of the system control module 1304 . For one embodiment, at least one of the processor(s) 1302 may be packaged with logic of one or more controllers of the system control module 1304 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 1302 may be integrated on the same die with the logic of one or more controllers of the system control module 1304 . For one embodiment, at least one of the processor(s) 1302 may be integrated on the same die with logic of one or more controllers of the system control module 1304 to form a system-on-chip (SoC).
在各个实施例中,系统1300可以但不限于是:浏览器、工作站、台式计算设备或移动计算设备(例如,膝上型计算设备、手持计算设备、平板电脑、上网本等)。在各个实施例中,系统1300可具有更多或更少的组件和/或不同的架构。例如,在一些实施例中,系统1300包括一个或多个摄像机、键盘、液晶显示器(LCD)屏幕(包括触屏显示器)、非易失性存储器端口、多个天线、图形芯片、专用集成电路(ASIC)和扬声器。In various embodiments, system 1300 may be, but is not limited to, a browser, workstation, desktop computing device, or mobile computing device (eg, laptop computing device, handheld computing device, tablet computer, netbook, etc.). In various embodiments, system 1300 may have more or fewer components and/or different architectures. For example, in some embodiments, system 1300 includes one or more cameras, keyboards, liquid crystal display (LCD) screens (including touchscreen displays), non-volatile memory ports, multiple antennas, graphics chips, application specific integrated circuits ( ASIC) and speakers.
其中,如果显示器包括触摸面板,显示屏可以被实现为触屏显示器,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的 手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还识别与所述触摸或滑动操作相关的持续时间和压力。Wherein, if the display includes a touch panel, the display screen may be implemented as a touch screen display to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also identify the duration and pressure associated with the touch or swipe action.
本申请实施例还提供了一种非易失性可读存储介质,该存储介质中存储有一个或多个模块(programs),该一个或多个模块被应用在终端设备时,可以使得该终端设备执行本申请实施例中各方法步骤的指令(instructions)。Embodiments of the present application further provide a non-volatile readable storage medium, where one or more modules (programs) are stored in the storage medium. When the one or more modules are applied to a terminal device, the terminal device can make the terminal The device executes the instructions (instructions) of each method step in the embodiment of the present application.
在一个示例中提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如本申请实施例的方法。In one example, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the method according to the embodiments of the present application when the processor executes the computer program .
在一个示例中还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本申请实施例的一个或多个的方法。In one example, a computer-readable storage medium is also provided, on which a computer program is stored, and when the program is executed by a processor, implements one or more of the methods according to the embodiments of the present application.
依据本申请实施例的一个方面,提供了一种图像帧编码方法,示例1包括:According to an aspect of the embodiments of the present application, an image frame encoding method is provided, and example 1 includes:
将目标图像帧划分为多个第一数据块;dividing the target image frame into a plurality of first data blocks;
将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units are synchronized perform processing;
根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The target image frame is encoded according to encoding parameters corresponding to the plurality of first data blocks respectively.
示例2包括示例1所述的方法,所述将目标图像帧划分为多个第一数据块包括:Example 2 includes the method of Example 1, wherein the dividing the target image frame into a plurality of first data blocks includes:
将所述目标图像帧的特定区域划分为多个第一数据块,所述目标区域为所述目标图像帧相对于参考图像帧发生内容变化的区域。A specific area of the target image frame is divided into a plurality of first data blocks, and the target area is an area where the content of the target image frame changes relative to the reference image frame.
示例3包括示例1所述的方法,所述将所述多个第一数据块分批输入数据处理单元进行数据处理包括:Example 3 includes the method of Example 1, wherein the inputting the plurality of first data blocks into the data processing unit in batches for data processing includes:
将所述多个第一数据块逐个输入数据处理单元进行数据处理。The plurality of first data blocks are input into the data processing unit one by one for data processing.
示例4包括示例1所述的方法,所述数据处理单元对应执行所述目标图像帧的编码参数的确定过程中的参数读取步骤、信息量获取步骤、数据计算步骤、以及数据交互步骤。Example 4 includes the method described in Example 1, wherein the data processing unit correspondingly executes the parameter reading step, the information amount acquisition step, the data calculation step, and the data exchange step in the process of determining the encoding parameters of the target image frame.
示例5包括示例1所述的方法,所述信息量获取步骤包括:Example 5 includes the method of Example 1, wherein the information amount obtaining step includes:
根据所述第一数据块的信息量存储地址,从对应存储器获取所述第一数据块的初始信息量;According to the information amount storage address of the first data block, obtain the initial information amount of the first data block from the corresponding memory;
根据所述第一数据块的预测代价和编码帧率,得到所述第一数据块的帧内信息量;According to the prediction cost and the encoding frame rate of the first data block, obtain the intra-frame information amount of the first data block;
根据所述帧内信息量和初始信息量确定所述第一数据块的总信息量。The total information amount of the first data block is determined according to the intra-frame information amount and the initial information amount.
示例6包括示例5所述的方法,所述参数读取步骤包括:Example 6 includes the method of Example 5, the parameter reading step comprising:
读取所述第一数据块的预测参数;所述预测参数包含目标图像帧编码过程中的预测方向和预测代价。Read the prediction parameters of the first data block; the prediction parameters include the prediction direction and the prediction cost in the encoding process of the target image frame.
示例7包括示例6所述的方法,所述数据计算步骤包括:Example 7 includes the method of Example 6, the data computing step comprising:
根据读取的所述第一数据块的总信息量、预测方向和预测代价确定用于所述第一数据块对应的编码参数。The coding parameter corresponding to the first data block is determined according to the read total information amount, prediction direction and prediction cost of the first data block.
示例8包括示例5所述的方法,所述参数读取步骤包括:Example 8 includes the method of Example 5, the parameter reading step comprising:
所述根据所述第一数据块在图像中的位置在获取所述第一数据块的信息量存储地址。The information storage address of the first data block is obtained according to the position of the first data block in the image.
示例9包括示例6所述的方法,所述编码处理单元还对应执行所述目标图像帧的参考图像帧的总信息量确定过程中的一个或多个步骤;Example 9 includes the method of Example 6, wherein the encoding processing unit further correspondingly performs one or more steps in the process of determining the total information content of the reference image frame of the target image frame;
所述信息量获取步骤还包括:The step of obtaining the amount of information further includes:
根据所述第一数据块的总信息量确定所述目标图像帧与参考图像帧之间的传递信息量;Determine the amount of information transferred between the target image frame and the reference image frame according to the total information amount of the first data block;
所述数据计算步骤还包括:The data calculation step also includes:
获取参考图像帧中第二数据块的初始信息量;obtaining the initial amount of information of the second data block in the reference image frame;
将所述第一数据块的传递信息量叠加至参考图像帧中第二数据块的初始信息量,获得所述参考图像帧中第二数据块的总信息量。The transfer information amount of the first data block is superimposed on the initial information amount of the second data block in the reference image frame to obtain the total information amount of the second data block in the reference image frame.
示例10包括示例9所述的方法,所述参数读取步骤还包括:Example 10 includes the method of Example 9, the parameter reading step further comprising:
读取预测代价系数;Read the prediction cost coefficient;
所述根据所述第一数据块的总信息量确定所述目标图像帧与参考图像帧之间的传递信息量包括:The determining the amount of information transferred between the target image frame and the reference image frame according to the total information amount of the first data block includes:
根据所述第一数据块的总信息量和预测代价系数确定所述第一数据块的传递信息量。The transfer information amount of the first data block is determined according to the total information amount of the first data block and the prediction cost coefficient.
示例11包括示例9所述的方法,所述参数读取步骤还包括:Example 11 includes the method of Example 9, the parameter reading step further comprising:
根据所述第一数据块在目标图像帧中的位置以及所述运动矢量,确定参考图像帧中待叠加信息量的第二数据块的位置。According to the position of the first data block in the target image frame and the motion vector, the position of the second data block of the amount of information to be superimposed in the reference image frame is determined.
示例12包括示例4所述的方法,所述数据交互步骤包括:Example 12 includes the method of Example 4, wherein the data interaction step includes:
将所述编码参数存储至对应的存储单元,以供后续编码时调用。The encoding parameters are stored in the corresponding storage unit for subsequent encoding.
示例13包括示例9所述的方法,所述数据交互步骤包括:Example 13 includes the method of Example 9, wherein the data interaction step includes:
将所述参考图像帧中第二数据块的总信息量传递至关联使用的其他编码处理单元。The total amount of information of the second data block in the reference image frame is passed to other encoding processing units used in association.
依据本申请实施例的一个方面,提供了一种视频编码方法,示例14包括:According to an aspect of the embodiments of the present application, a video encoding method is provided, and Example 14 includes:
将视频中的目标图像帧划分为多个第一数据块;dividing the target image frame in the video into a plurality of first data blocks;
将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the image frame, and in a partial time period during which the multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码;encoding the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively;
根据所述图像帧的编码结果得到所述视频的编码结果。The encoding result of the video is obtained according to the encoding result of the image frame.
依据本申请实施例的一个方面,提供了一种视频编码方法,示例15包括:According to an aspect of the embodiments of the present application, a video encoding method is provided, and Example 15 includes:
将视频中的目标图像帧的特定区域划分为多个第一数据块,所述目标区域为所述目标图像帧相对于参考图像帧发生内容变化的区域;Dividing a specific area of the target image frame in the video into a plurality of first data blocks, and the target area is an area where the content of the target image frame changes relative to the reference image frame;
将所述多个第一数据块分批输入按序执行的四个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,四个编码处理单元分别执行图像帧的编码参数的确定过程中的量化参数计算依据读取步骤、信息量获取步骤、量化参数和信息量计算步骤、以及量化参数和信息量写入步骤,在所述四个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;The plurality of first data blocks are input in batches into four encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed. , the four encoding processing units respectively perform the quantization parameter calculation in the determination process of the encoding parameter of the image frame according to the reading step, the information content acquisition step, the quantization parameter and the information content calculation step, and the quantization parameter and the information content write step, in During a part of the time period when the four encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
根据四个第一数据块分别对应的编码参数,对所述目标图像帧进行编码;encoding the target image frame according to encoding parameters corresponding to the four first data blocks respectively;
根据所述图像帧的编码结果得到所述视频的编码结果。The encoding result of the video is obtained according to the encoding result of the image frame.
依据本申请实施例的一个方面,提供了一种图像帧处理方法,示例16包括:According to an aspect of the embodiments of the present application, an image frame processing method is provided. Example 16 includes:
将目标图像帧划分为多个第一数据块;dividing the target image frame into a plurality of first data blocks;
将所述多个第一数据块分批输入按序执行的多个处理单元;所述处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述处理单元对应执行所述目标图像帧的处理过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理。The multiple first data blocks are input in batches into multiple processing units that are executed in sequence; after the processing unit performs the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed, so The processing unit correspondingly executes one or more steps in the processing process of the target image frame, and in a partial time period during which the multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously.
依据本申请实施例的一个方面,提供了一种图像帧处理方法,应用于软件服务平台,示例17包括:According to an aspect of the embodiments of the present application, an image frame processing method is provided, which is applied to a software service platform. Example 17 includes:
获取通过软件服务客户端提交的至少一个目标视频;Obtain at least one target video submitted through the software service client;
将目标视频的图像帧划分为多个第一数据块;dividing the image frame of the target video into a plurality of first data blocks;
将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units are synchronized perform processing;
根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码;encoding the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively;
根据多个图像帧的编码结果得到所述目标视频的编码结果;Obtain the encoding result of the target video according to the encoding results of a plurality of image frames;
基于所述软件服务客户端提供所述目标视频的编码结果。The encoding result of the target video is provided based on the software service client.
依据本申请实施例的一个方面,提供了一种图像帧编码系统,示例18包括帧划分模块、按序执行的多个编码处理单元和编码模块;According to an aspect of the embodiments of the present application, an image frame encoding system is provided, and Example 18 includes a frame division module, a plurality of encoding processing units and encoding modules executed in sequence;
所述帧划分单元,用于将目标图像帧划分为多个第一数据块,并将所述多个第一数据块分批输入多个编码处理单元;the frame dividing unit, configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of encoding processing units in batches;
所述编码处理单元,用于对应执行所述目标图像帧的编码参数的确定过程中的一个 或多个步骤,并在执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;The encoding processing unit is configured to correspondingly execute one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed. For the processing of the data block, in a part of the time period when the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
所述编码单元,用于根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The encoding unit is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
依据本申请实施例的一个方面,提供了一种基于现场可编程逻辑门阵列的芯片,示例19包括帧划分模块、按序执行的多个编码处理单元和编码模块;According to an aspect of the embodiments of the present application, a chip based on a field programmable logic gate array is provided, and Example 19 includes a frame division module, a plurality of encoding processing units executed in sequence, and an encoding module;
所述帧划分单元,用于将目标图像帧划分为多个第一数据块,并将所述多个第一数据块分批输入多个编码处理单元;the frame dividing unit, configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of encoding processing units in batches;
所述编码处理单元,用于对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,并在执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;The encoding processing unit is configured to correspondingly execute one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed. For the processing of the data block, in a part of the time period when the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
所述编码单元,用于根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The encoding unit is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
依据本申请实施例的一个方面,提供了一种电子设备,示例20包括:处理器;和According to an aspect of the embodiments of the present application, an electronic device is provided, and example 20 includes: a processor; and
存储器,其上存储有可执行代码,当所述可执行代码被执行时,使得所述处理器执行如示例1-17中任一项所述的方法。A memory having executable code stored thereon which, when executed, causes the processor to perform the method of any of Examples 1-17.
依据本申请实施例的一个方面,提供了一个或多个机器可读介质,其上存储有可执行代码,当所述可执行代码被执行时,使得处理器执行如示例1-17中任一项所述的方法。According to an aspect of the embodiments of the present application, one or more machine-readable media are provided, on which executable codes are stored, and when the executable codes are executed, cause the processor to execute any one of Examples 1-17. method described in item.
虽然某些实施例是以说明和描述为目的的,各种各样的替代、和/或、等效的实施方案、或计算来达到同样的目的实施例示出和描述的实现,不脱离本申请的实施范围。本申请旨在覆盖本文讨论的实施例的任何修改或变化。因此,显然本文描述的实施例仅由权利要求和它们的等同物来限定。While certain examples have been presented for purposes of illustration and description, various alternative, and/or, equivalent embodiments, or calculations may be used to achieve the same purposes as the implementation of the examples shown and described, without departing from this application. scope of implementation. This application is intended to cover any adaptations or variations of the embodiments discussed herein. Therefore, it is manifestly intended that the embodiments described herein be limited only by the claims and their equivalents.

Claims (21)

  1. 一种图像帧编码方法,其特征在于,包括:An image frame encoding method, comprising:
    将目标图像帧划分为多个第一数据块;dividing the target image frame into a plurality of first data blocks;
    将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units are synchronized perform processing;
    根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The target image frame is encoded according to encoding parameters corresponding to the plurality of first data blocks respectively.
  2. 根据权利要求1所述的方法,其特征在于,所述将目标图像帧划分为多个第一数据块包括:The method according to claim 1, wherein the dividing the target image frame into a plurality of first data blocks comprises:
    将所述目标图像帧的特定区域划分为多个第一数据块,所述目标区域为所述目标图像帧相对于参考图像帧发生内容变化的区域。A specific area of the target image frame is divided into a plurality of first data blocks, and the target area is an area where the content of the target image frame changes relative to the reference image frame.
  3. 根据权利要求1所述的方法,其特征在于,所述将所述多个第一数据块分批输入数据处理单元进行数据处理包括:The method according to claim 1, wherein the inputting the plurality of first data blocks into a data processing unit in batches for data processing comprises:
    将所述多个第一数据块逐个输入数据处理单元进行数据处理。The plurality of first data blocks are input into the data processing unit one by one for data processing.
  4. 根据权利要求1所述的方法,其特征在于,所述数据处理单元对应执行所述目标图像帧的编码参数的确定过程中的参数读取步骤、信息量获取步骤、数据计算步骤、以及数据交互步骤。The method according to claim 1, wherein the data processing unit corresponds to the parameter reading step, the information amount acquisition step, the data calculation step, and the data interaction in the process of determining the encoding parameters of the target image frame. step.
  5. 根据权利要求4所述的方法,其特征在于,所述信息量获取步骤包括:The method according to claim 4, wherein the step of obtaining the amount of information comprises:
    根据所述第一数据块的信息量存储地址,从对应存储器获取所述第一数据块的初始信息量;According to the information amount storage address of the first data block, obtain the initial information amount of the first data block from the corresponding memory;
    根据所述第一数据块的预测代价和编码帧率,得到所述第一数据块的帧内信息量;According to the prediction cost and the encoding frame rate of the first data block, obtain the intra-frame information amount of the first data block;
    根据所述帧内信息量和初始信息量确定所述第一数据块的总信息量。The total information amount of the first data block is determined according to the intra-frame information amount and the initial information amount.
  6. 根据权利要求5所述的方法,其特征在于,所述参数读取步骤包括:The method according to claim 5, wherein the parameter reading step comprises:
    读取所述第一数据块的预测参数;所述预测参数包含目标图像帧编码过程中的预测方向和预测代价。Read the prediction parameters of the first data block; the prediction parameters include the prediction direction and the prediction cost in the encoding process of the target image frame.
  7. 根据权利要求6所述的方法,其特征在于,所述数据计算步骤包括:The method according to claim 6, wherein the data calculation step comprises:
    根据读取的所述第一数据块的总信息量、预测方向和预测代价确定用于所述第一数据块对应的编码参数。The coding parameter corresponding to the first data block is determined according to the read total information amount, prediction direction and prediction cost of the first data block.
  8. 根据权利要求5所述的方法,其特征在于,所述参数读取步骤包括:The method according to claim 5, wherein the parameter reading step comprises:
    所述根据所述第一数据块在图像中的位置在获取所述第一数据块的信息量存储地址。The information storage address of the first data block is obtained according to the position of the first data block in the image.
  9. 根据权利要求6所述的方法,其特征在于,所述编码处理单元还对应执行所述目标图像帧的参考图像帧的总信息量确定过程中的一个或多个步骤;The method according to claim 6, wherein the encoding processing unit further executes one or more steps in the process of determining the total amount of information of the reference image frame of the target image frame;
    所述信息量获取步骤还包括:The step of obtaining the amount of information further includes:
    根据所述第一数据块的总信息量确定所述目标图像帧与参考图像帧之间的传递信息量;Determine the amount of information transferred between the target image frame and the reference image frame according to the total information amount of the first data block;
    所述数据计算步骤还包括:The data calculation step also includes:
    获取参考图像帧中第二数据块的初始信息量;obtaining the initial amount of information of the second data block in the reference image frame;
    将所述第一数据块的传递信息量叠加至参考图像帧中第二数据块的初始信息量,获得所述参考图像帧中第二数据块的总信息量。The transfer information amount of the first data block is superimposed on the initial information amount of the second data block in the reference image frame to obtain the total information amount of the second data block in the reference image frame.
  10. 根据权利要求9所述的方法,其特征在于,所述参数读取步骤还包括:The method according to claim 9, wherein the parameter reading step further comprises:
    读取预测代价系数;Read the prediction cost coefficient;
    所述根据所述第一数据块的总信息量确定所述目标图像帧与参考图像帧之间的传递信息量包括:The determining the amount of information transferred between the target image frame and the reference image frame according to the total information amount of the first data block includes:
    根据所述第一数据块的总信息量和预测代价系数确定所述第一数据块的传递信息量。The transfer information amount of the first data block is determined according to the total information amount of the first data block and the prediction cost coefficient.
  11. 根据权利要求9所述的方法,其特征在于,所述参数读取步骤还包括:The method according to claim 9, wherein the parameter reading step further comprises:
    根据所述第一数据块在目标图像帧中的位置以及运动矢量,确定参考图像帧中待叠加信息量的第二数据块的位置。According to the position of the first data block in the target image frame and the motion vector, the position of the second data block of the amount of information to be superimposed in the reference image frame is determined.
  12. 根据权利要求4所述的方法,其特征在于,所述数据交互步骤包括:The method according to claim 4, wherein the data interaction step comprises:
    将所述编码参数存储至对应的存储单元,以供后续编码时调用。The encoding parameters are stored in the corresponding storage unit for subsequent encoding.
  13. 根据权利要求9所述的方法,其特征在于,所述数据交互步骤包括:The method according to claim 9, wherein the data interaction step comprises:
    将所述参考图像帧中第二数据块的总信息量传递至关联使用的其他编码处理单元。The total amount of information of the second data block in the reference image frame is passed to other encoding processing units used in association.
  14. 一种视频编码方法,其特征在于,包括:A video coding method, comprising:
    将视频中的目标图像帧划分为多个第一数据块;dividing the target image frame in the video into a plurality of first data blocks;
    将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the image frame, and in a partial time period during which the multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
    根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码;encoding the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively;
    根据所述图像帧的编码结果得到所述视频的编码结果。The encoding result of the video is obtained according to the encoding result of the image frame.
  15. 一种视频编码方法,其特征在于,包括:A video coding method, comprising:
    将视频中的目标图像帧的特定区域划分为多个第一数据块,所述目标区域为所述目标图像帧相对于参考图像帧发生内容变化的区域;Dividing a specific area of the target image frame in the video into a plurality of first data blocks, and the target area is an area where the content of the target image frame changes relative to the reference image frame;
    将所述多个第一数据块分批输入按序执行的四个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,四个编码处理单元分别执行图像帧的编码参数的确定过程中的量化参数计算依据读取步骤、信息量获取步骤、量化参数和信息量计算步骤、以及量化参数和信息量写入步骤,在所述四个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;The plurality of first data blocks are input in batches into four encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed. , the four encoding processing units respectively perform the quantization parameter calculation in the determination process of the encoding parameter of the image frame according to the reading step, the information content acquisition step, the quantization parameter and the information content calculation step, and the quantization parameter and the information content write step, in During a part of the time period when the four encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
    根据四个第一数据块分别对应的编码参数,对所述目标图像帧进行编码;encoding the target image frame according to encoding parameters corresponding to the four first data blocks respectively;
    根据所述图像帧的编码结果得到所述视频的编码结果。The encoding result of the video is obtained according to the encoding result of the image frame.
  16. 一种图像帧处理方法,其特征在于,包括:An image frame processing method, comprising:
    将目标图像帧划分为多个第一数据块;dividing the target image frame into a plurality of first data blocks;
    将所述多个第一数据块分批输入按序执行的多个处理单元;所述处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述处理单元对应执行所述目标图像帧的处理过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理。The multiple first data blocks are input in batches into multiple processing units that are executed in sequence; after the processing unit performs the processing of the previous batch of the first data blocks, the processing of the next batch of the first data blocks is performed, so The processing unit correspondingly executes one or more steps in the processing process of the target image frame, and in a partial time period during which the multiple encoding processing units perform processing, at least two encoding processing units perform processing synchronously.
  17. 一种图像帧处理方法,其特征在于,应用于软件服务平台,包括:An image frame processing method, characterized in that, applied to a software service platform, comprising:
    获取通过软件服务客户端提交的至少一个目标视频;Obtain at least one target video submitted through the software service client;
    将目标视频的图像帧划分为多个第一数据块;dividing the image frame of the target video into a plurality of first data blocks;
    将所述多个第一数据块分批输入按序执行的多个编码处理单元;所述编码处理单元执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,所述编码处理单元对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;Inputting the plurality of first data blocks in batches into a plurality of encoding processing units that are executed in sequence; after the encoding processing unit has performed the processing of the previous batch of the first data blocks, executes the processing of the next batch of the first data blocks , the encoding processing unit correspondingly executes one or more steps in the process of determining the encoding parameters of the target image frame, and in a part of the time period during which the multiple encoding processing units perform processing, at least two encoding processing units are synchronized perform processing;
    根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码;encoding the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively;
    根据多个图像帧的编码结果得到所述目标视频的编码结果;Obtain the encoding result of the target video according to the encoding results of a plurality of image frames;
    基于所述软件服务客户端提供所述目标视频的编码结果。The encoding result of the target video is provided based on the software service client.
  18. 一种图像帧编码系统,其特征在于,包括帧划分模块、按序执行的多个编码处理单元和编码模块;An image frame encoding system, comprising a frame division module, a plurality of encoding processing units and encoding modules executed in sequence;
    所述帧划分单元,用于将目标图像帧划分为多个第一数据块,并将所述多个第一数据块分批输入多个编码处理单元;the frame dividing unit, configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of encoding processing units in batches;
    所述编码处理单元,用于对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,并在执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处理;The encoding processing unit is configured to correspondingly execute one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed. For the processing of the data block, in a part of the time period when the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
    所述编码单元,用于根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The encoding unit is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  19. 一种基于现场可编程逻辑门阵列的芯片,其特征在于,包括帧划分模块、按序执行的多个编码处理单元和编码模块;A chip based on a field programmable logic gate array, characterized in that it comprises a frame division module, a plurality of encoding processing units and encoding modules executed in sequence;
    所述帧划分单元,用于将目标图像帧划分为多个第一数据块,并将所述多个第一数据块分批输入多个编码处理单元;the frame dividing unit, configured to divide the target image frame into a plurality of first data blocks, and input the plurality of first data blocks into a plurality of encoding processing units in batches;
    所述编码处理单元,用于对应执行所述目标图像帧的编码参数的确定过程中的一个或多个步骤,并在执行完前一批第一数据块的处理后,执行下一批第一数据块的处理,在所述多个编码处理单元执行处理的部分时间段内,至少两个编码处理单元同步执行处 理;The encoding processing unit is configured to correspondingly execute one or more steps in the process of determining the encoding parameters of the target image frame, and execute the next batch of first data blocks after the processing of the previous batch of first data blocks is completed. For the processing of the data block, in a part of the time period when the plurality of encoding processing units perform processing, at least two encoding processing units perform processing synchronously;
    所述编码单元,用于根据多个第一数据块分别对应的编码参数,对所述目标图像帧进行编码。The encoding unit is configured to encode the target image frame according to encoding parameters corresponding to the plurality of first data blocks respectively.
  20. 一种电子设备,其特征在于,包括:处理器;和An electronic device, comprising: a processor; and
    存储器,其上存储有可执行代码,当所述可执行代码被执行时,使得所述处理器执行如权利要求1-17中任一项所述的方法。A memory having executable code stored thereon which, when executed, causes the processor to perform the method of any of claims 1-17.
  21. 一个或多个机器可读介质,其特征在于,其上存储有可执行代码,当所述可执行代码被执行时,使得处理器执行如权利要求1-17中任一项所述的方法。One or more machine-readable media, characterized in that executable code is stored thereon, which, when executed, causes a processor to perform the method of any one of claims 1-17.
PCT/CN2021/108842 2020-08-03 2021-07-28 Image frame coding method, object search method, computer device, and storage medium WO2022028283A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010768892.5 2020-08-03
CN202010768892.5A CN114071145A (en) 2020-08-03 2020-08-03 Image frame encoding method, object searching method, computer device, and storage medium

Publications (1)

Publication Number Publication Date
WO2022028283A1 true WO2022028283A1 (en) 2022-02-10

Family

ID=80119939

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/108842 WO2022028283A1 (en) 2020-08-03 2021-07-28 Image frame coding method, object search method, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN114071145A (en)
WO (1) WO2022028283A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024021999A1 (en) * 2022-07-26 2024-02-01 华为技术有限公司 Synchronization method, system, and electronic device
CN117793367A (en) * 2024-02-26 2024-03-29 此芯科技(上海)有限公司 Image coding method and system
CN117793367B (en) * 2024-02-26 2024-06-04 此芯科技(上海)有限公司 Image coding method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100239018A1 (en) * 2009-03-17 2010-09-23 Novatek Microelectronics Corp. Video processing method and video processor
CN101854538A (en) * 2009-04-03 2010-10-06 联咏科技股份有限公司 Motion image processing method and motion image processor
CN102143361A (en) * 2011-01-12 2011-08-03 浙江大学 Video coding method and video coding device
CN110971896A (en) * 2018-09-28 2020-04-07 福州瑞芯微电子股份有限公司 H.265 coding method and device
US20200145376A1 (en) * 2018-11-05 2020-05-07 Xilinx, Inc. Network interface device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100239018A1 (en) * 2009-03-17 2010-09-23 Novatek Microelectronics Corp. Video processing method and video processor
CN101854538A (en) * 2009-04-03 2010-10-06 联咏科技股份有限公司 Motion image processing method and motion image processor
CN102143361A (en) * 2011-01-12 2011-08-03 浙江大学 Video coding method and video coding device
CN110971896A (en) * 2018-09-28 2020-04-07 福州瑞芯微电子股份有限公司 H.265 coding method and device
US20200145376A1 (en) * 2018-11-05 2020-05-07 Xilinx, Inc. Network interface device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024021999A1 (en) * 2022-07-26 2024-02-01 华为技术有限公司 Synchronization method, system, and electronic device
CN117793367A (en) * 2024-02-26 2024-03-29 此芯科技(上海)有限公司 Image coding method and system
CN117793367B (en) * 2024-02-26 2024-06-04 此芯科技(上海)有限公司 Image coding method and system

Also Published As

Publication number Publication date
CN114071145A (en) 2022-02-18

Similar Documents

Publication Publication Date Title
CN110945871B (en) Efficient intra-coding for screen data
US10244254B2 (en) Encoding system using motion estimation and encoding method using motion estimation
US20140086309A1 (en) Method and device for encoding and decoding an image
CN105208394B (en) A kind of real-time digital image compression prediction technique and system
WO2017041551A1 (en) Spice protocol-based image transmission method and apparatus
US20210385458A1 (en) System-on-chip having a merged frame rate converter and video codec and frame rate converting method thereof
WO2022028283A1 (en) Image frame coding method, object search method, computer device, and storage medium
US11816871B2 (en) Real-time low latency computer vision/machine learning compute accelerator with smart convolutional neural network scheduler
TWI441091B (en) Method for performing image signal processing with aid of a graphics processing unit and apparatus for performing image signal processing
CN114766035A (en) Pre-processing and data enhancement of frequency domain data
JP6781823B2 (en) Interframe predictive coding method and equipment
KR102231975B1 (en) Techniques for performing a forward transformation by a video encoder using a forward transform matrix
US20150181209A1 (en) Modular motion estimation and mode decision engine
CN109495742B (en) Video frame coding method, device and equipment
JP2021519027A (en) Video coding methods, video coding equipment, electronics and computer programs
WO2019052452A1 (en) Image data processing method, user terminal, server and storage medium
KR20090020460A (en) Method and apparatus for video decoding
CN101256668B (en) Method for implementing video filtering to working balanced multiple nucleus
US11423644B1 (en) Hardware efficient RoI align
CN104038766A (en) Device used for using image frames as basis to execute parallel video coding and method thereof
US20140334545A1 (en) Hybrid video encoder apparatus and methods
CN103327340B (en) A kind of integer searches method and device
JP7017542B2 (en) Video decoding device and video decoding method
CN111405293B (en) Video transmission method and device
CN111510715B (en) Video processing method, system, computer device and storage medium

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

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

Country of ref document: EP

Kind code of ref document: A1