WO2015188729A1 - Video coding method and video decoding method and related device - Google Patents

Video coding method and video decoding method and related device Download PDF

Info

Publication number
WO2015188729A1
WO2015188729A1 PCT/CN2015/080907 CN2015080907W WO2015188729A1 WO 2015188729 A1 WO2015188729 A1 WO 2015188729A1 CN 2015080907 W CN2015080907 W CN 2015080907W WO 2015188729 A1 WO2015188729 A1 WO 2015188729A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
frame
image data
field
video decoding
Prior art date
Application number
PCT/CN2015/080907
Other languages
French (fr)
Chinese (zh)
Inventor
郑萧桢
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015188729A1 publication Critical patent/WO2015188729A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode

Definitions

  • the present invention relates to the field of video codec technology, and in particular, to a video encoding method, a video decoding method, and related devices.
  • Field coding technology is an encoding technology that can effectively improve the compression efficiency of video data.
  • an image is field-divided to obtain top field image data and top field image data.
  • the top field image data is obtained by scanning odd line pixel point data in an image
  • the bottom field data is obtained by scanning even line pixel point data in one image.
  • the top field image and the bottom field image in one image can be given different priorities. Therefore, if the top field and bottom field image data are still encapsulated in one coded frame in the conventional way, the implementation complexity of the reference frame management technique is increased.
  • the prior art proposes to encode the top field and bottom field data of an image as a single image and independently encapsulate the field coded data into a single coded frame.
  • This type of technology can effectively reduce the complexity of encoding data management and reference frame management, but it will introduce a A new technical problem, that is, each single-field image data obtained by decoding by the video decoding device is isolated from each other, so that it is difficult to determine how to correctly perform image blending of the obtained single-field image data.
  • Embodiments of the present invention provide a video encoding method, a video decoding method, and related devices.
  • a video encoding method can include:
  • the first video coding frame includes a first field coding indication, and the first field coding indication indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first field coding indication is further Instructing the first video encoding frame to include single field image data as top field image data or bottom field image data, the first field encoding indication further indicating the first video encoding frame and the second video encoding frame a sequence of occurrences in the video stream;
  • the first field image data is top field image data
  • the second field image data is bottom field image data
  • the second field image data is top field image data
  • the first field image is The data is bottom field image data.
  • the first indication parameter indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first indication parameter further indicates that the single video image data included in the first video coding frame is top. Field image data or bottom field image data;
  • the second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
  • the first field coding indication includes a third indication parameter, a fourth indication parameter, and a second indication parameter;
  • the third indication parameter indicates that the first video coding frame is a video coding frame corresponding to single field image data
  • the fourth indication parameter indicates that the single video image data included in the first video coding frame is top Field image data or bottom field image data;
  • the second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
  • the second video encoding frame A second field coding indication is included, where the second field coding indication indicates that the second video coding frame is a video coding frame corresponding to single field image data, and the second field coding indication further indicates that the second video coding frame includes The single field image data is bottom field image data or top field image data, and the second field code indication further indicates that the second video coded frame and the first video coded frame appear in the video code stream.
  • a video decoding method includes:
  • the first field coding indication includes a third indication parameter, a fourth indication parameter, and a second indication parameter;
  • the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, the second video decoding frame is present, and the second video decoding frame is in the And appearing in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the The second image decoding data is blended to obtain a blended image;
  • the second video decoding frame includes a second field coding indication, the second field coding indication indicates that the second video decoding frame is a video decoding frame corresponding to single field image data, and the second field coding indication further indicates The single field image data included in the second video decoding frame is top field image data or bottom field image data, and the second field encoding indication further indicates the second video decoding frame and the second The order in which the homologous video decoded frames of the video decoded frame appear in the video bitstream;
  • the first field coding indication and the second field coding indication are An image decoded data and the second image decoded data are blended to obtain a blended image, including:
  • the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream and then appears in the first video decoding frame, and the first field coding indication further indicates The single field image data included in the first video decoding frame is top field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame precedes the video code stream.
  • the second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame is in the video And appearing in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoding data are blended to obtain a blended image;
  • the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream
  • the first field coding indication further indicates The single field image data included in the first video decoding frame is top field image data
  • the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream.
  • the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, the first video decoding frame is present, and the first field coding indication is further
  • the single field image data included in the first video decoding frame is bottom field image data, and the second field encoding indication indicates that the homogenous video decoding frame of the second video decoding frame is first in the video code stream.
  • the second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video And appearing in the code stream before the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoded data are blended to obtain a blended image.
  • the first field coding indication includes a first indication parameter and a second indication parameter
  • the second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
  • the first field coding indication includes a third indication parameter, a fourth indication parameter, and a second indication parameter;
  • the third indication parameter indicates that the first video coding frame is a video coding frame corresponding to single field image data
  • the fourth indication parameter indicates that the single field image data included in the first video coding frame is top field image data or bottom field image data
  • the second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
  • the second video coding The frame includes a second field coding indication
  • the second field coding indication indicates that the second video coding frame is a video coding frame corresponding to single field image data
  • the second field coding indication further indicates the second video coding frame
  • the included single field image data is bottom field image data or top field image data
  • the second field encoding indication further indicates that the second video encoded frame and the first video encoded frame appear in the video code stream The order of precedence.
  • a video decoding apparatus may include:
  • the first video decoding frame includes a first field coding indication, the first field coding indication indicating that the first video decoding frame is a video decoding frame corresponding to single field image data, and the first field coding indication Also indicating a single field image data included in the first video decoding frame Is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video decoded frame and the homogenous video decoded frame of the first video decoded frame are in the video bitstream An order of appearance; wherein the first video decoded frame and the homogenous video decoded frame are obtained based on image data of different fields of the same image;
  • a blending unit configured to blend the first image decoded data and the second image decoded data according to the first field encoding instruction to obtain a blended image.
  • the first field coding indication includes a third indication parameter, a fourth indication parameter, and a second indication parameter;
  • the third indication parameter indicates that the first video decoding frame is a video decoding frame corresponding to single field image data
  • the fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data
  • the second indication parameter indicates an order of appearance of the homologous video decoding frame of the first video decoding frame and the first video decoding frame in the video code stream.
  • the first field coding indication includes a third indication parameter, a fourth indication parameter, and a second indication parameter;
  • the third indication parameter indicates that the first video decoding frame is a video decoding frame corresponding to single field image data
  • the fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data
  • the second indication parameter indicates that a homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream.
  • the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the second video decoding frame is in the The video code stream appears before the first video decoding frame, and the decoded output order of the first image decoded data and the second image decoded data are adjacent to each other, and the first image decoded data and the The second image decoded data is blended to obtain a blended image.
  • the second video decoding frame includes a second field coding indication, the second field coding indication indicates that the second video decoding frame is a video decoding frame corresponding to single field image data, and the second field coding indication further indicates The single field image data included in the second video decoding frame is top field image data or bottom field image data, and the second field encoding indication further indicates the same of the second video decoding frame and the second video decoding frame.
  • the second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video And appearing in the code stream before the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoded data are blended to obtain a blended image.
  • the first field image data and the second field image data of the image are separately video encoded to obtain a first video encoded frame and a second video encoded frame; A video encoded frame and a second video encoded frame are written to the video stream.
  • the first field coding instruction indicates that the first video coding frame is a video coding frame corresponding to the single field image data, and the first field coding indication further indicates the foregoing.
  • the single field image data included in a video encoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video encoding frame and the second video encoding frame appear in the video stream. The order of precedence.
  • the sequence of the homologous video coding frames obtained from the image data of different fields of the same image appears in the video code stream, which is beneficial for the video decoding device to know clearly based on the same
  • the sequence of the homologous video coding frames obtained by the image data of different fields of the image appears in the video code stream, thereby facilitating the video decoding device to correctly image the different field image data of the same image obtained by decoding.
  • FIG. 4 is a schematic diagram of a video decoding apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of another video encoding apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of another video encoding apparatus according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of another video decoding apparatus according to an embodiment of the present invention.
  • Embodiments of the present invention provide a video encoding method, a video decoding method, and related devices.
  • the video encoding method provided by the embodiment of the present invention is described.
  • the main body of the video encoding method provided by the embodiment of the present invention is a video encoding device, where the video encoding device can be any device that needs to output and store video, such as a mobile phone or a notebook. Computers, tablets, personal computers and other equipment.
  • a video encoding method comprises: acquiring an image; performing video encoding on the first field image data of the image to obtain a first video encoding frame; and second field image of the image Data is video-encoded to obtain a second video-coded frame; the first video-coded frame and the second video-coded frame are written into a video code stream; wherein the first video-coded frame includes a first field coding indicator, the first The field coding indication indicates that the first video coding frame is a video coding frame corresponding to the single field image data, and the first field coding indication further indicates that the single field image data included in the first video coding frame is a top field image data or a bottom field image.
  • the first field coding indication further indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream; wherein the first field image data is top field image data, and The second field image data is bottom field image data, or the second field image data is top field image data, and the above A bottom field image data as image data.
  • FIG. 1 is a schematic flowchart diagram of a video encoding method according to an embodiment of the present invention.
  • a video encoding method provided by an embodiment of the present invention may include the following content:
  • the first video coding frame includes a first field coding indication (the first field coding indication may be included, for example, in a frame header and/or other location of the first video coding frame), and the first field coding indication indicates the first
  • the video coding frame is a video coding frame corresponding to single field image data. That is, the first field coding indication may indicate that the first video coding frame includes one field of image data of one image, and does not include two fields of image data of one image.
  • the first field coding indication further indicates that the single field image data included in the first video coding frame is top field image data or bottom field image data. For example, if it is assumed that video encoding the top field image data of the image to obtain the first video encoding frame, the first field encoding indication indicates that the single field image data included in the first video encoding frame is top field image data, assuming The video encoding the bottom field image data of the image to obtain the first video encoding frame, the first field encoding instruction indicating that the single field image data included in the first video encoding frame is the bottom field image data.
  • the first field coding indication further indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the first field coding indication indicates that the first video coding frame and the second video coding frame are in the video code. The order of occurrence in the stream is that the first video coding frame appears before the second video coding frame. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the first field encoding indication indicates that the first video encoding frame and the second video encoding frame are in the video code. The sequence of occurrences in the stream is the first video encoding frame and the second video encoding frame Now.
  • the first field image data and the second field image data of the image are separately video-encoded to obtain a first video-coded frame and a second video-coded frame;
  • the frame and the second video encoded frame are written to the video stream.
  • the first field coding instruction indicates that the first video coding frame is a video coding frame corresponding to the single field image data, and the first field coding indication further indicates the foregoing.
  • the single field image data included in a video encoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video encoding frame and the second video encoding frame appear in the video stream. The order of precedence.
  • the sequence of the homologous video coding frames obtained from the image data of different fields of the same image appears in the video code stream, which is beneficial for the video decoding device to know clearly based on the same
  • the sequence of the homologous video coding frames obtained by the image data of different fields of the image appears in the video code stream, thereby facilitating the video decoding device to correctly image the different field image data of the same image obtained by decoding.
  • the top field image data and the bottom field image data of the image are respectively video-encoded to obtain two video coded frames which are mutually homologous video coded frames, because the field image data included in the two video coded frames are from the same image.
  • the first video coding frame is a homogenous video coding frame of the second video coding frame.
  • the second video coding frame is also a homogenous video coding frame of the first video coding frame.
  • the top field image data and the bottom field image data of an image are "homologous field image data" with each other because the two field image data are from the same image.
  • the top field image data of the image is the same-field image data of the bottom field image data of the image.
  • the bottom field image data of the image is the homologous field image data of the top field image data of the image.
  • the first field coding indication may include a first indication parameter and a second indication parameter.
  • the first indication parameter indicates that the first video encoding frame is a video encoding frame corresponding to single field image data (ie, the first indication parameter may indicate that the first video encoding frame includes a single field image data of an image, and
  • the first indicator parameter further includes the single field image data included in the first video encoding frame as the top field image data or the bottom field image data (for example, assuming that the image is the same for the two fields of image data)
  • the top field image data is video-encoded to obtain a first video-coded frame
  • the first indication parameter indicates that the single-field image data included in the first video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed.
  • Video coding to obtain a first video coding frame where the first indication parameter indicates the first video coding frame
  • the included single field image data is bottom field image data).
  • the second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the second indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video coding frame appears before the second video coding frame.
  • the second indication parameter may indicate that the first video encoding frame and the second video encoding frame are in the video stream. The sequence of occurrences occurs after the first video encoding frame is followed by the second video encoding frame.
  • the first field coding indication may include, for example, a third indication parameter, a fourth indication parameter, and a second indication parameter.
  • the third indication parameter may indicate that the first video coding frame is a video coding frame corresponding to single field image data (ie, the third indication parameter may indicate that the first video coding frame includes a single field image data of an image, Two image data without an image).
  • the fourth indication parameter may indicate that the single field image data included in the first video encoding frame is top field image data or bottom field image data (eg, it is assumed that video encoding the top field image data of the image to obtain the first video) Encoding the frame, the fourth indication parameter indicating that the single field image data included in the first video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain the first video encoding frame, The four indication parameter indicates that the single field image data included in the first video encoding frame is bottom field image data).
  • the second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
  • the foregoing second video coding frame may include a second field coding indication (the second field coding indication may be included, for example, in a frame header and/or other locations of the second video coding frame), where the second field coding indication may indicate
  • the second video encoding frame is a video encoding frame corresponding to the single field image data, that is, the second field encoding indication may indicate that the second video encoding frame includes one image of the single field image data, Does not contain two fields of image data for one image.
  • the second field coding indication may further indicate that the single field image data included in the second video coding frame is bottom field image data or top field image data.
  • the second field encoding indication may indicate that the single field image data included in the second video encoding frame is top field image data.
  • the second field encoding indication indicates that the single field image data included in the second video encoding frame is bottom field image data.
  • the second field coding indication may further indicate a sequence in which the second video coding frame and the first video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the second field coding indication may indicate that the first video coding frame and the second video coding frame are in the video. The order of occurrence in the code stream is that the first video coding frame appears before the second video coding frame. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the second field encoding indication may indicate that the first video encoding frame and the second video encoding frame are in the video. The sequence of occurrences in the code stream is the first video coded frame and the second video coded frame.
  • the second field coding indication may include a fifth indication parameter and a fifth indication parameter.
  • the fifth indication parameter indicates that the second video coding frame is a video coding frame corresponding to single field image data (that is, the fifth indication parameter may indicate that the second video coding frame includes a single field image data of an image, and The second indication parameter does not include an image, and the fifth indication parameter further indicates that the single field image data included in the second video coding frame is top field image data or bottom field image data (for example, assuming that the image is The top field image data is video-encoded to obtain a second video-coded frame, and the fifth indication parameter indicates that the single-field image data included in the second video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed.
  • the sixth indication parameter may indicate that the first video encoding frame and the second video encoding frame are in the video stream. The sequence of occurrences occurs after the first video encoding frame is followed by the second video encoding frame.
  • the foregoing second field coding indication may include, for example, a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter.
  • the seventh indication parameter may indicate that the second video coding frame is a video coding frame corresponding to single field image data (that is, the seventh indication parameter may indicate that the second video coding frame includes a single field image data of an image, Two image data without an image).
  • the eighth indication parameter may indicate that the single field image data included in the second video coding frame is top field image data or bottom field image data (eg, assuming that the top field image data of the image is video encoded to obtain a second video) Encoding the frame, the eighth indication parameter indicating that the single field image data included in the second video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain a second video encoding frame, The eight indication parameter indicates that the single field image data included in the second video encoding frame is bottom field image data).
  • the sixth indication parameter indicates a sequence in which the second video coding frame and the second video coding frame appear in the video code stream.
  • the fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter may be, for example, a parameter progressive_frame indication bit or a picture structure (picture_structure) indication bit or other extended indication bit.
  • the sixth indication parameter includes, for example, at least 1 bit.
  • the sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
  • the video decoding device is also Determining whether there is a dropped frame or a bit error condition according to whether the second video encoding frame and the first video encoding frame indicate the order in which the first video encoding frame and the first video encoding frame appear in the video code stream are the same. Wait.
  • the second field coding indication is Can also be omitted.
  • sequence of video coding frames appearing in the video code stream can be understood as the order in which the video coded frames are encoded, for example, the first video coding frame precedes the second video coding.
  • the frame appears in the code stream, which can be understood as the encoding of the first video encoded frame prior to encoding to obtain the second video encoded frame.
  • the first video encoding frame and the second video encoding frame appear in the code stream, which can be understood as encoding the second video encoding frame after encoding the first video encoding frame.
  • the "output sequence after decoding of decoded image data" can be understood as the display order of decoded image data after decoding and sorting of the video decoded frame corresponding to the decoded image data.
  • the order in which the first video decoded frame and the second video decoded frame appear in the video code stream may be different from the decoded output order of the decoded image data corresponding to the first video decoded frame and the decoded image data corresponding to the second video decoded frame. .
  • the video encoded frame in the video code stream may also be referred to as a video decoded frame.
  • the video decoding method provided by the embodiment of the present invention is described below.
  • the execution body of the video decoding method provided by the embodiment of the present invention is a video decoding device, where the video decoding device may be any device that needs to output and play video, such as a mobile phone or a notebook. Computers, tablets, personal computers and other equipment.
  • a video decoding method comprises: performing video decoding on a first video decoding frame in a video code stream to obtain first image decoding data;
  • the second video decoding frame is subjected to video decoding to obtain second image decoding data, where the first video decoding frame includes a first field encoding indication, and the first field encoding indication indicates that the first video decoding frame is corresponding to single field image data.
  • the video decoding frame, and the first field encoding indication further indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates the first video decoding.
  • the first image decoding data and the second image decoding data are blended according to the first field coding instruction to obtain a blend image.
  • the first field coding indication may include a first indication parameter and a second indication parameter, where the first indication parameter indication may indicate that the first video decoding frame is a single field image data corresponding to Video decoding frame (ie, the first indication parameter may indicate that the first video decoding frame includes one field of image data of one image, and does not include two fields of image data of one image), and the first indication parameter may also be Instructing the single video image data included in the first video decoding frame to be top field image data or bottom field image data (eg, assuming that the single field image data included in the first video decoding frame is top field image data, the first indicator parameter And indicating that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the first indication parameter indicates that the first video decoding frame includes The single field image data is the bottom field image data).
  • the second indication parameter may indicate a sequence of occurrence of the first video decoding frame and the
  • the first field coding indication may include a third indication parameter, a fourth indication parameter, and a second indication parameter, where the third indication parameter indicates that the first video decoding frame is a single The video decoded frame corresponding to the field image data.
  • the fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data (for example, assuming that the single field image data included in the first video decoding frame is top field image data, The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the fourth indication parameter indicates the foregoing The single field image data contained in a video decoding frame is bottom field image data).
  • the second indication parameter may indicate a sequence of occurrence of the first video decoding frame and the homologous video decoding frame of the first video decoding frame in the video code stream.
  • the first indication parameter may include, for example, at least two bits, wherein the first indication parameter may be, for example, a parameter progressive_frame indicator bit or a picture_structure indicator bit or other extension indicator bit.
  • the second indication parameter includes, for example, at least 1 bit.
  • the second indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
  • the method may include: if the first field encoding instruction indicates that the homologous video decoding frame of the first video decoding frame is in the video stream, a video decoding frame is present, and the second video decoding frame is present in the first video decoding frame after the video stream, and the decoded output sequence of the first image decoding data and the second image decoding data are adjacent to each other. Blending the first image decoded data and the second image decoded data to obtain a blended image;
  • the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream
  • the second video decoding frame is first in the video code stream. Appearing in the first video decoding frame, and the first image decoding data and the second image decoding data are sequentially outputted, and the first image decoding data and the second image decoding data are blended to obtain a blend image. .
  • the second video decoding frame may include a second field coding indication, where the second field coding indication indicates that the second video decoding frame is a video decoding frame corresponding to the single field image data. And the second field coding indication further indicates that the single field image data included in the second video decoding frame is top field image data or bottom field image data, and the second field coding indication further indicates the second video decoding frame and the foregoing The order in which the homologous video decoded frames of the two video decoded frames appear in the video stream;
  • Performing the blending of the first image decoding data and the second image decoding data according to the first field encoding instruction to obtain a blending image comprising: first, according to the first field encoding instruction and the second field encoding instruction, the first image The decoded data and the second image decoded data are blended to obtain a blended image.
  • the first image decoding data and the second image decoding data are blended to obtain a blend image, including:
  • the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream
  • the first video decoding frame is further generated, and the first field coding indication further indicates the first video decoding.
  • the single field image data included in the frame is top field image data
  • the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame appears before the second video decoding frame in the video code stream
  • the second field coding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame is in the foregoing view.
  • the first image decoding data and the second image decoding data are sequentially adjacent to the decoded output sequence, and the first image decoding data and the second image decoding data are Blending to obtain a blended image;
  • the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream
  • the first field coding indication further indicates the first video decoding.
  • the single field image data included in the frame is top field image data
  • the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame is present in the video code stream and then appears in the second video decoding frame
  • the second field coding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame appears in the video code stream before the first video decoding frame
  • the first image decoded data and the second image decoded data are sequentially adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image;
  • the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream
  • the first video decoding frame is further generated, and the first field coding indication further indicates the first video decoding.
  • the single field image data included in the frame is bottom field image data
  • the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame appears before the second video decoding frame in the video code stream
  • the second field coding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video code stream and then appears in the first video decoding frame, and
  • the first image decoded data and the second image decoded data are sequentially adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image;
  • the fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter may be, for example, a parameter progressive_frame indication bit or a picture structure (picture_structure) indication bit or other extended indication bit.
  • the sixth indication parameter includes, for example, at least 1 bit.
  • the sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
  • the blending the first image decoded data and the second image decoded data to obtain the blended image may include: if the second image decoded data is top field image decoding data, the first image decoded data is bottom field image decoding data, The second image decoded data is used as the top field image data of the blended image, and the first image decoded data is used as the bottom field image data of the blended image.
  • the two image data included in the video frame may be indicated as field image data from different time instants, that is, the image is an interlaced image.
  • the video frame may be encoded/decoded in a progressive manner (eg, the picture_structure indicator bit takes a value of 1) or may be encoded/decoded in an interlaced manner (the picture_structure indicator bit takes a value of 0).
  • the progressive_frame indicator bit after the extended meaning has four possible values, the progressive_frame indicator bit contains at least two bits.
  • the progressive_frame indicator can look at a specific implementation of the first indication parameter in the above embodiment.
  • top_field_first indication bit can be seen in a specific implementation of the second indication parameter in the above embodiment.
  • the embodiment of the present invention further provides a video encoding method, which may include: acquiring an image P1, and performing video encoding on the top field image data of the image P1 to obtain a first video encoding frame.
  • the bottom field image data of the image P1 described above is video encoded to obtain a second video encoded frame.
  • the first video encoded frame and the second video encoded frame are written to the video bitstream.
  • the second field coding indication includes a progressive_frame indicator bit, which may also indicate the single field image data included in the second video coding frame. For bottom field image data).
  • the second field coding indication includes a value of 1 for the top_field_first indication bit (ie, the top_field_first indication bit indicates that the first video coding frame appears in the video bitstream before the second video coding frame).
  • the first video coding frame includes a first field coding indication (the first field coding indication may be included, for example, in a frame header and/or other positions of the first video coding frame), where the first field coding indication includes a progressive_frame indicator bit and The top_field_first indicator bit, wherein the progressive_frame indicator bit has a value of 2 (ie, the progressive_frame indicator bit indicates that the first video coded frame is a video coded frame corresponding to single field image data, and may also indicate that the first video coded frame is included.
  • the single field image data is the top field image data).
  • the top_field_first indicates that the bit has a value of 0 (ie, the top_field_first indicator bit indicates that the second video encoded frame appears after the first video encoded frame in the video bitstream).
  • the second video coding frame includes a second field coding indication (the second field coding indication may be included, for example, in a frame header and/or other location of the second video coding frame), and the second field coding indication includes a progressive_frame indicator bit and The top_field_first indicator bit, wherein the second field coding indication includes a value of 3 for the progressive_frame indicator bit (ie, the progressive field_frame indicated by the second field coding indication indicates that the second video coding frame is a video coding frame corresponding to single field image data.
  • the second field coding indication includes a progressive_frame indicator bit, which may also indicate that the single field image data included in the second video coding frame is bottom field image data).
  • the second field coding indication includes a value of 0 for the top_field_first indication bit (ie, the top_field_first indication bit indicates that the second video coding frame appears after the first video coding frame in the video bitstream).
  • the top field image data and the bottom field image data of the image are respectively video-encoded to obtain a first video-coded frame and a second video-coded frame;
  • the second video encoded frame is written to the video stream.
  • the first video coding frame includes a progressive_frame indicator bit and a top_field_first indicator bit, and the progressive_frame indicator bit indicates that the first video coding frame is a video coding frame corresponding to single field image data, And the progressive_frame indicator bit further indicates that the single field image data included in the first video encoding frame is top field image data, and the top_field_first indicator bit indicates The sequence of occurrence of the first video encoding frame and the second video encoding frame in the video stream.
  • the sequence of the homologous video coding frames obtained from the image data of different fields of the same image appears in the video code stream, which is advantageous for the video decoding device to know clearly based on the same image.
  • the order in which the homologous video coding frames obtained by the image data of different fields appear in the video code stream further facilitates the video decoding device to correctly image the different field image data of the same image obtained by decoding.
  • bot represents bottom field image data
  • top represents top field image data.
  • the numbers following the bot and top (ie 1, 2, 3, 4, 5, ...) indicate the output order after the code stream is decoded.
  • the value of the progressive_frame indicator bit of the video decoding frame in the video code stream is 2 (ie, the video decoding frame contains single field image data and the single field image data is top field image data) or 3 (ie, the video decoding frame contains a single Field image data and the single field image data is bottom field image data).
  • the top_field_first indication bit of all coded frames has a value of one.
  • the image corresponding to all the field image data in the code stream is the top field image data before the bottom field image data in the video code stream. appear. Therefore, according to the above code stream structure, bot1 appears before top2, because the top_field_first indicator bit indicates that the top field image data of the image always appears in the video stream before the bottom field image data, so bot1 and top2 cannot After the video decoding device blends into a blending image, bot3 appears in the code stream in top2, and the decoded output order of bot3 and top2 are adjacent to each other. Therefore, top2 and bot3 can be blended into one image. Similarly, top4 and bot5 Blend into an image. Others can be deduced by analogy.
  • the video decoding device can blend bot1 and top2 into one image.
  • bot3 and top4 can be blended into one image. Others can be deduced by analogy.
  • the error resistance of the video decoding apparatus at the time of field encoding can be increased.
  • the video decoded frame in the video stream is decoded, and the field image data sequence output after decoding is as follows: bot1, top2, top3, bot4, bot5.
  • the value of the progressive_frame indicator bit of the video decoding frame in the video code stream is 2 (ie, the video decoding frame contains single field image data and the single field image data is top field image data) or 3 (ie, the video decoding frame contains a single Field map Like data and the single field image data is bottom field image data).
  • the value of the top_field_first indication bit corresponding to the video decoding frame is not the same.
  • the values of the top_field_first indication bits corresponding to bot1, top2, top3, bot4, bot5, etc. are as follows: 0, 0, 1 , 1, 1, ....
  • And/or progressive_frame indicates a bit error.
  • the video decoding device determines, according to the setting strategy, how to handle the frame loss or the error condition of the video and video code stream according to the value of the syntax element such as the progressive_frame indicator bit and the top_field_first indicator bit included in the video decoding frame in the video code stream. Frame loss or bit error.
  • Intra prediction refers to predicting a block by using the information in the image to obtain a prediction block
  • the video encoding device obtains a pixel corresponding to the prediction block according to the prediction mode, the prediction direction, and the pixel value around the current image block, and the current image block pixel
  • the residual is subtracted from the prediction block pixel, and the residual is transformed into the code stream after being transformed, quantized, and entropy encoded;
  • the video decoding device parses the code stream, and performs entropy decoding, inverse quantization, and inverse transformation on the code stream to obtain a residual block.
  • the video decoding device obtains a prediction block according to the prediction mode, the prediction direction, and the pixel values around the image block, and adds the residual block pixel to the prediction block pixel to obtain a reconstructed image block.
  • the pre-interframe predictive image is encoded and decoded using the image before the current image to be encoded
  • the bi-directional inter-predicted image is encoded and decoded using the image before and after the current image to be encoded. Since the bidirectional inter-predicted image needs to be coded and operated using the image after the current image to be coded, the image after the bi-directional inter-predicted image needs to be decoded and decoded before the bi-directional inter-frame prediction image is to be coded.
  • the bidirectional inter-predicted image uses the encoding information before and after the current image, the bi-directional inter-predicted image can improve the encoding efficiency compared to the forward inter-frame predicted image.
  • the Hierarchical B technique is applied to the coding and decoding of the bi-directional inter-predicted image.
  • the bidirectional inter prediction image can also be used as a reference image. Different levels of B frames have different priorities, and B frames with higher priority can be used. A reference frame for a B frame with a lower priority. The priority of the above B frame can be used for identification by some syntax elements.
  • a video encoding apparatus provided by an implementation of the present invention may include:
  • the writing unit 330 is configured to write the first video encoding frame and the second video encoding frame into the video code stream.
  • the first field coding indication may include a first indication parameter and a second indication parameter.
  • the first indication parameter indicates that the first video encoding frame is a video encoding frame corresponding to single field image data (ie, the first indication parameter may indicate that the first video encoding frame includes a single field image data of an image, and
  • the first indicator parameter further includes the single field image data included in the first video encoding frame as the top field image data or the bottom field image data (for example, assuming that the image is the same for the two fields of image data)
  • the top field image data is video-encoded to obtain a first video-coded frame
  • the first indication parameter indicates that the single-field image data included in the first video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed.
  • the fourth indication parameter may indicate that the single field image data included in the first video encoding frame is top field image data or bottom field image data (eg, it is assumed that video encoding the top field image data of the image to obtain the first video) Encoding the frame, the fourth indication parameter indicating that the single field image data included in the first video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain the first video encoding frame, The four indication parameter indicates that the single field image data included in the first video encoding frame is bottom field image data).
  • the second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
  • the second field coding indication may include a fifth finger Show parameters and fifth indication parameters.
  • the fifth indication parameter indicates that the second video coding frame is a video coding frame corresponding to single field image data (that is, the fifth indication parameter may indicate that the second video coding frame includes a single field image data of an image, and The second indication parameter does not include an image, and the fifth indication parameter further indicates that the single field image data included in the second video coding frame is top field image data or bottom field image data (for example, assuming that the image is The top field image data is video-encoded to obtain a second video-coded frame, and the fifth indication parameter indicates that the single-field image data included in the second video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed.
  • the foregoing second field coding indication may include, for example, a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter.
  • the seventh indication parameter may indicate that the second video coding frame is a video coding frame corresponding to single field image data (that is, the seventh indication parameter may indicate that the second video coding frame includes a single field image data of an image, Two image data without an image).
  • the video encoding device 300 can be any device that needs to output and store video, such as a notebook computer, a tablet computer, a personal computer, a mobile phone, and the like.
  • the sequence of the homologous video coding frames obtained from the image data of different fields of the same image appears in the video code stream, which is beneficial for the video decoding device to know clearly based on the same
  • the sequence of the homologous video coding frames obtained by the image data of different fields of the image appears in the video code stream, thereby facilitating the video decoding device to correctly image the different field image data of the same image obtained by decoding.
  • an embodiment of the present invention further provides a video decoding apparatus 400, which may include: a decoding unit 410 and an aforesaid unit 420.
  • the decoding unit 410 is configured to perform video decoding on the first video decoding frame in the video code stream to obtain first image decoding data, and perform video decoding on the second video decoding frame in the video code stream to obtain a second image. Decode the data.
  • the first video decoding frame includes a first field coding indication, where the first field coding indication indicates that the first video decoding frame is a video decoding frame corresponding to single field image data, and the first field coding indication further indicates the foregoing
  • the single field image data included in a video decoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video decoding frame and the homologous video decoding frame of the first video decoding frame are Above video An order of appearance in the code stream; wherein the first video decoded frame and the homologous video decoded frame are obtained based on image data of different fields of the same image.
  • the blending unit 420 is configured to blend the first image decoded data and the second image decoded data according to the first field encoding instruction to obtain a blended image.
  • the first field coding indication may include a first indication parameter and a second indication parameter, where the first indication parameter indication may indicate that the first video decoding frame is a single field image data corresponding to Video decoding frame (ie, the first indication parameter may indicate that the first video decoding frame includes one field of image data of one image, and does not include two fields of image data of one image), and the first indication parameter may also be Instructing the single video image data included in the first video decoding frame to be top field image data or bottom field image data (eg, assuming that the single field image data included in the first video decoding frame is top field image data, the first indicator parameter And indicating that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the first indication parameter indicates that the first video decoding frame includes The single field image data is the bottom field image data).
  • the second indication parameter may indicate an order of appearance of the first video decoding frame and the homogen
  • the fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data (for example, assuming that the single field image data included in the first video decoding frame is top field image data, The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the fourth indication parameter indicates the foregoing The single field image data contained in a video decoding frame is bottom field image data).
  • the second indication parameter may indicate an order of appearance of the first video decoding frame and the homogenous video decoding frame of the first video decoding frame in the video code stream.
  • the foregoing mixing unit 420 may be specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field The coding indication further indicates that the single field image data included in the first video decoding frame is top field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream.
  • the second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and And the second video decoding frame is generated in the video code stream before the first video decoding frame, and the first image decoding data and the second image decoding data are sequentially adjacent to the decoded output sequence, and the first image is decoded.
  • the data is blended with the second image decoded data to obtain a blended image;
  • the foregoing mixing unit 420 may be specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field The coding indication further indicates that the single field image data included in the first video decoding frame is bottom field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream.
  • the second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame precedes the video stream in the video stream.
  • the first video decoded frame appears, and the first image decoded data and the second image decoded data are sequentially adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image.
  • the foregoing second field coding indication may include a fifth indication parameter and a sixth indication parameter, where the fifth indication parameter indication may indicate that the second video decoding frame is a single field image data corresponding to Video decoding frame (ie, the fifth indication parameter may indicate that the second video decoding frame includes one field of image data of one image, and does not include two fields of image data of one image), and the fifth indication parameter may also be Instructing the single video image data included in the second video decoding frame to be top field image data or bottom field image data (for example, assuming that the single field image data included in the second video decoding frame is top field image data, the fifth indicator parameter Indicating the above second video decoding The single field image data included in the frame is top field image data, and the single field image data included in the second video decoding frame is bottom field image data, and the fifth indication parameter indicates that the single field image data included in the second video decoding frame is Bottom field image data).
  • the sixth indication parameter may indicate an order of appearance of the homologous video de
  • the foregoing second field coding indication may include a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter, where the seventh indication parameter indicates that the second video decoding frame is a single The video decoded frame corresponding to the field image data.
  • the eighth indication parameter indicates that the single field image data included in the second video decoding frame is top field image data or bottom field image data (for example, assuming that the single field image data included in the second video decoding frame is top field image data, The eighth indication parameter indicates that the single field image data included in the second video decoding frame is top field image data, and if the single field image data included in the second video decoding frame is bottom field image data, the eighth indication parameter indicates the above.
  • the single field image data included in the second video decoding frame is bottom field image data).
  • the sixth indication parameter may indicate an order of appearance of the homologous video decoding frame of the second video decoding frame and the second video decoding frame in the video code stream.
  • the fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter may be, for example, a parameter progressive_frame indication bit or a picture structure (picture_structure) indication bit or other extended indication bit.
  • the sixth indication parameter includes, for example, at least 1 bit.
  • the sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
  • the video decoding device 400 can be any device that needs to output and play video, such as a notebook computer, a tablet computer, a personal computer, a mobile phone, and the like.
  • the video decoding apparatus 400 of this embodiment performs video decoding on the first video decoding frame and the second video decoding frame in the video code stream to obtain the first image decoding data and the second image decoding data, since And an indication of the first field coding indication included in the first video decoding frame, and an appearance order of the second video decoding frame and the first video decoding frame in the video code stream, and the first image decoding data and the second image. Decoding the output order of the data to determine whether to blend the first image decoded data and the second image decoded data to obtain a blended image.
  • the first video decoding frame explicitly indicates the sequence in which the first video decoding frame and the homologous video decoding frame appear in the video code stream, this is advantageous for the video decoding device to explicitly know different fields based on the same image.
  • the order in which the homologous video decoded frames obtained by the image data appear in the video code stream further facilitates the video decoding device to correctly image the different field image data of the same image obtained by decoding.
  • FIG. 5 is a schematic diagram of a video encoding apparatus 500 according to an embodiment of the present invention.
  • the video encoding apparatus 500 may include at least one bus 501, at least one processor 502 connected to the bus 501, and at least one memory connected to the bus 501. 503.
  • the processor 502 calls the code stored in the memory 503 via the bus 501 for acquiring an image; the first field image data of the image is video-encoded to obtain a first video-encoded frame; and the second field image of the image is The data is video encoded to obtain a second video encoded frame; the first video encoded frame and the second video encoded frame are written to the video stream.
  • the first video coding frame includes a first field coding indication, and the first field coding indication indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first field coding indication further indicates the first
  • the single field image data included in the video encoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video encoding frame and the second video encoding frame appear in the video stream.
  • the first field image data is top field image data
  • the second field image data is bottom field image data
  • the second field image data is top field image data
  • the first field image data is a bottom field.
  • Image data
  • the first field coding indication may include a first indication parameter and a second indication parameter.
  • the first indication parameter indicates that the first video encoding frame is a video encoding frame corresponding to single field image data (ie, the first indication parameter may indicate that the first video encoding frame includes a single field image data of an image, and
  • the first indicator parameter further includes the single field image data included in the first video encoding frame as the top field image data or the bottom field image data (for example, assuming that the image is the same for the two fields of image data)
  • the top field image data is video-encoded to obtain a first video-coded frame
  • the first indication parameter indicates that the single-field image data included in the first video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed.
  • Video coding to obtain a first video coding frame where the first indication parameter indicates the first video coding frame
  • the included single field image data is bottom field image data).
  • the second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the second indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video coding frame appears before the second video coding frame.
  • the first field coding indication may include, for example, a third indication parameter, a fourth indication parameter, and a second indication parameter.
  • the third indication parameter may indicate that the first video coding frame is a video coding frame corresponding to single field image data (ie, the third indication parameter may indicate that the first video coding frame includes a single field image data of an image, Two image data without an image).
  • Video encoding to obtain a second video encoding frame the fifth indication parameter indicating that the single field image data included in the second video encoding frame is bottom field image data).
  • the sixth indication parameter indicates a sequence in which the second video coding frame and the second video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the sixth indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video coding frame appears before the second video coding frame.
  • the video encoding device 500 can be any device that needs to output and store video, such as a notebook computer, a tablet computer, a personal computer, a mobile phone, and the like.
  • the sequence of the homologous video coding frames obtained from the image data of different fields of the same image appears in the video code stream, which is beneficial for the video decoding device to know clearly based on the same
  • the sequence of the homologous video coding frames obtained by the image data of different fields of the image appears in the video code stream, thereby facilitating the video decoding device to correctly image the different field image data of the same image obtained by decoding.
  • FIG. 6 is a structural block diagram of a video encoding apparatus 600 according to another embodiment of the present invention.
  • the video encoding apparatus 600 may include at least one processor 601, at least one network interface 604 or other user interface 603, a memory 606, and at least one communication bus 602. Communication bus 602 is used to implement connection communication between these components.
  • the video encoding device 600 may optionally include a user interface 603, including a display (eg, a touch screen, LCD, CRT, Holographic or Projector, etc.), a pointing device (eg, a mouse, a trackball) ) a touch panel or touch screen, etc.), a camera and/or a sound pickup device, and the like.
  • memory 606 stores the following elements, executable modules or data structures, or a subset thereof, or their extended set:
  • the processor 601 acquires an image by calling a program or instruction stored in the memory 606; video encoding the first field image data of the image to obtain a first video encoding frame; and second to the image
  • the field image data is video encoded to obtain a second video encoded frame; the first video encoded frame and the second video encoded frame are written to the video bitstream.
  • the video encoding is performed to obtain a first video encoding frame, and the first indication parameter indicates that the single field image data included in the first video encoding frame is bottom field image data).
  • the second indication parameter indicates that the first video encoding frame and the second video encoding frame appear in the video stream. sequence. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the second indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video coding frame appears before the second video coding frame.
  • the second indication parameter may indicate that the first video encoding frame and the second video encoding frame are in the video stream. The sequence of occurrences occurs after the first video encoding frame is followed by the second video encoding frame.
  • the fourth indication parameter may indicate that the single field image data included in the first video encoding frame is top field image data or bottom field image data (eg, it is assumed that video encoding the top field image data of the image to obtain the first video) Encoding the frame, the fourth indication parameter indicating that the single field image data included in the first video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain the first video encoding frame, The four indication parameter indicates that the single field image data included in the first video encoding frame is bottom field image data).
  • the second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
  • the foregoing second field coding indication may include, for example, a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter.
  • the seventh indication parameter may indicate that the second video coding frame is a video coding frame corresponding to single field image data (that is, the seventh indication parameter may indicate that the second video coding frame includes a single field image data of an image, Two image data without an image).
  • the eighth indication parameter may indicate that the single field image data included in the second video coding frame is top field image data or bottom field image data (eg, assuming that the top field image data of the image is video encoded to obtain a second video) Encoding the frame, the eighth indication parameter indicating that the single field image data included in the second video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain a second video encoding frame, The eight indication parameter indicates that the single field image data included in the second video encoding frame is bottom field image data).
  • the sixth indication parameter indicates a sequence in which the second video coding frame and the second video coding frame appear in the video code stream.
  • the video encoding device 600 can be any device that needs to output and store video, such as a notebook computer, a tablet computer, a personal computer, a mobile phone, and the like.
  • the operating system 8081 includes various system programs for implementing various basic services and processing hardware-based tasks.
  • the processor 801 is specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, and then appears in the first video decoding frame, and the first field
  • the coding indication further indicates that the single field image data included in the first video decoding frame is bottom field image data
  • the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame precedes the video code stream.
  • the second video decoding frame is generated, and the second field coding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video code stream.
  • the first video decoding frame appears, and the decoded output order of the first image decoded data and the second image decoded data are adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image;
  • the fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter may be, for example, a parameter progressive_frame indication bit or a picture structure (picture_structure) indication bit or other extended indication bit.
  • the sixth indication parameter includes, for example, at least 1 bit.
  • the sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
  • the video decoding device 800 can be any device that needs to output and play video, such as a notebook computer, a tablet computer, a personal computer, a mobile phone, and the like.
  • the video decoding apparatus 800 of this embodiment performs video decoding on the first video decoding frame and the second video decoding frame in the video code stream to obtain the first image decoding data and the second image decoding data, since And an indication of the first field coding indication included in the first video decoding frame, and an appearance order of the second video decoding frame and the first video decoding frame in the video code stream, and the first image decoding data and the second image. Decoding the output order of the data to determine whether to blend the first image decoded data and the second image decoded data to obtain a blended image.
  • the first video decoding frame explicitly indicates the sequence in which the first video decoding frame and the homologous video decoding frame appear in the video code stream, this is advantageous for the video decoding device to explicitly know different fields based on the same image.
  • the order in which the homologous video decoded frames obtained by the image data appear in the video code stream further facilitates the video decoding device to correctly image the different field image data of the same image obtained by decoding.
  • the embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, where the program includes some or all of the steps of any one of the video encoding methods or the video decoding methods described in the foregoing method embodiments. .
  • the disclosed apparatus may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the above units is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or integrated. Go to another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
  • the units described above as separate components may or may not be physically separated.
  • the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or software. The implementation of the energy unit.
  • the above-described integrated unit if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the above-described methods of various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Abstract

