CN114071049B - Image scaling method, device and storage medium - Google Patents

Image scaling method, device and storage medium Download PDF

Info

Publication number
CN114071049B
CN114071049B CN202210034413.6A CN202210034413A CN114071049B CN 114071049 B CN114071049 B CN 114071049B CN 202210034413 A CN202210034413 A CN 202210034413A CN 114071049 B CN114071049 B CN 114071049B
Authority
CN
China
Prior art keywords
image
size
macro block
input
output
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210034413.6A
Other languages
Chinese (zh)
Other versions
CN114071049A (en
Inventor
刘善剑
陈勇坚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Jiangxinchuang Technology Co ltd
Original Assignee
Guangzhou Jiangxinchuang Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Jiangxinchuang Technology Co ltd filed Critical Guangzhou Jiangxinchuang Technology Co ltd
Priority to CN202210034413.6A priority Critical patent/CN114071049B/en
Publication of CN114071049A publication Critical patent/CN114071049A/en
Application granted granted Critical
Publication of CN114071049B publication Critical patent/CN114071049B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/01Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
    • H04N7/0135Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level involving interpolation processes

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to an image zooming method, an image zooming device and a storage medium, wherein the image zooming method comprises the following steps: acquiring a first image, and reading the first image into an input buffer area in blocks; adjusting the sizes of the input macro block and the output macro block according to the zoom rate, the input buffer area, the output buffer area and the interpolation window; reading pixel information of a second image with the same size as the input macro block from an input buffer area, and zooming the second image according to an interpolation algorithm to obtain a third image with the same size as the output macro block; and storing the third image in an output buffer area. The beneficial effect of this scheme does: and all data of the current buffer block are utilized to the maximum extent, so that the image scaling quality is improved.

Description

Image scaling method, device and storage medium
Technical Field
The invention relates to the field of image processing, in particular to an image scaling method, an image scaling device and a storage medium.
Background
In computer image processing and computer graphics, image scaling refers to the process of resizing a digital image. The main purpose of scaling the image is to generate a thumbnail corresponding to the original image so that the thumbnail conforms to the size of the display area.
In the prior art, when a block unit is processed, the operation sequence of macro blocks and the sizes of the macro blocks in a micro control unit are adjusted according to the scaling multiple and the rotation angle of a two-dimensional image, so that the reuse of intermediate operation data and the maximum utilization of cache resources are ensured.
Disclosure of Invention
The present invention is directed to solve at least one of the problems of the prior art, and provides an image scaling method, an image scaling apparatus, and a storage medium, which can improve the image scaling quality.
The technical scheme of the invention comprises an image scaling method, which comprises the following steps: acquiring a first image, and reading the first image into an input buffer area in a blocking manner; adjusting the sizes of the input macro block and the output macro block according to the zooming rate, the input buffer area, the output buffer area and the interpolation window; reading pixel information of a second image with the same size as the input macro block from the input buffer area, and zooming the second image according to an interpolation algorithm to obtain a third image with the same size as the output macro block; and storing the third image in an output buffer area.
According to the image scaling method, the size of an input macro block is adjusted, and the method comprises the following steps: when the scaling rate is larger than 1, configuring the size of the output macro block to be equal to the size of the output buffer area; obtaining the size of an input macro block according to the size and the scaling rate of the output macro block; sliding the interpolation window to a first position of the input macro block, and calculating the size of the fourth image after interpolation and amplification; when the size of the fourth image is smaller than the size of the output macro block, the size of the input macro block is increased, so that the size of the fourth image is equal to the size of the output macro block.
According to the image scaling method, adjusting the size of an output macro block comprises the following steps: when the scaling rate is less than 1, configuring the size of the input macro block to be equal to the size of the input buffer area; obtaining the size of an output macro block according to the size and the scaling rate of an input macro block; sliding the interpolation window to a second position of the output macro block, and calculating the size of a fifth image before interpolation and reduction; and when the size of the fifth image is larger than that of the input macro block, reducing the size of the output macro block to ensure that the size of the fifth image is equal to that of the input macro block.
According to the image scaling method, reading pixel information of a second image equal to the size of an input macroblock comprises: the input buffer area comprises at least one pair of buffer areas, and the input buffer area performs data caching in a ping-pong caching mode to realize caching of pixel information of the second image.
According to the image scaling method, scaling the second image comprises: splitting the second image into at least one vertical image segment, and performing vertical interpolation on the vertical image segment according to the vertical size of the output macro block to obtain a first intermediate image; splicing at least one first intermediate image to obtain a second intermediate image; splitting the second intermediate image into at least one horizontal image segment, and performing horizontal interpolation on the horizontal image segment according to the horizontal size of the output macro block to obtain a third intermediate image; and splicing at least one third intermediate image to obtain a third image.
According to the image scaling method, scaling the second image comprises: splitting the second image into at least one horizontal image segment, and performing horizontal interpolation on the horizontal image segment according to the horizontal size of the output macro block to obtain a fourth intermediate image; splicing at least one fourth intermediate image to obtain a fifth intermediate image; splitting the fifth intermediate image into at least one vertical image segment, and performing vertical interpolation on the vertical image segment according to the vertical size of the output macro block to obtain a sixth intermediate image; and splicing the at least one sixth intermediate image to obtain a third image.
According to the image scaling method, reading pixel information of a second image equal to the size of an input macroblock comprises: the second image is located at the boundary of the first image, and the pixels in the second image are copied to read the pixel information of the second image equal to the size of the input macro block.
The technical solution of the present invention also includes an image scaling apparatus, including: the first module is used for acquiring a first image, and the first image is read into an input buffer area in a blocking mode; a second module for adjusting the size of the input macroblock and the output macroblock according to the scaling rate, the input buffer, the output buffer and the interpolation window; a third module, configured to read pixel information of a second image with a size equal to that of the input macroblock from the input buffer, and scale the second image according to an interpolation algorithm to obtain a third image with a size equal to that of the output macroblock; and the fourth module is used for storing the third image in the output buffer area.
According to the image scaling apparatus, the second module comprises: a fourth sub-module, configured to configure the size of the output macroblock to be equal to the size of the output buffer when the scaling rate is greater than 1; obtaining the size of an input macro block according to the size and the scaling rate of the output macro block; sliding the interpolation window to a first position of the input macro block, and calculating the size of the fourth image after interpolation and amplification; when the size of the fourth image is smaller than that of the output macro block, increasing the size of the input macro block to ensure that the size of the fourth image is equal to that of the output macro block; a fifth sub-module, configured to configure the size of the input macroblock to be equal to the size of the input buffer when the scaling rate is less than 1; obtaining the size of an output macro block according to the size and the scaling rate of an input macro block; sliding the interpolation window to a second position of the output macro block, and calculating the size of a fifth image before interpolation and reduction; and when the size of the fifth image is larger than that of the input macro block, reducing the size of the output macro block to ensure that the size of the fifth image is equal to that of the input macro block.
The invention also relates to a computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, carries out any of the method steps.
The invention has the beneficial effects that: according to the zoom rate, the input and output buffer areas and the interpolation window, the sizes of the input and output macro blocks are adjusted, the operation window is adjusted, and for a zoom scene with small magnification, the system bandwidth can be saved, the power consumption is reduced, and the processing efficiency is improved; the input buffer comprises at least one pair of buffers and operates in a ping-pong manner to further improve the efficiency of reading data from the memory.
Drawings
The invention is further illustrated with reference to the following figures and examples:
FIG. 1 is a flow chart illustrating an image scaling method according to an embodiment of the present invention;
FIG. 2 is a sub-flowchart of an image scaling method according to an embodiment of the invention;
FIG. 3 is a detailed flowchart of an image scaling method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram according to an embodiment of the present invention;
FIG. 5 is a flow chart illustrating further details of an image scaling method according to an embodiment of the present invention;
FIG. 6 is yet another schematic diagram according to an embodiment of the present invention;
FIG. 7 is a further sub-flowchart illustrating an image scaling method according to an embodiment of the present invention;
FIG. 8 is a flow chart illustrating another detail of an image scaling method according to an embodiment of the present invention;
fig. 9 is a block diagram showing an image scaling apparatus according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to the present preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to like elements throughout.
In the description of the present invention, unless otherwise explicitly defined, terms such as set, etc. should be broadly construed, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the detailed contents of the technical solutions.
As shown in fig. 1, an image scaling method includes the steps of:
s100, acquiring a first image, and reading the first image into an input buffer area in a blocking mode; the first image is an original image to be zoomed, for example, a picture uploaded by a terminal such as a mobile phone, a computer, a camera and the like, or a picture obtained by framing a video uploaded by the terminal, or a part of the picture; due to the limitation of the buffer, the second image, which is usually blocked into at least one for the first image, is stored in the buffer, and the third image is obtained by scaling the second image, and the third image is stored in the output buffer.
S200, adjusting the sizes of an input macro block and an output macro block according to the zoom rate, the input buffer area, the output buffer area and the interpolation window;
s300, reading pixel information of a second image with the same size as the input macro block from the input buffer area, and zooming the second image according to an interpolation algorithm to obtain a third image with the same size as the output macro block; and storing the third image in an output buffer area.
Detailed embodiments of the above steps are described below in various embodiments.
As shown in fig. 2, S200 specifically includes:
s210, when the zoom ratio is larger than 1, configuring the size of an output macro block to be equal to the size of an output buffer area; obtaining the size of an input macro block according to the size and the scaling rate of the output macro block; sliding the interpolation window to a first position of the input macro block, and calculating the size of the fourth image after interpolation and amplification; when the size of the fourth image is smaller than the size of the output macro block, the size of the input macro block is increased, so that the size of the fourth image is equal to the size of the output macro block.
The interpolation window is a rectangular array consisting of vertical pixel points and horizontal pixel points, and the image is zoomed by adopting the existing interpolation algorithm.
Configuring the size of an input buffer area to be 32x32, and the size of an output buffer area to be 32x 32;
inputting a horizontal initial phase h _ phase _ init and a vertical initial phase v _ phase _ init of macro block scaling;
the scaling factor is k, wherein k is greater than 0, and k is the ratio of the size of the third image to the size of the second image;
configuring a window of scaling interpolation into mxn, wherein mxn is less than 32, and during configuration of the window of scaling interpolation, a horizontal left boundary copy point number l is required to be specified, wherein l is (m/2) -1, and a right boundary copy point number r is m/2; copying the number u of points on the vertical upper boundary, wherein u is (n/2-1), and copying the number d of points on the lower boundary, wherein d is n/2;
as shown in fig. 3, S210 specifically includes:
s211, configuring initial conditions: when k >1, for the enlargement operation of the image, the output macroblock size is configured to be equal to the size of the output buffer, 32x32, the horizontal interpolation window size is configured to be 6x6, h _ phase _ init =1, k =2,
s212, obtaining the size of the input macro block according to the size and the scaling rate of the output macro block;
the horizontal size of the input macroblock is shown in formula (1), where in _ hsize is the horizontal size of the input macroblock, h _ phase _ init is the horizontal initial phase h _ phase _ init of the input macroblock scaling, and the scaling factor is k.
in_hsize=(32-h_phase_init+1)/k (1)
The horizontal size of the input macroblock is calculated to be 16, and similarly to equation (1), the vertical size of the input macroblock is calculated to obtain the size of the input macroblock 16x 16.
S213, sliding the interpolation window to the first position of the input macro block, and calculating the size of the fourth image after interpolation and amplification; when the size of the fourth image is smaller than that of the output macro block, increasing the size of the input macro block to ensure that the size of the fourth image is equal to that of the output macro block;
taking a horizontal enlargement as an example, as shown in fig. 4:
starting position of interpolation window: setting the horizontal interpolation window size to be 6x1, h _ phase _ init =1, k =2, and specifying the number of horizontal left boundary copy points l to be 2 boundary pixel information, wherein h _ phase _ init =1 and is smaller than m/2=3, and the starting point does not need to be adjusted;
the end position of the interpolation window, out _ hsize =32, when the sliding window is located at the first position, where the first position is that the center of the sliding window is aligned with the end position of the input macro block, at this time, the horizontal size of the fourth image obtained by interpolation is 31 pixel points, and the size of the output macro block is 32 pixel points, at this time, the size of the input macro block needs to be increased, when the horizontal size of the input macro block is 19 pixel points, the center of the horizontal interpolation window is aligned with the end position of the input macro block, at this time, the horizontal size of the fourth image obtained by interpolation is 32 pixel points, and therefore, the horizontal size of the final input macro block is adjusted to be 19. Similarly, the adjustment process of the vertical size of the input macroblock is not described herein again.
S220, when the zoom ratio is smaller than 1, configuring the size of the input macro block to be equal to the size of the input buffer area; obtaining the size of an output macro block according to the size and the scaling rate of an input macro block; sliding the interpolation window to a second position of the output macro block, and calculating the size of a fifth image before interpolation and reduction; and when the size of the fifth image is larger than that of the input macro block, reducing the size of the output macro block to ensure that the size of the fifth image is equal to that of the input macro block.
As shown in fig. 5, S220 specifically includes:
s221, configuring initial conditions: when k <1, for the reduction operation of the image, the size of the input macroblock is configured to be equal to the size of the input buffer to be 32x32, the horizontal interpolation window size is configured to be 6x6, h _ phase _ init =1, k =1/2,
s222, obtaining the size of an output macro block according to the size and the scaling rate of the input macro block;
the horizontal size of the output macroblock is shown in formula (2), where out _ hsize is the horizontal size of the output macroblock, h _ phase _ init is the horizontal initial phase h _ phase _ init of the input macroblock scaling, and the scaling factor is k.
out_hsize =(32-h_phase_init+1) x k (2)
The horizontal size of the output macroblock is calculated to be 16, and similarly to equation (2), the vertical size of the output macroblock is calculated to be 16 × 16.
S223, sliding the interpolation window to the second position of the output macro block, and calculating the size of the fifth image before interpolation and reduction; and when the size of the fifth image is larger than that of the input macro block, reducing the size of the output macro block to ensure that the size of the fifth image is equal to that of the input macro block.
Taking horizontal reduction as an example, as shown in fig. 6:
starting position of interpolation window: setting the horizontal interpolation window size to be 6x1, h _ phase _ init =1, k =1/2, and specifying the number of horizontal left boundary copy points l to be 2 boundary pixel information, wherein h _ phase _ init =1 and is less than m/2=3, and the starting point does not need to be adjusted;
the end point position of the interpolation window, when the sliding window is located at the second position, wherein the second position is the end point position of the sliding window with the center aligned with the output macro block, the center of the sliding window is aligned with the end point position of the output macro block at the moment, namely the 16 th pixel point of the output macro block, the size of the window is 6, the horizontal size of the fifth image obtained by interpolation is 34 pixel points at the moment,
inputting 32 pixel points of the macro block, wherein the size of the output macro block needs to be reduced, when the horizontal size of the output macro block is 15 pixel points, the center of the horizontal interpolation window is aligned with the end point position of the output macro block, namely, the 15 th pixel point of the macro block is output, and the horizontal size of the fifth image obtained by interpolation is 32 pixel points, so that the horizontal size of the final output macro block is adjusted to be 15. Similarly, the adjustment process of the vertical size of the output macroblock is not described herein again.
S300, reading pixel information of a second image with the same size as the input macro block from the input buffer area, and zooming the second image according to an interpolation algorithm to obtain a third image with the same size as the output macro block; storing the third image in the output buffer area, as shown in fig. 7, specifically includes:
s310, the input buffer area comprises at least one pair of buffer areas, and the input buffer area caches data in a ping-pong cache mode to realize caching of pixel information of the second image. For example, a buffer area required by 2 32 × 32 pixels is opened up in the input buffer area to implement the buffering of the pixel information of the second image, and the 2 buffer areas are performed in a ping-pong manner, so that the image data passing through the buffer areas can be sent to the next module for processing without pause, thereby completing the seamless buffering and processing of the image data.
And S320, the second image is positioned at the boundary of the first image, and the pixels in the second image are copied to read the pixel information of the second image equal to the size of the input macro block.
S330, splitting the second image into at least one vertical image segment, and performing vertical interpolation on the vertical image segment according to the vertical size of the output macro block to obtain a first intermediate image; splicing at least one first intermediate image to obtain a second intermediate image; splitting the second intermediate image into at least one horizontal image segment, and performing horizontal interpolation on the horizontal image segment according to the horizontal size of the output macro block to obtain a third intermediate image; and splicing at least one third intermediate image to obtain a third image.
As shown in fig. 8, S330 specifically includes:
s331, splitting the second image MxN into N image slices of Mx1 size, and performing vertical interpolation on any one of the N image slices of Mx1 size according to the vertical size of the output macroblock, to obtain a first intermediate image.
In one embodiment, multiple line buffers can be used to provide multiple interpolation windows for vertical scaling, and the hardware defaults to use the maximum hardware resources, so that the maximum source image data which can be supported by the hardware in the interpolation algorithm is guaranteed to achieve the best effect; in addition, the software can properly reduce the number of line buffers according to the zoom magnification in an application scene, for example, when the zoom magnification is 1, the software can close all line buffers to reduce unnecessary resource waste.
S332, splicing the N first intermediate images to form a second intermediate image which is zoomed in the vertical direction, and setting the size of the second intermediate image as M1 xN.
The method comprises the steps of zooming the second image, namely, vertically zooming and horizontally zooming, and finally obtaining a third image, wherein the vertically zooming is to vertically interpolate N image segments with the size of Mx1, and the N vertically interpolated image segments are required to be spliced for horizontally interpolating the second image.
S333, convert the second intermediate image into M1 image slices of 1xN size, and perform horizontal interpolation on any one of the M1 image slices of 1xN size according to the horizontal size of the output macroblock, so as to obtain a third intermediate image.
And S334, splicing the M1 third intermediate images to obtain a third image, wherein the size of the third image is equal to that of the output macro block.
S340, splitting the second image into at least one horizontal image segment, and performing horizontal interpolation on the horizontal image segment according to the horizontal size of the output macro block to obtain a fourth intermediate image; splicing at least one fourth intermediate image to obtain a fifth intermediate image; splitting the fifth intermediate image into at least one vertical image segment, and performing vertical interpolation on the vertical image segment according to the vertical size of the output macro block to obtain a sixth intermediate image; and splicing the at least one sixth intermediate image to obtain a third image. Similar to step S330, the description will not be repeated here.
The invention adjusts the size of the input and output macro block through the zoom ratio, the input and output buffer area and the interpolation window, and respectively carries out vertical and horizontal interpolation zoom on the original image according to the size of the output macro block, for reducing the original image, fine adjustment is carried out, the size of the output macro block is reduced, and a clearer target image is ensured to be output; for enlarging the original image, when the size of the output macro block is equal to the size of the input buffer, fine adjustment is needed to increase the size of the input macro block, and the input macro block is not limited at this time and is much smaller than the size of the buffer, so that the maximum and clearest target image can be obtained in the above manner. The invention can utilize all data of the current buffer block to the maximum extent.
In a second aspect, an embodiment of the present invention further provides an image scaling apparatus, as shown in fig. 9, specifically including:
the first module is used for acquiring a first image, and the first image is read into an input buffer area in a blocking mode;
a second module for adjusting the size of the input macroblock and the output macroblock according to the scaling rate, the input buffer, the output buffer and the interpolation window;
a third module, configured to read pixel information of a second image with a size equal to that of the input macroblock from the input buffer, and scale the second image according to an interpolation algorithm to obtain a third image with a size equal to that of the output macroblock; and the fourth module is used for storing the third image in the output buffer area.
The second module includes: a fourth sub-module, configured to configure the size of the output macroblock to be equal to the size of the output buffer when the scaling rate is greater than 1; obtaining the size of an input macro block according to the size and the scaling rate of the output macro block; sliding the interpolation window to a first position of the input macro block, and calculating the size of the fourth image after interpolation and amplification; when the size of the fourth image is smaller than that of the output macro block, increasing the size of the input macro block to ensure that the size of the fourth image is equal to that of the output macro block; a fifth sub-module, configured to configure the size of the input macroblock to be equal to the size of the input buffer when the scaling rate is less than 1; obtaining the size of an output macro block according to the size and the scaling rate of an input macro block; sliding the interpolation window to a second position of the output macro block, and calculating the size of a fifth image before interpolation and reduction; and when the size of the fifth image is larger than that of the input macro block, reducing the size of the output macro block to ensure that the size of the fifth image is equal to that of the input macro block.
It should be recognized that the method steps in embodiments of the present invention may be embodied or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer readable memory. The method may use standard programming techniques. Each program may be implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose.
Further, the operations of processes described herein can be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and/or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) collectively executed on one or more processors, by hardware, or combinations thereof. The computer program includes a plurality of instructions executable by one or more processors.
Further, the method may be implemented in any type of computing platform operatively connected to a suitable interface, including but not limited to a personal computer, mini computer, mainframe, workstation, networked or distributed computing environment, separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and the like. Aspects of the invention may be embodied in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optically read and/or write storage medium, RAM, ROM, or the like, such that it may be read by a programmable computer, which when read by the storage medium or device, is operative to configure and operate the computer to perform the procedures described herein. Further, the machine-readable code, or portions thereof, may be transmitted over a wired or wireless network. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media include instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The invention also includes the computer itself when programmed according to the methods and techniques described herein.
A computer program can be applied to input data to perform the functions described herein to transform the input data to generate output data that is stored to non-volatile memory. The output information may also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including particular visual depictions of physical and tangible objects produced on a display.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.

Claims (10)

1. An image scaling method, characterized by comprising the steps of:
acquiring a first image, and reading the first image into an input buffer area in blocks;
adjusting the sizes of an input macro block and an output macro block according to the scaling rate, the size of the input buffer area, the size of the output buffer area and an interpolation window;
reading pixel information of a second image with the same size as the input macro block from the input buffer area, and zooming the second image according to an interpolation algorithm to obtain a third image with the same size as the output macro block;
and storing the third image in the output buffer area.
2. The image scaling method of claim 1, adjusting the size of the input macroblock, comprising:
when the scaling rate is larger than 1, configuring the size of the output macro block to be equal to the size of the output buffer area;
obtaining the size of the input macro block according to the size of the output macro block and the scaling rate;
sliding the interpolation window to a first position of the input macro block, and calculating the size of the fourth image after interpolation and amplification;
and when the size of the fourth image is smaller than that of the output macro block, increasing the size of the input macro block to enable the size of the fourth image to be equal to that of the output macro block.
3. The image scaling method of claim 1, adjusting the size of the output macroblock, comprising:
when the scaling rate is smaller than 1, configuring the size of the input macro block to be equal to the size of the input buffer area;
obtaining the size of an output macro block according to the size and the scaling rate of the input macro block;
sliding the interpolation window to a second position of the output macro block, and obtaining the size of a fifth image according to the size of the output macro block, so that the size of the image obtained after interpolation and reduction of the fifth image is equal to the size of the output macro block;
and when the size of the fifth image is larger than that of the input macro block, reducing the size of the output macro block to ensure that the size of the fifth image is equal to that of the input macro block.
4. The image scaling method of claim 1, the reading pixel information of a second image equal in size to the input macroblock, comprising:
the input buffer area comprises at least one pair of buffer areas, and the input buffer area caches data in a ping-pong cache mode so as to realize caching of pixel information of the second image.
5. The image scaling method of claim 1, said scaling said second image, comprising:
splitting the second image into at least one vertical image segment, and performing vertical interpolation on the vertical image segment according to the vertical size of the output macro block to obtain a first intermediate image;
splicing at least one first intermediate image to obtain a second intermediate image;
splitting the second intermediate image into at least one horizontal image segment, and performing horizontal interpolation on the horizontal image segment according to the horizontal size of the output macro block to obtain a third intermediate image;
and splicing at least one third intermediate image to obtain a third image.
6. The image scaling method of claim 1, said scaling said second image, comprising:
splitting the second image into at least one horizontal image segment, and performing horizontal interpolation on the horizontal image segment according to the horizontal size of the output macro block to obtain a fourth intermediate image;
splicing at least one fourth intermediate image to obtain a fifth intermediate image;
splitting the fifth intermediate image into at least one vertical image segment, and performing vertical interpolation on the vertical image segment according to the vertical size of the output macro block to obtain a sixth intermediate image;
and splicing at least one sixth intermediate image to obtain the third image.
7. The image scaling method of claim 1, the reading pixel information of a second image equal in size to the input macroblock, comprising:
the second image is located at the boundary of the first image, and pixels in the second image are copied to read pixel information of the second image equal to the size of the input macro block.
8. An image scaling apparatus, comprising:
the device comprises a first module, a second module and a third module, wherein the first module is used for acquiring a first image, and the first image is read into an input buffer area in a blocking mode;
a second module, configured to adjust the sizes of the input macroblock and the output macroblock according to a scaling rate, the size of the input buffer, the size of the output buffer, and an interpolation window;
a third module, configured to read pixel information of a second image with a size equal to that of the input macroblock from the input buffer, and scale the second image according to an interpolation algorithm to obtain a third image with a size equal to that of the output macroblock;
and the fourth module is used for storing the third image in the output buffer area.
9. The image scaling apparatus of claim 8, wherein the second module comprises:
a fourth sub-module, configured to configure the size of the output macroblock to be equal to the size of the output buffer when the scaling rate is greater than 1; obtaining the size of the input macro block according to the size of the output macro block and the scaling rate; sliding the interpolation window to a first position of the input macro block, and calculating the size of the fourth image after interpolation and amplification; when the size of the fourth image is smaller than the size of the output macro block, increasing the size of the input macro block to make the size of the fourth image equal to the size of the output macro block;
a fifth sub-module, configured to configure the size of the input macroblock to be equal to the size of the input buffer when the scaling rate is less than 1; obtaining the size of an output macro block according to the size and the scaling rate of an input macro block; sliding the interpolation window to a second position of the output macro block, and obtaining the size of a fifth image according to the size of the output macro block, so that the size of the image obtained after interpolation and reduction of the fifth image is equal to the size of the output macro block; and when the size of the fifth image is larger than that of the input macro block, reducing the size of the output macro block to ensure that the size of the fifth image is equal to that of the input macro block.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN202210034413.6A 2022-01-13 2022-01-13 Image scaling method, device and storage medium Active CN114071049B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210034413.6A CN114071049B (en) 2022-01-13 2022-01-13 Image scaling method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210034413.6A CN114071049B (en) 2022-01-13 2022-01-13 Image scaling method, device and storage medium

Publications (2)

Publication Number Publication Date
CN114071049A CN114071049A (en) 2022-02-18
CN114071049B true CN114071049B (en) 2022-05-10

Family

ID=80230841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210034413.6A Active CN114071049B (en) 2022-01-13 2022-01-13 Image scaling method, device and storage medium

Country Status (1)

Country Link
CN (1) CN114071049B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8351510B1 (en) * 2008-02-01 2013-01-08 Zenverge, Inc. Motion compensated noise reduction using shared motion estimation engine

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8872856B1 (en) * 2008-08-14 2014-10-28 Zenverge, Inc. Macroblock based scaling of images using reduced memory bandwidth
CN102831571B (en) * 2011-07-08 2014-10-22 图芯芯片技术(上海)有限公司 Design method of five-order filter for realizing graphic image resizing and rotation in one step in flow-line manner
AU2019359490B2 (en) * 2018-10-12 2023-03-16 Huawei Technologies Co., Ltd. Apparatus and method for deblocking filter in video coding
CN113709494B (en) * 2021-06-23 2024-04-09 珠海全志科技股份有限公司 Image decompression method and device for super-resolution reconstruction

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8351510B1 (en) * 2008-02-01 2013-01-08 Zenverge, Inc. Motion compensated noise reduction using shared motion estimation engine

