CN112218096B - Video image encoding method and apparatus, electronic device, and storage medium - Google Patents

Video image encoding method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
CN112218096B
CN112218096B CN202010915393.4A CN202010915393A CN112218096B CN 112218096 B CN112218096 B CN 112218096B CN 202010915393 A CN202010915393 A CN 202010915393A CN 112218096 B CN112218096 B CN 112218096B
Authority
CN
China
Prior art keywords
video frame
image
decoded
frame
original
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
CN202010915393.4A
Other languages
Chinese (zh)
Other versions
CN112218096A (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.)
Ifreecomm Technology Co ltd
Original Assignee
Ifreecomm 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 Ifreecomm Technology Co ltd filed Critical Ifreecomm Technology Co ltd
Priority to CN202010915393.4A priority Critical patent/CN112218096B/en
Publication of CN112218096A publication Critical patent/CN112218096A/en
Application granted granted Critical
Publication of CN112218096B publication Critical patent/CN112218096B/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/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • 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/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion

Landscapes

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

Abstract

The application relates to a video image coding method, which comprises the following steps: acquiring a field-merged original interlaced video frame, wherein odd lines of the original interlaced video frame correspond to original odd field image content, and even lines of the original interlaced video frame correspond to original even field image content; gathering odd lines of an original interlaced video frame to a first part of the video frame, gathering even lines of the original interlaced video frame to a second part of the video frame, and obtaining an updated interlaced video frame, wherein the first part is not overlapped with the second part; and carrying out progressive video coding on the updated interlaced video frame to obtain corresponding coded data, wherein the coded data is used for obtaining a corresponding decoded image frame through progressive video decoding, and restoring the decoded image frame into a field-combined decoded interlaced video frame. The application also discloses a video image coding device, electronic equipment and a computer readable storage medium, which ensure the fluency and the definition of the decoded image.

Description

