WO2023230933A1 - Image compression method and apparatus, electronic device, chip and storage medium - Google Patents

Image compression method and apparatus, electronic device, chip and storage medium Download PDF

Info

Publication number
WO2023230933A1
WO2023230933A1 PCT/CN2022/096492 CN2022096492W WO2023230933A1 WO 2023230933 A1 WO2023230933 A1 WO 2023230933A1 CN 2022096492 W CN2022096492 W CN 2022096492W WO 2023230933 A1 WO2023230933 A1 WO 2023230933A1
Authority
WO
WIPO (PCT)
Prior art keywords
code rate
scan line
current
line
compression parameters
Prior art date
Application number
PCT/CN2022/096492
Other languages
French (fr)
Chinese (zh)
Inventor
李慧超
马昊辰
Original Assignee
上海玄戒技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海玄戒技术有限公司 filed Critical 上海玄戒技术有限公司
Priority to CN202280004643.6A priority Critical patent/CN116438794B/en
Priority to PCT/CN2022/096492 priority patent/WO2023230933A1/en
Publication of WO2023230933A1 publication Critical patent/WO2023230933A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output

Definitions

  • the present disclosure relates to the field of image compression technology, and in particular, to an image compression method, device, electronic equipment, chip and storage medium.
  • image compression methods based on the JPEG-LS standard require residual prediction of pixels to be compressed in adjacent scan lines based on the compression state of the current scan line, and residual prediction of the pixels to be compressed. The difference is quantized to encode and compress the quantized residual.
  • the present disclosure provides an image compression method, device, electronic equipment, chip and storage medium to at least solve the technical problems existing in the related technology.
  • an image compression method includes:
  • the predicted code rate represents the compression parameters for the next scan based on the compression parameters corresponding to the current scan line. After the last scan line of the image is compressed, the final code rate of the image;
  • the pixel data of the next scanning line is compressed.
  • determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line includes:
  • the compression parameter of the current scan line is reduced to obtain the compression parameter of the next scan line.
  • determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line includes:
  • the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
  • the method before determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line, the method further includes:
  • Determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
  • the compression parameters of the next scan line are determined.
  • the upper limit of the current code rate range is adjusted based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line, include:
  • the method further includes:
  • the method before determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line, the method further includes:
  • the upper limit of the current code rate range is adjusted according to the attenuation factor corresponding to the current scan line.
  • the attenuation factor is used to control the upper limit of the code rate to converge to the set target.
  • Determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
  • the compression parameters of the next scan line are determined.
  • the method further includes:
  • the second line number threshold is obtained based on the total number of lines and the first proportional coefficient
  • the second preset line value is determined as the second line number threshold.
  • the method further includes:
  • the attenuation factor is determined according to the current scan line number and the second line number threshold.
  • determining the attenuation factor based on the current number of scanning lines and the second set threshold includes:
  • the attenuation factor is obtained according to the current scanning line number and the corresponding relationship.
  • the method further includes:
  • the code rate range is determined according to the set target code rate and the set range coefficient.
  • an image compression device includes:
  • Parameter acquisition module used to obtain the compression parameters and code stream length of the current scan line, as well as the total length of the code stream from the first line to the current scan line;
  • Code rate prediction module used to determine the predicted code rate of the current scan line based on the code stream length of the current scan line and the total length of the code stream from the first line to the current scan line.
  • the predicted code rate representation is based on the current scan line correspondence.
  • Parameter determination module used to determine the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line;
  • Compression module used to compress the pixel data of the next scanning line according to the compression parameters of the next scanning line.
  • the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
  • the compression parameter of the current scan line is reduced to obtain the compression parameter of the next scan line.
  • the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
  • the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
  • the device before the parameter determination module determines the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, the device further includes a range adjustment Module for:
  • the parameter determination module is specifically used to:
  • the compression parameters of the next scan line are determined.
  • the parameter determination module determines the current code rate range based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line. During the upper limit adjustment process, it is specifically used for:
  • the device further includes a range limiting module for:
  • the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
  • the upper limit of the current code rate range is adjusted according to the attenuation factor corresponding to the current scan line.
  • the attenuation factor is used to control the upper limit of the code rate to converge to the set target.
  • the parameter determination module is specifically used to:
  • the compression parameters of the next scan line are determined.
  • the device further includes a second row number threshold determination module, used for:
  • the second line number threshold is obtained based on the total number of lines and the first proportional coefficient
  • the second preset line value is determined as the second line number threshold.
  • the device further includes an attenuation factor determination module for:
  • the attenuation factor is determined according to the current scan line number and the second line number threshold.
  • the attenuation factor determination module is specifically used in the process of determining the attenuation factor based on the current scan line number and the second line number threshold:
  • the attenuation factor is obtained according to the current scanning line number and the corresponding relationship.
  • the device further includes a range determination module for:
  • the code rate range is determined according to the set target code rate and the set range coefficient.
  • an electronic device including:
  • Memory for storing instructions executable by the processor
  • the processor is configured to execute executable instructions in the memory to implement the steps of the method described in any embodiment of the first aspect.
  • a computer-readable storage medium on which a computer program is stored.
  • the program is executed by a processor, the steps of the method described in any embodiment of the first aspect are implemented.
  • a chip including:
  • One or more interface circuits and one or more processors are configured to receive signals from the memory of the electronic device and send the signals to the processor, where the signals include computer instructions stored in the memory;
  • the processor executes the computer instructions, the electronic device is caused to execute the image compression method described in any embodiment of the first aspect.
  • the predicted code rate of the entire image after compressing the remaining scan lines with the current compression parameters is obtained, and by setting the code rate range and combining the predicted code rate to adjust the compression parameters of the next scan line, so that each scan
  • Each row can adjust the compression parameters of the next scanned row in time, so that the code rate after compression based on the compression parameters is controlled within the code rate range. It avoids relying on empirical information to control compression parameters, reduces code rate fluctuations, makes compression losses even and controllable, and improves the lossless probability of the entire image. In addition, since no complex calculation process is involved, the computing pressure on the device can be reduced.
  • Figure 1 is a flow chart of an image compression method according to an exemplary embodiment of the present disclosure
  • Figure 2 is a flow chart of compression parameter adjustment according to an exemplary embodiment of the present disclosure
  • Figure 3 is a flow chart of determining a second row number threshold according to an exemplary embodiment of the present disclosure
  • Figure 4 is a comparison diagram of image compression effects according to an exemplary embodiment of the present disclosure.
  • Figure 5 is a schematic diagram of an image compression device according to an exemplary embodiment of the present disclosure.
  • FIG. 6 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
  • first, second, third, etc. may be used in this disclosure to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other.
  • first information may also be called second information, and similarly, the second information may also be called first information.
  • word “if” as used herein may be interpreted as "when” or “when” or “in response to determining.”
  • Figure 1 shows a flow chart of an image compression method according to an exemplary embodiment of the present disclosure.
  • step S101 the compression parameters and code stream length of the current scanning line are obtained, as well as the total length of the code stream from the first line to the current scanning line.
  • the compression parameters are used to reflect the degree of compression of the image, and are negatively correlated with the code stream length and code rate of the compressed scan lines.
  • the current scan line compress the pixels of the current scan line of the image using the current compression parameters to obtain the compressed code stream length of the current scan line.
  • the image is compressed using the compression parameters corresponding to each line to obtain the total length of the code stream from the first line to the current scanning line.
  • the quantized prediction residual is encoded by a Golomb encoder, and the compression parameters can be characterized by the quantization step size.
  • a large quantization step indicates a high degree of compression for the current scan line, and a small quantization step indicates a low degree of compression for the current scan line.
  • the length of the code stream compressed by a larger quantization step is smaller.
  • step S102 the predicted code rate of the current scan line is determined based on the code stream length of the current scan line and the total length of the code stream from the first line to the current scan line.
  • the predicted code rate represents the compression corresponding to the current scan line.
  • the parameter is the final code rate of the image after compression from the next scan line to the last scan line of the image.
  • the code stream length of the current scan line and the total length of the code stream from the first line to the current scan line are used to represent the compression status of the current scan line and all historical scan lines.
  • the predicted code rate is based on the compression status of the current scan line and the final code rate of the entire image after the remaining scan lines are compressed with the current compression parameters.
  • the predicted code rate can be determined by formula (1):
  • p represents the predicted code rate
  • H represents the total number of lines of the image
  • h represents the number of currently scanned lines, which can be obtained through the current row index
  • Hh represents the number of remaining unscanned lines of the image
  • b line represents the current scanned line.
  • the length of the code stream, b total represents the total length of the code stream from the first line to the current scanning line.
  • the numerator part of formula (1) represents the final code stream length of the entire image after compressing the remaining scan lines based on the current compression parameters.
  • H and W represent the number of pixels in the image based on height and width respectively, and P represents the bit width of the image, which is used to represent the amount of information in each pixel in the image.
  • the denominator part in formula (1) represents the total information amount of the image.
  • the predicted code rate can be obtained by calculating the proportion of the predicted code stream length to the total amount of information in the image.
  • step S103 the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
  • the code rate range is used to limit the fluctuation degree of the predicted code rate, which can be determined by setting a target code rate of the image or multiple experiments.
  • the code rate range may include an upper limit and/or a lower limit of the predicted code rate.
  • the predicted code rate can be increased or reduced by adjusting the compression parameters of the next scan line so that the predicted code rate returns to the code rate. rate range.
  • step S104 the pixel data of the next scanning line is compressed according to the compression parameter of the next scanning line.
  • the compression encoding can be controlled by adjusting the compression parameters of the next scanning line to encode and compress the pixels of the next scanning line.
  • the quantized prediction residual can be encoded by the Golomb encoder based on the adjusted quantization step size.
  • the scheme described in this disclosure obtains the predicted code rate of the entire image after compressing the remaining scan lines with the current compression parameters based on the compression status of the current scan line, and adjusts the code rate of the next scan line by setting the code rate range and combining it with the predicted code rate.
  • Compression parameters enable each scan line to adjust the compression parameters of the next scan line in time, so that the code rate after compression based on the compression parameters is controlled within the code rate range. It avoids relying on empirical information or the content characteristics of the image itself to control compression parameters, reduces code rate fluctuations, makes compression losses uniform and controllable, and improves the lossless probability of the entire image. In addition, since no complex calculation process is involved, the computing pressure on the device can be reduced.
  • determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line includes:
  • the compression parameter of the current scan line is reduced to obtain the compression parameter of the next scan line.
  • the predicted code rate of the current scan line exceeds the upper limit of the code rate, which means that the compression degree of the current scan line is too small.
  • You can increase the compression parameter of the next scan line that is, increase the compression degree of the next scan line, to reduce Lower the code rate of the next scan line so that the code rate during the compression of the next scan line does not exceed the upper limit of the code rate.
  • the predicted code rate of the current scan line is lower than the lower limit of the code rate, it means that the compression degree of the current scan line is too large. You can reduce the compression parameter of the next scan line, that is, reduce the compression degree of the next scan line.
  • the code rate of the next scan line is increased so that the code rate during the compression of the next scan line is not lower than the lower limit of the code rate.
  • Figure 2 shows a compression parameter adjustment flow chart disclosed in this application according to an exemplary embodiment.
  • step S201 it is determined whether the predicted code rate is greater than the upper limit of the code rate.
  • step S202 when the predicted code rate is greater than the upper code rate limit, it may be determined whether the current compression parameter is greater than the compression parameter threshold to determine whether the current compression process is in a regular compression mode.
  • the compression parameter threshold can be set to 15.
  • step S203 when the current compression process is in the normal compression mode, the compression parameters are increased.
  • step S204 it is determined whether the predicted code rate is less than the lower limit of the code rate.
  • step S205 when the predicted code rate is less than the lower limit of the code rate, it can be determined whether the current compression parameter is less than 0 to determine whether the current compression process is in the compression process, that is, whether the current compression process is in the conventional compression process. model.
  • step S206 if the current compression process is in the normal compression mode, the compression parameters are reduced.
  • step S207 if the predicted code rate is within the code rate range, the current compression parameters may be maintained.
  • the method of maintaining the current compression parameters can also be used to wait for further processing.
  • the compression parameter can be increased by adding 1 to the compression parameter and decreased by decrementing the compression parameter by 1 to ensure that the compression parameter variation of adjacent scan lines is controlled at 1 or 0. , to avoid obvious compression losses in the compressed image due to sudden increases or decreases in compression parameters, thereby ensuring uniform compression intensity in the image.
  • the scheme described in this disclosure adjusts the compression parameters in time by comparing the predicted code rate of the current scan line with the code rate range so that the code rate of the next scan line is controlled within the code rate range. At the same time, by limiting the compression parameters every The amount of adjustment is to avoid obvious compression loss in the compressed image, thereby ensuring uniform compression intensity in the image.
  • determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line includes:
  • the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
  • the code rate of different scanning lines of the image is due to the excessive complexity of the image, Due to large fluctuations due to objective reasons, selecting a bit rate range that is too small may cause the compression process to fail to operate normally. Therefore, before determining the bit rate range, scan lines before the first line number threshold can be scanned. For compression limited by a code rate range, the code rate range is determined based on the compression state of the image. In one example, the first line number threshold is 10.
  • the code rate range is determined according to the set target code rate and the set range coefficient.
  • the set target bit rate represents the final bit rate that the user hopes to compress the current image.
  • the set range coefficient may be determined based on the compression state of the scan lines before the first line number threshold. For example, a set target code rate of 110% is determined as the upper limit of the code rate, and a set code rate range of 95% is determined as the lower limit of the code rate to ensure that the code rate during the image compression process always surrounds the set code rate. Target code rate fluctuations.
  • the scheme described in this disclosure first performs compression without code rate range restrictions on the first line number threshold and the scanning lines before it, and then determines the code rate range according to the compression state of the image to ensure the compression range. Choose wisely.
  • the code rate range is determined according to the target set code rate and the range coefficient to ensure that the code rate during the image compression process always fluctuates around the set target code rate.
  • the method before determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line, the method further includes:
  • Determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
  • the compression parameters of the next scan line are determined.
  • the prediction of at least two scan lines before the current scan line can be used.
  • the code rate and the predicted code rate of the current scan line are obtained, the predicted code rate change trend of the most recent scan lines is obtained, and the code rate range is adaptively adjusted according to the change trend.
  • specific code rate range adjustment methods include:
  • the overall predicted code rate changes as the number of lines increases, usually showing a W-type or M-type, that is, the prediction at the Nth scanning line
  • the predicted code rate of the N+1th scan line is greater than the predicted code rate of the adjacent scan line.
  • the most recent scan can be determined by the change trend of the predicted code rate of the adjacent scan lines. Part of the code rate change trend.
  • the two predicted code rates corresponding to the current scanning line and its two preceding lines can be determined as the to-be-detected Predicted code rate; when determining the predicted code rate to be detected based on the current scanning line and its first five scanning lines, the current scanning line and the three predictions corresponding to the first two lines and the first four lines can be The code rate is determined as the predicted code rate to be detected, or the three predicted code rates corresponding to the first row, the first three rows and the first five rows from the current scan line are determined as the predicted code rate to be detected, and the code rate is determined according to the predicted code rate to be detected.
  • the increase or decrease trend of the predicted code rate is detected to determine the adjustment method for the upper limit of the code rate.
  • the predicted code rates corresponding to the first five scan lines adjacent to the current scan line can be fixedly determined as the predicted code rate to be detected, and after the scanning compression of the current scan line is completed, the code rate can be automatically moved to the next line.
  • the predicted code rates corresponding to the first five scan lines of the next scan line are determined as the predicted code rates to be detected.
  • the scheme described in this disclosure adaptively adjusts the code rate range according to the code rate change trend of the most recent scan lines, so that during the compression process, more code stream lengths are allocated in complex texture areas and less code stream lengths are allocated in simple texture areas.
  • the length of the code stream reduces the bit rate oscillation during the encoding process, thereby achieving a reasonable distribution of the code stream during the encoding process and achieving a uniform and excessive effect of reconstructed image quality.
  • the method further includes:
  • the code rate range can be adaptively adjusted according to the code rate change trend of the most recent scan lines
  • the degree of adaptive adjustment of the code rate range should still be limited to a certain extent to avoid the code rate upper limit.
  • Unlimited raising or lowering You can limit the number of increases or decreases in the code rate upper limit by setting a threshold for increases and decreases, or you can also set an increase or decrease range value isomorphically to control the specific value of the upper limit of the code rate to remain within an appropriate range.
  • the upper limit of the code rate can be adjusted by increasing or decreasing the upper limit of the code rate by 5%, and the result of the increase or decrease in the upper limit of the code rate is marked by the flag bit f. After the upper limit is increased, f is marked as true. After the upper limit is lowered, f is marked as false, so that the upper limit of the code rate cannot be continuously increased or decreased, and can only be adjusted within the range of ⁇ 5%.
  • the conditions for increasing and decreasing the code rate upper limit can be expressed by formula (2) and formula (3) respectively.
  • P0-P4 represents the predicted code rate corresponding to the five historical scan lines adjacent to the current scan line
  • p represents the predicted code rate of the current scan line
  • rt represents the set target code rate
  • l represents the upper limit distance of 100%.
  • the triggering conditions for increasing or decreasing the upper limit of the code rate can be further refined through the difference between the predicted code rate of the current scan line and the set target code rate or the difference between the predicted code rate to be detected.
  • the solution described in this disclosure limits the number of increases or decreases in the upper code rate by setting a threshold for the number of increases and a threshold for the number of decreases, or by using a range value to keep the specific value of the upper limit of the code rate within an appropriate range to avoid During the adaptive adjustment process of the upper limit of the code rate, the upper limit of the code rate can increase or decrease without restriction.
  • the method before determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line, the method further includes:
  • the current upper limit of the code rate range is adjusted according to the attenuation factor corresponding to the current scan line.
  • the attenuation factor is used to control the upper limit of the code rate to converge to the set target code. Rate;
  • Determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
  • the compression parameters of the next scan line are determined.
  • the final compression code rate in the entire image compression process is constrained by gradually converging the upper limit of the code rate to the set target code rate.
  • the attenuation factor is used to control the upper limit of the code rate to converge to a set target code rate.
  • the second line number threshold represents the attenuation starting point in the image scanning and compression process. If the code rate upper limit passes through the adaptive adjustment stage before the attenuation starting point, the code rate upper limit is reset at the attenuation starting point. is the initial upper limit, such as the upper limit of the code rate corresponding to the next scan line of the first line number threshold.
  • the method further includes:
  • the attenuation factor is determined according to the current scan line number and the second line number threshold.
  • the attenuation factor can be determined through formula (4):
  • decay represents the attenuation factor
  • h represents the number of lines currently scanned
  • h st represents the second line number threshold, that is, the number of lines from which the attenuation starts. Therefore, the attenuation factor can be expressed by an exponential function with a as the base and the cumulative number of rows after the attenuation starting point as the power.
  • the upper limit of the code rate gradually converges to the set target code rate, so as to constrain the final compression code rate in the entire image compression process.
  • determining the attenuation factor based on the current number of scanning lines and the second set threshold includes:
  • the attenuation factor is obtained according to the current scanning line number and the corresponding relationship.
  • the attenuation factor corresponding to each scan line can be obtained by looking up the table. If the table is too large and difficult to obtain, jump point sampling can be performed by setting the step size. Points within the step size range can be calculated through the look-ahead difference between two table lookup results that are close to the table lookup value.
  • the attenuation factor corresponding to each scanning line is directly obtained by looking up the table, so as to further reduce the computing pressure of the device.
  • the method further includes:
  • the second line number threshold is obtained based on the total number of lines and the first proportional coefficient
  • the second preset line value is determined as the second line number threshold.
  • Figure 3 discloses a second line number threshold determination flowchart according to an exemplary embodiment of the present disclosure, where H represents the total number of lines of the image, and h st represents the second line number threshold.
  • the 375th line from the bottom of the image is determined as the second line number threshold
  • the tenth line of the total number of image lines is determined as the second line number threshold. Further, in order to avoid that the upper limit of the code rate still cannot converge to the set target code rate at the end of the scan, it can be judged in the tenth line from the bottom of the image whether the convergence of the upper limit of the code rate can be completed based on the current attenuation factor. If If not, the attenuation factor is set to 0, and the set target bit rate is directly determined as the upper limit of the bit rate, so as to complete the convergence of the compression bit rate of the image in a timely manner.
  • the scanning compression process is controlled to converge on the upper limit of the code rate at an appropriate convergence starting point, so as to constrain the final result of the entire image compression process. Compression code rate.
  • FIG. 4 shows an image compression effect comparison diagram according to an exemplary embodiment of the present disclosure.
  • Figure 4 takes as an example whether the bayer image is compressed by the method described in the present disclosure, which can reflect the before and after comparison effect of whether the scheme described in the present disclosure is adopted for image compression.
  • the x-axis is the index of the number of scanning lines
  • the y-axis is the actual code rate corresponding to each scanning line.
  • the code rate oscillation during the image compression process can be significantly reduced, and the actual code rate can be converged to the target code rate faster.
  • bit rate control can be achieved for images of different types and sizes.
  • the code rate range is adaptively adjusted according to the code rate change trend of the recent scan lines, so that during the compression process, more code stream lengths are allocated in complex texture areas and more code stream lengths are allocated in simple texture areas. , Reduce the bit rate oscillation during the encoding process, thereby achieving a uniform transition of reconstructed image quality, so that the image quality can be effectively controlled.
  • the present disclosure also provides embodiments of application function implementation devices and corresponding terminals.
  • FIG. 5 A block diagram of an image compression device according to an exemplary embodiment of the present disclosure is shown in Figure 5.
  • the device includes:
  • Parameter acquisition module used to obtain the compression parameters and code stream length of the current scan line, as well as the total length of the code stream from the first line to the current scan line;
  • Code rate prediction module used to determine the predicted code rate of the current scan line based on the code stream length of the current scan line and the total length of the code stream from the first line to the current scan line.
  • the predicted code rate representation is based on the current scan.
  • the final code rate of the image after the compression parameters corresponding to the row compress the next scan line to the last scan line of the image;
  • Parameter determination module used to determine the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line;
  • Compression module configured to compress the pixel data of the next scanning line according to the compression parameters of the next scanning line.
  • the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
  • the compression parameter of the current scan line is reduced to obtain the compression parameter of the next scan line.
  • the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
  • the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
  • the device before the parameter determination module determines the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, the device further includes a range adjustment Module for:
  • the parameter determination module is specifically used to:
  • the compression parameters of the next scan line are determined.
  • the parameter determination module determines the upper limit of the current code rate range based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line. During the adjustment process, it is specifically used for:
  • the device further includes a range limiting module for:
  • the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
  • the current upper limit of the code rate range is adjusted according to the attenuation factor corresponding to the current scan line.
  • the attenuation factor is used to control the upper limit of the code rate to converge to the set target code. Rate;
  • the parameter determination module is specifically used to:
  • the compression parameters of the next scan line are determined.
  • the device further includes a second row number threshold determination module, used for:
  • the second line number threshold is obtained based on the total number of lines and the first proportional coefficient
  • the second preset line value is determined as the second line number threshold.
  • the device further includes an attenuation factor determination module for:
  • the attenuation factor is determined according to the current scan line number and the second line number threshold.
  • the attenuation factor determination module is specifically used in the process of determining the attenuation factor based on the current scan line number and the second line number threshold:
  • the attenuation factor is obtained according to the current scanning line number and the corresponding relationship.
  • the device further includes a range determination module for:
  • the code rate range is determined according to the set target code rate and the set range coefficient.
  • the device embodiment since it basically corresponds to the method embodiment, please refer to the partial description of the method embodiment for relevant details.
  • the device embodiments described above are only illustrative.
  • the units described above as separate components may or may not be physically separated.
  • the components shown as units may or may not be physical units, that is, they may be located in a place, or can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. Persons of ordinary skill in the art can understand and implement the method without any creative effort.
  • FIG. 6 shows a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
  • the device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
  • the device 600 may include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input/output (I/O) interface 612, a sensor component 614, and communications component 616.
  • Processing component 602 generally controls the overall operations of device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above method.
  • processing component 602 may include one or more modules that facilitate interaction between processing component 602 and other components.
  • processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
  • Memory 604 is configured to store various types of data to support operations at device 600 . Examples of such data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, etc.
  • Memory 604 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EEPROM erasable programmable read-only memory
  • EPROM Programmable read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory flash memory, magnetic or optical disk.
  • Power component 606 provides power to various components of device 600.
  • Power components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 600.
  • Multimedia component 608 includes a screen that provides an output interface between the device 600 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action.
  • multimedia component 608 includes a front-facing camera and/or a rear-facing camera.
  • the front camera and/or the rear camera may receive external multimedia data.
  • Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
  • Audio component 610 is configured to output and/or input audio signals.
  • audio component 610 includes a microphone (MIC) configured to receive external audio signals when device 600 is in operating modes, such as call mode, recording mode, and speech recognition mode. The received audio signal may be further stored in memory 604 or sent via communication component 616 .
  • audio component 610 includes a speaker for outputting audio signals.
  • the I/O interface 612 provides an interface between the processing component 602 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
  • Sensor component 614 includes one or more sensors for providing various aspects of status assessment for device 600 .
  • the sensor component 614 may detect the open/closed state of the device 600, the relative positioning of components, such as the display and keypad of the device 600, the sensor component 614 may detect a change in position of the device 600 or a component of the device 600, The presence or absence of user contact with the device 600, device 600 orientation or acceleration/deceleration and temperature changes of the device 600.
  • Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact.
  • Sensor assembly 614 may include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 614 may include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 616 is configured to facilitate wired or wireless communication between apparatus 600 and other devices.
  • the device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G or 5G or a combination thereof.
  • the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communications component 616 includes a near field communications (NFC) module to facilitate short-range communications.
  • NFC near field communications
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • apparatus 600 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the power supply method of the above electronic device.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable Gate array
  • controller microcontroller, microprocessor or other electronic components are implemented for executing the power supply method of the above electronic device.
  • the present disclosure provides a non-transitory computer-readable storage medium including instructions, such as a memory 604 including instructions.
  • the instructions can be executed by the processor 620 of the device 600 to complete the power supply method of the electronic device.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
  • the present disclosure also provides a chip, which specifically includes one or more interface circuits and one or more processors.
  • the interface circuit is used to receive signals from a memory of an electronic device and send the signals to the processor.
  • the signals include computer instructions stored in memory.
  • the processor executes the computer instructions, the electronic device is caused to execute the image compression method described in any one of the disclosure.
  • the chip can be a conventional CPU (central processing unit, central processing unit) chip, a GPU (graphics processing unit, graphics processor) chip, etc., or it can be an acceleration chip dedicated to artificial intelligence technology, such as AI (Artificial Intelligence). , artificial intelligence) accelerator, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