Also Published As

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

Similar Documents

Publication Publication Date Title
JP6673381B2 (en) Image processing device
CN115052104B (en) Image processing method, electronic device, and non-volatile computer-readable storage medium
CN110213490B (en) Image anti-shake method and device, electronic equipment and storage medium
KR101134668B1 (en) Image generation method, device, its program and recording medium with program recorded therein
JP5522174B2 (en) Video encoding device
JP5974089B2 (en) Method and apparatus for reframing and encoding video signals
CN110570367A (en) Fisheye image correction method, electronic device and storage medium
JP2016208307A (en) Image processing apparatus, control method therefor, and program
US8111305B2 (en) Apparatus for photographing having multiple zoom devices and associated method
US9462189B2 (en) Piecewise perspective transform engine
CN105407280A (en) Panoramic image synthesizing method and system
CN111402139A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
US8269859B2 (en) Photographing apparatus that performs distortion correction in association with digital and optical zoom, method of controlling the same, and recording medium having recorded thereon computer program to implement the method
CN114071049B (en) Image scaling method, device and storage medium
CN112351193A (en) Zooming method based on time sequence control, image acquisition equipment and storage medium
CN116489457A (en) Video display control method, device, equipment, system and storage medium
JP2007129403A (en) Image encoder and image processing system
JP2015015699A (en) Image processing system, information processing method and program
CN112308808A (en) Image processing method and device and electronic equipment
JP6622546B2 (en) Image processing apparatus and method
JP6524644B2 (en) Image processing apparatus and electronic device
JP4155401B2 (en) 3D image generation method, 3D image generation apparatus, 3D image generation program, and recording medium
JP4288210B2 (en) Image processing apparatus, display apparatus, image processing method, and program
JP2014072797A (en) Imaging apparatus and control method thereof
CN117011146B (en) Image scaling method and device, electronic equipment and storage medium

Legal Events

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