Video image encoding method and apparatus, electronic device, and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a video image encoding method and apparatus, an electronic device, and a computer-readable storage medium.
Background
In recent years, with the development of computer technology, when the system requires that the video input and output are in an interlaced video format, if the image needs to be transmitted over the network, it is a common practice to perform deinterlacing processing into a progressive video with half of the number of frames as a field number, then encode the progressive video in a common progressive encoding mode, transmit the progressive video to a remote system through the network, decode the progressive video at the remote end, and output the progressive video in an interlaced format. In this case, the image is not subjected to the frame interpolation processing, the video frame rate is reduced to half of the number of fields, then the video is encoded and transmitted, and then the video is decoded and output, so that the image fluency is reduced to half of the original image fluency, and the image definition is also reduced after the interlaced conversion and the progressive conversion.
In a system that does not support interlaced scanning format encoding and decoding and full frame rate de-interlacing, if the input is interlaced video, the actual image display effect will be poor after network transmission.
Disclosure of Invention
The embodiment of the application provides a video image coding method and device, electronic equipment and a computer readable storage medium, so that after a video in an interlaced scanning format is coded, the video is transmitted through a network and then is output after opposite end decoding processing, and the displayed video can keep good fluency and definition.
A video image encoding method, comprising:
acquiring a field-combined original interlaced video frame, wherein odd lines of the original interlaced video frame correspond to original odd field image content, and even lines of the original interlaced video frame correspond to original even field image content;
gathering odd lines of the original interlaced video frame to a first part of the video frame, gathering even lines of the original interlaced video frame to a second part of the video frame, and obtaining an updated interlaced video frame, wherein the first part and the second part are not overlapped;
and carrying out progressive video coding on the updated interlaced video frame to obtain corresponding coded data, wherein the coded data are used for obtaining corresponding decoded image frames through progressive video decoding, and restoring the decoded image frames into field-combined decoded interlaced video frames.
A video image encoding apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a field-combined original interlaced video frame, the odd lines of the original interlaced video frame correspond to original odd field image content, and the even lines of the original interlaced video frame correspond to original even field image content;
the updating module is used for gathering the odd lines of the original interlaced video frame to a first part in the video frame and gathering the even lines of the original interlaced video frame to a second part in the video frame to obtain an updated interlaced video frame, wherein the first part and the second part are not overlapped;
and the coding module is used for carrying out progressive video coding on the updated interlaced video frame to obtain corresponding coded data, the coded data is used for obtaining a corresponding decoded image frame through progressive video decoding, and the decoded image frame is restored to a field-combined decoded interlaced video frame.
An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
acquiring a field-combined original interlaced video frame, wherein odd lines of the original interlaced video frame correspond to original odd field image content, and even lines of the original interlaced video frame correspond to original even field image content;
gathering odd lines of the original interlaced video frame to a first part of the video frame, gathering even lines of the original interlaced video frame to a second part of the video frame, and obtaining an updated interlaced video frame, wherein the first part and the second part are not overlapped;
and carrying out progressive video coding on the updated interlaced video frame to obtain corresponding coded data, wherein the coded data are used for obtaining a corresponding decoded image frame through progressive video decoding, and restoring the decoded image frame into a field-combined decoded interlaced video frame.
A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, causes the processor to perform the steps of:
acquiring a field-merged original interlaced video frame, wherein odd lines of the original interlaced video frame correspond to original odd field image content, and even lines of the original interlaced video frame correspond to original even field image content;
gathering odd lines of the original interlaced video frame to a first part of the video frame, gathering even lines of the original interlaced video frame to a second part of the video frame, and obtaining an updated interlaced video frame, wherein the first part and the second part are not overlapped;
and carrying out progressive video coding on the updated interlaced video frame to obtain corresponding coded data, wherein the coded data are used for obtaining corresponding decoded image frames through progressive video decoding, and restoring the decoded image frames into field-combined decoded interlaced video frames.
The video image coding method, the video image coding device, the electronic equipment and the computer readable storage medium are used for acquiring the original interlaced video frame with combined fields, wherein the odd lines of the original interlaced video frame correspond to the original odd field image content, and the even lines of the original interlaced video frame correspond to the original even field image content; gathering odd lines of an original interlaced video frame to a first part of the video frame, gathering even lines of the original interlaced video frame to a second part of the video frame, and obtaining an updated interlaced video frame, wherein the first part is not overlapped with the second part; the method comprises the steps of carrying out progressive video coding on an updated interlaced video frame to obtain corresponding coded data, wherein the coded data are used for obtaining corresponding decoded image frames through progressive video decoding, reducing the decoded image frames into decoded interlaced video frames with combined fields, transmitting the images subjected to self-defined processing in a progressive coding mode, displaying the images after decoding, effectively storing information of odd and even fields, ensuring the smoothness and the definition of the images of the videos, and avoiding the problems that the moving pictures have obvious saw-toothed shapes, and the smoothness of the images is reduced due to the fact that the interlaced videos are directly coded and decoded by the progressive videos without supporting interlaced video coding by a system or carrying out full frame rate de-interlacing by the system.
Drawings
In order to more clearly illustrate the embodiments of the present application 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 application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of an exemplary embodiment of a video encoding method;
FIG. 2 is a flow diagram illustrating a method for encoding video images according to one embodiment;
FIG. 3 is a schematic diagram of a storage manner of an image inside an acquisition module in one embodiment;
FIG. 4 is a schematic diagram of content overlay to form captured video frames in another embodiment;
FIG. 5 is a diagram illustrating pre-encoding and post-decoding processing performed separately in one embodiment;
FIG. 6 is a block diagram showing the structure of a video image encoding apparatus according to one embodiment;
fig. 7 is a schematic diagram of an internal structure of an electronic device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
FIG. 1 is a diagram of an embodiment of a video coding method. As shown in fig. 1, the application environment includes a terminal 110, a server 120, and a terminal 130, where the terminal 110 collects videos in an interlaced scanning format from an input port, each video frame in the videos is a field-merged original interlaced video frame, odd lines of the original interlaced video frame correspond to original odd-field image content, and even lines of the original interlaced video frame correspond to original even-field image content; gathering odd lines of an original interlaced video frame to a first part of the video frame, gathering even lines of the original interlaced video frame to a second part of the video frame, and obtaining an updated interlaced video frame, wherein the first part and the second part are not overlapped. The updated interlaced video frame is subjected to progressive video coding to obtain corresponding coded data, the coded data can be sent to the server 120 from the terminal 110 and forwarded to the receiving terminal 130 through the server 120, the receiving terminal 130 obtains a corresponding decoded image frame through progressive video decoding, the decoded image frame is restored to a field-merged decoded interlaced video frame, and the decoded interlaced video frame is restored to a decoded odd field image and a decoded even field image through an output port of an interlaced scanning format for displaying. The terminals 110 and 130 may be terminal devices including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a vehicle-mounted computer, and a wearable device. Where the server 120 may be a server or a cluster of servers.
FIG. 2 is a flow diagram of a method for video image encoding in one embodiment. The video image encoding method shown in fig. 2 is applicable to the terminal 110 or the terminal 130, and includes:
step 202, acquiring a field-merged original interlaced video frame, where odd lines of the original interlaced video frame correspond to original odd field image content, and even lines of the original interlaced video frame correspond to original even field image content.
Specifically, the field-merged original interlaced video frame refers to progressive image data formed by odd and even fields in the same video memory, and is equivalent to that all odd lines in the original interlaced video frame are original odd field images, and all even lines are original even field images. If an interlaced format, i.e. 1920 × 1080I50, is actually 25 frames of progressive image data, and odd and even fields are in the same video memory, it can be understood that the interlaced format can be called I format or interlaced format.
Step 204, aggregating the odd lines of the original interlaced video frame to a first portion of the video frame, and aggregating the even lines of the original interlaced video frame to a second portion of the video frame, to obtain an updated interlaced video frame, wherein the first portion and the second portion are non-overlapping.
Specifically, odd lines of the original interlaced video frame represent image content of an odd field, the image content of the odd field is moved to a first portion of the image in a Direct Memory Access (DMA) manner, even lines of the original interlaced video frame represent image content of an even field, and the image content of the even field is moved to a second portion of the image, where there is no overlapping portion between the first portion and the second portion, the first portion may be an upper half of a frame of the image in the Memory, the second portion may be a lower half of the frame of the image in the Memory, or the first portion may be a lower half of the frame of the image in the Memory, and the second portion is an upper half of the frame of the image in the Memory.
And step 206, carrying out progressive video coding on the updated interlaced video frame to obtain corresponding coded data, wherein the coded data are used for obtaining a corresponding decoded image frame through progressive video decoding, and restoring the decoded image frame into a field-combined decoded interlaced video frame.
Specifically, the updated interlaced video frame is directly encoded by a common progressive codec to obtain encoded data, and the encoded data is transmitted to an opposite-end system through a network. The opposite end system can decode through a common progressive video decoder, and reversely restores the decoded images, namely the images with half of odd field contents and half of even field contents, into the images with odd line odd field contents and even line even field contents, namely the field-combined decoded interlaced video frames by using a DMA mode. The restored image can be sent to an output port of an interlaced scanning format for output, the output can be displayed according to a field method, namely field-by-field output, and the image content is output for display according to an odd-even field interlaced form. Through the above steps, when an image of 1920 × 1080I50 is input, the 1920 × 1080I50 image is also output through encoding and decoding, the frame rate is not lost, and the displayed video can keep good fluency and definition. It will be appreciated that all I formats apply to the above method, and I50 is merely an example.
In the video image encoding method in the embodiment, a field-merged original interlaced video frame is obtained, odd lines of the original interlaced video frame correspond to original odd field image content, and even lines of the original interlaced video frame correspond to original even field image content; gathering odd lines of an original interlaced video frame to a first part of the video frame, gathering even lines of the original interlaced video frame to a second part of the video frame, and obtaining an updated interlaced video frame, wherein the first part is not overlapped with the second part; the method comprises the steps of carrying out progressive video coding on an updated interlaced video frame to obtain corresponding coded data, wherein the coded data are used for obtaining corresponding decoded image frames through progressive video decoding, reducing the decoded image frames into decoded interlaced video frames with combined fields, transmitting the images subjected to self-defined processing in a progressive coding mode, displaying the images after decoding, effectively storing information of odd and even fields, ensuring the smoothness and the definition of the images of the videos, and avoiding the problems that the moving pictures have obvious saw-toothed shapes, and the smoothness of the images is reduced due to the fact that the interlaced videos are directly coded and decoded by the progressive videos without supporting interlaced video coding by a system or carrying out full frame rate de-interlacing by the system.
In one embodiment, step 202 comprises: and collecting the video in the interlaced scanning format from the input port, and taking each video frame in the video as an original interlaced video frame.
Specifically, the video input port collects 1 path of video, for example, the collected video is collected in a high-definition video format of 1080I50, the collected video is 50 fields of an interlaced line, and the video is stored in the memory by frames, that is, 1 field and 2 fields are stored in one frame, and 3 field and 4 field are stored in one frame through 25 frames.
In the embodiment, each video frame in the video is processed as an original interlaced video frame, so that each original interlaced video frame is processed to obtain a corresponding updated interlaced video frame, and thus, progressive video coding can be performed to obtain corresponding coded data, the format of the output video after transmission and decoding is the same as that of the original input video, and the frame rate and the image quality of the video after transmission and decoding are ensured without increasing the cost.
In one embodiment, step 204 comprises: and moving the image content of the odd lines of the original interlaced video frame to the upper half part of the video frame, and moving the image content of the even lines of the original interlaced video frame to the lower half part of the video frame.
Specifically, for example, for a 1920 × 1080I50 image, lines 1, 2, 3, 4, 5, \8230 \ 8230 \ 8230;, 1919, 1920 in an original interlaced video frame are image data of one frame, wherein lines 1, 3, 5, 7 \8230; \ 82301919 is image content of odd fields, and lines 2, 4, 6, 8, \8230; \ 82301920 is image content of even fields. The image contents of lines 1, 3, 5 and 7 of 8230, 82301919 of the frame are all moved to the upper part of the video frame, and the image contents of lines 2, 4, 6, 8, 8230, 82301920 of the frame are all moved to the lower part of the video frame. Thus, the odd fields of the original interlaced video are all placed in the upper half of a frame of the image in the memory, and the even fields are all placed in the lower half.
In this embodiment, the odd fields are all placed in the upper half and the even fields are all placed in the lower half of one frame of an image in the memory, so that the correlation of the image exists between adjacent lines, and the subsequent encoding can be performed through a progressive video encoding algorithm.
In one embodiment, after step 206, the method further includes: transmitting the encoded data to a decoding end; the decoding end obtains a corresponding decoding image frame through progressive video decoding; and inserting the image content of the second part of the decoded image frame into the image content of the first part of the decoded image frame in an interlaced mode respectively to form a decoded interlaced video frame, wherein the odd lines of the decoded interlaced video frame correspond to the decoded data of the original odd field image content, and the even lines of the decoded interlaced video frame correspond to the decoded data of the original even field image content.
Specifically, a new memory is obtained, the upper half and the lower half of decoded image frames decoded by the progressive video decoding algorithm are first interlaced and copied to the new memory in a DMA manner, for example, the upper half of odd field data, which is 540 lines in total, are first copied, and then the copied images are distributed in 1, 3, 5, 7, \ 8230 \ 8230;, 1079 odd lines of the new memory. And the next half image, namely the even field image, is copied to the 2, 4, 6, 8, \8230 \ 8230; \ 8230and 1080 even lines of the new memory by the same operation for the second time, so that a decoded interlaced video frame is formed, the odd lines of the decoded interlaced video frame correspond to the decoded data of the original odd field image content, and the even lines of the decoded interlaced video frame correspond to the decoded data of the original even field image content.
In the embodiment, the decoded interlaced video frame is formed by processing the image content in the decoded image frame, so that the decoded interlaced video frame can be sent to an output port of an interlaced scanning format for display, and the consistency of the input and output image formats is ensured.
In one embodiment, the method further comprises: transmitting the decoded interlaced video frame to an interlaced scanning format output port; an output port of the interlaced scanning format forms the odd lines of the decoded interlaced video frame into a decoded odd field image; an output port of the interlaced scanning format forms a decoded even field image by decoding even lines of an interlaced video frame; the decoded odd field picture and the decoded even field picture are sequentially output.
Specifically, if the input is a 1080I50 image, the input is an original interlaced video frame with a frame rate of 25, and the original interlaced video frame with the frame rate of 25 is obtained after decoding, and can be directly sent to the output port of the 1080I50 for output, and the output can be output field by field according to a field method.
In the embodiment, the display is restored at the far end, and the odd-even field characteristics of the image can be kept to a great extent, so that the decoded image has good display effect at the terminal, the fluency and the definition of the image are ensured, and the problems that an encoder and a decoder do not support interlaced coding and a chip cannot carry out full-frame-rate de-interlacing processing are effectively solved.
In a specific embodiment, a video image encoding method is provided, which comprises the following steps:
1. the Video input port collects 1 path of Video which is marked as Video #1, and the high-definition Video formats are 1080I50.
2. The acquired Video #1 is 50 interlaced fields, which are stored in the memory by frames, i.e. 1 and 2 fields are in one frame, and 3 and 4 fields are in one frame, which is called as original interlaced Video frame of field merging, as shown in fig. 3 and 4, the storage mode of images in 1080I50 format inside the acquisition module is schematically illustrated, when the acquisition module is a haisi chip, the internal frame data is overlapped by adjacent odd and even 2 field contents, i.e. odd row odd field contents and even row even field contents.
3. In the hi3531dv100, a frame of captured image in Video #1, actually including adjacent front and rear 2 fields, is processed into an odd field in the upper half of the image and an even field in the lower half of the image, so as to obtain an updated interlaced Video frame, as shown in fig. 5, which shows the updated interlaced Video frame obtained after processing.
4. The updated interlaced video frame is sent to a common progressive encoder for encoding and transmission to a remote system.
5. The far-end system receives the code stream and decodes the code stream, the decoded image is also an image with odd and even fields respectively on the upper and lower parts of the image, the decoded image is processed in a manner of DMA (direct memory access) to be an image with odd lines as the odd field and even lines as the even field, and then a field-merged decoded interlaced video frame is obtained, as shown in FIG. 5, the schematic diagram of the decoded interlaced video frame obtained by the post-decoding processing is shown.
6. And sending the processed image to an output port in a 1080I50 format for display.
The method comprises the steps of processing each frame in steps 2-6, distributing an odd field and an even field of a frame of acquired image in the upper half part and the lower half part of the frame of image respectively, acquiring a 1080I50 image originally, processing and coding a 25-second frame, transmitting and decoding to obtain a decoded image or a 1080I50 image, wherein the image fluency is not different from that of the original image, and the method of processing and coding does not need to support interlaced coding systematically, can be carried out by common progressive video coding and progressive video decoding, and has strong compatibility.
In the embodiment, even lines of an original interlaced Video frame are gathered to the second part of the Video frame to obtain an updated interlaced Video frame, the first part is not overlapped with the second part, an image of the input interlaced Video #1 after self-defining processing is transmitted in a progressive coding mode and displayed after decoding, the information of odd and even fields can be effectively stored, the fluency of the Video and the definition of the image are ensured, the system does not need to support interlaced Video coding, the system does not need to perform full frame rate de-interlacing, after the processing of the method, the method can not be the same as the method for directly performing progressive Video coding and decoding on the interlaced Video, a moving picture has obvious saw-toothed shape, the problem of image fluency reduction caused by frame rate reduction after de-interlacing does not occur, and the method has great advantages in practical application.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the sub-steps or stages of other steps.
FIG. 6 is a block diagram of a video image encoding apparatus 500 according to an embodiment. As shown in fig. 6, a video image encoding apparatus 500 includes: an obtaining module 502, an updating module 504, and an encoding module 506, wherein:
the obtaining module 502 is configured to obtain a field-merged original interlaced video frame, where odd lines of the original interlaced video frame correspond to original odd field image content, and even lines of the original interlaced video frame correspond to original even field image content.
The updating module 504 is configured to gather odd lines of the original interlaced video frame to a first portion of the video frame, gather even lines of the original interlaced video frame to a second portion of the video frame, and obtain an updated interlaced video frame, where the first portion is non-overlapped with the second portion.
The encoding module 506 is configured to perform progressive video encoding on the updated interlaced video frame to obtain corresponding encoded data, where the encoded data is used to obtain a corresponding decoded image frame through progressive video decoding, and the decoded image frame is restored to a field-merged decoded interlaced video frame.
The video image encoding apparatus 500 in this embodiment acquires a field-merged original interlaced video frame, where odd lines of the original interlaced video frame correspond to original odd field image content, and even lines of the original interlaced video frame correspond to original even field image content; gathering odd lines of an original interlaced video frame to a first part of the video frame, gathering even lines of the original interlaced video frame to a second part of the video frame, and obtaining an updated interlaced video frame, wherein the first part is not overlapped with the second part; the method comprises the steps of carrying out progressive video coding on an updated interlaced video frame to obtain corresponding coded data, using the coded data to obtain a corresponding decoded image frame through progressive video decoding, restoring the decoded image frame into a field-combined decoded interlaced video frame, transmitting the image after self-defining processing in a progressive coding mode, displaying the image after decoding, effectively storing information of odd and even fields, ensuring the smoothness of the video and the definition of the image, not needing a system to support interlaced video coding, and not needing the system to carry out full frame rate de-interlacing.
In one embodiment, the obtaining module 502 is further configured to collect the video in the interlaced scanning format from the input port, and use each video frame in the video as an original interlaced video frame.
In the embodiment, each video frame in the video is processed as an original interlaced video frame, so that each original interlaced video frame is processed to obtain a corresponding updated interlaced video frame, and thus, progressive video coding can be performed to obtain corresponding coded data, the format of the output video after transmission and decoding is the same as that of the original input video, and the frame rate and the image quality of the video after transmission and decoding are ensured without increasing the cost.
In one embodiment, the update module 504 is further configured to move the odd-line image content of the original interlaced video frame to the top half of the video frame and the even-line image content of the original interlaced video frame to the bottom half of the video frame.
In this embodiment, the odd fields are all placed in the upper half and the even fields are all placed in the lower half of a frame of an image in the memory, so that the correlation of the image exists between adjacent lines, and the subsequent encoding can be performed by a progressive video encoding algorithm.
In one embodiment, the apparatus further comprises: a transmission module 508, configured to transmit the encoded data to a decoding end; the decoding end obtains a corresponding decoded image frame through progressive video decoding; and inserting the image content of the second part of the decoded image frame into the image content of the first part of the decoded image frame in an interlaced mode respectively to form a decoded interlaced video frame, wherein the odd lines of the decoded interlaced video frame correspond to the decoded data of the original odd field image content, and the even lines of the decoded interlaced video frame correspond to the decoded data of the original even field image content.
In the embodiment, the decoded interlaced video frame is formed by processing the image content in the decoded image frame, so that the decoded interlaced video frame can be sent to an output port of an interlaced scanning format for display, and the consistency of the input and output image formats is ensured.
In one embodiment, the apparatus further comprises: an output module 510, configured to deliver the decoded interlaced video frame to an interlace format output port; an output port of the interlaced scanning format forms a decoded odd field image by decoding odd lines of an interlaced video frame; an output port of the interlaced scanning format forms a decoded even field image by decoding even lines of an interlaced video frame; the decoded odd field picture and the decoded even field picture are sequentially output.
In the embodiment, the display is recovered at the far end, the odd-even field characteristic of the image can be kept to a great extent, so the decoded image has good display effect at the terminal, the fluency and the definition of the image are ensured, and the problems that an encoder and a decoder do not support interlaced coding and a chip cannot carry out full-frame-rate de-interlaced processing are effectively solved.
For specific limitations of the video image encoding apparatus, reference may be made to the above limitations of the video image encoding method, which are not described herein again. The respective modules in the video image encoding apparatus described above may be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Fig. 7 is a schematic diagram of an internal structure of an electronic device in one embodiment. As shown in fig. 7, the electronic apparatus includes a processor and a memory connected by a system bus. Wherein, the processor is used for providing calculation and control capability and supporting the operation of the whole electronic equipment. The memory may include non-volatile storage media and internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by a processor for implementing the video image encoding method provided in the above embodiments. The internal memory provides a cached execution environment for the operating system computer programs in the non-volatile storage medium. The electronic device may be a mobile phone, a server, etc.
The implementation of each module in the video image encoding apparatus provided in the embodiments of the present application may be in the form of a computer program. The computer program may be run on a terminal or a server. The program modules constituted by the computer program may be stored on the memory of the terminal or the server. Which when executed by a processor, performs the steps of the method described in the embodiments of the present application.
The embodiment of the application also provides a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of a video image encoding method.
A computer program product comprising instructions which, when run on a computer, cause the computer to perform a video image encoding method.
Any reference to memory, storage, database or other medium used herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct bused dynamic RAM (DRDRAM), and Rambus Dynamic RAM (RDRAM).
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A video image encoding method, comprising:
acquiring a field-combined original interlaced video frame, wherein odd lines of the original interlaced video frame correspond to original odd field image content, even lines of the original interlaced video frame correspond to original even field image content, and the field-combined original interlaced video frame refers to progressive image data formed by odd and even fields in the same video memory;
gathering odd lines of the original interlaced video frame to a first part of the video frame, gathering even lines of the original interlaced video frame to a second part of the video frame, and obtaining an updated interlaced video frame, wherein the first part and the second part are non-overlapped, the first part is the upper half part of a frame of an image in a memory, the second part is the lower half part of the frame of the image in the memory, or the first part is the lower half part of the frame of the image in the memory, and the second part is the upper half part of the frame of the image in the memory;
carrying out progressive video coding on the updated interlaced video frame to obtain corresponding coded data, wherein the coded data is used for obtaining a corresponding decoded image frame through progressive video decoding, the decoded image frame is an image with half of odd field content and half of even field content, the decoded image frame is reduced into a field-combined decoded interlaced video frame, the decoded interlaced video frame is odd-numbered-row odd-field content, the decoded interlaced video frame is an image with even-numbered-row even-field content, and the decoded interlaced video frame is transmitted to an output port of an interlaced scanning format; the output port of the interlaced scanning format forms the odd lines of the decoded interlaced video frame into a decoded odd field image; the interlaced scanning format output port forms even lines of the decoded interlaced video frame into a decoded even field image; and outputting the decoded odd field image and the decoded even field image in sequence.
2. The method of claim 1, wherein said obtaining a field-merged original interlaced video frame comprises:
collecting a video in an interlaced scanning format from an input port;
and taking each video frame in the video as the original interlaced video frame.
3. The method of claim 1, wherein aggregating odd lines of the original interlaced video frame into a first portion of a video frame and aggregating even lines of the original interlaced video frame into a second portion of a video frame to obtain an updated interlaced video frame comprises:
moving the odd-line image content of the original interlaced video frame to the upper half part of the video frame;
and moving the even-numbered line image content of the original interlaced video frame to the lower half part of the video frame.
4. The method according to claim 1, wherein said progressively coding the updated interlaced video frame to obtain the corresponding coded data comprises:
transmitting the encoded data to a decoding end;
the decoding end obtains a corresponding decoded image frame through progressive video decoding;
inserting the image content of the second part of the decoded image frame into the image content of the first part of the decoded image frame in an interlaced manner respectively to form the decoded interlaced video frame, wherein the odd lines of the decoded interlaced video frame correspond to the decoded data of the original odd field image content, and the even lines of the decoded interlaced video frame correspond to the decoded data of the original even field image content.
5. The method of claim 4, wherein the originally acquired 1080I50 image corresponds to a decoded image or a 1080I50 image.
6. A video image encoding apparatus, comprising:
the system comprises an acquisition module, a frame merging module and a frame merging module, wherein the acquisition module is used for acquiring a field-merged original interlaced video frame, odd lines of the original interlaced video frame correspond to original odd field image content, even lines of the original interlaced video frame correspond to original even field image content, and the field-merged original interlaced video frame refers to progressive image data formed by odd and even fields in the same video memory;
an update module, configured to aggregate odd lines of the original interlaced video frame to a first portion of the video frame, and aggregate even lines of the original interlaced video frame to a second portion of the video frame, so as to obtain an updated interlaced video frame, where the first portion is non-overlapping with the second portion, the first portion is an upper half of a frame of an image in the memory, and the second portion is a lower half of a frame of an image in the memory, or the first portion is a lower half of a frame of an image in the memory, and the second portion is an upper half of a frame of an image in the memory;
the encoding module is used for carrying out progressive video encoding on the updated interlaced video frame to obtain corresponding encoded data, the encoded data is used for obtaining a corresponding decoded image frame through progressive video decoding, the decoded image frame is an image with half of odd field content and half of even field content, the decoded image frame is restored into a field-merged decoded interlaced video frame, and the decoded interlaced video frame is an image with odd-numbered line odd field content and even-numbered line even field content;
the output module is used for transmitting the decoded interlaced video frame to an output port of an interlaced scanning format; the output port of the interlaced scanning format forms the odd lines of the decoded interlaced video frame into a decoded odd field image; the interlaced scanning format output port forms even lines of the decoded interlaced video frame into a decoded even field image; and outputting the decoded odd field image and the decoded even field image in sequence.
7. The apparatus of claim 6, wherein the obtaining module is further configured to capture video in interlaced format from an input port, and to treat each video frame in the video as the original interlaced video frame.
8. The apparatus of claim 6, wherein the update module is further configured to move the odd-line image content of the original interlaced video frame to an upper half of the video frame and move the even-line image content of the original interlaced video frame to a lower half of the video frame.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN202010915393.4A 2020-09-03 2020-09-03 Video image encoding method and apparatus, electronic device, and storage medium Active CN112218096B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010915393.4A CN112218096B (en) 2020-09-03 2020-09-03 Video image encoding method and apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010915393.4A CN112218096B (en) 2020-09-03 2020-09-03 Video image encoding method and apparatus, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
CN112218096A CN112218096A (en) 2021-01-12
CN112218096B true CN112218096B (en) 2023-03-28

