Image encoding and decoding method, device, electronic device and computer readable medium

By converting the video frames to be encoded collected by the image sensor into fixed-point numbers in the video encoding and decoding system, and performing floating-point number processing, the problem of transmission distortion and resource waste during image encoding is solved, and accurate encoding and decoding of images is achieved.

CN118474394BActive Publication Date: 2024-09-13BEIJING VIMICRO ARTIFICIAL INTELLIGENCE CHIP TECH CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410918186.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-09-13
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

In video coding and decoding systems, transmission distortion occurs due to nonlinear transformation of bit depth during image encoding, and floating-point number representation causes waste of resources and high computational complexity.

Method used

By controlling the image sensor to collect video frames to be encoded, convert them into fixed-point numbers, perform floating-point number conversion processing, and use a custom encoder for encoding and decoding to ensure complete image transmission and reduce resource waste and computational complexity.

Benefits of technology

It avoids distortion of image transmission, reduces waste of resources, reduces computational complexity, and achieves accurate encoding and decoding of images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118474394B
    Figure CN118474394B
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose image encoding and decoding methods, devices, electronic devices and computer-readable media. A specific implementation of the method includes: controlling an image sensor to collect video frames to be encoded; transmitting the video frames to be encoded to an encoding terminal; controlling an image processor included in the encoding terminal to perform floating-point conversion processing on the video frames to be encoded to generate floating-point video frames; inputting the floating-point video frames into a custom encoder included in the encoding terminal to obtain a video frame code stream; in response to receiving the video frame code stream, a custom decoder included in a decoding terminal decodes the video frame code stream to generate a decoded video frame; controlling a driver included in the decoding terminal to convert the decoded video frame to generate a converted video frame; controlling a display included in the decoding terminal to display the converted video frame. This implementation avoids distortion of the transmitted image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and more particularly to image encoding and decoding methods, devices, electronic devices, and computer-readable media. Background Art

[0002] In video encoding and decoding systems, the images used for encoding often come from image sensors, the photosensitive elements in cameras. Transmitting these images typically requires encoding them to generate a bitstream for transmission. Currently, most image sensors have a 12-bit bit depth, while encoders have a 10-bit or 8-bit bit depth. Therefore, image encoding typically involves reducing the bit depth of the image captured by the image sensor and then feeding this reduced bit depth image into the encoder for encoding.

[0003] However, in practice, it is found that when the above method is used for image encoding, the following technical problems often occur: bit depth is used to represent the amount of color information used by each pixel in the image. Reducing the bit depth is a nonlinear transformation, which will cause distortion of the transmitted image.

[0004] In the process of adopting technical solutions to solve the above-mentioned technical problem 1, the following problem often occurs: Technical problem 2: when the image is converted into a floating-point type and then encoded, the pixel value may not cover the entire floating-point representation range, and the entire image is encoded and transmitted, resulting in a waste of transmission resources. For these problems of the above-mentioned technical problem 2, the conventional solution is generally to delete the range of values ​​that are not covered by pixels. However, the above-mentioned conventional solution still has the following problem: the deleted value range may not be a continuous range, resulting in inaccurate pixel prediction results during encoding, and further causing distortion of the transmitted image.

[0005] In the process of adopting technical solutions to solve the above-mentioned technical problem 1, the following problem often arises: Technical problem 3: When using floating-point numbers to represent pixels, the IEEE754 standard is usually used, and the difference between the two values ​​of the image captured by the image sensor is 1, and the maximum accuracy is limited. Therefore, when using the IEEE754 standard, the computational complexity is high, and it takes a long time to convert the image into a floating-point number.

[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the Invention

[0007] The content of this disclosure is used to briefly introduce concepts that will be described in detail in the detailed description section below. The content of this disclosure is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0008] Some embodiments of the present disclosure provide image encoding and decoding methods, devices, electronic devices, and computer-readable media to solve one or more of the technical problems mentioned in the above background technology section.