Provided in the present disclosure are an image compression method and apparatus, an electronic device, a chip and a storage medium. The method comprises: according to the data stream length of a current scanning line and the total data stream length from a first line to the current scanning line, determining a predicted data rate of the current scanning line; according to the predicted data rate, a data rate range, and compression parameters of the current scanning line, determining compression parameters of a next scanning line; and, according to the compression parameters of the next scanning line, performing compression processing on pixel data of the next scanning line. The solution of the present disclosure avoids reliance on empirical information for control of compression parameters and the data rate is limited to the data rate range, reducing data rate oscillation, allowing a more uniform compression loss, and improving the losslessness probability of a whole image. In addition, since a complex calculation process is not involved, the operation pressure of a device can be reduced.

Description

图像压缩方法、装置、电子设备、芯片及储存介质Image compression method, device, electronic equipment, chip and storage medium 技术领域Technical field
本公开涉及图像压缩技术领域,尤其涉及一种图像压缩方法、装置、电子设备、芯片及储存介质。The present disclosure relates to the field of image compression technology, and in particular, to an image compression method, device, electronic equipment, chip and storage medium.
背景技术Background technique
当前,基于JPEG-LS标准(用于连续色调图像无损压缩的静态图像压缩标准)的图像压缩方法,需要通过当前扫描行的压缩状态对邻近扫描行的待压缩像素进行残差预测,并对残差进行量化处理以对量化后的残差进行编码压缩。Currently, image compression methods based on the JPEG-LS standard (a static image compression standard for lossless compression of continuous tone images) require residual prediction of pixels to be compressed in adjacent scan lines based on the compression state of the current scan line, and residual prediction of the pixels to be compressed. The difference is quantized to encode and compress the quantized residual.
由于常规模式下,需要以经验值确定的压缩参数对图像的扫描行进行压缩编码,而由于图像中不同扫描行生成的预测残差与真实值的偏离程度不同,通过同一压缩参数进行压缩会使每一扫描行压缩后的码流长度出现无规律的波动,引起码率震荡,使图像压缩损失不均匀,难以控制图像压缩后的画质损失。Since in normal mode, the scanning lines of the image need to be compressed and encoded with compression parameters determined by empirical values, and since the prediction residuals generated by different scanning lines in the image deviate to different degrees from the real values, compression using the same compression parameters will cause The length of the compressed code stream for each scan line fluctuates irregularly, causing code rate oscillations and uneven image compression loss, making it difficult to control the image quality loss after image compression.
发明内容Contents of the invention
有鉴于此,本公开提供一种图像压缩方法、装置、电子设备、芯片及储存介质,以至少解决相关技术中存在的技术问题。In view of this, the present disclosure provides an image compression method, device, electronic equipment, chip and storage medium to at least solve the technical problems existing in the related technology.
根据本公开实施例的第一方面,提供了一种图像压缩方法,所述方法包括:According to a first aspect of an embodiment of the present disclosure, an image compression method is provided, and the method includes:
获取当前扫描行的压缩参数和码流长度,以及首行至所述当前扫描行的码流总长度;Obtain the compression parameters and code stream length of the current scan line, as well as the total length of the code stream from the first line to the current scan line;
根据当前扫描行的码流长度和首行至所述当前扫描行的码流总长度,确定当前扫描行的预测码率,所述预测码率表征基于当前扫描行对应的压缩参 数对下一个扫描行至图像最后扫描行压缩后,所述图像的最终码率;Determine the predicted code rate of the current scan line based on the code stream length of the current scan line and the total length of the code stream from the first line to the current scan line. The predicted code rate represents the compression parameters for the next scan based on the compression parameters corresponding to the current scan line. After the last scan line of the image is compressed, the final code rate of the image;
根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数;Determine the compression parameters of the next scan line according to the predicted code rate, code rate range and compression parameters of the current scan line;
根据所述下一个扫描行的压缩参数,对下一个扫描行的像素数据进行压缩处理。According to the compression parameters of the next scanning line, the pixel data of the next scanning line is compressed.
结合本公开的任一实施方式,所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:Combined with any embodiment of the present disclosure, determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line includes:
在所述当前扫描行的预测码率大于码率上限的情况下,提升所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数;和/或,When the predicted code rate of the current scan line is greater than the upper limit of the code rate, increase the compression parameters of the current scan line to obtain the compression parameters of the next scan line; and/or,
在所述当前扫描行的预测码率小于码率下限的情况下,降低所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数。When the predicted code rate of the current scan line is less than the lower limit of the code rate, the compression parameter of the current scan line is reduced to obtain the compression parameter of the next scan line.
结合本公开的任一实施方式,所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:Combined with any embodiment of the present disclosure, determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line includes:
响应于当前扫描行数大于第一行数阈值,根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。In response to the current number of scan lines being greater than the first line number threshold, the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
结合本公开的任一实施方式,在所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数之前,还包括:Combined with any embodiment of the present disclosure, before determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line, the method further includes:
响应于当前扫描行数大于所述第一行数阈值且小于等于第二行数阈值,根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,对当前的码率范围的上限进行调整;In response to the current number of scan lines being greater than the first line number threshold and less than or equal to the second line number threshold, based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line , adjust the upper limit of the current code rate range;
所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:Determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
结合本公开的任一实施方式,所述根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,对当前的码率范围的上限 进行调整,包括:In conjunction with any embodiment of the present disclosure, the upper limit of the current code rate range is adjusted based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line, include:
根据预设规则,在所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率中,选取待检测预测码率;According to preset rules, select the predicted code rate to be detected among the predicted code rates of at least two scan lines before the current scan line and the predicted code rate of the current scan line;
在所述待检测预测码率依次递增的情况下,提升所述码率上限;When the predicted code rate to be detected increases sequentially, increase the upper limit of the code rate;
在所述待检测预测码率依次递减的情况下,降低所述码率上限。When the predicted code rate to be detected decreases in sequence, the upper limit of the code rate is lowered.
结合本公开的任一实施方式,所述方法还包括:Combined with any embodiment of the present disclosure, the method further includes:
在所述码率上限的提升次数超过提升次数阈值的情况下,停止提升所述码率上限,在所述码率上限的降低次数超过降低次数阈值的情况下,停止降低所述码率上限,或;When the number of increases in the upper code rate exceeds a threshold of increase times, stop increasing the upper limit of the code rate; when the number of decreases in the upper limit of the code rate exceeds a threshold of decreases, stop lowering the upper limit of the code rate, or;
在提升后的码率上限超出提升范围阈值的情况下,停止提升当次码率上限;When the increased code rate upper limit exceeds the increase range threshold, stop increasing the current code rate upper limit;
在降低后的码率上限超出降低范围阈值的情况下,停止降低当次码率上限。When the lowered upper limit of the code rate exceeds the reduction range threshold, stop lowering the upper limit of the current bit rate.
结合本公开的任一实施方式,在所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数之前,还包括:Combined with any embodiment of the present disclosure, before determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line, the method further includes:
响应于当前扫描行数大于第二行数阈值,根据当前扫描行对应的衰减因子,对当前的码率范围的上限进行调整,所述衰减因子用于控制所述码率上限收敛至设定目标码率;In response to the current number of scan lines being greater than the second line number threshold, the upper limit of the current code rate range is adjusted according to the attenuation factor corresponding to the current scan line. The attenuation factor is used to control the upper limit of the code rate to converge to the set target. Code rate;
所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:Determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
结合本公开的任一实施方式,所述方法还包括:Combined with any embodiment of the present disclosure, the method further includes:
在当前图像的总行数大于第三行数阈值的情况下,根据所述总行数和第一比例系数,得到所述第二行数阈值;When the total number of lines of the current image is greater than the third line number threshold, the second line number threshold is obtained based on the total number of lines and the first proportional coefficient;
在图像的总行数小于第三行数阈值且大于第四行数阈值的情况下,将所 述总行数减去第一预设行数值,得到所述第二行数阈值;When the total number of rows of the image is less than the third row number threshold and greater than the fourth row number threshold, subtract the first preset row value from the total number of rows to obtain the second row number threshold;
在图像的总行数小于第四行数阈值的情况下,将第二预设行数值确定为所述第二行数阈值。When the total number of lines of the image is less than the fourth line number threshold, the second preset line value is determined as the second line number threshold.
结合本公开的任一实施方式,所述方法还包括:Combined with any embodiment of the present disclosure, the method further includes:
根据当前扫描行数和所述第二行数阈值,确定所述衰减因子。The attenuation factor is determined according to the current scan line number and the second line number threshold.
结合本公开的任一实施方式,所述根据当前扫描行数和所述第二设定阈值,确定所述衰减因子,包括:Combined with any embodiment of the present disclosure, determining the attenuation factor based on the current number of scanning lines and the second set threshold includes:
获取所述当前扫描行数和所述衰减因子的对应关系;Obtain the corresponding relationship between the current scanning line number and the attenuation factor;
根据所述当前扫描行数和所述对应关系,获取所述衰减因子。The attenuation factor is obtained according to the current scanning line number and the corresponding relationship.
结合本公开的任一实施方式,所述方法还包括:Combined with any embodiment of the present disclosure, the method further includes:
响应于当前扫描行为所述第一行数阈值对应行的下一行,根据设定目标码率和设定范围系数,确定所述码率范围。In response to a line next to the line corresponding to the first line number threshold of the current scan line, the code rate range is determined according to the set target code rate and the set range coefficient.
根据本公开实施例的第二方面,提供了一种图像压缩装置,所述装置包括:According to a second aspect of the embodiment of the present disclosure, an image compression device is provided, and the device includes:
参数获取模块:用于获取当前扫描行的压缩参数和码流长度,以及首行至所述当前扫描行的码流总长度;Parameter acquisition module: used to obtain the compression parameters and code stream length of the current scan line, as well as the total length of the code stream from the first line to the current scan line;
码率预测模块:用于根据当前扫描行的码流长度和首行至所述当前扫描行的码流总长度,确定当前扫描行的预测码率,所述预测码率表征基于当前扫描行对应的压缩参数对下一个扫描行至图像最后扫描行压缩后,所述图像的最终码率;Code rate prediction module: used to determine the predicted code rate of the current scan line based on the code stream length of the current scan line and the total length of the code stream from the first line to the current scan line. The predicted code rate representation is based on the current scan line correspondence. The final code rate of the image after compression of the next scan line to the last scan line of the image using the compression parameters;
参数确定模块:用于根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数;Parameter determination module: used to determine the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line;
压缩模块:用于根据所述下一个扫描行的压缩参数,对下一个扫描行的像素数据进行压缩处理。Compression module: used to compress the pixel data of the next scanning line according to the compression parameters of the next scanning line.
结合本公开的任一实施方式,所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体 用于:Combined with any embodiment of the present disclosure, the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
在所述当前扫描行的预测码率大于码率上限的情况下,提升所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数;和/或,When the predicted code rate of the current scan line is greater than the upper limit of the code rate, increase the compression parameters of the current scan line to obtain the compression parameters of the next scan line; and/or,
在所述当前扫描行的预测码率小于码率下限的情况下,降低所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数。When the predicted code rate of the current scan line is less than the lower limit of the code rate, the compression parameter of the current scan line is reduced to obtain the compression parameter of the next scan line.
结合本公开的任一实施方式,所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:Combined with any embodiment of the present disclosure, the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
响应于当前扫描行数大于第一行数阈值,根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。In response to the current number of scan lines being greater than the first line number threshold, the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
结合本公开的任一实施方式,所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数之前,所述装置还包括范围调整模块,用于:In connection with any embodiment of the present disclosure, before the parameter determination module determines the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, the device further includes a range adjustment Module for:
响应于当前扫描行数大于所述第一行数阈值且小于等于第二行数阈值,根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,对当前的码率范围的上限进行调整;In response to the current number of scan lines being greater than the first line number threshold and less than or equal to the second line number threshold, based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line , adjust the upper limit of the current code rate range;
所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:In the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, the parameter determination module is specifically used to:
根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
结合本公开的任一实施方式,所述参数确定模块在根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,对当前的码率范围的上限进行调整过程中,具体用于:In conjunction with any embodiment of the present disclosure, the parameter determination module determines the current code rate range based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line. During the upper limit adjustment process, it is specifically used for:
根据预设规则,在所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率中,选取待检测预测码率;According to preset rules, select the predicted code rate to be detected among the predicted code rates of at least two scan lines before the current scan line and the predicted code rate of the current scan line;
在所述待检测预测码率依次递增的情况下,提升所述码率上限;When the predicted code rate to be detected increases sequentially, increase the upper limit of the code rate;
在所述待检测预测码率依次递减的情况下,降低所述码率上限。When the predicted code rate to be detected decreases in sequence, the upper limit of the code rate is lowered.
结合本公开的任一实施方式,所述装置还包括范围限制模块,用于:In conjunction with any embodiment of the present disclosure, the device further includes a range limiting module for:
在所述码率上限的提升次数超过提升次数阈值的情况下,停止提升所述码率上限,在所述码率上限的降低次数超过降低次数阈值的情况下,停止降低所述码率上限,或;When the number of increases in the upper code rate exceeds a threshold of increase times, stop increasing the upper limit of the code rate; when the number of decreases in the upper limit of the code rate exceeds a threshold of decreases, stop lowering the upper limit of the code rate, or;
在提升后的码率上限超出提升范围阈值的情况下,停止提升当次码率上限;When the increased code rate upper limit exceeds the increase range threshold, stop increasing the current code rate upper limit;
在降低后的码率上限超出降低范围阈值的情况下,停止降低当次码率上限。When the lowered upper limit of the code rate exceeds the reduction range threshold, stop lowering the upper limit of the current bit rate.
结合本公开的任一实施方式,所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:Combined with any embodiment of the present disclosure, the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
响应于当前扫描行数大于第二行数阈值,根据当前扫描行对应的衰减因子,对当前的码率范围的上限进行调整,所述衰减因子用于控制所述码率上限收敛至设定目标码率;In response to the current number of scan lines being greater than the second line number threshold, the upper limit of the current code rate range is adjusted according to the attenuation factor corresponding to the current scan line. The attenuation factor is used to control the upper limit of the code rate to converge to the set target. Code rate;
所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:In the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, the parameter determination module is specifically used to:
根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
结合本公开的任一实施方式,所述装置还包括第二行数阈值确定模块,用于:In combination with any embodiment of the present disclosure, the device further includes a second row number threshold determination module, used for:
在当前图像的总行数大于第三行数阈值的情况下,根据所述总行数和第一比例系数,得到所述第二行数阈值;When the total number of lines of the current image is greater than the third line number threshold, the second line number threshold is obtained based on the total number of lines and the first proportional coefficient;
在图像的总行数小于第三行数阈值且大于第四行数阈值的情况下,将所述总行数减去第一预设行数值,得到所述第二行数阈值;When the total number of rows of the image is less than the third row number threshold and greater than the fourth row number threshold, subtract the first preset row value from the total number of rows to obtain the second row number threshold;
在图像的总行数小于第四行数阈值的情况下,将第二预设行数值确定为所述第二行数阈值。When the total number of lines of the image is less than the fourth line number threshold, the second preset line value is determined as the second line number threshold.
结合本公开的任一实施方式,所述装置还包括衰减因子确定模块,用于:In conjunction with any embodiment of the present disclosure, the device further includes an attenuation factor determination module for:
根据当前扫描行数和所述第二行数阈值,确定所述衰减因子。The attenuation factor is determined according to the current scan line number and the second line number threshold.
结合本公开的任一实施方式,所述衰减因子确定模块在根据当前扫描行数和所述第二行数阈值,确定所述衰减因子过程中,具体用于:Combined with any embodiment of the present disclosure, the attenuation factor determination module is specifically used in the process of determining the attenuation factor based on the current scan line number and the second line number threshold:
获取所述当前扫描行数和所述衰减因子的对应关系;Obtain the corresponding relationship between the current scanning line number and the attenuation factor;
根据所述当前扫描行数和所述对应关系,获取所述衰减因子。The attenuation factor is obtained according to the current scanning line number and the corresponding relationship.
结合本公开的任一实施方式,所述装置还包括范围确定模块,用于:In conjunction with any embodiment of the present disclosure, the device further includes a range determination module for:
响应于当前扫描行为所述第一行数阈值对应行的下一行,根据设定目标码率和设定范围系数,确定所述码率范围。In response to a line next to the line corresponding to the first line number threshold of the current scan line, the code rate range is determined according to the set target code rate and the set range coefficient.
根据本公开实施例的第三方面,提供了一种电子设备,包括:According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, including:
存储器,用于存储所述处理器可执行指令;Memory for storing instructions executable by the processor;
处理器,被配置为执行所述存储器中的可执行指令以实现上述第一方面任一实施方式所述方法的步骤。The processor is configured to execute executable instructions in the memory to implement the steps of the method described in any embodiment of the first aspect.
根据本公开实施例的第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述第一方面任一实施方式所述方法的步骤。According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method described in any embodiment of the first aspect are implemented.
根据本公开实施例的第五方面,提供一种芯片,包括:According to a fifth aspect of an embodiment of the present disclosure, a chip is provided, including:
一个或多个接口电路和一个或多个处理器;所述接口电路用于从电子设备的存储器接收信号,并向所述处理器发送所述信号,所述信号包括存储器中存储的计算机指令;当所述处理器执行所述计算机指令时,使得所述电子设备执行上述第一方面任一实施方式所述的图像压缩方法。One or more interface circuits and one or more processors; the interface circuit is configured to receive signals from the memory of the electronic device and send the signals to the processor, where the signals include computer instructions stored in the memory; When the processor executes the computer instructions, the electronic device is caused to execute the image compression method described in any embodiment of the first aspect.
本公开实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
基于当前扫描行的压缩状态,得到以当前压缩参数压缩剩余扫描行后全图的预测码率,并通过设置码率范围,结合预测码率以调整下一扫描行的压缩参数,使每一扫描行都能够对下一扫描行的压缩参数进行及时调整,使得基于压缩参数压缩后的码率控制在码率范围内。避免依赖经验信息对压缩参数进行控制,减少码率震荡,使压缩损失均匀可控,提升了全图的无损概率。 此外,由于不涉及复杂计算过程,可以减小设备的运算压力。Based on the compression status of the current scan line, the predicted code rate of the entire image after compressing the remaining scan lines with the current compression parameters is obtained, and by setting the code rate range and combining the predicted code rate to adjust the compression parameters of the next scan line, so that each scan Each row can adjust the compression parameters of the next scanned row in time, so that the code rate after compression based on the compression parameters is controlled within the code rate range. It avoids relying on empirical information to control compression parameters, reduces code rate fluctuations, makes compression losses even and controllable, and improves the lossless probability of the entire image. In addition, since no complex calculation process is involved, the computing pressure on the device can be reduced.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and do not limit the present disclosure.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
图1是本公开根据一示例性实施例示出的一种图像压缩方法流程图;Figure 1 is a flow chart of an image compression method according to an exemplary embodiment of the present disclosure;
图2是本公开根据一示例性实施例示出的一种压缩参数调整流程图;Figure 2 is a flow chart of compression parameter adjustment according to an exemplary embodiment of the present disclosure;
图3是本公开根据一示例性实施例示出的一种第二行数阈值确定流程图;Figure 3 is a flow chart of determining a second row number threshold according to an exemplary embodiment of the present disclosure;
图4是本公开根据一示例性实施例示出的一种图像压缩效果对照图;Figure 4 is a comparison diagram of image compression effects according to an exemplary embodiment of the present disclosure;
图5是本公开根据一示例性实施例示出的一种图像压缩装置示意图;Figure 5 is a schematic diagram of an image compression device according to an exemplary embodiment of the present disclosure;
图6是本公开根据一示例性实施例示出的一种电子设备框图。FIG. 6 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with aspects of the disclosure as detailed in the appended claims.
在本公开使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本公开和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "the" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信 息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the present disclosure, the first information may also be called second information, and similarly, the second information may also be called first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to determining."
图1示出了本公开根据一示例性实施例示出的一种图像压缩方法流程图。Figure 1 shows a flow chart of an image compression method according to an exemplary embodiment of the present disclosure.
在步骤S101中,获取当前扫描行的压缩参数和码流长度,以及首行至所述当前扫描行的码流总长度。In step S101, the compression parameters and code stream length of the current scanning line are obtained, as well as the total length of the code stream from the first line to the current scanning line.
所述压缩参数用于反应图像的压缩程度,与压缩后扫描行的码流长度和码率负相关。在当前扫描行中,通过当前的压缩参数对图像当前扫描行的像素进行压缩,以获取当前扫描行压缩后的码流长度。同样的,在图像首行至当前扫描行的扫描压缩过程中,通过每行对应的压缩参数对图像进行压缩,得到首行至所述当前扫描行的码流总长度。在JPEG-LS标准中,通过Golomb编码器对量化后的预测残差进行编码,可以通过量化步长表征所述压缩参数。量化步长大,表示当前扫描行的压缩程度高,量化步长小,表示当前扫描行的压缩程度低。对于同一扫描行,通过更大的量化步长压缩后的码流长度更小。The compression parameters are used to reflect the degree of compression of the image, and are negatively correlated with the code stream length and code rate of the compressed scan lines. In the current scan line, compress the pixels of the current scan line of the image using the current compression parameters to obtain the compressed code stream length of the current scan line. Similarly, during the scanning compression process from the first line of the image to the current scanning line, the image is compressed using the compression parameters corresponding to each line to obtain the total length of the code stream from the first line to the current scanning line. In the JPEG-LS standard, the quantized prediction residual is encoded by a Golomb encoder, and the compression parameters can be characterized by the quantization step size. A large quantization step indicates a high degree of compression for the current scan line, and a small quantization step indicates a low degree of compression for the current scan line. For the same scan line, the length of the code stream compressed by a larger quantization step is smaller.
在步骤S102中,根据当前扫描行的码流长度和首行至所述当前扫描行的码流总长度,确定当前扫描行的预测码率,所述预测码率表征基于当前扫描行对应的压缩参数对下一个扫描行至图像最后扫描行压缩后,所述图像的最终码率。In step S102, the predicted code rate of the current scan line is determined based on the code stream length of the current scan line and the total length of the code stream from the first line to the current scan line. The predicted code rate represents the compression corresponding to the current scan line. The parameter is the final code rate of the image after compression from the next scan line to the last scan line of the image.
所述当前扫描行的码流长度和首行至所述当前扫描行的码流总长度,用于表示在当前扫描行及全部历史扫描行的压缩状态。所述预测码率是基于截止当前扫描行的压缩状态,推算得到的以当前压缩参数压缩剩余扫描行后全图的最终码率。在一个示例中,所述预测码率可以通过公式(1)确定:The code stream length of the current scan line and the total length of the code stream from the first line to the current scan line are used to represent the compression status of the current scan line and all historical scan lines. The predicted code rate is based on the compression status of the current scan line and the final code rate of the entire image after the remaining scan lines are compressed with the current compression parameters. In one example, the predicted code rate can be determined by formula (1):
Figure PCTCN2022096492-appb-000001
Figure PCTCN2022096492-appb-000001
其中,p表示所述预测码率,H表示图像的总行数,h表示当前扫描行的行数,可以通过当前所在行索引获取,H-h表示图像的剩余未扫描行数,b line表示当前扫描行的码流长度,b total表示首行至所述当前扫描行的码流总长度。公式 (1)的分子部分表示基于当前的压缩参数压缩剩余扫描行后全图的最终码流长度。 Among them, p represents the predicted code rate, H represents the total number of lines of the image, h represents the number of currently scanned lines, which can be obtained through the current row index, Hh represents the number of remaining unscanned lines of the image, and b line represents the current scanned line. The length of the code stream, b total represents the total length of the code stream from the first line to the current scanning line. The numerator part of formula (1) represents the final code stream length of the entire image after compressing the remaining scan lines based on the current compression parameters.
H和W分别表示图像基于高度和宽度的像素量,P表示图像的比特位宽,用于表示图像中每个像素的信息量。公式(1)中的分母部分表示图像的总信息量。H and W represent the number of pixels in the image based on height and width respectively, and P represents the bit width of the image, which is used to represent the amount of information in each pixel in the image. The denominator part in formula (1) represents the total information amount of the image.
通过计算预测码流长度在图像中总信息量的占比,可以获取所述预测码率。The predicted code rate can be obtained by calculating the proportion of the predicted code stream length to the total amount of information in the image.
在步骤S103中,根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。In step S103, the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
所述码率范围用于限制所述预测码率的波动程度,可以通过图像的设定目标码率或多次实验确定。所述码率范围可以包括所述预测码率的上限和/或下限。在一个示例中,可以在所述预测码率超出所述码率范围的情况下,通过调整下一扫描行的压缩参数提升或降低预测码率,以使所述预测码率回归至所述码率范围。The code rate range is used to limit the fluctuation degree of the predicted code rate, which can be determined by setting a target code rate of the image or multiple experiments. The code rate range may include an upper limit and/or a lower limit of the predicted code rate. In one example, when the predicted code rate exceeds the code rate range, the predicted code rate can be increased or reduced by adjusting the compression parameters of the next scan line so that the predicted code rate returns to the code rate. rate range.
在步骤S104中,根据所述下一个扫描行的压缩参数,对下一个扫描行的像素数据进行压缩处理。In step S104, the pixel data of the next scanning line is compressed according to the compression parameter of the next scanning line.
可以控制压缩编码通过调整后的下一扫描行的压缩参数,对下一个扫描行的像素进行编码压缩。在JPEG-LS标准中,可以通过Golomb编码器基于调整后的量化步长对量化后的预测残差进行编码。The compression encoding can be controlled by adjusting the compression parameters of the next scanning line to encode and compress the pixels of the next scanning line. In the JPEG-LS standard, the quantized prediction residual can be encoded by the Golomb encoder based on the adjusted quantization step size.
本公开所述方案,通过基于当前扫描行的压缩状态,得到以当前压缩参数压缩剩余扫描行后全图的预测码率,并通过设置码率范围,结合预测码率以调整下一扫描行的压缩参数,实现每一扫描行都能够对下一扫描行的压缩参数进行及时调整,使得基于压缩参数压缩后的码率控制在码率范围内。避免了依赖经验信息或图像本身内容特性对压缩参数进行控制,减少码率震荡,使压缩损失均匀可控,提升了全图的无损概率。此外,由于不涉及复杂计算过程,可以减小设备的运算压力。The scheme described in this disclosure obtains the predicted code rate of the entire image after compressing the remaining scan lines with the current compression parameters based on the compression status of the current scan line, and adjusts the code rate of the next scan line by setting the code rate range and combining it with the predicted code rate. Compression parameters enable each scan line to adjust the compression parameters of the next scan line in time, so that the code rate after compression based on the compression parameters is controlled within the code rate range. It avoids relying on empirical information or the content characteristics of the image itself to control compression parameters, reduces code rate fluctuations, makes compression losses uniform and controllable, and improves the lossless probability of the entire image. In addition, since no complex calculation process is involved, the computing pressure on the device can be reduced.
在一个可选的实施例中,所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:In an optional embodiment, determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line includes:
在所述当前扫描行的预测码率大于码率上限的情况下,提升所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数;和/或,When the predicted code rate of the current scan line is greater than the upper limit of the code rate, increase the compression parameters of the current scan line to obtain the compression parameters of the next scan line; and/or,
在所述当前扫描行的预测码率小于码率下限的情况下,降低所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数。When the predicted code rate of the current scan line is less than the lower limit of the code rate, the compression parameter of the current scan line is reduced to obtain the compression parameter of the next scan line.
可选的,当前扫描行的预测码率超出所述码率上限,表示当前扫描行的压缩程度过小,可以通过提升下一个扫描行的压缩参数,即提升下一个扫描行的压缩程度,以降低下一个扫描行的码率,使在对下一扫描行进行压缩的过程中的码率不超出所述码率上限。Optionally, the predicted code rate of the current scan line exceeds the upper limit of the code rate, which means that the compression degree of the current scan line is too small. You can increase the compression parameter of the next scan line, that is, increase the compression degree of the next scan line, to reduce Lower the code rate of the next scan line so that the code rate during the compression of the next scan line does not exceed the upper limit of the code rate.
同样的,当前扫描行的预测码率低于所述码率下限,表示当前扫描行的压缩程度过大,可以通过降低下一个扫描行的压缩参数,即降低下一个扫描行的压缩程度,以提升下一个扫描行的码率,以使在对下一扫描行进行压缩的过程中的码率不低于所述码率下限。Similarly, if the predicted code rate of the current scan line is lower than the lower limit of the code rate, it means that the compression degree of the current scan line is too large. You can reduce the compression parameter of the next scan line, that is, reduce the compression degree of the next scan line. The code rate of the next scan line is increased so that the code rate during the compression of the next scan line is not lower than the lower limit of the code rate.
图2示出了本申请公开根据一示例性实施例示出的一种压缩参数调整流程图。Figure 2 shows a compression parameter adjustment flow chart disclosed in this application according to an exemplary embodiment.
在步骤S201中,判断所述预测码率是否大于码率上限。In step S201, it is determined whether the predicted code rate is greater than the upper limit of the code rate.
在步骤S202中,在所述预测码率大于所述码率上限的情况下,可以判断当前的压缩参数是否大于压缩参数阈值,以确定当前的压缩过程是否处于常规压缩模式,在一个示例中,所述压缩参数阈值可以设置为15。In step S202, when the predicted code rate is greater than the upper code rate limit, it may be determined whether the current compression parameter is greater than the compression parameter threshold to determine whether the current compression process is in a regular compression mode. In one example, The compression parameter threshold can be set to 15.
在步骤S203中,在当前压缩过程处于常规压缩模式的情况下,提升所述压缩参数。In step S203, when the current compression process is in the normal compression mode, the compression parameters are increased.
在步骤S204中,判断所述预测码率是否小于码率下限。In step S204, it is determined whether the predicted code rate is less than the lower limit of the code rate.
在步骤S205中,在所述预测码率小于所述码率下限的情况下,可以判断当前的压缩参数是否小于0,以确定当前是否处于压缩过程,也即确定当前的压缩过程是否处于常规压缩模式。In step S205, when the predicted code rate is less than the lower limit of the code rate, it can be determined whether the current compression parameter is less than 0 to determine whether the current compression process is in the compression process, that is, whether the current compression process is in the conventional compression process. model.
在步骤S206中,在当前压缩过程处于常规压缩模式的情况下,降低所述压缩参数。In step S206, if the current compression process is in the normal compression mode, the compression parameters are reduced.
在步骤S207中,在所述预测码率在码率范围内的情况下,可以保持当前压缩参数。此外,在当前不处于常规压缩模式的情况下,也可以通过保持当前压缩参数的方法等待进一步处理。In step S207, if the predicted code rate is within the code rate range, the current compression parameters may be maintained. In addition, when the current compression mode is not in the normal compression mode, the method of maintaining the current compression parameters can also be used to wait for further processing.
在一个示例中,可以通过对压缩参数加1的方式提升所述压缩参数,通过对压缩参数减1的方式降低所述压缩参数,以确保相邻扫描行的压缩参数变化量控制在1或0,避免由于压缩参数的骤增或骤降使压缩后的图像有明显的压缩损失,从而保证图像中压缩强度的均匀过度。In one example, the compression parameter can be increased by adding 1 to the compression parameter and decreased by decrementing the compression parameter by 1 to ensure that the compression parameter variation of adjacent scan lines is controlled at 1 or 0. , to avoid obvious compression losses in the compressed image due to sudden increases or decreases in compression parameters, thereby ensuring uniform compression intensity in the image.
本公开所述方案,通过比较当前扫描行的预测码率与码率范围,及时调整压缩参数,以使下一扫描行的码率控制在码率范围内,同时,通过限制所述压缩参数每次的调整量,避免压缩后的图像有明显的压缩损失,从而保证图像中压缩强度的均匀过度。The scheme described in this disclosure adjusts the compression parameters in time by comparing the predicted code rate of the current scan line with the code rate range so that the code rate of the next scan line is controlled within the code rate range. At the same time, by limiting the compression parameters every The amount of adjustment is to avoid obvious compression loss in the compressed image, thereby ensuring uniform compression intensity in the image.
在一个可选的实施例中,所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:In an optional embodiment, determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line includes:
响应于当前扫描行数大于第一行数阈值,根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。In response to the current number of scan lines being greater than the first line number threshold, the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
可选的,由于在图像刚刚启动扫描压缩过程时,无法确定所述扫描范围的选取是否合理,且前几行没有足够的历史信息,若由于图像复杂程度过大导致图像不同扫描行的码率由于客观原因存在较大波动,选取过小的码率范围可能会导致所述压缩过程无法正常运行,因此可以在确定所述码率范围前,先对第一行数阈值前的扫描行进行无码率范围限制的压缩,再根据所述图像的压缩状态确定所述码率范围,在一个示例中,所述第一行数阈值为10。Optional, because when the image has just started the scanning compression process, it is impossible to determine whether the selection of the scanning range is reasonable, and there is not enough historical information in the first few lines. If the code rate of different scanning lines of the image is due to the excessive complexity of the image, Due to large fluctuations due to objective reasons, selecting a bit rate range that is too small may cause the compression process to fail to operate normally. Therefore, before determining the bit rate range, scan lines before the first line number threshold can be scanned. For compression limited by a code rate range, the code rate range is determined based on the compression state of the image. In one example, the first line number threshold is 10.
在一个示例中,响应于当前扫描行为所述第一行数阈值对应行的下一行,根据设定目标码率和设定范围系数,确定所述码率范围。In one example, in response to the current scan line being a next line corresponding to the first line number threshold, the code rate range is determined according to the set target code rate and the set range coefficient.
所述设定目标码率表示用户希望对当前图像压缩后的最终码率。所述设定范围系数可以根据第一行数阈值前的扫描行的压缩状态确定。例如,将110%的设定目标码率确定为所述码率上限,将95%的设定码率范围确定为所述码率下 限,以确保图像压缩过程中的码率始终围绕所述设定目标码率波动。The set target bit rate represents the final bit rate that the user hopes to compress the current image. The set range coefficient may be determined based on the compression state of the scan lines before the first line number threshold. For example, a set target code rate of 110% is determined as the upper limit of the code rate, and a set code rate range of 95% is determined as the lower limit of the code rate to ensure that the code rate during the image compression process always surrounds the set code rate. Target code rate fluctuations.
本公开所述方案,通过先对第一行数阈值及其之前的扫描行进行无码率范围限制的压缩,再根据所述图像的压缩状态确定所述码率范围,保证所述压缩范围的合理选取。此外,根据目标设定码率和范围系数确定所述码率范围,以确保图像压缩过程中的码率始终围绕所述设定目标码率波动。The scheme described in this disclosure first performs compression without code rate range restrictions on the first line number threshold and the scanning lines before it, and then determines the code rate range according to the compression state of the image to ensure the compression range. Choose wisely. In addition, the code rate range is determined according to the target set code rate and the range coefficient to ensure that the code rate during the image compression process always fluctuates around the set target code rate.
在一个可选的实施例中,在所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数之前,还包括:In an optional embodiment, before determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line, the method further includes:
响应于当前扫描行数大于所述第一行数阈值且小于等于第二行数阈值,根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,对当前的码率范围上限进行调整;In response to the current number of scan lines being greater than the first line number threshold and less than or equal to the second line number threshold, based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line , adjust the upper limit of the current code rate range;
所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:Determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
可选的,在所述当前扫描行数大于第一行数阈值的情况下,在所述当前扫描行前存在若干历史扫描行,可以根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,获取最近部分扫描行的预测码率变化趋势,并根据所述变化趋势自适应调整所述码率范围。Optionally, when the current number of scan lines is greater than the first line number threshold, there are several historical scan lines before the current scan line, and the prediction of at least two scan lines before the current scan line can be used. The code rate and the predicted code rate of the current scan line are obtained, the predicted code rate change trend of the most recent scan lines is obtained, and the code rate range is adaptively adjusted according to the change trend.
在一个示例中,具体的码率范围调整方法包括:In an example, specific code rate range adjustment methods include:
根据预设规则,在所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率中,选取待检测预测码率;According to preset rules, select the predicted code rate to be detected among the predicted code rates of at least two scan lines before the current scan line and the predicted code rate of the current scan line;
在所述待检测预测码率依次递增的情况下,提升所述码率上限;When the predicted code rate to be detected increases sequentially, increase the upper limit of the code rate;
在所述待检测预测码率依次递减的情况下,降低所述码率上限。When the predicted code rate to be detected decreases in sequence, the upper limit of the code rate is lowered.
可选的,在基于JPEG-LS标准对图像进行压缩的过程中,由于存在码率小幅震荡,整体预测码率变化随行数增加通常呈现W型或M型,即在第N个扫描行的预测码率小于相邻扫描行的预测码率的情况下,第N+1个扫描行的预测码 率大于相邻扫描行的预测码率,可以通过相隔扫描行的预测码率变化趋势确定最近扫描部分的码率变化趋势。在根据当前扫描行及其前2个扫描行确定所述待检测预测码率的情况下,可以将所述当前扫描行与距其前2行对应的2个预测码率确定为所述待检测预测码率;在根据当前扫描行及其前5个扫描行确定所述待检测预测码率的情况下,可以将所述当前扫描行与距其前2行和前4行对应的3个预测码率确定为所述待检测预测码率,或将距当前扫描行前1行、前3行和前5行对应的3个预测码率确定为所述待检测预测码率,并根据所属待检测预测码率的增减趋势确定所述码率上限的调整方式。在一个示例中,可以固定将当前扫描行相邻的前5个扫描行对应的预测码率确定为所述待检测预测码率,在结束对当前扫描行的扫描压缩后,自动向下一行移动所述历史扫描行的选取范围,将下一扫描行的前5个扫描行对应的预测码率确定为所述待检测预测码率。Optionally, in the process of image compression based on the JPEG-LS standard, due to the small oscillation of the code rate, the overall predicted code rate changes as the number of lines increases, usually showing a W-type or M-type, that is, the prediction at the Nth scanning line When the code rate is less than the predicted code rate of the adjacent scan line, the predicted code rate of the N+1th scan line is greater than the predicted code rate of the adjacent scan line. The most recent scan can be determined by the change trend of the predicted code rate of the adjacent scan lines. Part of the code rate change trend. In the case where the predicted code rate to be detected is determined based on the current scanning line and its two previous scanning lines, the two predicted code rates corresponding to the current scanning line and its two preceding lines can be determined as the to-be-detected Predicted code rate; when determining the predicted code rate to be detected based on the current scanning line and its first five scanning lines, the current scanning line and the three predictions corresponding to the first two lines and the first four lines can be The code rate is determined as the predicted code rate to be detected, or the three predicted code rates corresponding to the first row, the first three rows and the first five rows from the current scan line are determined as the predicted code rate to be detected, and the code rate is determined according to the predicted code rate to be detected. The increase or decrease trend of the predicted code rate is detected to determine the adjustment method for the upper limit of the code rate. In one example, the predicted code rates corresponding to the first five scan lines adjacent to the current scan line can be fixedly determined as the predicted code rate to be detected, and after the scanning compression of the current scan line is completed, the code rate can be automatically moved to the next line. In the selection range of the historical scan lines, the predicted code rates corresponding to the first five scan lines of the next scan line are determined as the predicted code rates to be detected.
在所述预测码率依次递增的情况下,表示最近扫描部分的码率呈增加趋势,间接表示当前扫描部分为图像的复杂纹理区域,可以通过提升所述码率上限,允许在当前区域以较小的压缩参数进行压缩,以在纹理复杂区域分配更多的码流长度。When the predicted code rate increases sequentially, it means that the code rate of the recently scanned part shows an increasing trend, which indirectly indicates that the currently scanned part is a complex texture area of the image. By increasing the upper limit of the code rate, it is possible to allow the current area to be processed at a higher rate. Compress with small compression parameters to allocate more bitstream length in texture-complex areas.
在所述预测码率依次递减的情况下,表示最近扫描部分的码率呈下降趋势,间接表示当前扫描部分为图像的简单纹理区域,可以通过降低所述码率上限,允许在当前区域以较大的压缩参数进行压缩,以在简单纹理区域分配更少的码流长度。When the predicted code rate decreases sequentially, it means that the code rate of the most recently scanned part is on a downward trend, which indirectly indicates that the currently scanned part is a simple texture area of the image. By lowering the upper limit of the code rate, it is possible to allow the current area to be processed with a higher rate. Compress with large compression parameters to allocate less bitstream length in simple texture areas.
本公开所述方案,通过根据最近部分扫描行的码率变化趋势自适应调整码率范围,以使压缩过程中,在复杂纹理区域分配更多的码流长度,在简单纹理区域分配更少的码流长度,减少编码过程中的码率震荡,从而实现编码过程中码流的合理分配,达到重建图像画质的均匀过度的效果。The scheme described in this disclosure adaptively adjusts the code rate range according to the code rate change trend of the most recent scan lines, so that during the compression process, more code stream lengths are allocated in complex texture areas and less code stream lengths are allocated in simple texture areas. The length of the code stream reduces the bit rate oscillation during the encoding process, thereby achieving a reasonable distribution of the code stream during the encoding process and achieving a uniform and excessive effect of reconstructed image quality.
在一个可选的实施例中,所述方法还包括:In an optional embodiment, the method further includes:
在所述码率上限的提升次数超过提升次数阈值的情况下,停止提升所述码 率上限,在所述码率上限的降低次数超过降低次数阈值的情况下,停止降低所述码率上限,或;When the number of increases in the upper code rate exceeds a threshold of increase times, stop increasing the upper limit of the code rate; when the number of decreases in the upper limit of the code rate exceeds a threshold of decreases, stop lowering the upper limit of the code rate, or;
在提升后的码率上限超出提升范围阈值的情况下,停止提升当次码率上限;When the increased code rate upper limit exceeds the increase range threshold, stop increasing the current code rate upper limit;
在降低后的码率上限超出降低范围阈值的情况下,停止降低当次码率上限。When the lowered upper limit of the code rate exceeds the reduction range threshold, stop lowering the upper limit of the current bit rate.
可选的,虽然在前述方法中,可以根据最近部分扫描行的码率变化趋势自适应调整码率范围,但码率范围的适应性调整程度仍应具有一定的程度限制,以避免码率上限无限制的升高或降低。可以通过设置提升次数阈值和降低次数阈值限制所述码率上限的升高或降低次数,也可以同构设置提升或降低范围值的方法,控制所述码率上限的具体数值保持在适当区间。Optionally, although in the aforementioned method, the code rate range can be adaptively adjusted according to the code rate change trend of the most recent scan lines, the degree of adaptive adjustment of the code rate range should still be limited to a certain extent to avoid the code rate upper limit. Unlimited raising or lowering. You can limit the number of increases or decreases in the code rate upper limit by setting a threshold for increases and decreases, or you can also set an increase or decrease range value isomorphically to control the specific value of the upper limit of the code rate to remain within an appropriate range.
在一个示例中,可以通过对所述码率上限提升或降低5%实现对码率上限的调整,并且通过标志位f对所述码率上限的提升或降低结果进行标志,在上限提高后,f标记为true,上限降低后,f标记为false,以使所述码率上限无法连续升高或降低,只能够在±5%的范围内进行调整。In one example, the upper limit of the code rate can be adjusted by increasing or decreasing the upper limit of the code rate by 5%, and the result of the increase or decrease in the upper limit of the code rate is marked by the flag bit f. After the upper limit is increased, f is marked as true. After the upper limit is lowered, f is marked as false, so that the upper limit of the code rate cannot be continuously increased or decreased, and can only be adjusted within the range of ±5%.
在一个示例中,所述码率上限的提升和降低条件可以分别通过公式(2)和公式(3)表示。In one example, the conditions for increasing and decreasing the code rate upper limit can be expressed by formula (2) and formula (3) respectively.
Figure PCTCN2022096492-appb-000002
Figure PCTCN2022096492-appb-000002
Figure PCTCN2022096492-appb-000003
Figure PCTCN2022096492-appb-000003
其中,P0-P4表示距当前扫描行相邻的5个历史扫描行对应的预测码率,p表示当前扫描行的预测码率,rt表示所述设定目标码率,l表示上限距离100%的偏移量,且每次满足调整条件时,调整量直接加到l上,!f表示所述码率上限可以提升,f表示所述码率上限可以降低。Among them, P0-P4 represents the predicted code rate corresponding to the five historical scan lines adjacent to the current scan line, p represents the predicted code rate of the current scan line, rt represents the set target code rate, and l represents the upper limit distance of 100%. The offset of , and every time the adjustment condition is met, the adjustment amount is directly added to l,! f means that the upper limit of the code rate can be increased, and f means that the upper limit of the code rate can be reduced.
进一步的,根据实验数据,可以通过当前扫描行的预测码率与设定目标码率的比例范围或待检测预测码率间的差值,进一步精确码率上限提升或降低的触发条件。Furthermore, based on experimental data, the triggering conditions for increasing or decreasing the upper limit of the code rate can be further refined through the difference between the predicted code rate of the current scan line and the set target code rate or the difference between the predicted code rate to be detected.
本公开所述方案,通过设置提升次数阈值和降低次数阈值,限制所述码率上限的升高或降低次数,或通过范围值,使所述码率上限的具体数值保持在适当区间,避免在对所述码率上限的自适应调整过程中,码率上限的无限制上升或下降。The solution described in this disclosure limits the number of increases or decreases in the upper code rate by setting a threshold for the number of increases and a threshold for the number of decreases, or by using a range value to keep the specific value of the upper limit of the code rate within an appropriate range to avoid During the adaptive adjustment process of the upper limit of the code rate, the upper limit of the code rate can increase or decrease without restriction.
在一个可选的实施例中,在所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数之前,还包括:In an optional embodiment, before determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line, the method further includes:
响应于当前扫描行数大于第二行数阈值,根据当前扫描行对应的衰减因子,对当前的码率范围上限进行调整,所述衰减因子用于控制所述码率上限收敛至设定目标码率;In response to the current scan line number being greater than the second line number threshold, the current upper limit of the code rate range is adjusted according to the attenuation factor corresponding to the current scan line. The attenuation factor is used to control the upper limit of the code rate to converge to the set target code. Rate;
所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:Determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
可选的,在扫描压缩的最后阶段,通过逐渐将所述码率上限收敛至设定目标码率,以约束整个图像压缩过程中的最终压缩码率。所述衰减因子用于控制所述码率上限收敛至设定目标码率。所述第二行数阈值表示图像扫描压缩过程中的衰减起点,若所述码率上限在所述衰减起点前经过了自适应调整阶段,则在所述衰减起点将所述码率上限重置为初始上限,例如第一行数阈值的下一扫描行对应的码率上限。Optionally, in the final stage of scan compression, the final compression code rate in the entire image compression process is constrained by gradually converging the upper limit of the code rate to the set target code rate. The attenuation factor is used to control the upper limit of the code rate to converge to a set target code rate. The second line number threshold represents the attenuation starting point in the image scanning and compression process. If the code rate upper limit passes through the adaptive adjustment stage before the attenuation starting point, the code rate upper limit is reset at the attenuation starting point. is the initial upper limit, such as the upper limit of the code rate corresponding to the next scan line of the first line number threshold.
在一个示例中,所述方法还包括:In one example, the method further includes:
根据当前扫描行数和所述第二行数阈值,确定所述衰减因子。The attenuation factor is determined according to the current scan line number and the second line number threshold.
可选的,可以通过公式(4)确定所述衰减因子:Optionally, the attenuation factor can be determined through formula (4):
decay=pow(a,h-h st)  (4) decay=pow(a,hh st ) (4)
其中,decay表示所述衰减因子,h表示当前扫描行的行数,h st表示第二行数阈值,即衰减起始行的行数。因此,所述衰减因子可以通过以a为底,以经过衰减起点后的累计行数为幂的指数函数表示。其中,a<1,以使衰减因子随 着行数的增加逐渐趋近于0,使得码率上限随着行数的增加逐渐逼近于所述设定目标码率。在一个示例中,a=0.989。 Among them, decay represents the attenuation factor, h represents the number of lines currently scanned, and h st represents the second line number threshold, that is, the number of lines from which the attenuation starts. Therefore, the attenuation factor can be expressed by an exponential function with a as the base and the cumulative number of rows after the attenuation starting point as the power. Wherein, a<1, so that the attenuation factor gradually approaches 0 as the number of lines increases, so that the upper limit of the code rate gradually approaches the set target code rate as the number of lines increases. In one example, a=0.989.
本公开所述方案,通过将衰减因子作为码率上限偏移量系数,逐渐将所述码率上限收敛至设定目标码率,以约束整个图像压缩过程中的最终压缩码率。According to the solution of the present disclosure, by using the attenuation factor as the offset coefficient of the upper limit of the code rate, the upper limit of the code rate gradually converges to the set target code rate, so as to constrain the final compression code rate in the entire image compression process.
在一个可选的实施例中,所述根据当前扫描行数和所述第二设定阈值,确定所述衰减因子,包括:In an optional embodiment, determining the attenuation factor based on the current number of scanning lines and the second set threshold includes:
获取所述当前扫描行数和所述衰减因子的对应关系;Obtain the corresponding relationship between the current scanning line number and the attenuation factor;
根据所述当前扫描行数和所述对应关系,获取所述衰减因子。The attenuation factor is obtained according to the current scanning line number and the corresponding relationship.
可选的,为了便于硬件实现,可以通过查表获取每一扫描行对应的衰减因子。如果表过大难以获取,可以通过设定步长进行跳点采样,而在步长范围内的点,则可以通过查表值临近的两个查表结果通过先行差值计算得到。Optionally, in order to facilitate hardware implementation, the attenuation factor corresponding to each scan line can be obtained by looking up the table. If the table is too large and difficult to obtain, jump point sampling can be performed by setting the step size. Points within the step size range can be calculated through the look-ahead difference between two table lookup results that are close to the table lookup value.
本公开所述方案,通过获取扫描行数和所述衰减因子的对应关系,直接通过查表获取每一扫描行对应的衰减因子,以进一步减小设备的运算压力。According to the solution of the present disclosure, by obtaining the corresponding relationship between the number of scanning lines and the attenuation factor, the attenuation factor corresponding to each scanning line is directly obtained by looking up the table, so as to further reduce the computing pressure of the device.
在一个可选的实施例中,所述方法还包括:In an optional embodiment, the method further includes:
在当前图像的总行数大于第三行数阈值的情况下,根据所述总行数和第一比例系数,得到所述第二行数阈值;When the total number of lines of the current image is greater than the third line number threshold, the second line number threshold is obtained based on the total number of lines and the first proportional coefficient;
在图像的总行数小于第三行数阈值且大于第四行数阈值的情况下,将所述总行数减去第一预设行数值,得到所述第二行数阈值;When the total number of rows of the image is less than the third row number threshold and greater than the fourth row number threshold, subtract the first preset row value from the total number of rows to obtain the second row number threshold;
在图像的总行数小于第四行数阈值的情况下,将第二预设行数值确定为所述第二行数阈值。When the total number of lines of the image is less than the fourth line number threshold, the second preset line value is determined as the second line number threshold.
图3公开了本公开根据一示例性实施例示出的一种第二行数阈值确定流程图,其中,H表示所述图像的总行数,h st表示所述第二行数阈值。 Figure 3 discloses a second line number threshold determination flowchart according to an exemplary embodiment of the present disclosure, where H represents the total number of lines of the image, and h st represents the second line number threshold.
如图3所示,通常,在所述图像总行数H大于1500的情况下,将所述总行数的3/4确定为所述第二行数阈值;As shown in Figure 3, usually, when the total number of image lines H is greater than 1500, 3/4 of the total number of lines is determined as the second line number threshold;
在所述图像总行数在1500行至375行之间的情况下,将所述图像的倒数第375行确定为所述第二行数阈值;In the case where the total number of lines of the image is between 1500 lines and 375 lines, the 375th line from the bottom of the image is determined as the second line number threshold;
在所述图像总行数小于375行的情况下,将所述图像总行数的第十行确定为所述第二行数阈值。进一步的,为了避免在扫描结束时所述码率上限仍无法收敛至设定目标码率,可以在图像的倒数第十行判断基于当前的衰减因子能否完成所述码率上限的收敛,若不能,则将所述衰减因子设置为0,直接将所述设定目标码率确定为所述码率上限,以及时完成对图像的压缩码率的收敛。In the case where the total number of image lines is less than 375 lines, the tenth line of the total number of image lines is determined as the second line number threshold. Further, in order to avoid that the upper limit of the code rate still cannot converge to the set target code rate at the end of the scan, it can be judged in the tenth line from the bottom of the image whether the convergence of the upper limit of the code rate can be completed based on the current attenuation factor. If If not, the attenuation factor is set to 0, and the set target bit rate is directly determined as the upper limit of the bit rate, so as to complete the convergence of the compression bit rate of the image in a timely manner.
本公开所述方案,通过根据所述图像的总行数确定所述第二行数阈值,控制所述扫描压缩过程在适当的收敛起点进行码率上限的收敛,以约束整个图像压缩过程中的最终压缩码率。According to the solution of the present disclosure, by determining the second line number threshold according to the total number of lines of the image, the scanning compression process is controlled to converge on the upper limit of the code rate at an appropriate convergence starting point, so as to constrain the final result of the entire image compression process. Compression code rate.
图4示出了本公开根据一示例性实施例示出的一种图像压缩效果对照图。FIG. 4 shows an image compression effect comparison diagram according to an exemplary embodiment of the present disclosure.
图4以是否通过本公开所述方法对bayer图像进行压缩为例,能够体现是否采取本公开所述方案进行图像压缩的前后对比效果。其中,x轴为扫描行数索引,y轴为每一扫描行对应的实际码率。Figure 4 takes as an example whether the bayer image is compressed by the method described in the present disclosure, which can reflect the before and after comparison effect of whether the scheme described in the present disclosure is adopted for image compression. Among them, the x-axis is the index of the number of scanning lines, and the y-axis is the actual code rate corresponding to each scanning line.
可见,基于本公开所述方案,能过明显降低图像压缩过程中的码率震荡,并使实际码率更快地收敛到目标码率。It can be seen that based on the solution of the present disclosure, the code rate oscillation during the image compression process can be significantly reduced, and the actual code rate can be converged to the target code rate faster.
此外,由于本公开所述方案不依赖于图像内容本身,只依赖于码率历史信息的变化规律,所以不同类型不同尺寸的图像均可以达到码率控制的效果。In addition, since the solution described in the present disclosure does not rely on the image content itself, but only relies on the changing rules of the historical bit rate information, the effect of bit rate control can be achieved for images of different types and sizes.
进一步的,通过根据最近部分扫描行的码率变化趋势自适应调整码率范围,以使压缩过程中,在复杂纹理区域分配更多的码流长度,在简单纹理区域分配更多的码流长度,减少编码过程中的码率震荡,从而实现重建图像画质的均匀过度,使得图像画质得到有效控制。Furthermore, the code rate range is adaptively adjusted according to the code rate change trend of the recent scan lines, so that during the compression process, more code stream lengths are allocated in complex texture areas and more code stream lengths are allocated in simple texture areas. , Reduce the bit rate oscillation during the encoding process, thereby achieving a uniform transition of reconstructed image quality, so that the image quality can be effectively controlled.
对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本公开并不受所描述的动作顺序的限制,因为依据本公开,某些步骤可以采用其他顺序或者同时进行。For the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present disclosure is not limited by the described action sequence, because according to the present disclosure, Some steps may be performed in other orders or simultaneously.
其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作和模块并不一定是本公开所必须的。Secondly, those skilled in the art should also know that the embodiments described in the specification are optional embodiments, and the actions and modules involved are not necessarily necessary for the present disclosure.
与前述应用功能实现方法实施例相对应,本公开还提供了应用功能实现 装置及相应的终端的实施例。Corresponding to the foregoing embodiments of application function implementation methods, the present disclosure also provides embodiments of application function implementation devices and corresponding terminals.
本公开一示例性实施例示出的一种图像压缩的装置框图如图5所示,所述装置包括:A block diagram of an image compression device according to an exemplary embodiment of the present disclosure is shown in Figure 5. The device includes:
401,参数获取模块:用于获取当前扫描行的压缩参数和码流长度,以及首行至所述当前扫描行的码流总长度;401. Parameter acquisition module: used to obtain the compression parameters and code stream length of the current scan line, as well as the total length of the code stream from the first line to the current scan line;
402,码率预测模块:用于根据当前扫描行的码流长度和首行至所述当前扫描行的码流总长度,确定当前扫描行的预测码率,所述预测码率表征基于当前扫描行对应的压缩参数对下一个扫描行至图像最后扫描行压缩后,所述图像的最终码率;402. Code rate prediction module: used to determine the predicted code rate of the current scan line based on the code stream length of the current scan line and the total length of the code stream from the first line to the current scan line. The predicted code rate representation is based on the current scan. The final code rate of the image after the compression parameters corresponding to the row compress the next scan line to the last scan line of the image;
403,参数确定模块:用于根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数;403. Parameter determination module: used to determine the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line;
404,压缩模块:用于根据所述下一个扫描行的压缩参数,对下一个扫描行的像素数据进行压缩处理。404. Compression module: configured to compress the pixel data of the next scanning line according to the compression parameters of the next scanning line.
结合本公开的任一实施方式,所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:Combined with any embodiment of the present disclosure, the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
在所述当前扫描行的预测码率大于码率上限的情况下,提升所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数;和/或,When the predicted code rate of the current scan line is greater than the upper limit of the code rate, increase the compression parameters of the current scan line to obtain the compression parameters of the next scan line; and/or,
在所述当前扫描行的预测码率小于码率下限的情况下,降低所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数。When the predicted code rate of the current scan line is less than the lower limit of the code rate, the compression parameter of the current scan line is reduced to obtain the compression parameter of the next scan line.
结合本公开的任一实施方式,所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:Combined with any embodiment of the present disclosure, the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
响应于当前扫描行数大于第一行数阈值,根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。In response to the current number of scan lines being greater than the first line number threshold, the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
结合本公开的任一实施方式,所述参数确定模块在根据所述预测码率、码 率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数之前,所述装置还包括范围调整模块,用于:In connection with any embodiment of the present disclosure, before the parameter determination module determines the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, the device further includes a range adjustment Module for:
响应于当前扫描行数大于所述第一行数阈值且小于等于第二行数阈值,根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,对当前的码率范围上限进行调整;In response to the current number of scan lines being greater than the first line number threshold and less than or equal to the second line number threshold, based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line , adjust the upper limit of the current code rate range;
所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:In the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, the parameter determination module is specifically used to:
根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
结合本公开的任一实施方式,所述参数确定模块在根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,对当前的码率范围上限进行调整过程中,具体用于:In connection with any embodiment of the present disclosure, the parameter determination module determines the upper limit of the current code rate range based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line. During the adjustment process, it is specifically used for:
根据预设规则,在所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率中,选取待检测预测码率;According to preset rules, select the predicted code rate to be detected among the predicted code rates of at least two scan lines before the current scan line and the predicted code rate of the current scan line;
在所述待检测预测码率依次递增的情况下,提升所述码率上限;When the predicted code rate to be detected increases sequentially, increase the upper limit of the code rate;
在所述待检测预测码率依次递减的情况下,降低所述码率上限。When the predicted code rate to be detected decreases in sequence, the upper limit of the code rate is lowered.
结合本公开的任一实施方式,所述装置还包括范围限制模块,用于:In conjunction with any embodiment of the present disclosure, the device further includes a range limiting module for:
在所述码率上限的提升次数超过提升次数阈值的情况下,停止提升所述码率上限,在所述码率上限的降低次数超过降低次数阈值的情况下,停止降低所述码率上限,或;When the number of increases in the upper code rate exceeds a threshold of increase times, stop increasing the upper limit of the code rate; when the number of decreases in the upper limit of the code rate exceeds a threshold of decreases, stop lowering the upper limit of the code rate, or;
在提升后的码率上限超出提升范围阈值的情况下,停止提升当次码率上限;When the increased code rate upper limit exceeds the increase range threshold, stop increasing the current code rate upper limit;
在降低后的码率上限超出降低范围阈值的情况下,停止降低当次码率上限。When the lowered upper limit of the code rate exceeds the reduction range threshold, stop lowering the upper limit of the current bit rate.
结合本公开的任一实施方式,所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:Combined with any embodiment of the present disclosure, the parameter determination module is specifically used in the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range, and compression parameters of the current scan line:
响应于当前扫描行数大于第二行数阈值,根据当前扫描行对应的衰减因子, 对当前的码率范围上限进行调整,所述衰减因子用于控制所述码率上限收敛至设定目标码率;In response to the current scan line number being greater than the second line number threshold, the current upper limit of the code rate range is adjusted according to the attenuation factor corresponding to the current scan line. The attenuation factor is used to control the upper limit of the code rate to converge to the set target code. Rate;
所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:In the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, the parameter determination module is specifically used to:
根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
结合本公开的任一实施方式,所述装置还包括第二行数阈值确定模块,用于:In combination with any embodiment of the present disclosure, the device further includes a second row number threshold determination module, used for:
在当前图像的总行数大于第三行数阈值的情况下,根据所述总行数和第一比例系数,得到所述第二行数阈值;When the total number of lines of the current image is greater than the third line number threshold, the second line number threshold is obtained based on the total number of lines and the first proportional coefficient;
在图像的总行数小于第三行数阈值且大于第四行数阈值的情况下,将所述总行数减去第一预设行数值,得到所述第二行数阈值;When the total number of rows of the image is less than the third row number threshold and greater than the fourth row number threshold, subtract the first preset row value from the total number of rows to obtain the second row number threshold;
在图像的总行数小于第四行数阈值的情况下,将第二预设行数值确定为所述第二行数阈值。When the total number of lines of the image is less than the fourth line number threshold, the second preset line value is determined as the second line number threshold.
结合本公开的任一实施方式,所述装置还包括衰减因子确定模块,用于:In conjunction with any embodiment of the present disclosure, the device further includes an attenuation factor determination module for:
根据当前扫描行数和所述第二行数阈值,确定所述衰减因子。The attenuation factor is determined according to the current scan line number and the second line number threshold.
结合本公开的任一实施方式,所述衰减因子确定模块在根据当前扫描行数和所述第二行数阈值,确定所述衰减因子过程中,具体用于:Combined with any embodiment of the present disclosure, the attenuation factor determination module is specifically used in the process of determining the attenuation factor based on the current scan line number and the second line number threshold:
获取所述当前扫描行数和所述衰减因子的对应关系;Obtain the corresponding relationship between the current scanning line number and the attenuation factor;
根据所述当前扫描行数和所述对应关系,获取所述衰减因子。The attenuation factor is obtained according to the current scanning line number and the corresponding relationship.
结合本公开的任一实施方式,所述装置还包括范围确定模块,用于:In conjunction with any embodiment of the present disclosure, the device further includes a range determination module for:
响应于当前扫描行为所述第一行数阈值对应行的下一行,根据设定目标码率和设定范围系数,确定所述码率范围。In response to a line next to the line corresponding to the first line number threshold of the current scan line, the code rate range is determined according to the set target code rate and the set range coefficient.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作 为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本公开方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。As for the device embodiment, since it basically corresponds to the method embodiment, please refer to the partial description of the method embodiment for relevant details. The device embodiments described above are only illustrative. The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in a place, or can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. Persons of ordinary skill in the art can understand and implement the method without any creative effort.
图6示出了本公开根据一示例性实施例示出的一种电子设备框图。FIG. 6 shows a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
请参照附图6,其示例性的示出了一种电子设备的框图。例如,装置600可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。Please refer to FIG. 6 , which exemplarily shows a block diagram of an electronic device. For example, the device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
参照图6,装置600可以包括以下一个或多个组件:处理组件602,存储器604,电源组件606,多媒体组件608,音频组件610,输入/输出(I/O)的接口612,传感器组件614,以及通信部件616。Referring to Figure 6, the device 600 may include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input/output (I/O) interface 612, a sensor component 614, and communications component 616.
处理组件602通常控制装置600的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理部件602可以包括一个或多个处理器620来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件602可以包括一个或多个模块,便于处理组件602和其他组件之间的交互。例如,处理部件602可以包括多媒体模块,以方便多媒体组件608和处理组件602之间的交互。 Processing component 602 generally controls the overall operations of device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 602 may include one or more modules that facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
存储器604被配置为存储各种类型的数据以支持在设备600的操作。这些数据的示例包括用于在装置600上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器604可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。 Memory 604 is configured to store various types of data to support operations at device 600 . Examples of such data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
电力组件606为装置600的各种组件提供电力。电力组件606可以包括电源管理系统,一个或多个电源,及其他与为装置600生成、管理和分配电力相 关联的组件。 Power component 606 provides power to various components of device 600. Power components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 600.
多媒体组件608包括在所述装置600和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件608包括一个前置摄像头和/或后置摄像头。当装置600处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。 Multimedia component 608 includes a screen that provides an output interface between the device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action. In some embodiments, multimedia component 608 includes a front-facing camera and/or a rear-facing camera. When the device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each front-facing camera and rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
音频组件610被配置为输出和/或输入音频信号。例如,音频组件610包括一个麦克风(MIC),当装置600处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器604或经由通信部件616发送。在一些实施例中,音频组件610包括一个扬声器,用于输出音频信号。 Audio component 610 is configured to output and/or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when device 600 is in operating modes, such as call mode, recording mode, and speech recognition mode. The received audio signal may be further stored in memory 604 or sent via communication component 616 . In some embodiments, audio component 610 includes a speaker for outputting audio signals.
I/O接口612为处理组件602和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 612 provides an interface between the processing component 602 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc. These buttons may include, but are not limited to: Home button, Volume buttons, Start button, and Lock button.
传感器组件614包括一个或多个传感器,用于为装置600提供各个方面的状态评估。例如,传感器组件614可以检测到装置600的打开/关闭状态,组件的相对定位,例如所述组件为装置600的显示器和小键盘,传感器组件614可以检测装置600或装置600一个组件的位置改变,用户与装置600接触的存在或不存在,装置600方位或加速/减速和装置600的温度变化。传感器组件614可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件614可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件614可以包括加速度传感器, 陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor component 614 includes one or more sensors for providing various aspects of status assessment for device 600 . For example, the sensor component 614 may detect the open/closed state of the device 600, the relative positioning of components, such as the display and keypad of the device 600, the sensor component 614 may detect a change in position of the device 600 or a component of the device 600, The presence or absence of user contact with the device 600, device 600 orientation or acceleration/deceleration and temperature changes of the device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 614 may include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信部件616被配置为便于装置600和其他设备之间有线或无线方式的通信。装置600可以接入基于通信标准的无线网络,如WiFi,2G或3G,4G或5G或它们的组合。在一个示例性实施例中,通信部件616经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信部件616包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。 Communication component 616 is configured to facilitate wired or wireless communication between apparatus 600 and other devices. The device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G or 5G or a combination thereof. In one exemplary embodiment, the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communications component 616 includes a near field communications (NFC) module to facilitate short-range communications. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,装置600可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述电子设备的供电方法。In an exemplary embodiment, apparatus 600 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable Gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are implemented for executing the power supply method of the above electronic device.
本公开在示例性实施例中,提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器604,上述指令可由装置600的处理器620执行以完成上述电子设备的供电方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, the present disclosure provides a non-transitory computer-readable storage medium including instructions, such as a memory 604 including instructions. The instructions can be executed by the processor 620 of the device 600 to complete the power supply method of the electronic device. . For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
本公开还提供一种芯片,具体包括一个或多个接口电路和一个或多个处理器,所述接口电路用于从电子设备的存储器接收信号,并向所述处理器发送所述信号,所述信号包括存储器中存储的计算机指令。当所述处理器执行所述计算机指令时,使得所述电子设备执行本公开任一项所述的图像压缩方法。其中,所述芯片可以为常规的CPU(central processing unit,中央处理器)芯片、GPU(graphics processing unit,图形处理器)芯片等,也可以为人工智能技术专用的加速芯片,例如AI(Artificial Intelligence,人工智能)加速器等。The present disclosure also provides a chip, which specifically includes one or more interface circuits and one or more processors. The interface circuit is used to receive signals from a memory of an electronic device and send the signals to the processor. The signals include computer instructions stored in memory. When the processor executes the computer instructions, the electronic device is caused to execute the image compression method described in any one of the disclosure. Among them, the chip can be a conventional CPU (central processing unit, central processing unit) chip, a GPU (graphics processing unit, graphics processor) chip, etc., or it can be an acceleration chip dedicated to artificial intelligence technology, such as AI (Artificial Intelligence). , artificial intelligence) accelerator, etc.
本领域技术人员在考虑说明书及实践这里公开的公开后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the disclosure. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the disclosure is limited only by the appended claims.