Disclosed are a video coding method and video decoding method and related device. The video coding method comprises: obtaining an image; performing video coding on a first field image data of the image to obtain a first video coding frame; performing video coding on a second field image data of the image to obtain a second video coding frame; writing the first and second video coding frames into a video bit stream, the first field coding indication further indicating the sequence of the first and second video coding frames in the video bit stream. The above solution enables a video decoding device to correctly perform image fusion of different field image data of the same image obtained by decoding.

Description

视频编码方法和解码方法和相关装置Video coding method and decoding method and related device
本申请要求于2014年6月9日提交中国专利局、申请号为201410253649.4、发明名称为“视频编码方法和解码方法和相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201410253649.4, entitled "Video Coding Method and Decoding Method and Related Device", filed on June 9, 2014, the entire contents of which are incorporated herein by reference. In the application.
技术领域Technical field
本发明涉及视频编解码技术领域,具体涉及视频编码方法和视频解码方法和相关装置。The present invention relates to the field of video codec technology, and in particular, to a video encoding method, a video decoding method, and related devices.
背景技术Background technique
在视频编解码中,为了尽量减少传送视频数据所需带宽,可能采用多种视频压缩方法对视频数据进行压缩。场编码技术是一种可以有效提高视频数据压缩效率的编码技术。In video codec, in order to minimize the bandwidth required to transmit video data, it is possible to compress video data using a variety of video compression methods. Field coding technology is an encoding technology that can effectively improve the compression efficiency of video data.
在场编码技术中,将一幅图像进行场划分以得到顶场图像数据和顶场图像数据。顶场图像数据通过扫描一幅图像中的奇数行像素点数据获得,底场数据通过扫描一幅图像中的偶数行像素点数据获得。In the field coding technique, an image is field-divided to obtain top field image data and top field image data. The top field image data is obtained by scanning odd line pixel point data in an image, and the bottom field data is obtained by scanning even line pixel point data in one image.
在场编码时一幅图像中每一场(顶场或底场)的图像数据均当作独立的一视频帧数据进行编码和解码,但传统的视频编解码技术中将一幅图像的两场编码数据封装在一个编码帧中。由于顶场和底场分别表示图像的奇数行和偶数行图像数据,但编码数据却是按各自独立的方式存储,因此,这种编码方式会将编码数据的获取方法变复杂。此外,由于场编码时一幅图像中的每一场数据实际上相当于一个独立的图像,因此,在参考帧管理技术中每一场图像均作为独立的图像被管理。例如在层次B帧技术中,一幅图像中的顶场图像和底场图像可以被赋予不同的优先级。因此,如果仍按传统的方法将顶场和底场图像数据封装于一个编码帧之中会增加参考帧管理技术的实现复杂度。In the field coding, the image data of each field (top field or bottom field) in an image is encoded and decoded as independent video frame data, but the conventional video coding and decoding technology will encode two fields of one image. The data is encapsulated in an encoded frame. Since the top field and the bottom field respectively represent the odd-numbered lines and the even-numbered lines of image data of the image, the encoded data is stored in separate ways. Therefore, this encoding method complicates the method of acquiring the encoded data. Furthermore, since each field of data in an image is actually equivalent to a separate image at the time of field encoding, each field image is managed as a separate image in the reference frame management technique. For example, in hierarchical B-frame technology, the top field image and the bottom field image in one image can be given different priorities. Therefore, if the top field and bottom field image data are still encapsulated in one coded frame in the conventional way, the implementation complexity of the reference frame management technique is increased.
针对上述问题,现有技术中提出将一幅图像的顶场和底场数据当作一个独立的图像进行编码并对该场编码数据进行独立封装成一个单独编码帧。这类技术可以有效降低编码数据管理及参考帧管理的复杂度,但这又会引入一 个新技术问题,即,视频解码装置解码获得的各单场图像数据之间彼此孤立,使得解码难以确定如何正确的将得到的各单场图像数据进行图像交融。In view of the above problems, the prior art proposes to encode the top field and bottom field data of an image as a single image and independently encapsulate the field coded data into a single coded frame. This type of technology can effectively reduce the complexity of encoding data management and reference frame management, but it will introduce a A new technical problem, that is, each single-field image data obtained by decoding by the video decoding device is isolated from each other, so that it is difficult to determine how to correctly perform image blending of the obtained single-field image data.
发明内容Summary of the invention
本发明实施例提供视频编码方法和视频解码方法和相关装置。Embodiments of the present invention provide a video encoding method, a video decoding method, and related devices.
第一方面,一种视频编码方法,可包括:In a first aspect, a video encoding method can include:
获取图像;Get an image;
对所述图像的第一场图像数据进行视频编码以得到第一视频编码帧;Performing video encoding on the first field image data of the image to obtain a first video encoding frame;
对所述图像的第二场图像数据进行视频编码以得到第二视频编码帧;Performing video encoding on the second field image data of the image to obtain a second video encoding frame;
将所述第一视频编码帧和所述第二视频编码帧写入视频码流;Writing the first video encoded frame and the second video encoded frame into a video code stream;
其中,所述第一视频编码帧包含第一场编码指示,所述第一场编码指示指示所述第一视频编码帧为单场图像数据对应的视频编码帧,所述第一场编码指示还指示所述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,所述第一场编码指示还指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序;The first video coding frame includes a first field coding indication, and the first field coding indication indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first field coding indication is further Instructing the first video encoding frame to include single field image data as top field image data or bottom field image data, the first field encoding indication further indicating the first video encoding frame and the second video encoding frame a sequence of occurrences in the video stream;
其中,所述第一场图像数据为顶场图像数据,且所述第二场图像数据为底场图像数据,或者所述第二场图像数据为顶场图像数据,且所述第一场图像数据为底场图像数据。The first field image data is top field image data, and the second field image data is bottom field image data, or the second field image data is top field image data, and the first field image is The data is bottom field image data.
结合第一方面,在第一方面的第一种可能的实施方式中,In conjunction with the first aspect, in a first possible implementation of the first aspect,
所述第一场编码指示包含第一指示参数和第二指示参数;The first field coding indication includes a first indication parameter and a second indication parameter;
其中,所述第一指示参数指示所述第一视频编码帧为单场图像数据对应的视频编码帧,所述第一指示参数还指示所述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据;The first indication parameter indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first indication parameter further indicates that the single video image data included in the first video coding frame is top. Field image data or bottom field image data;
所述第二指示参数指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序。The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
结合第一方面,在第一方面的第二种可能的实施方式中,所述第一场编码指示包含第三指示参数、第四指示参数和第二指示参数;With reference to the first aspect, in a second possible implementation manner of the first aspect, the first field coding indication includes a third indication parameter, a fourth indication parameter, and a second indication parameter;
其中,所述第三指示参数指示所述第一视频编码帧为单场图像数据对应的视频编码帧;The third indication parameter indicates that the first video coding frame is a video coding frame corresponding to single field image data;
所述第四指示参数指示所述第一视频编码帧包含的单场图像数据为顶 场图像数据或者底场图像数据;The fourth indication parameter indicates that the single video image data included in the first video coding frame is top Field image data or bottom field image data;
所述第二指示参数指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序。The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
结合第一方面或第一方面的第一种可能的实施方式或第一方面的第二种可能的实施方式,在第一方面的第三种可能的实施方式中,所述第二视频编码帧包含第二场编码指示,所述第二场编码指示指示所述第二视频编码帧为单场图像数据对应的视频编码帧,所述第二场编码指示还指示所述第二视频编码帧包含的单场图像数据为底场图像数据或者顶场图像数据,所述第二场编码指示还指示出所述第二视频编码帧和所述第一视频编码帧在所述视频码流中出现的先后顺序。With reference to the first aspect or the first possible implementation manner of the first aspect or the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the second video encoding frame A second field coding indication is included, where the second field coding indication indicates that the second video coding frame is a video coding frame corresponding to single field image data, and the second field coding indication further indicates that the second video coding frame includes The single field image data is bottom field image data or top field image data, and the second field code indication further indicates that the second video coded frame and the first video coded frame appear in the video code stream. In order.
第二方面,一种视频解码方法,包括:In a second aspect, a video decoding method includes:
对视频码流中的第一视频解码帧进行视频解码以得到第一图像解码数据;Performing video decoding on the first video decoded frame in the video code stream to obtain first image decoded data;
对所述视频码流中的第二视频解码帧进行视频解码以得到第二图像解码数据;Performing video decoding on the second video decoded frame in the video code stream to obtain second image decoding data;
其中,所述第一视频解码帧包含第一场编码指示,所述第一场编码指示指示出第一视频解码帧为单场图像数据对应的视频解码帧,并且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且所述第一场编码指示还指示所述第一视频解码帧和所述第一视频解码帧的同源视频解码帧在所述视频码流中的出现顺序;其中,所述第一视频解码帧和所述同源视频解码帧基于同一图像的不同场的图像数据得到;The first video decoding frame includes a first field coding indication, where the first field coding indication indicates that the first video decoding frame is a video decoding frame corresponding to single field image data, and the first field coding indication is further Instructing the first video decoding frame to include single field image data as top field image data or bottom field image data, and the first field encoding indication further indicating the first video decoding frame and the first video decoding frame The order in which the homologous video decoded frames appear in the video codestream; wherein the first video decoded frame and the homogenous video decoded frame are obtained based on image data of different fields of the same image;
根据所述第一场编码指示将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。And blending the first image decoding data and the second image decoding data according to the first field encoding instruction to obtain a blending image.
结合第二方面,在第二方面的第一种可能的实施方式中,In conjunction with the second aspect, in a first possible implementation of the second aspect,
所述第一场编码指示包含第一指示参数和第二指示参数;The first field coding indication includes a first indication parameter and a second indication parameter;
其中,所述第一指示参数指示指示出第一视频解码帧为单场图像数据对应的视频解码帧,并且所述第一指示参数还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据;The first indication parameter indication indicates that the first video decoding frame is a video decoding frame corresponding to the single field image data, and the first indication parameter further indicates that the single field image data included in the first video decoding frame is Top field image data or bottom field image data;
所述第二指示参数指示出所述第一视频解码帧和所述第一视频解码帧 的同源视频解码帧在所述视频码流中的出现顺序。The second indication parameter indicates the first video decoded frame and the first video decoded frame The order in which the homologous video decoded frames appear in the video stream.
结合第二方面,在第二方面的第二种可能的实施方式中,所述第一场编码指示包含第三指示参数、第四指示参数和第二指示参数;With reference to the second aspect, in a second possible implementation manner of the second aspect, the first field coding indication includes a third indication parameter, a fourth indication parameter, and a second indication parameter;
其中,所述第三指示参数指示出第一视频解码帧为单场图像数据对应的视频解码帧;The third indication parameter indicates that the first video decoding frame is a video decoding frame corresponding to single field image data;
所述第四指示参数指示所述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据;The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data;
所述第二指示参数指示出所述第一视频解码帧和所述第一视频解码帧的同源视频解码帧在所述视频码流中的出现顺序。The second indication parameter indicates an order of appearance of the homologous video decoding frame of the first video decoding frame and the first video decoding frame in the video code stream.
结合第二方面或第二方面的第一种可能的实施方式或第二方面的第二种可能的实施方式,在第二方面的第三种可能的实施方式中,,所述根据所述第一场编码指示将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像,包括:With reference to the second aspect or the first possible implementation of the second aspect or the second possible implementation of the second aspect, in a third possible implementation manner of the second aspect, A field encoding instruction blends the first image decoded data and the second image decoded data to obtain a blended image, including:
若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, the second video decoding frame is present, and the second video decoding frame is in the And appearing in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the The second image decoding data is blended to obtain a blended image;
或者;or;
若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the second video decoding frame is in the The video code stream appears before the first video decoding frame, and the decoded output order of the first image decoded data and the second image decoded data are adjacent to each other, and the first image decoded data and the The second image decoded data is blended to obtain a blended image.
结合第二方面或第二方面的第一种可能的实施方式或第二方面的第二种可能的实施方式,在第二方面的第四种可能的实施方式中,In conjunction with the second aspect or the first possible implementation of the second aspect or the second possible implementation of the second aspect, in a fourth possible implementation of the second aspect,
所述第二视频解码帧包含第二场编码指示,所述第二场编码指示指示出第二视频解码帧为单场图像数据对应的视频解码帧,并且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且所述第二场编码指示还指示所述第二视频解码帧和所述第二 视频解码帧的同源视频解码帧在所述视频码流中的出现顺序;The second video decoding frame includes a second field coding indication, the second field coding indication indicates that the second video decoding frame is a video decoding frame corresponding to single field image data, and the second field coding indication further indicates The single field image data included in the second video decoding frame is top field image data or bottom field image data, and the second field encoding indication further indicates the second video decoding frame and the second The order in which the homologous video decoded frames of the video decoded frame appear in the video bitstream;
所述根据所述第一场编码指示将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像,包括:根据所述第一场编码指示和所述第二场编码指示,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。And the blending the first image decoding data and the second image decoding data according to the first field encoding instruction to obtain a blending image, comprising: according to the first field encoding indication and the second field encoding indication And blending the first image decoded data and the second image decoded data to obtain a blended image.
结合第二方面的第四种可能的实施方式,在第二方面的第五种可能的实施方式中,所述根据所述第一场编码指示和所述第二场编码指示,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像,包括:With reference to the fourth possible implementation manner of the second aspect, in a fifth possible implementation manner of the second aspect, the first field coding indication and the second field coding indication are An image decoded data and the second image decoded data are blended to obtain a blended image, including:
若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中先于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为底场图像数据,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream and then appears in the first video decoding frame, and the first field coding indication further indicates The single field image data included in the first video decoding frame is top field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame precedes the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame is in the video And appearing in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoding data are blended to obtain a blended image;
或者;or;
若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中后于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为底场图像数据,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;And if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field coding indication further indicates The single field image data included in the first video decoding frame is top field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame is in the video And appearing in the code stream before the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoding data are blended to obtain a blended image;
或者;or;
若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第一场编码指示还指 示所述第一视频解码帧包含的单场图像数据为底场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中先于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, the first video decoding frame is present, and the first field coding indication is further The single field image data included in the first video decoding frame is bottom field image data, and the second field encoding indication indicates that the homogenous video decoding frame of the second video decoding frame is first in the video code stream. Appearing in the second video decoding frame, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the And appearing in the video code stream in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the The second image decoded data is blended to obtain a blended image;
或者;or;
若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为底场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中后于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。And if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field coding indication further indicates The single field image data included in the first video decoding frame is bottom field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video And appearing in the code stream before the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoded data are blended to obtain a blended image.
第三方面,一种视频编码装置,包括:In a third aspect, a video encoding apparatus includes:
获取单元,用于获取图像;An acquisition unit for acquiring an image;
编码单元,用于对所述图像的第一场图像数据进行视频编码以得到第一视频编码帧;对所述图像的第二场图像数据进行视频编码以得到第二视频编码帧;a coding unit, configured to video encode the first field image data of the image to obtain a first video coding frame, and perform video coding on the second field image data of the image to obtain a second video coding frame;
写入单元,用于将所述第一视频编码帧和所述第二视频编码帧写入视频码流;a writing unit, configured to write the first video encoding frame and the second video encoding frame into a video code stream;
其中,所述第一视频编码帧包含第一场编码指示,所述第一场编码指示指示所述第一视频编码帧为单场图像数据对应的视频编码帧,所述第一场编码指示还指示所述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,所述第一场编码指示还指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序;The first video coding frame includes a first field coding indication, and the first field coding indication indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first field coding indication is further Instructing the first video encoding frame to include single field image data as top field image data or bottom field image data, the first field encoding indication further indicating the first video encoding frame and the second video encoding frame a sequence of occurrences in the video stream;
其中,所述第一场图像数据为顶场图像数据,且所述第二场图像数据为 底场图像数据,或者所述第二场图像数据为顶场图像数据,且所述第一场图像数据为底场图像数据。The first field image data is top field image data, and the second field image data is The bottom field image data, or the second field image data is top field image data, and the first field image data is bottom field image data.
结合第三方面,在第三方面的第一种可能的实施方式中,In conjunction with the third aspect, in a first possible implementation of the third aspect,
所述第一场编码指示包含第一指示参数和第二指示参数;The first field coding indication includes a first indication parameter and a second indication parameter;
其中,所述第一指示参数指示所述第一视频编码帧为单场图像数据对应的视频编码帧,所述第一指示参数还指示所述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据;The first indication parameter indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first indication parameter further indicates that the single video image data included in the first video coding frame is top. Field image data or bottom field image data;
所述第二指示参数指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序。The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
结合第三方面,在第三方面的第二种可能的实施方式中,所述第一场编码指示包含第三指示参数、第四指示参数和第二指示参数;With reference to the third aspect, in a second possible implementation manner of the third aspect, the first field coding indication includes a third indication parameter, a fourth indication parameter, and a second indication parameter;
其中,所述第三指示参数指示所述第一视频编码帧为单场图像数据对应的视频编码帧;The third indication parameter indicates that the first video coding frame is a video coding frame corresponding to single field image data;
所述第四指示参数指示所述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据;The fourth indication parameter indicates that the single field image data included in the first video coding frame is top field image data or bottom field image data;
所述第二指示参数指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序。The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
结合第三方面或第三方面的第一种可能的实施方式或第三方面的第二种可能的实施方式,在第三方面的第三种可能的实施方式中,,所述第二视频编码帧包含第二场编码指示,所述第二场编码指示指示所述第二视频编码帧为单场图像数据对应的视频编码帧,所述第二场编码指示还指示所述第二视频编码帧包含的单场图像数据为底场图像数据或者顶场图像数据,所述第二场编码指示还指示出所述第二视频编码帧和所述第一视频编码帧在所述视频码流中出现的先后顺序。With reference to the third aspect or the first possible implementation manner of the third aspect or the second possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect, the second video coding The frame includes a second field coding indication, the second field coding indication indicates that the second video coding frame is a video coding frame corresponding to single field image data, and the second field coding indication further indicates the second video coding frame The included single field image data is bottom field image data or top field image data, and the second field encoding indication further indicates that the second video encoded frame and the first video encoded frame appear in the video code stream The order of precedence.
第四方面,一种视频解码装置,可包括:In a fourth aspect, a video decoding apparatus may include:
解码单元,用于对视频码流中的第一视频解码帧进行视频解码以得到第一图像解码数据;对所述视频码流中的第二视频解码帧进行视频解码以得到第二图像解码数据;其中,所述第一视频解码帧包含第一场编码指示,所述第一场编码指示指示出第一视频解码帧为单场图像数据对应的视频解码帧,并且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据 为顶场图像数据或底场图像数据,并且所述第一场编码指示还指示所述第一视频解码帧和所述第一视频解码帧的同源视频解码帧在所述视频码流中的出现顺序;其中,所述第一视频解码帧和所述同源视频解码帧基于同一图像的不同场的图像数据得到;a decoding unit, configured to perform video decoding on the first video decoding frame in the video code stream to obtain first image decoding data, and perform video decoding on the second video decoding frame in the video code stream to obtain second image decoding data. Wherein the first video decoding frame includes a first field coding indication, the first field coding indication indicating that the first video decoding frame is a video decoding frame corresponding to single field image data, and the first field coding indication Also indicating a single field image data included in the first video decoding frame Is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video decoded frame and the homogenous video decoded frame of the first video decoded frame are in the video bitstream An order of appearance; wherein the first video decoded frame and the homogenous video decoded frame are obtained based on image data of different fields of the same image;
交融单元,用于根据所述第一场编码指示将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。And a blending unit, configured to blend the first image decoded data and the second image decoded data according to the first field encoding instruction to obtain a blended image.
结合第四方面,在第四方面的第一种可能的实施方式中,With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect,
所述第一场编码指示包含第三指示参数、第四指示参数和第二指示参数;The first field coding indication includes a third indication parameter, a fourth indication parameter, and a second indication parameter;
其中,所述第三指示参数指示出第一视频解码帧为单场图像数据对应的视频解码帧;The third indication parameter indicates that the first video decoding frame is a video decoding frame corresponding to single field image data;
所述第四指示参数指示所述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据;The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data;
所述第二指示参数指示出所述第一视频解码帧和所述第一视频解码帧的同源视频解码帧在所述视频码流中的出现顺序。The second indication parameter indicates an order of appearance of the homologous video decoding frame of the first video decoding frame and the first video decoding frame in the video code stream.
结合第四方面,在第四方面的第二种可能的实施方式中,In conjunction with the fourth aspect, in a second possible implementation of the fourth aspect,
所述第一场编码指示包含第三指示参数、第四指示参数和第二指示参数;The first field coding indication includes a third indication parameter, a fourth indication parameter, and a second indication parameter;
其中,所述第三指示参数指示出第一视频解码帧为单场图像数据对应的视频解码帧;The third indication parameter indicates that the first video decoding frame is a video decoding frame corresponding to single field image data;
所述第四指示参数指示所述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据;The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data;
所述第二指示参数指示出所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现。The second indication parameter indicates that a homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream.
结合第四方面或第四方面的第一种可能的实施方式或第四方面的第二种可能的实施方式,在第四方面的第三种可能的实施方式中,With reference to the fourth aspect or the first possible implementation manner of the fourth aspect or the second possible implementation manner of the fourth aspect, in a third possible implementation manner of the fourth aspect,
所述交融单元具体用于,若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所 述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;The aggregating unit is configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, and then appears in the first video decoding frame, and The second video decoding frame is present in the video code stream after the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other. The first image decoded data and the second image decoded data are blended to obtain a blended image;
或者;or;
若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the second video decoding frame is in the The video code stream appears before the first video decoding frame, and the decoded output order of the first image decoded data and the second image decoded data are adjacent to each other, and the first image decoded data and the The second image decoded data is blended to obtain a blended image.
结合第四方面或第四方面的第一种可能的实施方式或第四方面的第二种可能的实施方式,在第四方面的第四种可能的实施方式中,With reference to the fourth aspect or the first possible implementation manner of the fourth aspect or the second possible implementation manner of the fourth aspect, in a fourth possible implementation manner of the fourth aspect,
所述第二视频解码帧包含第二场编码指示,所述第二场编码指示指示出第二视频解码帧为单场图像数据对应的视频解码帧,并且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且所述第二场编码指示还指示所述第二视频解码帧和所述第二视频解码帧的同源视频解码帧在所述视频码流中的出现顺序;The second video decoding frame includes a second field coding indication, the second field coding indication indicates that the second video decoding frame is a video decoding frame corresponding to single field image data, and the second field coding indication further indicates The single field image data included in the second video decoding frame is top field image data or bottom field image data, and the second field encoding indication further indicates the same of the second video decoding frame and the second video decoding frame. The order in which the source video decoded frames appear in the video stream;
其中,所述交融单元具体用于,根据所述第一场编码指示和所述第二场编码指示,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。The aggregating unit is configured to perform the blending of the first image decoding data and the second image decoding data according to the first field encoding instruction and the second field encoding instruction to obtain a blending image.
结合第四方面的第四种可能的实施方式,在第四方面的第五种可能的实施方式中,In conjunction with the fourth possible implementation of the fourth aspect, in a fifth possible implementation manner of the fourth aspect,
所述交融单元具体用于,若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中先于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为底场图像数据,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;The aggregating unit is configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, and then appears in the first video decoding frame, and The first field coding indication further indicates that the single field image data included in the first video decoding frame is top field image data, and the second field coding indication indicates that the same video decoding frame of the second video decoding frame is The video code stream appears before the second video decoding frame, and the second field coding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the Two video decoding frames appear in the first video decoding frame in the video code stream, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, An image decoded data and the second image decoded data are blended to obtain a blended image;
或者;or;
若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在 所述视频码流中先于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中后于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为底场图像数据,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is The video code stream appears before the first video decoding frame, and the first field coding indication further indicates that the single field image data included in the first video decoding frame is top field image data, and the a second field coding indication indicating that a homogenous video decoding frame of the second video decoding frame is present in the video code stream after the second video decoding frame, and the second field coding indication further indicates the second The single field image data included in the video decoding frame is bottom field image data, and the second video decoding frame appears in the video code stream before the first video decoding frame, and the first image decoding data and The decoded output of the second image decoded data is sequentially adjacent, and the first image decoded data and the second image decoded data are blended to obtain a blended image;
或者;or;
若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为底场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中先于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream and then appears in the first video decoding frame, and the first field coding indication further indicates The single field image data included in the first video decoding frame is bottom field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame precedes the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video And appearing in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoding data are blended to obtain a blended image;
或者;or;
若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为底场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中后于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。And if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field coding indication further indicates The single field image data included in the first video decoding frame is bottom field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video And appearing in the code stream before the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoded data are blended to obtain a blended image.
可以看出,本发明一些视频编码方案中,对图像的第一场图像数据和第二场图像数据分别进行视频编码以得到第一视频编码帧和第二视频编码帧;将第 一视频编码帧和第二视频编码帧写入视频码流。其中,由于第一视频编码帧包含第一场编码指示,上述第一场编码指示指示上述第一视频编码帧为单场图像数据对应的视频编码帧,且上述第一场编码指示还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,且第一场编码指示还指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。其中,由于利用第一视频编码帧明确的指示出,基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,这有利于视频解码装置明确获知基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,进而有利于视频解码装置正确的将解码得到的同一图像的不同场图像数据进行图像交融。It can be seen that, in some video coding schemes of the present invention, the first field image data and the second field image data of the image are separately video encoded to obtain a first video encoded frame and a second video encoded frame; A video encoded frame and a second video encoded frame are written to the video stream. The first field coding instruction indicates that the first video coding frame is a video coding frame corresponding to the single field image data, and the first field coding indication further indicates the foregoing. The single field image data included in a video encoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video encoding frame and the second video encoding frame appear in the video stream. The order of precedence. Wherein, because the first video coding frame is explicitly indicated, the sequence of the homologous video coding frames obtained from the image data of different fields of the same image appears in the video code stream, which is beneficial for the video decoding device to know clearly based on the same The sequence of the homologous video coding frames obtained by the image data of different fields of the image appears in the video code stream, thereby facilitating the video decoding device to correctly image the different field image data of the same image obtained by decoding.
附图说明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 embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图1是本发明实施例提供的一种视频编码方法的流程示意图;1 is a schematic flowchart of a video encoding method according to an embodiment of the present invention;
图2是本发明实施例提供的一种视频解码方法的流程示意图;2 is a schematic flowchart of a video decoding method according to an embodiment of the present invention;
图3是本发明实施例提供的一种视频编码装置的示意图;3 is a schematic diagram of a video encoding apparatus according to an embodiment of the present invention;
图4是本发明实施例提供的一种视频解码装置的示意图;4 is a schematic diagram of a video decoding apparatus according to an embodiment of the present invention;
图5是本发明实施例提供的另一种视频编码装置的示意图;FIG. 5 is a schematic diagram of another video encoding apparatus according to an embodiment of the present invention; FIG.
图6是本发明实施例提供的另一种视频编码装置的示意图;FIG. 6 is a schematic diagram of another video encoding apparatus according to an embodiment of the present invention; FIG.
图7是本发明实施例提供的另一种视频解码装置的示意图;FIG. 7 is a schematic diagram of another video decoding apparatus according to an embodiment of the present invention; FIG.
图8是本发明实施例提供的另一种视频解码装置的示意图。FIG. 8 is a schematic diagram of another video decoding apparatus according to an embodiment of the present invention.
具体实施方式detailed description
本发明实施例提供视频编码方法和视频解码方法和相关装置。Embodiments of the present invention provide a video encoding method, a video decoding method, and related devices.
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获 得的所有其他实施例,都应当属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is an embodiment of the invention, but not all of the embodiments. Based on the embodiments of the present invention, those of ordinary skill in the art obtain the following without creative efforts. All other embodiments are intended to fall within the scope of the invention.
以下分别进行详细说明。The details are described below separately.
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等是用于区别不同的对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth" and the like in the specification and claims of the present invention and the above drawings are used to distinguish different objects, and are not intended to describe a specific order. Furthermore, the terms "comprises" and "comprising" and "comprising" are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that comprises a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units not listed, or alternatively Other steps or units inherent to these processes, methods, products or equipment.
以下分别进行详细说明。The details are described below separately.
先介绍本发明实施例提供的视频编码方法,本发明实施例提供的视频编码方法的执行主体是视频编码装置,其中,该视频编码装置可以是任何需要输出、存储视频的装置,如手机,笔记本电脑,平板电脑,个人电脑等设备。The video encoding method provided by the embodiment of the present invention is described. The main body of the video encoding method provided by the embodiment of the present invention is a video encoding device, where the video encoding device can be any device that needs to output and store video, such as a mobile phone or a notebook. Computers, tablets, personal computers and other equipment.
本发明视频编码方法的一实施例,其中,一种视频编码方法包括:获取图像;对上述图像的第一场图像数据进行视频编码以得到第一视频编码帧;对上述图像的第二场图像数据进行视频编码以得到第二视频编码帧;将上述第一视频编码帧和上述第二视频编码帧写入视频码流;其中,上述第一视频编码帧包含第一场编码指示,上述第一场编码指示指示上述第一视频编码帧为单场图像数据对应的视频编码帧,上述第一场编码指示还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,上述第一场编码指示还指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序;其中,上述第一场图像数据为顶场图像数据,且上述第二场图像数据为底场图像数据,或者上述第二场图像数据为顶场图像数据,且上述第一场图像数据为底场图像数据。An embodiment of the video encoding method of the present invention, wherein a video encoding method comprises: acquiring an image; performing video encoding on the first field image data of the image to obtain a first video encoding frame; and second field image of the image Data is video-encoded to obtain a second video-coded frame; the first video-coded frame and the second video-coded frame are written into a video code stream; wherein the first video-coded frame includes a first field coding indicator, the first The field coding indication indicates that the first video coding frame is a video coding frame corresponding to the single field image data, and the first field coding indication further indicates that the single field image data included in the first video coding frame is a top field image data or a bottom field image. Data, the first field coding indication further indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream; wherein the first field image data is top field image data, and The second field image data is bottom field image data, or the second field image data is top field image data, and the above A bottom field image data as image data.
参见图1,图1为本发明的一个实施例提供的一种视频编码方法的流程示意图。如图1所示,本发明的一个实施例提供的一种视频编码方法可包括以下内容:Referring to FIG. 1, FIG. 1 is a schematic flowchart diagram of a video encoding method according to an embodiment of the present invention. As shown in FIG. 1, a video encoding method provided by an embodiment of the present invention may include the following content:
101、获取图像。101. Acquire an image.
102、对上述图像的第一场图像数据进行视频编码以得到第一视频编码帧。102. Perform video coding on the first field image data of the foregoing image to obtain a first video coding frame.
103、对上述图像的第二场图像数据进行视频编码以得到第二视频编码 帧。103. Perform video coding on the second field image data of the foregoing image to obtain a second video coding. frame.
其中,上述第一场图像数据可为顶场图像数据(即上述图像的第一场图像数据可为上述图像的顶场图像数据),并且上述第二场图像数据可为底场图像数据(即上述图像的第二场图像数据可为上述图像的底场图像数据)。或者上述第二场图像数据可为顶场图像数据(即,上述图像的第二场图像数据可为上述图像的顶场图像数据),且上述第一场图像数据可为底场图像数据(即上述图像的第一场图像数据可为上述图像的底场图像数据)。The first field image data may be top field image data (ie, the first field image data of the image may be top field image data of the image), and the second field image data may be bottom field image data (ie, The second field image data of the above image may be the bottom field image data of the above image). Or the second field image data may be top field image data (ie, the second field image data of the image may be top field image data of the image), and the first field image data may be bottom field image data (ie, The first field image data of the above image may be the bottom field image data of the above image).
其中,步骤102和步骤103之间没用必然的执行先后顺序,例如步骤202可先于或晚于步骤103执行,或者步骤102和步骤103也可同步执行,或者步骤102和步骤103也可穿插执行。There is no necessary execution sequence between step 102 and step 103. For example, step 202 may be performed before or after step 103, or steps 102 and 103 may be performed synchronously, or steps 102 and 103 may be interspersed. carried out.
104、将上述第一视频编码帧和上述第二视频编码帧写入视频码流。104. Write the first video coding frame and the second video coding frame to the video code stream.
其中,上述第一视频编码帧包含第一场编码指示(第一场编码指示例如可包含于上述第一视频编码帧的帧头和/或其他位置),上述第一场编码指示指示上述第一视频编码帧为单场图像数据对应的视频编码帧。也就是说,上述第一场编码指示可指示上述第一视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据。The first video coding frame includes a first field coding indication (the first field coding indication may be included, for example, in a frame header and/or other location of the first video coding frame), and the first field coding indication indicates the first The video coding frame is a video coding frame corresponding to single field image data. That is, the first field coding indication may indicate that the first video coding frame includes one field of image data of one image, and does not include two fields of image data of one image.
其中,上述第一场编码指示还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据。例如,假设是对上述图像的顶场图像数据进行视频编码以得到第一视频编码帧,则上述第一场编码指示指示上述第一视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第一视频编码帧,则上述第一场编码指示指示上述第一视频编码帧包含的单场图像数据为底场图像数据。The first field coding indication further indicates that the single field image data included in the first video coding frame is top field image data or bottom field image data. For example, if it is assumed that video encoding the top field image data of the image to obtain the first video encoding frame, the first field encoding indication indicates that the single field image data included in the first video encoding frame is top field image data, assuming The video encoding the bottom field image data of the image to obtain the first video encoding frame, the first field encoding instruction indicating that the single field image data included in the first video encoding frame is the bottom field image data.
其中,上述第一场编码指示还指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。例如,若上述视频码流中上述第一视频编码帧先于上述第二视频编码帧出现,则上述第一场编码指示指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧先于上述第二视频编码帧出现。反之,若上述视频码流中上述第一视频编码帧后于上述第二视频编码帧出现,则上述第一场编码指示指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧后于上述第二视频编码帧出 现。The first field coding indication further indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the first field coding indication indicates that the first video coding frame and the second video coding frame are in the video code. The order of occurrence in the stream is that the first video coding frame appears before the second video coding frame. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the first field encoding indication indicates that the first video encoding frame and the second video encoding frame are in the video code. The sequence of occurrences in the stream is the first video encoding frame and the second video encoding frame Now.
可以看出,本实施例的视频编码方案中,对图像的第一场图像数据和第二场图像数据分别进行视频编码以得到第一视频编码帧和第二视频编码帧;将第一视频编码帧和第二视频编码帧写入视频码流。其中,由于第一视频编码帧包含第一场编码指示,上述第一场编码指示指示上述第一视频编码帧为单场图像数据对应的视频编码帧,且上述第一场编码指示还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,且第一场编码指示还指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。其中,由于利用第一视频编码帧明确的指示出,基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,这有利于视频解码装置明确获知基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,进而有利于视频解码装置正确的将解码得到的同一图像的不同场图像数据进行图像交融。It can be seen that, in the video coding scheme of this embodiment, the first field image data and the second field image data of the image are separately video-encoded to obtain a first video-coded frame and a second video-coded frame; The frame and the second video encoded frame are written to the video stream. The first field coding instruction indicates that the first video coding frame is a video coding frame corresponding to the single field image data, and the first field coding indication further indicates the foregoing. The single field image data included in a video encoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video encoding frame and the second video encoding frame appear in the video stream. The order of precedence. Wherein, because the first video coding frame is explicitly indicated, the sequence of the homologous video coding frames obtained from the image data of different fields of the same image appears in the video code stream, which is beneficial for the video decoding device to know clearly based on the same The sequence of the homologous video coding frames obtained by the image data of different fields of the image appears in the video code stream, thereby facilitating the video decoding device to correctly image the different field image data of the same image obtained by decoding.
其中,对图像的顶场图像数据和底场图像数据分别进行视频编码而得到两个视频编码帧互为“同源视频编码帧”,因为这两个视频编码帧所包含的场图像数据来自同一图像。例如。上述第一视频编码帧为上述第二视频编码帧的同源视频编码帧,同理,上述第二视频编码帧也为上述第一视频编码帧的同源视频编码帧。类似的,某图像的顶场图像数据和底场图像数据互为“同源场图像数据”,因为这两个场图像数据来自同一图像。例如。上述图像的顶场图像数据为上述图像的底场图像数据的同源场图像数据,同理,上述图像的底场图像数据为上述图像的顶场图像数据的同源场图像数据。Wherein, the top field image data and the bottom field image data of the image are respectively video-encoded to obtain two video coded frames which are mutually homologous video coded frames, because the field image data included in the two video coded frames are from the same image. E.g. The first video coding frame is a homogenous video coding frame of the second video coding frame. Similarly, the second video coding frame is also a homogenous video coding frame of the first video coding frame. Similarly, the top field image data and the bottom field image data of an image are "homologous field image data" with each other because the two field image data are from the same image. E.g. The top field image data of the image is the same-field image data of the bottom field image data of the image. Similarly, the bottom field image data of the image is the homologous field image data of the top field image data of the image.
在本发明的一些可能的实施方式中,上述第一场编码指示可包含第一指示参数和第二指示参数。其中,上述第一指示参数指示上述第一视频编码帧为单场图像数据对应的视频编码帧(即,第一指示参数可指示上述第一视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),上述第一指示参数还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第一视频编码帧,则第一指示参数指示上述第一视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第一视频编码帧,则第一指示参数指示上述第一视频编码帧 包含的单场图像数据为底场图像数据)。其中,上述第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。例如,若上述视频码流中上述第一视频编码帧先于上述第二视频编码帧出现,则第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧先于上述第二视频编码帧出现。反之,若上述视频码流中上述第一视频编码帧后于上述第二视频编码帧出现,则第二指示参数可指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧后于上述第二视频编码帧出现。In some possible implementation manners of the present invention, the first field coding indication may include a first indication parameter and a second indication parameter. The first indication parameter indicates that the first video encoding frame is a video encoding frame corresponding to single field image data (ie, the first indication parameter may indicate that the first video encoding frame includes a single field image data of an image, and The first indicator parameter further includes the single field image data included in the first video encoding frame as the top field image data or the bottom field image data (for example, assuming that the image is the same for the two fields of image data) The top field image data is video-encoded to obtain a first video-coded frame, and the first indication parameter indicates that the single-field image data included in the first video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed. Video coding to obtain a first video coding frame, where the first indication parameter indicates the first video coding frame The included single field image data is bottom field image data). The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the second indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video coding frame appears before the second video coding frame. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the second indication parameter may indicate that the first video encoding frame and the second video encoding frame are in the video stream. The sequence of occurrences occurs after the first video encoding frame is followed by the second video encoding frame.
在本发明的另一些可能的实施方式中,上述第一场编码指示例如可包含第三指示参数、第四指示参数和第二指示参数。其中,上述第三指示参数可指示上述第一视频编码帧为单场图像数据对应的视频编码帧(即,第三指示参数可指示上述第一视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据)。上述第四指示参数可指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第一视频编码帧,则第四指示参数指示上述第一视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第一视频编码帧,则第四指示参数指示上述第一视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。In other possible implementation manners of the present invention, the first field coding indication may include, for example, a third indication parameter, a fourth indication parameter, and a second indication parameter. The third indication parameter may indicate that the first video coding frame is a video coding frame corresponding to single field image data (ie, the third indication parameter may indicate that the first video coding frame includes a single field image data of an image, Two image data without an image). The fourth indication parameter may indicate that the single field image data included in the first video encoding frame is top field image data or bottom field image data (eg, it is assumed that video encoding the top field image data of the image to obtain the first video) Encoding the frame, the fourth indication parameter indicating that the single field image data included in the first video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain the first video encoding frame, The four indication parameter indicates that the single field image data included in the first video encoding frame is bottom field image data). The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
其中,第一指示参数例如可包括至少两个比特,其中,第一指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第二指示参数例如包括至少1个比特。第二指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The first indication parameter may include, for example, at least two bits, wherein the first indication parameter may be, for example, a parameter progressive_frame indicator bit or a picture_structure indicator bit or other extension indicator bit. The second indication parameter includes, for example, at least 1 bit. The second indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
可选的,上述第二视频编码帧可包含第二场编码指示(第二场编码指示例如可包含于上述第二视频编码帧的帧头和/其他位置),上述第二场编码指示可指示上述第二视频编码帧为单场图像数据对应的视频编码帧,即,上述第二场编码指示可指示上述第二视频编码帧包含一幅图像的单场图像数据, 而不包含一幅图像的两场图像数据。Optionally, the foregoing second video coding frame may include a second field coding indication (the second field coding indication may be included, for example, in a frame header and/or other locations of the second video coding frame), where the second field coding indication may indicate The second video encoding frame is a video encoding frame corresponding to the single field image data, that is, the second field encoding indication may indicate that the second video encoding frame includes one image of the single field image data, Does not contain two fields of image data for one image.
可选的,上述第二场编码指示还可指示上述第二视频编码帧包含的单场图像数据为底场图像数据或者顶场图像数据。例如,假设是对上述图像的顶场图像数据进行视频编码以得到第二视频编码帧,则上述第二场编码指示可指示上述第二视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第二视频编码帧,则上述第二场编码指示指示上述第二视频编码帧包含的单场图像数据为底场图像数据。Optionally, the second field coding indication may further indicate that the single field image data included in the second video coding frame is bottom field image data or top field image data. For example, if it is a video encoding of the top field image data of the image to obtain a second video encoding frame, the second field encoding indication may indicate that the single field image data included in the second video encoding frame is top field image data. Assuming that the bottom field image data of the image is video encoded to obtain a second video encoded frame, the second field encoding indication indicates that the single field image data included in the second video encoding frame is bottom field image data.
可选的,上述第二场编码指示还可指示出上述第二视频编码帧和上述第一视频编码帧在上述视频码流中出现的先后顺序。例如,若上述视频码流中上述第一视频编码帧先于上述第二视频编码帧出现,则上述第二场编码指示可指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧先于上述第二视频编码帧出现。反之,若上述视频码流中上述第一视频编码帧后于上述第二视频编码帧出现,则上述第二场编码指示可指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧后于上述第二视频编码帧出现。Optionally, the second field coding indication may further indicate a sequence in which the second video coding frame and the first video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the second field coding indication may indicate that the first video coding frame and the second video coding frame are in the video. The order of occurrence in the code stream is that the first video coding frame appears before the second video coding frame. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the second field encoding indication may indicate that the first video encoding frame and the second video encoding frame are in the video. The sequence of occurrences in the code stream is the first video coded frame and the second video coded frame.
在本发明的一些可能的实施方式中,上述第二场编码指示可包含第五指示参数和第五指示参数。其中,上述第五指示参数指示上述第二视频编码帧为单场图像数据对应的视频编码帧(即,第五指示参数可指示上述第二视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),上述第五指示参数还指示上述第二视频编码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第二视频编码帧,则第五指示参数指示上述第二视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第二视频编码帧,则第五指示参数指示上述第二视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第六指示参数指示出上述第二视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。例如,若上述视频码流中上述第一视频编码帧先于上述第二视频编码帧出现,则第六指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧先于上述第二视频 编码帧出现。反之,若上述视频码流中上述第一视频编码帧后于上述第二视频编码帧出现,则第六指示参数可指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧后于上述第二视频编码帧出现。In some possible implementation manners of the present invention, the second field coding indication may include a fifth indication parameter and a fifth indication parameter. The fifth indication parameter indicates that the second video coding frame is a video coding frame corresponding to single field image data (that is, the fifth indication parameter may indicate that the second video coding frame includes a single field image data of an image, and The second indication parameter does not include an image, and the fifth indication parameter further indicates that the single field image data included in the second video coding frame is top field image data or bottom field image data (for example, assuming that the image is The top field image data is video-encoded to obtain a second video-coded frame, and the fifth indication parameter indicates that the single-field image data included in the second video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed. Video encoding to obtain a second video encoding frame, the fifth indication parameter indicating that the single field image data included in the second video encoding frame is bottom field image data). The sixth indication parameter indicates a sequence in which the second video coding frame and the second video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the sixth indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video encoding frame is preceded by the second video The encoded frame appears. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the sixth indication parameter may indicate that the first video encoding frame and the second video encoding frame are in the video stream. The sequence of occurrences occurs after the first video encoding frame is followed by the second video encoding frame.
在本发明的另一些可能的实施方式中,上述第二场编码指示例如可包含第七指示参数、第八指示参数和第六指示参数。其中,上述第七指示参数可指示上述第二视频编码帧为单场图像数据对应的视频编码帧(即,第七指示参数可指示上述第二视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据)。上述第八指示参数可指示上述第二视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第二视频编码帧,则第八指示参数指示上述第二视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第二视频编码帧,则第八指示参数指示上述第二视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第六指示参数指示出上述第二视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。In other possible implementation manners of the present invention, the foregoing second field coding indication may include, for example, a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter. The seventh indication parameter may indicate that the second video coding frame is a video coding frame corresponding to single field image data (that is, the seventh indication parameter may indicate that the second video coding frame includes a single field image data of an image, Two image data without an image). The eighth indication parameter may indicate that the single field image data included in the second video coding frame is top field image data or bottom field image data (eg, assuming that the top field image data of the image is video encoded to obtain a second video) Encoding the frame, the eighth indication parameter indicating that the single field image data included in the second video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain a second video encoding frame, The eight indication parameter indicates that the single field image data included in the second video encoding frame is bottom field image data). The sixth indication parameter indicates a sequence in which the second video coding frame and the second video coding frame appear in the video code stream.
其中,第五指示参数例如可包括至少两个比特,其中,第五指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第六指示参数例如包括至少1个比特。第六指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter may be, for example, a parameter progressive_frame indication bit or a picture structure (picture_structure) indication bit or other extended indication bit. The sixth indication parameter includes, for example, at least 1 bit. The sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
可以理解,由于第二场编码指示和第一场编码指示指示出的第二视频编码帧和第一视频编码帧在视频码流中出现的先后顺序本质上应相同,因此,视频解码装置也也可根据第二场编码指示和第一场编码指示所指示出的第二视频编码帧和第一视频编码帧在视频码流中出现的先后顺序是否相同,来确定是否存在丢弃帧或误码情况等。当然,也是由于第二场编码指示和第一场编码指示所指示出的第二视频编码帧和第一视频编码帧在视频码流中出现的先后顺序本质上应相同,因此第二场编码指示也可以省略。It can be understood that since the second field coding indication and the first video coding frame indicate that the second video coding frame and the first video coding frame appear in the video code stream in the same order, the video decoding device is also Determining whether there is a dropped frame or a bit error condition according to whether the second video encoding frame and the first video encoding frame indicate the order in which the first video encoding frame and the first video encoding frame appear in the video code stream are the same. Wait. Of course, since the second video coding frame and the first video coding frame indicated by the second field coding indication and the first video coding frame are in the same order in the video code stream, the second field coding indication is Can also be omitted.
其中,所谓“视频编码帧在视频码流中出现的先后顺序”,可理解为是编码得到视频编码帧的先后顺序,例如,第一视频编码帧先于第二视频编码 帧在码流中出现,可以理解为是编码得到第一视频编码帧先于编码得到第二视频编码帧。又例如,第一视频编码帧后于第二视频编码帧在码流中出现,可理解为是编码得到第一视频编码帧后于编码得到第二视频编码帧。The so-called "sequence of video coding frames appearing in the video code stream" can be understood as the order in which the video coded frames are encoded, for example, the first video coding frame precedes the second video coding. The frame appears in the code stream, which can be understood as the encoding of the first video encoded frame prior to encoding to obtain the second video encoded frame. For another example, the first video encoding frame and the second video encoding frame appear in the code stream, which can be understood as encoding the second video encoding frame after encoding the first video encoding frame.
其中,所谓“解码图像数据的解码后输出顺序”,可理解为是解码图像数据所对应的视频解码帧经解码及排序后的解码图像数据的显示顺序。第一视频解码帧和第二视频解码帧在视频码流中出现的先后顺序,可能不同于第一视频解码帧所对应解码图像数据和第二视频解码帧所对应解码图像数据的解码后输出顺序。Here, the "output sequence after decoding of decoded image data" can be understood as the display order of decoded image data after decoding and sorting of the video decoded frame corresponding to the decoded image data. The order in which the first video decoded frame and the second video decoded frame appear in the video code stream may be different from the decoded output order of the decoded image data corresponding to the first video decoded frame and the decoded image data corresponding to the second video decoded frame. .
其中,对于视频解码装置而言,也可以将视频码流中的视频编码帧称为视频解码帧。Wherein, for the video decoding device, the video encoded frame in the video code stream may also be referred to as a video decoded frame.
下面介绍本发明实施例提供的视频解码方法,本发明实施例提供的视频解码方法的执行主体是视频解码装置,其中,该视频解码装置可以是任何需要输出、播放视频的装置,如手机,笔记本电脑,平板电脑,个人电脑等设备。The video decoding method provided by the embodiment of the present invention is described below. The execution body of the video decoding method provided by the embodiment of the present invention is a video decoding device, where the video decoding device may be any device that needs to output and play video, such as a mobile phone or a notebook. Computers, tablets, personal computers and other equipment.
本发明视频解码方法的另一实施例,其中,一种视频解码方法包括:对视频码流中的第一视频解码帧进行视频解码以得到第一图像解码数据;对上述视频码流中的第二视频解码帧进行视频解码以得到第二图像解码数据;其中,上述第一视频解码帧包含第一场编码指示,上述第一场编码指示指示出第一视频解码帧为单场图像数据对应的视频解码帧,并且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且上述第一场编码指示还指示上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现顺序;其中,上述第一视频解码帧和上述同源视频解码帧基于同一图像的不同场的图像数据得到;根据上述第一场编码指示将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。Another embodiment of the video decoding method of the present invention, wherein a video decoding method comprises: performing video decoding on a first video decoding frame in a video code stream to obtain first image decoding data; The second video decoding frame is subjected to video decoding to obtain second image decoding data, where the first video decoding frame includes a first field encoding indication, and the first field encoding indication indicates that the first video decoding frame is corresponding to single field image data. The video decoding frame, and the first field encoding indication further indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates the first video decoding. An order of appearance of the frame and the homogenous video decoding frame of the first video decoding frame in the video stream; wherein the first video decoding frame and the homologous video decoding frame are obtained based on image data of different fields of the same image; Blending the first image decoded data and the second image decoded data according to the first field encoding instruction Blend images.
请参见图2,图2为本发明的另一个实施例提供的一种视频解码方法的流程示意图。如图2所示,本发明的另一个实施例提供的一种视频解码方法可包括以下内容:Referring to FIG. 2, FIG. 2 is a schematic flowchart diagram of a video decoding method according to another embodiment of the present invention. As shown in FIG. 2, a video decoding method provided by another embodiment of the present invention may include the following content:
201、对视频码流中的第一视频解码帧进行视频解码以得到第一图像解码数据。 201. Perform video decoding on the first video decoded frame in the video code stream to obtain first image decoded data.
202、对上述视频码流中的第二视频解码帧进行视频解码以得到第二图像解码数据。202. Perform video decoding on the second video decoding frame in the video stream to obtain second image decoding data.
其中,步骤201和步骤202之间没用必然的执行先后顺序,例如步骤201可先于或晚于步骤202执行,或者步骤201和步骤202也可同步执行,或者步骤201和步骤202也可穿插执行。The inevitable execution sequence is not used between step 201 and step 202. For example, step 201 may be performed before or after step 202, or steps 201 and 202 may be performed synchronously, or step 201 and step 202 may be interspersed. carried out.
其中,上述第一视频解码帧包含第一场编码指示,上述第一场编码指示指示出第一视频解码帧为单场图像数据对应的视频解码帧,并且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且上述第一场编码指示还指示上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现顺序;其中,上述第一视频解码帧和上述同源视频解码帧基于同一图像的不同场的图像数据得到。The first video decoding frame includes a first field coding indication, where the first field coding indication indicates that the first video decoding frame is a video decoding frame corresponding to single field image data, and the first field coding indication further indicates the foregoing The single field image data included in a video decoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video decoding frame and the homologous video decoding frame of the first video decoding frame are An order of appearance in the video stream; wherein the first video decoded frame and the homologous video decoded frame are obtained based on image data of different fields of the same image.
203、根据上述第一场编码指示将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。203. The first image decoding data and the second image decoding data are blended according to the first field coding instruction to obtain a blend image.
其中,上述第一视频解码帧和上述第一视频解码帧的上述同源视频解码帧基于同一图像的不同场的图像数据得到。即,基于同一图像的不同场的图像数据而得到得两个视频解码帧互为“同源视频解码帧”。类似的,某图像的顶场图像数据和底场图像数据互为“同源场图像数据”,因为这两个场图像数据来自同一图像。例如。某副图像的顶场图像数据为该图像的底场图像数据的同源场图像数据,同理,某图像的底场图像数据为该图像的顶场图像数据的同源场图像数据。The first video decoding frame and the homologous video decoding frame of the first video decoding frame are obtained based on image data of different fields of the same image. That is, two video decoded frames are obtained as "homo homologous video decoding frames" based on image data of different fields of the same image. Similarly, the top field image data and the bottom field image data of an image are "homologous field image data" with each other because the two field image data are from the same image. E.g. The top field image data of a certain image is the homologous field image data of the bottom field image data of the image. Similarly, the bottom field image data of a certain image is the homologous field image data of the top field image data of the image.
可以看出,本实施例的视频解码方案中,在对视频码流中的第一视频解码帧和第二视频解码帧进行视频解码以得到第一图像解码数据和第二图像解码数据之后,由于是根据第一视频解码帧包含的第一场编码指示的指示,及第二视频解码帧与上述第一视频解码帧在上述视频码流中的出现顺序,及第一图像解码数据和上述第二图像解码数据的解码后输出顺序,来确定是否将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。其中,由于第一视频解码帧明确的指示出,第一视频解码帧和其同源视频解码帧在视频码流中出现的先后顺序,这有利于视频解码装置明确获知基于同一图像的不同场的图像数据得到的同源视频解码帧在视频码流中出现的先 后顺序,进而有利于视频解码装置正确的将解码得到的同一图像的不同场图像数据进行图像交融。It can be seen that, in the video decoding scheme of this embodiment, after the first video decoding frame and the second video decoding frame in the video code stream are video-decoded to obtain the first image decoding data and the second image decoding data, And an indication of the first field coding indication included in the first video decoding frame, and an appearance order of the second video decoding frame and the first video decoding frame in the video code stream, and the first image decoding data and the second The decoded output order of the image decoded data determines whether the first image decoded data and the second image decoded data are blended to obtain a blended image. Wherein, since the first video decoding frame explicitly indicates the sequence in which the first video decoding frame and the homologous video decoding frame appear in the video code stream, this is advantageous for the video decoding device to explicitly know different fields based on the same image. The homologous video decoding frame obtained from the image data appears first in the video code stream The latter sequence, in turn, facilitates the video decoding device to correctly image the different field image data of the same image obtained by decoding.
在本发明一些可能的实施方式中,上述第一场编码指示可包含第一指示参数和第二指示参数;其中,上述第一指示参数指示可指示出第一视频解码帧为单场图像数据对应的视频解码帧(即,第一指示参数可指示上述第一视频解码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),并且上述第一指示参数还可以指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第一视频解码帧包含的单场图像数据为顶场图像数据,则第一指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,上述第一视频解码帧包含的单场图像数据为底场图像数据,则第一指示参数指示上述第一视频解码帧包含的单场图像数据为底场图像数据)。上述第二指示参数可指示出上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现先后顺序。In some possible implementation manners of the present disclosure, the first field coding indication may include a first indication parameter and a second indication parameter, where the first indication parameter indication may indicate that the first video decoding frame is a single field image data corresponding to Video decoding frame (ie, the first indication parameter may indicate that the first video decoding frame includes one field of image data of one image, and does not include two fields of image data of one image), and the first indication parameter may also be Instructing the single video image data included in the first video decoding frame to be top field image data or bottom field image data (eg, assuming that the single field image data included in the first video decoding frame is top field image data, the first indicator parameter And indicating that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the first indication parameter indicates that the first video decoding frame includes The single field image data is the bottom field image data). The second indication parameter may indicate a sequence of occurrence of the first video decoding frame and the homologous video decoding frame of the first video decoding frame in the video code stream.
在本发明另一些可能的实施方式中,上述第一场编码指示可包含第三指示参数、第四指示参数和第二指示参数;其中,上述第三指示参数指示出第一视频解码帧为单场图像数据对应的视频解码帧。上述第四指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第一视频解码帧包含的单场图像数据为顶场图像数据,则第四指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,上述第一视频解码帧包含的单场图像数据为底场图像数据,则第四指示参数指示上述第一视频解码帧包含的单场图像数据为底场图像数据)。上述第二指示参数可指示出上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现先后顺序。In another possible implementation manner of the present invention, the first field coding indication may include a third indication parameter, a fourth indication parameter, and a second indication parameter, where the third indication parameter indicates that the first video decoding frame is a single The video decoded frame corresponding to the field image data. The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data (for example, assuming that the single field image data included in the first video decoding frame is top field image data, The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the fourth indication parameter indicates the foregoing The single field image data contained in a video decoding frame is bottom field image data). The second indication parameter may indicate a sequence of occurrence of the first video decoding frame and the homologous video decoding frame of the first video decoding frame in the video code stream.
其中,第一指示参数例如可包括至少两个比特,其中,第一指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第二指示参数例如包括至少1个比特。第二指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The first indication parameter may include, for example, at least two bits, wherein the first indication parameter may be, for example, a parameter progressive_frame indicator bit or a picture_structure indicator bit or other extension indicator bit. The second indication parameter includes, for example, at least 1 bit. The second indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
在本发明的一些可能的实施方式中,根据上述第一场编码指示将上述第 一图像解码数据和上述第二图像解码数据进行交融得到交融图像,可包括:若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第二视频解码帧在上述视频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;In some possible implementation manners of the present invention, the foregoing And combining the image decoding data and the second image decoding data to obtain the blending image, the method may include: if the first field encoding instruction indicates that the homologous video decoding frame of the first video decoding frame is in the video stream, a video decoding frame is present, and the second video decoding frame is present in the first video decoding frame after the video stream, and the decoded output sequence of the first image decoding data and the second image decoding data are adjacent to each other. Blending the first image decoded data and the second image decoded data to obtain a blended image;
或者;or;
若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,且上述第二视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。And if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the second video decoding frame is first in the video code stream. Appearing in the first video decoding frame, and the first image decoding data and the second image decoding data are sequentially outputted, and the first image decoding data and the second image decoding data are blended to obtain a blend image. .
在本发明的另一些可能的实施方式中,上述第二视频解码帧可包含第二场编码指示,上述第二场编码指示指示出第二视频解码帧为单场图像数据对应的视频解码帧,并且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且上述第二场编码指示还指示上述第二视频解码帧和上述第二视频解码帧的同源视频解码帧在上述视频码流中的出现顺序;In another possible implementation manner of the present invention, the second video decoding frame may include a second field coding indication, where the second field coding indication indicates that the second video decoding frame is a video decoding frame corresponding to the single field image data. And the second field coding indication further indicates that the single field image data included in the second video decoding frame is top field image data or bottom field image data, and the second field coding indication further indicates the second video decoding frame and the foregoing The order in which the homologous video decoded frames of the two video decoded frames appear in the video stream;
上述根据上述第一场编码指示将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像,包括:根据上述第一场编码指示和上述第二场编码指示,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。Performing the blending of the first image decoding data and the second image decoding data according to the first field encoding instruction to obtain a blending image, comprising: first, according to the first field encoding instruction and the second field encoding instruction, the first image The decoded data and the second image decoded data are blended to obtain a blended image.
例如,根据上述第一场编码指示和上述第二场编码指示,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像,包括:For example, according to the first field coding instruction and the second field coding instruction, the first image decoding data and the second image decoding data are blended to obtain a blend image, including:
若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中先于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为底场图像数据,且上述第二视频解码帧在上述视 频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, the first video decoding frame is further generated, and the first field coding indication further indicates the first video decoding. The single field image data included in the frame is top field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame appears before the second video decoding frame in the video code stream, and The second field coding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame is in the foregoing view. And appearing in the first video decoding frame, and the first image decoding data and the second image decoding data are sequentially adjacent to the decoded output sequence, and the first image decoding data and the second image decoding data are Blending to obtain a blended image;
或者;or;
若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中后于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为底场图像数据,且上述第二视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field coding indication further indicates the first video decoding. The single field image data included in the frame is top field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame is present in the video code stream and then appears in the second video decoding frame, and The second field coding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame appears in the video code stream before the first video decoding frame, and The first image decoded data and the second image decoded data are sequentially adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image;
或者;or;
若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为底场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中先于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,且上述第二视频解码帧在上述视频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, the first video decoding frame is further generated, and the first field coding indication further indicates the first video decoding. The single field image data included in the frame is bottom field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame appears before the second video decoding frame in the video code stream, and The second field coding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video code stream and then appears in the first video decoding frame, and The first image decoded data and the second image decoded data are sequentially adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image;
或者;or;
若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为底场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中后于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,且上述第二视频解码帧在上述视 频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field coding indication further indicates the first video decoding. The single field image data included in the frame is bottom field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream and then appears in the second video decoding frame, and The second field coding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the foregoing view. And generating, in the frequency code stream, the first video decoding frame, and the first image decoding data and the second image decoding data are sequentially outputted, and the first image decoding data and the second image decoding data are Blend to get a blended image.
在本发明一些可能的实施方式中,上述第二场编码指示可包含第五指示参数和第六指示参数;其中,上述第五指示参数指示可指示出第二视频解码帧为单场图像数据对应的视频解码帧(即,第五指示参数可指示上述第二视频解码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),并且上述第五指示参数还可以指示上述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第二视频解码帧包含的单场图像数据为顶场图像数据,则第五指示参数指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,上述第二视频解码帧包含的单场图像数据为底场图像数据,则第五指示参数指示上述第二视频解码帧包含的单场图像数据为底场图像数据)。上述第六指示参数可指示出上述第二视频解码帧和上述第二视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In some possible implementation manners of the present disclosure, the foregoing second field coding indication may include a fifth indication parameter and a sixth indication parameter, where the fifth indication parameter indication may indicate that the second video decoding frame is a single field image data corresponding to Video decoding frame (ie, the fifth indication parameter may indicate that the second video decoding frame includes one field of image data of one image, and does not include two fields of image data of one image), and the fifth indication parameter may also be Instructing the single video image data included in the second video decoding frame to be top field image data or bottom field image data (for example, assuming that the single field image data included in the second video decoding frame is top field image data, the fifth indicator parameter And indicating that the single field image data included in the second video decoding frame is top field image data, and the single field image data included in the second video decoding frame is bottom field image data, and the fifth indication parameter indicates that the second video decoding frame includes The single field image data is the bottom field image data). The sixth indication parameter may indicate an order of appearance of the homologous video decoding frame of the second video decoding frame and the second video decoding frame in the video code stream.
在本发明另一些可能的实施方式中,上述第二场编码指示可包含第七指示参数、第八指示参数和第六指示参数;其中,上述第七指示参数指示出第二视频解码帧为单场图像数据对应的视频解码帧。上述第八指示参数指示上述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第二视频解码帧包含的单场图像数据为顶场图像数据,则第八指示参数指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,若上述第二视频解码帧包含的单场图像数据为底场图像数据,则第八指示参数指示上述第二视频解码帧包含的单场图像数据为底场图像数据)。上述第六指示参数可指示出上述第二视频解码帧和上述第二视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In another possible implementation manner of the present invention, the foregoing second field coding indication may include a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter, where the seventh indication parameter indicates that the second video decoding frame is a single The video decoded frame corresponding to the field image data. The eighth indication parameter indicates that the single field image data included in the second video decoding frame is top field image data or bottom field image data (for example, assuming that the single field image data included in the second video decoding frame is top field image data, The eighth indication parameter indicates that the single field image data included in the second video decoding frame is top field image data, and if the single field image data included in the second video decoding frame is bottom field image data, the eighth indication parameter indicates the above. The single field image data included in the second video decoding frame is bottom field image data). The sixth indication parameter may indicate an order of appearance of the homologous video decoding frame of the second video decoding frame and the second video decoding frame in the video code stream.
其中,第五指示参数例如可包括至少两个比特,其中,第五指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第六指示参数例如包括至少1个比特。第六指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。 The fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter may be, for example, a parameter progressive_frame indication bit or a picture structure (picture_structure) indication bit or other extended indication bit. The sixth indication parameter includes, for example, at least 1 bit. The sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
其中,上述将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像,例如可包括:若第一图像解码数据为顶场图像解码数据,第二图像解码数据为底场图像解码数据,将第一图像解码数据作为交融图像的顶场图像数据,将第二图像解码数据作为交融图像的底场图像数据。或,上述将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像可包括:若第二图像解码数据为顶场图像解码数据,第一图像解码数据为底场图像解码数据,将第二图像解码数据作为交融图像的顶场图像数据,将第一图像解码数据作为交融图像的底场图像数据。Wherein, the blending the first image decoded data and the second image decoded data to obtain a blended image may include, for example, if the first image decoded data is top field image decoding data, and the second image decoded data is bottom field image decoding. The data uses the first image decoded data as the top field image data of the blended image and the second image decoded data as the bottom field image data of the blended image. Alternatively, the blending the first image decoded data and the second image decoded data to obtain the blended image may include: if the second image decoded data is top field image decoding data, the first image decoded data is bottom field image decoding data, The second image decoded data is used as the top field image data of the blended image, and the first image decoded data is used as the bottom field image data of the blended image.
为便于更好的理解和实施本发明实施例的上述技术方案,下面通过一些具体的应用场景进行举例说明。To facilitate a better understanding and implementation of the foregoing technical solutions of the embodiments of the present invention, the following is exemplified by some specific application scenarios.
本发明一些实施例,通过扩展标准协议定义的场编码语法元素含义,有利于实现更灵活的场编解码。Some embodiments of the present invention facilitate the implementation of more flexible field codec by extending the meaning of the field coding syntax elements defined by the standard protocol.
例如,图像结构(picture_structure)指示位:当当前图像为隔行扫描图像时,指示当前图像以逐行方式编码或隔行方式编码。For example, the picture structure (picture_structure) indicates a bit: when the current picture is an interlaced picture, indicating that the current picture is encoded in a line-by-line manner or interlaced.
例如,当picture_structure指示位的取值为0时可表示两场图像数据依次出现,即当前图像以隔行方式进行编码,先编码或解码一场图像数据再编码或解码另一场图像数据;当picture_structure指示位取值为1时可表示当前图像的两场图像数据交融出现,即,当前图像以逐行方式进行编码或解码,即编码或解码时不刻意区分两个场图像数据是顶场图像数据还是底场图像数据。For example, when the value of the picture_structure indication bit is 0, it can indicate that two fields of image data appear sequentially, that is, the current image is encoded in an interlaced manner, and one field of image data is first encoded or decoded to re-encode or decode another field of image data; when picture_structure When the value of the indication bit is 1, it can indicate that the two fields of the current image are blended, that is, the current image is encoded or decoded in a row-by-row manner, that is, the encoding or decoding does not intentionally distinguish the two field image data from the top field image data. Still the bottom field image data.
例如可扩展progressive_frame指示位的含义。其中,标准协议中progressive_frame指示位只用于指示一个视频帧包含逐行扫描图像数据或包含隔行扫描图像数据。本发明一些实施例扩展progressive_frame指示位的指示含义,例如,progressive_frame指示位除了可指示视频码流中一个视频帧包含逐行扫描图像数据或包含隔行扫描图像数据,还可以指示当视频帧包含单场图像数据时,指示该单场图像数据是图像的顶场图像数据或是底场图像数据。For example, the meaning of the progressive_frame indicator bit can be extended. The progressive_frame indicator bit in the standard protocol is only used to indicate that one video frame contains progressive scan image data or contains interlaced image data. Some embodiments of the present invention extend the indication meaning of the progressive_frame indicator bit. For example, the progressive_frame indicator bit may indicate that a video frame in the video stream includes progressive image data or contains interlaced image data, and may also indicate that the video frame includes a single field. In the case of image data, the single field image data is indicated as top field image data or bottom field image data of the image.
其中,progressive_frame指示位具体定义例如可以如下:The specific definition of the progressive_frame indicator bit can be as follows:
例如,当progressive_frame指示位的取值为0时,可指示视频帧包含的两场图像数据为来自不同时刻的场图像数据,即图像为隔行扫描图像。此时 该视频帧可以以逐行方式进行编码/解码(如picture_structure指示位取值为1)或可以以隔行方式进行编码/解码(picture_structure指示位取值为0)。For example, when the value of the progressive_frame indicator bit is 0, the two image data included in the video frame may be indicated as field image data from different time instants, that is, the image is an interlaced image. at this time The video frame may be encoded/decoded in a progressive manner (eg, the picture_structure indicator bit takes a value of 1) or may be encoded/decoded in an interlaced manner (the picture_structure indicator bit takes a value of 0).
当progressive_frame指示位的取值为1时,可指示图像的两场图像数据交融出现,即当前图像以逐行方式进行编码或解码,即编码或解码时不刻意区分图像的两场图像数据是顶场图像数据还是底场图像数据。此时,该视频帧以逐行方式进行编码/解码。When the value of the progressive_frame indicator bit is 1, the two image data of the image may be indicated to be blended, that is, the current image is encoded or decoded in a row-by-row manner, that is, two fields of image data that are not intentionally distinguished when encoding or decoding are top. The field image data is also the bottom field image data. At this time, the video frame is encoded/decoded in a line-by-line manner.
当progressive_frame指示位的取值为2时,可以指示视频帧包含单场图像数据而不包含两场图像数据,并且,该视频帧包含的单场图像数据为顶场图像数据。When the value of the progressive_frame indicator bit is 2, it may be indicated that the video frame contains single field image data and does not include two fields of image data, and the single field image data included in the video frame is top field image data.
当progressive_frame指示位的取值为3时,可以指示视频帧包含单场图像数据而不包含两场图像数据,并且,该视频帧包含的单场图像数据为底场图像数据。When the value of the progressive_frame indicator bit is 3, the video frame may be included to include single-field image data without including two fields of image data, and the single-field image data included in the video frame is bottom field image data.
可以理解,由于扩展含义之后的progressive_frame指示位具有四种可能的取值,因此progressive_frame指示位包含至少两个比特。progressive_frame指示位可看着上述实施例中的第一指示参数的一种具体实现。It can be understood that since the progressive_frame indicator bit after the extended meaning has four possible values, the progressive_frame indicator bit contains at least two bits. The progressive_frame indicator can look at a specific implementation of the first indication parameter in the above embodiment.
其中,在上述progressive_frame指示位的扩展中,当progressive_frame指示位取值2或3时一个视频帧包含单场图像数据而不包含两场图像数据,因此此时无需通过picture_structure指示位来指示视频帧中的两场图像数据的编解码方式,因此,此时picture_structure指示位的取值设为固定值,如可固定设为1或0。In the extension of the progressive_frame indicator bit, when the progressive_frame indicator bit takes a value of 2 or 3, one video frame contains single-field image data and does not include two fields of image data, so there is no need to indicate the video frame by the picture_structure indicator bit at this time. The codec mode of the two fields of image data, therefore, the value of the picture_structure indicator bit is set to a fixed value, for example, it can be fixed to 1 or 0.
可以看出,通过扩展语法元素progressive_frame指示位的含义,有利于有效支持一个视频帧以单场方式单独进行编码,从而有利于简化在场编码时对编码数据管理及参考帧管理的复杂度。It can be seen that by extending the meaning of the syntax element progressive_frame indicating bit, it is advantageous to effectively support a video frame to be separately coded in a single field manner, thereby facilitating the simplification of the complexity of encoding data management and reference frame management in the field coding.
此外,还可扩展语法元素top_field_first指示位的含义,top_field_first指示位可用于指示一个视频帧和该视频帧的同源视频帧在视频码流中出现的先后顺序。top_field_first指示位的具体定义例如可以如下:In addition, the meaning of the bit element top_field_first may be extended, and the top_field_first indicator bit may be used to indicate the order in which a video frame and a homologous video frame of the video frame appear in the video stream. The specific definition of the top_field_first indicator bit can be as follows:
例如,当top_field_first指示位的取值为1时,可指示该场图像数据对应图像中的顶场图像数据在视频码流中先于底场图像数据出现,即视频帧和该视频帧的同源视频帧在视频码流中出现的先后顺序为,包含底场图像数据的视频帧在视频码流中先于该视频帧的同源视频帧(即包含顶场图像数据的视 频帧)出现。For example, when the value of the top_field_first indication bit is 1, it may indicate that the top field image data in the image corresponding to the field image data appears in the video code stream before the bottom field image data, that is, the video frame and the video frame are the same. The order in which video frames appear in the video stream is that the video frame containing the bottom field image data precedes the homologous video frame of the video frame in the video stream (ie, the view containing the top field image data) Frequency frame) appears.
例如当top_field_first指示位的取值为0时,可指示该场图像数据对应图像中的顶场图像数据在视频码流中后于底场图像数据出现,即视频帧和该视频帧的同源视频帧在视频码流中出现的后后顺序为,包含顶场图像数据的视频帧在视频码流中先于该视频帧的同源视频帧(即包含底场图像数据的视频帧)出现。For example, when the value of the top_field_first indication bit is 0, it may be indicated that the top field image data in the corresponding image data of the field image appears in the video code stream and then appears in the bottom field image data, that is, the video frame and the homologous video of the video frame. The order in which the frames appear in the video stream is that the video frame containing the top field image data appears in the video stream prior to the homologous video frame of the video frame (ie, the video frame containing the bottom field image data).
其中,通过扩展语法元素top_field_first指示位的指示含义,有利于视频解码装置明确获知所解码输出的每一场图像数据与相邻场图像数据如何进行交融以得到交融图像。其中,top_field_first指示位可看着上述实施例中的第二指示参数的一种具体实现。Wherein, by extending the indication meaning of the syntax element top_field_first indicating bit, it is advantageous for the video decoding device to know clearly how each field image data of the decoded output and the adjacent field image data are blended to obtain a blended image. The top_field_first indication bit can be seen in a specific implementation of the second indication parameter in the above embodiment.
下面通过一些具体例子,来举例说明语法元素progressive_frame指示位和top_field_first指示位的一些使用方式。The following uses some specific examples to illustrate some ways of using the syntax element progressive_frame indicator bit and the top_field_first indicator bit.
下面先结合视频编码方法进行举例。The following is an example of combining video coding methods.
本发明实施例还提供一种视频编码方法,可包括:获取图像P1,对上述图像P1的顶场图像数据进行视频编码以得到第一视频编码帧。对上述图像P1的底场图像数据进行视频编码以得到第二视频编码帧。将上述第一视频编码帧和上述第二视频编码帧写入视频码流。其中,上述第一视频编码帧包含第一场编码指示(第一场编码指示例如可包含于上述第一视频编码帧的帧头和/或其他位置),第一场编码指示包括progressive_frame指示位和top_field_first指示位,其中,progressive_frame指示位的取值为2(即该progressive_frame指示位指示上述第一视频编码帧为单场图像数据对应的视频编码帧,且还可指示上述第一视频编码帧包含的单场图像数据为顶场图像数据)。top_field_first指示位的取值为1(即top_field_first指示位指示在视频码流中第一视频编码帧先于第二视频编码帧出现)。其中,上述第二视频编码帧包含第二场编码指示(第二场编码指示例如可包含于上述第二视频编码帧的帧头和/或其他位置),第二场编码指示包括progressive_frame指示位和top_field_first指示位,其中,第二场编码指示包含的progressive_frame指示位的取值为3(即第二场编码指示包含的progressive_frame指示位指示上述第二视频编码帧为单场图像数据对应的视频编码帧,并且第二场编码指示包含的progressive_frame指示位还可指示上述第二视频编码帧包含的单场图像数据 为底场图像数据)。其中,第二场编码指示包含的top_field_first指示位的取值为1(即top_field_first指示位指示在视频码流中第一视频编码帧先于第二视频编码帧出现)。The embodiment of the present invention further provides a video encoding method, which may include: acquiring an image P1, and performing video encoding on the top field image data of the image P1 to obtain a first video encoding frame. The bottom field image data of the image P1 described above is video encoded to obtain a second video encoded frame. The first video encoded frame and the second video encoded frame are written to the video bitstream. The first video coding frame includes a first field coding indication (the first field coding indication may be included, for example, in a frame header and/or other positions of the first video coding frame), where the first field coding indication includes a progressive_frame indicator bit and The top_field_first indicator bit, wherein the progressive_frame indicator bit has a value of 2 (ie, the progressive_frame indicator bit indicates that the first video coded frame is a video coded frame corresponding to single field image data, and may also indicate that the first video coded frame is included. The single field image data is the top field image data). The top_field_first indicates that the bit has a value of 1 (ie, the top_field_first indicator bit indicates that the first video encoded frame appears in the video bitstream before the second video encoded frame). The second video coding frame includes a second field coding indication (the second field coding indication may be included, for example, in a frame header and/or other location of the second video coding frame), and the second field coding indication includes a progressive_frame indicator bit and The top_field_first indicator bit, wherein the second field coding indication includes a value of 3 for the progressive_frame indicator bit (ie, the progressive field_frame indicated by the second field coding indication indicates that the second video coding frame is a video coding frame corresponding to single field image data. And the second field coding indication includes a progressive_frame indicator bit, which may also indicate the single field image data included in the second video coding frame. For bottom field image data). The second field coding indication includes a value of 1 for the top_field_first indication bit (ie, the top_field_first indication bit indicates that the first video coding frame appears in the video bitstream before the second video coding frame).
本发明实施例还提供一种视频编码方法,可包括:获取图像P2,对上述图像P2的顶场图像数据进行视频编码以得到第一视频编码帧。对上述图像P2的底场图像数据进行视频编码以得到第二视频编码帧。将上述第一视频编码帧和上述第二视频编码帧写入视频码流。其中,上述第一视频编码帧包含第一场编码指示(第一场编码指示例如可包含于上述第一视频编码帧的帧头和/或其他位置),第一场编码指示包括progressive_frame指示位和top_field_first指示位,其中,progressive_frame指示位的取值为2(即该progressive_frame指示位指示上述第一视频编码帧为单场图像数据对应的视频编码帧,且还可指示上述第一视频编码帧包含的单场图像数据为顶场图像数据)。top_field_first指示位的取值为0(即top_field_first指示位指示在视频码流中第一视频编码帧后于第二视频编码帧出现)。其中,上述第二视频编码帧包含第二场编码指示(第二场编码指示例如可包含于上述第二视频编码帧的帧头和/或其他位置),第二场编码指示包括progressive_frame指示位和top_field_first指示位,其中,第二场编码指示包含的progressive_frame指示位的取值为3(即第二场编码指示包含的progressive_frame指示位指示上述第二视频编码帧为单场图像数据对应的视频编码帧,且第二场编码指示包含的progressive_frame指示位还可指示上述第二视频编码帧包含的单场图像数据为底场图像数据)。第二场编码指示包含的top_field_first指示位的取值为0(即top_field_first指示位指示在视频码流中第一视频编码帧后于第二视频编码帧出现)。The embodiment of the present invention further provides a video encoding method, which may include: acquiring an image P2, and performing video encoding on the top field image data of the image P2 to obtain a first video encoding frame. The bottom field image data of the image P2 described above is video encoded to obtain a second video encoded frame. The first video encoded frame and the second video encoded frame are written to the video bitstream. The first video coding frame includes a first field coding indication (the first field coding indication may be included, for example, in a frame header and/or other positions of the first video coding frame), where the first field coding indication includes a progressive_frame indicator bit and The top_field_first indicator bit, wherein the progressive_frame indicator bit has a value of 2 (ie, the progressive_frame indicator bit indicates that the first video coded frame is a video coded frame corresponding to single field image data, and may also indicate that the first video coded frame is included. The single field image data is the top field image data). The top_field_first indicates that the bit has a value of 0 (ie, the top_field_first indicator bit indicates that the second video encoded frame appears after the first video encoded frame in the video bitstream). The second video coding frame includes a second field coding indication (the second field coding indication may be included, for example, in a frame header and/or other location of the second video coding frame), and the second field coding indication includes a progressive_frame indicator bit and The top_field_first indicator bit, wherein the second field coding indication includes a value of 3 for the progressive_frame indicator bit (ie, the progressive field_frame indicated by the second field coding indication indicates that the second video coding frame is a video coding frame corresponding to single field image data. And the second field coding indication includes a progressive_frame indicator bit, which may also indicate that the single field image data included in the second video coding frame is bottom field image data). The second field coding indication includes a value of 0 for the top_field_first indication bit (ie, the top_field_first indication bit indicates that the second video coding frame appears after the first video coding frame in the video bitstream).
可以看出,上述几个举例视频编码方案中,对图像的顶场图像数据和底场图像数据分别进行视频编码以得到第一视频编码帧和第二视频编码帧;将第一视频编码帧和第二视频编码帧写入视频码流。其中,由于第一视频编码帧包含第一场编码指示,第一场编码指示包括progressive_frame指示位和top_field_first指示位,progressive_frame指示位指示上述第一视频编码帧为单场图像数据对应的视频编码帧,且progressive_frame指示位还指示第一视频编码帧包含的单场图像数据为顶场图像数据,且top_field_first指示位指示出 上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。由于利用第一视频编码帧明确的指示出,基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,这有利于视频解码装置明确获知基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,进而有利于视频解码装置正确的将解码得到的同一图像的不同场图像数据进行图像交融。It can be seen that, in the above several example video coding schemes, the top field image data and the bottom field image data of the image are respectively video-encoded to obtain a first video-coded frame and a second video-coded frame; The second video encoded frame is written to the video stream. The first video coding frame includes a progressive_frame indicator bit and a top_field_first indicator bit, and the progressive_frame indicator bit indicates that the first video coding frame is a video coding frame corresponding to single field image data, And the progressive_frame indicator bit further indicates that the single field image data included in the first video encoding frame is top field image data, and the top_field_first indicator bit indicates The sequence of occurrence of the first video encoding frame and the second video encoding frame in the video stream. Since the first video coding frame is explicitly indicated, the sequence of the homologous video coding frames obtained from the image data of different fields of the same image appears in the video code stream, which is advantageous for the video decoding device to know clearly based on the same image. The order in which the homologous video coding frames obtained by the image data of different fields appear in the video code stream further facilitates the video decoding device to correctly image the different field image data of the same image obtained by decoding.
下面先结合视频解码方法进行举例。The following is an example of combining video decoding methods.
假设,对视频码流中的视频解码帧进行解码,解码后输出的场图像数据序列依次如下:bot1,top2,bot3,top4,bot5……。Assume that the video decoded frame in the video stream is decoded, and the field image data sequence output after decoding is as follows: bot1, top2, bot3, top4, bot5.
其中,bot表示底场图像数据、top表示顶场图像数据。其中,bot和top后面的编号(即1、2、3、4、5……)表示码流解码后输出顺序。视频码流中的视频解码帧的progressive_frame指示位的取值为2(即,视频解码帧包含单场图像数据且该单场图像数据为顶场图像数据)或3(即,视频解码帧包含单场图像数据且该单场图像数据为底场图像数据)。并且,所有编码帧的top_field_first指示位的取值为1。在本例子中,由于所有编码帧的top_field_first指示位的取值均为1,因此,码流中所有场图像数据对应的图像中均是顶场图像数据在视频码流中先于底场图像数据出现。因此,根据上述码流结构可知,bot1在top2之前出现,由于语法元素top_field_first指示位指示图像的顶场图像数据始终先于底场顶场图像数据在视频码流中出现,因此,bot1与top2无法在视频解码装置交融成一幅交融图像,bot3后于top2在码流中出现,且bot3和top2的解码后输出顺序相邻,因此,可将top2与bot3交融成一幅图像,同理,top4与bot5交融成一幅图像。其他可以此类推。Among them, bot represents bottom field image data, and top represents top field image data. The numbers following the bot and top (ie 1, 2, 3, 4, 5, ...) indicate the output order after the code stream is decoded. The value of the progressive_frame indicator bit of the video decoding frame in the video code stream is 2 (ie, the video decoding frame contains single field image data and the single field image data is top field image data) or 3 (ie, the video decoding frame contains a single Field image data and the single field image data is bottom field image data). Also, the top_field_first indication bit of all coded frames has a value of one. In this example, since the value of the top_field_first indication bit of all the encoded frames is 1, the image corresponding to all the field image data in the code stream is the top field image data before the bottom field image data in the video code stream. appear. Therefore, according to the above code stream structure, bot1 appears before top2, because the top_field_first indicator bit indicates that the top field image data of the image always appears in the video stream before the bottom field image data, so bot1 and top2 cannot After the video decoding device blends into a blending image, bot3 appears in the code stream in top2, and the decoded output order of bot3 and top2 are adjacent to each other. Therefore, top2 and bot3 can be blended into one image. Similarly, top4 and bot5 Blend into an image. Others can be deduced by analogy.
同理,假设上述码流结构中所有视频解码帧的top_field_first指示位的取值为0,则视频解码装置可将bot1与top2交融成一幅图像,同理,可将bot3与top4交融成一幅图像。其他可以此类推。Similarly, assuming that the top_field_first indicator bit of all video decoding frames in the above code stream structure has a value of 0, the video decoding device can blend bot1 and top2 into one image. Similarly, bot3 and top4 can be blended into one image. Others can be deduced by analogy.
此外,根据progressive_frame与top_field_first语法元素的组合还可以增加场编码时视频解码装置的抗误码能力。In addition, according to the combination of the progressive_frame and the top_field_first syntax elements, the error resistance of the video decoding apparatus at the time of field encoding can be increased.
假设,对视频码流中的视频解码帧进行解码,解码后输出的场图像数据序列依次如下:bot1,top2,top3,bot4,bot5……。视频码流中的视频解码帧的progressive_frame指示位的取值为2(即,视频解码帧包含单场图像数据且该单场图像数据为顶场图像数据)或3(即,视频解码帧包含单场图 像数据且该单场图像数据为底场图像数据)。与前述例子不同的是,视频解码帧对应的top_field_first指示位的取值不尽相同,例如bot1,top2,top3,bot4,bot5……对应的top_field_first指示位的取值依次如下:0,0,1,1,1……。Assume that the video decoded frame in the video stream is decoded, and the field image data sequence output after decoding is as follows: bot1, top2, top3, bot4, bot5. The value of the progressive_frame indicator bit of the video decoding frame in the video code stream is 2 (ie, the video decoding frame contains single field image data and the single field image data is top field image data) or 3 (ie, the video decoding frame contains a single Field map Like data and the single field image data is bottom field image data). Different from the foregoing example, the value of the top_field_first indication bit corresponding to the video decoding frame is not the same. For example, the values of the top_field_first indication bits corresponding to bot1, top2, top3, bot4, bot5, etc. are as follows: 0, 0, 1 , 1, 1, ....
其中,由于bot1和top2对应的top_field_first指示位的取值为0,因此这两场图像数据对应的图像中是顶场图像数据在视频码流中后于底场图像数据出现,因此,视频解码装置可将bot1与top2交融成一幅图像。由于top3和bot4对应的top_field_first指示位的取值为1,因此,这两场图像数据对应的图像中是顶场图像数据在视频码流中先于底场图像数据出现,视频解码装置可将top3和bot4交融成一幅图像。其他可以此类推。此时可以认为该段视频码流没有发生图像丢失或传输错误。Wherein, since the value of the top_field_first indication bit corresponding to bot1 and top2 is 0, the image corresponding to the two field image data is the top field image data appearing in the video code stream and then appearing in the bottom field image data, therefore, the video decoding device You can blend bot1 and top2 into one image. Since the value of the top_field_first indication bit corresponding to top3 and bot4 is 1, the top field image data in the image corresponding to the two image data appears before the bottom field image data in the video code stream, and the video decoding device can top3 Blend into an image with bot4. Others can be deduced by analogy. At this point, it can be considered that there is no image loss or transmission error in the video stream.
又假设,对视频码流中的视频解码帧进行解码,解码后输出的场图像数据序列依次如下:bot1,top2,top3,bot4,bot5……。视频码流中的视频解码帧的progressive_frame指示位的取值为2或3。其中,视频解码帧对应的top_field_first指示位的取值不尽相同,例如bot1,top2,top 3,bot4,top5……对应的top_field_first指示位的取值依次如下:0,0,0,1,1……。It is also assumed that the video decoded frame in the video stream is decoded, and the field image data sequence output after decoding is as follows: bot1, top2, top3, bot4, bot5. The progressive_frame indicator bit of the video decoding frame in the video stream is 2 or 3. The value of the top_field_first indication bit corresponding to the video decoding frame is different. For example, the values of the top_field_first indication bits corresponding to bot1, top2, top 3, bot4, top5, etc. are as follows: 0, 0, 0, 1, 1 ....
由于bot1和top2对应的top_field_first指示位的取值为0,因此这两场图像数据对应的图像中是顶场图像数据在视频码流中后于底场图像数据出现,因此视频解码装置可将bot1与top2交融成一幅图像。由于top3对应的top_field_first指示位的取值为0,因此,这该单场图像数据对应的图像中是顶场图像数据在视频码流中后于底场图像数据出现,而top3之前是紧邻的top2,由于一幅图像不可能包含两个顶场图像数据,由此可以推知,top2和top3之间丢失了一幅底场图像数据,或者视频码流在传输过程中发生误码使得一些top_field_first指示位和/或progressive_frame指示位错误。视频解码装置根据视频码流中视频解码帧包含的progressive_frame指示位和top_field_first指示位等语法元素的取值,判断出视频视频码流出现丢帧或误码情况之后,可按照设定策略决定如何处理丢帧或误码情况。Since the value of the top_field_first indication bit corresponding to bot1 and top2 is 0, the image corresponding to the two field image data is the top field image data appearing in the video code stream and then appearing in the bottom field image data, so the video decoding device can set the bot1. Blend into an image with top2. Since the value of the top_field_first indication bit corresponding to top3 is 0, the top field image data in the image corresponding to the single field image data appears in the video code stream and then appears in the bottom field image data, and top3 is immediately adjacent to top2. Since an image cannot contain two top field image data, it can be inferred that a bottom field image data is lost between top2 and top3, or a bit error occurs in the video code stream during transmission so that some top_field_first indicator bits are displayed. And/or progressive_frame indicates a bit error. The video decoding device determines, according to the setting strategy, how to handle the frame loss or the error condition of the video and video code stream according to the value of the syntax element such as the progressive_frame indicator bit and the top_field_first indicator bit included in the video decoding frame in the video code stream. Frame loss or bit error.
下面简单介绍一下对视频编码装置的视频压缩方法。视频压缩方法可包括帧内压缩和帧间压缩,视频编码装置现在多采用基于运动估计的帧间压缩方法。例如,视频编码装置采用帧间压缩方法对图像压缩并编码的过程可包 括:视频编码装置将待编码图像块划分成若干个大小相等的子图像块,然后针对每个子图像块,在参考图像中搜索与当前子图像块最匹配的图像块作为预测块,然后将该子图像块与预测块的相应像素值相减得到残差,将该残差经变换与量化后得到的值进行熵编码,最后将熵编码得到的比特流和运动矢量信息等编码数据编码。相应的,视频解码装置首先获得熵编码比特流后进行熵解码得到相应的残差、以及相应的运动矢量信息等编码数据;然后根据运动矢量信息在参考图像中获得相应的匹配图像块(即上述预测块),再根据匹配图像块中各像素点的值和残差值中对应像素点的值相加得到当前子图像块中各像素点的值。帧内预测是指利用本幅图像内的信息对图像块进行预测得到预测块,视频编码装置根据预测模式、预测方向、当前图像块周围的像素值得到预测块对应的像素,将当前图像块像素与预测块像素相减得到残差,残差经变换、量化和熵编码后写入码流中;视频解码装置解析码流,对码流进行熵解码、反量化、反变换后得到残差块,视频解码装置根据预测模式、预测方向和图像块周围的像素值得到预测块,将残差块像素与预测块像素相加得到重构图像块。The following briefly introduces the video compression method for the video encoding device. The video compression method may include intra-frame compression and inter-frame compression, and the video encoding apparatus now adopts an inter-frame compression method based on motion estimation. For example, the video encoding apparatus compresses and encodes an image by using an interframe compression method. The video encoding device divides the image block to be encoded into a plurality of equal-sized sub-image blocks, and then for each sub-image block, searches the reference image for the image block that best matches the current sub-image block as the prediction block, and then The sub-image block is subtracted from the corresponding pixel value of the prediction block to obtain a residual, and the value obtained by transforming and quantizing the residual is entropy encoded, and finally the encoded data such as the bit stream and the motion vector information obtained by entropy coding is encoded. Correspondingly, the video decoding device first obtains an entropy encoded bit stream, performs entropy decoding to obtain a corresponding residual, and corresponding motion vector information and the like encoded data; and then obtains a corresponding matching image block in the reference image according to the motion vector information (ie, the above The prediction block is further added according to the value of each pixel in the matching image block and the value of the corresponding pixel in the residual value to obtain the value of each pixel in the current sub-image block. Intra prediction refers to predicting a block by using the information in the image to obtain a prediction block, and the video encoding device obtains a pixel corresponding to the prediction block according to the prediction mode, the prediction direction, and the pixel value around the current image block, and the current image block pixel The residual is subtracted from the prediction block pixel, and the residual is transformed into the code stream after being transformed, quantized, and entropy encoded; the video decoding device parses the code stream, and performs entropy decoding, inverse quantization, and inverse transformation on the code stream to obtain a residual block. The video decoding device obtains a prediction block according to the prediction mode, the prediction direction, and the pixel values around the image block, and adds the residual block pixel to the prediction block pixel to obtain a reconstructed image block.
帧间预测编码主要是用于消除视频序列在时间上的冗余性,其具体处理过程主要包括:当视频编码装置编码当前图像中的某一个图像块时,在该图像块的所有参考帧中进行搜索,分别在每一个参考帧中获得一个与该图像块对应的预测块,并根据获取到的一组预测块对该图像块进行编码处理。为了提高帧间预测编码的效率,帧间预测图像还可以进一步细分为前向帧间预测图像,即视频编解码技术中俗称的P帧,以及双向帧间预测图像,即视频编解码技术中俗称的B帧。其中,前项帧间预测图像使用当前待编解码图像之前的图像进行编解码操作,双向帧间预测图像使用当前待编解码图像之前及之后的图像进行编解码操作。由于双向帧间预测图像需要使用当前待编解码图像之后的图像进行编解码操作,在待编解码双向帧间预测图像之前需要先编解码该双向帧间预测图像之后的图像。Inter-prediction coding is mainly used to eliminate the redundancy of video sequences in time. The specific processing process mainly includes: when the video encoding device encodes one image block in the current image, in all reference frames of the image block. A search is performed to obtain a prediction block corresponding to the image block in each reference frame, and the image block is encoded according to the acquired set of prediction blocks. In order to improve the efficiency of inter-prediction coding, the inter-predicted image can be further subdivided into a forward inter-frame prediction image, which is commonly known as P-frame in video coding and decoding technology, and a bi-directional inter-frame prediction image, that is, in video coding and decoding technology. Commonly known as B frames. The pre-interframe predictive image is encoded and decoded using the image before the current image to be encoded, and the bi-directional inter-predicted image is encoded and decoded using the image before and after the current image to be encoded. Since the bidirectional inter-predicted image needs to be coded and operated using the image after the current image to be coded, the image after the bi-directional inter-predicted image needs to be decoded and decoded before the bi-directional inter-frame prediction image is to be coded.
由于双向帧间预测图像使用了当前图像之前及之后的编码信息,双向帧间预测图像相比于前向帧间预测图像可以提高编码效率。为了进一步提高双向帧间预测图像的编码效率,层次B帧(Hierarchical B)技术应用于双向帧间预测图像的编解码。其中,在层级B帧技术中,双向帧间预测图像亦可作为参考图像使用。不同层次的B帧具有不同的优先级,优先级高的B帧可作 为优先级低的B帧的参考帧。上述B帧的优先级可通过一些语法元素用于标识。Since the bidirectional inter-predicted image uses the encoding information before and after the current image, the bi-directional inter-predicted image can improve the encoding efficiency compared to the forward inter-frame predicted image. In order to further improve the coding efficiency of the bidirectional inter-predicted image, the Hierarchical B technique is applied to the coding and decoding of the bi-directional inter-predicted image. Among them, in the hierarchical B frame technology, the bidirectional inter prediction image can also be used as a reference image. Different levels of B frames have different priorities, and B frames with higher priority can be used. A reference frame for a B frame with a lower priority. The priority of the above B frame can be used for identification by some syntax elements.
为便于更好的理解和实施本发明实施的上述技术方案,下面还提供用于实施上述方案的相关装置。In order to facilitate a better understanding and implementation of the above technical solutions of the implementation of the present invention, related devices for implementing the above solutions are also provided below.
参见图3,本发明实施提供的一种视频编码装置,可包括:Referring to FIG. 3, a video encoding apparatus provided by an implementation of the present invention may include:
获取单元310,用于获取图像。The acquiring unit 310 is configured to acquire an image.
编码单元320,用于对上述图像的第一场图像数据进行视频编码以得到第一视频编码帧;对上述图像的第二场图像数据进行视频编码以得到第二视频编码帧。The encoding unit 320 is configured to perform video encoding on the first field image data of the image to obtain a first video encoding frame, and perform video encoding on the second field image data of the image to obtain a second video encoding frame.
写入单元330,用于将上述第一视频编码帧和上述第二视频编码帧写入视频码流。The writing unit 330 is configured to write the first video encoding frame and the second video encoding frame into the video code stream.
其中,上述第一视频编码帧包含第一场编码指示,上述第一场编码指示指示上述第一视频编码帧为单场图像数据对应的视频编码帧,上述第一场编码指示还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,上述第一场编码指示还指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。The first video coding frame includes a first field coding indication, and the first field coding indication indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first field coding indication further indicates the first The single field image data included in the video encoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video encoding frame and the second video encoding frame appear in the video stream. In order.
其中,上述第一场图像数据为顶场图像数据,且上述第二场图像数据为底场图像数据,或者上述第二场图像数据为顶场图像数据,且上述第一场图像数据为底场图像数据。The first field image data is top field image data, and the second field image data is bottom field image data, or the second field image data is top field image data, and the first field image data is a bottom field. Image data.
在本发明的一些可能的实施方式中,上述第一场编码指示可包含第一指示参数和第二指示参数。其中,上述第一指示参数指示上述第一视频编码帧为单场图像数据对应的视频编码帧(即,第一指示参数可指示上述第一视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),上述第一指示参数还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第一视频编码帧,则第一指示参数指示上述第一视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第一视频编码帧,则第一指示参数指示上述第一视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺 序。例如,若上述视频码流中上述第一视频编码帧先于上述第二视频编码帧出现,则第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧先于上述第二视频编码帧出现。反之,若上述视频码流中上述第一视频编码帧后于上述第二视频编码帧出现,则第二指示参数可指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧后于上述第二视频编码帧出现。In some possible implementation manners of the present invention, the first field coding indication may include a first indication parameter and a second indication parameter. The first indication parameter indicates that the first video encoding frame is a video encoding frame corresponding to single field image data (ie, the first indication parameter may indicate that the first video encoding frame includes a single field image data of an image, and The first indicator parameter further includes the single field image data included in the first video encoding frame as the top field image data or the bottom field image data (for example, assuming that the image is the same for the two fields of image data) The top field image data is video-encoded to obtain a first video-coded frame, and the first indication parameter indicates that the single-field image data included in the first video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed. The video encoding is performed to obtain a first video encoding frame, and the first indication parameter indicates that the single field image data included in the first video encoding frame is bottom field image data). The second indication parameter indicates that the first video encoding frame and the second video encoding frame appear in the video stream. sequence. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the second indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video coding frame appears before the second video coding frame. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the second indication parameter may indicate that the first video encoding frame and the second video encoding frame are in the video stream. The sequence of occurrences occurs after the first video encoding frame is followed by the second video encoding frame.
在本发明的另一些可能的实施方式中,上述第一场编码指示例如可包含第三指示参数、第四指示参数和第二指示参数。其中,上述第三指示参数可指示上述第一视频编码帧为单场图像数据对应的视频编码帧(即,第三指示参数可指示上述第一视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据)。上述第四指示参数可指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第一视频编码帧,则第四指示参数指示上述第一视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第一视频编码帧,则第四指示参数指示上述第一视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。In other possible implementation manners of the present invention, the first field coding indication may include, for example, a third indication parameter, a fourth indication parameter, and a second indication parameter. The third indication parameter may indicate that the first video coding frame is a video coding frame corresponding to single field image data (ie, the third indication parameter may indicate that the first video coding frame includes a single field image data of an image, Two image data without an image). The fourth indication parameter may indicate that the single field image data included in the first video encoding frame is top field image data or bottom field image data (eg, it is assumed that video encoding the top field image data of the image to obtain the first video) Encoding the frame, the fourth indication parameter indicating that the single field image data included in the first video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain the first video encoding frame, The four indication parameter indicates that the single field image data included in the first video encoding frame is bottom field image data). The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
其中,第一指示参数例如可包括至少两个比特,其中,第一指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第二指示参数例如包括至少1个比特。第二指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The first indication parameter may include, for example, at least two bits, wherein the first indication parameter may be, for example, a parameter progressive_frame indicator bit or a picture_structure indicator bit or other extension indicator bit. The second indication parameter includes, for example, at least 1 bit. The second indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
在本发明的一些实施例中,上述第二视频编码帧包含第二场编码指示,上述第二场编码指示指示上述第二视频编码帧为单场图像数据对应的视频编码帧,上述第二场编码指示还指示上述第二视频编码帧包含的单场图像数据为底场图像数据或者顶场图像数据,上述第二场编码指示还指示出上述第二视频编码帧和上述第一视频编码帧在上述视频码流中出现的先后顺序。In some embodiments of the present invention, the second video coding frame includes a second field coding indication, where the second field coding indication indicates that the second video coding frame is a video coding frame corresponding to single field image data, and the second field The encoding indication further indicates that the single field image data included in the second video encoding frame is bottom field image data or top field image data, and the second field encoding indication further indicates that the second video encoding frame and the first video encoding frame are The order in which the above video streams appear.
在本发明的一些可能的实施方式中,上述第二场编码指示可包含第五指 示参数和第五指示参数。其中,上述第五指示参数指示上述第二视频编码帧为单场图像数据对应的视频编码帧(即,第五指示参数可指示上述第二视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),上述第五指示参数还指示上述第二视频编码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第二视频编码帧,则第五指示参数指示上述第二视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第二视频编码帧,则第五指示参数指示上述第二视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第六指示参数指示出上述第二视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。例如,若上述视频码流中上述第一视频编码帧先于上述第二视频编码帧出现,则第六指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧先于上述第二视频编码帧出现。反之,若上述视频码流中上述第一视频编码帧后于上述第二视频编码帧出现,则第六指示参数可指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧后于上述第二视频编码帧出现。In some possible implementation manners of the present invention, the second field coding indication may include a fifth finger Show parameters and fifth indication parameters. The fifth indication parameter indicates that the second video coding frame is a video coding frame corresponding to single field image data (that is, the fifth indication parameter may indicate that the second video coding frame includes a single field image data of an image, and The second indication parameter does not include an image, and the fifth indication parameter further indicates that the single field image data included in the second video coding frame is top field image data or bottom field image data (for example, assuming that the image is The top field image data is video-encoded to obtain a second video-coded frame, and the fifth indication parameter indicates that the single-field image data included in the second video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed. Video encoding to obtain a second video encoding frame, the fifth indication parameter indicating that the single field image data included in the second video encoding frame is bottom field image data). The sixth indication parameter indicates a sequence in which the second video coding frame and the second video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the sixth indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video coding frame appears before the second video coding frame. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the sixth indication parameter may indicate that the first video encoding frame and the second video encoding frame are in the video stream. The sequence of occurrences occurs after the first video encoding frame is followed by the second video encoding frame.
在本发明的另一些可能的实施方式中,上述第二场编码指示例如可包含第七指示参数、第八指示参数和第六指示参数。其中,上述第七指示参数可指示上述第二视频编码帧为单场图像数据对应的视频编码帧(即,第七指示参数可指示上述第二视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据)。上述第八指示参数可指示上述第二视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第二视频编码帧,则第八指示参数指示上述第二视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第二视频编码帧,则第八指示参数指示上述第二视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第六指示参数指示出上述第二视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。In other possible implementation manners of the present invention, the foregoing second field coding indication may include, for example, a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter. The seventh indication parameter may indicate that the second video coding frame is a video coding frame corresponding to single field image data (that is, the seventh indication parameter may indicate that the second video coding frame includes a single field image data of an image, Two image data without an image). The eighth indication parameter may indicate that the single field image data included in the second video coding frame is top field image data or bottom field image data (eg, assuming that the top field image data of the image is video encoded to obtain a second video) Encoding the frame, the eighth indication parameter indicating that the single field image data included in the second video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain a second video encoding frame, The eight indication parameter indicates that the single field image data included in the second video encoding frame is bottom field image data). The sixth indication parameter indicates a sequence in which the second video coding frame and the second video coding frame appear in the video code stream.
其中,第五指示参数例如可包括至少两个比特,其中,第五指示参数例 如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第六指示参数例如包括至少1个比特。第六指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter example For example, the parameter progressive line frame (progressive_frame) indicator bit or picture structure (picture_structure) indicator bit or other extended indicator bit. The sixth indication parameter includes, for example, at least 1 bit. The sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
可以理解的是,本实施例的视频编码装置300的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。视频编码装置300可为任何需要输出、存储视频的装置,如笔记本电脑,平板电脑、个人电脑、手机等设备。It is to be understood that the functions of the functional modules of the video encoding apparatus 300 of this embodiment may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, reference may be made to the related description of the foregoing method embodiments, and details are not described herein again. . The video encoding device 300 can be any device that needs to output and store video, such as a notebook computer, a tablet computer, a personal computer, a mobile phone, and the like.
可以看出,本实施例的视频编码装置300对图像的第一场图像数据和第二场图像数据分别进行视频编码以得到第一视频编码帧和第二视频编码帧;将第一视频编码帧和第二视频编码帧写入视频码流。其中,由于第一视频编码帧包含第一场编码指示,上述第一场编码指示指示上述第一视频编码帧为单场图像数据对应的视频编码帧,且上述第一场编码指示还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,且第一场编码指示还指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。其中,由于利用第一视频编码帧明确的指示出,基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,这有利于视频解码装置明确获知基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,进而有利于视频解码装置正确的将解码得到的同一图像的不同场图像数据进行图像交融。It can be seen that the video encoding apparatus 300 of the embodiment separately performs video encoding on the first field image data and the second field image data of the image to obtain the first video encoding frame and the second video encoding frame; and the first video encoding frame. And writing a video stream to the second video encoded frame. The first field coding instruction indicates that the first video coding frame is a video coding frame corresponding to the single field image data, and the first field coding indication further indicates the foregoing. The single field image data included in a video encoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video encoding frame and the second video encoding frame appear in the video stream. The order of precedence. Wherein, because the first video coding frame is explicitly indicated, the sequence of the homologous video coding frames obtained from the image data of different fields of the same image appears in the video code stream, which is beneficial for the video decoding device to know clearly based on the same The sequence of the homologous video coding frames obtained by the image data of different fields of the image appears in the video code stream, thereby facilitating the video decoding device to correctly image the different field image data of the same image obtained by decoding.
参见图4,本发明实施例还提供一种视频解码装置400,可包括:解码单元410和交融单元420。Referring to FIG. 4, an embodiment of the present invention further provides a video decoding apparatus 400, which may include: a decoding unit 410 and an aforesaid unit 420.
其中,解码单元410,用于对视频码流中的第一视频解码帧进行视频解码以得到第一图像解码数据;对上述视频码流中的第二视频解码帧进行视频解码以得到第二图像解码数据。其中,上述第一视频解码帧包含第一场编码指示,上述第一场编码指示指示出第一视频解码帧为单场图像数据对应的视频解码帧,并且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且上述第一场编码指示还指示上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频 码流中的出现顺序;其中,上述第一视频解码帧和上述同源视频解码帧基于同一图像的不同场的图像数据得到。The decoding unit 410 is configured to perform video decoding on the first video decoding frame in the video code stream to obtain first image decoding data, and perform video decoding on the second video decoding frame in the video code stream to obtain a second image. Decode the data. The first video decoding frame includes a first field coding indication, where the first field coding indication indicates that the first video decoding frame is a video decoding frame corresponding to single field image data, and the first field coding indication further indicates the foregoing The single field image data included in a video decoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video decoding frame and the homologous video decoding frame of the first video decoding frame are Above video An order of appearance in the code stream; wherein the first video decoded frame and the homologous video decoded frame are obtained based on image data of different fields of the same image.
交融单元420,用于根据上述第一场编码指示将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。The blending unit 420 is configured to blend the first image decoded data and the second image decoded data according to the first field encoding instruction to obtain a blended image.
在本发明一些可能的实施方式中,上述第一场编码指示可包含第一指示参数和第二指示参数;其中,上述第一指示参数指示可指示出第一视频解码帧为单场图像数据对应的视频解码帧(即,第一指示参数可指示上述第一视频解码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),并且上述第一指示参数还可以指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第一视频解码帧包含的单场图像数据为顶场图像数据,则第一指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,上述第一视频解码帧包含的单场图像数据为底场图像数据,则第一指示参数指示上述第一视频解码帧包含的单场图像数据为底场图像数据)。上述第二指示参数可指示出上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In some possible implementation manners of the present disclosure, the first field coding indication may include a first indication parameter and a second indication parameter, where the first indication parameter indication may indicate that the first video decoding frame is a single field image data corresponding to Video decoding frame (ie, the first indication parameter may indicate that the first video decoding frame includes one field of image data of one image, and does not include two fields of image data of one image), and the first indication parameter may also be Instructing the single video image data included in the first video decoding frame to be top field image data or bottom field image data (eg, assuming that the single field image data included in the first video decoding frame is top field image data, the first indicator parameter And indicating that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the first indication parameter indicates that the first video decoding frame includes The single field image data is the bottom field image data). The second indication parameter may indicate an order of appearance of the first video decoding frame and the homogenous video decoding frame of the first video decoding frame in the video code stream.
在本发明另一些可能的实施方式中,上述第一场编码指示可包含第三指示参数、第四指示参数和第二指示参数;其中,上述第三指示参数指示出第一视频解码帧为单场图像数据对应的视频解码帧。上述第四指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第一视频解码帧包含的单场图像数据为顶场图像数据,则第四指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,上述第一视频解码帧包含的单场图像数据为底场图像数据,则第四指示参数指示上述第一视频解码帧包含的单场图像数据为底场图像数据)。上述第二指示参数可指示出上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In another possible implementation manner of the present invention, the first field coding indication may include a third indication parameter, a fourth indication parameter, and a second indication parameter, where the third indication parameter indicates that the first video decoding frame is a single The video decoded frame corresponding to the field image data. The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data (for example, assuming that the single field image data included in the first video decoding frame is top field image data, The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the fourth indication parameter indicates the foregoing The single field image data contained in a video decoding frame is bottom field image data). The second indication parameter may indicate an order of appearance of the first video decoding frame and the homogenous video decoding frame of the first video decoding frame in the video code stream.
其中,第一指示参数例如可包括至少两个比特,其中,第一指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第二指示参数例如包括至少1个比特。第二指示参数例如可为顶场在先(top_field_first)指示位或其他扩 展指示位等。The first indication parameter may include, for example, at least two bits, wherein the first indication parameter may be, for example, a parameter progressive_frame indicator bit or a picture_structure indicator bit or other extension indicator bit. The second indication parameter includes, for example, at least 1 bit. The second indication parameter may be, for example, a top field first (top_field_first) indicator bit or other expansion Exhibition indicators, etc.
在本发明的一些可能的实施方式中,上述交融单元具体420可用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第二视频解码帧在上述视频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;In some possible implementation manners of the present invention, the foregoing mixing unit 420 may be configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, after the first a video decoding frame is generated, and the second video decoding frame is displayed in the first video decoding frame in the video stream, and the decoded output sequence of the first image decoding data and the second image decoding data are adjacent to each other. Blending the first image decoded data and the second image decoded data to obtain a blended image;
或者;上述交融单元具体420可以用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第二视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,可将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。Alternatively, the foregoing mixing unit 420 may be configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the foregoing And the second video decoding frame appears in the video code stream before the first video decoding frame, and the decoded output sequence of the first image decoding data and the second image decoded data are adjacent to each other, and the first image decoding data may be Blending with the second image decoded data described above to obtain a blended image.
例如,上述交融单元420可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中先于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为底场图像数据,且上述第二视频解码帧在上述视频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;For example, the foregoing mixing unit 420 may be specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, and then appears in the first video decoding frame, and the foregoing The field coding indication further indicates that the single field image data included in the first video decoding frame is top field image data, and the second field coding indication indicates that the homogenous video decoding frame of the second video decoding frame is in the video stream. And the second video encoding frame is further configured to indicate that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame is in the video stream. And then appearing in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the second image decoding data are blended to obtain a blending image;
或者;or;
上述交融单元420可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中后于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为底场图像数据,且 上述第二视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;The foregoing mixing unit 420 may be specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field The coding indication further indicates that the single field image data included in the first video decoding frame is top field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and And the second video decoding frame is generated in the video code stream before the first video decoding frame, and the first image decoding data and the second image decoding data are sequentially adjacent to the decoded output sequence, and the first image is decoded. The data is blended with the second image decoded data to obtain a blended image;
或者;or;
上述交融单元420可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为底场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中先于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,且上述第二视频解码帧在上述视频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;The foregoing mixing unit 420 may be specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, and then appears in the first video decoding frame, and the first field The coding indication further indicates that the single field image data included in the first video decoding frame is bottom field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame precedes the video code stream. The second video decoding frame is generated, and the second field coding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video code stream. The first video decoding frame appears, and the decoded output order of the first image decoded data and the second image decoded data are adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image;
或者;or;
上述交融单元420可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为底场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中后于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,且上述第二视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。The foregoing mixing unit 420 may be specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field The coding indication further indicates that the single field image data included in the first video decoding frame is bottom field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame precedes the video stream in the video stream. The first video decoded frame appears, and the first image decoded data and the second image decoded data are sequentially adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image.
在本发明一些可能的实施方式中,上述第二场编码指示可包含第五指示参数和第六指示参数;其中,上述第五指示参数指示可指示出第二视频解码帧为单场图像数据对应的视频解码帧(即,第五指示参数可指示上述第二视频解码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),并且上述第五指示参数还可以指示上述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第二视频解码帧包含的单场图像数据为顶场图像数据,则第五指示参数指示上述第二视频解码 帧包含的单场图像数据为顶场图像数据,上述第二视频解码帧包含的单场图像数据为底场图像数据,则第五指示参数指示上述第二视频解码帧包含的单场图像数据为底场图像数据)。上述第六指示参数可指示出上述第二视频解码帧和上述第二视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In some possible implementation manners of the present disclosure, the foregoing second field coding indication may include a fifth indication parameter and a sixth indication parameter, where the fifth indication parameter indication may indicate that the second video decoding frame is a single field image data corresponding to Video decoding frame (ie, the fifth indication parameter may indicate that the second video decoding frame includes one field of image data of one image, and does not include two fields of image data of one image), and the fifth indication parameter may also be Instructing the single video image data included in the second video decoding frame to be top field image data or bottom field image data (for example, assuming that the single field image data included in the second video decoding frame is top field image data, the fifth indicator parameter Indicating the above second video decoding The single field image data included in the frame is top field image data, and the single field image data included in the second video decoding frame is bottom field image data, and the fifth indication parameter indicates that the single field image data included in the second video decoding frame is Bottom field image data). The sixth indication parameter may indicate an order of appearance of the homologous video decoding frame of the second video decoding frame and the second video decoding frame in the video code stream.
在本发明另一些可能的实施方式中,上述第二场编码指示可包含第七指示参数、第八指示参数和第六指示参数;其中,上述第七指示参数指示出第二视频解码帧为单场图像数据对应的视频解码帧。上述第八指示参数指示上述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第二视频解码帧包含的单场图像数据为顶场图像数据,则第八指示参数指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,若上述第二视频解码帧包含的单场图像数据为底场图像数据,则第八指示参数指示上述第二视频解码帧包含的单场图像数据为底场图像数据)。上述第六指示参数可指示出上述第二视频解码帧和上述第二视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In another possible implementation manner of the present invention, the foregoing second field coding indication may include a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter, where the seventh indication parameter indicates that the second video decoding frame is a single The video decoded frame corresponding to the field image data. The eighth indication parameter indicates that the single field image data included in the second video decoding frame is top field image data or bottom field image data (for example, assuming that the single field image data included in the second video decoding frame is top field image data, The eighth indication parameter indicates that the single field image data included in the second video decoding frame is top field image data, and if the single field image data included in the second video decoding frame is bottom field image data, the eighth indication parameter indicates the above. The single field image data included in the second video decoding frame is bottom field image data). The sixth indication parameter may indicate an order of appearance of the homologous video decoding frame of the second video decoding frame and the second video decoding frame in the video code stream.
其中,第五指示参数例如可包括至少两个比特,其中,第五指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第六指示参数例如包括至少1个比特。第六指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter may be, for example, a parameter progressive_frame indication bit or a picture structure (picture_structure) indication bit or other extended indication bit. The sixth indication parameter includes, for example, at least 1 bit. The sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
可以理解的是,本实施例的视频解码装置400的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。视频解码装置400可为任何需要输出、播放视频的装置,如笔记本电脑,平板电脑、个人电脑、手机等设备。It is to be understood that the functions of the functional modules of the video decoding apparatus 400 of this embodiment may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, reference may be made to the related description of the foregoing method embodiments, and details are not described herein again. . The video decoding device 400 can be any device that needs to output and play video, such as a notebook computer, a tablet computer, a personal computer, a mobile phone, and the like.
可以看出,本实施例的视频解码装置400在对视频码流中的第一视频解码帧和第二视频解码帧进行视频解码以得到第一图像解码数据和第二图像解码数据之后,由于是根据第一视频解码帧包含的第一场编码指示的指示,及第二视频解码帧与上述第一视频解码帧在上述视频码流中的出现顺序,及第一图像解码数据和上述第二图像解码数据的解码后输出顺序,来确定是否将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。 其中,由于第一视频解码帧明确的指示出,第一视频解码帧和其同源视频解码帧在视频码流中出现的先后顺序,这有利于视频解码装置明确获知基于同一图像的不同场的图像数据得到的同源视频解码帧在视频码流中出现的先后顺序,进而有利于视频解码装置正确的将解码得到的同一图像的不同场图像数据进行图像交融。It can be seen that the video decoding apparatus 400 of this embodiment performs video decoding on the first video decoding frame and the second video decoding frame in the video code stream to obtain the first image decoding data and the second image decoding data, since And an indication of the first field coding indication included in the first video decoding frame, and an appearance order of the second video decoding frame and the first video decoding frame in the video code stream, and the first image decoding data and the second image. Decoding the output order of the data to determine whether to blend the first image decoded data and the second image decoded data to obtain a blended image. Wherein, since the first video decoding frame explicitly indicates the sequence in which the first video decoding frame and the homologous video decoding frame appear in the video code stream, this is advantageous for the video decoding device to explicitly know different fields based on the same image. The order in which the homologous video decoded frames obtained by the image data appear in the video code stream further facilitates the video decoding device to correctly image the different field image data of the same image obtained by decoding.
参见图5,图5为本发明实施例提供的视频编码装置500的示意图,视频编码装置500可包括至少一个总线501、与总线501相连的至少一个处理器502以及与总线501相连的至少一个存储器503。Referring to FIG. 5, FIG. 5 is a schematic diagram of a video encoding apparatus 500 according to an embodiment of the present invention. The video encoding apparatus 500 may include at least one bus 501, at least one processor 502 connected to the bus 501, and at least one memory connected to the bus 501. 503.
其中,处理器502通过总线501,调用存储器503中存储的代码以用于获取图像;对上述图像的第一场图像数据进行视频编码以得到第一视频编码帧;对上述图像的第二场图像数据进行视频编码以得到第二视频编码帧;将上述第一视频编码帧和上述第二视频编码帧写入视频码流。Wherein, the processor 502 calls the code stored in the memory 503 via the bus 501 for acquiring an image; the first field image data of the image is video-encoded to obtain a first video-encoded frame; and the second field image of the image is The data is video encoded to obtain a second video encoded frame; the first video encoded frame and the second video encoded frame are written to the video stream.
其中,上述第一视频编码帧包含第一场编码指示,上述第一场编码指示指示上述第一视频编码帧为单场图像数据对应的视频编码帧,上述第一场编码指示还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,上述第一场编码指示还指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。The first video coding frame includes a first field coding indication, and the first field coding indication indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first field coding indication further indicates the first The single field image data included in the video encoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video encoding frame and the second video encoding frame appear in the video stream. In order.
其中,上述第一场图像数据为顶场图像数据,且上述第二场图像数据为底场图像数据,或者上述第二场图像数据为顶场图像数据,且上述第一场图像数据为底场图像数据。The first field image data is top field image data, and the second field image data is bottom field image data, or the second field image data is top field image data, and the first field image data is a bottom field. Image data.
在本发明的一些可能的实施方式中,上述第一场编码指示可包含第一指示参数和第二指示参数。其中,上述第一指示参数指示上述第一视频编码帧为单场图像数据对应的视频编码帧(即,第一指示参数可指示上述第一视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),上述第一指示参数还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第一视频编码帧,则第一指示参数指示上述第一视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第一视频编码帧,则第一指示参数指示上述第一视频编码帧 包含的单场图像数据为底场图像数据)。其中,上述第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。例如,若上述视频码流中上述第一视频编码帧先于上述第二视频编码帧出现,则第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧先于上述第二视频编码帧出现。反之,若上述视频码流中上述第一视频编码帧后于上述第二视频编码帧出现,则第二指示参数可指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧后于上述第二视频编码帧出现。In some possible implementation manners of the present invention, the first field coding indication may include a first indication parameter and a second indication parameter. The first indication parameter indicates that the first video encoding frame is a video encoding frame corresponding to single field image data (ie, the first indication parameter may indicate that the first video encoding frame includes a single field image data of an image, and The first indicator parameter further includes the single field image data included in the first video encoding frame as the top field image data or the bottom field image data (for example, assuming that the image is the same for the two fields of image data) The top field image data is video-encoded to obtain a first video-coded frame, and the first indication parameter indicates that the single-field image data included in the first video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed. Video coding to obtain a first video coding frame, where the first indication parameter indicates the first video coding frame The included single field image data is bottom field image data). The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the second indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video coding frame appears before the second video coding frame. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the second indication parameter may indicate that the first video encoding frame and the second video encoding frame are in the video stream. The sequence of occurrences occurs after the first video encoding frame is followed by the second video encoding frame.
在本发明的另一些可能的实施方式中,上述第一场编码指示例如可包含第三指示参数、第四指示参数和第二指示参数。其中,上述第三指示参数可指示上述第一视频编码帧为单场图像数据对应的视频编码帧(即,第三指示参数可指示上述第一视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据)。上述第四指示参数可指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第一视频编码帧,则第四指示参数指示上述第一视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第一视频编码帧,则第四指示参数指示上述第一视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。In other possible implementation manners of the present invention, the first field coding indication may include, for example, a third indication parameter, a fourth indication parameter, and a second indication parameter. The third indication parameter may indicate that the first video coding frame is a video coding frame corresponding to single field image data (ie, the third indication parameter may indicate that the first video coding frame includes a single field image data of an image, Two image data without an image). The fourth indication parameter may indicate that the single field image data included in the first video encoding frame is top field image data or bottom field image data (eg, it is assumed that video encoding the top field image data of the image to obtain the first video) Encoding the frame, the fourth indication parameter indicating that the single field image data included in the first video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain the first video encoding frame, The four indication parameter indicates that the single field image data included in the first video encoding frame is bottom field image data). The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
其中,第一指示参数例如可包括至少两个比特,其中,第一指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第二指示参数例如包括至少1个比特。第二指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The first indication parameter may include, for example, at least two bits, wherein the first indication parameter may be, for example, a parameter progressive_frame indicator bit or a picture_structure indicator bit or other extension indicator bit. The second indication parameter includes, for example, at least 1 bit. The second indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
在本发明的一些实施例中,上述第二视频编码帧包含第二场编码指示,上述第二场编码指示指示上述第二视频编码帧为单场图像数据对应的视频编码帧,上述第二场编码指示还指示上述第二视频编码帧包含的单场图像数据为底场图像数据或者顶场图像数据,上述第二场编码指示还指示出上述第 二视频编码帧和上述第一视频编码帧在上述视频码流中出现的先后顺序。In some embodiments of the present invention, the second video coding frame includes a second field coding indication, where the second field coding indication indicates that the second video coding frame is a video coding frame corresponding to single field image data, and the second field The coding indication further indicates that the single field image data included in the second video coding frame is bottom field image data or top field image data, and the second field coding indication further indicates the foregoing The order in which the two video encoded frames and the first video encoded frames appear in the video stream.
在本发明的一些可能的实施方式中,上述第二场编码指示可包含第五指示参数和第五指示参数。其中,上述第五指示参数指示上述第二视频编码帧为单场图像数据对应的视频编码帧(即,第五指示参数可指示上述第二视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),上述第五指示参数还指示上述第二视频编码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第二视频编码帧,则第五指示参数指示上述第二视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第二视频编码帧,则第五指示参数指示上述第二视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第六指示参数指示出上述第二视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。例如,若上述视频码流中上述第一视频编码帧先于上述第二视频编码帧出现,则第六指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧先于上述第二视频编码帧出现。反之,若上述视频码流中上述第一视频编码帧后于上述第二视频编码帧出现,则第六指示参数可指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧后于上述第二视频编码帧出现。In some possible implementation manners of the present invention, the second field coding indication may include a fifth indication parameter and a fifth indication parameter. The fifth indication parameter indicates that the second video coding frame is a video coding frame corresponding to single field image data (that is, the fifth indication parameter may indicate that the second video coding frame includes a single field image data of an image, and The second indication parameter does not include an image, and the fifth indication parameter further indicates that the single field image data included in the second video coding frame is top field image data or bottom field image data (for example, assuming that the image is The top field image data is video-encoded to obtain a second video-coded frame, and the fifth indication parameter indicates that the single-field image data included in the second video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed. Video encoding to obtain a second video encoding frame, the fifth indication parameter indicating that the single field image data included in the second video encoding frame is bottom field image data). The sixth indication parameter indicates a sequence in which the second video coding frame and the second video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the sixth indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video coding frame appears before the second video coding frame. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the sixth indication parameter may indicate that the first video encoding frame and the second video encoding frame are in the video stream. The sequence of occurrences occurs after the first video encoding frame is followed by the second video encoding frame.
在本发明的另一些可能的实施方式中,上述第二场编码指示例如可包含第七指示参数、第八指示参数和第六指示参数。其中,上述第七指示参数可指示上述第二视频编码帧为单场图像数据对应的视频编码帧(即,第七指示参数可指示上述第二视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据)。上述第八指示参数可指示上述第二视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第二视频编码帧,则第八指示参数指示上述第二视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第二视频编码帧,则第八指示参数指示上述第二视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第六指示参数指示出上述第二视频编码帧和上述第二视频编码帧在上 述视频码流中出现的先后顺序。In other possible implementation manners of the present invention, the foregoing second field coding indication may include, for example, a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter. The seventh indication parameter may indicate that the second video coding frame is a video coding frame corresponding to single field image data (that is, the seventh indication parameter may indicate that the second video coding frame includes a single field image data of an image, Two image data without an image). The eighth indication parameter may indicate that the single field image data included in the second video coding frame is top field image data or bottom field image data (eg, assuming that the top field image data of the image is video encoded to obtain a second video) Encoding the frame, the eighth indication parameter indicating that the single field image data included in the second video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain a second video encoding frame, The eight indication parameter indicates that the single field image data included in the second video encoding frame is bottom field image data). The sixth indication parameter indicates that the second video encoding frame and the second video encoding frame are on The order in which the video streams appear.
其中,第五指示参数例如可包括至少两个比特,其中,第五指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第六指示参数例如包括至少1个比特。第六指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter may be, for example, a parameter progressive_frame indication bit or a picture structure (picture_structure) indication bit or other extended indication bit. The sixth indication parameter includes, for example, at least 1 bit. The sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
可以理解的是,本实施例的视频编码装置500的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。视频编码装置500可为任何需要输出、存储视频的装置,如笔记本电脑,平板电脑、个人电脑、手机等设备。It is to be understood that the functions of the functional modules of the video coding apparatus 500 of the present embodiment may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, reference may be made to the related description of the foregoing method embodiments, and details are not described herein again. . The video encoding device 500 can be any device that needs to output and store video, such as a notebook computer, a tablet computer, a personal computer, a mobile phone, and the like.
可以看出,本实施例的视频编码装置500对图像的第一场图像数据和第二场图像数据分别进行视频编码以得到第一视频编码帧和第二视频编码帧;将第一视频编码帧和第二视频编码帧写入视频码流。其中,由于第一视频编码帧包含第一场编码指示,上述第一场编码指示指示上述第一视频编码帧为单场图像数据对应的视频编码帧,且上述第一场编码指示还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,且第一场编码指示还指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。其中,由于利用第一视频编码帧明确的指示出,基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,这有利于视频解码装置明确获知基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,进而有利于视频解码装置正确的将解码得到的同一图像的不同场图像数据进行图像交融。It can be seen that the video encoding apparatus 500 of the embodiment separately performs video encoding on the first field image data and the second field image data of the image to obtain the first video encoding frame and the second video encoding frame; and the first video encoding frame. And writing a video stream to the second video encoded frame. The first field coding instruction indicates that the first video coding frame is a video coding frame corresponding to the single field image data, and the first field coding indication further indicates the foregoing. The single field image data included in a video encoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video encoding frame and the second video encoding frame appear in the video stream. The order of precedence. Wherein, because the first video coding frame is explicitly indicated, the sequence of the homologous video coding frames obtained from the image data of different fields of the same image appears in the video code stream, which is beneficial for the video decoding device to know clearly based on the same The sequence of the homologous video coding frames obtained by the image data of different fields of the image appears in the video code stream, thereby facilitating the video decoding device to correctly image the different field image data of the same image obtained by decoding.
参见图6,图6是本发明的另一实施例提供的视频编码装置600的结构框图。其中,视频编码装置600可以包括:至少1个处理器601,至少1个网络接口604或其他用户接口603,存储器606,至少1个通信总线602。通信总线602用于实现这些组件之间的连接通信。其中,该视频编码装置600可选的可以包含用户接口603,包括显示器(例如,触摸屏、LCD、CRT、全息成像(Holographic)或者投影(Projector)等)、点击设备(例如鼠标、轨迹球(trackball)触感板或触摸屏等)、摄像头和/或拾音装置等。Referring to FIG. 6, FIG. 6 is a structural block diagram of a video encoding apparatus 600 according to another embodiment of the present invention. The video encoding apparatus 600 may include at least one processor 601, at least one network interface 604 or other user interface 603, a memory 606, and at least one communication bus 602. Communication bus 602 is used to implement connection communication between these components. The video encoding device 600 may optionally include a user interface 603, including a display (eg, a touch screen, LCD, CRT, Holographic or Projector, etc.), a pointing device (eg, a mouse, a trackball) ) a touch panel or touch screen, etc.), a camera and/or a sound pickup device, and the like.
其中,存储器602可以包括只读存储器和随机存取存储器,并向处理器 601提供指令和数据。存储器602中的一部分还可以包括非易失性随机存取存储器(NVRAM)。Wherein, the memory 602 can include a read only memory and a random access memory, and 601 provides instructions and data. A portion of memory 602 may also include non-volatile random access memory (NVRAM).
在一些实施方式中,存储器606存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:In some implementations, memory 606 stores the following elements, executable modules or data structures, or a subset thereof, or their extended set:
操作系统6061,包含各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。The operating system 6061 includes various system programs for implementing various basic services and processing hardware-based tasks.
应用程序模块6062,包含各种应用程序,用于实现各种应用业务。The application module 6062 includes various applications for implementing various application services.
在本发明的实施例中,通过调用存储器606存储的程序或指令,处理器601获取图像;对上述图像的第一场图像数据进行视频编码以得到第一视频编码帧;对上述图像的第二场图像数据进行视频编码以得到第二视频编码帧;将上述第一视频编码帧和上述第二视频编码帧写入视频码流。In an embodiment of the present invention, the processor 601 acquires an image by calling a program or instruction stored in the memory 606; video encoding the first field image data of the image to obtain a first video encoding frame; and second to the image The field image data is video encoded to obtain a second video encoded frame; the first video encoded frame and the second video encoded frame are written to the video bitstream.
其中,上述第一视频编码帧包含第一场编码指示,上述第一场编码指示指示上述第一视频编码帧为单场图像数据对应的视频编码帧,上述第一场编码指示还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,上述第一场编码指示还指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。The first video coding frame includes a first field coding indication, and the first field coding indication indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first field coding indication further indicates the first The single field image data included in the video encoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video encoding frame and the second video encoding frame appear in the video stream. In order.
其中,上述第一场图像数据为顶场图像数据,且上述第二场图像数据为底场图像数据,或者上述第二场图像数据为顶场图像数据,且上述第一场图像数据为底场图像数据。The first field image data is top field image data, and the second field image data is bottom field image data, or the second field image data is top field image data, and the first field image data is a bottom field. Image data.
在本发明的一些可能的实施方式中,上述第一场编码指示可包含第一指示参数和第二指示参数。其中,上述第一指示参数指示上述第一视频编码帧为单场图像数据对应的视频编码帧(即,第一指示参数可指示上述第一视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),上述第一指示参数还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第一视频编码帧,则第一指示参数指示上述第一视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第一视频编码帧,则第一指示参数指示上述第一视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺 序。例如,若上述视频码流中上述第一视频编码帧先于上述第二视频编码帧出现,则第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧先于上述第二视频编码帧出现。反之,若上述视频码流中上述第一视频编码帧后于上述第二视频编码帧出现,则第二指示参数可指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧后于上述第二视频编码帧出现。In some possible implementation manners of the present invention, the first field coding indication may include a first indication parameter and a second indication parameter. The first indication parameter indicates that the first video encoding frame is a video encoding frame corresponding to single field image data (ie, the first indication parameter may indicate that the first video encoding frame includes a single field image data of an image, and The first indicator parameter further includes the single field image data included in the first video encoding frame as the top field image data or the bottom field image data (for example, assuming that the image is the same for the two fields of image data) The top field image data is video-encoded to obtain a first video-coded frame, and the first indication parameter indicates that the single-field image data included in the first video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed. The video encoding is performed to obtain a first video encoding frame, and the first indication parameter indicates that the single field image data included in the first video encoding frame is bottom field image data). The second indication parameter indicates that the first video encoding frame and the second video encoding frame appear in the video stream. sequence. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the second indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video coding frame appears before the second video coding frame. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the second indication parameter may indicate that the first video encoding frame and the second video encoding frame are in the video stream. The sequence of occurrences occurs after the first video encoding frame is followed by the second video encoding frame.
在本发明的另一些可能的实施方式中,上述第一场编码指示例如可包含第三指示参数、第四指示参数和第二指示参数。其中,上述第三指示参数可指示上述第一视频编码帧为单场图像数据对应的视频编码帧(即,第三指示参数可指示上述第一视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据)。上述第四指示参数可指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第一视频编码帧,则第四指示参数指示上述第一视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第一视频编码帧,则第四指示参数指示上述第一视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第二指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。In other possible implementation manners of the present invention, the first field coding indication may include, for example, a third indication parameter, a fourth indication parameter, and a second indication parameter. The third indication parameter may indicate that the first video coding frame is a video coding frame corresponding to single field image data (ie, the third indication parameter may indicate that the first video coding frame includes a single field image data of an image, Two image data without an image). The fourth indication parameter may indicate that the single field image data included in the first video encoding frame is top field image data or bottom field image data (eg, it is assumed that video encoding the top field image data of the image to obtain the first video) Encoding the frame, the fourth indication parameter indicating that the single field image data included in the first video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain the first video encoding frame, The four indication parameter indicates that the single field image data included in the first video encoding frame is bottom field image data). The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
其中,第一指示参数例如可包括至少两个比特,其中,第一指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第二指示参数例如包括至少1个比特。第二指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The first indication parameter may include, for example, at least two bits, wherein the first indication parameter may be, for example, a parameter progressive_frame indicator bit or a picture_structure indicator bit or other extension indicator bit. The second indication parameter includes, for example, at least 1 bit. The second indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
在本发明的一些实施例中,上述第二视频编码帧包含第二场编码指示,上述第二场编码指示指示上述第二视频编码帧为单场图像数据对应的视频编码帧,上述第二场编码指示还指示上述第二视频编码帧包含的单场图像数据为底场图像数据或者顶场图像数据,上述第二场编码指示还指示出上述第二视频编码帧和上述第一视频编码帧在上述视频码流中出现的先后顺序。In some embodiments of the present invention, the second video coding frame includes a second field coding indication, where the second field coding indication indicates that the second video coding frame is a video coding frame corresponding to single field image data, and the second field The encoding indication further indicates that the single field image data included in the second video encoding frame is bottom field image data or top field image data, and the second field encoding indication further indicates that the second video encoding frame and the first video encoding frame are The order in which the above video streams appear.
在本发明的一些可能的实施方式中,上述第二场编码指示可包含第五指 示参数和第五指示参数。其中,上述第五指示参数指示上述第二视频编码帧为单场图像数据对应的视频编码帧(即,第五指示参数可指示上述第二视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),上述第五指示参数还指示上述第二视频编码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第二视频编码帧,则第五指示参数指示上述第二视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第二视频编码帧,则第五指示参数指示上述第二视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第六指示参数指示出上述第二视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。例如,若上述视频码流中上述第一视频编码帧先于上述第二视频编码帧出现,则第六指示参数指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧先于上述第二视频编码帧出现。反之,若上述视频码流中上述第一视频编码帧后于上述第二视频编码帧出现,则第六指示参数可指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序为上述第一视频编码帧后于上述第二视频编码帧出现。In some possible implementation manners of the present invention, the second field coding indication may include a fifth finger Show parameters and fifth indication parameters. The fifth indication parameter indicates that the second video coding frame is a video coding frame corresponding to single field image data (that is, the fifth indication parameter may indicate that the second video coding frame includes a single field image data of an image, and The second indication parameter does not include an image, and the fifth indication parameter further indicates that the single field image data included in the second video coding frame is top field image data or bottom field image data (for example, assuming that the image is The top field image data is video-encoded to obtain a second video-coded frame, and the fifth indication parameter indicates that the single-field image data included in the second video-coded frame is top-field image data, and the bottom field image data of the image is assumed to be performed. Video encoding to obtain a second video encoding frame, the fifth indication parameter indicating that the single field image data included in the second video encoding frame is bottom field image data). The sixth indication parameter indicates a sequence in which the second video coding frame and the second video coding frame appear in the video code stream. For example, if the first video coding frame in the video code stream appears before the second video coding frame, the sixth indication parameter indicates that the first video coding frame and the second video coding frame are in the video code stream. The order of occurrence is that the first video coding frame appears before the second video coding frame. On the other hand, if the first video encoding frame in the video stream is followed by the second video encoding frame, the sixth indication parameter may indicate that the first video encoding frame and the second video encoding frame are in the video stream. The sequence of occurrences occurs after the first video encoding frame is followed by the second video encoding frame.
在本发明的另一些可能的实施方式中,上述第二场编码指示例如可包含第七指示参数、第八指示参数和第六指示参数。其中,上述第七指示参数可指示上述第二视频编码帧为单场图像数据对应的视频编码帧(即,第七指示参数可指示上述第二视频编码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据)。上述第八指示参数可指示上述第二视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据(例如,假设是对上述图像的顶场图像数据进行视频编码以得到第二视频编码帧,则第八指示参数指示上述第二视频编码帧包含的单场图像数据为顶场图像数据,假设是对上述图像的底场图像数据进行视频编码以得到第二视频编码帧,则第八指示参数指示上述第二视频编码帧包含的单场图像数据为底场图像数据)。其中,上述第六指示参数指示出上述第二视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。In other possible implementation manners of the present invention, the foregoing second field coding indication may include, for example, a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter. The seventh indication parameter may indicate that the second video coding frame is a video coding frame corresponding to single field image data (that is, the seventh indication parameter may indicate that the second video coding frame includes a single field image data of an image, Two image data without an image). The eighth indication parameter may indicate that the single field image data included in the second video coding frame is top field image data or bottom field image data (eg, assuming that the top field image data of the image is video encoded to obtain a second video) Encoding the frame, the eighth indication parameter indicating that the single field image data included in the second video encoding frame is top field image data, and assuming that the bottom field image data of the image is video encoded to obtain a second video encoding frame, The eight indication parameter indicates that the single field image data included in the second video encoding frame is bottom field image data). The sixth indication parameter indicates a sequence in which the second video coding frame and the second video coding frame appear in the video code stream.
其中,第五指示参数例如可包括至少两个比特,其中,第五指示参数例 如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第六指示参数例如包括至少1个比特。第六指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter example For example, the parameter progressive line frame (progressive_frame) indicator bit or picture structure (picture_structure) indicator bit or other extended indicator bit. The sixth indication parameter includes, for example, at least 1 bit. The sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
可以理解的是,本实施例的视频编码装置600的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。视频编码装置600可为任何需要输出、存储视频的装置,如笔记本电脑,平板电脑、个人电脑、手机等设备。It is to be understood that the functions of the functional modules of the video encoding apparatus 600 of this embodiment may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, reference may be made to the related description of the foregoing method embodiments, and details are not described herein again. . The video encoding device 600 can be any device that needs to output and store video, such as a notebook computer, a tablet computer, a personal computer, a mobile phone, and the like.
可以看出,本实施例的视频编码装置600对图像的第一场图像数据和第二场图像数据分别进行视频编码以得到第一视频编码帧和第二视频编码帧;将第一视频编码帧和第二视频编码帧写入视频码流。其中,由于第一视频编码帧包含第一场编码指示,上述第一场编码指示指示上述第一视频编码帧为单场图像数据对应的视频编码帧,且上述第一场编码指示还指示上述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,且第一场编码指示还指示出上述第一视频编码帧和上述第二视频编码帧在上述视频码流中出现的先后顺序。其中,由于利用第一视频编码帧明确的指示出,基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,这有利于视频解码装置明确获知基于同一图像的不同场的图像数据得到的同源视频编码帧在视频码流中出现的先后顺序,进而有利于视频解码装置正确的将解码得到的同一图像的不同场图像数据进行图像交融。It can be seen that the video encoding apparatus 600 of the embodiment separately performs video encoding on the first field image data and the second field image data of the image to obtain the first video encoding frame and the second video encoding frame; and the first video encoding frame. And writing a video stream to the second video encoded frame. The first field coding instruction indicates that the first video coding frame is a video coding frame corresponding to the single field image data, and the first field coding indication further indicates the foregoing. The single field image data included in a video encoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video encoding frame and the second video encoding frame appear in the video stream. The order of precedence. Wherein, because the first video coding frame is explicitly indicated, the sequence of the homologous video coding frames obtained from the image data of different fields of the same image appears in the video code stream, which is beneficial for the video decoding device to know clearly based on the same The sequence of the homologous video coding frames obtained by the image data of different fields of the image appears in the video code stream, thereby facilitating the video decoding device to correctly image the different field image data of the same image obtained by decoding.
参见图7,图7为本发明实施例提供的视频解码装置700的示意图,视频解码装置700可包括至少一个总线701、与总线701相连的至少一个处理器702以及与总线701相连的至少一个存储器703。Referring to FIG. 7, FIG. 7 is a schematic diagram of a video decoding apparatus 700 according to an embodiment of the present invention. The video decoding apparatus 700 can include at least one bus 701, at least one processor 702 connected to the bus 701, and at least one memory connected to the bus 701. 703.
其中,处理器702通过总线701,调用存储器703中存储的代码以用于对视频码流中的第一视频解码帧进行视频解码以得到第一图像解码数据;对上述视频码流中的第二视频解码帧进行视频解码以得到第二图像解码数据。其中,上述第一视频解码帧包含第一场编码指示,上述第一场编码指示指示出第一视频解码帧为单场图像数据对应的视频解码帧,并且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场 图像数据,并且上述第一场编码指示还指示上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现顺序;其中,上述第一视频解码帧和上述同源视频解码帧基于同一图像的不同场的图像数据得到;根据上述第一场编码指示将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。The processor 702 calls, by using the bus 701, the code stored in the memory 703 for video decoding the first video decoded frame in the video code stream to obtain first image decoded data; and the second in the video code stream. The video decoded frame is video decoded to obtain second image decoded data. The first video decoding frame includes a first field coding indication, where the first field coding indication indicates that the first video decoding frame is a video decoding frame corresponding to single field image data, and the first field coding indication further indicates the foregoing The single field image data contained in a video decoding frame is the top field image data or the bottom field Image data, and the first field coding indication further indicates an order of appearance of the first video decoding frame and the homogenous video decoding frame of the first video decoding frame in the video code stream; wherein the first video decoding frame and The homologous video decoding frame is obtained based on image data of different fields of the same image; and the first image decoding data and the second image decoding data are blended according to the first field encoding instruction to obtain a blended image.
在本发明一些可能的实施方式中,上述第一场编码指示可包含第一指示参数和第二指示参数;其中,上述第一指示参数指示可指示出第一视频解码帧为单场图像数据对应的视频解码帧(即,第一指示参数可指示上述第一视频解码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),并且上述第一指示参数还可以指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第一视频解码帧包含的单场图像数据为顶场图像数据,则第一指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,上述第一视频解码帧包含的单场图像数据为底场图像数据,则第一指示参数指示上述第一视频解码帧包含的单场图像数据为底场图像数据)。上述第二指示参数可指示出上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In some possible implementation manners of the present disclosure, the first field coding indication may include a first indication parameter and a second indication parameter, where the first indication parameter indication may indicate that the first video decoding frame is a single field image data corresponding to Video decoding frame (ie, the first indication parameter may indicate that the first video decoding frame includes one field of image data of one image, and does not include two fields of image data of one image), and the first indication parameter may also be Instructing the single video image data included in the first video decoding frame to be top field image data or bottom field image data (eg, assuming that the single field image data included in the first video decoding frame is top field image data, the first indicator parameter And indicating that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the first indication parameter indicates that the first video decoding frame includes The single field image data is the bottom field image data). The second indication parameter may indicate an order of appearance of the first video decoding frame and the homogenous video decoding frame of the first video decoding frame in the video code stream.
在本发明另一些可能的实施方式中,上述第一场编码指示可包含第三指示参数、第四指示参数和第二指示参数;其中,上述第三指示参数指示出第一视频解码帧为单场图像数据对应的视频解码帧。上述第四指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第一视频解码帧包含的单场图像数据为顶场图像数据,则第四指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,上述第一视频解码帧包含的单场图像数据为底场图像数据,则第四指示参数指示上述第一视频解码帧包含的单场图像数据为底场图像数据)。上述第二指示参数可指示出上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In another possible implementation manner of the present invention, the first field coding indication may include a third indication parameter, a fourth indication parameter, and a second indication parameter, where the third indication parameter indicates that the first video decoding frame is a single The video decoded frame corresponding to the field image data. The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data (for example, assuming that the single field image data included in the first video decoding frame is top field image data, The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the fourth indication parameter indicates the foregoing The single field image data contained in a video decoding frame is bottom field image data). The second indication parameter may indicate an order of appearance of the first video decoding frame and the homogenous video decoding frame of the first video decoding frame in the video code stream.
其中,第一指示参数例如可包括至少两个比特,其中,第一指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第二指示参数例如包括至少1 个比特。第二指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The first indication parameter may include, for example, at least two bits, wherein the first indication parameter may be, for example, a parameter progressive_frame indicator bit or a picture_structure indicator bit or other extension indicator bit. The second indication parameter includes, for example, at least 1 Bits. The second indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
在本发明的一些可能的实施方式中,上述处理器702可用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第二视频解码帧在上述视频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;In some possible implementation manners of the present invention, the processor 702 may be configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, after the first video Decoding a frame, wherein the second video decoding frame is present in the video stream and after the first video decoding frame, and the decoded output sequence of the first image decoded data and the second image decoded data are adjacent The first image decoded data and the second image decoded data are blended to obtain a blended image;
或者;or;
上述处理器702可以用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第二视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,可将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。The processor 702 may be configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears in the video code stream before the first video decoding frame, and the second video decoding And the frame appears in the video stream according to the first video decoding frame, and the first image decoding data and the second image decoded data are sequentially adjacent to the decoded output sequence, and the first image decoding data and the foregoing The two image decoded data are blended to obtain a blended image.
例如,上述处理器702可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中先于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为底场图像数据,且上述第二视频解码帧在上述视频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;For example, the processor 702 may be specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, and then appears in the first video decoding frame, and the foregoing The field coding indication further indicates that the single field image data included in the first video decoding frame is top field image data, and the second field coding indication indicates that the homogenous video decoding frame of the second video decoding frame is in the video stream. And the second video encoding frame is further configured to indicate that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame is in the video stream. And then appearing in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the second image decoding data are blended to obtain a blending image;
或者;or;
上述处理器702可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频 解码帧在上述视频码流中后于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为底场图像数据,且上述第二视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;The processor 702 is specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears in the video code stream before the first video decoding frame, and the first field The encoding indication further indicates that the single field image data included in the first video decoding frame is top field image data, and the second field encoding indication indicates the same video of the second video decoding frame. Decoding the frame in the video stream, and then appearing in the second video decoding frame, and the second field encoding indication further indicating that the single field image data included in the second video decoding frame is bottom field image data, and the second video is Decoding the frame in the video stream according to the first video decoding frame, and the first image decoding data and the second image decoding data are sequentially outputted, and the first image decoding data and the first The two image decoding data are blended to obtain a blended image;
或者;or;
上述处理器702可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为底场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中先于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,且上述第二视频解码帧在上述视频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;The processor 702 may be specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, and then appears in the first video decoding frame, and the first field The coding indication further indicates that the single field image data included in the first video decoding frame is bottom field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame precedes the video code stream. The second video decoding frame is generated, and the second field coding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video code stream. The first video decoding frame appears, and the decoded output order of the first image decoded data and the second image decoded data are adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image;
或者;or;
上述处理器702可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为底场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中后于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,且上述第二视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。The processor 702 is specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears in the video code stream before the first video decoding frame, and the first field The coding indication further indicates that the single field image data included in the first video decoding frame is bottom field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame precedes the video stream in the video stream. The first video decoded frame appears, and the first image decoded data and the second image decoded data are sequentially adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image.
在本发明一些可能的实施方式中,上述第二场编码指示可包含第五指示参数和第六指示参数;其中,上述第五指示参数指示可指示出第二视频解码帧为单场图像数据对应的视频解码帧(即,第五指示参数可指示上述第二视频解码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),并且上述第五指示参数还可以指示上述第二视频解码帧包含的单场图 像数据为顶场图像数据或底场图像数据(例如,假设上述第二视频解码帧包含的单场图像数据为顶场图像数据,则第五指示参数指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,上述第二视频解码帧包含的单场图像数据为底场图像数据,则第五指示参数指示上述第二视频解码帧包含的单场图像数据为底场图像数据)。上述第六指示参数可指示出上述第二视频解码帧和上述第二视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In some possible implementation manners of the present disclosure, the foregoing second field coding indication may include a fifth indication parameter and a sixth indication parameter, where the fifth indication parameter indication may indicate that the second video decoding frame is a single field image data corresponding to Video decoding frame (ie, the fifth indication parameter may indicate that the second video decoding frame includes one field of image data of one image, and does not include two fields of image data of one image), and the fifth indication parameter may also be Instructing the single field picture included in the second video decoding frame The image data is top field image data or bottom field image data (for example, assuming that the single field image data included in the second video decoding frame is top field image data, the fifth indication parameter indicates a single field included in the second video decoding frame. The image data is the top field image data, and the single field image data included in the second video decoding frame is the bottom field image data, and the fifth indication parameter indicates that the single field image data included in the second video decoding frame is the bottom field image data) . The sixth indication parameter may indicate an order of appearance of the homologous video decoding frame of the second video decoding frame and the second video decoding frame in the video code stream.
在本发明另一些可能的实施方式中,上述第二场编码指示可包含第七指示参数、第八指示参数和第六指示参数;其中,上述第七指示参数指示出第二视频解码帧为单场图像数据对应的视频解码帧。上述第八指示参数指示上述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第二视频解码帧包含的单场图像数据为顶场图像数据,则第八指示参数指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,若上述第二视频解码帧包含的单场图像数据为底场图像数据,则第八指示参数指示上述第二视频解码帧包含的单场图像数据为底场图像数据)。上述第六指示参数可指示出上述第二视频解码帧和上述第二视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In another possible implementation manner of the present invention, the foregoing second field coding indication may include a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter, where the seventh indication parameter indicates that the second video decoding frame is a single The video decoded frame corresponding to the field image data. The eighth indication parameter indicates that the single field image data included in the second video decoding frame is top field image data or bottom field image data (for example, assuming that the single field image data included in the second video decoding frame is top field image data, The eighth indication parameter indicates that the single field image data included in the second video decoding frame is top field image data, and if the single field image data included in the second video decoding frame is bottom field image data, the eighth indication parameter indicates the above. The single field image data included in the second video decoding frame is bottom field image data). The sixth indication parameter may indicate an order of appearance of the homologous video decoding frame of the second video decoding frame and the second video decoding frame in the video code stream.
其中,第五指示参数例如可包括至少两个比特,其中,第五指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第六指示参数例如包括至少1个比特。第六指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter may be, for example, a parameter progressive_frame indication bit or a picture structure (picture_structure) indication bit or other extended indication bit. The sixth indication parameter includes, for example, at least 1 bit. The sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
可以理解的是,本实施例的视频解码装置700的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。视频解码装置700可为任何需要输出、播放视频的装置,如笔记本电脑,平板电脑、个人电脑、手机等设备。It is to be understood that the functions of the functional modules of the video decoding apparatus 700 of this embodiment may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, reference may be made to the related description of the foregoing method embodiments, and details are not described herein again. . The video decoding device 700 can be any device that needs to output and play video, such as a notebook computer, a tablet computer, a personal computer, a mobile phone, and the like.
可以看出,本实施例的视频解码装置700在对视频码流中的第一视频解码帧和第二视频解码帧进行视频解码以得到第一图像解码数据和第二图像解码数据之后,由于是根据第一视频解码帧包含的第一场编码指示的指示,及第二视频解码帧与上述第一视频解码帧在上述视频码流中的出现顺序,及 第一图像解码数据和上述第二图像解码数据的解码后输出顺序,来确定是否将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。其中,由于第一视频解码帧明确的指示出,第一视频解码帧和其同源视频解码帧在视频码流中出现的先后顺序,这有利于视频解码装置明确获知基于同一图像的不同场的图像数据得到的同源视频解码帧在视频码流中出现的先后顺序,进而有利于视频解码装置正确的将解码得到的同一图像的不同场图像数据进行图像交融。It can be seen that the video decoding apparatus 700 of this embodiment performs video decoding on the first video decoding frame and the second video decoding frame in the video code stream to obtain the first image decoding data and the second image decoding data, since And an indication of the first field coding indication included in the first video decoding frame, and an appearance order of the second video decoding frame and the first video decoding frame in the video code stream, and The decoded output order of the first image decoded data and the second image decoded data determines whether the first image decoded data and the second image decoded data are blended to obtain a blended image. Wherein, since the first video decoding frame explicitly indicates the sequence in which the first video decoding frame and the homologous video decoding frame appear in the video code stream, this is advantageous for the video decoding device to explicitly know different fields based on the same image. The order in which the homologous video decoded frames obtained by the image data appear in the video code stream further facilitates the video decoding device to correctly image the different field image data of the same image obtained by decoding.
参见图8,图8是本发明的另一实施例提供的视频解码装置800的结构框图。其中,视频解码装置800可以包括:至少1个处理器801,至少1个网络接口804或其他用户接口803,存储器808,至少1个通信总线802。通信总线802用于实现这些组件之间的连接通信。其中,该视频解码装置800可选的可以包含用户接口803,包括显示器(例如,触摸屏、LCD、CRT、全息成像(Holographic)或者投影(Projector)等)、点击设备(例如鼠标、轨迹球(trackball)触感板或触摸屏等)、摄像头和/或拾音装置等。Referring to FIG. 8, FIG. 8 is a structural block diagram of a video decoding apparatus 800 according to another embodiment of the present invention. The video decoding device 800 may include at least one processor 801, at least one network interface 804 or other user interface 803, a memory 808, and at least one communication bus 802. Communication bus 802 is used to implement connection communication between these components. The video decoding device 800 can optionally include a user interface 803, including a display (eg, a touch screen, LCD, CRT, Holographic or Projector, etc.), a pointing device (eg, a mouse, a trackball) ) a touch panel or touch screen, etc.), a camera and/or a sound pickup device, and the like.
其中,存储器802可以包括只读存储器和随机存取存储器,并向处理器801提供指令和数据。存储器802中的一部分还可以包括非易失性随机存取存储器(NVRAM)。The memory 802 can include read only memory and random access memory and provides instructions and data to the processor 801. A portion of memory 802 may also include non-volatile random access memory (NVRAM).
在一些实施方式中,存储器808存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:In some implementations, memory 808 stores elements, executable modules or data structures, or a subset thereof, or their extension set:
操作系统8081,包含各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。The operating system 8081 includes various system programs for implementing various basic services and processing hardware-based tasks.
应用程序模块8082,包含各种应用程序,用于实现各种应用业务。The application module 8082 includes various applications for implementing various application services.
在本发明的实施例中,通过调用存储器808存储的程序或指令,处理器801对视频码流中的第一视频解码帧进行视频解码以得到第一图像解码数据;对上述视频码流中的第二视频解码帧进行视频解码以得到第二图像解码数据。其中,上述第一视频解码帧包含第一场编码指示,上述第一场编码指示指示出第一视频解码帧为单场图像数据对应的视频解码帧,并且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且上述第一场编码指示还指示上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现顺序;其 中,上述第一视频解码帧和上述同源视频解码帧基于同一图像的不同场的图像数据得到;根据上述第一场编码指示将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。In an embodiment of the present invention, the processor 801 performs video decoding on the first video decoded frame in the video code stream to obtain first image decoded data by calling a program or instruction stored in the memory 808; The second video decoded frame is video decoded to obtain second image decoded data. The first video decoding frame includes a first field coding indication, where the first field coding indication indicates that the first video decoding frame is a video decoding frame corresponding to single field image data, and the first field coding indication further indicates the foregoing The single field image data included in a video decoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates that the first video decoding frame and the homologous video decoding frame of the first video decoding frame are The order of appearance in the above video stream; The first video decoding frame and the homologous video decoding frame are obtained based on image data of different fields of the same image; and the first image decoding data and the second image decoding data are blended according to the first field encoding instruction. Blend the image.
在本发明一些可能的实施方式中,上述第一场编码指示可包含第一指示参数和第二指示参数;其中,上述第一指示参数指示可指示出第一视频解码帧为单场图像数据对应的视频解码帧(即,第一指示参数可指示上述第一视频解码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),并且上述第一指示参数还可以指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第一视频解码帧包含的单场图像数据为顶场图像数据,则第一指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,上述第一视频解码帧包含的单场图像数据为底场图像数据,则第一指示参数指示上述第一视频解码帧包含的单场图像数据为底场图像数据)。上述第二指示参数可指示出上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In some possible implementation manners of the present disclosure, the first field coding indication may include a first indication parameter and a second indication parameter, where the first indication parameter indication may indicate that the first video decoding frame is a single field image data corresponding to Video decoding frame (ie, the first indication parameter may indicate that the first video decoding frame includes one field of image data of one image, and does not include two fields of image data of one image), and the first indication parameter may also be Instructing the single video image data included in the first video decoding frame to be top field image data or bottom field image data (eg, assuming that the single field image data included in the first video decoding frame is top field image data, the first indicator parameter And indicating that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the first indication parameter indicates that the first video decoding frame includes The single field image data is the bottom field image data). The second indication parameter may indicate an order of appearance of the first video decoding frame and the homogenous video decoding frame of the first video decoding frame in the video code stream.
在本发明另一些可能的实施方式中,上述第一场编码指示可包含第三指示参数、第四指示参数和第二指示参数;其中,上述第三指示参数指示出第一视频解码帧为单场图像数据对应的视频解码帧。上述第四指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第一视频解码帧包含的单场图像数据为顶场图像数据,则第四指示参数指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,上述第一视频解码帧包含的单场图像数据为底场图像数据,则第四指示参数指示上述第一视频解码帧包含的单场图像数据为底场图像数据)。上述第二指示参数可指示出上述第一视频解码帧和上述第一视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In another possible implementation manner of the present invention, the first field coding indication may include a third indication parameter, a fourth indication parameter, and a second indication parameter, where the third indication parameter indicates that the first video decoding frame is a single The video decoded frame corresponding to the field image data. The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data (for example, assuming that the single field image data included in the first video decoding frame is top field image data, The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data, and the single field image data included in the first video decoding frame is bottom field image data, and the fourth indication parameter indicates the foregoing The single field image data contained in a video decoding frame is bottom field image data). The second indication parameter may indicate an order of appearance of the first video decoding frame and the homogenous video decoding frame of the first video decoding frame in the video code stream.
其中,第一指示参数例如可包括至少两个比特,其中,第一指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第二指示参数例如包括至少1个比特。第二指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。 The first indication parameter may include, for example, at least two bits, wherein the first indication parameter may be, for example, a parameter progressive_frame indicator bit or a picture_structure indicator bit or other extension indicator bit. The second indication parameter includes, for example, at least 1 bit. The second indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
在本发明的一些可能的实施方式中,上述处理器801可用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第二视频解码帧在上述视频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;In some possible implementation manners of the present invention, the processor 801 may be configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, after the first video Decoding a frame, wherein the second video decoding frame is present in the video stream and after the first video decoding frame, and the decoded output sequence of the first image decoded data and the second image decoded data are adjacent The first image decoded data and the second image decoded data are blended to obtain a blended image;
或者;or;
上述处理器801可以用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第二视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,可将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。The processor 801 may be configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears in the video code stream before the first video decoding frame, and the second video decoding And the frame appears in the video stream according to the first video decoding frame, and the first image decoding data and the second image decoded data are sequentially adjacent to the decoded output sequence, and the first image decoding data and the foregoing The two image decoded data are blended to obtain a blended image.
例如,上述处理器801可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中先于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为底场图像数据,且上述第二视频解码帧在上述视频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;For example, the processor 801 may be specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, and then appears in the first video decoding frame, and the foregoing The field coding indication further indicates that the single field image data included in the first video decoding frame is top field image data, and the second field coding indication indicates that the homogenous video decoding frame of the second video decoding frame is in the video stream. And the second video encoding frame is further configured to indicate that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame is in the video stream. And then appearing in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the second image decoding data are blended to obtain a blending image;
或者;or;
上述处理器801可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为顶场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中后于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为底场图像数据,且上 述第二视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;The processor 801 may be specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field The coding indication further indicates that the single field image data included in the first video decoding frame is top field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field coding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and The second video decoding frame appears in the video code stream before the first video decoding frame, and the first image decoded data and the second image decoded data are sequentially decoded and outputted, and the first image is decoded. The data is blended with the second image decoded data to obtain a blended image;
或者;or;
上述处理器801可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中后于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为底场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中先于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,且上述第二视频解码帧在上述视频码流中后于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像;The processor 801 is specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, and then appears in the first video decoding frame, and the first field The coding indication further indicates that the single field image data included in the first video decoding frame is bottom field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame precedes the video code stream. The second video decoding frame is generated, and the second field coding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video code stream. The first video decoding frame appears, and the decoded output order of the first image decoded data and the second image decoded data are adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image;
或者;or;
上述处理器801可具体用于,若上述第一场编码指示指示上述第一视频解码帧的同源视频解码帧在上述视频码流中先于上述第一视频解码帧出现,且上述第一场编码指示还指示上述第一视频解码帧包含的单场图像数据为底场图像数据,且上述第二场编码指示指示上述第二视频解码帧的同源视频解码帧在上述视频码流中后于上述第二视频解码帧出现,且上述第二场编码指示还指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,且上述第二视频解码帧在上述视频码流中先于上述第一视频解码帧出现,并且上述第一图像解码数据和上述第二图像解码数据的解码后输出顺序相邻,将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。The processor 801 may be specifically configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field The coding indication further indicates that the single field image data included in the first video decoding frame is bottom field image data, and the second field coding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame precedes the video stream in the video stream. The first video decoded frame appears, and the first image decoded data and the second image decoded data are sequentially adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image.
在本发明一些可能的实施方式中,上述第二场编码指示可包含第五指示参数和第六指示参数;其中,上述第五指示参数指示可指示出第二视频解码帧为单场图像数据对应的视频解码帧(即,第五指示参数可指示上述第二视频解码帧包含一幅图像的单场图像数据,而不包含一幅图像的两场图像数据),并且上述第五指示参数还可以指示上述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第二视频解码帧包含的单场图像数据为顶场图像数据,则第五指示参数指示上述第二视频解码 帧包含的单场图像数据为顶场图像数据,上述第二视频解码帧包含的单场图像数据为底场图像数据,则第五指示参数指示上述第二视频解码帧包含的单场图像数据为底场图像数据)。上述第六指示参数可指示出上述第二视频解码帧和上述第二视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In some possible implementation manners of the present disclosure, the foregoing second field coding indication may include a fifth indication parameter and a sixth indication parameter, where the fifth indication parameter indication may indicate that the second video decoding frame is a single field image data corresponding to Video decoding frame (ie, the fifth indication parameter may indicate that the second video decoding frame includes one field of image data of one image, and does not include two fields of image data of one image), and the fifth indication parameter may also be Instructing the single video image data included in the second video decoding frame to be top field image data or bottom field image data (for example, assuming that the single field image data included in the second video decoding frame is top field image data, the fifth indicator parameter Indicating the above second video decoding The single field image data included in the frame is top field image data, and the single field image data included in the second video decoding frame is bottom field image data, and the fifth indication parameter indicates that the single field image data included in the second video decoding frame is Bottom field image data). The sixth indication parameter may indicate an order of appearance of the homologous video decoding frame of the second video decoding frame and the second video decoding frame in the video code stream.
在本发明另一些可能的实施方式中,上述第二场编码指示可包含第七指示参数、第八指示参数和第六指示参数;其中,上述第七指示参数指示出第二视频解码帧为单场图像数据对应的视频解码帧。上述第八指示参数指示上述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据(例如,假设上述第二视频解码帧包含的单场图像数据为顶场图像数据,则第八指示参数指示上述第二视频解码帧包含的单场图像数据为顶场图像数据,若上述第二视频解码帧包含的单场图像数据为底场图像数据,则第八指示参数指示上述第二视频解码帧包含的单场图像数据为底场图像数据)。上述第六指示参数可指示出上述第二视频解码帧和上述第二视频解码帧的同源视频解码帧在上述视频码流中的出现顺序。In another possible implementation manner of the present invention, the foregoing second field coding indication may include a seventh indication parameter, an eighth indication parameter, and a sixth indication parameter, where the seventh indication parameter indicates that the second video decoding frame is a single The video decoded frame corresponding to the field image data. The eighth indication parameter indicates that the single field image data included in the second video decoding frame is top field image data or bottom field image data (for example, assuming that the single field image data included in the second video decoding frame is top field image data, The eighth indication parameter indicates that the single field image data included in the second video decoding frame is top field image data, and if the single field image data included in the second video decoding frame is bottom field image data, the eighth indication parameter indicates the above. The single field image data included in the second video decoding frame is bottom field image data). The sixth indication parameter may indicate an order of appearance of the homologous video decoding frame of the second video decoding frame and the second video decoding frame in the video code stream.
其中,第五指示参数例如可包括至少两个比特,其中,第五指示参数例如可为参数逐行帧标志(progressive_frame)指示位或图像结构(picture_structure)指示位或其他扩展指示位。第六指示参数例如包括至少1个比特。第六指示参数例如可为顶场在先(top_field_first)指示位或其他扩展指示位等。The fifth indication parameter may include, for example, at least two bits, wherein the fifth indication parameter may be, for example, a parameter progressive_frame indication bit or a picture structure (picture_structure) indication bit or other extended indication bit. The sixth indication parameter includes, for example, at least 1 bit. The sixth indication parameter may be, for example, a top field first (top_field_first) indicator bit or other extended indicator bit or the like.
可以理解的是,本实施例的视频解码装置800的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。视频解码装置800可为任何需要输出、播放视频的装置,如笔记本电脑,平板电脑、个人电脑、手机等设备。It is to be understood that the functions of the functional modules of the video decoding apparatus 800 of this embodiment may be specifically implemented according to the method in the foregoing method embodiment. For the specific implementation process, reference may be made to the related description of the foregoing method embodiments, and details are not described herein again. . The video decoding device 800 can be any device that needs to output and play video, such as a notebook computer, a tablet computer, a personal computer, a mobile phone, and the like.
可以看出,本实施例的视频解码装置800在对视频码流中的第一视频解码帧和第二视频解码帧进行视频解码以得到第一图像解码数据和第二图像解码数据之后,由于是根据第一视频解码帧包含的第一场编码指示的指示,及第二视频解码帧与上述第一视频解码帧在上述视频码流中的出现顺序,及第一图像解码数据和上述第二图像解码数据的解码后输出顺序,来确定是否将上述第一图像解码数据和上述第二图像解码数据进行交融得到交融图像。 其中,由于第一视频解码帧明确的指示出,第一视频解码帧和其同源视频解码帧在视频码流中出现的先后顺序,这有利于视频解码装置明确获知基于同一图像的不同场的图像数据得到的同源视频解码帧在视频码流中出现的先后顺序,进而有利于视频解码装置正确的将解码得到的同一图像的不同场图像数据进行图像交融。It can be seen that the video decoding apparatus 800 of this embodiment performs video decoding on the first video decoding frame and the second video decoding frame in the video code stream to obtain the first image decoding data and the second image decoding data, since And an indication of the first field coding indication included in the first video decoding frame, and an appearance order of the second video decoding frame and the first video decoding frame in the video code stream, and the first image decoding data and the second image. Decoding the output order of the data to determine whether to blend the first image decoded data and the second image decoded data to obtain a blended image. Wherein, since the first video decoding frame explicitly indicates the sequence in which the first video decoding frame and the homologous video decoding frame appear in the video code stream, this is advantageous for the video decoding device to explicitly know different fields based on the same image. The order in which the homologous video decoded frames obtained by the image data appear in the video code stream further facilitates the video decoding device to correctly image the different field image data of the same image obtained by decoding.
本发明实施例还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时包括上述方法实施例中记载的任意一种视频编码方法或视频解码方法的部分或全部步骤。The embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, where the program includes some or all of the steps of any one of the video encoding methods or the video decoding methods described in the foregoing method embodiments. .
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the present invention is not limited by the described action sequence. Because certain steps may be performed in other sequences or concurrently in accordance with the present invention. In addition, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the details that are not detailed in a certain embodiment can be referred to the related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided herein, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above units is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or integrated. Go to another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功 能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software. The implementation of the energy unit.
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例上述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The above-described integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the above-described methods of various embodiments of the present invention. The foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .
以上上述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 The above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the embodiments are modified, or equivalent to some of the technical features, and the modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (20)

  1. 一种视频编码方法,其特征在于,包括:A video encoding method, comprising:
    获取图像;Get an image;
    对所述图像的第一场图像数据进行视频编码以得到第一视频编码帧;Performing video encoding on the first field image data of the image to obtain a first video encoding frame;
    对所述图像的第二场图像数据进行视频编码以得到第二视频编码帧;Performing video encoding on the second field image data of the image to obtain a second video encoding frame;
    将所述第一视频编码帧和所述第二视频编码帧写入视频码流;Writing the first video encoded frame and the second video encoded frame into a video code stream;
    其中,所述第一视频编码帧包含第一场编码指示,所述第一场编码指示指示所述第一视频编码帧为单场图像数据对应的视频编码帧,所述第一场编码指示还指示所述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,所述第一场编码指示还指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序;The first video coding frame includes a first field coding indication, and the first field coding indication indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first field coding indication is further Instructing the first video encoding frame to include single field image data as top field image data or bottom field image data, the first field encoding indication further indicating the first video encoding frame and the second video encoding frame a sequence of occurrences in the video stream;
    其中,所述第一场图像数据为顶场图像数据,且所述第二场图像数据为底场图像数据,或者所述第二场图像数据为顶场图像数据,且所述第一场图像数据为底场图像数据。The first field image data is top field image data, and the second field image data is bottom field image data, or the second field image data is top field image data, and the first field image is The data is bottom field image data.
  2. 根据权利要求1所述的方法,其特征在于,The method of claim 1 wherein
    所述第一场编码指示包含第一指示参数和第二指示参数;The first field coding indication includes a first indication parameter and a second indication parameter;
    其中,所述第一指示参数指示所述第一视频编码帧为单场图像数据对应的视频编码帧,所述第一指示参数还指示所述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据;The first indication parameter indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first indication parameter further indicates that the single video image data included in the first video coding frame is top. Field image data or bottom field image data;
    所述第二指示参数指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序。The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
  3. 根据权利要求1所述的方法,其特征在于,所述第一场编码指示包含第三指示参数、第四指示参数和第二指示参数;The method according to claim 1, wherein the first field coding indication comprises a third indication parameter, a fourth indication parameter and a second indication parameter;
    其中,所述第三指示参数指示所述第一视频编码帧为单场图像数据对应的视频编码帧;The third indication parameter indicates that the first video coding frame is a video coding frame corresponding to single field image data;
    所述第四指示参数指示所述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据;The fourth indication parameter indicates that the single field image data included in the first video coding frame is top field image data or bottom field image data;
    所述第二指示参数指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序。The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述第二视频 编码帧包含第二场编码指示,所述第二场编码指示指示所述第二视频编码帧为单场图像数据对应的视频编码帧,所述第二场编码指示还指示所述第二视频编码帧包含的单场图像数据为底场图像数据或者顶场图像数据,所述第二场编码指示还指示出所述第二视频编码帧和所述第一视频编码帧在所述视频码流中出现的先后顺序。Method according to any of claims 1 to 3, characterized in that said second video The coded frame includes a second field coding indication, the second field coding indication indicates that the second video coding frame is a video coding frame corresponding to single field image data, and the second field coding indication further indicates the second video coding The single field image data contained in the frame is bottom field image data or top field image data, and the second field encoding indication further indicates that the second video encoded frame and the first video encoded frame are in the video bitstream. The order of appearance.
  5. 一种视频解码方法,其特征在于,包括:A video decoding method, comprising:
    对视频码流中的第一视频解码帧进行视频解码以得到第一图像解码数据;Performing video decoding on the first video decoded frame in the video code stream to obtain first image decoded data;
    对所述视频码流中的第二视频解码帧进行视频解码以得到第二图像解码数据;Performing video decoding on the second video decoded frame in the video code stream to obtain second image decoding data;
    其中,所述第一视频解码帧包含第一场编码指示,所述第一场编码指示指示出第一视频解码帧为单场图像数据对应的视频解码帧,并且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且所述第一场编码指示还指示所述第一视频解码帧和所述第一视频解码帧的同源视频解码帧在所述视频码流中的出现顺序;其中,所述第一视频解码帧和所述同源视频解码帧基于同一图像的不同场的图像数据得到;The first video decoding frame includes a first field coding indication, where the first field coding indication indicates that the first video decoding frame is a video decoding frame corresponding to single field image data, and the first field coding indication is further Instructing the first video decoding frame to include single field image data as top field image data or bottom field image data, and the first field encoding indication further indicating the first video decoding frame and the first video decoding frame The order in which the homologous video decoded frames appear in the video codestream; wherein the first video decoded frame and the homogenous video decoded frame are obtained based on image data of different fields of the same image;
    根据所述第一场编码指示将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。And blending the first image decoding data and the second image decoding data according to the first field encoding instruction to obtain a blending image.
  6. 根据权利要求5所述的方法,其特征在于,The method of claim 5 wherein:
    所述第一场编码指示包含第一指示参数和第二指示参数;The first field coding indication includes a first indication parameter and a second indication parameter;
    其中,所述第一指示参数指示指示出第一视频解码帧为单场图像数据对应的视频解码帧,并且所述第一指示参数还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据;The first indication parameter indication indicates that the first video decoding frame is a video decoding frame corresponding to the single field image data, and the first indication parameter further indicates that the single field image data included in the first video decoding frame is Top field image data or bottom field image data;
    所述第二指示参数指示出所述第一视频解码帧和所述第一视频解码帧的同源视频解码帧在所述视频码流中的出现顺序。The second indication parameter indicates an order of appearance of the homologous video decoding frame of the first video decoding frame and the first video decoding frame in the video code stream.
  7. 根据权利要求5所述的方法,其特征在于,所述第一场编码指示包含第三指示参数、第四指示参数和第二指示参数;The method according to claim 5, wherein the first field coding indication comprises a third indication parameter, a fourth indication parameter and a second indication parameter;
    其中,所述第三指示参数指示出第一视频解码帧为单场图像数据对应的视频解码帧; The third indication parameter indicates that the first video decoding frame is a video decoding frame corresponding to single field image data;
    所述第四指示参数指示所述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据;The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data;
    所述第二指示参数指示出所述第一视频解码帧和所述第一视频解码帧的同源视频解码帧在所述视频码流中的出现顺序。The second indication parameter indicates an order of appearance of the homologous video decoding frame of the first video decoding frame and the first video decoding frame in the video code stream.
  8. 根据权利要求5至7任意一项所述的方法,其特征在于,所述根据所述第一场编码指示将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像,包括:The method according to any one of claims 5 to 7, wherein the first image decoding data and the second image decoding data are blended according to the first field encoding instruction to obtain a blending image, include:
    若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, the second video decoding frame is present, and the second video decoding frame is in the And appearing in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the The second image decoding data is blended to obtain a blended image;
    或者;or;
    若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the second video decoding frame is in the The video code stream appears before the first video decoding frame, and the decoded output order of the first image decoded data and the second image decoded data are adjacent to each other, and the first image decoded data and the The second image decoded data is blended to obtain a blended image.
  9. 根据权利要求5至7任意一项所述的方法,其特征在于,A method according to any one of claims 5 to 7, wherein
    所述第二视频解码帧包含第二场编码指示,所述第二场编码指示指示出第二视频解码帧为单场图像数据对应的视频解码帧,并且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且所述第二场编码指示还指示所述第二视频解码帧和所述第二视频解码帧的同源视频解码帧在所述视频码流中的出现顺序;The second video decoding frame includes a second field coding indication, the second field coding indication indicates that the second video decoding frame is a video decoding frame corresponding to single field image data, and the second field coding indication further indicates The single field image data included in the second video decoding frame is top field image data or bottom field image data, and the second field encoding indication further indicates the same of the second video decoding frame and the second video decoding frame. The order in which the source video decoded frames appear in the video stream;
    所述根据所述第一场编码指示将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像,包括:根据所述第一场编码指示和所述第二场编码指示,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。And the blending the first image decoding data and the second image decoding data according to the first field encoding instruction to obtain a blending image, comprising: according to the first field encoding indication and the second field encoding indication And blending the first image decoded data and the second image decoded data to obtain a blended image.
  10. 根据权利要求9所述的方法,其特征在于,所述根据所述第一场编码指示和所述第二场编码指示,将所述第一图像解码数据和所述第二图像解 码数据进行交融得到交融图像,包括:The method according to claim 9, wherein said first image decoding data and said second image are decoded according to said first field encoding indication and said second field encoding indication The code data is blended to obtain a blended image, including:
    若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中先于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为底场图像数据,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream and then appears in the first video decoding frame, and the first field coding indication further indicates The single field image data included in the first video decoding frame is top field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame precedes the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame is in the video And appearing in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoding data are blended to obtain a blended image;
    或者;or;
    若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中后于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为底场图像数据,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;And if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field coding indication further indicates The single field image data included in the first video decoding frame is top field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame is in the video And appearing in the code stream before the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoding data are blended to obtain a blended image;
    或者;or;
    若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为底场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中先于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像; If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream and then appears in the first video decoding frame, and the first field coding indication further indicates The single field image data included in the first video decoding frame is bottom field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame precedes the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video And appearing in the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoding data are blended to obtain a blended image;
    或者;or;
    若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为底场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中后于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。And if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field coding indication further indicates The single field image data included in the first video decoding frame is bottom field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video And appearing in the code stream before the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoded data are blended to obtain a blended image.
  11. 一种视频编码装置,其特征在于,包括:A video encoding apparatus, comprising:
    获取单元,用于获取图像;An acquisition unit for acquiring an image;
    编码单元,用于对所述图像的第一场图像数据进行视频编码以得到第一视频编码帧;对所述图像的第二场图像数据进行视频编码以得到第二视频编码帧;a coding unit, configured to video encode the first field image data of the image to obtain a first video coding frame, and perform video coding on the second field image data of the image to obtain a second video coding frame;
    写入单元,用于将所述第一视频编码帧和所述第二视频编码帧写入视频码流;a writing unit, configured to write the first video encoding frame and the second video encoding frame into a video code stream;
    其中,所述第一视频编码帧包含第一场编码指示,所述第一场编码指示指示所述第一视频编码帧为单场图像数据对应的视频编码帧,所述第一场编码指示还指示所述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据,所述第一场编码指示还指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序;The first video coding frame includes a first field coding indication, and the first field coding indication indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first field coding indication is further Instructing the first video encoding frame to include single field image data as top field image data or bottom field image data, the first field encoding indication further indicating the first video encoding frame and the second video encoding frame a sequence of occurrences in the video stream;
    其中,所述第一场图像数据为顶场图像数据,且所述第二场图像数据为底场图像数据,或者所述第二场图像数据为顶场图像数据,且所述第一场图像数据为底场图像数据。The first field image data is top field image data, and the second field image data is bottom field image data, or the second field image data is top field image data, and the first field image is The data is bottom field image data.
  12. 根据权利要求11所述的视频编码装置,其特征在于,A video encoding apparatus according to claim 11, wherein
    所述第一场编码指示包含第一指示参数和第二指示参数;The first field coding indication includes a first indication parameter and a second indication parameter;
    其中,所述第一指示参数指示所述第一视频编码帧为单场图像数据对应的视频编码帧,所述第一指示参数还指示所述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据; The first indication parameter indicates that the first video coding frame is a video coding frame corresponding to single field image data, and the first indication parameter further indicates that the single video image data included in the first video coding frame is top. Field image data or bottom field image data;
    所述第二指示参数指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序。The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
  13. 根据权利要求11所述的视频编码装置,其特征在于,所述第一场编码指示包含第三指示参数、第四指示参数和第二指示参数;The video encoding apparatus according to claim 11, wherein the first field coding indication comprises a third indication parameter, a fourth indication parameter, and a second indication parameter;
    其中,所述第三指示参数指示所述第一视频编码帧为单场图像数据对应的视频编码帧;The third indication parameter indicates that the first video coding frame is a video coding frame corresponding to single field image data;
    所述第四指示参数指示所述第一视频编码帧包含的单场图像数据为顶场图像数据或者底场图像数据;The fourth indication parameter indicates that the single field image data included in the first video coding frame is top field image data or bottom field image data;
    所述第二指示参数指示出所述第一视频编码帧和所述第二视频编码帧在所述视频码流中出现的先后顺序。The second indication parameter indicates a sequence in which the first video coding frame and the second video coding frame appear in the video code stream.
  14. 根据权利要求11至13任一项所述的视频编码装置,其特征在于,所述第二视频编码帧包含第二场编码指示,所述第二场编码指示指示所述第二视频编码帧为单场图像数据对应的视频编码帧,所述第二场编码指示还指示所述第二视频编码帧包含的单场图像数据为底场图像数据或者顶场图像数据,所述第二场编码指示还指示出所述第二视频编码帧和所述第一视频编码帧在所述视频码流中出现的先后顺序。The video encoding apparatus according to any one of claims 11 to 13, wherein the second video encoding frame includes a second field encoding indication, and the second field encoding indication indicates that the second video encoding frame is a video encoding frame corresponding to the single field image data, the second field encoding indication further indicating that the single field image data included in the second video encoding frame is bottom field image data or top field image data, and the second field encoding indication A sequence of occurrences of the second video encoded frame and the first video encoded frame in the video bitstream is also indicated.
  15. 一种视频解码装置,其特征在于,包括:A video decoding device, comprising:
    解码单元,用于对视频码流中的第一视频解码帧进行视频解码以得到第一图像解码数据;对所述视频码流中的第二视频解码帧进行视频解码以得到第二图像解码数据;其中,所述第一视频解码帧包含第一场编码指示,所述第一场编码指示指示出第一视频解码帧为单场图像数据对应的视频解码帧,并且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且所述第一场编码指示还指示所述第一视频解码帧和所述第一视频解码帧的同源视频解码帧在所述视频码流中的出现顺序;其中,所述第一视频解码帧和所述同源视频解码帧基于同一图像的不同场的图像数据得到;a decoding unit, configured to perform video decoding on the first video decoding frame in the video code stream to obtain first image decoding data, and perform video decoding on the second video decoding frame in the video code stream to obtain second image decoding data. Wherein the first video decoding frame includes a first field coding indication, the first field coding indication indicating that the first video decoding frame is a video decoding frame corresponding to single field image data, and the first field coding indication Also indicating that the single field image data included in the first video decoding frame is top field image data or bottom field image data, and the first field encoding indication further indicates the first video decoding frame and the first video decoding An order in which the homogenous video decoded frames of the frame appear in the video bitstream; wherein the first video decoded frame and the homogenous video decoded frame are obtained based on image data of different fields of the same image;
    交融单元,用于根据所述第一场编码指示将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。And a blending unit, configured to blend the first image decoded data and the second image decoded data according to the first field encoding instruction to obtain a blended image.
  16. 根据权利要求15所述的视频解码装置,其特征在于,A video decoding apparatus according to claim 15, wherein:
    所述第一场编码指示包含第三指示参数、第四指示参数和第二指示参 数;The first field coding indication includes a third indication parameter, a fourth indication parameter, and a second indication parameter number;
    其中,所述第三指示参数指示出第一视频解码帧为单场图像数据对应的视频解码帧;The third indication parameter indicates that the first video decoding frame is a video decoding frame corresponding to single field image data;
    所述第四指示参数指示所述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据;The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data;
    所述第二指示参数指示出所述第一视频解码帧和所述第一视频解码帧的同源视频解码帧在所述视频码流中的出现顺序。The second indication parameter indicates an order of appearance of the homologous video decoding frame of the first video decoding frame and the first video decoding frame in the video code stream.
  17. 根据权利要求15所述的视频解码装置,其特征在于,所述第一场编码指示包含第三指示参数、第四指示参数和第二指示参数;The video decoding device according to claim 15, wherein the first field coding indication comprises a third indication parameter, a fourth indication parameter and a second indication parameter;
    其中,所述第三指示参数指示出第一视频解码帧为单场图像数据对应的视频解码帧;The third indication parameter indicates that the first video decoding frame is a video decoding frame corresponding to single field image data;
    所述第四指示参数指示所述第一视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据;The fourth indication parameter indicates that the single field image data included in the first video decoding frame is top field image data or bottom field image data;
    所述第二指示参数指示出所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现。The second indication parameter indicates that a homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream.
  18. 根据权利要求15至17任意一项所述的视频解码装置,其特征在于,A video decoding apparatus according to any one of claims 15 to 17, wherein
    所述交融单元具体用于,若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;The aggregating unit is configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, and then appears in the first video decoding frame, and The second video decoding frame is present in the video code stream after the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other. The first image decoded data and the second image decoded data are blended to obtain a blended image;
    或者;or;
    若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the second video decoding frame is in the The video code stream appears before the first video decoding frame, and the decoded output order of the first image decoded data and the second image decoded data are adjacent to each other, and the first image decoded data and the The second image decoded data is blended to obtain a blended image.
  19. 根据权利要求15至17任意一项所述的视频解码装置,其特征在于,A video decoding apparatus according to any one of claims 15 to 17, wherein
    所述第二视频解码帧包含第二场编码指示,所述第二场编码指示指示出第二视频解码帧为单场图像数据对应的视频解码帧,并且所述第二场编码指 示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据或底场图像数据,并且所述第二场编码指示还指示所述第二视频解码帧和所述第二视频解码帧的同源视频解码帧在所述视频码流中的出现顺序;The second video decoding frame includes a second field encoding indication, the second field encoding indication indicates that the second video decoding frame is a video decoding frame corresponding to single field image data, and the second field encoding index The indication further indicates that the single field image data included in the second video decoding frame is top field image data or bottom field image data, and the second field encoding indication further indicates the second video decoding frame and the second video The order in which the homologous video decoded frames of the decoded frame appear in the video bitstream;
    其中,所述交融单元具体用于,根据所述第一场编码指示和所述第二场编码指示,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。The aggregating unit is configured to perform the blending of the first image decoding data and the second image decoding data according to the first field encoding instruction and the second field encoding instruction to obtain a blending image.
  20. 根据权利要求19所述的视频解码装置,其特征在于,A video decoding apparatus according to claim 19, wherein
    所述交融单元具体用于,若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中先于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为底场图像数据,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;The aggregating unit is configured to: if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream, and then appears in the first video decoding frame, and The first field coding indication further indicates that the single field image data included in the first video decoding frame is top field image data, and the second field coding indication indicates that the same video decoding frame of the second video decoding frame is The video code stream appears before the second video decoding frame, and the second field coding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the Two video decoding frames appear in the first video decoding frame in the video code stream, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, An image decoded data and the second image decoded data are blended to obtain a blended image;
    或者;or;
    若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为顶场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中后于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为底场图像数据,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;And if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field coding indication further indicates The single field image data included in the first video decoding frame is top field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is bottom field image data, and the second video decoding frame is in the video And appearing in the code stream before the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoding data are blended to obtain a blended image;
    或者;or;
    若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中后于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为底场图像数据,且所述第二场 编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中先于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据,且所述第二视频解码帧在所述视频码流中后于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像;If the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame is in the video code stream and then appears in the first video decoding frame, and the first field coding indication further indicates The single field image data included in the first video decoding frame is bottom field image data, and the second field Encoding instructions indicating that a homogenous video decoded frame of the second video decoded frame precedes the second video decoded frame in the video bitstream, and the second field encoding indication further indicates the second video decoding The single field image data contained in the frame is top field image data, and the second video decoded frame appears in the video code stream after the first video decoded frame, and the first image decoded data and the The decoded output sequence of the second image decoded data is adjacent to each other, and the first image decoded data and the second image decoded data are blended to obtain a blended image;
    或者;or;
    若所述第一场编码指示指示所述第一视频解码帧的同源视频解码帧在所述视频码流中先于所述第一视频解码帧出现,且所述第一场编码指示还指示所述第一视频解码帧包含的单场图像数据为底场图像数据,且所述第二场编码指示指示所述第二视频解码帧的同源视频解码帧在所述视频码流中后于所述第二视频解码帧出现,且所述第二场编码指示还指示所述第二视频解码帧包含的单场图像数据为顶场图像数据,且所述第二视频解码帧在所述视频码流中先于所述第一视频解码帧出现,并且所述第一图像解码数据和所述第二图像解码数据的解码后输出顺序相邻,将所述第一图像解码数据和所述第二图像解码数据进行交融得到交融图像。 And if the first field coding indication indicates that the homogenous video decoding frame of the first video decoding frame appears before the first video decoding frame in the video code stream, and the first field coding indication further indicates The single field image data included in the first video decoding frame is bottom field image data, and the second field encoding indication indicates that the homologous video decoding frame of the second video decoding frame is in the video code stream. The second video decoding frame is generated, and the second field encoding indication further indicates that the single field image data included in the second video decoding frame is top field image data, and the second video decoding frame is in the video And appearing in the code stream before the first video decoding frame, and the decoded output order of the first image decoding data and the second image decoding data are adjacent to each other, and the first image decoding data and the first The two image decoded data are blended to obtain a blended image.
