CN115914637A - Image format conversion method and device and video processing equipment - Google Patents

Image format conversion method and device and video processing equipment Download PDF

Info

Publication number
CN115914637A
CN115914637A CN202111165196.6A CN202111165196A CN115914637A CN 115914637 A CN115914637 A CN 115914637A CN 202111165196 A CN202111165196 A CN 202111165196A CN 115914637 A CN115914637 A CN 115914637A
Authority
CN
China
Prior art keywords
target
pixel block
value
mode index
values
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202111165196.6A
Other languages
Chinese (zh)
Inventor
陈茜茜
胡海鹏
李松
周晶晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian Novastar Electronic Technology Co Ltd
Original Assignee
Xian Novastar Electronic Technology Co Ltd
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 Xian Novastar Electronic Technology Co Ltd filed Critical Xian Novastar Electronic Technology Co Ltd
Priority to CN202111165196.6A priority Critical patent/CN115914637A/en
Publication of CN115914637A publication Critical patent/CN115914637A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Color Television Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiment of the invention provides an image format conversion method, an image format conversion device and video processing equipment. The method comprises the following steps: acquiring an image to be converted; determining a plurality of pixel blocks and a plurality of coding modes based on the image to be converted, wherein the plurality of coding modes correspond to a plurality of mode index values; determining a target coding mode of the pixel block according to the luminance component deviation values of the pixel block under the plurality of coding modes respectively, wherein the target coding mode is one of the plurality of coding modes; encoding a plurality of chroma components of the pixel block based on the target encoding mode to obtain a plurality of chroma component output values for the pixel block; determining a target mode index value from the plurality of mode index values according to the target coding mode; and obtaining and outputting target data based on the target mode index value, the plurality of luminance components and the plurality of chrominance component output values.

Description

