Image coding circuit and image coding method that calculate quantization distortion in frequency domain
Patent Information
- Application Number
- TW114129971
- Authority / Receiving Office
- TW · TW
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2026-11-11
- Estimated Expiration
- 2045-08-05
Smart Images

Figure TWG2TB001920742_001 
Figure TWG2TB001920742_002 
Figure TWG2TB001920742_003
Abstract
Claims
1. An image encoding circuit, comprising: a subtraction circuit for calculating a pixel difference between a predicted pixel and a current pixel; a discrete cosine transform circuit coupled to the subtraction circuit for performing a discrete cosine transform on the pixel difference to generate a discrete cosine transform coefficient; a quantization circuit coupled to the discrete cosine transform circuit for quantizing the discrete cosine transform coefficient to generate a quantized value; a storage circuit coupled to the quantization circuit for storing the quantized value; a frequency domain quantization distortion calculation circuit coupled to the quantization circuit for calculating a quantization distortion based on the quantized value and a quantization step size; a bit rate calculation circuit coupled to the quantization circuit for calculating a bit rate based on the quantized value; and a mode decision circuit coupled to the frequency domain quantization distortion calculation circuit and the bit rate calculation circuit for generating a predicted mode based on the quantization distortion and the bit rate. An inverse quantization circuit, coupled to the storage circuit and the mode decision circuit, is used to read the quantization value corresponding to the prediction mode from the storage circuit according to the prediction mode, and perform an inverse quantization operation on the quantization value to generate an inverse quantization value; an inverse discrete cosine transform circuit, coupled to the inverse quantization circuit, is used to perform an inverse discrete cosine transform operation on the inverse quantization value to generate an inverse discrete cosine transform coefficient; and a pixel reconstruction circuit, coupled to the inverse discrete cosine transform circuit, is used to generate a reconstructed pixel based on the current pixel and the inverse discrete cosine transform coefficient.
2. The image encoding circuit as described in claim 1, wherein, The quantization circuit stores the quantized value together with a tag corresponding to the quantized value in the storage circuit. The dequantization circuit finds the tag corresponding to the prediction mode from the storage circuit based on the prediction mode, and the dequantization circuit reads the quantized value corresponding to the tag.
3. The image encoding circuit as described in claim 2, wherein, This label indicates an intra-frame prediction of N*N pixels or an inter-frame prediction of N*N pixels, where N is an integer greater than 1.
4. The image encoding circuit as described in claim 2, wherein, The subtraction circuit is a first subtraction circuit. The frequency domain quantization distortion calculation circuit includes: a second subtraction circuit coupled to the quantization circuit, used to calculate a difference between the quantized value and an integer approximation of the quantized value; and a multiply-accumulate-add circuit coupled to the second subtraction circuit, used to perform a multiply-accumulate-add operation on the difference to generate a numerical value. And a multiplication circuit coupled to the multiply-accumulate circuit, used to multiply the value by the square of the quantization step size to generate a luminance component and a chrominance component.
5. The image encoding circuit as described in claim 2, wherein, The subtraction circuit is a first subtraction circuit. The frequency domain quantization distortion calculation circuit includes: a second subtraction circuit coupled to the quantization circuit, used to calculate a difference between the quantized value and an integer approximation of the quantized value; a scaling list compensation circuit used to generate a compensation value based on a scaling list and the quantized value; an addition circuit coupled to the second subtraction circuit and the scaling list compensation circuit, used to add the difference to the compensation value to generate a first value; and a multiply-accumulate-add circuit coupled to the addition circuit, used to perform a multiply-accumulate-add operation on the first value to generate a second value. And a multiplication circuit coupled to the multiply-accumulate circuit, used to multiply the second value by the square of the quantization step size to generate a luminance component and a chrominance component.
6. The image encoding circuit as described in claim 5, wherein, The compensation value is equal to the quantization value divided by the scaling list and then the quantization value subtracted.
7. The image encoding circuit as described in claim 2, wherein, The subtraction circuit is a first subtraction circuit. The frequency domain quantization distortion calculation circuit includes: a second subtraction circuit coupled to the quantization circuit, used to calculate a difference between the quantized value and an integer approximation of the quantized value; a first multiplication circuit coupled to the second subtraction circuit, used to multiply the difference by a multiplier to produce a first value; and a multiply-accumulate-add circuit coupled to the first multiplication circuit, used to perform a multiply-accumulate-add operation on the first value to produce a second value. And a second multiplication circuit, coupled to the multiply-accumulate circuit, is used to multiply the second value by the square of the quantization step size to generate a luminance component and a chrominance component.
8. The image encoding circuit as described in claim 7, wherein, The multiplier is the reciprocal of a scaling list.
9. An image coding method, comprising: calculating a pixel difference between a predicted pixel and a current pixel; performing a discrete cosine transform on the pixel difference to generate a discrete cosine transform coefficient; quantizing the discrete cosine transform coefficient to generate a quantized value; storing the quantized value in a storage circuit; calculating a quantization distortion based on the quantized value and a quantization step size; calculating a bit rate based on the quantized value; generating a prediction mode based on the quantization distortion and the bit rate; reading the quantized value corresponding to the prediction mode from the storage circuit based on the prediction mode; performing an inverse quantization operation on the quantized value to generate an inverse quantized value; performing an inverse discrete cosine transform operation on the inverse quantized value to generate an inverse discrete cosine transform coefficient; and generating a reconstructed pixel based on the current pixel and the inverse discrete cosine transform coefficient.
10. As in request item 9, wherein, The quantized value, together with a tag corresponding to the quantized value, is stored in the storage circuit. The step of reading the quantized value from the storage circuit according to the prediction pattern includes: finding the tag corresponding to the prediction pattern from the storage circuit based on the prediction pattern; and reading the quantized value corresponding to the tag.
11. As in request item 10, wherein, The step of calculating the quantization distortion based on the quantization value and the quantization step size includes: calculating a difference between the quantization value and an integer approximation of the quantization value; performing a multiplication-accumulation operation on the difference to produce a numerical value; and multiplying the numerical value by the square of the quantization step size to produce a luminance component and a chrominance component.
12. As in request item 10, wherein, The step of calculating the quantization distortion based on the quantization value and the quantization step size includes: calculating a difference between the quantization value and an integer approximation of the quantization value; generating a compensation value based on a scaling list and the quantization value; compensating for the difference based on the compensation value to generate a first value; and performing a multiply-accumulate operation on the first value to generate a second value. And multiply the second value by the square of the quantization step size to produce a luminance component and a chrominance component; wherein the compensation value is equal to the quantization value divided by the scaling list and then the quantization value is subtracted.
13. As in request item 10, wherein, The step of calculating the quantization distortion based on the quantization value and the quantization step size includes: calculating a difference between the quantization value and an integer approximation of the quantization value; multiplying the difference by a multiplier to produce a first value; and performing a multiplication-accumulation operation on the first value to produce a second value. And multiply the second value by the square of the quantization step size to produce a luminance component and a chrominance component; wherein the multiplier is the reciprocal of a scaling list.
14. An image encoding circuit, comprising: a subtraction circuit for calculating a pixel difference between a predicted pixel and a current pixel; a discrete cosine transform circuit coupled to the subtraction circuit for performing a discrete cosine transform on the pixel difference to generate a discrete cosine transform coefficient; a storage circuit coupled to the discrete cosine transform circuit for storing the discrete cosine transform coefficient; and a quantization circuit coupled to the discrete cosine transform circuit for quantizing the discrete cosine transform coefficient to generate a quantized value. An inverse quantization circuit, coupled to the quantization circuit, is used to perform an inverse quantization operation on the quantized value to generate an inverse quantized value; A bitrate calculation circuit, coupled to the quantization circuit, is used to calculate a bitrate based on the quantization value; a frequency domain quantization distortion calculation circuit, coupled to the storage circuit and the inverse quantization circuit, is used to calculate a quantization distortion based on the discrete cosine transform coefficients and the inverse quantization value; a discrete cosine inverse transform circuit, coupled to the inverse quantization circuit, is used to perform a discrete cosine inverse transform operation on the inverse quantization value to generate a discrete cosine inverse transform coefficient; a mode decision circuit, coupled to the frequency domain quantization distortion calculation circuit and the bitrate calculation circuit, is used to generate a prediction mode based on the quantization distortion and the bitrate; and a pixel reconstruction circuit, coupled to the discrete cosine inverse transform circuit, is used to generate a reconstructed pixel based on the current pixel and the discrete cosine inverse transform coefficient.
15. The image encoding circuit of claim 14, wherein, The subtraction circuit is a first subtraction circuit. The frequency domain quantization distortion calculation circuit includes: a second subtraction circuit coupled to the inverse quantization circuit, used to calculate a difference between the discrete cosine inverse conversion coefficient and the discrete cosine conversion coefficient; and a multiply-accumulate-add circuit coupled to the second subtraction circuit, used to perform a multiply-accumulate-add operation on the difference to generate a numerical value. And a multiplication circuit coupled to the multiply-accumulate circuit, used to multiply the value by the square of a quantization step size to generate a luminance component and a chrominance component.
Citation Information
Patent Citations
Video coding quantization method and device, electronic equipment and storage medium
CN115002461A
Cross component prediction
TW202518897A