PCT/CN2015/080907 2014-06-09 2015-06-05 Video coding method and video decoding method and related device WO2015188729A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410253649.4 2014-06-09
CN201410253649.4A CN104038759B (en) 2014-06-09 2014-06-09 Method for video coding and coding/decoding method and relevant apparatus

Publications (1)

Publication Number Publication Date
WO2015188729A1 true WO2015188729A1 (en) 2015-12-17

Family

ID=51469331

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/080907 WO2015188729A1 (en) 2014-06-09 2015-06-05 Video coding method and video decoding method and related device

Country Status (2)

Country Link
CN (1) CN104038759B (en)
WO (1) WO2015188729A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104038759B (en) * 2014-06-09 2017-11-17 华为技术有限公司 Method for video coding and coding/decoding method and relevant apparatus

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1244325A (en) * 1997-10-03 2000-02-09 索尼公司 Encoded data stream splicing device and method, and encoded stream generating device and method
US6871003B1 (en) * 2000-03-17 2005-03-22 Avid Technology, Inc. Edit decision list for identifying the pull down phase of a video signal
CN1852429A (en) * 2005-12-05 2006-10-25 华为技术有限公司 Video-code-flow grouped transmission method and system
CN101116335A (en) * 2005-02-07 2008-01-30 汤姆森许可贸易公司 Method and apparatus for replaying a video signal and one or more audio signals related to audio/video data that are based on a 24Hz frame frequency video signal
CN104038759A (en) * 2014-06-09 2014-09-10 华为技术有限公司 Video coding method and decoding method and related devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1244325A (en) * 1997-10-03 2000-02-09 索尼公司 Encoded data stream splicing device and method, and encoded stream generating device and method
US6871003B1 (en) * 2000-03-17 2005-03-22 Avid Technology, Inc. Edit decision list for identifying the pull down phase of a video signal
CN101116335A (en) * 2005-02-07 2008-01-30 汤姆森许可贸易公司 Method and apparatus for replaying a video signal and one or more audio signals related to audio/video data that are based on a 24Hz frame frequency video signal
CN1852429A (en) * 2005-12-05 2006-10-25 华为技术有限公司 Video-code-flow grouped transmission method and system
CN104038759A (en) * 2014-06-09 2014-09-10 华为技术有限公司 Video coding method and decoding method and related devices

Also Published As

Publication number Publication date
CN104038759B (en) 2017-11-17
CN104038759A (en) 2014-09-10

Similar Documents

Publication Publication Date Title
JP7443455B2 (en) Method, apparatus and computer program for video decoding
RU2613738C2 (en) Signaling of state information for decoded picture buffer and reference picture lists
KR101053628B1 (en) Method for scalably encoding and decoding video signal
US9473790B2 (en) Inter-prediction method and video encoding/decoding method using the inter-prediction method
US20210274206A1 (en) Method for signaling a gradual temporal layer access picture
AU2018383797B2 (en) Video data inter prediction method and apparatus
JP2022522841A (en) Signaling adaptive image sizes in video bitstreams
KR20060027779A (en) Method and apparatus for encoding/decoding video signal using temporal and spatial correlations between macro blocks
JP2015019152A (en) Device, method and program for image coding, and device, method and program for image decoding
KR20120082994A (en) Motion vector coding and decoding method and apparatus
KR20200125698A (en) Method and apparatus for sub-block motion vector prediction
KR20220162739A (en) A video encoding/decoding method for signaling HLS, a computer readable recording medium storing an apparatus and a bitstream
WO2021057697A1 (en) Video encoding and decoding methods and apparatuses, storage medium, and electronic device
JP7357679B2 (en) Improved most probable mode list generation method
WO2015188729A1 (en) Video coding method and video decoding method and related device
JP2022524783A (en) Methods and equipment for video coding
CN115866297A (en) Video processing method, device, equipment and storage medium
US9491483B2 (en) Inter-prediction method and video encoding/decoding method using the inter-prediction method
RU2775390C1 (en) Adaptive image size signaling in video bitstream
RU2773642C1 (en) Signaling for reference picture oversampling
KR20220162738A (en) A video encoding/decoding method for signaling PTL related information, a computer readable recording medium storing an apparatus and a bitstream
KR20230027180A (en) Image encoding/decoding method and apparatus for signaling picture output timing information, and computer readable recording medium storing bitstream
JP2022522842A (en) Methods, equipment and programs for video coding
JP2023520534A (en) Image encoding/decoding method and apparatus based on available slice type information for GDR or IRPA pictures and recording medium for storing bitstream
KR20230015392A (en) A video encoding/decoding method for signaling a GCI, a computer readable recording medium storing an apparatus and a bitstream

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15806326

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15806326

Country of ref document: EP

Kind code of ref document: A1