Image format conversion method and device and video processing equipment
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image format conversion method, an image format conversion apparatus, and a video processing device.
Background
YUV is a color coding method that separates a luminance component (Y) and a chrominance component (UV), which is widely used in various video processing components. In the YUV space, the chrominance information of the image is down-sampled by using the characteristic that the human eye is insensitive to the UV component, so as to reduce the bandwidth of the transmission link, and at the receiving display end, the recovery of the video data is involved, for example, if the image is sampled and transmitted in the YUV422 format, the image needs to be recovered to the YUV444 format.
In addition, the video images used by people mainly originate from two aspects: one is a natural image taken by a camera; it has continuous color tone and rich color, but has very thin lines and sharp edges; the other is a computer screen content image which is generated by various application software of a computer, such as: the image of single pixel lines, characters and the like has the characteristics of discontinuous tone, fine lines, clear edges, sharp edges and the like. For example, in the prior art, images in YUV422 format are generally converted into images in YUV444 format by a copying method and an averaging method, but the images in YUV444 format converted by the two methods have obvious problems of cross color, color cast and saw tooth at the edges of natural images, and the images in computer screen content have serious line blurring and fracture, thereby reducing the image display quality.
Therefore, a YUV conversion method is needed to solve the technical problems of color crosstalk, color cast, jaggy, severe line blurring and breaking of the converted image, so as to improve the image display quality.
Disclosure of Invention
Therefore, to overcome the defects and shortcomings in the prior art, embodiments of the present invention provide an image format conversion method, an image format conversion apparatus, and a video processing device.
In one aspect, an embodiment of the present invention provides an image format conversion method, including: acquiring an image to be converted; determining a plurality of pixel blocks and a plurality of coding modes based on the image to be converted, wherein the plurality of coding modes correspond to a plurality of mode index values; determining a target coding mode of the pixel block according to the luminance component deviation values of the pixel block under the plurality of coding modes respectively, wherein the target coding mode is one of the plurality of coding modes; encoding a plurality of chroma components of the block of pixels based on the target encoding mode to obtain a plurality of chroma component output values for the block of pixels; determining a target mode index value from the plurality of mode index values according to the target coding mode; and obtaining and outputting target data based on the target mode index value, the plurality of luminance components and the plurality of chrominance component output values.
The image format conversion method provided by this embodiment determines a plurality of pixel blocks and a plurality of coding modes based on an image to be converted, determines a target coding mode of the pixel blocks, generates a chrominance component output value after coding a chrominance component according to the target coding mode, and outputs a target mode index value, a luminance component and a chrominance component output value corresponding to the target coding mode to decode the chrominance component output value according to the coding mode. In addition, the mode index value of the target coding mode is output, so that the decoding end avoids the process of repeatedly calculating the target coding mode, the image quality effect is ensured, and the hardware resource overhead can be greatly reduced.
In an embodiment of the present invention, the obtaining and outputting target data based on the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values specifically includes: the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values are output over the same link; or a link outputting the plurality of luminance component and the plurality of chrominance component output values and a link outputting the target mode index value are different; or the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values are output over at least two links.
In one embodiment of the present invention, the transmitting the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values through the same link, and the obtaining and outputting target data based on the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values includes: and replacing partial values in the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block by the target mode index value to obtain and output the target data.
The target data is obtained and output by replacing part of the output values of the luminance components and the chrominance components of the pixel block with the target mode index value, namely, the target mode index value of the target coding mode is output after being coded to the output values of the luminance components and the chrominance components through the same link, so that the output bandwidth is saved, and the transmission efficiency is greatly improved.
In one embodiment of the present invention, the replacing a part of the plurality of luminance component and the plurality of chrominance component output values of the pixel block with the target mode index value to obtain the target data and outputting the target data includes: and replacing partial values in the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block with the value of the target mode index value under the specified system to obtain the target data and outputting the target data, wherein the number of bits of the value of the target mode index value under the specified system is equal to the number of bits of the partial values.
In one embodiment of the present invention, the replacing a part of the plurality of luminance component and the plurality of chrominance component output values of the pixel block with the target mode index value to obtain the target data and outputting the target data includes: determining a target luma component and/or a target chroma component output value from the plurality of luma components and/or the plurality of chroma component output values of the block of pixels based on a total number of bits of binary data of the target mode index value; determining the partial value from the target luma component and/or the target chroma component output value, the partial value having a number of bits that is a first bit of the target luma component and/or the target chroma component output value, wherein the first bit comprises one of: the first bit is a low bit; the first bit is lower than a preset bit; the first bit is equal to a preset bit; the first bit is a middle bit; the first bit is a high bit; the first bit is higher than a preset bit.
In one embodiment of the present invention, the replacing a part of the plurality of luminance component and the plurality of chrominance component output values of the pixel block with the target mode index value to obtain the target data and outputting the target data includes: replacing a value of the target mode index value under a binary system with a first bit of the target luminance component and/or the target chrominance component output value to obtain a replaced target luminance component and/or a replaced target chrominance component output value; and adjusting the output value of the replaced target brightness component and/or the replaced target chrominance component according to a preset position rule, generating and outputting the target data.
The target data is generated after adjustment according to the preset position rule, so that the interference to low-order data is avoided in the transmission process, and the accuracy of data transmission is further improved.
In an embodiment of the present invention, the determining the target coding mode of the pixel block according to the luminance component deviation values of the pixel block in the plurality of coding modes respectively comprises: calculating the sum of absolute values of luminance component differences of a plurality of pixel points of the pixel block in a plurality of coding modes, and taking the sum as the luminance component deviation value of the pixel block in the plurality of coding modes; determining the encoding mode that is the smallest among the luminance component deviation values of the plurality of encoding modes as a target encoding mode for the pixel block.
The target coding mode is determined through simple calculation, a plurality of adders and subtractors are greatly saved, and therefore hardware resources are greatly reduced.
On the other hand, an embodiment of the present invention provides an image format conversion method, including: receiving input data, wherein the input data comprises target format image data; analyzing a target mode index value of each pixel block of the target format image data about an encoding mode from the input data; decoding the chroma component of the pixel block according to the target mode index value to obtain a decoded chroma component value of the pixel block; and outputting a luma component value and the decoded chroma component value of the pixel block.
In this embodiment, the target mode index value of the pixel block of the target format image data with respect to the coding mode is obtained by parsing the input data, and then the chroma component of the pixel block is decoded according to the target mode index value to obtain a decoded chroma component value, so that the transmission bandwidth is reduced, the image quality is ensured, and the technical problems of cross color and color cast, line fracture and blur and the like in the prior art are effectively improved. In addition, the target mode index value in the input data is decoded, so that the repeated calculation of the coding mode is avoided, the image quality effect is ensured, and the hardware resource overhead can be greatly reduced.
In an embodiment of the present invention, the decoding, according to the target mode index value, the chroma component of the pixel block to obtain a decoded chroma component value of the pixel block specifically includes: searching a corresponding target coding mode in a plurality of coding modes according to the target mode index value; and decoding the chroma components of the pixel block according to the target coding mode to obtain the decoded chroma component values of the pixel block.
In an embodiment of the present invention, the parsing a target coding mode index value about a coding mode of each pixel block of the target format image data from the input data specifically includes: parsing out a plurality of target luminance components and a plurality of target chrominance components for each pixel block of the target format image data from the input data; analyzing the values of the target brightness components and the target chrominance components under the designated scale according to a preset position to obtain a plurality of first brightness components and a plurality of first chrominance component output values; and analyzing the first bits of the values of the first luminance components and the first chrominance component output values under the appointed scale to obtain a target mode index value of the pixel block relative to the coding mode.
In another aspect, an embodiment of the present invention provides an image format conversion apparatus, including: the acquisition module is used for acquiring an image to be converted; a first determining module, configured to determine, based on the image to be converted, a plurality of pixel blocks and a plurality of encoding modes, where the plurality of encoding modes correspond to a plurality of mode index values; a second determining module, configured to determine a target coding mode of the pixel block according to the luminance component deviation values of the pixel block in the multiple coding modes, respectively, where the target coding mode is one of the multiple coding modes; an encoding module for encoding a plurality of chroma components of the block of pixels based on the target encoding mode to obtain a plurality of chroma component output values for the block of pixels; a third determining module to determine a target mode index value from the plurality of mode index values according to the target coding mode; and the data output module is used for obtaining and outputting target data based on the target mode index value, the plurality of luminance components and the plurality of chrominance component output values.
The image format conversion device provided by this embodiment is provided with an acquisition module, a first determination module, a second determination module, a coding module, a third determination module, and a data output module, so that a plurality of pixel blocks and a plurality of coding modes can be determined based on an image to be converted, a target coding mode of the pixel blocks is determined, a chrominance component output value is generated after a chrominance component is coded according to the target coding mode, and a target mode index value, a luminance component and a chrominance component output value corresponding to the target coding mode are output, so as to decode the chrominance component output value according to the coding mode. In addition, the mode index value of the target coding mode is output, so that the decoding end avoids the process of repeatedly calculating the target coding mode, the image quality effect is ensured, and the hardware resource overhead can be greatly reduced.
In an embodiment of the present invention, the data output module is specifically configured to: the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values are output over the same link; or a link outputting the plurality of luminance component and the plurality of chrominance component output values and a link outputting the target mode index value are different; or the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values are output over at least two links.
In an embodiment of the present invention, the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values are transmitted through the same link, and the data output module is specifically configured to replace a part of the plurality of luminance components and the plurality of chrominance component output values of the pixel block with the target mode index value to obtain the target data and output the target data.
In one embodiment of the present invention, the replacing a part of the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block with the target mode index value to obtain the target data and outputting the target data includes: and replacing partial values in the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block with the value of the target mode index value under the specified system to obtain the target data and outputting the target data, wherein the number of bits of the value of the target mode index value under the specified system is equal to the number of bits of the partial values.
In one embodiment of the present invention, replacing a part of the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block with the target mode index value to obtain the target data and outputting the target data, comprises: determining a target luma component and/or a target chroma component output value from the plurality of luma components and/or the plurality of chroma component output values of the block of pixels based on a total number of bits of binary data of the target mode index value; determining the partial value from the target luma component and/or the target chroma component output value, the partial value having a first number of bits of the target luma component and/or the target chroma component output value, wherein the first number of bits comprises one of: the first bit is a low bit; the first bit is lower than a preset bit; the first bit is equal to a preset bit; the first bit is a middle bit; the first bit is a high bit; the first bit is higher than a preset bit.
In one embodiment of the present invention, the replacing a part of the plurality of luminance component and the plurality of chrominance component output values of the pixel block with the target mode index value to obtain the target data and outputting the target data includes: replacing a value of the target mode index value under a binary system with a first bit of the target luminance component and/or the target chrominance component output value to obtain a replaced target luminance component and/or a replaced target chrominance component output value; and adjusting the output value of the replaced target brightness component and/or the replaced target chrominance component according to a preset position rule, generating and outputting the target data.
In one embodiment of the present invention, the second determining module includes: a calculating unit, configured to calculate a sum of absolute values of luminance component differences of a plurality of pixels of the pixel block in the plurality of coding modes, as the luminance component deviation value in the plurality of coding modes of the pixel block; a determination unit for determining the encoding mode that is the smallest among the luminance component deviation values of the plurality of encoding modes as a target encoding mode for the pixel block.
In another aspect, an embodiment of the present invention provides an image format conversion apparatus, including: the receiving module is used for receiving input data, and the input data comprises target format image data; the analysis module is used for analyzing a target mode index value of a pixel block of the target format image data relative to the coding mode from the input data; the decoding module is used for decoding the chroma component of the pixel block according to the target mode index value to obtain a decoded chroma component value of the pixel block; and an output module for outputting a luminance component value and the decoded chrominance component value of the pixel block.
The image format conversion device provided by this embodiment is provided with a receiving module, an analyzing module, a decoding module and an output module, so that an object mode index value of a pixel block of the object format image data about a coding mode can be obtained through analyzing from input data, and then a chroma component of the pixel block is decoded according to the object mode index value to obtain a chroma component value after decoding, thereby reducing transmission bandwidth, ensuring image quality, and effectively improving the technical problems of cross color and color cast, line fracture and blur and the like in the prior art. In addition, the target coding mode index value in the input data is used for decoding, so that the repeated calculation of the coding mode is avoided, the image quality effect is ensured, and the hardware resource overhead can be greatly reduced.
In an embodiment of the present invention, the parsing module specifically includes: a first parsing unit for parsing out a plurality of target luminance components and a plurality of target chrominance components of each pixel block of the target format image data from the input data; the second analysis unit is used for analyzing the values of the target brightness components and the target chroma components under the appointed scale according to the preset position to obtain a plurality of first brightness components and a plurality of first chroma component output values; and the third analyzing unit is used for analyzing the first bits of the values of the first luminance components and the first chrominance component output values under the appointed scale system to obtain a target mode index value of the pixel block relative to the coding mode.
In an embodiment of the present invention, the decoding module specifically includes: the searching unit is used for searching a corresponding target coding mode in the multiple coding modes according to the target mode index value; and the decoding unit is used for decoding the chroma components of the pixel block according to the target coding mode to obtain the decoded chroma component values of the pixel block.
In another aspect, an embodiment of the present invention provides a video processing apparatus, including: a microprocessor and a programmable logic device electrically connected with the microprocessor, wherein the programmable logic device is used for executing the image format conversion method and/or the image format conversion method; or an integrated processing chip for performing the image format conversion method as described above and/or the image format conversion method as described above.
In still another aspect, an embodiment of the present invention provides an image format conversion system, including a memory and a processor connected to the memory, where the processor stores a computer program, and the processor executes the computer program to perform the image format conversion method described above.
In still another aspect, an embodiment of the present invention provides a computer-readable storage medium, in which computer-executable instructions are stored, and when executed by a processor, the stored computer-executable instructions implement the image format conversion method as described above.
One or more of the above technical solutions may have the following advantages or beneficial effects: the method comprises the steps of determining a plurality of pixel blocks and a plurality of coding modes based on an image to be converted, determining a target coding mode of the pixel blocks, coding a chrominance component according to the target coding mode to generate a chrominance component output value, and outputting a target mode index value, a luminance component and the chrominance component output value corresponding to the target coding mode to decode the chrominance component output value according to the coding mode, so that the transmission bandwidth is reduced, the image quality is ensured, and the technical problems of cross color and color cast, line fracture blur and the like in the prior art are effectively improved. In addition, the mode index value of the target coding mode is output, so that the decoding end avoids the process of repeatedly calculating the target coding mode, the image quality effect is ensured, and the hardware resource overhead can be greatly reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating an image format conversion method according to a first embodiment of the present invention.
Fig. 2 is a schematic flowchart of step S300 in fig. 1.
Fig. 3 is a flowchart illustrating another image format conversion method according to the first embodiment of the present invention.
Fig. 4 is a flowchart illustrating step S800 in fig. 3.
Fig. 5 is a flowchart illustrating step S900 in fig. 3.
Fig. 6A and 6B are schematic structural diagrams of a video processing apparatus according to a first embodiment of the present invention.
Fig. 7 is a diagram illustrating an encoding mode.
Fig. 8 is a block diagram of an image format conversion device according to a second embodiment of the present invention.
FIG. 9 is a block diagram of a second determination module of FIG. 8.
Fig. 10 is a block diagram of another image format conversion device according to a second embodiment of the present invention.
Fig. 11 is a block diagram of the parsing module in fig. 10.
Fig. 12 is a block diagram of the decoding module in fig. 10.
Fig. 13 is a schematic structural diagram of an image format conversion system according to a third embodiment of the present invention.
Fig. 14 is a schematic structural diagram of a computer-readable storage medium according to a fourth embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
[ first embodiment ] A
As shown in fig. 1, a first embodiment of the present invention provides an image format conversion method, including the steps of:
s100, acquiring an image to be converted;
s200, determining a plurality of pixel blocks and a plurality of coding modes based on the image to be converted, wherein the plurality of coding modes correspond to a plurality of mode index values;
s300, determining a target coding mode of the pixel block according to the luminance component deviation values of the pixel block under the plurality of coding modes respectively, wherein the target coding mode is one of the plurality of coding modes;
s400, encoding a plurality of chrominance components of the pixel block based on the target encoding mode to obtain a plurality of chrominance component output values of the pixel block;
s500, determining a target mode index value from the plurality of mode index values according to the target coding mode;
and S600, obtaining and outputting target data based on the target mode index value, the plurality of luminance components and the plurality of chrominance component output values.
Referring to fig. 2, the determining, in step S300, a target coding mode of the pixel block according to the luminance component deviation values of the pixel block in the multiple coding modes respectively includes:
s210, calculating the sum of absolute values of the luminance component differences of a plurality of pixel points of the pixel block in a plurality of coding modes, and taking the sum as the luminance component deviation value of the pixel block in the plurality of coding modes;
s220, determining the encoding mode with the smallest luminance component deviation value of the plurality of encoding modes as a target encoding mode for the pixel block.
Referring to fig. 3, another image format conversion method according to the first embodiment of the present invention includes the following steps:
s700, receiving input data, wherein the input data comprises target format image data;
s800, analyzing a target mode index value of each pixel block of the target format image data about the coding mode from the input data;
s900, decoding the chroma components of the pixel block according to the target mode index value to obtain the decoded chroma component values of the pixel block;
s1000, outputting the brightness component value and the decoded chroma component value of the pixel block.
Referring to fig. 4, in step S800, parsing a target mode index value regarding an encoding mode of each pixel block of the target format image data from the input data specifically includes:
s810, parsing a plurality of target luminance components and a plurality of target chrominance components of each pixel block of the target format image data from the input data;
s820, analyzing the values of the target luminance components and the target chrominance components under the designated scale according to a preset position rule to obtain a plurality of first luminance components and a plurality of first chrominance component output values;
and S830, analyzing the first bit of the values of the plurality of first luminance components and the plurality of first chrominance component output values in the designated system to obtain a target mode index value of the pixel block related to the coding mode.
Referring to fig. 5, in step S900, decoding the chroma component of the pixel block according to the target mode index value to obtain a decoded chroma component value of the pixel block specifically includes:
s910, searching a corresponding target coding mode in the multiple coding modes according to the target mode index value;
s920, decoding the chroma components of the pixel block according to the target coding mode to obtain the decoded chroma component values of the pixel block.
The image format conversion method provided by the first embodiment of the present invention can be applied to the video processing apparatus 100 shown in fig. 6A and 6B, specifically, the image format conversion method shown in fig. 1 can be applied to the conversion of a first format image and a second format image, wherein the first format image information is larger than the second format image information, that is, YUV444 is converted into YUV422, YUV444 is converted into YUV420, YUV422 is converted into YUV420, and the like, and the process of converting the first format image into the second format image can be referred to as a downsampling process; the image format conversion method as shown in fig. 3 may be applied, for example, to conversion of a second format image into a first format image, wherein the first format image information is larger than the second format image information, i.e., YUV422 to YUV444, YUV420 to YUV422, etc., and the process of converting the second format image into the first format image may be referred to as an up-sampling process. The down-sampling process and the up-sampling process may be performed in the same video processing apparatus 100, or may be performed in different video processing apparatuses 100, and of course, the image format conversion method may also be applied to other application scenarios or apparatuses that need to perform image format conversion, and the embodiment of the present invention is not limited thereto. In order to facilitate a clearer understanding of the present embodiment, the following describes the image format conversion method provided in the present embodiment in detail by taking an example of conversion between YUV444 and YUV422 format images in conjunction with fig. 6A, 6B and 7.
Referring to fig. 6A and 6B, video processing device 100 may, for example, include a microprocessor 110 and a programmable logic device 120 electrically connected thereto, or video processing device 100 may, for example, include an integrated processing chip 130. The video processing apparatus 100 may be used, for example, to receive a video source, perform video processing such as scaling processing, image format conversion, etc. on the video source, and display the processed video source output on a display screen connected thereto. The microprocessor 110 may be, for example, a Micro Controller Unit (MCU), and the Programmable logic device 121 may be, for example, a Field Programmable Gate Array (FPGA), configured to execute the image format conversion method provided in this embodiment; the integrated processing chip 130 may be, for example, an integrated chip having processing and control capabilities for performing the image format conversion method provided by the present embodiment. When the video processing device 100 receives a plurality of video sources, the formats of the video sources are different, and a downsampling process or an upsampling process is required to perform format conversion for different video sources, the image format conversion method provided by this embodiment, that is, the downsampling process and the upsampling process, may be executed on different execution modules of the same programmable logic device 121 or the same integrated processing chip 130 of the same video processing device 100, for example; the image format conversion method provided by the present embodiment, i.e., the down-sampling process and the up-sampling process, can be executed on different programmable logic devices 121 or different integrated processing chips 130 of the same video processing apparatus 100, for example; the image format conversion method provided by the present embodiment, i.e., the downsampling process and the upsampling process, may be performed, for example, in different video processing apparatuses 100. Of course, the video processing apparatus 100 may further include a video input interface, a video output interface, a video encoder, a video decoder, and the like, which is not limited thereto.
Specifically, the programmable logic device 120 in the video processing device 100 converts the YUV 444-format image into the YUV 422-format image, and the programmable logic device 120 determines a plurality of pixel blocks and a plurality of encoding modes based on the image to be converted, and specifically, for example, the image to be converted, for example, the first-format image YUV 444-format image, may be divided into a plurality of pixel blocks according to the number of preset pixel points, and each pixel block is grouped to obtain a plurality of encoding modes. The YUV format image is, for example, a certain frame image in a video source, the number of the preset pixel points may be, for example, 2 × 2 pixel points, and certainly, may also be 3 × 3 pixel points, and may be predetermined or set according to an actual situation, which is not limited in this embodiment. The YUV format image is divided into a plurality of pixel blocks, specifically, for example, the YUV format image may be divided into a plurality of pixel blocks of 2 × 2 pixel points, or may be divided into pixel blocks of 3 × 3 pixel points, or may be divided into other dividing manners. Taking a pixel block with 2 × 2 pixels as an example, for example, four pixels in the pixel block are divided into two groups to obtain seven encoding modes. As shown in fig. 7, seven coding modes can be obtained according to different combinations of pixel correlations based on the correlation characteristics between pixels. Wherein, four pixels are respectively defined as Pix0, pix1, pix2, pix3, wherein the circle pixels represent a group of correlation pixel points, the triangle pixels represent another group of correlation pixel points, and the strong correlation means that the values of the adjacent pixels are closer and the difference value is smaller. The seven coding modes are specifically as follows:
mode1: pix0 and Pix1 are a group of correlation pixel points, and Pix2 and Pix3 are another group of correlation pixel points;
mode2: pix0 and Pix2 are a group of correlation pixel points, and Pix1 and Pix3 are another group of correlation pixel points;
mode3: pix0 and Pix3 are a group of related pixel points, and Pix1 and Pix2 are another group of related pixel points;
mode4: pix0, pix1 and Pix2 are a group of related pixel points, and Pix3 is another group of related pixel points;
mode5: pix0, pix1 and Pix3 are a group of related pixel points, and Pix2 is another group of related pixel points;
mode6: pix1, pix2 and Pix3 are a group of correlation pixel points, and Pix0 is another group of correlation pixel points;
mode7: pix0, pix2 and Pix3 are a group of correlation pixel points, and Pix1 is another group of correlation pixel points;
in this way, the target coding mode of the pixel block is determined according to the luminance component deviation values of the pixel block under the plurality of coding modes, respectively, where the target coding mode is one of the plurality of coding modes. The target coding mode of the pixel block may be determined, for example, according to the luminance components of each group of pixels in the seven coding modes, and specifically, the sum of absolute values of luminance component differences of a plurality of pixels of the pixel block in a plurality of coding modes may be calculated, for example, and then the coding mode with the smallest luminance component difference value in the plurality of coding modes may be determined as the target coding mode of the pixel block. The sum of the absolute values of the luminance component differences of the four pixels in the seven coding modes can be calculated, for example, according to the luminance component, i.e., Y component, of each group of pixels in the seven coding modes, and used as the luminance component deviation value in the seven coding modes of the pixel block. For example, the raw YUV444 values for four pixels in the pixel block are: Y0U0V0, Y1U1V1, Y2U2V2, and Y3U3V3, the luminance component deviation value of the Y component in the seven coding modes can be calculated as follows:
Mode1:Diff1=|Y0–Y1|+|Y2–Y3|;
Mode2:Diff2=|Y0–Y2|+|Y1–Y3|;
Mode3:Diff3=|Y0–Y3|+|Y1–Y2|;
Mode4:Diff4=|Y0–Y1|+|Y0–Y2|;
Mode5:Diff5=|Y0–Y1|+|Y1–Y3|;
Mode6:Diff6=|Y1–Y3|+|Y2–Y3|;
Mode7:Diff7=|Y0–Y2|+|Y2–Y3|;
wherein Diffi (i is not less than 1 and not more than 7, i is an integer) represents a luminance component deviation value of a Y component of a related pixel point in each coding mode, and then the coding mode with the smallest luminance component deviation value among the seven coding modes is determined as a target coding mode of the pixel block, where the seven coding modes correspond to seven mode index values, and a value of the mode index value ModeIndex is, for example, 1 to 7, and, of course, this is merely an example, and the mode index value may be other data of image data such as any non-RGB and non-YUV, which is not limited in the embodiments of the present invention. The luminance component deviation values under the seven modes are calculated through the method, calculation can be achieved through a few adders and subtractors, the display effect is guaranteed, and meanwhile hardware resources are reduced.
In view of the above, encoding the multiple chrominance components of the pixel block according to the determined target encoding mode to obtain multiple chrominance component output values of the pixel block, specifically, for example, averaging encoding the multiple chrominance components, such as U components and V components, of the pixel block according to the target encoding mode, and the calculation formula may be as follows:
ModeIndex=1:OutU1=(U0+U1)/2;OutV1=(V0+V1)/2;
OutU2=(U2+U3)/2;OutV2=(V2+V3)/2;
ModeIndex=2:OutU1=(U0+U2)/2;OutV1=(V0+V2)/2;
OutU2=(U1+U3)/2;OutV2=(V1+V3)/2;
ModeIndex=3:OutU1=(U0+U3)/2;OutV1=(V0+V3)/2;
OutU2=(U1+U2)/2;OutV2=(V1+V2)/2;
ModeIndex=4:OutU1=(U0+U1+U2)/3;OutV1=(V0+V1+V2)/3;
OutU2=U3;OutV2=V3;
ModeIndex=5:OutU1=(U0+U1+U3)/3;OutV1=(V0+V1+V3)/3;
OutU2=U2;OutV2=V2;
ModeIndex=6:OutU1=(U1+U2+U3)/3;OutV1=(V1+V2+V3)/3;
OutU2=U0;OutV2=V0;
ModeIndex=7:OutU1=(U0+U2+U3)/3;OutV1=(V0+V2+V3)/3;
OutU2=U1;OutV2=V1;
wherein OutU1, outV1, outU2, and OutV2 are a plurality of chrominance component output values, outU1 is a first encoded U component, outV1 is a first encoded V component, outU2 is a second encoded U component, and OutV2 is a second encoded V component.
Then, a target mode index value is determined from the plurality of mode index values according to the target coding mode, and then target data is derived and output based on the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values of the pixel block.
In a specific implementation manner of the embodiment of the present invention, the target data of the pixel block may be output, for example, through the same link, where the target data includes the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values, that is, the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values are all output through the same link, and the same link may specifically be, for example, the same video interface, such as an HDMI interface, a DVI interface, or the like, or a board SerDes transmission, such as an LVDS SerDes, a SerDes. For example, the target pattern index value may be added to the luminance component outputs and the chrominance component outputs, for example, 3 bits may be added to the luminance component outputs and the chrominance component outputs, a binary value corresponding to the target pattern index value may be replaced with the 3 bits, and the target pattern index value may be carried on the luminance component outputs and the chrominance component outputs and then output through the same link. Therefore, the target mode index value is transmitted without adding other transmission links, and the mode index value of the target coding mode is output, so that the transmission bandwidth is reduced, the image quality is ensured, the process of repeatedly calculating the target coding mode is avoided at a decoding end, the image quality effect is ensured, and the hardware resource overhead is greatly reduced.
In this case, the target data of the pixel block may be obtained by, for example, mixedly encoding the mode index value of the target encoding mode into the plurality of luminance component output values and the plurality of chrominance component output values, and specifically, by, for example, replacing some of the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block based on the target mode index value of the pixel block. Specifically, for example, a value of the target mode index value in a designated scale may replace a part of the luminance components and the chrominance components of the pixel block to obtain the target data, and output the target data, where a number of bits of the value of the target mode index value in the designated scale is equal to a number of bits of the part of the chrominance components, that is, each target value corresponds to one bit of the binary value of the mode index value, where the designated scale is binary, for example, a total number of bits, for example, 101, of the binary value according to the mode index value of the coding mode is three bits, and any three values of the binary values of the luminance components (for example, the original Y component) and/or the chrominance components of the pixel block are arbitrarily selected as the target values, and then the target values are replaced based on the value of the target mode index value of the pixel block in the binary, and the target values may be binary values of the luminance components (for example, the original Y component) and/or the chrominance components, and this embodiment is not limited by this embodiment. It is also possible to determine a plurality of target values from the plurality of luminance components (e.g. original Y components) and/or the plurality of chrominance component output values of the pixel block, for example, according to the total number of bits of the target mode index value in a designated scale, for example, a binary value, octal value, decimal value, etc., in a binary system, for example, and/or in a binary system, for example, from the plurality of luminance components and/or the plurality of chrominance component output values, for example, in a partial value in a plurality of luminance components and in a plurality of chrominance component output values, for example, and optionally selecting the partial values in a plurality of luminance components and in a plurality of chrominance component output values as the plurality of target values, taking the designated binary system as an example, for example, according to the encoding mode, the total number of bits of binary values of the mode index values of the encoding mode is three, for example, 101, in the case where three values are arbitrarily selected from the luminance components (e.g., original Y components) and/or the chrominance component output values of the pixel block as the target values, then the target values are replaced based on the values of the target mode index value of the pixel block in the binary system, and when the selected target values are one luminance component and two chrominance component values, the binary value of the target mode index value replaces the values of one luminance component in the designated binary system and the values of two chrominance component output values in the designated binary system of the luminance components (e.g., original Y components) of the pixel block, and generating and outputting a plurality of target luminance components and a plurality of target chrominance components of the pixel block. When the value of the target mode index value in the designated system is the same as the partial value, the generated transmission data (i.e., the target luminance components and the target chrominance components of the pixel block) is the same as the encoded data (i.e., the luminance components and the chrominance component output values of the pixel block), and when the value of the target mode index value in the designated system is different from the partial value, the generated transmission data (i.e., the target luminance components and the chrominance components of the pixel block) is different from the encoded data (i.e., the luminance components and the chrominance component output values of the pixel block). Specifically, a plurality of target values may be determined from the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block, for example, according to a total number of bits of a binary value of the mode index value, where the number of the plurality of target values is equal to the total number of bits; and replacing the numerical value of the first bit of the binary numerical value corresponding to each target value with the numerical value of the corresponding bit in the binary numerical values of the pattern index values. The first bit may be, for example, a low bit, a medium bit, or a high bit, the low bit may be, for example, the lowest bit, or the last 20% range of bits in the binary value, the medium bit may be, for example, the middle 20% range of bits in the binary value, and the high bit may be, for example, the first 20% range of bits in the binary value; the first bit may also be, for example, lower than a preset bit, equal to the preset bit, or higher than the preset bit, where the preset bit is, for example, a certain bit threshold, and a specific bit may be set according to an actual situation, which is not limited in the embodiments of the present invention. When the designated bit is a low bit, the loss information is relatively minimum, the resource occupation ratio can be greatly saved, and when the designated bit is a high bit, the error rate can be greatly reduced. When the designated bit is the lowest bit, for example, after the above steps, the output multiple luminance components, i.e., Y component data streams, in the pixel block are: y0, Y1, Y2, Y3, and the output data streams of the chrominance components, which are the output values of the chrominance components, are: outU1, outV1, outU2, and OutV2, where a mode index value ModeIndex of the coding mode takes a value of 1 to 7, and corresponding binary data occupies 3 bits, that is, a high bit, a medium bit, and a low bit, and three components, that is, Y0, outU1, and OutV1, may be selected to modify bits, specifically, for example, the lowest bit of the binary value corresponding to the selected component may be modified, and of course, other components may also be selected, and other bits may also be modified, which is only an example, and the embodiment of the present invention is not limited thereto. Specifically, for example, the least significant bit of the binary number value corresponding to the Y0 component may be modified to be equal to the value of the upper bit of the ModeIndex, the least significant bit of the binary number value corresponding to the OutU1 component may be modified to be equal to the value of the middle bit of the ModeIndex, and the least significant bit of the binary number value corresponding to the OutV1 component may be modified to be equal to the value of the lower bit of the ModeIndex. Of course, the embodiment of the present invention is not limited to modifying the least significant bit of the binary values corresponding to Y0, outU1, and OutV1, and may also be other bit bits of other values. Thus, the mode index value ModeIndex of the coding mode is carried by the Y0, outU1 and OutV1 components for application when performing a downsampling process by converting YUV422 format to YUV444 format. For the sake of clarity, the above method for modifying the bit value is exemplified as follows: for example, the mode index values ModeIndex =5, Y0=108, outu1=71, outv1=220 of the coding modes, and the processing procedure is as shown in table 1:
ModeIndex Y0 OutU1 OutV1
raw data 5 108 71 220
Binary number corresponding to original data 101 01101100 01000111 11011100
Modifying the value of the lowest bit of Y0/OutU1/OutV1 01101101 01000110 11011101
After modifying the lowest bit, the Y0'/OutU1'/OutV1' value 109 70 221
That is, the mode index value ModeIndex =5 of the coding mode corresponds to a binary value of 101, and the lowest bit number values of Y0, outU1, and OutV1 are modified to generate Y0', outU1', and OutV1'. By converting the image of YUV444 to an image of YUV422 through the above steps, the output YUV422 luma output value may include, for example, a Y component data stream of: y0', Y1, Y2, Y3, the data stream for the chrominance components is: outU1', outV1', outU2, outV2.
In this case, for example, the pixel block may be replaced with binary data based on the target mode index value for the pixel block to generate a plurality of first luminance component output values and a plurality of first chrominance component output values; then, a plurality of target luminance components and a plurality of target chrominance components corresponding to the binary data of the plurality of first luminance components and the binary data of the plurality of first chrominance component output values are generated according to positions and output as the target data, and the preset position may be, for example, a numerical value sequence of an original bit is exchanged, for example, a numerical value of an original low bit is exchanged to a high bit or a medium bit, a numerical value of an original high bit is exchanged to a low bit, and the like, and may also, for example, maintain the position of the original bit, and may of course be exchanged according to other sequences, which is not limited in the embodiments of the present invention. When the numerical value sequence of the original bit is exchanged and coded to generate a plurality of corresponding target brightness components and a plurality of corresponding target chrominance components as the target data and output the target data, the interference to the data of the original bit is avoided, and the accuracy of data transmission is further improved.
In a specific implementation manner of the embodiment of the present invention, a link outputting the plurality of luminance component output values and the plurality of chrominance component output values is different from a link outputting the target mode index value; or the target mode index value, the luminance components and the chrominance component output values are output through at least two links, specifically, the luminance components and the chrominance component output values in the target data may be output through a first link, for example, a video interface, and the mode index value of the target coding mode in the target data of the pixel block may be output through a second link, for example, another data line, a communication link, or other links of course; for example, the plurality of luminance component output values and the plurality of chrominance component output values may be output through different first links, for example, two video interfaces, and the mode index value of the target coding mode in the target data of the pixel block may be output through a second link, which is not limited by the embodiment of the present invention.
The YUV 444-format image is converted into the YUV 422-format image through the down-sampling process, a plurality of pixel blocks and a plurality of coding modes are determined based on the image to be converted, the target coding mode of the pixel blocks is determined, the chrominance component output value is generated after the chrominance component is coded according to the target coding mode, and the target mode index value, the luminance component and the chrominance component output value corresponding to the target coding mode are output, so that the chrominance component output value is decoded according to the coding mode, the transmission bandwidth is reduced, the image quality is guaranteed, and the technical problems of cross color cast, line fracture blur and the like in the prior art are effectively improved. In addition, the mode index value of the target coding mode is output, so that the decoding end avoids the process of repeatedly calculating the target coding mode, the image quality effect is ensured, and the hardware resource overhead can be greatly reduced.
The programmable logic device 120 in the video processing apparatus 100 may, for example, convert the YUV 422-format image generated in the downsampling process into a YUV 444-format image, and the programmable logic device 120 may, for example, receive input data, where the input data includes target-format image data, and the target-format image data may, for example, be a second-format image YUV 422-format image, parse a current mode index value of each pixel block of the target-format image data with respect to a coding mode from the input data, specifically, may, for example, divide the YUV422 image into a plurality of pixel blocks according to a preset number of pixels, then parse data of each pixel block to obtain a corresponding target mode index value, where the preset number of pixels may, for example, be the same as the preset number of pixels in the downsampling process, then search for a corresponding target coding mode from among a plurality of coding modes according to the target mode index value, decode a chrominance component of the pixel block according to the target coding mode to obtain a decoded chrominance component value of the pixel block, and output a luminance component value of the pixel block and the decoded chrominance component value, that are to be converted into the YUV 444-format image.
Specifically, a plurality of target luminance components and a plurality of target chrominance components of each pixel block of the target format image data may be parsed from the input data, for example, and then a first bit of a value of the plurality of target luminance components and the plurality of target chrominance components in a designated scale, which may be binary, for example, the value in the designated scale may be binary data, of course, the designated scale may also be other scales such as octal, decimal, etc., the first bit may be, for example, a low bit, a middle bit, or a high bit, the low bit may be, for example, a lowest bit, or a last 20% range bit in a binary value, the middle bit may be, for example, a bit in a middle 20% range of the binary value, and the high bit may be, for example, a bit in a first 20% range of the binary value, may be obtained by parsing the target encoding mode index value of the pixel block; the first bit may also be, for example, lower than, equal to, or higher than a preset bit, where the preset bit is, for example, a certain bit threshold, and a specific bit may be set according to practical situations, and the embodiment of the present invention is not limited thereto, and the specified scale is the same as the specified scale in the downsampling process, and the first bit is also the same as the first bit in the downsampling process, and may be, for example, agreed or specified in advance. Taking the example that the designated binary system is a binary system and the designated bit is a low bit, analyzing the lowest bit of the binary values corresponding to Y0', outU1', outV1' in the target luminance components and the target chrominance components of the pixel block to obtain the mode index value, and then determining the corresponding coding mode according to the mode index value. Of course, it is also possible to parse a plurality of target luminance components and a plurality of target chrominance components of each pixel block of the target format image data from the input data, for example, and then parse values of the target luminance components and the target chrominance components under a designated scale according to a preset position to obtain a plurality of first luminance components and a plurality of first chrominance component output values, i.e., values under the designated scale of the target luminance components and the target chrominance components may be, for example, values of a scrambled bit position or values of an original bit position, the preset position may be, for example, a position opposite to the position in the downsampling process, or may be, for example, the same as the preset position of the downsampling, i.e., if the downsampling process encodes the original bit scrambled bit position, the upsampling process parses the data according to the position opposite to the scrambled bit position of the downsampling process to restore the bit to the original position, if the downsampling process encodes the original bit position, the upsampling process also decodes according to the same bit position, i.e., if the downsampling process encodes according to the original bit position, decodes the upsampling process also specifies values of the target luminance components and the first chrominance components under the first chrominance component in advance of the first luminance mode, and the first chrominance component are designated pixel block, and the target luminance components under the designated scale of the first chrominance mode, the designated scale may be, for example, a binary scale, and a value under the designated scale may be, for example, binary data, but of course, the designated scale may also be other scales such as an octal scale, a decimal scale, and the like. Therefore, when the YUV422 format is converted into the YUV444 format image, the process of calculating the coding mode in the downsampling process does not need to be repeated in the upsampling process, the processing process is saved, and meanwhile, the waste of hardware resources is avoided.
As mentioned above, the chroma component of the pixel block is decoded according to the target coding mode to obtain the decoded chroma component value of the pixel block, and specifically, for example, the chroma component of the pixel block may be decoded by a duplication method according to the target coding mode, and of course, an averaging method or another decoding method may also be adopted, taking the duplication method as an example, and the specific decoding process may be as follows:
ModeIndex=1:U0=U1=OutU1’;U2=U3=OutU2;
V0=V1=OutV1’;V2=V3=OutV2;
ModeIndex=2:U0=U2=OutU1’;U1=U3=OutU2;
V0=V2=OutV1’;V1=V3=OutV2;
ModeIndex=3:U0=U3=OutU1’;U1=U2=OutU2;
V0=V3=OutV1’;V1=V2=OutV2;
ModeIndex=4:U0=U1=U2=OutU1’;U3=OutU2;
V0=V1=V2=OutV1’;V3=OutV2;
ModeIndex=5:U0=U1=U3=OutU1’;U2=OutU2;
V0=V1=V3=OutV1’;V2=OutV2;
ModeIndex=6:U1=U2=U3=OutU1’;U0=OutU2;
V1=V2=V3=OutV1’;V0=OutV2;
ModeIndex=7:U0=U2=U3=OutU1’;U1=OutU2;
V0=V2=V3=OutV1’;V1=OutV2;
obtaining the decoded chrominance component values of the pixel block, such as decoded U components (OutU 1', outU 2) and decoded V components (OutV 1', outV 2), through the calculation, and then outputting the luminance component value and the decoded chrominance component value of the pixel block, namely, completing the conversion of the YUV422 format image into the YUV444 format image.
In the up-sampling process, a target mode index value of a pixel block of the target format image data about a coding mode is obtained by analyzing the input data, and then the chroma component of the pixel block is decoded according to the target coding mode index value to obtain a chroma component value after decoding, so that the transmission bandwidth is reduced, the image quality is ensured, and the technical problems of cross color and color cast, line fracture and blurring and the like in the prior art are effectively improved. In addition, the target coding mode index value in the input data is decoded, so that the repeated calculation of the coding mode is avoided, the image quality effect is ensured, and the hardware resource overhead can be greatly reduced.
In summary, the image format conversion method provided in this embodiment determines a plurality of pixel blocks and a plurality of coding modes based on an image to be converted, determines a target coding mode of the pixel blocks, encodes a chrominance component according to the target coding mode, generates a chrominance component output value, and outputs a target mode index value, a luminance component, and a chrominance component output value corresponding to the target coding mode, so as to decode the chrominance component output value according to the coding mode. In addition, the mode index value of the target coding mode is output, so that the decoding end avoids the process of repeatedly calculating the target coding mode, the image quality effect is ensured, and the hardware resource overhead can be greatly reduced. In addition, the mode index value of the target coding mode is output through the down-sampling process, the coding mode index value is obtained through direct analysis in the up-sampling process, decoding is carried out on the coding mode index value, the process of repeatedly calculating the target coding mode is avoided by a decoding end, the image quality effect is guaranteed, and meanwhile hardware resource overhead can be greatly reduced.
[ second embodiment ]
As shown in fig. 8, a second embodiment of the present invention provides an image format conversion apparatus 200, including: an acquisition module 210, a first determination module 220, a second determination module 230, an encoding module 240, a third determination module 250, and a data output module 260.
An obtaining module 210, configured to obtain an image to be converted;
a first determining module 220, configured to determine a plurality of pixel blocks and a plurality of coding modes based on the image to be converted, where the plurality of coding modes correspond to a plurality of mode index values;
a second determining module 230, configured to determine a target coding mode for the pixel block according to the luminance component deviation values of the pixel block in the plurality of coding modes, respectively, where the target coding mode is one of the plurality of coding modes;
an encoding module 240 configured to encode a plurality of chroma components of the pixel block based on the target encoding mode to obtain a plurality of chroma component output values of the pixel block;
a third determining module 250 for determining a target mode index value from the plurality of mode index values according to the target coding mode;
a data output module 260, configured to obtain and output target data based on the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values.
In a specific implementation manner of this embodiment, the data output module 260 is specifically configured to: the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values are output over the same link; or a link outputting the plurality of luminance component and the plurality of chrominance component output values and a link outputting the target mode index value are different; or the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values are output over at least two links.
In a specific implementation manner of this embodiment, the target mode index value, the luminance components, and the chrominance component output values are transmitted through the same link, and the data output module is specifically configured to replace a part of the luminance components and the chrominance component output values of the pixel block with the target mode index value to obtain the target data and output the target data.
In a specific implementation manner of this embodiment, the replacing, by the target mode index value, a part of values in the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block to obtain the target data and output the target data includes: and replacing partial values in the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block with the value of the target mode index value under the specified system to obtain the target data and outputting the target data, wherein the number of bits of the value of the target mode index value under the specified system is equal to the number of bits of the partial values.
In a specific implementation manner of this embodiment, replacing some of the luminance component output values and the chrominance component output values of the pixel block with the target mode index value to obtain the target data and output the target data, includes: determining a target luma component and/or a target chroma component output value from the plurality of luma components and/or the plurality of chroma component output values of the block of pixels based on a total number of bits of binary data of the target mode index value; determining the partial value from the target luma component and/or the target chroma component output value, the partial value having a first number of bits of the target luma component and/or the target chroma component output value, wherein the first number of bits comprises one of: the first bit is a low bit; the first bit is lower than a preset bit; the first bit is equal to a preset bit; the first bit is a middle bit; the first bit is a high bit; the first bit is higher than a preset bit.
In a specific implementation manner of this embodiment, the replacing, by the target mode index value, a partial value of the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block to obtain the target data and output the target data includes: replacing a value of the target mode index value under a binary system with a first bit of the target luminance component and/or the target chrominance component output value to obtain a replaced target luminance component and/or a replaced target chrominance component output value; and adjusting the output value of the replaced target brightness component and/or the replaced target chrominance component according to a preset position rule, generating and outputting the target data.
Referring to fig. 9, in a specific implementation manner of this embodiment, the second determining module 230 includes:
a calculating unit 231, configured to calculate a sum of absolute values of luminance component differences of a plurality of pixels of the pixel block in the plurality of coding modes, as the luminance component deviation value in the plurality of coding modes of the pixel block;
a determining unit 232, configured to determine the coding mode with the smallest luminance component deviation value among the plurality of coding modes as a target coding mode for the pixel block.
Referring to fig. 10, the second embodiment of the present invention further provides another image conversion apparatus 200, including: a receiving module 270, a parsing module 280, a decoding module 290, and an output module 2100.
A receiving module 270, configured to input data, where the input data includes target format image data;
a parsing module 280 for parsing a target mode index value regarding an encoding mode for each pixel block of the target format image data from the input data;
a decoding module 290, configured to decode the chroma component of the pixel block according to the target mode index value, so as to obtain a decoded chroma component value of the pixel block; and
an output module 2100 configured to output a luma component value and the decoded chroma component value of the pixel block.
In a specific implementation manner of this embodiment, referring to fig. 11, the parsing module 280 specifically includes:
a first parsing unit 281 for parsing a plurality of target luminance components and a plurality of target chrominance components for each pixel block of the target format image data from the input data;
a second analyzing unit 282, configured to analyze, according to a preset position rule, values of the target luminance components and the target chrominance components in a designated scale to obtain a plurality of first luminance components and a plurality of first chrominance component output values;
a third parsing unit 283, configured to parse first bits of values of the plurality of first luma components and the plurality of first chroma component output values in a specified scale to obtain a target coding mode index value of the pixel block regarding a coding mode.
Referring to fig. 12, the decoding module 290 specifically includes:
a searching unit 291, configured to search, according to the target mode index value, a corresponding target coding mode from the multiple coding modes;
the decoding unit 292 is configured to decode the chroma component of the pixel block according to the target coding mode to obtain a decoded chroma component value of the pixel block.
The specific operation and technical effects between the modules in the image format conversion apparatus 200 in the present embodiment are described with reference to the foregoing first embodiment.
[ third embodiment ] A
As shown in fig. 13, a third embodiment of the present invention provides an image format conversion system 300. The image format conversion system 300 includes, for example, a memory 320 and a processor 310 connected to the memory 320. The memory 320 may be, for example, a non-volatile memory, on which the computer program 321 is stored. The processor 310 may be, for example, an embedded processor. The processor 310 executes the image format conversion method in the foregoing first embodiment when running the computer program 321.
The specific operation and technical effects of the image format conversion system 300 in the present embodiment are described with reference to the foregoing first embodiment.
[ fourth embodiment ]
As shown in fig. 14, a fourth embodiment of the present invention provides a computer-readable storage medium 400. The computer-readable storage medium 400 is, for example, a nonvolatile memory, which is, for example: magnetic media (e.g., hard disks, floppy disks, and magnetic tape), optical media (e.g., CDROM disks and DVDs), magneto-optical media (e.g., optical disks), and hardware devices that are specially constructed for the storage and execution of computer-executable instructions (e.g., read-only memories (ROMs), random Access Memories (RAMs), flash memories, etc.). The computer-readable storage medium 400 has stored thereon computer-executable instructions 410. The computer-readable storage medium 400 may execute the computer-executable instructions 410 by one or more processors or processing devices to implement the image format conversion method in the foregoing first embodiment.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (13)

