Disclosure of Invention
The invention discloses a method for self-adaptive format conversion based on a high dynamic range video, which is used for solving the problems in the prior art.
The method for the adaptive format conversion based on the high dynamic range video comprises the following steps:
acquiring display parameters of the terminal display equipment or user-defined parameters of the terminal display equipment through EDID;
the converter is arranged on the terminal display equipment, the signal type conversion or the video image processing is carried out on the program signal according to the display parameters of the terminal display equipment or the user-defined parameters so as to lead the program signal to be suitable for the display of the terminal display equipment,
or the server end is provided with an encoder, and the program signal is recoded according to the display parameter of the terminal display equipment or the user-defined parameter so as to be adapted to the decoder of the terminal display equipment;
and the terminal display equipment receives the video file or decodes the video code stream and the video file.
In another embodiment of the method based on the above adaptive format conversion for high dynamic range video, the signal type conversion comprises: and converting the HDR video into the SDR video and converting the SDR video into the HDR video.
In another embodiment of the above method for adaptive format conversion based on high dynamic range video, the video image processing comprises: gamut conversion, tone mapping, resolution conversion.
In another embodiment of the method for adaptive format conversion based on high dynamic range video, the setting a converter on the terminal display device, and performing signal type conversion or video image processing on the program signal according to the display parameters of the terminal display device or the user-defined parameters to adapt to the display of the terminal display device includes:
acquiring the display capability of the current terminal display equipment through EDID, wherein the display capability of the terminal display equipment comprises a brightness dynamic range, a supported color gamut and a supported conversion curve;
buffering a video stream or a video file to be played with NUM frames;
detecting whether the display parameters of the current terminal display equipment have user-defined settings or not;
if the user-defined setting exists, judging whether the conversion curve EOTF of the format switching frame and the video queue behind the format switching frame is the same as the EOTF supported by the display equipment;
if the user-defined setting does not exist, automatically detecting whether format switching occurs in the buffer queue;
if the format switching does not occur, buffering NUM frames of the video stream or the video file to be played again;
if the format switching occurs, judging whether the conversion curve EOTF of the format switching frame and the video queue behind the format switching frame is the same as the EOTF supported by the display equipment;
if the EOTF is different, performing signal type conversion;
judging whether the dynamic ranges of the image brightness are the same or not;
if the EOTF is the same, directly judging whether the dynamic ranges of the image brightness are the same;
if the dynamic ranges are different, tone mapping is carried out;
judging whether the color gamut is the same;
if the dynamic ranges are the same, directly judging whether the color ranges are the same;
if the color gamut is different, performing color gamut conversion;
transmitting the video image to terminal display equipment for displaying;
and if the color gamut is the same, directly transmitting the video image to the terminal display device for display.
In another embodiment of the method for adaptive format conversion based on high dynamic range video, the setting of an encoder at the server end to re-encode the program signal according to the display parameters of the terminal display device or the user-defined parameters to adapt to the decoder of the terminal display device includes:
acquiring the display capability of the current terminal display equipment through EDID, wherein the display capability of the terminal display equipment comprises a brightness dynamic range, a supported color gamut and a supported conversion curve;
decoding an input video stream or video file;
detecting whether the display parameters of the current terminal display equipment have user-defined settings or not;
if the user-defined setting exists, judging whether the conversion curve EOTF of the format switching frame and the video queue behind the format switching frame is the same as the EOTF supported by the display equipment;
if no user-defined setting exists, analyzing the information contained in the decoded data, comparing the information with the capability of the display equipment, and detecting whether the information is matched;
if the information is matched, directly coding the video stream or the video file;
if the information is not matched, judging whether the conversion curve EOTF of the format switching frame and the video queue behind the format switching frame is the same as the EOTF supported by the display equipment;
if the EOTF is different, performing signal type conversion;
judging whether the dynamic ranges of the image brightness are the same or not;
if the EOTF is the same, directly judging whether the dynamic ranges of the image brightness are the same;
if the dynamic ranges are different, tone mapping is carried out;
judging whether the color gamut is the same;
if the dynamic ranges are the same, directly judging whether the color ranges are the same;
if the color gamut is different, performing color gamut conversion;
directly coding the video stream or the video file, and transmitting the video stream or the video file to terminal display equipment;
and if the color gamut is the same, directly encoding the video stream or the video file and transmitting the video stream or the video file to the terminal display equipment.
In another embodiment of the method based on the above adaptive format conversion for high dynamic range video, the signal type conversion comprises:
determining an EOTF conversion curve through the conversion curve identification bit of the input video queue;
converting the decoded nonlinear brightness value into a linear brightness value through an EOTF conversion curve, and if the conversion is from SDR to HDR, additionally adjusting the brightness and contrast of an image;
determining an OETF conversion curve through a support conversion curve of the terminal display equipment, wherein the OETF conversion curve is an inverse transformation of an EOTF function;
the linear luminance values are transformed into nonlinear luminance values by an OETF conversion curve.
Compared with the prior art, the invention has the following advantages:
the invention sets a converter on the terminal display device to perform signal type conversion or video image processing on the program signal, or sets an encoder on the server side to re-encode the program signal according to the display parameter of the terminal display device or the user-defined parameter, so that the video image of the signal source can adapt to the video display mode of the terminal display device.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The existing video coding for video transmission of television programs mainly comprises two types, one type is SDR (standard dynamic Range) coding, the adopted color gamut standard is BT.709, the standard can generate highlight overflow, details of highlight parts are lost to ensure that dark parts are normally exposed, or dark parts are cut, and details of dark parts are lost to ensure that high-brightness scenes are normally exposed; the other is the color gamut standard in hdr (high Dynamic range) coding, st.2084, which can avoid highlight overflow or dark clipping, and can represent a higher luminance Dynamic range, without overexposure in highlight, without underexposure in dark, so that the effect of bright is clearer, and the dark can still distinguish the contour and depth of an object. Since the display device has already set its maximum image size, color setting, brightness setting, etc. information at the time of shipment, it is impossible to adapt to the video encoding of the television program, and its decoders cannot adapt to each other.
Fig. 1 is a flowchart of an embodiment of a method for adaptive format conversion based on high dynamic range video according to the present invention, and the method for adaptive format conversion based on high dynamic range video includes:
10, obtaining Display parameters of the terminal Display device or user-defined parameters of the terminal Display device through EDID, wherein the EDID is Extended Display Identification Data, the Extended Display Identification Data is a VESA standard Data format, and the Extended Display Identification Data includes parameters related to a monitor and performance thereof, and the Extended Display Identification Data includes: vendor information, maximum image size, color settings, vendor preset values, limits on frequency range, and a string of display names and serial numbers;
20, a converter is arranged on the terminal display equipment, and signal type conversion or video image processing is carried out on the program signal according to the display parameters or user-defined parameters of the terminal display equipment so as to enable the program signal to be suitable for the display of the terminal display equipment;
or an encoder is arranged at the server end, the program signal is recoded according to the display parameter of the terminal display equipment or the user-defined parameter so as to be adapted to a decoder of the terminal display equipment, the encoder recodes the coding mode of the video signal according to the display capability of the terminal display equipment, then the recoded video signal is sent to the terminal display equipment, and the terminal display equipment plays the video signal after decoding;
and 30, the terminal display equipment receives the video file or decodes the video code stream and the video file.
The signal type conversion comprises: and converting the HDR video into the SDR video and converting the SDR video into the HDR video.
The video image processing includes: gamut conversion, tone mapping, resolution conversion.
Fig. 2 is a flowchart of another embodiment of the method for adaptive format conversion based on high dynamic range video according to the present invention, and as shown in fig. 2, the setting of the converter on the terminal display device, performing signal type conversion or video image processing on the program signal according to the display parameters of the terminal display device or the user-defined parameters to adapt to the display of the terminal display device includes:
101, acquiring the display capability of the current terminal display equipment through EDID, wherein the display capability of the terminal display equipment comprises a luminance dynamic range, a supported color gamut and a supported conversion curve, the EDID is communicated with a system through DDC (display Data channel), and the EDID consists of 128 bytes;
102, buffering a NUM frame of a video stream or a video file to be played, and by playing or buffering a segment of video, checking the format of a video code or a video file, whether the video is an HDR video or an SDR video, and by using the parameter of the terminal display device sent by EDID, judging whether the current video is suitable for playing of the current terminal display device;
103, detecting whether the display parameters of the current terminal display equipment have user-defined settings, and judging whether the terminal display equipment can adapt to video coding or video files in a mode of changing the terminal parameters by detecting whether the current terminal display equipment has the user-defined parameters;
104, if the user-defined setting exists, judging whether the conversion curve EOTF of the format switching frame and the video queue behind the format switching frame is the same as the EOTF supported by the display equipment, and comparing through EOFT to see whether the video of the video queue is consistent with the playing format supported by the terminal display equipment;
105, if no user-defined setting exists, automatically detecting whether format switching occurs in the buffer queue, and judging whether the video of the video queue is converted in a video coding mode through other equipment by checking whether format switching occurs so as to adapt to the playing of terminal display equipment;
102, if the format is not switched, buffering NUM frames of the video stream or the video file to be played again;
104, if format switching occurs, judging whether the conversion curve EOTF of the format switching frame and the video queue behind the format switching frame is the same as the EOTF supported by the display equipment;
106, if the EOTF is different, performing signal type conversion, and converting the SDR video and the HDR video into each other through the signal type conversion;
107, judging whether the dynamic ranges of the image brightness are the same;
107, if the EOTF is the same, directly judging whether the dynamic ranges of the image brightness are the same;
108, if the dynamic ranges are different, performing tone mapping;
109, judging whether the color gamut is the same;
109, if the dynamic ranges are the same, directly judging whether the color ranges are the same;
110, if the color gamut is different, performing color gamut conversion;
111, transmitting the video image to a terminal display device for displaying;
and 111, if the color gamut is the same, directly transmitting the video image to a terminal display device for displaying.
Fig. 3 is a flowchart of another embodiment of the method for adaptive format conversion based on high dynamic range video according to the present invention, and the decoder that is configured with an encoder on the server side to re-encode the program signal according to the display parameters of the terminal display device or the user-defined parameters to adapt to the terminal display device, as shown in fig. 3, includes:
acquiring the display capability of the current terminal display equipment through EDID (extended display identification data), wherein the display capability of the terminal display equipment comprises a brightness dynamic range, a supported color gamut and a supported conversion curve;
202, decoding an input video stream or video file;
203, detecting whether the display parameters of the current terminal display equipment have user-defined settings;
204, if the user-defined setting exists, judging whether the conversion curve EOTF of the format switching frame and the video queue behind the format switching frame is the same as the EOTF supported by the display equipment;
205, if there is no user-defined setting, analyzing the information contained in the decoded data, comparing with the capability of the display device, and detecting whether the information is matched;
206, if the information is matched, directly coding the video stream or the video file;
204, if the information is not matched, judging whether the conversion curve EOTF of the format switching frame and the video queue behind the format switching frame is the same as the EOTF supported by the display equipment;
207, if the EOTF is not the same, performing signal type conversion;
208, judging whether the dynamic ranges of the image brightness are the same;
208, if the EOTF is the same, directly judging whether the dynamic ranges of the image brightness are the same;
209, if the dynamic ranges are different, performing tone mapping;
210, judging whether the color gamuts are the same;
210, if the dynamic ranges are the same, directly judging whether the color gamuts are the same;
211, if the color gamut is not the same, performing color gamut conversion;
206, directly coding the video stream or the video file and transmitting the video stream or the video file to the terminal display equipment;
and 206, if the color gamut is the same, directly coding the video stream or the video file and transmitting the video stream or the video file to the terminal display device.
Fig. 4 is a flow chart of another embodiment of the method for adaptive format conversion based on high dynamic range video according to the present invention, as shown in fig. 4, the signal type conversion comprises:
301, determining an EOTF conversion curve by inputting a conversion curve identification bit of a video queue;
302, converting the decoded nonlinear luminance values into linear luminance values through an EOTF conversion curve, and if the conversion is from SDR to HDR, additionally adjusting the image luminance and the contrast;
303, determining an OETF conversion curve through a support conversion curve of the terminal display equipment, wherein the OETF conversion curve is an inverse transformation of an EOTF function;
the linear luminance values are transformed 304 into nonlinear luminance values by an OETF conversion curve.
The method for adaptive format conversion based on high dynamic range video provided by the invention is described in detail above, and a specific example is applied in the text to explain the principle and the implementation of the invention, and the description of the above embodiment is only used to help understand the method of the invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments or portions thereof without departing from the spirit and scope of the invention.