Family

ID=74049078

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010915393.4A Active CN112218096B (en) 2020-09-03 2020-09-03 Video image encoding method and apparatus, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN112218096B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596453A (en) * 2021-07-27 2021-11-02 咪咕文化科技有限公司 Video compression and decompression method, device, equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2940545B1 (en) * 1998-05-28 1999-08-25 日本電気株式会社 Image conversion method and image conversion device
CN101442649B (en) * 2009-01-08 2011-05-18 杭州华三通信技术有限公司 Processing method and apparatus for removing alternate line and FPGA chip
CN101621652A (en) * 2009-07-21 2010-01-06 上海华平信息技术股份有限公司 Method for transmitting interlaced picture in high quality and changing the interlaced picture into non-interlaced picture in picture transmission system
CN103065349B (en) * 2012-12-31 2016-01-27 艾迪普(北京)文化科技股份有限公司 A kind of data rendering method and device
CN109005341B (en) * 2018-08-01 2020-10-27 深圳市沃特沃德股份有限公司 Camera image signal processing method and device

Also Published As

Publication number Publication date
CN112218096A (en) 2021-01-12

Similar Documents

Publication Publication Date Title
US20200145692A1 (en) Video processing method and apparatus
CN112218096B (en) Video image encoding method and apparatus, electronic device, and storage medium
CN112218081B (en) Method and device for de-interlacing video image, electronic equipment and storage medium
CN113747242B (en) Image processing method, image processing device, electronic equipment and storage medium
CN110572673B (en) Video encoding and decoding method and device, storage medium and electronic device
CN113141352B (en) Multimedia data transmission method and device, computer equipment and storage medium
CN110891195B (en) Method, device and equipment for generating screen image and storage medium
CN110572677B (en) Video encoding and decoding method and device, storage medium and electronic device
US8767831B2 (en) Method and system for motion compensated picture rate up-conversion using information extracted from a compressed video stream
CN106060080A (en) Medical video signal collection and transcoding system
CN110662071A (en) Video decoding method and apparatus, storage medium, and electronic apparatus
CN106027991B (en) Medical video image live broadcast all-in-one
CN114727116A (en) Encoding method and device
CN110418197B (en) Video transcoding method and device and computer readable storage medium
CN110636295B (en) Video encoding and decoding method and device, storage medium and electronic device
CN110572653B (en) Video encoding and decoding methods and devices, storage medium and electronic device
CN110572654B (en) Video encoding and decoding methods and devices, storage medium and electronic device
CN116708793B (en) Video transmission method, device, equipment and storage medium
US20160381318A1 (en) Efficient recording of transaction video
CN115103188A (en) SVC error concealment method, model training method, system and equipment
KR100498363B1 (en) Method for post-processing decoded image of mobile phone
KR100498362B1 (en) Method for post-processing decoded image of mobile phone
CN115499664A (en) Video encoding method, video decoding method, and encoding end or/and decoding end
CN117793458A (en) Video processing method, device, computer equipment and storage medium
CN115529465A (en) Image transmission method, system and device and electronic 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