1. An image format conversion method, comprising:
acquiring an image to be converted;
determining a plurality of pixel blocks and a plurality of coding modes based on the image to be converted, wherein the plurality of coding modes correspond to a plurality of mode index values;
determining a target coding mode of the pixel block according to the luminance component deviation values of the pixel block under the plurality of coding modes respectively, wherein the target coding mode is one of the plurality of coding modes;
encoding a plurality of chroma components of the block of pixels based on the target encoding mode to obtain a plurality of chroma component output values for the block of pixels;
determining a target mode index value from the plurality of mode index values according to the target coding mode;
and obtaining and outputting target data based on the target mode index value, the plurality of luminance components and the plurality of chrominance component output values.
2. The image format conversion method according to claim 1, wherein the obtaining and outputting target data based on the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values specifically comprises:
the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values are output over the same link; or
A link outputting the plurality of luminance component and the plurality of chrominance component output values and a link outputting the target mode index value are different; or
The target mode index value, the plurality of luma components, and the plurality of chroma component output values are output over at least two links.
3. The image format conversion method according to claim 1, wherein the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values are transmitted through the same link, and the obtaining and outputting of the target data based on the target mode index value, the plurality of luminance components, and the plurality of chrominance component output values comprises:
and replacing partial values in the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block by the target mode index value to obtain and output the target data.
4. The image format conversion method according to claim 3, wherein the replacing a part of the plurality of luminance component and the plurality of chrominance component output values of the pixel block with the target mode index value to obtain the target data and outputting, comprises:
and replacing partial values in the plurality of luminance component output values and the plurality of chrominance component output values of the pixel block with the value of the target mode index value under the specified system to obtain the target data and outputting the target data, wherein the number of bits of the value of the target mode index value under the specified system is equal to the number of bits of the partial values.
5. The image format conversion method according to claim 3, wherein the replacing a part of the plurality of luminance component and the plurality of chrominance component output values of the pixel block with the target mode index value to obtain the target data and outputting, comprises:
determining a target luma component and/or a target chroma component output value from the plurality of luma components and/or the plurality of chroma component output values of the block of pixels based on a total number of bits of binary data of the target mode index value;
determining the partial value from the target luma component and/or the target chroma component output value, the partial value having a number of bits that is a first bit of the target luma component and/or the target chroma component output value, wherein the first bit comprises one of:
the first bit is a low bit;
the first bit is lower than a preset bit;
the first bit is equal to a preset bit;
the first bit is a middle bit;
the first bit is a high bit;
the first bit is higher than a preset bit.
6. The image format conversion method according to claim 5, wherein the replacing a part of the plurality of luminance component and the plurality of chrominance component output values of the pixel block with the target mode index value to obtain the target data and output it, comprises:
replacing a value of the target mode index value under a binary system with a first bit of the target luminance component and/or the target chrominance component output value to obtain a replaced target luminance component and/or a replaced target chrominance component output value;
and adjusting the output value of the replaced target brightness component and/or the replaced target chrominance component according to a preset position rule, generating and outputting the target data.
7. The image format conversion method of claim 1, wherein the determining the target coding mode for the pixel block according to the luminance component deviation values of the pixel block in the plurality of coding modes respectively comprises:
calculating the sum of absolute values of luminance component differences of a plurality of pixels of the pixel block in a plurality of coding modes, and taking the sum as the luminance component deviation value of the pixel block in the plurality of coding modes;
determining the encoding mode having the smallest luminance component deviation value among the plurality of encoding modes as a target encoding mode for the pixel block.
8. An image format conversion method, comprising:
receiving input data, wherein the input data comprises target format image data;
analyzing a target mode index value of each pixel block of the target format image data about an encoding mode from the input data;
decoding the chroma component of the pixel block according to the target mode index value to obtain a decoded chroma component value of the pixel block; and
outputting a luma component value and the decoded chroma component value of the block of pixels.
9. The image format conversion method according to claim 8, wherein the decoding the chroma component of the pixel block according to the target mode index value to obtain a decoded chroma component value of the pixel block specifically comprises:
searching a corresponding target coding mode in a plurality of coding modes according to the target mode index value;
and decoding the chroma components of the pixel block according to the target coding mode to obtain the decoded chroma component values of the pixel block.
10. The image format conversion method according to claim 8, wherein the parsing out the target mode index value regarding the coding mode for each pixel block of the target format image data from the input data specifically includes:
parsing out a plurality of target luminance components and a plurality of target chrominance components for each pixel block of the target format image data from the input data;
analyzing the values of the target brightness components and the target chrominance components under the designated scale according to a preset position rule to obtain a plurality of first brightness components and a plurality of first chrominance component output values;
and analyzing the first bits of the values of the first luminance components and the first chrominance component output values under the appointed scale to obtain a target mode index value of the pixel block relative to the coding mode.
11. An image format conversion apparatus, characterized by comprising:
the acquisition module is used for acquiring an image to be converted;
a first determining module, configured to determine, based on the image to be converted, a plurality of pixel blocks and a plurality of encoding modes, where the plurality of encoding modes correspond to a plurality of mode index values;
a second determining module, configured to determine a target coding mode of the pixel block according to the luminance component deviation values of the pixel block in the multiple coding modes, respectively, where the target coding mode is one of the multiple coding modes;
an encoding module to encode a plurality of chroma components of the pixel block based on the target encoding mode to obtain a plurality of chroma component output values for the pixel block;
a third determining module to determine a target mode index value from the plurality of mode index values according to the target coding mode;
and the data output module is used for obtaining and outputting target data based on the target mode index value, the plurality of luminance components and the plurality of chrominance component output values.
12. An image format conversion apparatus, characterized by comprising:
the receiving module is used for receiving input data, and the input data comprises target format image data;
the analysis module is used for analyzing a target mode index value of each pixel block of the target format image data relative to the coding mode from the input data;
the decoding module is used for decoding the chroma component of the pixel block according to the target mode index value to obtain a decoded chroma component value of the pixel block; and
an output module for outputting the luminance component value and the decoded chrominance component value of the pixel block.
13. A video processing apparatus, comprising:
a microprocessor and a programmable logic device electrically connected to the microprocessor, the programmable logic device being configured to perform the image format conversion method of any one of claims 1 to 7 and/or the image format conversion method of any one of claims 8 to 10; or
An integrated processing chip for performing the image format conversion method of any one of claims 1 to 7 and/or the image format conversion method of any one of claims 8 to 10.
CN202111165196.6A 2021-09-30 2021-09-30 Image format conversion method and device and video processing equipment Pending CN115914637A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111165196.6A CN115914637A (en) 2021-09-30 2021-09-30 Image format conversion method and device and video processing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111165196.6A CN115914637A (en) 2021-09-30 2021-09-30 Image format conversion method and device and video processing equipment

