CN110896477B - Video coding method, device, coding equipment and storage medium - Google Patents

Video coding method, device, coding equipment and storage medium Download PDF

Info

Publication number
CN110896477B
CN110896477B CN201811066855.9A CN201811066855A CN110896477B CN 110896477 B CN110896477 B CN 110896477B CN 201811066855 A CN201811066855 A CN 201811066855A CN 110896477 B CN110896477 B CN 110896477B
Authority
CN
China
Prior art keywords
image
video frame
coding block
original video
coding
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
CN201811066855.9A
Other languages
Chinese (zh)
Other versions
CN110896477A (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201811066855.9A priority Critical patent/CN110896477B/en
Publication of CN110896477A publication Critical patent/CN110896477A/en
Application granted granted Critical
Publication of CN110896477B publication Critical patent/CN110896477B/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/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • 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/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/167Position within a video image, e.g. region of interest [ROI]
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability

Landscapes

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

Abstract

The embodiment of the invention provides a video coding method, a video coding device, a coding device and a storage medium, wherein the method comprises the following steps: acquiring an original video frame to be coded; acquiring display parameters of an original video frame in a television wall; if the total image size in the display parameters is smaller than the initial display size of the original video frame, zooming the original video frame; encoding the scaled original video frame to obtain a plurality of encoding blocks; determining local images respectively corresponding to each coding block according to the position of the pixel block corresponding to each coding block in the original video frame and the pixel coordinate range of each local image in the target image; and sending each coding block to a decoding device for decoding the local image corresponding to the coding block. It is not necessary for each decoding device to transmit the data encoded for the entire video frame. The total data volume of transmission can be reduced, and the waste of transmission resources is avoided.

Description

Video coding method, device, coding equipment and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a video encoding method, an apparatus, an encoding device, and a storage medium.
Background
With the continuous development of technologies such as video monitoring, more and more scenes adopt a display technology which can realize multiple display functions, such as a television wall. The television wall can be formed by splicing a plurality of display units. For example, it may be a 3 × 3 tv wall, i.e. a tv wall composed of 3 rows and 3 columns of display units. The Display unit may be various types of displays or Display devices, such as a Light Emitting Diode (LED) Display or a Liquid Crystal Display (LCD) Display. The display unit has a corresponding decoding device, and generally, one decoding device can output decoded video data to one or more display units, so that the display units can display video images.
Each display unit on the television wall can display a video image individually, or can display a video image by combining the display units on the television wall. The television wall can support various functions such as window roaming, split screen, zooming and the like. And the user can more conveniently view multiple paths of video images.
In practical applications, in a video wall, a plurality of display units are often required to display a video image together, that is, each display unit only displays a partial image of the video image. And the partial image is displayed not through the entire screen of the display unit but through a partial screen area, such as 1/4 or 1/9 screens, when displayed in the display unit.
In the prior art, when a video image is displayed through a display unit, no matter how large a portion or a large size of the image is displayed in each display unit, encoded data of the complete video image is sent to a decoding device of each display unit, the decoding device decodes the data of the complete video image, then scales or divides the decoded data, so as to obtain partial data corresponding to the image displayed by the display unit, and then sends the partial data to the display unit, so that the display unit displays a corresponding image.
As can be seen from the above process, since the decoding device corresponding to each display unit transmits the complete video image encoded data, and the complete data needs to be scaled or divided on the decoding device, the manner of transmitting the complete data to each encoding device causes a waste of transmission resources, for example, a waste of network bandwidth when transmitting through a network. And at the same time increases the workload of the decoding device.
Disclosure of Invention
Embodiments of the present invention provide a video encoding method, an apparatus, an encoding device, and a storage medium, so as to avoid waste of transmission resources and reduce a workload of a decoding device. The specific technical scheme is as follows:
the embodiment of the invention provides a video coding method, which is applied to coding equipment and comprises the following steps:
acquiring an original video frame to be coded;
acquiring display parameters of the original video frame in the television wall, wherein the display parameters comprise: the method comprises the steps that the overall image size of a target image and the pixel coordinate range of each local image in the target image are determined, wherein the target image is a complete image displayed when an original video frame is displayed in the television wall, and the local images are partial images which are respectively displayed in each display unit forming the target image in the television wall;
if the total image size is smaller than the initial display size of the original video frame, zooming the original video frame according to the total image size;
coding the scaled original video frame to obtain a plurality of coding blocks, wherein each coding block corresponds to a pixel block in the original video frame;
determining the local images respectively corresponding to each coding block according to the position of the pixel block corresponding to each coding block in the original video frame and the pixel coordinate range of each local image in the target image;
and sending each coding block to a decoding device for decoding the local image corresponding to the coding block.
Optionally, if there are a plurality of the overall image sizes in the display parameter and the plurality of the overall image sizes are all smaller than the initial display size, the scaling the original video frame according to the overall image size includes:
selecting a maximum overall image size from a plurality of overall image sizes;
scaling the original video frame according to the maximum overall image size.
Optionally, the determining, according to the position of the pixel block corresponding to each coding block in the original video frame and the pixel coordinate range of each local image in the target image, the local image corresponding to each coding block includes:
determining an original coordinate range corresponding to each local image in the original video frame according to the total image size and the pixel coordinate range of the local image;
and comparing the position of the pixel block corresponding to each coding block in the original video frame with each original coordinate range, determining a local image to which the pixel block corresponding to the coding block belongs from each local image, and taking the local image as the local image corresponding to the coding block.
Optionally, the determining, in the original video frame, an original coordinate range corresponding to each of the local images according to the total image size and the pixel coordinate range of the local image includes:
determining the ratio of each local image in the overall image size according to the pixel coordinate range of each local image;
and calculating the corresponding original coordinate range of the local image in the original video frame according to the ratio.
Optionally, the method further includes:
and correcting the original coordinate range according to the size of the pixel blocks corresponding to the coding blocks, so that the original coordinate range can contain the pixel blocks corresponding to an integral number of coding blocks.
Optionally, the method further includes:
dividing all coding blocks of the original video frame into coding block groups corresponding to different local images;
the sending each coding block to a decoding device for decoding the local image corresponding to the coding block includes:
and sending each coding block group to a decoding device for decoding the local image corresponding to the coding block group.
Optionally, the method further includes:
for each coding block, determining decoding equipment corresponding to the coding block;
adding the target network address of the decoding device corresponding to the coding block into the additional information of the coding block;
the sending each coding block to a decoding device for decoding the local image corresponding to the coding block includes:
and packaging each coding block into a data packet transmitted through a network, and sending the data packet to decoding equipment corresponding to the target network address according to the target network address in the additional information.
Optionally, the sending each of the coding blocks to a decoding device for decoding the local image corresponding to the coding block includes:
for each coding block, determining a display unit corresponding to the coding block through a local image corresponding to the coding block;
and sending each coding block to the decoding equipment of the display unit corresponding to the coding block.
The embodiment of the invention also provides a video coding device, which is applied to coding equipment, and the device comprises:
the first acquisition module is used for acquiring an original video frame to be coded;
a second obtaining module, configured to obtain display parameters of the original video frame in the video wall, where the display parameters include: the method comprises the steps that the overall image size of a target image and the pixel coordinate range of each local image in the target image are determined, wherein the target image is a complete image displayed when an original video frame is displayed in the television wall, and the local images are partial images which are respectively displayed in each display unit forming the target image in the television wall;
a scaling module, configured to scale the original video frame according to the overall image size if the overall image size is smaller than an initial display size of the original video frame;
the encoding module is used for encoding the scaled original video frame to obtain a plurality of encoding blocks, and each encoding block corresponds to a pixel block in the original video frame;
the calculation module is used for determining the local images corresponding to the coding blocks respectively according to the positions of the pixel blocks corresponding to the coding blocks in the original video frame and the pixel coordinate ranges of the local images in the target image;
and the sending module is used for sending each coding block to decoding equipment for decoding the local image corresponding to the coding block.
Optionally, if there are a plurality of the overall image sizes in the display parameter, and the plurality of the overall image sizes are all smaller than the initial display size, the scaling module is specifically configured to:
selecting a maximum overall image size from a plurality of overall image sizes; scaling the original video frame according to the maximum overall image size.
Optionally, the calculation module is specifically configured to:
determining an original coordinate range corresponding to each local image in the original video frame according to the total image size and the pixel coordinate range of the local image;
and comparing the position of the pixel block corresponding to each coding block in the original video frame with each original coordinate range, determining a local image to which the pixel block corresponding to the coding block belongs from each local image, and taking the local image as the local image corresponding to the coding block.
Optionally, the calculation module is specifically configured to:
determining the ratio of each local image in the overall image size according to the pixel coordinate range of each local image; and calculating the corresponding original coordinate range of the local image in the original video frame according to the ratio.
Optionally, the apparatus further comprises:
and the correction module is used for correcting the original coordinate range according to the size of the pixel blocks corresponding to the coding blocks, so that the original coordinate range can contain the pixel blocks corresponding to an integral number of coding blocks.
Optionally, the apparatus further comprises:
a grouping module, configured to divide all coding blocks of the original video frame into coding block groups corresponding to different local images;
the sending module is specifically configured to:
and sending each coding block group to a decoding device for decoding the local image corresponding to the coding block group.
Optionally, the apparatus further comprises:
the address module is used for determining decoding equipment corresponding to each coding block; adding the target network address of the decoding device corresponding to the coding block into the additional information of the coding block;
the sending module is specifically configured to:
and packaging each coding block into a data packet transmitted through a network, and sending the data packet to decoding equipment corresponding to the target network address according to the target network address in the additional information.
Optionally, the sending module is specifically configured to:
for each coding block, determining a display unit corresponding to the coding block through a local image corresponding to the coding block;
and sending each coding block to the decoding equipment of the display unit corresponding to the coding block.
The embodiment of the invention also provides coding equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and a processor for implementing any of the above-described video encoding methods when executing the program stored in the memory.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements any of the above-mentioned video encoding methods.
There is also provided, in an embodiment of the present invention, a computer program product including instructions that, when executed on a computer, cause the computer to perform any of the video encoding methods described above.
According to the video coding method, the video coding device and the storage medium provided by the embodiment of the invention, when the coding device obtains an original video frame, the coding device can also obtain display parameters of the original video frame when the original video frame is displayed on a television wall, the original video frame is zoomed according to the display parameters, the coding device codes the zoomed original video frame to obtain a plurality of coding blocks, and then local images corresponding to each coding block are determined according to the position of a pixel block corresponding to each coding block in the original video frame and the pixel coordinate range of each local image in a target image. And then each coding block is respectively sent to decoding equipment for decoding the local image corresponding to the coding block, so that each decoding equipment only needs to receive part of the coding blocks and decode the part of the coding blocks to form corresponding local images, and the local images are displayed through a display unit. It is not necessary to transmit data resulting from encoding for the entire video frame to each decoding device as in the prior art. Therefore, the total transmitted data volume can be reduced, the waste of transmission resources is avoided, decoding equipment is not needed to decode the data after the complete video frame is coded, and only partial coding blocks are decoded, so that the workload of the decoding equipment can be reduced. Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a video encoding method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a target image provided by an embodiment of the invention;
FIG. 3 is a diagram of an original video frame according to an embodiment of the present invention;
fig. 4 is a block diagram of a video encoding apparatus according to an embodiment of the present invention;
fig. 5 is a block diagram of an encoding apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a video encoding method according to an embodiment of the present invention, where the video encoding method is applied to an encoding device, and the encoding device may be a coding board, an input board, an encoder, or a server in a video surveillance system. The encoding device may acquire video information acquired or stored by a video source, for example, the video source may be various devices capable of acquiring or storing video, such as a camera and a computer, and then encode video frames in the video information one by one, and send encoded data or information to the decoding device, the decoding device may be a device such as an output board, a decoder, and a server connected to a display unit in a video wall, and the decoding device may decode the acquired information or data, and then send the decoded data to the display unit, so that the display unit can display a corresponding image.
As shown in fig. 1, a video encoding method provided by an embodiment of the present invention includes:
step 110, an original video frame to be encoded is obtained.
The original video frame to be encoded is a video frame in an original video image that has not been encoded, such as a video frame in a video image of a monitored area captured by a camera, or a video frame in a video image stored in a computer, and so on.
The encoding device may obtain an original video frame to be encoded in various ways, for example, the original video frame may be input to the encoding device by a relevant person through various terminal devices, or the encoding device may directly obtain the original video frame from a video source such as a connected camera or a computer through a network or other types of lines, for example, in an actual application scenario, the camera may send a video image of a captured scene to the encoding device in a form of a data stream, where the data stream includes data of video images of one frame, and a video image of each frame in the data stream may be used as the original video frame. The encoding device can acquire original video frames one by one from the data stream and process the original video frames one by one according to the video encoding method provided by the embodiment of the invention. Thus, a corresponding video code stream is formed, and finally, a dynamic video image formed by video images of one frame is displayed in the display unit.
Step 120, obtaining display parameters of the original video frame in the video wall, wherein the display parameters include: the overall image size of the target image and the pixel coordinate range of each partial image in the target image. The target image is a complete image displayed when the original video frame is displayed in the television wall, and the partial images are partial images respectively displayed in each display unit forming the target image in the television wall.
When an original video frame is displayed on a television wall, the displayed image is a target image, the target image is formed by jointly displaying one or more display units in the television wall, and local images of the target image are respectively displayed in the display units forming the target image.
After the original video frame is subjected to encoding, transmission, decoding and other processes, the original video frame is finally displayed in a television wall, and finally, a displayed image in the television wall is a target image which is composed of one or more display units. Referring to fig. 2, fig. 2 is a schematic diagram of a target image formed when an original video frame is displayed on a video wall. The television wall is formed by splicing 4 display units, namely a first display unit 201, a second display unit 202, a third display unit 203 and a fourth display unit 204. The target image 205 is displayed by the 4 display units, and only the partial images of the target image 205 are displayed on each display unit, namely, the first partial image 210, the second partial image 220, the third partial image 230 and the fourth partial image 240. Each partial image occupies only a portion of the screen of the display unit.
When a user needs to display a video picture of the video source on a television wall, video data of the video source can be displayed on the television wall in a dragging or control command mode. When the user finishes dragging or sends a control command, the display parameters of the video data of the video source in the video wall can be determined, for example, the display position of the video data of the video source in the video wall, the size of the displayed image, and the like, and the display parameters are issued to the respective encoding devices. Thereby enabling the respective encoding apparatuses to obtain the display parameters. The display parameters are the display parameters of the original video frame in the television wall. The display parameters at least comprise the range of pixel coordinates of each local image in the target image when the original video frame is displayed on the television wall, and the overall image size of the target image.
Specifically, when the user operates the television wall, the user may control the television wall through the control system of the television wall, and select an area in the television wall to display the target image to be displayed, for example, the area where the target image 205 is located in fig. 2 may be a preset total area for displaying the target image, after the user sets the total area, the sub-area where each display unit needs to display the local image may be determined, and the range of the pixel coordinates of the sub-area where each display unit displays the local image in the total area may also be determined. Since the sub-region is equal in size to the local image, the total region is equal in size to the target image. Therefore, it is possible to determine the display parameters when the original video frame is displayed on the video wall, corresponding to the total area for displaying the target image set by the user.
The encoding device obtains the display parameters in advance from a control device of a television wall or a device such as a decoding device of the television wall through a network transmission mode and the like.
In connection with an actual usage scenario, for example, a video wall may simultaneously display a plurality of video images, each of the video images may be superimposed on another video image, and a user may enlarge one of the video images being displayed, or control the video wall so that the video image is displayed in an area where the target image 205 is located as shown in fig. 2. This operation corresponds to the user setting the display parameters for the video image. The control device of the video wall or the decoding device corresponding to the video image can send the display parameters newly set by the user to the encoding device corresponding to the video image. And a step of enabling the encoding device to perform subsequent encoding based on the obtained display parameters when encoding a video frame of the video image which is subsequently acquired, that is, a video frame equivalent to an original video frame.
The range of the pixel coordinates in the display parameter refers to a position and a range of the local image in the target image, and specifically, may be represented by coordinates of the local image in the target image. For example, in fig. 2, the first partial image 210 has a width of 900 and a height of 1000, where 900 and 1000 are pixels. The first partial image 210 is a range of pixel coordinates in the target image, i.e., a rectangular range from (0,0) point to (900, 1000).
The total image size in the display parameters refers to the number of pixel points constituting the image, which the target image has, and can also be described by the number of the pixel points. For example, in fig. 2, the overall image size of the target image is 2600 × 2400.
Step 130, if the overall image size is smaller than the initial display size of the original video frame, scaling the original video frame according to the overall image size.
In practical application, an original video frame obtained by an encoding device has an initial display size, which is the number of pixels constituting an image that the original video frame itself has. Therefore, the initial display size is described by the number of pixels, for example, the initial display size may be 800 × 600, 1920 × 1080, and so on.
However, when the original video frame is displayed on the video wall, the displayed target image may also have an overall image size, which may be the same as or different from the initial display size of the original video frame. When the difference is different, the original video frame needs to be enlarged or reduced and then displayed through the display unit.
In the prior art, when the total image size of a target image displayed on a video wall is smaller than the initial display size of an original video frame, an encoding device still encodes the original video frame according to the original initial display size according to a normal flow, then sends the encoded data to a decoding device, and after the decoding device completes decoding, the decoding device performs scaling processing, and then displays the target image through a display unit. Therefore, when the total image size of the target image is smaller than the initial display size of the original video frame, the encoding device still sends the data encoded according to the original initial display size to the decoding device, thereby further causing the waste of transmission resources.
In order to solve the above problem, in the embodiment of the present invention, after acquiring the original video frame and the display parameters, the encoding apparatus may compare the overall image size of the target image in the display parameters with the initial display size of the original video frame.
If the total image size is smaller than the initial display size of the original video frame, it indicates that the displayed target image is a reduced image when the original video frame is displayed on the television wall. Therefore, the encoding device can scale the original video frame directly according to the overall image size before encoding. The original video frame is enabled to be scaled to a video frame with the same size as a target image to be displayed in a television wall in the future, for example, the original video frame has an initial display size of 1920 × 1080, and the target image has an overall image size of 1024 × 768, so that the original video frame can be scaled to a video frame of 1024 × 768.
Because the original video frame is scaled, the data volume of the scaled original video frame is smaller than that of the original video frame which is not scaled, so that the data volume of the code is reduced, and the data volume of the coded code block can be reduced. Finally, when the coding block is transmitted, less transmission resources are needed, so that the use of the transmission resources is further reduced, and meanwhile, the decoding device is not required to scale the original video frame, so that the workload of the decoding device is further reduced.
It will be readily appreciated that if the overall image size is consistent with the initial display size of the original video frame, or if the overall image size is greater than the initial display size, then scaling of the original video frame is not required.
Step 140, encoding the scaled original video frame to obtain a plurality of encoding blocks, wherein each encoding block corresponds to a pixel block in the original video frame.
The encoding device may encode the scaled original video frame after obtaining the original video frame. Of course, if the original video frame is not scaled, the original video frame may be directly encoded.
The specific encoding method may be encoding using an encoding method such as h.264 or h.265. In the embodiment of the present invention, a specific encoding method is not limited. When an original video frame is encoded, the encoding may be performed based on pixel blocks in the original video frame, and the size of the pixel blocks may be set as needed, for example, the size may be 8 × 8, 16 × 16, and other macro blocks of various specifications. After the pixel block is coded, a coding block corresponding to the pixel block can be obtained. The coding block is video data formed by coding the corresponding pixel block.
And 150, determining the local images respectively corresponding to each coding block according to the position of the pixel block corresponding to each coding block in the original video frame and the pixel coordinate range of each local image in the target image.
After the original video frame is encoded, a plurality of encoding blocks can be obtained. Then, the position of the pixel block corresponding to each coding block in the original video frame can be compared with the pixel coordinate range of each local image in the display parameters, the local image to which the pixel block corresponding to the coding block belongs is determined from each local image, and the local image is used as the local image corresponding to the coding block.
Specifically, the position of the pixel block corresponding to each coding block in the original video frame is known in the coding process, and the position of the pixel block in the original video frame refers to that the pixel block is formed by pixels in the first row and the second column in the original video frame.
The display parameters include the pixel coordinate range of each partial image. By comparison, the position of the pixel block can be easily determined, and the pixel coordinate range of which local image can fall can be determined, so that the local image to which the pixel block belongs can be determined. I.e. the local image where this block of pixels will be displayed in the video wall in the future.
In a specific comparison process, since the pixel block is already encoded into the encoding block, and the encoding block carries the position information of the pixel block corresponding to the encoding block, the comparison process may be performed by comparing the position information carried by the encoding block with the pixel coordinate range of each local image in the display parameter, and determining the local image to which the pixel block corresponding to the encoding block belongs from each local image. The partial image may then be determined to be the partial image corresponding to the encoded block. And comparing each coding block to establish the corresponding relation between each coding block and the local image.
And step 160, sending each coding block to a decoding device for decoding the local image corresponding to the coding block.
Each partial image is displayed by a display unit, and the image data displayed in the display unit needs to be provided by the decoding device corresponding to the display unit. Therefore, when the partial image is displayed in the display unit, correspondingly, each encoding block corresponding to the partial image needs to be decoded by a corresponding decoding device. Therefore, after the local image corresponding to each coding block is determined, the decoding device for decoding the coding block of the local image can be determined according to the local image, so that each coding block is sent to the corresponding decoding device.
Specifically, the step 160 of sending each coding block to a decoding device for decoding the local image corresponding to the coding block may include:
firstly, a display unit corresponding to the coding block is determined through a local image corresponding to the coding block.
Each local image is displayed in one display unit, so that each local image can uniquely correspond to one display unit on the premise that the display parameters are not changed.
Therefore, when a coding block corresponds to a partial image, the coding block corresponds to a display unit that displays the partial image. So that the display unit can be used as the display unit corresponding to the coding block.
And secondly, respectively sending each coding block to the decoding equipment of the display unit corresponding to the coding block.
One decoding device can be connected with one or more display units, and one display unit can be connected with only one decoding device. Therefore, each display unit can uniquely correspond to one decoding device.
Therefore, after the display unit corresponding to each coding block is determined, each coding block can be respectively sent to the decoding equipment of the display unit corresponding to the coding block.
A plurality of coding blocks obtained by coding an original video frame are respectively sent to different decoding devices, so that each decoding device only needs to decode part of the coding blocks to obtain a local image, and the local image is displayed through a display unit. And finally, displaying the complete target image together through a plurality of display units on the television wall.
In this embodiment of the present invention, in order to more accurately transmit the coding block, the video coding method provided in this embodiment of the present invention may further include:
step 170, for each coding block, determining a decoding device corresponding to the coding block.
Since each coding block may correspond to a partial image, the partial image may correspond to a decoding device for decoding the coding block of the partial image. Therefore, each coding block and the corresponding decoding device can be determined. I.e. the encoded block needs to be decoded in the corresponding decoding device to form a partial image.
Step 180, adding the destination network address of the decoding device corresponding to the coding block into the additional information of the coding block.
After the decoding device corresponding to each coding block is determined, the coding block can be sent to the corresponding decoding device. Therefore, for each coding block, the destination network address of the decoding device corresponding to the coding block may be added to the additional information of the coding block.
In practical applications, the encoding device and the decoding device may be connected via a network, such as a local area network or the internet, so as to enable remote information transmission.
Each coding block may have additional information that may include various side information of the coding block, for example, a size of the coding block, position information of a pixel block corresponding to the coding block, and the like. In addition, the destination network address of the decoding device of the display unit corresponding to the coding block may be added to the additional information.
Correspondingly, step 160, sending each coding block to a decoding device for decoding the partial image corresponding to the coding block, may include:
and packaging each coding block into a data packet transmitted through a network, and sending the data packet to decoding equipment corresponding to a target network address according to the target network address in the additional information.
The coding blocks may be packaged or encapsulated into a data packet capable of being transmitted through a network, and then each level of network transmission device, such as a network switch, may transmit the data packet formed by the coding block to a decoding device corresponding to a target network address according to the target network address in the additional information of the coding block. Therefore, the coding block can be accurately transmitted to the corresponding decoding equipment, network-based transmission is realized, and the reliability of coding block transmission is improved.
Furthermore, in order to transmit the coding blocks more conveniently, after determining the partial image corresponding to each coding block, the method provided in the embodiment of the present invention further includes:
step 155, divide all the coding blocks of the original video frame into coding block groups corresponding to different partial images.
After the partial image corresponding to each coding block is determined, all the coding blocks obtained by coding the original video frame can be grouped according to the corresponding partial images. For example, when the display parameter is the display area shown in fig. 2,4 display units in a video wall all display partial images. Therefore, all the encoding blocks can be divided into 4 encoding block groups corresponding to the partial image displayed in the first display unit 201, the partial image displayed in the second display unit 202, the partial image displayed in the third display unit 203, and the partial image displayed in the fourth display unit 204, respectively. I.e. the coding blocks in each coding block group, may constitute a partial picture.
Correspondingly, step 160, sending each coding block to a decoding device for decoding the partial image corresponding to the coding block, may include:
and sending each coding block group to a decoding device for decoding the local image corresponding to the coding block group.
When all the coding blocks are divided into a plurality of coding block groups, the coding block groups can be transmitted. Each coding block group corresponds to a local image, and each coding block forming the local image needs to be decoded in a coding device, and then the decoded image data is sent to a display unit corresponding to the coding device for displaying, so that the local image is displayed in the display unit. Therefore, each coding block group may correspond to one coding device. The coding block group can be uniformly transmitted to the coding device corresponding to the coding block group.
For example, the coding block set may be packaged or encapsulated in the form of a data packet that can be transmitted over a network, and a coding block set may be packaged or encapsulated as one or more data packets. And then sending the coded block group to a decoding device corresponding to the coded block group. By grouping the coding blocks, the coding blocks can be more conveniently and accurately sent to corresponding decoding equipment, omission of the coding blocks is avoided, and the transmitted coding blocks are more complete.
In the embodiment of the present invention, when an encoding device acquires an original video frame, a display parameter of the original video frame when the original video frame is displayed on a television wall may also be acquired, the encoding device encodes the original video frame to obtain a plurality of encoding blocks, and then, according to a position of a pixel block corresponding to each encoding block in the original video frame and a pixel coordinate range of each local image in a target image, a local image corresponding to each encoding block is determined. And then each coding block is respectively sent to decoding equipment for decoding the local image corresponding to the coding block, so that each decoding equipment only needs to receive part of the coding blocks and decode the part of the coding blocks to form corresponding local images, and the local images are displayed through a display unit. It is not necessary to transmit data resulting from encoding for the entire video frame to each decoding device as in the prior art. Therefore, the total transmitted data volume can be reduced, the waste of transmission resources is avoided, decoding equipment is not needed to decode the data after the complete video frame is coded, and only partial coding blocks are decoded, so that the workload of the decoding equipment can be reduced.
In practical applications, a plurality of target images may be displayed in different areas of a video wall at the same time. I.e., the original video frame, is displayed in a region of a plurality of video walls, thereby displaying a plurality of target images. The range of each region may be different according to the user's setting, so the overall image size of each target image may be different. So that the display parameters obtained by the encoding device may also exist for a plurality of overall image sizes.
In this embodiment of the present invention, if there are multiple overall image sizes in the display parameters, and the multiple overall image sizes are all smaller than the initial display size, the scaling the original video frame according to the overall image sizes in step 130 may include:
first, a maximum overall image size is selected from a plurality of overall image sizes.
And secondly, scaling the original video frame according to the maximum overall image size.
If the sizes of the plurality of overall images are smaller than the initial display size, the target images displayed by the original video frame all need to be scaled, so that the original video frame can be encoded after being scaled. Meanwhile, in order to avoid the decoding device from repeatedly amplifying the original video frame after being zoomed. Therefore, the largest overall image size can be selected from a plurality of overall image sizes, and the original video frame can be scaled according to the largest overall image size.
For example, one overall image size is 800 × 600, another overall image size is 1024 × 768, and the original video frame has an initial display size of 1920 × 1080. The largest overall image size is selected to be 1024 x 768 and the original video frame is scaled to a size of 1024 x 768. And encoding the scaled original video frame, and then sending the encoded encoding block to a corresponding decoding device, wherein the encoding device corresponding to the 1024 × 768 target image can decode the encoding block and then directly display the encoded block through a display device. After the encoding device corresponding to the 800 × 600 target image decodes the encoded block, the encoding device needs to perform scaling again to display the 800 × 600 target image. But the process of scaling is easier and faster than zooming in. Therefore, the encoding device scales the original video frame according to the maximum overall image size, the decoding device can be prevented from amplifying the decoded original video frame, and only the scaling processing is needed to meet the requirement, so that the efficiency of the decoding device is improved.
With reference to the foregoing embodiments, in order to determine the local image corresponding to each coding block more accurately, in the video encoding method according to the embodiments of the present invention, in step 150, determining the local image corresponding to each coding block according to the position of the pixel block corresponding to each coding block in the original video frame and the pixel coordinate range of each local image in the target image, the method may include:
step 151, determining an original coordinate range corresponding to each local image in the original video frame according to the total image size and the pixel coordinate range of the local image.
The display parameters include the overall image size and the pixel coordinate range of the local image, wherein the pixel coordinate range of the local image is obtained based on the overall image size. That is, the pixel coordinate range of the partial image is accurate only in the target image, and each partial image can be determined from the target image.
However, after the original video frame is encoded, the position information of the obtained coding block is the position of the pixel block corresponding to the coding block in the original video frame. Therefore, it is necessary to determine the original coordinate range of each partial image in the initial display size of the original video frame. Comparing the original coordinate range of each local image with the position information in the coding block. Thereby determining the partial image corresponding to the coding block.
In practical applications, the overall image size of the target image may be the same as or different from the initial display size of the original video frame, and when the overall image size is the same as the initial display size, the method includes scaling the initial display size of the original video frame to obtain the original video frame with the same overall image size. Since the overall image size and the initial display size are the same, the pixel coordinate range of the partial image based on the overall image size in the display parameters can be directly applied to the original video frame. That is, the pixel coordinate range of the local image in the display parameters can be directly used as the pixel coordinate range of each local image in the original video frame without conversion.
For example, when an original video frame is displayed in a video wall, a target image as shown in fig. 2 is constructed. The overall image size of the target image 205 is 2600 × 2400, the width of the first partial image 210 is 900, the height is 1000, and the pixel coordinate range thereof is a rectangular range from (0,0) point to (900, 1000). The original video frame is also 2600 x 2400 in its initial display size or scaled size. Therefore, according to the pixel coordinate range of the first partial image 210 in the display parameters, the first partial image 210 can be directly mapped into the original video frame, so that the original coordinate range in the original video frame corresponding to the first partial image 210 can be directly determined in the original video frame, and the original coordinate range is also a rectangular range formed from (0,0) point to (900, 1000).
However, in many cases, the overall image size and the initial display size are not the same, and the overall image size may be larger or smaller than the initial display size. Since the pixel coordinate ranges of the respective partial images in the display parameters are obtained based on the overall image size. Therefore, when the total image size and the initial display size are not the same, the original coordinate range corresponding to each local image in the original video frame cannot be directly obtained according to the pixel coordinate range of each local image in the display parameters. Therefore, the pixel coordinate range of each local image in the display parameters needs to be converted to calculate the original coordinate range corresponding to each local image in the original video frame.
Specifically, in this embodiment of the present invention, when the pixel coordinate range of each local image in the display parameters needs to be converted, in step 151, determining the original coordinate range corresponding to each local image in the original video frame according to the overall image size and the pixel coordinate range of the local image, may include:
step 151a, determining the ratio of each local image in the overall image size according to the pixel coordinate range of each local image.
In the obtained display parameters, the overall image size and the pixel coordinate range of each local image can be obtained, and the pixel coordinate range of each local image can reflect the size and the position of each local image in the target image. Thus, by using the size of each partial image and the overall image size of the target image, the proportion of the partial image in the overall image size can be calculated, wherein the proportion refers to the proportion of the height or the width of the partial image in the overall image size respectively.
Specifically, as shown in fig. 2, the overall image size of the target image 205 is 2600 × 2400, and the pixel coordinate range of the first partial image is a rectangular range formed from (0,0) point to (900, 1000). It can thus be determined that the first partial image 210 has a width of 900 and a height of 1000.
The ratio of the size of the first partial image 210 in the overall image size can be easily obtained, i.e. the ratio of the width of the first partial image 210 is 900/2600 and the ratio of the height of the first partial image 210 is 1000/2400.
And step 151b, calculating the corresponding original coordinate range of the local image in the original video frame according to the ratio.
After the ratio of each local image in the overall image size is calculated, the original coordinate range corresponding to each local image can be determined in the original video frame according to the ratio.
Because the original video frame is displayed on the television wall, whether enlarged or reduced, each local image is enlarged or reduced in equal proportion. Therefore, the occupation ratio of the local image in the target image is the same as that of the local image in the original video frame.
Therefore, the size of each local image in the original video frame can be calculated according to the initial display size of the original video frame and the ratio of the local image in the target image.
For example, in connection with the above example, the original video frame has an initial display size of 1920 × 1080, which is smaller than the overall image size 2600 × 2400 of the target image 205.
The first partial image 210 has a width size in the original video frame of: 1920 × (900/2600) and 1080 × (1000/2400) in height, and since the size cannot be a decimal number, the calculation result may take an integer value larger than the calculated value. The size of the first partial image 210 in the original video frame is 665 × 450 through the above calculation. Meanwhile, since the position of the partial image does not change, the pixel coordinate range of the first partial image 210 is a rectangular range formed by (0,0) point to (900,1000) point in the target image. Accordingly, the original coordinate range in the original video frame can be a rectangular range from (0,0) point to (665,450). Other local images can also determine the corresponding original coordinate range in the original video frame by adopting the calculation method.
Step 152, comparing the position of the pixel block corresponding to each coding block in the original video frame with each original coordinate range, determining the local image to which the pixel block corresponding to the coding block belongs from each local image, and using the local image as the local image corresponding to the coding block.
After the corresponding original coordinate range of each local image in the original video frame is determined by the method, the coded blocks obtained by coding can be compared with each original coordinate range one by one. The specific comparison method still compares the position of the pixel block corresponding to the coding block in the original video frame, and determines the local image to which the pixel block corresponding to the coding block belongs or falls into a certain original coordinate range, and uses the local image as the local image corresponding to the coding block.
In the embodiment of the invention, the initial display size of the original video frame is used, and the overall image size and the pixel coordinate range of the local image in the display parameters are used. The method can determine the original coordinate range corresponding to the local image in the original video frame, then compares the position of the pixel block corresponding to the coding block with the original coordinate range, and can more accurately determine the local image to which the pixel block corresponding to the coding block belongs through the original coordinate range because the position of the pixel block corresponding to the coding block is calculated based on the original video frame, thereby more accurately determining the local image corresponding to the coding block.
With the above-described embodiments, since the pixel block itself corresponding to the coding block has a certain size, for example, it may be a 32 × 16 pixel block. It may occur that a part of the block of pixels belongs to one partial image and another part to another partial image. In this case, it is not easy to region the local image to which the pixel block belongs, and it is also not easy to specify the local image corresponding to the coding block of the pixel block.
In order to solve the above problem, after determining the corresponding original coordinate range of each local image in the original video frame, the video encoding method provided in the embodiment of the present invention may further include:
and 151c, correcting the original coordinate range according to the size of the pixel blocks corresponding to the coding blocks, so that the original coordinate range can contain the pixel blocks corresponding to the integral number of coding blocks.
After the original coordinate range corresponding to each local image is determined, the original coordinate range can be corrected, so that the corrected original coordinate range can contain an integral number of pixel blocks corresponding to the coding blocks, and the condition that part of the pixel blocks are contained in the original coordinate range is avoided.
The specific correction method is generally a method of rounding up the pixel block size. I.e. the width and height of the original coordinate range is expanded to integral multiples of the width and height of the pixel block, respectively, by the width and height of the pixel block.
For example, referring to fig. 2 and 3, in conjunction with the previous example, the overall image size 2600 × 2400 of the target image 205 in fig. 2, the pixel coordinate range of the first partial image 210 is a rectangular range formed by (0,0) points to (900, 1000). Fig. 3 is a schematic diagram of an original video frame according to an embodiment of the present invention, where an initial display size of the original video frame is 1920 × 1080.
Through the foregoing calculation, the first partial image 210 in fig. 2 is determined, and the original coordinate range in the original video frame is a rectangular range constituted by (0,0) points to (665,450). I.e. the corresponding size of the first partial image 210 in the original video frame is 665 x 450, which rectangular extent is indicated by a dashed box in fig. 3.
When the encoding device performs encoding, the size of each pixel block is 32 × 16. 32 cannot be divided exactly by 665 and 16 cannot be divided exactly by 450. Accordingly, it can be reflected that the original coordinate range formed by 665 × 450 includes a single incomplete pixel block, and in order to enable the original coordinate range to include an integer number of pixel blocks, the original coordinate range can be rounded up according to the width and height of the pixel block, respectively, according to the size of the pixel block, and after rounding up, the corresponding size of the first partial image 210 in the original video frame can be modified to 672 × 464, that is, 672 and 464 can be respectively divided by 32 and 16, so that the modified original coordinate range can include an integer number of pixel blocks. The corrected original coordinate range is a rectangular range formed by (0,0) point to (672,464). The modified rectangular range is indicated by a solid line box in fig. 3.
In the same way, the corresponding corrected original coordinate range of a local image in the original video frame can be calculated. Because the rounding-up mode is adopted, each original coordinate range is enlarged, and the original coordinate ranges may overlap with each other. I.e. one coding block may correspond to multiple partial images simultaneously. Eventually the encoded block may also be sent to multiple decoding devices. After decoding, the decoding device can also perform simple clipping and segmentation on the edge of the formed local image according to the pixel coordinate range of the local image in the target image to form a finally displayed local image, and the finally displayed local image is displayed through the display unit.
In the embodiment of the invention, the problem that the corresponding local image cannot be determined by individual coding blocks is avoided by correcting the original coordinate range, so that omission of the coding blocks is avoided, and the integrity and the accuracy of the finally displayed target image are improved.
Referring to fig. 4, fig. 4 is a video encoding apparatus provided in an embodiment of the present invention, and the apparatus is applied to an encoding device, and includes:
a first obtaining module 401, configured to obtain an original video frame to be encoded;
a second obtaining module 402, configured to obtain display parameters of the original video frame in the video wall, where the display parameters include: the overall image size of the target image and the pixel coordinate range of each local image in the target image are determined, wherein the target image is a complete image displayed when the original video frame is displayed in the television wall, and the local images are partial images respectively displayed in each display unit forming the target image in the television wall;
a scaling module 403, configured to scale the original video frame according to the overall image size if the overall image size is smaller than the initial display size of the original video frame;
an encoding module 404, configured to encode the original video frame to obtain a plurality of encoding blocks, where each encoding block corresponds to a pixel block in the original video frame;
a calculating module 405, configured to determine, according to a position of a pixel block corresponding to each coding block in the original video frame and a pixel coordinate range of each local image in the target image, the local image corresponding to each coding block;
a sending module 406, configured to send each of the encoding blocks to a decoding device for decoding the local image corresponding to the encoding block.
In the embodiment of the present invention, when an encoding device acquires an original video frame, a display parameter of the original video frame when the original video frame is displayed on a television wall may also be acquired, the encoding device encodes the original video frame to obtain a plurality of encoding blocks, and then, according to a position of a pixel block corresponding to each encoding block in the original video frame and a pixel coordinate range of each local image in a target image, a local image corresponding to each encoding block is determined. And then each coding block is respectively sent to decoding equipment for decoding the local image corresponding to the coding block, so that each decoding equipment only needs to receive part of the coding blocks and decode the part of the coding blocks to form corresponding local images, and the local images are displayed through a display unit. It is not necessary to transmit data resulting from encoding for the entire video frame to each decoding device as in the prior art. Therefore, the total transmitted data volume can be reduced, the waste of transmission resources is avoided, decoding equipment is not needed to decode the data after the complete video frame is coded, and only partial coding blocks are decoded, so that the workload of the decoding equipment can be reduced.
Optionally, in the video encoding device according to the embodiment of the present invention, if there are a plurality of the overall image sizes in the display parameter and the plurality of the overall image sizes are all smaller than the initial display size, the scaling module is specifically configured to:
selecting a maximum overall image size from a plurality of overall image sizes; scaling the original video frame according to the maximum overall image size.
Optionally, in the video encoding apparatus provided in the embodiment of the present invention, the calculating module 405 is specifically configured to:
determining an original coordinate range corresponding to each local image in the original video frame according to the total image size and the pixel coordinate range of the local image;
and comparing the position of the pixel block corresponding to each coding block in the original video frame with each original coordinate range, determining a local image to which the pixel block corresponding to the coding block belongs from each local image, and taking the local image as the local image corresponding to the coding block.
Optionally, in the video encoding apparatus provided in the embodiment of the present invention, the calculating module 405 is specifically configured to:
determining the ratio of each local image in the overall image size according to the pixel coordinate range of each local image; and calculating the corresponding original coordinate range of the local image in the original video frame according to the ratio.
Optionally, in the video encoding apparatus provided in the embodiment of the present invention, the apparatus further includes:
and the correction module is used for correcting the original coordinate range according to the size of the pixel blocks corresponding to the coding blocks, so that the original coordinate range can contain the pixel blocks corresponding to an integral number of coding blocks.
Optionally, in the video encoding apparatus provided in the embodiment of the present invention, the apparatus further includes:
a grouping module, configured to divide all coding blocks of the original video frame into coding block groups corresponding to different local images;
the sending module 406 is specifically configured to:
and sending each coding block group to a decoding device for decoding the local image corresponding to the coding block group.
Optionally, in the video encoding apparatus provided in the embodiment of the present invention, the apparatus further includes:
the address module is used for determining decoding equipment corresponding to each coding block; adding the target network address of the decoding device corresponding to the coding block into the additional information of the coding block;
the sending module 406 is specifically configured to:
and packaging each coding block into a data packet transmitted through a network, and sending the data packet to decoding equipment corresponding to the target network address according to the target network address in the additional information.
Optionally, in the video encoding apparatus provided in the embodiment of the present invention, the sending module 406 is specifically configured to:
for each coding block, determining a display unit corresponding to the coding block through a local image corresponding to the coding block; and sending each coding block to the decoding equipment of the display unit corresponding to the coding block.
The embodiment of the present invention further provides an encoding apparatus, as shown in fig. 5, including a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502, and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the following steps:
acquiring an original video frame to be coded;
acquiring display parameters of the original video frame in the television wall, wherein the display parameters comprise: the method comprises the steps that the overall image size of a target image and the pixel coordinate range of each local image in the target image are determined, wherein the target image is a complete image displayed when an original video frame is displayed in the television wall, and the local images are partial images which are respectively displayed in each display unit forming the target image in the television wall;
if the total image size is smaller than the initial display size of the original video frame, zooming the original video frame according to the total image size;
coding the scaled original video frame to obtain a plurality of coding blocks, wherein each coding block corresponds to a pixel block in the original video frame;
determining the local images respectively corresponding to each coding block according to the position of the pixel block corresponding to each coding block in the original video frame and the pixel coordinate range of each local image in the target image;
and sending each coding block to a decoding device for decoding the local image corresponding to the coding block.
The communication bus mentioned in the electronic device may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a RAM (Random Access Memory) or an NVM (Non-Volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, which has instructions stored therein, which when run on a computer, cause the computer to perform the video encoding method described in any of the above embodiments.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the video encoding method described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for embodiments of the apparatus, the decoding device, and the like, since they are substantially similar to the method embodiments, the description is relatively simple, and for relevant points, reference may be made to part of the description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (18)

1. A video encoding method applied to an encoding apparatus, the method comprising:
acquiring an original video frame to be coded;
acquiring display parameters of the original video frame in a television wall, wherein the display parameters comprise: the method comprises the steps that the overall image size of a target image and the pixel coordinate range of each local image in the target image are determined, wherein the target image is a complete image displayed when an original video frame is displayed in the television wall, and the local images are partial images which are respectively displayed in each display unit forming the target image in the television wall;
if the total image size is smaller than the initial display size of the original video frame, zooming the original video frame according to the total image size;
coding the scaled original video frame to obtain a plurality of coding blocks, wherein each coding block corresponds to a pixel block in the original video frame;
determining the local images respectively corresponding to each coding block according to the position of the pixel block corresponding to each coding block in the original video frame and the pixel coordinate range of each local image in the target image;
and sending each coding block to a decoding device for decoding the local image corresponding to the coding block.
2. The method of claim 1, wherein scaling the original video frame according to the overall image size if there are a plurality of overall image sizes in the display parameters, and the plurality of overall image sizes are all smaller than the initial display size, comprises:
selecting a maximum overall image size from a plurality of overall image sizes;
scaling the original video frame according to the maximum overall image size.
3. The method of claim 1, wherein the determining the local image corresponding to each of the coding blocks according to the position of the pixel block corresponding to each of the coding blocks in the original video frame and the pixel coordinate range of each of the local images in the target image comprises:
determining an original coordinate range corresponding to each local image in the original video frame according to the total image size and the pixel coordinate range of the local image;
and comparing the position of the pixel block corresponding to each coding block in the original video frame with each original coordinate range, determining a local image to which the pixel block corresponding to the coding block belongs from each local image, and taking the local image as the local image corresponding to the coding block.
4. The method of claim 3, wherein determining an original coordinate range corresponding to each of the partial images in the original video frame by the overall image size and the pixel coordinate ranges of the partial images comprises:
determining the ratio of each local image in the overall image size according to the pixel coordinate range of each local image;
and calculating the corresponding original coordinate range of the local image in the original video frame according to the ratio.
5. The method according to claim 3 or 4, characterized in that the method further comprises:
and correcting the original coordinate range according to the size of the pixel blocks corresponding to the coding blocks, so that the original coordinate range can contain the pixel blocks corresponding to an integral number of coding blocks.
6. The method of claim 1, further comprising:
dividing all coding blocks of the original video frame into coding block groups corresponding to different local images;
the sending each coding block to a decoding device for decoding the local image corresponding to the coding block includes:
and sending each coding block group to a decoding device for decoding the local image corresponding to the coding block group.
7. The method of claim 1, further comprising:
for each coding block, determining decoding equipment corresponding to the coding block;
adding the target network address of the decoding device corresponding to the coding block into the additional information of the coding block;
the sending each coding block to a decoding device for decoding the local image corresponding to the coding block includes:
and packaging each coding block into a data packet transmitted through a network, and sending the data packet to decoding equipment corresponding to the target network address according to the target network address in the additional information.
8. The method of claim 1, wherein sending each of the encoded blocks to a decoding device for decoding the partial image corresponding to the encoded block comprises:
for each coding block, determining a display unit corresponding to the coding block through a local image corresponding to the coding block;
and sending each coding block to the decoding equipment of the display unit corresponding to the coding block.
9. A video coding apparatus, applied to a coding device, the apparatus comprising:
the first acquisition module is used for acquiring an original video frame to be coded;
a second obtaining module, configured to obtain display parameters of the original video frame in a video wall, where the display parameters include: the method comprises the steps that the overall image size of a target image and the pixel coordinate range of each local image in the target image are determined, wherein the target image is a complete image displayed when an original video frame is displayed in the television wall, and the local images are partial images which are respectively displayed in each display unit forming the target image in the television wall;
a scaling module, configured to scale the original video frame according to the overall image size if the overall image size is smaller than an initial display size of the original video frame;
the encoding module is used for encoding the scaled original video frame to obtain a plurality of encoding blocks, and each encoding block corresponds to a pixel block in the original video frame;
the calculation module is used for determining the local images corresponding to the coding blocks respectively according to the positions of the pixel blocks corresponding to the coding blocks in the original video frame and the pixel coordinate ranges of the local images in the target image;
and the sending module is used for sending each coding block to decoding equipment for decoding the local image corresponding to the coding block.
10. The apparatus of claim 9, wherein if there are a plurality of the overall image sizes in the display parameter, and the plurality of overall image sizes are all smaller than the initial display size, the scaling module is specifically configured to:
selecting a maximum overall image size from a plurality of overall image sizes; scaling the original video frame according to the maximum overall image size.
11. The apparatus of claim 9, wherein the computing module is specifically configured to:
determining an original coordinate range corresponding to each local image in the original video frame according to the total image size and the pixel coordinate range of the local image;
and comparing the position of the pixel block corresponding to each coding block in the original video frame with each original coordinate range, determining a local image to which the pixel block corresponding to the coding block belongs from each local image, and taking the local image as the local image corresponding to the coding block.
12. The apparatus of claim 11, wherein the computing module is specifically configured to:
determining the ratio of each local image in the overall image size according to the pixel coordinate range of each local image; and calculating the corresponding original coordinate range of the local image in the original video frame according to the ratio.
13. The apparatus of claim 11 or 12, further comprising:
and the correction module is used for correcting the original coordinate range according to the size of the pixel blocks corresponding to the coding blocks, so that the original coordinate range can contain the pixel blocks corresponding to an integral number of coding blocks.
14. The apparatus of claim 9, further comprising:
a grouping module, configured to divide all coding blocks of the original video frame into coding block groups corresponding to different local images;
the sending module is specifically configured to:
and sending each coding block group to a decoding device for decoding the local image corresponding to the coding block group.
15. The apparatus of claim 9, further comprising:
the address module is used for determining decoding equipment corresponding to each coding block; adding the target network address of the decoding device corresponding to the coding block into the additional information of the coding block;
the sending module is specifically configured to:
and packaging each coding block into a data packet transmitted through a network, and sending the data packet to decoding equipment corresponding to the target network address according to the target network address in the additional information.
16. The apparatus of claim 9, wherein the sending module is specifically configured to:
for each coding block, determining a display unit corresponding to the coding block through a local image corresponding to the coding block;
and sending each coding block to the decoding equipment of the display unit corresponding to the coding block.
17. The coding device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 8 when executing a program stored in the memory.
18. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-8.
CN201811066855.9A 2018-09-13 2018-09-13 Video coding method, device, coding equipment and storage medium Active CN110896477B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811066855.9A CN110896477B (en) 2018-09-13 2018-09-13 Video coding method, device, coding equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811066855.9A CN110896477B (en) 2018-09-13 2018-09-13 Video coding method, device, coding equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110896477A CN110896477A (en) 2020-03-20
CN110896477B true CN110896477B (en) 2022-04-05

Family

ID=69785261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811066855.9A Active CN110896477B (en) 2018-09-13 2018-09-13 Video coding method, device, coding equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110896477B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112367557B (en) * 2020-10-29 2023-03-24 深圳Tcl数字技术有限公司 Display method of LED television wall, television and computer readable storage medium
CN112929601B (en) * 2021-01-22 2024-05-10 广东新粤交通投资有限公司 Vehicle monitoring video transmission system and transmission method
CN112817681B (en) * 2021-02-09 2023-03-24 杭州海康威视系统技术有限公司 Data display method, device, equipment and machine-readable storage medium
CN113613014A (en) * 2021-08-03 2021-11-05 北京爱芯科技有限公司 Image decoding method and device and image coding method and device
CN115914506A (en) * 2021-08-04 2023-04-04 西安青松光电技术有限公司 LED display screen image processing method, device and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102196243A (en) * 2011-04-02 2011-09-21 杭州华三通信技术有限公司 Video data processing method, device and system
CN104284098A (en) * 2013-07-01 2015-01-14 杭州海康威视数字技术股份有限公司 Method and system for processing video data
CN104333739A (en) * 2014-10-28 2015-02-04 广东威创视讯科技股份有限公司 Echoing device and echoing method for spliced wall system
CN104657101A (en) * 2015-02-12 2015-05-27 武汉新蜂乐众网络技术有限公司 Image mosaic display method and system
WO2018066804A1 (en) * 2016-10-07 2018-04-12 (주)코텍 Touch screen device and control method therefor

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100581264C (en) * 2006-01-21 2010-01-13 宇龙计算机通信科技(深圳)有限公司 Method for determining video frequency block in-frame or interframe coding

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102196243A (en) * 2011-04-02 2011-09-21 杭州华三通信技术有限公司 Video data processing method, device and system
CN104284098A (en) * 2013-07-01 2015-01-14 杭州海康威视数字技术股份有限公司 Method and system for processing video data
CN104333739A (en) * 2014-10-28 2015-02-04 广东威创视讯科技股份有限公司 Echoing device and echoing method for spliced wall system
CN104657101A (en) * 2015-02-12 2015-05-27 武汉新蜂乐众网络技术有限公司 Image mosaic display method and system
WO2018066804A1 (en) * 2016-10-07 2018-04-12 (주)코텍 Touch screen device and control method therefor

Also Published As

Publication number Publication date
CN110896477A (en) 2020-03-20

Similar Documents

Publication Publication Date Title
CN110896477B (en) Video coding method, device, coding equipment and storage medium
JP7271580B2 (en) Image encoding/decoding method and device, electronic device and system
WO2019001006A1 (en) Method and device for encoding and decoding image data
US11388442B2 (en) Point cloud encoding method, point cloud decoding method, encoder, and decoder
US10681367B2 (en) Intra-prediction video coding method and device
CN113079379A (en) Video compression method, device, equipment and computer readable storage medium
CN112333538A (en) Resolution adjustment method and device, display screen controller and information source equipment
CN108650460B (en) Server, panoramic video storage and transmission method and computer storage medium
US11949853B2 (en) Data decoding method and apparatus, and data coding method and apparatus
CN113453046B (en) Immersive media providing method, immersive media obtaining device, immersive media equipment and storage medium
CN113068040A (en) Image compression method and device, electronic equipment and readable storage medium
CN108810610B (en) Screen sharing method and device
CN110298895B (en) Picture compression method, device, equipment and storage medium based on artificial intelligence
CN114240754A (en) Screen projection processing method and device, electronic equipment and computer readable storage medium
CN110545427A (en) PDF document compression method and device and electronic equipment
CN111683249A (en) Data reading method, device, decoder and storage medium
CN108668166B (en) Coding method, device and terminal equipment
CN113992951A (en) Screen projection method, projector and terminal equipment
CN112468883A (en) Video stream playing method and video stream playing equipment
CN110581995A (en) Video processing method and device
CN117440160A (en) Video processing method, device, equipment and storage medium
CN111885417B (en) VR video playing method, device, equipment and storage medium
CN111405349B (en) Information implantation method and device based on video content and storage medium
CN105245933A (en) Screen display method and device
CN112331310A (en) Medical image data display method and device, storage medium and intelligent equipment

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