Claims (25)

  1. 一种图像压缩方法,其特征在于,所述方法包括:An image compression method, characterized in that the method includes:
    获取当前扫描行的压缩参数和码流长度,以及首行至所述当前扫描行的码流总长度;Obtain the compression parameters and code stream length of the current scan line, as well as the total length of the code stream from the first line to the current scan line;
    根据当前扫描行的码流长度和首行至所述当前扫描行的码流总长度,确定当前扫描行的预测码率,所述预测码率表征基于当前扫描行对应的压缩参数对下一个扫描行至图像最后扫描行压缩后,所述图像的最终码率;Determine the predicted code rate of the current scan line based on the code stream length of the current scan line and the total length of the code stream from the first line to the current scan line. The predicted code rate represents the compression parameters for the next scan based on the compression parameters corresponding to the current scan line. After the last scan line of the image is compressed, the final code rate of the image;
    根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数;Determine the compression parameters of the next scan line according to the predicted code rate, code rate range and compression parameters of the current scan line;
    根据所述下一个扫描行的压缩参数,对下一个扫描行的像素数据进行压缩处理。According to the compression parameters of the next scanning line, the pixel data of the next scanning line is compressed.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:The method of claim 1, wherein determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
    在所述当前扫描行的预测码率大于码率上限的情况下,提升所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数;和/或,When the predicted code rate of the current scan line is greater than the upper limit of the code rate, increase the compression parameters of the current scan line to obtain the compression parameters of the next scan line; and/or,
    在所述当前扫描行的预测码率小于码率下限的情况下,降低所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数。When the predicted code rate of the current scan line is less than the lower limit of the code rate, the compression parameter of the current scan line is reduced to obtain the compression parameter of the next scan line.
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:The method of claim 1, wherein determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
    响应于当前扫描行数大于第一行数阈值,根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。In response to the current number of scan lines being greater than the first line number threshold, the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
  4. 根据权利要求3所述的方法,其特征在于,在所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数之前,还 包括:The method according to claim 3, characterized in that, before determining the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, it also includes:
    响应于当前扫描行数大于所述第一行数阈值且小于等于第二行数阈值,根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,对当前的码率范围的上限进行调整;In response to the current number of scan lines being greater than the first line number threshold and less than or equal to the second line number threshold, based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line , adjust the upper limit of the current code rate range;
    所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:Determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
    根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,对当前的码率范围的上限进行调整,包括:The method according to claim 4, characterized in that, based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line, the current code rate range is The upper limits are adjusted, including:
    根据预设规则,在所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率中,选取待检测预测码率;According to preset rules, select the predicted code rate to be detected among the predicted code rates of at least two scan lines before the current scan line and the predicted code rate of the current scan line;
    在所述待检测预测码率依次递增的情况下,提升所述码率上限;When the predicted code rate to be detected increases sequentially, increase the upper limit of the code rate;
    在所述待检测预测码率依次递减的情况下,降低所述码率上限。When the predicted code rate to be detected decreases in sequence, the upper limit of the code rate is lowered.
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method of claim 5, further comprising:
    在所述码率上限的提升次数超过提升次数阈值的情况下,停止提升所述码率上限,在所述码率上限的降低次数超过降低次数阈值的情况下,停止降低所述码率上限,或;When the number of increases in the upper code rate exceeds a threshold of increase times, stop increasing the upper limit of the code rate; when the number of decreases in the upper limit of the code rate exceeds a threshold of decreases, stop lowering the upper limit of the code rate, or;
    在提升后的码率上限超出提升范围阈值的情况下,停止提升当次码率上限;When the increased code rate upper limit exceeds the increase range threshold, stop increasing the current code rate upper limit;
    在降低后的码率上限超出降低范围阈值的情况下,停止降低当次码率上限。When the lowered upper limit of the code rate exceeds the reduction range threshold, stop lowering the upper limit of the current bit rate.
  7. 根据权利要求3所述的方法,其特征在于,在所述根据所述预测码率、 码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数之前,还包括:The method according to claim 3, characterized in that before determining the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, it further includes:
    响应于当前扫描行数大于第二行数阈值,根据当前扫描行对应的衰减因子,对当前的码率范围的上限进行调整,所述衰减因子用于控制所述码率上限收敛至设定目标码率;In response to the current number of scan lines being greater than the second line number threshold, the upper limit of the current code rate range is adjusted according to the attenuation factor corresponding to the current scan line. The attenuation factor is used to control the upper limit of the code rate to converge to the set target. Code rate;
    所述根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数,包括:Determining the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line includes:
    根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method of claim 7, further comprising:
    根据当前扫描行数和所述第二行数阈值,确定所述衰减因子。The attenuation factor is determined according to the current scan line number and the second line number threshold.
  9. 根据权利要求7所述的方法,其特征在于,所述根据当前扫描行数和所述第二设定阈值,确定所述衰减因子,包括:The method of claim 7, wherein determining the attenuation factor based on the current number of scanning lines and the second set threshold includes:
    获取所述当前扫描行数和所述衰减因子的对应关系;Obtain the corresponding relationship between the current scanning line number and the attenuation factor;
    根据所述当前扫描行数和所述对应关系,获取所述衰减因子。The attenuation factor is obtained according to the current scanning line number and the corresponding relationship.
  10. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method of claim 7, further comprising:
    在当前图像的总行数大于第三行数阈值的情况下,根据所述总行数和第一比例系数,得到所述第二行数阈值;When the total number of lines of the current image is greater than the third line number threshold, the second line number threshold is obtained based on the total number of lines and the first proportional coefficient;
    在图像的总行数小于第三行数阈值且大于第四行数阈值的情况下,将所述总行数减去第一预设行数值,得到所述第二行数阈值;When the total number of rows of the image is less than the third row number threshold and greater than the fourth row number threshold, subtract the first preset row value from the total number of rows to obtain the second row number threshold;
    在图像的总行数小于第四行数阈值的情况下,将第二预设行数值确定为所述第二行数阈值。When the total number of lines of the image is less than the fourth line number threshold, the second preset line value is determined as the second line number threshold.
  11. 根据权利要求3-10中任一项所述的方法,其特征在于,所述方法还 包括:The method according to any one of claims 3-10, characterized in that the method further includes:
    响应于当前扫描行为所述第一行数阈值对应行的下一行,根据设定目标码率和设定范围系数,确定所述码率范围。In response to a line next to the line corresponding to the first line number threshold of the current scan line, the code rate range is determined according to the set target code rate and the set range coefficient.
  12. 一种图像压缩装置,其特征在于,所述装置包括:An image compression device, characterized in that the device includes:
    参数获取模块:用于获取当前扫描行的压缩参数和码流长度,以及首行至所述当前扫描行的码流总长度;Parameter acquisition module: used to obtain the compression parameters and code stream length of the current scan line, as well as the total length of the code stream from the first line to the current scan line;
    码率预测模块:用于根据当前扫描行的码流长度和首行至所述当前扫描行的码流总长度,确定当前扫描行的预测码率,所述预测码率表征基于当前扫描行对应的压缩参数对下一个扫描行至图像最后扫描行压缩后,所述图像的最终码率;Code rate prediction module: used to determine the predicted code rate of the current scan line based on the code stream length of the current scan line and the total length of the code stream from the first line to the current scan line. The predicted code rate representation is based on the current scan line correspondence. The final code rate of the image after compression of the next scan line to the last scan line of the image using the compression parameters;
    参数确定模块:用于根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数;Parameter determination module: used to determine the compression parameters of the next scan line based on the predicted code rate, code rate range and compression parameters of the current scan line;
    压缩模块:用于根据所述下一个扫描行的压缩参数,对下一个扫描行的像素数据进行压缩处理。Compression module: used to compress the pixel data of the next scanning line according to the compression parameters of the next scanning line.
  13. 根据权利要求12所述的装置,其特征在于,所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:The device according to claim 12, wherein the parameter determination module specifically uses At:
    在所述当前扫描行的预测码率大于码率上限的情况下,提升所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数;和/或,When the predicted code rate of the current scan line is greater than the upper limit of the code rate, increase the compression parameters of the current scan line to obtain the compression parameters of the next scan line; and/or,
    在所述当前扫描行的预测码率小于码率下限的情况下,降低所述当前扫描行的压缩参数,得到下一个扫描行的压缩参数。When the predicted code rate of the current scan line is less than the lower limit of the code rate, the compression parameter of the current scan line is reduced to obtain the compression parameter of the next scan line.
  14. 根据权利要求12所述的装置,其特征在于,所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:The device according to claim 12, wherein the parameter determination module specifically uses At:
    响应于当前扫描行数大于第一行数阈值,根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。In response to the current number of scan lines being greater than the first line number threshold, the compression parameters of the next scan line are determined based on the predicted code rate, the code rate range, and the compression parameters of the current scan line.
  15. 根据权利要求14所述的装置,其特征在于,所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数之前,所述装置还包括范围调整模块,用于:The device according to claim 14, characterized in that, before the parameter determination module determines the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, the device Also included is a range adjustment module for:
    响应于当前扫描行数大于所述第一行数阈值且小于等于第二行数阈值,根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,对当前的码率范围的上限进行调整;In response to the current number of scan lines being greater than the first line number threshold and less than or equal to the second line number threshold, based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line , adjust the upper limit of the current code rate range;
    所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:In the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, the parameter determination module is specifically used to:
    根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
  16. 根据权利要求15所述的装置,其特征在于,所述参数确定模块在根据所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率,对当前的码率范围的上限进行调整过程中,具体用于:The device according to claim 15, wherein the parameter determination module determines the current scan line based on the predicted code rate of at least two scan lines before the current scan line and the predicted code rate of the current scan line. During the adjustment process, the upper limit of the code rate range is specifically used for:
    根据预设规则,在所述当前扫描行之前的至少两个扫描行的预测码率和所述当前扫描行的预测码率中,选取待检测预测码率;According to preset rules, select the predicted code rate to be detected among the predicted code rates of at least two scan lines before the current scan line and the predicted code rate of the current scan line;
    在所述待检测预测码率依次递增的情况下,提升所述码率上限;When the predicted code rate to be detected increases sequentially, increase the upper limit of the code rate;
    在所述待检测预测码率依次递减的情况下,降低所述码率上限。When the predicted code rate to be detected decreases in sequence, the upper limit of the code rate is lowered.
  17. 根据权利要求16所述的装置,其特征在于,所述装置还包括范围限制模块,用于:The device according to claim 16, characterized in that the device further includes a range limiting module for:
    在所述码率上限的提升次数超过提升次数阈值的情况下,停止提升所述码率上限,在所述码率上限的降低次数超过降低次数阈值的情况下,停止降低所述码率上限,或;When the number of increases in the upper code rate exceeds a threshold of increase times, stop increasing the upper limit of the code rate; when the number of decreases in the upper limit of the code rate exceeds a threshold of decreases, stop lowering the upper limit of the code rate, or;
    在提升后的码率上限超出提升范围阈值的情况下,停止提升当次码率上限;When the increased code rate upper limit exceeds the increase range threshold, stop increasing the current code rate upper limit;
    在降低后的码率上限超出降低范围阈值的情况下,停止降低当次码率上限。When the lowered upper limit of the code rate exceeds the reduction range threshold, stop lowering the upper limit of the current bit rate.
  18. 根据权利要求12所述的装置,其特征在于,所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:The device according to claim 12, wherein the parameter determination module specifically uses At:
    响应于当前扫描行数大于第二行数阈值,根据当前扫描行对应的衰减因子,对当前的码率范围的上限进行调整,所述衰减因子用于控制所述码率上限收敛至设定目标码率;In response to the current scan line number being greater than the second line number threshold, the upper limit of the current code rate range is adjusted according to the attenuation factor corresponding to the current scan line. The attenuation factor is used to control the upper limit of the code rate to converge to the set target. Code rate;
    所述参数确定模块在根据所述预测码率、码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数过程中,具体用于:In the process of determining the compression parameters of the next scan line based on the predicted code rate, code rate range and the compression parameters of the current scan line, the parameter determination module is specifically used to:
    根据所述预测码率、调整后的码率范围和当前扫描行的压缩参数,确定下一个扫描行的压缩参数。According to the predicted code rate, the adjusted code rate range and the compression parameters of the current scan line, the compression parameters of the next scan line are determined.
  19. 根据权利要求18所述的装置,其特征在于,所述装置还包括衰减因子确定模块,用于:The device according to claim 18, characterized in that the device further includes an attenuation factor determination module for:
    根据当前扫描行数和所述第二行数阈值,确定所述衰减因子。The attenuation factor is determined according to the current scan line number and the second line number threshold.
  20. 根据权利要求18所述的装置,其特征在于,所述衰减因子确定模块在根据当前扫描行数和所述第二行数阈值,确定所述衰减因子过程中,具体用于:The device according to claim 18, wherein the attenuation factor determination module, in the process of determining the attenuation factor based on the current scan line number and the second line number threshold, is specifically used to:
    获取所述当前扫描行数和所述衰减因子的对应关系;Obtain the corresponding relationship between the current scanning line number and the attenuation factor;
    根据所述当前扫描行数和所述对应关系,获取所述衰减因子。The attenuation factor is obtained according to the current scanning line number and the corresponding relationship.
  21. 根据权利要求18所述的装置,其特征在于,所述装置还包括第二行 数阈值确定模块,用于:The device according to claim 18, characterized in that the device further includes a second row number threshold determination module for:
    在当前图像的总行数大于第三行数阈值的情况下,根据所述总行数和第一比例系数,得到所述第二行数阈值;When the total number of lines of the current image is greater than the third line number threshold, the second line number threshold is obtained based on the total number of lines and the first proportional coefficient;
    在图像的总行数小于第三行数阈值且大于第四行数阈值的情况下,将所述总行数减去第一预设行数值,得到所述第二行数阈值;When the total number of rows of the image is less than the third row number threshold and greater than the fourth row number threshold, subtract the first preset row value from the total number of rows to obtain the second row number threshold;
    在图像的总行数小于第四行数阈值的情况下,将第二预设行数值确定为所述第二行数阈值。When the total number of lines of the image is less than the fourth line number threshold, the second preset line value is determined as the second line number threshold.
  22. 根据权利要求14~21中任一项所述的装置,其特征在于,所述装置还包括范围确定模块,用于:The device according to any one of claims 14 to 21, characterized in that the device further includes a range determination module for:
    响应于当前扫描行为所述第一行数阈值对应行的下一行,根据设定目标码率和设定范围系数,确定所述码率范围。In response to a line next to the line corresponding to the first line number threshold of the current scanning line, the code rate range is determined according to the set target code rate and the set range coefficient.
  23. 一种电子设备,其特征在于,所述电子设备包括:An electronic device, characterized in that the electronic device includes:
    存储器,用于存储处理器可执行指令;Memory, used to store instructions executable by the processor;
    处理器,被配置为执行所述存储器中的可执行指令以实现权利要求1~11任一项所述方法的步骤。A processor configured to execute executable instructions in the memory to implement the steps of the method according to any one of claims 1 to 11.
  24. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现权利要求1~11任一项所述的方法的步骤。A computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the steps of the method described in any one of claims 1 to 11 are implemented.
  25. 一种芯片,其特征在于,包括:A chip is characterized by including:
    一个或多个接口电路和一个或多个处理器;所述接口电路用于从电子设备的存储器接收信号,并向所述处理器发送所述信号,所述信号包括存储器中存储的计算机指令;当所述处理器执行所述计算机指令时,使得所述电子设备执行权利要求1~11任一项所述的图像压缩方法。One or more interface circuits and one or more processors; the interface circuit is configured to receive signals from the memory of the electronic device and send the signals to the processor, the signals including computer instructions stored in the memory; When the processor executes the computer instructions, the electronic device is caused to execute the image compression method according to any one of claims 1 to 11.
PCT/CN2022/096492 2022-05-31 2022-05-31 Image compression method and apparatus, electronic device, chip and storage medium WO2023230933A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202280004643.6A CN116438794B (en) 2022-05-31 2022-05-31 Image compression method, device, electronic equipment, chip and storage medium
PCT/CN2022/096492 WO2023230933A1 (en) 2022-05-31 2022-05-31 Image compression method and apparatus, electronic device, chip and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/096492 WO2023230933A1 (en) 2022-05-31 2022-05-31 Image compression method and apparatus, electronic device, chip and storage medium

Publications (1)

Publication Number Publication Date
WO2023230933A1 true WO2023230933A1 (en) 2023-12-07

Family

ID=87083713

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/096492 WO2023230933A1 (en) 2022-05-31 2022-05-31 Image compression method and apparatus, electronic device, chip and storage medium

Country Status (2)

Country Link
CN (1) CN116438794B (en)
WO (1) WO2023230933A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070133678A1 (en) * 2005-12-13 2007-06-14 Ryuji Sakai Information processing apparatus, control method and program
US20080063293A1 (en) * 2006-09-08 2008-03-13 Eastman Kodak Company Method for controlling the amount of compressed data
CN101159871A (en) * 2007-11-12 2008-04-09 中兴通讯股份有限公司 Macro block group video code rate control method
CN102938838A (en) * 2012-10-19 2013-02-20 西安电子科技大学 Joint Photographic Experts Group Lossless and near_lossless compression of conituous_tone still image (JPEG-LS) standard based dynamic code rate control method
CN106658006A (en) * 2017-01-12 2017-05-10 武汉轻工大学 Code rate control method for near lossless compression of JPEG-LS (Joint Photographic Experts Group-Lossless) image with near optimal rate distortion performance

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1998053613A1 (en) * 1997-05-20 1998-11-26 Motorola Inc. Apparatus, method and computer readable medium for scalable coding of video information
JPH1118083A (en) * 1997-06-25 1999-01-22 Sony Corp Digital signal coding method and system, signal recording medium and signal transmission method
DE602004011213T2 (en) * 2003-04-04 2009-01-08 Avid Technology, Inc., Tewksbury INTRAFRAME COMPRESSION AND DECOMPRIMATION OF VIDEO SIGNALS WITH A FIXED BITRATE
JP4063205B2 (en) * 2003-11-20 2008-03-19 セイコーエプソン株式会社 Image data compression apparatus and encoder
US7844097B2 (en) * 2007-12-03 2010-11-30 Samplify Systems, Inc. Compression and decompression of computed tomography data
CN103297775B (en) * 2013-05-17 2016-02-10 西安电子科技大学 Based on the Multispectral Image Compression System and method for that unicode rate distributes and controls
CN103916675B (en) * 2014-03-25 2017-06-20 北京工商大学 A kind of low latency inner frame coding method divided based on band
CN105205521B (en) * 2015-09-30 2018-09-14 立德高科(昆山)数码科技有限责任公司 Scan line in two-dimensional code scanning region is changed to the method and device of selected material
CN109379598B (en) * 2018-09-12 2021-11-19 合肥埃科光电科技有限公司 Image lossless compression method based on FPGA
CN113670608B (en) * 2021-07-21 2022-09-16 广州大学 Fault detection method, system, device and medium based on suffix tree and vector machine
CN114051144A (en) * 2021-11-09 2022-02-15 京东科技信息技术有限公司 Video compression method and device, computer equipment and storage medium
CN114357665B (en) * 2022-03-15 2022-05-20 成都中科翼能科技有限公司 Method for determining vibration limit value of compressor blade

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070133678A1 (en) * 2005-12-13 2007-06-14 Ryuji Sakai Information processing apparatus, control method and program
US20080063293A1 (en) * 2006-09-08 2008-03-13 Eastman Kodak Company Method for controlling the amount of compressed data
CN101159871A (en) * 2007-11-12 2008-04-09 中兴通讯股份有限公司 Macro block group video code rate control method
CN102938838A (en) * 2012-10-19 2013-02-20 西安电子科技大学 Joint Photographic Experts Group Lossless and near_lossless compression of conituous_tone still image (JPEG-LS) standard based dynamic code rate control method
CN106658006A (en) * 2017-01-12 2017-05-10 武汉轻工大学 Code rate control method for near lossless compression of JPEG-LS (Joint Photographic Experts Group-Lossless) image with near optimal rate distortion performance

Also Published As

Publication number Publication date
CN116438794A (en) 2023-07-14
CN116438794B (en) 2023-12-12

Similar Documents

Publication Publication Date Title
US10511772B2 (en) Image capturing device having continuous image capture
US11606564B2 (en) Video encoding code rate control method, apparatus, and device, and storage medium
EP3171596B1 (en) Image compression with adaptive quantization of regions of interest (roi)
CN107230182B (en) Image processing method and device and storage medium
KR101554639B1 (en) Method and apparatus with depth map generation
CN106412702B (en) Video clip intercepting method and device
US11061202B2 (en) Methods and devices for adjusting lens position
US10277829B1 (en) Video capture in low-light conditions
EP3173923A1 (en) Method and device for image display
JP7166171B2 (en) INTERFACE IMAGE DISPLAY METHOD, APPARATUS AND PROGRAM
EP4007289A1 (en) Video uploading method and apparatus, electronic device, and storage medium
WO2020168706A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN111381746B (en) Parameter adjusting method, device and storage medium
US9678868B2 (en) Method and device for optimizing memory
CN109547782B (en) MPM candidate list construction method and device, electronic equipment and storage medium
US20220415236A1 (en) Display control method, display control device and storage medium
CN115052150A (en) Video encoding method, video encoding device, electronic equipment and storage medium
WO2023230933A1 (en) Image compression method and apparatus, electronic device, chip and storage medium
CN105472228B (en) Image processing method and device and terminal
CN114595785A (en) Model training method and device, electronic equipment and storage medium
WO2024045967A1 (en) Model adjustment method and device, display device, and storage medium
US20170220401A1 (en) Method, device, and computer-readable storage medium for calling a process
CN115469816A (en) Read-write switching method, device and equipment of memory and storage medium
US10979628B2 (en) Image processing apparatus, image processing system, image processing method, and recording medium
KR20080107652A (en) A method of performing camera function in a portable terminal

Legal Events

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

Ref document number: 22944267

Country of ref document: EP

Kind code of ref document: A1