Publications (1)

Publication Number Publication Date
CN115914637A true CN115914637A (en) 2023-04-04

Family

ID=86486868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111165196.6A Pending CN115914637A (en) 2021-09-30 2021-09-30 Image format conversion method and device and video processing equipment

Country Status (1)

Country Link
CN (1) CN115914637A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117750025A (en) * 2024-02-20 2024-03-22 上海励驰半导体有限公司 Image data processing method, device, chip, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117750025A (en) * 2024-02-20 2024-03-22 上海励驰半导体有限公司 Image data processing method, device, chip, equipment and medium
CN117750025B (en) * 2024-02-20 2024-05-10 上海励驰半导体有限公司 Image data processing method, device, chip, equipment and medium

Similar Documents

Publication Publication Date Title
US8559709B1 (en) Method and apparatus for progressive encoding for text transmission
CN108322746B (en) Method and apparatus for dynamically monitoring the encoding of a digital multi-dimensional signal
CN115914637A (en) Image format conversion method and device and video processing equipment
CN105144726A (en) Custom data indicating nominal range of samples of media content
US10250892B2 (en) Techniques for nonlinear chrominance upsampling
CN109413445B (en) Video transmission method and device
US11582464B2 (en) Using morphological operations to process frame masks in video content
US11330278B2 (en) Chroma adjustment with color components in color spaces in video coding
CN113301339A (en) Data encoding and decoding method and device
CN117528098B (en) Coding and decoding system, method and equipment for improving image quality based on deep compressed code stream
US11064210B2 (en) Pre-processing of HDR video involving chroma adjustment
CN115100031B (en) Image processing method and image processing apparatus
US11515961B2 (en) Encoding data arrays
US11601665B2 (en) Embedding frame masks in a video stream
US20230262210A1 (en) Visual lossless image/video fixed-rate compression
CN115529465A (en) Image transmission method, system and device and electronic equipment
JP3642158B2 (en) Image encoding device, image encoding method, image decoding device, image decoding method, and transmission method
CN117676145A (en) Multi-format video coding transmission method, device, terminal equipment and medium
CN116112679A (en) Image encoding and decoding method, device, electronic equipment and storage medium
KR100327482B1 (en) Image data encoding method
CN115695781A (en) Coding and decoding method for static frame mode
CN116614632A (en) Image compression method, system and device applied to LED display control system
CN115426519A (en) Method and system for playing H265 video in browser
CN116330661A (en) Processing method and printing system for slice data for 3D printing
JP2002010084A (en) Coding device, decoding device, coding method, decoding method, and computer readable storage medium which stores program for making computer execute the decoding method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination