CN107222743B - Image processing method, device and system - Google Patents

Image processing method, device and system Download PDF

Info

Publication number
CN107222743B
CN107222743B CN201710535189.8A CN201710535189A CN107222743B CN 107222743 B CN107222743 B CN 107222743B CN 201710535189 A CN201710535189 A CN 201710535189A CN 107222743 B CN107222743 B CN 107222743B
Authority
CN
China
Prior art keywords
macro block
intra
macroblock
value
pixel
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
CN201710535189.8A
Other languages
Chinese (zh)
Other versions
CN107222743A (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.)
Xian Wanxiang Electronics Technology Co Ltd
Original Assignee
Xian Wanxiang Electronics Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xian Wanxiang Electronics Technology Co Ltd filed Critical Xian Wanxiang Electronics Technology Co Ltd
Priority to CN201710535189.8A priority Critical patent/CN107222743B/en
Publication of CN107222743A publication Critical patent/CN107222743A/en
Application granted granted Critical
Publication of CN107222743B publication Critical patent/CN107222743B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • 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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The disclosure provides an image processing method, device and system, wherein a macro block type and a prediction mode of a current macro block are determined according to a first statistical value, a second statistical value and a first threshold value by acquiring the first statistical value of the same pixel in the current macro block and a first macro block and acquiring the second statistical value of the same pixel in the current macro block and a second macro block. By adopting the intra-frame prediction technology, the intra-frame prediction mode is determined by combining the image content to distinguish the macro block type of the current macro block, and each macro block does not need to be calculated for many times, so that the calculation complexity is greatly reduced, and the compression efficiency is improved.

Description

Image processing method, device and system
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method, an apparatus, and a system for processing a graphic.
Background
With the popularization of high-definition images and high resolution, the encoding and decoding of images and videos become more important, and the encoding and decoding technology also wins a good era of challenges and opportunities. The most popular coding technique at present is the video coding standard based on h.264/AVC (or simply h.264), where intra prediction is one of the coding techniques employed by h.264.
In the intra prediction technology, h.264 provides three intra prediction modes: the prediction mode includes a 4 × 4 luminance block intra prediction mode, a 16 × 16 luminance block intra prediction mode, and an 8 × 8 chrominance block intra prediction mode, and a plurality of prediction modes are provided for each prediction mode, wherein 9 prediction modes are available for the intra prediction of the 4 × 4 luminance block, and 4 prediction modes are available for the 16 × 16 luminance block intra prediction mode and the 8 × 8 chrominance block intra prediction mode. For which prediction mode to select, the encoder typically uses the prediction mode with the least difference between the prediction block and the coding block. In order to obtain balance between coding quality and code Rate, h.264 adopts a Rate Distortion Optimization (RDO) strategy to select an optimal coding mode, and finally selects a minimum Rate Distortion cost mode as an optimal intra-frame prediction mode by traversing all possible coding modes.
When the brightness macro block is predicted, the minimum cost of 9 4 × 4 prediction modes and the minimum cost of 4 16 × 16 prediction modes are calculated in sequence according to the RDO policy requirement, and then a smaller prediction mode is selected from the minimum costs. With this intra prediction technique, 592 RDO calculations are required for each macroblock to determine the intra prediction mode of each macroblock, which is too complex. In addition, this method does not sufficiently consider image contents, resulting in low compression efficiency.
Disclosure of Invention
The embodiment of the disclosure provides an image processing method, an image processing device and an image processing system. The technical scheme is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided an image processing method, including:
acquiring a first statistical value of the same pixel in a current macro block and a first macro block, wherein the first macro block is adjacent to the current macro block and positioned on a first side of the current macro block;
acquiring a second statistical value of the current macro block and a second macro block with the same pixels, wherein the second macro block is adjacent to the current macro block and is positioned on a second side of the current macro block;
and determining the macroblock type and the prediction mode of the current macroblock according to the first statistic value, the second statistic value and the first threshold, wherein the macroblock type comprises an intra-frame prediction macroblock and a non-intra-frame prediction macroblock.
The intra-frame prediction mode is determined by combining the image content, so that the calculation complexity is reduced, and the compression efficiency is improved.
In one embodiment, obtaining the first statistical value of the current macroblock and the first macroblock having the same pixel comprises: comparing whether the pixel value of each pixel in the current macro block is the same as the pixel value of the corresponding pixel in the first macro block; and counting the number of the same pixel values of the current macro block and the first macro block to obtain a first statistical value.
In one embodiment, obtaining the second statistical value of the same pixel in the current macroblock and the second macroblock comprises: comparing whether the pixel value of each pixel in the current macro block is the same as the pixel value of the corresponding pixel in the second macro block; and counting the number of the same pixel values in the current macro block and the second macro block to obtain a second statistical value.
In one embodiment, determining the type and the prediction mode of the current macroblock according to the first statistic, the second statistic, and the first threshold comprises:
comparing the first statistical value with the second statistical value, and comparing whether the first statistical value and the second statistical value are both greater than or equal to a first threshold value;
when the first statistic value is larger than or equal to the second statistic value and the first statistic value is larger than or equal to the first threshold value, the current macro block is an intra-frame prediction macro block, and the prediction mode of the current macro block is a first prediction mode;
when the second statistic value is larger than the first statistic value and is larger than or equal to the first threshold value, the current macro block is an intra-frame prediction macro block, and the prediction mode of the current macro block is a second prediction mode;
and when the first statistic value is larger than or equal to the second statistic value and the first statistic value is smaller than the first threshold value, or when the second statistic value is larger than the first statistic value and the second statistic value is smaller than the first threshold value, the current macro block is a non-intra-prediction macro block.
In one embodiment, the first threshold is greater than or equal to a second threshold equal to the product of the size of the current macroblock and a preset coefficient.
According to a second aspect of the embodiments of the present disclosure, there is provided an image processing method including:
acquiring a frame image, wherein the frame image comprises a plurality of macro blocks;
according to the first aspect and the method provided by any embodiment of the first aspect, a macroblock type and a prediction mode of each macroblock in a frame image are determined, wherein the macroblock type includes an intra-predicted macroblock and a non-intra-predicted macroblock;
coding the prediction mode of each intra-frame prediction macro block to obtain first coded data;
coding the pixel value of each non-intra-frame prediction macro block to obtain second coded data;
and packaging the first coded data and the second coded data into a code stream and sending the code stream to the terminal equipment.
By adopting the intra-frame prediction technology, the macroblock type of each macroblock in a frame picture is distinguished and the prediction mode is determined by considering the image content, and each macroblock does not need to be calculated for many times, so that the calculation complexity is greatly reduced, and the compression efficiency is improved while the lossless compression is achieved.
In one embodiment, when each intra-predicted macroblock has a pixel residual, encoding the prediction mode of each intra-predicted macroblock to obtain first encoded data includes:
coding the prediction mode of each intra-frame prediction macro block and the pixel residual error of each intra-frame prediction macro block to obtain first coded data; the pixel residual is obtained according to the pixel difference value between the intra-frame prediction macro block and the first macro block or the second macro block.
According to a third aspect of the embodiments of the present disclosure, there is provided a method of image processing, including:
receiving a code stream sent by a server;
decoding the coded data of each non-intra-frame prediction macro block in the code stream to obtain a pixel value of each non-intra-frame prediction macro block;
decoding the coded data of each intra-frame prediction macro block in the code stream to obtain a pixel value of each intra-frame prediction macro block;
and displaying the picture according to the pixel value of each non-intra-prediction macro block and the pixel value of each intra-prediction macro block.
The image content is considered when the coded data in the code stream is coded, lossless compression is achieved, rapid decoding can be achieved in the decoding process, and decoding efficiency is improved.
In one embodiment, decoding the encoded data of each intra-prediction macroblock in the code stream to obtain the pixel value of each intra-prediction macroblock includes:
decoding the coded data of each intra-frame prediction macro block in the code stream to obtain a prediction mode of each intra-frame prediction macro block;
when the prediction mode of the intra-frame prediction macro block is a first prediction mode, the pixel value of the intra-frame prediction macro block is the pixel value of a first macro block;
when the prediction mode of the intra-frame prediction macro block is the second prediction mode, the pixel value of the intra-frame prediction macro block is the pixel value of the second macro block;
the first macroblock is adjacent to the intra-predicted macroblock and located on a first side of the intra-predicted macroblock, and the second macroblock is adjacent to the intra-predicted macroblock and located on a second side of the intra-predicted macroblock.
In one embodiment, the method further comprises:
decoding pixel residual error coded data of each intra-frame prediction macro block in the code stream;
and superposing the decoded pixel residual error to the pixel value of the corresponding intra-frame prediction macro block.
According to a fourth aspect of embodiments of the present disclosure, there is provided a server, including:
the device comprises an acquisition module, a judging module and a judging module, wherein the acquisition module is used for acquiring a first statistical value of the same pixels in a current macro block and a first macro block, and the first macro block is adjacent to the current macro block and positioned on a first side of the current macro block;
the acquisition module is used for acquiring a second statistical value of the same pixel in the current macro block and a second macro block, wherein the second macro block is adjacent to the current macro block and is positioned on the second side of the current macro block;
and the determining module is used for determining the macroblock type and the prediction mode of the current macroblock according to the first statistical value, the second statistical value and the first threshold, wherein the macroblock type comprises an intra-frame prediction macroblock and a non-intra-frame prediction macroblock.
In one embodiment, the obtaining module includes:
the comparison submodule is used for comparing whether the pixel value of each pixel in the current macro block is the same as the pixel value of the corresponding pixel in the first macro block or not;
and the counting submodule is used for counting the number of the same pixel values of the current macro block and the first macro block to obtain a first statistical value.
In one embodiment, the comparing sub-module is configured to compare whether a pixel value of each pixel in the current macroblock is the same as a pixel value of a corresponding pixel in the second macroblock;
and the counting submodule is used for counting the number of the same pixel values in the current macro block and the second macro block to obtain a second statistical value.
In one embodiment, the determining module includes:
the first determining submodule is used for comparing the first statistical value with the second statistical value and comparing whether the first statistical value and the second statistical value are both larger than or equal to a first threshold value;
the second determining submodule is used for determining that the current macro block is an intra-frame prediction macro block and the prediction mode of the current macro block is the first prediction mode when the first statistical value is larger than or equal to the second statistical value and the first statistical value is larger than or equal to the first threshold value;
the second determining submodule is used for determining that the current macro block is an intra-frame prediction macro block and the prediction mode of the current macro block is a second prediction mode when the second statistic value is larger than the first statistic value and is larger than or equal to the first threshold value;
and the second determining submodule is used for determining that the current macro block is a non-intra-prediction macro block when the first statistical value is greater than or equal to the second statistical value and the first statistical value is smaller than the first threshold value, or when the second statistical value is greater than the first statistical value and the second statistical value is smaller than the first threshold value.
In one embodiment, the first threshold is greater than or equal to a second threshold equal to the product of the size of the current macroblock and a preset coefficient.
According to a fifth aspect of embodiments of the present disclosure, there is provided a server including:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a frame of image, and the frame of image comprises a plurality of macro blocks;
a determining module, configured to determine a macroblock type and a prediction mode of each macroblock in a frame of image according to the first aspect or a method corresponding to any embodiment of the first aspect, where the macroblock type includes an intra-predicted macroblock and a non-intra-predicted macroblock;
the encoding module is used for encoding the prediction mode of each intra-frame prediction macro block to obtain first encoded data;
the encoding module is used for encoding the pixel value of each non-intra-frame prediction macro block to obtain second encoded data;
and the sending module is used for packing the first coded data and the second coded data into a code stream and sending the code stream to the terminal equipment.
In one embodiment, the encoding module is further configured to encode the prediction mode of each intra-prediction macroblock and the pixel residual of each intra-prediction macroblock to obtain first encoded data; the pixel residual is obtained according to the pixel difference value between the intra-frame prediction macro block and the first macro block or the second macro block.
According to a sixth aspect of the embodiments of the present disclosure, there is provided a terminal device, including:
the receiving module is used for receiving the code stream sent by the server;
the decoding module is used for decoding the coded data of each non-intra-frame prediction macro block in the code stream to obtain the pixel value of each non-intra-frame prediction macro block;
the decoding module is used for decoding the coded data of each intra-frame prediction macro block in the code stream to obtain the pixel value of each intra-frame prediction macro block;
and the processing module is used for displaying pictures according to the pixel value of each non-intra-prediction macro block and the pixel value of each intra-prediction macro block.
In one embodiment, the decoding module comprises:
the decoding submodule is used for decoding the coded data of each intra-frame prediction macro block in the code stream to obtain the prediction mode of each intra-frame prediction macro block;
the processing submodule is used for setting the pixel value of the intra-frame prediction macro block as the pixel value of the first macro block when the prediction mode of the intra-frame prediction macro block is the first prediction mode;
the processing submodule is used for setting the pixel value of the intra-frame prediction macro block as the pixel value of the second macro block when the prediction mode of the intra-frame prediction macro block is the second prediction mode;
the first macroblock is adjacent to the intra-predicted macroblock and located on a first side of the intra-predicted macroblock, and the second macroblock is adjacent to the intra-predicted macroblock and located on a second side of the intra-predicted macroblock.
In one embodiment, the decoding sub-module is further configured to decode pixel residual encoded data of each intra-prediction macroblock in the code stream;
and the processing sub-module is also used for superposing the decoded pixel residual error to the pixel value of the corresponding intra-frame prediction macro block.
According to a seventh aspect of the embodiments of the present disclosure, an intra prediction system is provided, which includes the server provided in any one of the fifth aspect and the fifth aspect, and the terminal device provided in any one of the sixth aspect and the sixth aspect.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart of a method of image processing provided by an embodiment of the present disclosure;
FIG. 2 is a flowchart of a method of image processing provided by an embodiment of the present disclosure;
FIG. 3 is a flowchart of a method of image processing provided by an embodiment of the present disclosure;
fig. 4 is a flowchart of a screen display process of a mobile terminal according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a prediction mode of a mobile terminal according to an embodiment of the present disclosure;
FIG. 6 is a block diagram of a server provided by an embodiment of the present disclosure;
FIG. 7 is a block diagram of a server provided by an embodiment of the present disclosure;
FIG. 8 is a block diagram of a server provided by an embodiment of the present disclosure;
fig. 9 is a structural diagram of a terminal device provided in an embodiment of the present disclosure;
fig. 10 is a structural diagram of a terminal device according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
An embodiment of the present disclosure provides an image processing method, as shown in fig. 1, the method including the following steps:
101. a first statistical value of the same pixel in the current macro block and the first macro block is obtained.
The first macro block is adjacent to the current macro block and located on a first side of the current macro block. Macroblocks are basic coding units in the h.264 standard, and each macroblock has a size of m × n pixels, and typically, the size of a macroblock is 16 × 16 pixels. It is understood that the sizes of the current macroblock and the first macroblock are the same.
The method for acquiring the first statistical value of the current macro block and the first macro block with the same pixel comprises the following steps:
comparing whether the pixel value of each pixel in the current macro block is the same as the pixel value of the corresponding pixel in the first macro block;
and counting the number of the same pixel values in the current macro block and the first macro block to obtain a first statistical value.
In an embodiment of the present invention, whether the pixel value of each pixel in the current macroblock is the same as the pixel value of the corresponding pixel in the first macroblock may be comparing the pixel value of each pixel in the current macroblock with the pixel value of the corresponding pixel in the first macroblock, and if the pixel values of the corresponding two pixels are equal, meaning that the two pixels are the same pixel, the number of the same pixel points in the current macroblock and the first macroblock is added by 1, so as to obtain a first statistical value of the same pixel in the current macroblock and the first macroblock by statistics.
In another embodiment of the present invention, comparing whether the pixel value of each pixel in the current macroblock is the same as the pixel value of the corresponding pixel in the first macroblock may be to find a difference between the pixel value of each pixel in the current macroblock and the pixel value of the corresponding pixel in the first macroblock, if the difference between the pixel values of the corresponding two pixels is 0, which means that the two pixels are the same pixel, the number of the same pixel in the current macroblock and the first macroblock is increased by 1, and then the first statistical value of the same pixel in the current macroblock and the first macroblock is obtained through statistics.
In an embodiment of the present invention, whether the pixel value of each pixel in the current macroblock is the same as the pixel value of the corresponding pixel in the first macroblock or not is compared, which may be to obtain an absolute value of a difference between the pixel value of each pixel in the current macroblock and the pixel value of the corresponding pixel in the first macroblock, if the absolute value of the difference between the pixel values of two corresponding pixels is 0, which means that the two pixels are the same pixel, the number of the same pixel points in the current macroblock and the first macroblock is added by 1, and then a first statistical value that the current macroblock and the first macroblock have the same pixel is obtained through statistics.
It can be understood that, if the pixel values of all corresponding pixels in the current macroblock and the first macroblock are the same, the size of the first statistical value is the size of the current macroblock; if the pixel values of all corresponding pixels in the current macro block and the first macro block are different, the size of the first statistical value is 0; therefore, the range of the first statistical value is [0, the size of the current macroblock ].
102. And acquiring a second statistical value of the same pixel in the current macro block and the second macro block.
The second macro block is adjacent to the current macro block and located above the current macro block. As described in step 101, the current macroblock and the second macroblock are the same size, and the first macroblock differs from the second macroblock only in that the first macroblock and the second macroblock are located at different positions.
Obtaining a second statistic value of the same pixel in the current macroblock and the second macroblock comprises:
comparing whether the pixel value of each pixel in the current macro block is the same as the pixel value of the corresponding pixel in the second macro block;
and counting the number of the same pixel values in the current macro block and the second macro block to obtain a second statistical value.
In an embodiment of the present invention, whether the pixel value of each pixel in the current macroblock is the same as the pixel value of the corresponding pixel in the second macroblock or not may be comparing the pixel value of each pixel in the current macroblock with the pixel value of the corresponding pixel in the second macroblock, and if the pixel values of the corresponding two pixels are equal, meaning that the two pixels are the same pixel, the number of the same pixel points in the current macroblock and the second macroblock is added by 1, so as to obtain a second statistical value of the same pixel in the current macroblock and the second macroblock through statistics.
In another embodiment of the present invention, comparing whether the pixel value of each pixel in the current macroblock is the same as the pixel value of the corresponding pixel in the second macroblock may be to find a difference between the pixel value of each pixel in the current macroblock and the pixel value of the corresponding pixel in the second macroblock, if the difference between the pixel values of the corresponding two pixels is 0, which means that the two pixels are the same pixel, the number of the same pixel in the current macroblock and the second macroblock is increased by 1, and then the second statistical value having the same pixel in the current macroblock and the second macroblock is obtained through statistics.
In another embodiment of the present invention, whether the pixel value of each pixel in the current macroblock is the same as the pixel value of the corresponding pixel in the second macroblock or not is compared, which may be to obtain an absolute value of a difference between the pixel value of each pixel in the current macroblock and the pixel value of the corresponding pixel in the second macroblock, if the absolute value of the difference between the pixel values of two corresponding pixels is 0, which means that the two pixels are the same pixel, the number of the same pixel points in the current macroblock and the second macroblock is increased by 1, and then a second statistical value having the same pixel in the current macroblock and the second macroblock is obtained through statistics.
It can be understood that, if the pixel values of all corresponding pixels in the current macroblock and the second macroblock are the same, the size of the second statistical value is the size of the current macroblock; if the pixel values of all corresponding pixels in the current macro block and the second macro block are different, the size of the second statistical value is 0; therefore, the second statistical value ranges from [0, the size of the current macroblock ].
103. And determining the macroblock type and the prediction mode of the current macroblock according to the first statistical value, the second statistical value and the first threshold value.
The macroblock types include intra-predicted macroblocks and non-intra-predicted macroblocks. The intra-prediction macro block means that the current macro block is the same as or similar to the first macro block or the second macro block, and the pixel value of the current macro block can be obtained through the pixel value of the first macro block or the second macro block; a non-intra predicted macroblock means that the current macroblock is not the same or similar to the first macroblock or the second macroblock. The prediction mode of the current macroblock is only said when the macroblock type of the current macroblock is an intra prediction macroblock.
In addition, the first threshold is greater than or equal to a second threshold equal to the product of the size of the current macroblock and a preset coefficient. The first threshold and the preset coefficient may be adjusted according to actual requirements, and the embodiments of the present disclosure are described only by way of example.
In the embodiment of the present invention, determining the macroblock type and the prediction mode of the current macroblock according to the first statistical value, the second statistical value, and the first threshold value includes:
comparing the first statistical value with the second statistical value, and comparing whether the first statistical value and the second statistical value are both greater than or equal to a first threshold value;
when the first statistic value is larger than or equal to the second statistic value and the first statistic value is larger than or equal to the first threshold value, the current macro block is an intra-frame prediction macro block, and the prediction mode of the current macro block is a first prediction mode;
when the second statistic value is larger than the first statistic value and is larger than or equal to the first threshold value, the current macro block is an intra-frame prediction macro block, and the prediction mode of the current macro block is a second prediction mode;
and when the first statistic value is larger than or equal to the second statistic value and the first statistic value is smaller than the first threshold value, or when the second statistic value is larger than the first statistic value and the second statistic value is smaller than the first threshold value, the current macro block is a non-intra-prediction macro block.
The first prediction mode and the second prediction mode may be marked with different marks, may be marked with 0 and 1, and may also be marked with a and b. The embodiment of the present invention is not particularly limited thereto.
For better understanding of the above steps, it is assumed that the macroblock size is 16 × 16 pixels, the second threshold is 256 × 90%, the first threshold is greater than or equal to 256 × 90%, and the first prediction mode and the second prediction mode are respectively marked with 0 and 1.
When the first statistic value is greater than or equal to the second statistic value and the first statistic value is greater than or equal to 256 × 90%, the current macroblock is an intra-frame prediction macroblock, and the prediction mode of the current macroblock is 0;
when the second statistic value is larger than the first statistic value and the second statistic value is larger than or equal to 256 × 90%, the current macroblock is an intra-frame prediction macroblock, and the prediction mode of the current macroblock is 1;
when the first statistic value is greater than or equal to the second statistic value and the first statistic value is less than 256 × 90%, or when the second statistic value is greater than the first statistic value and the second statistic value is less than 256 × 90%, the current macroblock is a non-intra-predicted macroblock.
According to the intra-frame prediction method provided by the embodiment of the disclosure, the macroblock type and the prediction mode of the current macroblock are determined according to the first statistical value, the second statistical value and the first threshold value by acquiring the first statistical value of the current macroblock and the first macroblock, and the second statistical value of the current macroblock and the second macroblock, wherein the first statistical value and the second statistical value have the same pixels. By adopting the intra-frame prediction technology, the intra-frame prediction mode is determined by combining the image content to distinguish the macro block type of the current macro block, and each macro block does not need to be calculated for many times, so that the calculation complexity is greatly reduced, and the compression efficiency is improved.
Based on the intra prediction method of the current macroblock described in the embodiment corresponding to fig. 1, the intra prediction method of a frame of image will be described with reference to fig. 2.
201. A frame of image is acquired.
Wherein, a frame of image comprises a plurality of macro blocks. The frame is a single image picture of the minimum unit in the image animation, and one frame is a static picture. In the embodiment of the invention, the picture can be adaptively decomposed into a plurality of macro blocks with the height of m and the width of n according to the resolution of the screen, and each macro block has m multiplied by n pixel points.
202. According to the method described in the steps 101-103, the macroblock type and the prediction mode of each macroblock in a frame of image are determined.
The types of macroblocks include intra-predicted macroblocks and non-intra-predicted macroblocks, and the prediction modes of the intra-predicted macroblocks include a first prediction mode and a second prediction mode, as described in steps 101-103. Therefore, according to the method described in steps 101-103, step 202 distinguishes the macroblock type for each macroblock in a frame of image, and determines the prediction mode of the macroblock when the macroblock type is intra-prediction macroblock.
203. And coding the prediction mode of each intra-frame prediction macro block to obtain first coded data.
When each intra-frame prediction macro block has no pixel residual, only the prediction mode of each intra-frame prediction macro block needs to be coded to obtain first coded data. In an embodiment of the present invention, the run length of the prediction mode of each intra-predicted macroblock may be encoded, and the pixel residue of each intra-predicted macroblock may be entropy encoded to obtain the first encoded data. The Run Length Coding (RLC) Coding, also called "Run Length Coding" or "Run Length Coding", is a statistical Coding, and the Coding belongs to lossless compression Coding, and common Run Length Coding formats include TGA, packbit, PCX, ILBM, and the like.
When each intra-frame prediction macro block has a pixel residual error, the prediction mode of each intra-frame prediction macro block and the pixel residual error of each intra-frame prediction macro block need to be coded to obtain first coded data; the prediction mode for each intra-predicted macroblock may be run-length encoded, with the pixel residuals for each intra-predicted macroblock being entropy encoded. Entropy coding, i.e. coding without losing any information in accordance with the entropy principle during coding, includes the following steps: shannon (Shannon) coding, Huffman (Huffman) coding and arithmetic coding (arithmetric coding); entropy coding converts a series of element symbols representing a video sequence into a compressed code stream for transmission or storage.
In the embodiment of the present invention, the pixel residual of each intra-predicted macroblock is obtained according to the pixel difference between the intra-predicted macroblock and the first macroblock or the second macroblock.
The example is given by taking the macroblock size of 16 × 16 as an example. When the macroblock is an intra-frame prediction macroblock and the prediction mode is a first mode, the macroblock is the same as or similar to the first macroblock; when the macro block is the same as the first macro block, the pixel values of the corresponding pixels of the macro block and the second macro block are the same, the pixel residual error of the macro block and the first macro block is 0, when the macro block is similar to the first macro block, the pixel values of the corresponding pixels of the macro block and the first macro block are partially different, and the difference value of the pixel values of the partially different pixels is the pixel residual error of the macro block and the first macro block.
When the macroblock is an intra-frame prediction macroblock and the prediction mode is a second prediction mode, the macroblock is the same as or similar to the second macroblock; when the macro block is the same as the second macro block, the pixel values of the corresponding pixels of the macro block and the second macro block are the same, and the pixel residual error of the intra-frame prediction macro block and the second macro block is 0; when the macro block is similar to the second macro block, the pixel values of the corresponding pixels in the macro block and the second macro block are partially different, and the difference value of the pixel values of the partially different pixels is the pixel residual between the macro block and the second macro block.
204. And coding the pixel value of each non-intra-prediction macro block to obtain second coded data.
In an embodiment of the present invention, the pixel values of each non-intra-predicted macroblock may be compressed and encoded by JPEG to obtain the second encoded data. JPEG is English abbreviation of Joint Photographic sources Group, Chinese is called as Joint image expert Group, the Group belongs to ISO international standardization organization, and is mainly responsible for customizing coding method of static digital image, namely JPEG algorithm.
205. And packaging the first coded data and the second coded data into a code stream and sending the code stream to the terminal equipment.
The intra-frame prediction method provided by the embodiment of the disclosure determines a macroblock type and a prediction mode of each macroblock in a frame image by obtaining the frame image, when the macroblock type is the intra-frame prediction mode, according to the prediction mode of each intra-frame prediction macroblock, a pixel residual of each intra-frame prediction macroblock is obtained, the prediction mode and the pixel residual of each intra-frame prediction macroblock are encoded to obtain first encoded data, a pixel value of each non-intra-frame prediction macroblock is encoded to obtain second encoded data, and the first encoded data and the second encoded data are packed into a code stream and sent to a terminal device. By adopting the intra-frame prediction technology, the macroblock type of each macroblock in a frame picture is distinguished and the prediction mode is determined by considering the image content, and each macroblock does not need to be calculated for many times, so that the calculation complexity is greatly reduced, and the compression efficiency is improved while the lossless compression is achieved.
When the terminal device receives the code stream sent by the server, the operation of the terminal device will be described with reference to fig. 3.
301. And receiving the code stream sent by the server.
The code stream comprises coded data of an intra-frame prediction macro block and coded data of a non-intra-frame prediction macro block. In the embodiment of the invention, the coded data of the intra-frame prediction macro block can be obtained by JPEG coding, and the coded data of the non-intra-frame prediction macro block can be obtained by run-length and entropy coding.
302. And decoding the coded data of each non-intra-frame prediction macro block in the code stream to obtain the pixel value of each non-intra-frame prediction macro block.
In the embodiment of the invention, when the coded data of each non-intra-frame prediction macro block in the code stream is coded by JPEG, JPEG decoding can be carried out on each non-intra-frame prediction macro block to obtain the pixel value of each intra-frame prediction macro block. It can be understood that when the coded data of each non-intra-prediction macro block in the code stream adopts other coding modes, each non-intra-prediction macro block can be adaptively decoded correspondingly.
303. And decoding the coded data of each intra-frame prediction macro block in the code stream to obtain the pixel value of each intra-frame prediction macro block.
In this embodiment of the present invention, decoding the encoded data of each intra-frame prediction macroblock in the code stream to obtain a pixel value of each intra-frame prediction macroblock includes:
decoding the coded data of each intra-frame prediction macro block in the code stream to obtain a prediction mode of each intra-frame prediction macro block;
when the prediction mode of the intra-frame prediction macro block is a first prediction mode, the pixel value of the intra-frame prediction macro block is the pixel value of a first macro block;
when the prediction mode of the intra-frame prediction macro block is the second prediction mode, the pixel value of the intra-frame prediction macro block is the pixel value of the second macro block;
the first macro block is adjacent to the intra-frame prediction macro block and located on the first side of the intra-frame prediction macro block, and the second macro block is adjacent to the intra-frame prediction macro block and located on the second side of the intra-frame prediction macro block.
When the code stream contains the pixel residual of each intra-frame prediction macro block, the method further comprises the following steps: decoding pixel residual error coded data of each intra-frame prediction macro block in the code stream; and superposing the decoded pixel residual error to the pixel value of the corresponding intra-frame prediction macro block.
Based on the intra prediction method described in fig. 1 and 2, the prediction modes of the intra-predicted macroblock include a first prediction mode and a second prediction mode. If the server encodes the prediction mode of the intra-frame prediction macro block by using the run length during encoding, the terminal equipment decodes the run length in the code stream at the moment to obtain the prediction mode of each intra-frame prediction macro block; if the server encodes the pixel residual of the intra-prediction macro block by entropy coding during encoding, the terminal equipment decodes the entropy coding at the moment to obtain the residual of each intra-prediction macro block. And further, when the prediction mode of the intra-frame prediction macro block is a first prediction mode, copying the pixel value of the first macro block to the intra-frame prediction macro block, when the prediction mode of the intra-frame prediction macro block is a second prediction mode, copying the pixel value of the second macro block to the intra-frame prediction macro block, and then superposing the decoded pixel residual on the corresponding pixel value to obtain the pixel value of the intra-frame prediction macro block.
304. And displaying the picture according to the pixel value of each non-intra-prediction macro block and the pixel value of each intra-prediction macro block.
In the intra-frame prediction method provided by the embodiment of the disclosure, terminal equipment receives a code stream sent by a server, and decodes coded data of each non-intra-frame prediction macro block in the code stream to obtain a pixel value of each non-intra-frame prediction macro block; decoding the coded data of each intra-frame prediction macro block in the code stream to obtain a pixel value of each intra-frame prediction macro block; and displaying the picture according to the pixel value of each non-intra-prediction macro block and the pixel value of each intra-prediction macro block. The image content is considered when the coded data in the code stream is coded, lossless compression is achieved, rapid decoding can be achieved in the decoding process, and decoding efficiency is improved.
Based on the intra-frame prediction method described in the embodiments corresponding to fig. 1 to fig. 3, the intra-frame prediction method will be specifically described below with reference to the mobile zero terminal system shown in fig. 4.
In the mobile zero terminal system, because the real-time requirement, the rate and the compression rate of encoding one frame are also important, and therefore, the efficiency can be greatly improved by the low-complexity encoding scheme. The mobile zero terminal picture has the characteristics of stability and obvious blocking, the stability is caused by the fact that the mobile zero terminal picture is rarely switched rapidly, the blocking is obvious because the key contents of the composite picture of the mobile zero terminal are all in the center of a screen, the periphery of the composite picture of the mobile zero terminal is often a simple background, the background parts are similar approximately, and only the difference of individual pixel points exists, so that the whole picture does not need to be coded. And the image layout of the mobile terminal application is often from left to right or from top to bottom, and many similar parts exist. During the encoding process, the left and upper contents are encoded first, so only comparison with the left and upper contents is needed, and if they are completely identical, they are directly copied, and if they are 90% similar, they are copied first, and then the residual is entropy-encoded. For portions that do not satisfy such a similarity, a JPEG encoder is used for encoding.
Referring to fig. 4, the specific operation process of the server side is as follows:
a. the display card generates a frame of picture.
b. According to the resolution of the screen, the picture is adaptively decomposed into a plurality of macro blocks with the width of m and the height of n pixels, and each macro block is m multiplied by n pixel points. Without loss of generality, the size of a macroblock defaults to 16 × 16 pixels.
c. Calculating the absolute value of the difference of pixel points of each macro block and the left macro block one by one, if the difference is 0, adding 1 to the same pixel point, and counting the same pixel number n of the two macro blocksl
d. Calculating the absolute value of the difference between each macro block and the pixel point of the macro block one by one, if the difference is 0, adding 1 to the same pixel point, and counting the same pixel number n of the two macro blocksu
e. If n isl>nuAnd n isl256, then the macroblock prediction mode is marked as 0, marking the macroblock as an intra-prediction macroblock; if n isu>nlAnd n isu256, then the macroblock prediction mode is marked as 1, marking the macroblock as an intra-predicted macroblock.
f. If n isl>nuAnd n islWhen the macroblock prediction mode is more than or equal to 256 multiplied by 90 percent, marking the macroblock as an intra prediction macroblock as 0; if n isu>nlAnd n isuAnd 256 x 90%, the macroblock prediction mode is marked as 1, and the macroblock is marked as an intra-prediction macroblock.
Fig. 5 is a schematic diagram illustrating the labeling of the prediction modes of the intra-predicted macroblock.
g. After marking all the intra-frame prediction macro blocks, coding all the intra-frame prediction macro blocks one by one, firstly coding the 0 and 1 prediction modes by using a run length, and then entropy coding the residual error.
h. Non-intra predicted macroblocks are compression encoded using JPEG.
Referring to fig. 4, the server is a transmitting end with respect to the mobile zero terminal, and an encoding module in the server, that is, an S-end decoding module shown in fig. 4, encodes a prediction mode and a residual of a received code stream intra-frame prediction macroblock, and JPEG-encodes a non-intra-frame prediction macroblock.
i. And after the whole picture is coded, packing the code stream, entering a network and sending the code stream to the mobile zero client.
In the embodiment of the present invention, the network may be a mobile communication network, such as a 3G network, a 4G, WiFi network, or may be another wired network, which is not limited in the present invention.
Referring to fig. 4, the specific operation process of the mobile zero client is as follows:
a. and receiving the code stream sent by the server from the network.
b. JPEG decoding is performed on the non-intra-predicted macroblocks.
c. And decoding the run of the prediction modes 0 and 1 of each intra-frame prediction macro block from top to bottom and from left to right to obtain the prediction mode of each intra-frame prediction macro block.
d. If the prediction mode is 0, copying the pixel value of the left macro block to the current macro block; if the prediction mode is 1, the pixel value of the upper macroblock is copied to the current macroblock.
e. If so, the residual is decoded and the residual value is superimposed on the corresponding pixel value.
Referring to fig. 4, the mobile zero terminal is a receiving terminal with respect to the server terminal, and a decoding module in the mobile zero terminal, that is, an R-terminal decoding module shown in fig. 4, decodes the received code stream.
f. And after the decoding is finished, displaying the picture.
According to the intra-frame prediction method provided by the embodiment of the disclosure, the macroblock type and the prediction mode of the current macroblock are determined according to the first statistical value, the second statistical value and the first threshold value by acquiring the first statistical value of the current macroblock and the first macroblock, and the second statistical value of the current macroblock and the second macroblock, wherein the first statistical value and the second statistical value have the same pixels. By adopting the intra-frame prediction technology, the intra-frame prediction mode is determined by combining the image content to distinguish the macro block type of the current macro block, and each macro block does not need to be calculated for many times, so that the calculation complexity is greatly reduced, and the compression efficiency is improved.
Based on the remote control method described in the embodiments corresponding to fig. 1 to 4, the following is an embodiment of the apparatus of the present disclosure, which can be used to execute the embodiment of the method of the present disclosure.
An embodiment of the present disclosure provides a server, as shown in fig. 6, where the server 60 includes:
an obtaining module 601, configured to obtain a first statistical value of a current macroblock and a first macroblock, where the first macroblock and the first macroblock have a same pixel, and the first macroblock is adjacent to the current macroblock and located on a first side of the current macroblock;
an obtaining module 601, configured to obtain a second statistical value of a current macroblock and a second macroblock, where the second macroblock is adjacent to the current macroblock and located on a second side of the current macroblock;
a determining module 602, configured to determine a macroblock type and a prediction mode of a current macroblock according to the first statistic, the second statistic, and the first threshold, where the macroblock type includes an intra-predicted macroblock and a non-intra-predicted macroblock.
As shown in fig. 7, in one embodiment, the obtaining module 601 includes:
a comparing submodule 6011, configured to compare whether a pixel value of each pixel in the current macroblock is the same as a pixel value of a corresponding pixel in the first macroblock;
the counting submodule 6012 is configured to count the number of pixels in the current macroblock that is the same as the number of pixels in the first macroblock, so as to obtain a first statistical value.
In one embodiment, the comparing sub-module 6011 is configured to compare whether a pixel value of each pixel in the current macroblock is the same as a pixel value of a corresponding pixel in the second macroblock;
the counting submodule 6012 is configured to count the number of pixels in the current macroblock and the second macroblock, and obtain a second statistical value.
As shown in fig. 7, in one embodiment, the determining module 602 includes:
a first determination submodule 6021 for comparing the first statistical value and the second statistical value, and comparing whether both the first statistical value and the second statistical value are greater than or equal to a first threshold;
a second determining submodule 6022, configured to, when the first statistical value is greater than or equal to the second statistical value and the first statistical value is greater than or equal to the first threshold, determine that the current macroblock is an intra-frame prediction macroblock and a prediction mode of the current macroblock is a first prediction mode;
a second determining sub-module 6022, configured to determine that the current macroblock is an intra-frame prediction macroblock and the prediction mode of the current macroblock is the second prediction mode when the second statistic is greater than the first statistic and the second statistic is greater than or equal to the first threshold;
the second determining sub-module 6022 is configured to determine that the current macroblock is a non-intra-predicted macroblock when the first statistical value is greater than or equal to the second statistical value and the first statistical value is smaller than the first threshold, or when the second statistical value is greater than the first statistical value and the second statistical value is smaller than the first threshold.
In one embodiment, the first threshold is greater than or equal to a second threshold equal to the product of the size of the current macroblock and a preset coefficient.
According to the intra-frame prediction method provided by the embodiment of the disclosure, the intra-frame prediction mode is determined by combining the image content to distinguish the macro block type of the current macro block, and each macro block does not need to be calculated for many times, so that the calculation complexity is greatly reduced, and the compression efficiency is improved.
The embodiment of the present disclosure provides a server, as shown in fig. 8, where the server 80 includes:
an obtaining module 801, configured to obtain a frame of image, where the frame of image includes a plurality of macroblocks;
a determining module 802, configured to determine a macroblock type and a prediction mode of each macroblock in a frame of image according to the method corresponding to the embodiment in fig. 1, where the macroblock type includes an intra-predicted macroblock and a non-intra-predicted macroblock;
an encoding module 803, configured to encode a prediction mode of each intra-frame prediction macroblock to obtain first encoded data;
an encoding module 803, configured to encode a pixel value of each non-intra-prediction macroblock to obtain second encoded data;
the sending module 804 is configured to pack the first encoded data and the second encoded data into a code stream and send the code stream to the terminal device.
In one embodiment, the encoding module 803 is further configured to encode the prediction mode of each intra-prediction macroblock and the pixel residual of each intra-prediction macroblock to obtain first encoded data; the pixel residual is obtained according to the pixel difference value between the intra-frame prediction macro block and the first macro block or the second macro block.
According to the intra-frame prediction method provided by the embodiment of the disclosure, by considering image content, the macroblock type of each macroblock in a frame picture is distinguished and the prediction mode is determined, and each macroblock does not need to be calculated for many times, so that the calculation complexity is greatly reduced, and the compression efficiency is improved while lossless compression is achieved.
An embodiment of the present disclosure provides a terminal device, as shown in fig. 9, where the terminal device 90 includes:
a receiving module 901, configured to receive a code stream sent by a server;
a decoding module 902, configured to decode encoded data of each non-intra-prediction macroblock in the code stream to obtain a pixel value of each non-intra-prediction macroblock;
a decoding module 902, configured to decode encoded data of each intra-frame prediction macroblock in the code stream to obtain a pixel value of each intra-frame prediction macroblock;
and a processing module 903, configured to perform picture display according to the pixel value of each non-intra-predicted macroblock and the pixel value of each intra-predicted macroblock.
In one embodiment, as shown in FIG. 10, the decode module 902 includes:
a decoding submodule 9021, configured to decode the encoded data of each intra-frame prediction macroblock in the code stream to obtain a prediction mode of each intra-frame prediction macroblock;
a processing sub-module 9022, configured to, when the prediction mode of the intra-prediction macroblock is the first prediction mode, set the pixel value of the intra-prediction macroblock to be the pixel value of the first macroblock;
a processing sub-module 9022, configured to, when the prediction mode of the intra-prediction macroblock is the second prediction mode, set the pixel value of the intra-prediction macroblock to be the pixel value of the second macroblock;
the first macroblock is adjacent to the intra-predicted macroblock and located on a first side of the intra-predicted macroblock, and the second macroblock is adjacent to the intra-predicted macroblock and located on a second side of the intra-predicted macroblock.
In an embodiment, the decoding sub-module 9021 is further configured to decode pixel residual encoded data of each intra-prediction macroblock in the code stream;
the processing sub-module 9022 is further configured to superimpose the decoded pixel residual onto a pixel value of the corresponding intra prediction macroblock.
According to the intra-frame prediction method provided by the embodiment of the disclosure, the terminal device receives the code stream sent by the server, the image content is considered when the coded data in the code stream is coded, lossless compression is achieved, rapid decoding can be achieved in the decoding process, and the decoding efficiency is improved.
The embodiment of the present disclosure further provides an intra prediction system, which includes the server shown in fig. 8 and any one of the terminal devices shown in fig. 9 to 10.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. 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 will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (17)