[0009] In a first aspect, some embodiments of the present disclosure provide an image encoding and decoding method, which includes: controlling the above-mentioned image sensor to collect video frames to be encoded, wherein the data type of the above-mentioned video frames to be encoded is a fixed-point number; transmitting the above-mentioned video frames to be encoded to the above-mentioned encoding terminal; controlling the image processor included in the above-mentioned encoding terminal to perform floating-point conversion processing on the above-mentioned video frames to be encoded to generate floating-point video frames; inputting the above-mentioned floating-point video frames into the custom encoder included in the above-mentioned encoding terminal to obtain a video frame code stream; in response to receiving the above-mentioned video frame code stream, the custom decoder included in the above-mentioned decoding terminal decodes the above-mentioned video frame code stream to generate a decoded video frame; controlling the driver included in the above-mentioned decoding terminal to convert the above-mentioned decoded video frame to generate a converted video frame; controlling the display included in the above-mentioned decoding terminal to display the above-mentioned converted video frame.

[0010] In a second aspect, some embodiments of the present disclosure provide an image encoding and decoding device, the device comprising: a first control unit, configured to control the image sensor to capture video frames to be encoded, wherein the data type of the video frames to be encoded is a fixed-point number; a transmission unit, configured to transmit the video frames to be encoded to the encoding terminal; a second control unit, configured to control the image processor included in the encoding terminal to perform floating-point conversion processing on the video frames to be encoded to generate floating-point video frames; an input unit, configured to input the floating-point video frames into a custom encoder included in the encoding terminal to obtain a video frame code stream; a decoding unit, configured to decode the video frame code stream in response to receiving the video frame code stream, and generate a decoded video frame by the custom decoder included in the decoding terminal; a third control unit, configured to control the driver included in the decoding terminal to perform conversion processing on the decoded video frames to generate converted video frames; and a fourth control unit, configured to control the display included in the decoding terminal to display the converted video frames.

[0011] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.

[0012] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation of the first aspect is implemented.

[0013] The above-described embodiments of the present disclosure have the following advantageous effects: The image encoding and decoding methods of some embodiments of the present disclosure avoid transmitted image distortion. Specifically, the cause of transmitted image distortion is that bit depth represents the amount of color information used by each pixel in an image. Reducing the bit depth is a nonlinear transformation, which results in transmitted image distortion. Based on this, the image encoding and decoding methods of some embodiments of the present disclosure first control the image sensor to capture the video frame to be encoded. This allows the image sensor to acquire the image to be transmitted. Next, the video frame to be encoded is transmitted to the encoding terminal. This allows the image to be processed. Then, the image processor included in the encoding terminal is controlled to perform floating-point conversion on the video frame to generate a floating-point video frame. This converts an integer image into a floating-point number. The floating-point video frame is then input into a custom encoder included in the encoding terminal to generate a video frame stream. This allows the floating-point video frame to be encoded to generate a stream. Finally, in response to receiving the video frame stream, the custom decoder included in the decoding terminal decodes the video frame stream to generate a decoded video frame. Thus, decoding can be performed according to the inverse process of the encoding terminal, outputting a floating-point image. Subsequently, the driver included in the decoding terminal is controlled to convert the decoded video frame to generate a converted video frame. This allows the floating-point image to be converted into a fixed-point format supported by the display device. Finally, the display included in the decoding terminal is controlled to display the converted video frame. This completes the encoding and decoding of the image. By converting the fixed-point image into a floating-point number, the image can be fully encoded and decoded, thereby avoiding image distortion during transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0015] Figure 1 is a flowchart of some embodiments of the image encoding and decoding method according to the present disclosure;

[0016] Figure 2 is a schematic structural diagram of some embodiments of the image encoding and decoding device according to the present disclosure;

[0017] Figure 3 It is a structural diagram of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0018] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0019] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other.

[0020] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0021] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0022] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0023] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0024] Figure 1 A process 100 of some embodiments of the image encoding and decoding method according to the present disclosure is shown. The image encoding and decoding method includes the following steps:

[0025] Step 101: Control the image sensor to collect video frames to be encoded.

[0026] In some embodiments, the execution entity (e.g., a server) of the image encoding and decoding method can control the image sensor to capture video frames to be encoded. The image encoding and decoding method can be applied to a video acquisition system. The video acquisition system may include an image sensor, an encoding terminal, and a decoding terminal. The encoding terminal includes an image processor and a custom encoder. The decoding terminal includes a custom decoder, a driver, and a display. The video frames to be encoded can be video frames from a video captured by the image sensor or single images captured by the image processor. The data type of the video frames to be encoded can be fixed-point numbers. The video frames to be encoded have corresponding bit depths.

[0027] Step 102: Transmit the video frame to be encoded to the encoding terminal.

[0028] In some embodiments, the execution entity may transmit the to-be-encoded video frame to the encoding terminal.

[0029] Step 103: Control the image processor included in the encoding terminal to perform floating-point conversion processing on the video frame to be encoded to generate a floating-point video frame.

[0030] In some embodiments, the execution entity may control the image processor included in the encoding terminal to perform floating-point conversion processing on the to-be-encoded video frame to generate a floating-point video frame.

[0031] In practice, the following steps may be performed to perform floating point conversion on the above-mentioned video frame to be encoded to generate a floating point video frame:

[0032] The first step is to obtain sensor information corresponding to the image sensor. The sensor information includes a maximum bit depth value. The sensor information may be configuration information of the image sensor. The maximum bit depth value may be the maximum bit depth that the image sensor can capture.

[0033] The second step is to determine a floating-point range mapping information set based on the maximum bit depth value included in the sensor information and the bit depth value corresponding to the to-be-encoded video frame. Here, a preset floating-point range mapping information set corresponding to the maximum bit depth value can be selected from a preset floating-point range mapping information set as the floating-point range mapping information set. The floating-point range mapping information in the floating-point range mapping information set may include, but is not limited to, an exponent value, a floating-point number range, a multiplier value, a precision value, and a starting floating-point number.

[0034] In a third step, in response to the to-be-encoded video frame not being the first video frame, a pixel reduction value corresponding to the to-be-encoded video frame is determined. In practice, the pixel reduction value can be obtained from a buffer included in the encoding terminal. The pixel reduction value can be a pixel value used to truncate the to-be-encoded video frame.

[0035] Considering the problems with the conventional solutions mentioned above, and facing the second technical problem mentioned above: when converting an image to a floating-point type for encoding, the pixel values ​​may not fit within the entire floating-point representation range, and encoding and transmitting the entire image results in a waste of transmission resources. Combining the advantages, the following solution can be adopted. Here, the pixel reduction value can be determined through the following sub-steps:

[0036] The first sub-step is to perform a histogram arrangement on each pixel included in the previous video frame to generate a pixel histogram.

[0037] The second sub-step is to determine the minimum pixel value and a preset step size set based on the pixel histogram. In practice, the minimum pixel value can be selected from the pixel histogram. The preset step size in the preset step size set can be a pre-set length from the starting position of the histogram.

[0038] The third sub-step is to determine the previous frame floating-point range mapping information corresponding to the previous video frame.

[0039] The fourth sub-step is to perform the following processing steps for each preset step size in the preset step size set:

[0040] The first processing step is to select a floating-point number range of the previous frame from the floating-point number range mapping information of the previous frame, and select at least one floating-point number node from the floating-point number range of the previous frame according to a preset step size as a target floating-point number node. In practice, the at least one floating-point number node can be selected as the target floating-point number node by starting at a point of the preset step size on the horizontal axis of the histogram and using each starting floating-point value included in the floating-point range mapping information set as a node range.

[0041] As an example, the floating-point number range may be [0-1000], the preset step size may be 100, and the starting floating-point values ​​may be 100 and 200. Therefore, the 100th in [0-1000] may be used as the starting point, and 100+100 and 100+100+200, i.e., 200 and 400, may be selected as two floating-point number nodes, and the 1000th may be selected as the target floating-point number node.

[0042] The second processing step is to determine, for each of the selected target floating-point nodes, a precision loss value corresponding to the target floating-point node. In practice, for each target floating-point node, the precision value corresponding to the target floating-point node can be selected from the floating-point range mapping information set, and the precision value included in the previous floating-point range mapping information can be subtracted to obtain the precision loss value.

[0043] In the third processing step, for each floating-point sub-range in the floating-point sub-ranges divided by the selected target floating-point nodes in the floating-point range of the previous frame, the product of the number of pixels corresponding to the floating-point sub-range in the pixel histogram and the corresponding precision loss value is determined as the pixel loss value.

[0044] In the fourth processing step, the sum of the generated pixel loss values ​​is determined as the total pixel loss value.

[0045] In a fifth sub-step, a pixel total loss value that satisfies a preset condition is selected from the determined total pixel loss values ​​as a target pixel loss value, and a preset step size corresponding to the target pixel loss value is determined as a pixel reduction value. The preset condition may be that the total pixel loss value is minimized.

[0046] The first to fifth substeps described above, as an inventive feature of an embodiment of the present disclosure, address the second technical issue mentioned in the background technology: "When encoding an image after conversion to a floating-point type, pixel values ​​may not necessarily fit within the entire floating-point representation range. This results in wasted transmission resources when encoding and transmitting the entire image." This waste of transmission resources is caused by the following: When encoding an image after conversion to a floating-point type, pixel values ​​may not necessarily fit within the entire floating-point representation range. This results in wasted transmission resources when encoding and transmitting the entire image. Resolving this issue can avoid wasted transmission resources. To achieve this, the present disclosure firstly arranges the pixels included in the previous video frame into a histogram to generate a pixel histogram. This allows each pixel to be represented by a histogram. Second, based on the pixel histogram, a minimum pixel value and a set of preset step sizes are determined. This allows the minimum pixel value and step size to be determined. Third, floating-point range mapping information corresponding to the previous video frame is determined. This allows the floating-point range of the previous video frame to be determined. Fourth, for each preset step size in the preset step size set, the following processing steps are performed: First, a previous frame floating-point range is selected from the previous frame floating-point range mapping information, and at least one floating-point node is selected from the previous frame floating-point range based on the preset step size as a target floating-point node. This allows the floating-point node corresponding to each precision to be determined. Second, for each of the selected target floating-point nodes, the precision loss value corresponding to the target floating-point node is determined. This allows the precision loss of the pixel mapping in the node to be determined. Then, for each of the floating-point sub-ranges in the previous frame floating-point range divided by the selected target floating-point nodes, the pixel loss value is determined by multiplying the number of pixels corresponding to the floating-point sub-range in the pixel histogram by the corresponding precision loss value. This allows the loss value of all pixels included in each floating-point sub-range to be determined. The sum of the generated pixel loss values ​​is then determined as the total pixel loss value. Thus, the pixel loss caused by transmitting at this preset step size can be determined. Fifth, a total pixel loss value that satisfies a preset condition is selected from the determined total pixel loss values ​​as the target pixel loss value, and the preset step size corresponding to the target pixel loss value is determined as the pixel reduction value. Thus, the preset step size with the smallest pixel loss can be selected to perform image truncation processing, thereby reducing the size of the transmitted image and truncating the portion with fewer pixels and lower loss, thereby avoiding waste of transmission resources.

[0047] In the fourth step, according to the pixel reduction value and the floating-point range mapping information set, the to-be-encoded video frame is subjected to floating-point conversion processing to generate a floating-point video frame.

[0048] In practice, the floating point conversion process can be performed on the above-mentioned video frame to be encoded through the following sub-steps to generate a floating point video frame:

[0049] In the first sub-step, the video frame to be encoded is truncated according to the pixel reduction value to generate a truncated video frame. In practice, the truncation process may be performed by subtracting each pixel in the video frame to be encoded from the pixel reduction value. Here, the pixel values ​​of pixels whose difference values ​​are less than 0 may be set to 0.

[0050] In a second sub-step, based on the truncated video frame, floating-point range mapping information corresponding to the truncated video frame is selected from the floating-point range mapping information set as target mapping information.

[0051] The third sub-step is to determine the exponent value and multiplier value corresponding to the truncated video frame according to the target mapping information. In practice, the corresponding exponent value and multiplier value can be selected from the target mapping information.

[0052] In a fourth sub-step, a difference between the truncated video frame and the starting floating-point value included in the target mapping information is determined as an intermediate floating-point value.

[0053] The fifth sub-step is to determine the remainder of the intermediate floating-point value and the precision value included in the target mapping information as the mantissa value of the floating-point number.

[0054] The sixth sub-step is to determine the floating-point video frame according to the exponent value and the floating-point mantissa value. In practice, the floating-point video frame can be determined by the following formula: .

[0055] in, Represents a floating point video frame. Indicates the exponential value. Represents the mantissa value of a floating point number. Indicates the starting floating-point value.

[0056] The first to sixth substeps described above, as an inventive feature of an embodiment of the present disclosure, address the third technical issue mentioned in the background technology: "When floating-point numbers are used to represent pixels, the IEEE 754 standard is typically used. However, the difference between two values ​​in an image captured by an image sensor is 1, and the maximum precision is limited, so there are no complex numbers. Therefore, when using the IEEE 754 standard, the computational complexity is high, and it takes a long time to convert the image to floating-point numbers." The reason for the long time required to convert the image to floating-point numbers is as follows: When floating-point numbers are used to represent pixels, the IEEE 754 standard is typically used. However, the difference between two values ​​in an image captured by an image sensor is 1, and the maximum precision is limited, so there are no complex numbers. Therefore, when using the IEEE 754 standard, the computational complexity is high, and it takes a long time to convert the image to floating-point numbers. If these factors are resolved, the time required to convert the image to floating-point numbers can be reduced. To achieve this, the present disclosure first truncates the video frame to be encoded based on the pixel reduction value to generate a truncated video frame. This allows the image to be truncated. Second, based on the truncated video frame, the floating-point range mapping information corresponding to the truncated video frame is selected from the floating-point range mapping information set as the target mapping information. Thus, the floating-point range mapping information of the image can be determined. Third, based on the target mapping information, the exponent value and multiplier value corresponding to the truncated video frame are determined; the difference between the truncated video frame and the starting floating-point value included in the target mapping information is determined as the floating-point intermediate value. Thus, the intermediate value can be determined. Fourth, the remainder of the floating-point intermediate value and the precision value included in the target mapping information is determined as the floating-point mantissa value. Thus, the mantissa of the floating-point number can be determined, avoiding image distortion caused by different values ​​after conversion to floating-point numbers. Fifth, based on the exponent value and the floating-point mantissa value, a floating-point video frame is determined. Thus, the fixed-point image is converted into a custom floating-point number, thereby reducing the time required to convert the image to floating-point numbers.

[0057] Step 104: Input the floating-point video frame into a custom encoder included in the encoding terminal to obtain a video frame code stream.

[0058] In some embodiments, the execution entity may input the floating-point video frame into a custom encoder included in the encoding terminal to obtain a video frame code stream.

[0059] In practice, the video frame stream can be obtained by following the steps below:

[0060] In the first step, the floating-point video frame is divided to generate a plurality of pixel blocks.

[0061] The second step is to generate a residual correction value corresponding to each floating-point range mapping information in the floating-point range mapping information set based on the floating-point video frame's floating-point range mapping information set and the correction value generation model. In practice, each floating-point range mapping information can be input into the correction value generation model to obtain the residual correction value corresponding to the floating-point range mapping information. As an example, the correction value generation model can be a VGG network.

[0062] In the third step, for each preset coding information in the preset coding information set, perform the following coding steps:

[0063] In the first encoding step, for each pixel block in the plurality of pixel blocks, the following correction steps are performed:

[0064] The first correction step is to determine the residual value corresponding to the pixel block.

[0065] The second correction step is to correct the residual value according to the residual correction value corresponding to the pixel block to generate a corrected residual value.

[0066] In the second encoding step, a rate-distortion optimization value is determined based on the generated corrected residual values ​​and the codeword length.

[0067] In the fourth step, a target rate-distortion optimization value is selected from the determined rate-distortion optimization values, and the floating-point video frame is encoded according to preset encoding information corresponding to the target rate-distortion optimization value to generate a video frame code stream.

[0068] Step 105 : In response to receiving the video frame code stream, the custom decoder included in the decoding terminal decodes the video frame code stream to generate decoded video frames.

[0069] In some embodiments, the execution entity may, in response to receiving the video frame code stream, decode the video frame code stream using a custom decoder included in the decoding terminal to generate decoded video frames. In practice, the video frame code stream may be decoded using an inverse encoding process to generate decoded video frames.

[0070] Step 106: Control the driver included in the decoding terminal to perform conversion processing on the decoded video frame to generate a converted video frame.

[0071] In some embodiments, the execution entity may control a driver included in the decoding terminal to perform conversion processing on the decoded video frame to generate a converted video frame, wherein the conversion processing may be converting the decoded video frame of floating-point type into the converted video frame of fixed-point type.

[0072] Step 107: Control the display included in the decoding terminal to display the converted video frame.

[0073] In some embodiments, the execution entity may control a display included in the decoding terminal to display the converted video frame.

[0074] The above-described embodiments of the present disclosure have the following advantageous effects: The image encoding and decoding methods of some embodiments of the present disclosure avoid transmitted image distortion. Specifically, the cause of transmitted image distortion is that bit depth represents the amount of color information used by each pixel in an image. Reducing the bit depth is a nonlinear transformation, which results in transmitted image distortion. Based on this, the image encoding and decoding methods of some embodiments of the present disclosure first control the image sensor to capture the video frame to be encoded. This allows the image sensor to acquire the image to be transmitted. Next, the video frame to be encoded is transmitted to the encoding terminal. This allows the image to be processed. Then, the image processor included in the encoding terminal is controlled to perform floating-point conversion on the video frame to generate a floating-point video frame. This converts an integer image into a floating-point number. The floating-point video frame is then input into a custom encoder included in the encoding terminal to generate a video frame stream. This allows the floating-point video frame to be encoded to generate a stream. Finally, in response to receiving the video frame stream, the custom decoder included in the decoding terminal decodes the video frame stream to generate a decoded video frame. Thus, decoding can be performed according to the inverse process of the encoding terminal, outputting a floating-point image. Subsequently, the driver included in the decoding terminal is controlled to convert the decoded video frame to generate a converted video frame. This allows the floating-point image to be converted into a fixed-point format supported by the display device. Finally, the display included in the decoding terminal is controlled to display the converted video frame. This completes the encoding and decoding of the image. By converting the fixed-point image into a floating-point number, the image can be fully encoded and decoded, thereby avoiding image distortion during transmission.

[0075] Further references Figure 2 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of an image encoding and decoding device. These device embodiments are similar to Figure 1 Corresponding to the method embodiments shown, the image encoding and decoding device can be specifically applied to various electronic devices.

[0076] like Figure 2As shown, the image encoding and decoding apparatus 200 of some embodiments includes: a first control unit 201 , a transmission unit 202 , a second control unit 203 , an input unit 204 , a decoding unit 205 , a third control unit 206 and a fourth control unit 207 . Among them, the first control unit 201 is configured to control the above-mentioned image sensor to collect the video frame to be encoded, wherein the data type of the above-mentioned video frame to be encoded is a fixed-point number; the transmission unit 202 is configured to transmit the above-mentioned video frame to be encoded to the above-mentioned encoding terminal; the second control unit 203 is configured to control the image processor included in the above-mentioned encoding terminal to perform floating-point conversion processing on the above-mentioned video frame to generate a floating-point video frame; the input unit 204 is configured to input the above-mentioned floating-point video frame into the custom encoder included in the above-mentioned encoding terminal to obtain a video frame code stream; the decoding unit 205 is configured to, in response to receiving the above-mentioned video frame code stream, decode the above-mentioned video frame code stream by the custom decoder included in the above-mentioned decoding terminal to generate a decoded video frame; the third control unit 206 is configured to control the driver included in the above-mentioned decoding terminal to convert the above-mentioned decoded video frame to generate a converted video frame; the fourth control unit 207 is configured to control the display included in the above-mentioned decoding terminal to display the above-mentioned converted video frame.

[0077] It is understandable that the units described in the image encoding and decoding device 200 are similar to those in the reference Figure 1 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the image coding and decoding device 200 and the units included therein, and will not be described in detail here.

[0078] Reference below Figure 3 , which shows a schematic structural diagram of an electronic device 300 suitable for implementing some embodiments of the present disclosure. The electronic devices in some embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0079] like Figure 3As shown, electronic device 300 may include a processing device 301 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 302 or programs loaded from a storage device 308 into a random access memory (RAM) 303. RAM 303 also stores various programs and data required for the operation of electronic device 300. Processing device 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to bus 304.

[0080] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Figure 3 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead. Figure 3 Each block shown in the figure may represent one device, or may represent multiple devices as needed.

[0081] In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from a network via the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of some embodiments of the present disclosure are performed.

[0082] It should be noted that the computer-readable medium described in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable storage media may include, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component. Furthermore, in some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wire, optical cable, RF (radio frequency), or any suitable combination thereof.

[0083] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.

[0084] The computer-readable medium may be included in the electronic device, or may exist independently and not incorporated into the electronic device. The computer-readable medium carries one or more programs. When executed by the electronic device, the one or more programs cause the electronic device to: control the image sensor to capture video frames to be encoded, wherein the data type of the video frames to be encoded is fixed-point. Transmit the video frames to be encoded to the encoding terminal. Control the image processor included in the encoding terminal to perform floating-point conversion on the video frames to generate floating-point video frames. Input the floating-point video frames into a custom encoder included in the encoding terminal to obtain a video frame stream. In response to receiving the video frame stream, the custom decoder included in the decoding terminal decodes the video frame stream to generate decoded video frames. Control the driver included in the decoding terminal to convert the decoded video frames to generate converted video frames. Control the display included in the decoding terminal to display the converted video frames.

[0085] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0086] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0087] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor. For example, they may be described as follows: a processor includes a first control unit, a transmission unit, a second control unit, an input unit, a decoding unit, a third control unit, and a fourth control unit. The names of these units do not, in some cases, constitute limitations on the units themselves. For example, the first control unit may also be described as a "unit that controls the above-mentioned image sensor to capture the video frames to be encoded."

[0088] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0089] The above descriptions are merely some preferred embodiments of the present disclosure and illustrate the underlying technical principles. Those skilled in the art should understand that the scope of the invention encompassed by the embodiments of the present disclosure is not limited to technical solutions formed by specific combinations of the aforementioned technical features. It also encompasses other technical solutions formed by any combination of the aforementioned technical features or their equivalents, without departing from the aforementioned inventive concept. For example, a technical solution formed by replacing the aforementioned features with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. An image encoding and decoding method is applied to a video acquisition system, the video acquisition system comprising: An image sensor, an encoding terminal and a decoding terminal, wherein the encoding terminal includes an image processor and a custom encoder, and the decoding terminal includes a custom decoder, a driver and a display. The method includes: Controlling the image sensor to collect a video frame to be encoded, wherein the data type of the video frame to be encoded is a fixed-point number; Transmitting the to-be-encoded video frame to the encoding terminal; Controlling the image processor included in the encoding terminal to perform floating point conversion processing on the to-be-encoded video frame to generate a floating point video frame; Inputting the floating point video frame into a custom encoder included in the encoding terminal to obtain a video frame code stream; In response to receiving the video frame code stream, the custom decoder included in the decoding terminal decodes the video frame code stream to generate a decoded video frame; Controlling a driver included in the decoding terminal to perform conversion processing on the decoded video frame to generate a converted video frame; Controlling a display included in the decoding terminal to display the converted video frame; Wherein, the video frame to be encoded corresponds to a bit depth value; And the controlling the image processor included in the encoding terminal to perform floating point conversion processing on the video frame to be encoded to generate a floating point video frame includes: Acquire sensor information corresponding to the image sensor, wherein the sensor information includes a maximum bit depth value; Determine a floating point range mapping information set according to a maximum bit depth value included in the sensor information and a bit depth value corresponding to the to-be-encoded video frame; In response to the to-be-encoded video frame not being the first video frame, determining a pixel reduction value corresponding to the to-be-encoded video frame; According to the pixel reduction value and the floating point range mapping information set, the to-be-encoded video frame is subjected to floating point conversion processing to generate a floating point video frame; The pixel reduction value is generated by the following generation steps: Performing a histogram arrangement on each pixel included in the previous video frame to generate a pixel histogram; Determining a minimum pixel value and a preset step size set according to the pixel histogram; Determine the previous frame floating point range mapping information corresponding to the previous frame of video; For each preset step size in the preset step size set, the following processing steps are performed: Selecting a floating point number range of a previous frame from the floating point number range mapping information of the previous frame, and selecting at least one floating point number node from the floating point number range of the previous frame according to a preset step size as a target floating point number node; For each of the selected target floating-point number nodes, determining a precision loss value corresponding to the target floating-point number node; For each floating-point number sub-range in each floating-point number sub-range divided by each selected target floating-point number node in the floating-point number range of the previous frame, multiplying the number of pixel points corresponding to the floating-point number sub-range in the pixel histogram by the corresponding precision loss value to determine the pixel loss value; The sum of the generated pixel loss values ​​is determined as the total pixel loss value; A total pixel loss value that meets a preset condition is selected from the determined total pixel loss values ​​as a target pixel loss value, and a preset step length corresponding to the target pixel loss value is determined as a pixel reduction value.

2. The method according to claim 1, wherein: The performing floating point conversion processing on the to-be-encoded video frame according to the pixel reduction value and the floating point range mapping information set to generate a floating point video frame includes: According to the pixel reduction value, truncating the to-be-encoded video frame to generate a truncated video frame; According to the truncated video frame, selecting the floating point range mapping information corresponding to the truncated video frame from the floating point range mapping information set as the target mapping information; Determining, according to the target mapping information, an exponent value and a multiplier value corresponding to the truncated video frame; Determine the difference between the truncated video frame and the starting floating-point value included in the target mapping information as a floating-point intermediate value; Determine the remainder of the floating-point intermediate value and the precision value included in the target mapping information as the floating-point mantissa value; A floating point video frame is determined according to the exponent value and the floating point mantissa value.

3. The method according to claim 1, wherein: The step of inputting the floating point video frame into a custom encoder included in the encoding terminal to obtain a video frame code stream includes: Dividing the floating point video frame to generate a plurality of pixel blocks; Generate a residual correction value corresponding to each floating-point range mapping information in the floating-point range mapping information set according to the floating-point range mapping information set corresponding to the floating-point video frame and a correction value generation model; For each preset coding information in the preset coding information set, the following coding steps are performed: For each pixel block in the plurality of pixel blocks, the following correction steps are performed: Determine a residual value corresponding to the pixel block; According to the residual correction value corresponding to the pixel block, the residual value is corrected to generate a corrected residual value; Determining a rate-distortion optimization value based on each generated modified residual value and codeword length; A target rate-distortion optimization value is selected from the determined rate-distortion optimization values, and the floating-point video frame is encoded according to preset encoding information corresponding to the target rate-distortion optimization value to generate a video frame code stream.

4. The method according to claim 3, wherein: The correction value generation model is obtained by training through the following steps: Acquire a sample set, wherein the samples in the sample set include sample floating point range mapping information and sample residual correction values ​​corresponding to the sample floating point range mapping information; Selecting a sample from the sample set; Inputting the sample into the initial network model to obtain a residual correction value corresponding to the sample; Determine a loss value between a residual correction value corresponding to the sample and a sample residual correction value included in the sample; In response to the loss value being greater than or equal to a preset threshold, adjusting the network parameters of the initial network model.

5. The method according to claim 4, wherein: The method further comprises: In response to the loss value being less than the preset threshold, the initial network model is determined as a correction value generation model.

6. The image coding and decoding device corresponding to the image coding and decoding method according to any one of claims 1 to 5, comprising: A first control unit is configured to control the image sensor to collect a video frame to be encoded, wherein the data type of the video frame to be encoded is a fixed-point number; A transmission unit, configured to transmit the to-be-encoded video frame to the encoding terminal; A second control unit is configured to control the image processor included in the encoding terminal to perform floating point conversion processing on the video frame to be encoded to generate a floating point video frame; An input unit, configured to input the floating point video frame into a custom encoder included in the encoding terminal to obtain a video frame code stream; A decoding unit, configured to, in response to receiving the video frame code stream, decode the video frame code stream with a custom decoder included in the decoding terminal to generate a decoded video frame; A third control unit is configured to control a driver included in the decoding terminal to perform conversion processing on the decoded video frame to generate a converted video frame; a fourth control unit, configured to control a display included in the decoding terminal to display the converted video frame; Wherein, the video frame to be encoded corresponds to a bit depth value; And the controlling the image processor included in the encoding terminal to perform floating point conversion processing on the video frame to be encoded to generate a floating point video frame includes: Acquire sensor information corresponding to the image sensor, wherein the sensor information includes a maximum bit depth value; Determine a floating point range mapping information set according to a maximum bit depth value included in the sensor information and a bit depth value corresponding to the to-be-encoded video frame; In response to the to-be-encoded video frame not being the first video frame, determining a pixel reduction value corresponding to the to-be-encoded video frame; According to the pixel reduction value and the floating point range mapping information set, the to-be-encoded video frame is subjected to floating point conversion processing to generate a floating point video frame; The pixel reduction value is generated by the following generation steps: Performing a histogram arrangement on each pixel included in the previous video frame to generate a pixel histogram; Determining a minimum pixel value and a preset step size set according to the pixel histogram; Determine the previous frame floating point range mapping information corresponding to the previous frame of video; For each preset step size in the preset step size set, the following processing steps are performed: Selecting a floating point number range of a previous frame from the floating point number range mapping information of the previous frame, and selecting at least one floating point number node from the floating point number range of the previous frame according to a preset step size as a target floating point number node; For each of the selected target floating-point number nodes, determining a precision loss value corresponding to the target floating-point number node; For each floating-point number sub-range in each floating-point number sub-range divided by each selected target floating-point number node in the floating-point number range of the previous frame, multiplying the number of pixel points corresponding to the floating-point number sub-range in the pixel histogram by the corresponding precision loss value to determine the pixel loss value; The sum of the generated pixel loss values ​​is determined as the total pixel loss value; A total pixel loss value that meets a preset condition is selected from the determined total pixel loss values ​​as a target pixel loss value, and a preset step length corresponding to the target pixel loss value is determined as a pixel reduction value.

7. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

8. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.