1. A method of image processing, comprising:
acquiring a first statistical value of a current macro block and a first macro block which have the same pixel, wherein the first macro block is adjacent to the current macro block and is positioned on a first side of the current macro block;
acquiring a second statistical value of the current macro block and a second macro block with the same pixels, wherein the second macro block is adjacent to the current macro block and is positioned on a second side of the current macro block;
determining the macroblock type and the prediction mode of the current macroblock according to the first statistic value, the second statistic value and a first threshold, wherein the macroblock type comprises an intra-frame prediction macroblock and a non-intra-frame prediction macroblock;
the current macro block, the first macro block and the second macro block belong to the same frame image;
the determining, according to the first statistical value, the second statistical value, and a first threshold, a macroblock type and a prediction mode of the current macroblock includes:
comparing the first statistical value and the second statistical value, and comparing whether the first statistical value and the second statistical value are both greater than or equal to a first threshold;
when the first statistic value is greater than or equal to the second statistic value and the first statistic value is greater than or equal to a first threshold value, the current macroblock is an intra-frame prediction macroblock, and the prediction mode of the current macroblock is a first prediction mode;
when the second statistic value is larger than the first statistic value and the second statistic value is larger than or equal to the first threshold value, the current macroblock is an intra-frame prediction macroblock, and the prediction mode of the current macroblock is a second prediction mode;
when the first statistic value is greater than or equal to the second statistic value and the first statistic value is smaller than the first threshold value, or when the second statistic value is greater than the first statistic value and the second statistic value is smaller than the first threshold value, the current macroblock is a non-intra-prediction macroblock.
2. The method of claim 1, wherein obtaining the first statistical value of the same pixels in the current macroblock and the first macroblock comprises:
comparing whether the pixel value of each pixel in the current macro block is the same as the pixel value of the corresponding pixel in the first macro block;
and counting the number of the same pixel values of the current macro block and the first macro block to obtain the first statistical value.
3. The method of claim 1, wherein obtaining the second statistical value of the same pixel in the current macroblock and the second macroblock comprises:
comparing whether the pixel value of each pixel in the current macro block is the same as the pixel value of the corresponding pixel in the second macro block;
and counting the number of the same pixel values of the current macro block and the second macro block to obtain the second statistical value.
4. The method of claim 1, wherein the first threshold is greater than or equal to a second threshold, and wherein the second threshold is equal to a product of a size of the current macroblock and a preset coefficient.
5. A method of image processing, comprising:
acquiring a frame of image, wherein the frame of image comprises a plurality of macro blocks;
the method according to any one of claims 1 to 4, determining a macroblock type and a prediction mode of each macroblock in the frame of picture, the macroblock type comprising an intra-predicted macroblock and a non-intra-predicted macroblock;
coding the prediction mode of each intra-frame prediction macro block to obtain first coded data;
coding the pixel value of each non-intra-frame prediction macro block to obtain second coded data;
and packaging the first coded data and the second coded data into a code stream and sending the code stream to terminal equipment.
6. The method of claim 5, wherein when each intra-predicted macroblock has a pixel residual, the encoding the prediction mode of each intra-predicted macroblock to obtain first encoded data comprises:
coding the prediction mode of each intra-frame prediction macro block and the pixel residual error of each intra-frame prediction macro block to obtain first coded data; the pixel residual is obtained according to the pixel difference value between the intra-frame prediction macro block and the first macro block or the second macro block.
7. A method of image processing, comprising:
receiving a code stream sent by a server, wherein the code stream is generated according to the method of any one of claims 5-6;
decoding the coded data of each non-intra-frame prediction macro block in the code stream to obtain the pixel value of each non-intra-frame prediction macro block;
decoding the coded data of each intra-frame prediction macro block in the code stream to obtain a pixel value of each intra-frame prediction macro block;
displaying pictures according to the pixel value of each non-intra-frame prediction macro block and the pixel value of each intra-frame prediction macro block;
wherein the decoding the coded data of each intra-frame prediction macro block in the code stream to obtain the pixel value of each intra-frame prediction macro block comprises:
decoding the coded data of each intra-frame prediction macro block in the code stream to obtain a prediction mode of each intra-frame prediction macro block;
when the prediction mode of the intra-frame prediction macro block is a first prediction mode, the pixel value of the intra-frame prediction macro block is the pixel value of a first macro block;
when the prediction mode of the intra-frame prediction macro block is a second prediction mode, the pixel value of the intra-frame prediction macro block is the pixel value of a second macro block;
the first macroblock is adjacent to and on a first side of the intra-predicted macroblock, and the second macroblock is adjacent to and on a second side of the intra-predicted macroblock.
8. The method of claim 7, further comprising:
decoding pixel residual error coded data of each intra-frame prediction macro block in the code stream;
and superposing the decoded pixel residual error to the corresponding pixel value of the intra-frame prediction macro block.
9. A server, comprising:
the device comprises an acquisition module, a judging module and a judging module, wherein the acquisition module is used for acquiring a first statistical value of the same pixels in a current macro block and a first macro block, and the first macro block is adjacent to the current macro block and positioned at a first side of the current macro block;
the obtaining module is configured to obtain a second statistical value of a same pixel in the current macroblock and a second macroblock, where the second macroblock is adjacent to the current macroblock and located on a second side of the current macroblock;
a determining module, configured to determine a macroblock type and a prediction mode of the current macroblock according to the first statistical value, the second statistical value, and a first threshold, where the macroblock type includes an intra-predicted macroblock and a non-intra-predicted macroblock;
the current macro block, the first macro block and the second macro block belong to the same frame image;
the determining module comprises:
a first determination submodule for comparing the first statistical value and the second statistical value, and comparing whether both the first statistical value and the second statistical value are greater than or equal to a first threshold value;
a second determining submodule, configured to determine that the current macroblock is an intra-prediction macroblock and a prediction mode of the current macroblock is a first prediction mode when the first statistical value is greater than or equal to the second statistical value and the first statistical value is greater than or equal to a first threshold;
the second determining submodule is configured to, when the second statistic is greater than the first statistic and the second statistic is greater than or equal to the first threshold, determine that the current macroblock is an intra-prediction macroblock and a prediction mode of the current macroblock is a second prediction mode;
the second determining submodule is configured to determine that the current macroblock is a non-intra-predicted macroblock when the first statistical value is greater than or equal to the second statistical value and the first statistical value is smaller than the first threshold, or when the second statistical value is greater than the first statistical value and the second statistical value is smaller than the first threshold.
10. The server according to claim 9, wherein the obtaining module comprises:
a comparison submodule, configured to compare whether a pixel value of each pixel in the current macroblock is the same as a pixel value of a corresponding pixel in the first macroblock;
and the counting submodule is used for counting the number of the same pixel values of the current macro block and the first macro block to obtain the first statistical value.
11. The server according to claim 10,
the comparison submodule is used for comparing whether the pixel value of each pixel in the current macro block is the same as the pixel value of the corresponding pixel in the second macro block or not;
the counting submodule is configured to count the number of pixels in the current macroblock that are the same as the number of pixels in the second macroblock, so as to obtain the second statistical value.
12. The server according to claim 9, wherein the first threshold is greater than or equal to a second threshold equal to a product of a size of the current macroblock and a preset coefficient.
13. A server, comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a frame of image, and the frame of image comprises a plurality of macro blocks;
a determining module, configured to determine a macroblock type and a prediction mode of each macroblock in the frame of image according to the method of any one of claims 1 to 4, where the macroblock type includes an intra-predicted macroblock and a non-intra-predicted macroblock;
the coding module is used for coding the prediction mode of each intra-frame prediction macro block to obtain first coded data;
the coding module is used for coding the pixel value of each non-intra-frame prediction macro block to obtain second coded data;
and the sending module is used for packing the first coded data and the second coded data into a code stream and sending the code stream to the terminal equipment.
14. The server according to claim 13, wherein the encoding module is further configured to encode the prediction mode of each intra-predicted macroblock and the pixel residue of each intra-predicted macroblock to obtain first encoded data; the pixel residual is obtained according to the pixel difference value between the intra-frame prediction macro block and the first macro block or the second macro block.
15. A terminal device, comprising:
a receiving module, configured to receive a code stream sent by a server, where the code stream is generated according to the method of any one of claims 5 to 6;
the decoding module is used for decoding the coded data of each non-intra-frame prediction macro block in the code stream to obtain the pixel value of each non-intra-frame prediction macro block;
the decoding module is used for decoding the coded data of each intra-frame prediction macro block in the code stream to obtain the pixel value of each intra-frame prediction macro block;
the processing module is used for displaying pictures according to the pixel value of each non-intra-frame prediction macro block and the pixel value of each intra-frame prediction macro block;
wherein the decoding module comprises:
the decoding submodule is used for decoding the coded data of each intra-frame prediction macro block in the code stream to obtain the prediction mode of each intra-frame prediction macro block;
the processing sub-module is used for determining the pixel value of the intra-frame prediction macro block as the pixel value of the first macro block when the prediction mode of the intra-frame prediction macro block is the first prediction mode;
the processing sub-module is configured to, when the prediction mode of the intra-frame prediction macroblock is a second prediction mode, determine that the pixel value of the intra-frame prediction macroblock is the pixel value of a second macroblock;
the first macroblock is adjacent to and on a first side of the intra-predicted macroblock, and the second macroblock is adjacent to and on a second side of the intra-predicted macroblock.
16. The terminal device of claim 15,
the decoding submodule is also used for decoding pixel residual error coded data of each intra-frame prediction macro block in the code stream;
and the processing sub-module is also used for superposing the decoded pixel residual error to the corresponding pixel value of the intra-frame prediction macro block.
17. An intra prediction system comprising the server according to any one of claims 13 to 14 and the terminal device according to any one of claims 15 to 16.
CN201710535189.8A 2017-07-04 2017-07-04 Image processing method, device and system Active CN107222743B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710535189.8A CN107222743B (en) 2017-07-04 2017-07-04 Image processing method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710535189.8A CN107222743B (en) 2017-07-04 2017-07-04 Image processing method, device and system

Publications (2)

Publication Number Publication Date
CN107222743A CN107222743A (en) 2017-09-29
CN107222743B true CN107222743B (en) 2020-02-04

Family

ID=59951523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710535189.8A Active CN107222743B (en) 2017-07-04 2017-07-04 Image processing method, device and system

Country Status (1)

Country Link
CN (1) CN107222743B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110213589A (en) * 2019-06-18 2019-09-06 合肥安杰特光电科技有限公司 A kind of Real Time Compression coding method of high speed image
CN112702598B (en) * 2020-12-03 2024-06-04 浙江智慧视频安防创新中心有限公司 Method, device, electronic equipment and medium for encoding and decoding based on displacement operation

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1674680A (en) * 2005-03-31 2005-09-28 华中科技大学 An enhanced in-frame predictive mode coding method
CN101064849A (en) * 2006-04-29 2007-10-31 鲁海宁 Dynamic image coding method, apparatus and computer readable record medium
CN101389016A (en) * 2007-09-13 2009-03-18 华为技术有限公司 Method and device for obtaining boundary strength and removing block effect
CN101584218A (en) * 2007-01-18 2009-11-18 三星电子株式会社 Method and apparatus for encoding and decoding based on intra prediction
CN101668202A (en) * 2008-09-01 2010-03-10 中兴通讯股份有限公司 Method and device for selecting intra-frame prediction mode
CN102946538A (en) * 2012-11-09 2013-02-27 中国矿业大学 Rapid intra-frame mode selection method suitable for downhole distribution type video encoding
CN103299640A (en) * 2010-11-04 2013-09-11 Sk电信有限公司 Method and apparatus for encoding/decoding image for performing intra-prediction using pixel value filtered according to prediction mode
CN103686169A (en) * 2013-10-25 2014-03-26 四川大学 Intra-frame prediction rapid algorithm based on macro-block characteristics
CN103916665A (en) * 2013-01-07 2014-07-09 华为技术有限公司 Image decoding and coding method and device
CN103997646A (en) * 2014-05-13 2014-08-20 北京航空航天大学 Rapid intra-frame prediction mode selection method in high-definition video coding
CN104937936A (en) * 2013-02-01 2015-09-23 高通股份有限公司 Mode decision simplification for intra prediction

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101715007B1 (en) * 2011-11-28 2017-03-13 한국전자통신연구원 Method and apparatus for encoding adaptive intra prediction based on mode of valuable size partition in a macro block

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1674680A (en) * 2005-03-31 2005-09-28 华中科技大学 An enhanced in-frame predictive mode coding method
CN101064849A (en) * 2006-04-29 2007-10-31 鲁海宁 Dynamic image coding method, apparatus and computer readable record medium
CN101584218A (en) * 2007-01-18 2009-11-18 三星电子株式会社 Method and apparatus for encoding and decoding based on intra prediction
CN101389016A (en) * 2007-09-13 2009-03-18 华为技术有限公司 Method and device for obtaining boundary strength and removing block effect
CN101668202A (en) * 2008-09-01 2010-03-10 中兴通讯股份有限公司 Method and device for selecting intra-frame prediction mode
CN103299640A (en) * 2010-11-04 2013-09-11 Sk电信有限公司 Method and apparatus for encoding/decoding image for performing intra-prediction using pixel value filtered according to prediction mode
CN102946538A (en) * 2012-11-09 2013-02-27 中国矿业大学 Rapid intra-frame mode selection method suitable for downhole distribution type video encoding
CN103916665A (en) * 2013-01-07 2014-07-09 华为技术有限公司 Image decoding and coding method and device
CN104937936A (en) * 2013-02-01 2015-09-23 高通股份有限公司 Mode decision simplification for intra prediction
CN103686169A (en) * 2013-10-25 2014-03-26 四川大学 Intra-frame prediction rapid algorithm based on macro-block characteristics
CN103997646A (en) * 2014-05-13 2014-08-20 北京航空航天大学 Rapid intra-frame prediction mode selection method in high-definition video coding

Also Published As

Publication number Publication date
CN107222743A (en) 2017-09-29

Similar Documents

Publication Publication Date Title
US10038908B2 (en) Palette mode in high efficiency video coding (HEVC) screen content coding (SCC)
US11146788B2 (en) Grouping palette bypass bins for video coding
US9008179B2 (en) Encoding of prediction residuals for lossless video coding
CN104396245B (en) For method and apparatus image being encoded or decoding
US9503750B2 (en) Binarization of prediction residuals for lossless video coding
JP5238523B2 (en) Moving picture encoding apparatus, moving picture decoding apparatus, and moving picture decoding method
CN1620761B (en) Adaptive variable length coding and decoding method, and corresponding encoder and decoder
KR20200110442A (en) Method and apparatus for harmonizing multi-code bit hiding and residual code prediction
US11323707B2 (en) Multi-type tree depth extension for picture boundary handling
US20200107036A1 (en) Signaling scalability information in a parameter set
US9462289B2 (en) Implicit signaling of scalability dimension identifier information in a parameter set
CN109640089B (en) Image coding and decoding method and device
US20140140398A1 (en) Signaling scalability information in a parameter set
WO2014050151A1 (en) System for signaling idr and bla pictures
CN107483942B (en) Decoding method of video data compressed code stream, encoding method and device of video data
CN107222743B (en) Image processing method, device and system
CN116918335A (en) Residual and coefficient coding for video coding
US11006133B2 (en) Image compression technique
CN102845061A (en) Codeword restriction for high performance video coding
RU2795184C2 (en) Increasing the depth of a multiple type tree for processing image borders

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20171117

Address after: 710075 D102 room, building 4, Maple new city, F District, Xi'an hi tech Zone, Shaanxi

Applicant after: XI'AN WANXIANG ELECTRONIC TECHNOLOGY CO., LTD.

Address before: 710075 room B 501 of cool intelligent industrial park, No. 8, Tang Yan Nan Road, Xi'an high tech Zone, Shaanxi

Applicant before: Su Rui

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant