CN106791276B - automatic phase detection method and device for video and graphic signals - Google Patents

automatic phase detection method and device for video and graphic signals Download PDF

Info

Publication number
CN106791276B
CN106791276B CN201611185043.7A CN201611185043A CN106791276B CN 106791276 B CN106791276 B CN 106791276B CN 201611185043 A CN201611185043 A CN 201611185043A CN 106791276 B CN106791276 B CN 106791276B
Authority
CN
China
Prior art keywords
phase
signal
signals
digital signals
sharpness
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611185043.7A
Other languages
Chinese (zh)
Other versions
CN106791276A (en
Inventor
朱健
傅文海
余方桃
黄新军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Goke Microelectronics Co Ltd
Original Assignee
Hunan Goke Microelectronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Goke Microelectronics Co Ltd filed Critical Hunan Goke Microelectronics Co Ltd
Priority to CN201611185043.7A priority Critical patent/CN106791276B/en
Publication of CN106791276A publication Critical patent/CN106791276A/en
Application granted granted Critical
Publication of CN106791276B publication Critical patent/CN106791276B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/14Picture signal circuitry for video frequency region
    • H04N5/144Movement detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/77Circuits for processing the brightness signal and the chrominance signal relative to each other, e.g. adjusting the phase of the brightness signal relative to the colour signal, correcting differential gain or differential phase

Abstract

The invention relates to a method and a device for automatically detecting the phase of video and graphic signals, comprising the following steps: the method comprises the following steps: acquiring mode signals of the same type from multiple paths of the same analog video and graphic signals; generating sampling clocks with different phases according to the current phase control signal; converting the mode signal into digital signals with different phases by using sampling clocks with different phases; respectively detecting the edge quantity and the sharpness of each line of the digital signals with different phases line by line; respectively counting the edge number of digital signals with different phases; when the edge number of any phase digital signal is larger than a preset edge number threshold, acquiring a better phase of the mode signal according to the sharpness of each row of the detected digital signals with different phases; updating the phase control signal to obtain the optimal phase of the mode signal; the optimal phase of the other types of mode signals is acquired until the optimal phase of all types of mode signals is acquired. The method has the advantages of fast APD convergence time and high user experience.

Description

Automatic phase detection method and device for video and graphic signals
Technical Field
The invention relates to the technical field of video and graphic signal phase detection, in particular to a method and a device for automatically detecting video and graphic signals.
background
in video and graphic signal receiving or processing systems, such as televisions, monitors, projection and audio equipment, it is necessary to receive analog video or graphics, convert the received analog video or graphics signals into digital signals through an ADC (analog-to-digital converter), and then perform graphics and video processing and output. The sampling frequency of the analog-to-digital converter for sampling the analog signal depends on the sampling clock, the sampling clock of the ADC is generally generated by a sampling clock generator, and the sampling clock generator can identify the video and graphic formats by detecting the line synchronization signal in the received analog video and graphic signals, and generate the sampling clock with the precise frequency required by the corresponding standard. In practical applications, the phase relationship between the sampling clock and the line synchronization signal of the received video input signal is uncertain, and the phase relationship between the sampling clock and the line synchronization signal of the ADC has a great influence on the quality of the video and graphics converted into digital signals. If the optimal phase can be detected and the phase of the sampling clock of the ADC is consistent with the optimal phase, the digital video and the figure output by the ADC are sharp, otherwise, the digital video and the figure are fuzzy.
When video and graphics signals are used for playing video, the detection of the optimal phase of the sampling clock needs to take into account the frame variation, which affects the accuracy of the optimal phase. Currently, in order to detect the optimal PHASE, an Automatic PHASE DETECTION (APD) method based on motion DETECTION is generally adopted in a video and graphics signal receiving or processing system. The video and graphic phase automatic detection method based on motion detection comprises the following steps: converting the analog video signal into a digital signal according to a current sampling phase; detecting motion of the digital signal to generate a motion detection result; selectively performing phase detection to select a target sampling phase according to the motion detection result, updating the current sampling phase to the target sampling phase, and performing phase detection to select the target phase when the motion detection result is less than a first critical value; when the motion detection result is smaller than the second critical value, the current sampling phase is updated to the target sampling phase.
However, in the above-mentioned video and graphic phase automatic detection method based on motion detection, when the APD convergence is performed to find the optimal phase, it usually requires a period of dozens of video fields and frames, or even a longer period of time to converge, and the convergence time is long, which affects the user experience.
disclosure of Invention
to overcome the problems in the related art, the present invention provides a method and apparatus for automatic phase detection of video and graphics signals.
According to a first aspect of the embodiments of the present invention, there is provided a method for detecting an automatic phase of a video and graphics signal, including:
acquiring a mode signal of the same type from multiple paths of same analog video and graphic signals, wherein one analog video and graphic signal corresponds to one picture, and the type of the mode signal comprises an R signal, a G signal and a B signal, or a brightness Y signal, a blue color difference Pb signal, a red color difference Pr signal and a composite video broadcast cvbs signal;
Generating sampling clocks with different phases according to the current phase control signal;
Converting the mode signal into digital signals with different phases by using the sampling clocks with different phases;
Respectively detecting the edge quantity and the sharpness of each line of the digital signals with different phases line by line;
Respectively counting the edge number of digital signals with different phases, wherein the edge number of the digital signals with different phases is the sum of the edge numbers of all the detected rows of the digital signals with different phases;
When the edge number of any phase digital signal is larger than a preset edge number threshold, acquiring a better phase of the mode signal according to the sharpness of each row of the detected digital signals with different phases;
updating the phase control signals except the better phase in the different phases to obtain sampling clocks of the phase control signals except the better phase, obtaining digital signals under the updated sampling clocks, comparing the digital signals with the digital signals corresponding to the better phase, and obtaining the optimal phase of the mode signal;
and acquiring other types of mode signals from multiple paths of the same analog video and graphic signals, and acquiring the optimal phases of the other types of mode signals until the optimal phases of all types of mode signals are acquired.
preferably, the detecting the edge number and the sharpness of each line of the digital signals with different phases line by line respectively includes:
Presetting a window size as three pixel points, and sequentially calculating pixel difference values of all windows in each row of the digital signals with different phases, wherein the pixel difference value i of the window is |2b-a-c |, i is the pixel difference value of the window, b is the pixel value of a middle pixel point of the window, and a and c are the pixel values of two pixel points except the middle pixel point of the window respectively;
judging whether the pixel difference value of the window is larger than a preset difference value threshold value or not;
If the pixel difference value of the window is larger than a preset difference value threshold value, the window has an edge;
And counting the edge number of each line of the different-phase digital signals, superposing the pixel difference values of all windows with edges in each line of the different-phase digital signals, and calculating to obtain the sharpness of each line of the different-phase digital signals.
Preferably, the obtaining a better phase of the mode signal according to the detected sharpness of each row of the digital signal with different phases includes:
Respectively comparing the sharpness of the digital signals of different phases in each row to obtain the optimal sharpness of each row, wherein the optimal sharpness of each row is the maximum value of the sharpness of the same row of the digital signals of different phases;
respectively counting the optimal sharpness line number of the digital signals with different phases;
And comparing the optimal sharpness line number of the digital signals with different phases, wherein the phase corresponding to the digital signal with the maximum optimal sharpness line number is the better phase of the mode signal.
according to a second aspect of the embodiments of the present invention, there is provided an apparatus for detecting an automatic phase of a video and graphics signal, comprising: a plurality of multiplexers, a plurality of analog-to-digital converters, a plurality of edge detection modules, a sampling clock generator, and a phase controller,
the multiple multiplexers are used for receiving the same input analog video and graphic signal and selecting the same type of mode signal, wherein one digital video and graphic signal corresponds to one picture;
The sampling clock generator is coupled with the phase controller and used for generating a plurality of sampling clocks with different phases according to a plurality of current phase control signals and respectively sending the sampling clocks to the analog-digital converter;
the analog-digital converters are coupled with the multiplexers one by one correspondingly, and are used for receiving the mode signals sent by the multiplexers, converting the mode signals into digital signals according to the sampling clocks sent by the sampling clock generators, and sending the digital signals to the corresponding edge detection modules;
The edge detection module is coupled with the analog-digital converters one by one correspondingly, the number of the edge detection module and the number of the multiplexers are matched with the number of the analog-digital converters, and the edge detection module is used for detecting the edge number and the sharpness of each line of the received digital signals line by line and sending the detection result to the phase controller;
the phase controllers are respectively coupled with the edge detection modules and are used for generating a plurality of phase control signals, sending the phase control signals to the sampling clock generator, receiving detection results sent by the edge detection modules and comparing the detection results to obtain the optimal phase corresponding to the mode signals;
The phase controller comprises a digital signal edge number statistic module and a better phase acquisition module, wherein,
The edge number counting module is used for respectively counting the edge numbers of different-phase digital signals, wherein the edge numbers of the different-phase digital signals are the sum of the edge numbers of all the detected rows of the different-phase digital signals;
The better phase acquisition module is used for acquiring a better phase of the mode signal according to the sharpness of each row of the detected digital signals with different phases when the edge number of any phase digital signal is greater than a preset edge number threshold;
The types of the mode signals include an R signal, a G signal, and a B signal, or a luminance Y signal, a blue color difference Pb signal, a red color difference Pr signal, and a composite video broadcasting cvbs signal.
preferably, the edge detection module includes:
The pixel difference value calculating unit is used for presetting the size of a window as three pixel points and calculating the pixel difference values of all the windows in each row of the digital signals with different phases in sequence, wherein the pixel difference value i of the window is |2b-a-c |, i is the pixel difference value of the window, b is the pixel value of a middle pixel point of the window, and a and c are the pixel values of two pixel points except the middle pixel point of the window respectively;
The difference value judging unit is used for judging whether the pixel difference value of the window is larger than a preset difference value threshold value or not;
An edge determining unit, configured to determine that the window has an edge if the pixel difference value of the window is greater than a preset difference threshold value;
And the edge number and sharpness acquisition unit is used for counting the edge number of each line of the different-phase digital signals, superposing the pixel difference values of all windows with edges in each line of the different-phase digital signals, and calculating to obtain the sharpness of each line of the different-phase digital signals.
preferably, the better phase acquisition module comprises:
The optimal sharpness obtaining unit is used for respectively comparing the sharpness of the digital signals of different phases in each row to obtain the optimal sharpness of each row, wherein the optimal sharpness of each row is the maximum value of the sharpness of the same row of the digital signals of different phases;
The statistical unit is used for respectively carrying out statistics on the optimal sharpness line number of the digital signals with different phases;
And the comparison unit is used for comparing the optimal sharpness line number of the digital signals with different phases, and the phase corresponding to the digital signal with the maximum optimal sharpness line number is the better phase of the mode signal.
the technical scheme provided by the embodiment of the invention can have the following beneficial effects:
the embodiment of the invention provides a method and a device for automatically detecting the phase of a video and a graphic signal, which comprises the following steps: acquiring a mode signal of the same type from multiple paths of the same analog video and graphic signals, wherein one analog video and graphic signal corresponds to one picture, and the type of the mode signal comprises an R signal, a G signal and a B signal, or a Y signal, a Pb signal, a Pr signal and a cvbs signal; generating sampling clocks with different phases according to the current phase control signal; converting the mode signal into digital signals with different phases by using the sampling clocks with different phases; respectively detecting the edge quantity and the sharpness of each line of the digital signals with different phases line by line; respectively counting the edge number of digital signals with different phases, wherein the edge number of the digital signals with different phases is the sum of the edge numbers of all the detected rows of the digital signals with different phases; when the edge number of any phase digital signal is larger than a preset edge number threshold, acquiring a better phase of the mode signal according to the sharpness of each row of the detected digital signals with different phases; updating the phase control signals except the better phase in the different phases to obtain sampling clocks of the phase control signals except the better phase, obtaining digital signals under the updated sampling clocks, comparing the digital signals with the digital signals corresponding to the better phase, and obtaining the optimal phase of the mode signal; and acquiring other types of mode signals from multiple paths of the same analog video and graphic signals, and acquiring the optimal phases of the other types of mode signals until the optimal phases of all types of mode signals are acquired. According to the automatic phase detection method for the video and graphic signals, provided by the embodiment of the invention, the optimal phase of each mode signal in a video and graphic signal receiving or processing system is determined by comparing the edge number and the sharpness of the same line of different phase digital signals converted by sampling clocks with different phases, the unit with the optimal phase is judged as the line of the input analog video and graphic signals, the APD convergence can be realized within the time of hundreds of lines in general to obtain the optimal phase, the convergence time is fast, and the user experience is high.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
in order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
fig. 1 is a schematic flow chart illustrating a method for detecting an automatic phase of video and graphics signals according to an embodiment of the present invention;
Fig. 2 is a schematic flow chart of a method for calculating an edge number according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of a method for obtaining a better phase according to an embodiment of the present invention;
Fig. 4 is a schematic structural diagram of an apparatus for detecting video and graphics signal automatic phases according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The embodiment of the invention provides an automatic phase detection method for video and graphic signals, which is shown in figure 1 and comprises the following steps:
S100: the same type of mode signal is obtained from multiple paths of the same analog video and graphics signals.
in the embodiment of the invention, one digital video and one graphic signal correspond to one picture.
the video and graphic signal automatic phase detection method provided by the implementation of the invention aims at the automatic phase detection of video and graphic signals in a video and graphic signal receiving or processing system, the commonly used video and graphic signal receiving or processing system comprises a video and graphic signal receiving or processing system for receiving VGA signals and a video and graphic signal receiving or processing system for receiving Ypbpr, and for the video and graphic signal receiving or processing system for receiving VGA signals, the types of mode signals comprise R (Red ) signals, G (Green ) signals and B (Blue ) signals; for a Video, graphics Signal receiving or processing system that accepts Ypbpr, the types of the mode Signal include a Y Signal (luminance Signal), a Pb Signal (blue color difference Signal), a Pr Signal (red color difference Signal), and sometimes a cvbs (Composite Video Broadcast Signal) Signal, where the mode Signal is an analog Signal.
in a specific implementation, a certain type of mode signal is typically extracted by a multiplexer. The number of multiplexers is related to the type of mode signal in the video, graphics signal receiving or processing system, e.g. 3 for a video, graphics signal receiving or processing system receiving VGA signals.
In an application scenario, the video and graphic signal receiving or processing system is a system for receiving VGA signals, and R signals are respectively obtained from the same analog video and graphic signals input to 3 multiplexers, so as to obtain 3R signals in total.
S200: according to the current phase control signal, sampling clocks with different phases are generated.
In the embodiment of the present invention, one clock cycle is evenly divided into 32 phases, i.e., -16,15 based on the positive edge of the clock, wherein-16 represents the phase 180 degrees before the default phase of the sampling clock generator, and 15 represents the phase 168.75 degrees after the default phase of the sampling clock generator, so that the range of-16, 15 completely covers the phase of one cycle.
in a specific implementation, the phase control signal is typically issued by a phase controller, and the sampling clock is generated by a sampling clock generator. The sampling clock generator receives the horizontal synchronizing signals in the analog video and graphic signals to determine the formats of the analog video and graphic signals, and generates a plurality of sampling clocks with different phases according to a plurality of current phase control signals sent by the phase controller. For example, the phase control signal of the phase controller is M-phase and N-phase, and the sampling clock generator will generate two sampling clocks, where one sampling clock has M-phase and the other sampling clock has N-phase.
S300: and converting the mode signal into digital signals with different phases by using the sampling clocks with different phases.
in the implementation, an analog-to-digital converter is usually used to convert the analog signal into a digital signal. The number of the analog-to-digital converters is related to the type of the mode signal in the video and graphic signal receiving or processing system, for example, for the video and graphic signal receiving or processing system receiving the VGA signal, the number of the mode signal is 3 corresponding to the number of the analog-to-digital converters.
the analog-digital converters respectively receive the mode signals sent by the multiplexers and simultaneously respectively receive the sampling clocks with different phases sent by the sampling clock generator. The analog-digital converters convert the mode signals into digital signals under a sampling clock, the analog-digital converters convert the mode signals into a plurality of digital signals, and the number of the converted digital signals is matched with the number of the analog-digital converters. Due to the different phases of the sampling clocks adopted by the analog-digital converters, the quality of the plurality of digital signals converted by the analog-digital converters is different.
In an application scenario, there are three analog-to-digital converters, namely a first analog-to-digital converter, a second analog-to-digital converter and a third analog-to-digital converter, which respectively receive R signals sent from the three multiplexers, and a sampling clock generator respectively sends a sampling clock to the first analog-to-digital converter as an a phase, a sampling clock to the second analog-to-digital converter as a B phase, and a sampling clock to the third analog-to-digital converter as a C phase. The first analog-digital converter converts the R signal into a first digital signal according to the sampling clock of the A phase; the second analog-digital converter converts the R signal into a second digital signal according to the sampling clock of the B phase; the third analog-to-digital converter converts the R signal into a third digital signal according to the sampling clock of the C phase. Because the sampling clock phases adopted by the first digital signal, the second digital signal and the third digital signal in the analog-digital conversion are different, the quality of the three digital signals is different.
S400: and detecting the edge quantity and the sharpness of each line of the digital signals with different phases respectively line by line.
since the quality of the digital signals converted under the sampling clocks of different phases is different, it is necessary to detect the quality of each line of the digital signals converted by the same mode signal line by line. The edge detection module is generally used to detect the number of edges and the sharpness of each row of the digital signals with different phases, and the edge detection modules are used to detect the number of edges and the sharpness of each row of the analog-digital signals respectively. In a specific implementation, the number of edge detection modules matches the number of analog-to-digital converters.
in the embodiment of the invention, a plurality of edge detection modules respectively receive digital signals sent by corresponding analog-digital converters, and each edge detection module detects the edge number and the sharpness of each row of the received digital signals line by line. For example, three analog-to-digital converters will convert three digital signals, each digital signal requiring an edge detection module to detect the number of edges and sharpness of each row in the digital signal.
in the embodiment of the invention, the edge number and the sharpness of each line are calculated by a method combining a Laplacian operator and threshold judgment.
In one possible implementation, referring to fig. 2, a specific implementation of step S400 includes:
S401: the preset window size is three pixel points, and pixel difference values of all windows in all rows of the digital signals with different phases are calculated in sequence.
in a specific implementation process, a pixel difference value i of the window is |2b-a-c |, where i is the pixel difference value of the window, b is a pixel value of a middle pixel point of the window, a and c are pixel values of two pixel points other than the middle pixel point of the window, and the middle pixel point of the window is a pixel point located in a middle position among three pixel points of the window.
S402: and judging whether the pixel difference value of the window is larger than a preset difference value threshold value.
it is determined whether the pixel difference value of the window obtained in step S401 is greater than a preset difference threshold value. If the pixel difference value of the window is greater than the preset difference threshold value, step S403 is executed.
S403: the window has an edge.
And if the pixel difference value of the window is greater than a preset difference value threshold value, the window has an edge.
S404: and counting the edge number of each line of the different-phase digital signals, superposing the pixel difference values of all windows with edges in each line of the different-phase digital signals, and calculating to obtain the sharpness of each line of the different-phase digital signals.
in an application scenario, if 5 windows in a first row of a digital signal have edges, the number of the edges of the row is 5; the sharpness of the line is the sum of the pixel differences of the 5 bordered windows.
S500: and respectively counting the edge number of the digital signals with different phases.
In a specific implementation process, the number of edges of the out-of-phase digital signal is the sum of the number of edges of all rows that have been detected by the out-of-phase digital signal.
in an application scenario, an edge detection module detects the number and sharpness of 5 lines of a digital signal of a certain phase to the current time, and then the number of edges of the digital signal at the current time is the sum of the number of edges of the 5 lines. For example, the number of edges of the 5 lines is 3, 5, 1, 7, and 6, respectively, and the number of edges of the digital signal is 3+5+1+7+6 — 22.
s600: and when the edge number of any phase digital signal is greater than a preset edge number threshold, acquiring a better phase of the mode signal according to the sharpness of each row of the detected digital signals with different phases.
When the edge number of the digital signal with any phase detected in step S500 is greater than the threshold value of the preset edge number, the number of samples of the detected digital signal rows with different phases is sufficient, and at this time, the sharpness of each detected digital signal row with different phases at the current moment is compared, so that a better phase of the mode signal can be obtained. For example, the R signal is converted into three digital signals under sampling clocks of three phases, and the three edge detection modules respectively detect the number of edges and sharpness of each row of the corresponding digital signals. The preset edge number threshold is 2000, the edge numbers of three digital signals with different phases at the current moment are 2001, 500 and 1300 respectively, wherein the edge number of one digital signal is greater than 2000, the detected line number is enough, at this moment, the three edge detection modules can stop detecting the edge number and the sharpness, the detected sharpness at the current moment can be compared, and a better phase of the R signal can be obtained.
in a specific implementation process, referring to fig. 3, the obtaining a better phase of the mode signal according to the sharpness of each row of the detected digital signal with different phases includes:
S601: and respectively comparing the sharpness of the digital signals of different phases in each row to obtain the optimal sharpness of each row, wherein the optimal sharpness of each row is the maximum sharpness of the same row of the digital signals of different phases.
in an application scenario, three different-phase digital signals are respectively an A digital signal, a B digital signal and a C digital signal, and at the current moment, three edge detection modules respectively detect the edge number and the sharpness of each 1000 rows of the corresponding digital signals, and the sharpness of the 1 st row of the three different-phase digital signals is compared to obtain the optimal sharpness of the 1 st row, so that the optimal sharpness of each 1000 rows is obtained according to the method. For example, the optimal sharpness of the 1 st row is the sharpness of the 1 st row of the B digital signal.
S602: and respectively counting the optimal sharpness line number of the digital signals with different phases.
and respectively counting the line number of the optimal sharpness of the digital signals with different phases.
In an application scenario, the optimal sharpness of each line is obtained in step S601, and the number of lines of the optimal sharpness of each phase digital signal is counted. For example, the three digital signals with different phases are an a digital signal, a B digital signal and a C digital signal, and the sharpness of the first line of the three digital signals is compared, and if the optimal sharpness of the 1 st line is the sharpness of the 1 st line of the B digital signal, the optimal sharpness line number of the B digital signal is 1; continuing the optimal sharpness of the 2 nd row, and if the optimal sharpness of the 2 nd row is the sharpness of the 2 nd row of the A digital signal, the optimal sharpness row number of the A digital signal is 1; and continuing to compare, and acquiring the optimal sharpness of the 3 rd row, wherein if the optimal sharpness of the 3 rd row is the sharpness of the third row of the A digital signal, the optimal sharpness row number of the A digital signal is the sum of 1 of the optimal sharpness row number of the A digital signal acquired when the first two rows are compared. In the 1 st to 3 rd rows, the optimal number of sharpness rows of the digital signal a is 2, the optimal number of sharpness rows of the digital signal B is 1, and the optimal number of sharpness rows of the digital signal C is 0. And continuously counting the optimal sharpness line number of each digital signal in the 1000 th line according to the method, wherein the optimal sharpness line number of the digital signals such as the A digital signal, the B digital signal and the C digital signal is respectively 500, 200 and 300.
S603: and comparing the optimal sharpness line number of the digital signals with different phases, wherein the phase corresponding to the digital signal with the maximum optimal sharpness line number is the better phase of the mode signal.
And comparing the optimal sharpness line number of the digital signals with different phases obtained in the step S602 to obtain a digital signal with the maximum optimal sharpness line number, where the phase corresponding to the digital signal is a better phase of the mode signal. For example, the R signal is converted into an a digital signal, a B digital signal, and a C digital signal under A, B, C sampling clocks with different phases, the optimal number of rows of sharpness of the a digital signal is 500, the optimal number of rows of sharpness of the B digital signal is 200, and the optimal number of rows of sharpness of the C digital signal is 300 obtained through step S602.
S700: and updating the phase control signals except the better phase in the different phases to obtain the sampling clock of the phase control signals except the better phase, obtaining the digital signals under the updated sampling clock, and comparing the digital signals with the digital signals corresponding to the better phase to obtain the optimal phase of the mode signal.
since there are 32 phases in one clock cycle, the better phase of the different phases is obtained in step S600, and the digital signals in the sampling clocks of other phases need to be obtained and compared with the digital signals in the better phase. In a specific implementation process, the phase control signals except for the better phase in the different phases are updated to obtain the sampling clocks of the phase control signals except for the better phase, the digital signals under the updated sampling clocks are obtained and compared with the digital signals of the better phase, and the obtained better phase is the optimal phase corresponding to the mode signal after the comparison of all the digital signals under the sampling clocks of 32 phases is completed.
In an application scenario, the step S600 obtains the better phase of the R signal in the three different phases of-16, -15, -14 as-15, and updates the phase control signal corresponding to-16 and-14, the phase controller sends the updated phase control signal to the sampling clock generator, so that the sampling clock generator generates the sampling clocks in the three phases of-13 and-12 and sends the sampling clocks to the analog-to-digital converters, respectively, the three analog-to-digital converters convert the R signal into three digital signals in the three phases of-13, -15 and-12, respectively, and the digital signals corresponding to-13 and-12 are compared with the digital signals in the phase of-15, so as to obtain the better phase in the three phases, for example, the better phase in the three phases is-12; and continuously updating the current phase control signal until the quality of the digital signals under the sampling clocks with 32 phases in the range of [ -16,15] is completely compared, and at the moment, the obtained better phase is 3, so that the 3 phase is the corresponding optimal phase of the R signal.
S800: and acquiring other types of mode signals from multiple paths of the same analog video and graphic signals, and acquiring the optimal phases of the other types of mode signals until the optimal phases of all types of mode signals are acquired.
in the specific implementation process, step S700 obtains the optimal phase corresponding to one type of mode signal, and for a video and graphics signal receiving or processing system receiving VGA signals or a video and graphics signal receiving or processing system receiving Ypbpr, there are 3 or 4 types of mode signals, and after finding the optimal phase of one mode signal, it needs to find the optimal phase of another mode signal. In the specific implementation process, the process returns to step S100, and obtains other types of mode signals from multiple paths of the same analog video and graphics signals, and obtains the optimal phases of the sampling clock generators corresponding to the other types of mode signals until obtaining the optimal phases corresponding to all types of mode signals.
In an application scenario, in a video and graphic signal receiving or processing system receiving VGA signals, there are three types of mode signals, namely, R signal, G signal and B signal, and in a specific implementation process, an optimal phase corresponding to the R signal is obtained first, then an optimal phase corresponding to the G signal is obtained, and finally an optimal phase corresponding to the B signal is obtained.
In the embodiment of the invention, after the optimal phases corresponding to all types of mode signals are obtained, the phase controller sends the phase control signals of the optimal phases corresponding to all types of mode signals to the sampling clock generator, so that the sampling clock generator respectively generates the sampling clocks of the optimal phases of all types of mode signals; and respectively sent to each analog-to-digital converter, and a plurality of multiplexers respectively select different types of mode signals and send the mode signals to the corresponding analog-to-digital converters. All types of mode signals are converted into digital signals under the sampling clock with the optimal phase, so that the video and graphic quality of the finally obtained digital signals is optimal.
the embodiment of the invention provides an automatic phase detection method for video and graphic signals, which comprises the following steps: acquiring a mode signal of the same type from multiple paths of the same analog video and graphic signals, wherein one analog video and graphic signal corresponds to one picture, and the type of the mode signal comprises an R signal, a G signal and a B signal, or a Y signal, a Pb signal, a Pr signal and a cvbs signal; generating sampling clocks with different phases according to the current phase control signal; converting the mode signal into digital signals with different phases by using the sampling clocks with different phases; respectively detecting the edge quantity and the sharpness of each line of the digital signals with different phases line by line; respectively counting the edge number of digital signals with different phases, wherein the edge number of the digital signals with different phases is the sum of the edge numbers of all the detected rows of the digital signals with different phases; when the edge number of any phase digital signal is larger than a preset edge number threshold, acquiring a better phase of the mode signal according to the sharpness of each row of the detected digital signals with different phases; updating the phase control signals except the better phase in the different phases to obtain sampling clocks of the phase control signals except the better phase, obtaining digital signals under the updated sampling clocks, comparing the digital signals with the digital signals corresponding to the better phase, and obtaining the optimal phase of the mode signal; and acquiring other types of mode signals from multiple paths of the same analog video and graphic signals, and acquiring the optimal phases of the other types of mode signals until the optimal phases of all types of mode signals are acquired. According to the automatic phase detection method for the video and graphic signals, provided by the embodiment of the invention, the optimal phase of each mode signal in a video and graphic signal receiving or processing system is determined by comparing the edge number and the sharpness of the same line of different phase digital signals converted by sampling clocks with different phases, the unit with the optimal phase is judged as the line of the input analog video and graphic signals, the APD convergence can be realized within the time of hundreds of lines in general to obtain the optimal phase, the convergence time is fast, and the user experience is high.
based on the same inventive concept, an embodiment of the present invention further provides an apparatus for detecting an automatic phase of a video and graphics signal, as shown in fig. 4, including: a number of multiplexers 100, a number of analog-to-digital converters 200, a number of edge detection modules 300, a sampling clock generator 400, and a phase controller 500, wherein,
the multiplexers 100 are used for receiving the same input analog video and graphics signals and selecting the same type of mode signals, wherein one digital video and graphics signal corresponds to one picture.
The sampling clock generator 400 is coupled to the phase controller, and is configured to generate a plurality of sampling clocks with different phases according to a plurality of current phase control signals, and respectively send the sampling clocks to the analog-to-digital converter 200.
In a specific implementation process, the sampling clock generator 400 receives line synchronization signals in analog video and graphics signals to determine formats of the analog video and graphics signals, generates a plurality of sampling clocks with different phases according to a plurality of current phase control signals, and sends the sampling clocks to the analog-to-digital converter 200 respectively.
the analog-to-digital converter 200 is correspondingly coupled to the multiplexer 100 one by one, and the analog-to-digital converter 200 is configured to receive the mode signal sent by the multiplexer, convert the mode signal into a digital signal according to the sampling clock sent by the sampling clock generator 400, and send the digital signal to the corresponding edge detection module 300.
in the implementation, the number of the analog-to-digital converters 200 is related to the type of video, graphics signal receiving or processing system mode signal, for example: the video and graphic signal receiving or processing system receives VGA signals, the types of the mode signals are three, namely R signals, G signals and B signals, and correspondingly, the number of the analog-digital converters is 3.
The edge detection module 300 is correspondingly coupled to the adc 200 one by one, the number of the edge detection module 300 and the number of the multiplexer 100 are both matched with the number of the adc 200, and the edge detection module 300 is configured to detect the number of edges and the sharpness of each line of the received digital signal line by line, and send the detection result to the phase controller 500.
In an application scenario, for a video and graphic signal receiving or processing system receiving VGA signals, there are three types of mode signals, which are R signals, G signals and B signals, correspondingly, the number of the analog-to-digital converters is 3, and the number of the edge detection modules 300 and the number of the multiplexers 100 are also 3.
In one possible embodiment, the edge detection module 300 includes a pixel difference value calculation unit, a difference value judgment unit, an edge determination unit, and an edge number and sharpness acquisition unit.
The pixel difference value calculating unit is configured to preset a window size as three pixel points, and sequentially calculate pixel difference values of all windows in each row of the digital signals with different phases, where i is a pixel difference value of the window, b is a pixel value of a middle pixel point of the window, and a and c are pixel values of two pixel points other than the middle pixel point of the window.
and the difference value judging unit is used for judging whether the pixel difference value of the window is greater than a preset difference value threshold value.
And the edge determining unit is used for determining that the window has an edge if the pixel difference value of the window is greater than a preset difference value threshold.
The edge number and sharpness obtaining unit is used for counting the edge number of each line of the different-phase digital signals, superposing the pixel difference values of all windows with edges in each line of the different-phase digital signals, and calculating to obtain the sharpness of each line of the different-phase digital signals.
The phase controller 500 is respectively coupled to the edge detection modules 300, and the phase controller 500 is configured to generate a plurality of phase control signals, send the phase control signals to the sampling clock generator 400, and receive and compare detection results sent by the edge detection modules 300 to obtain an optimal phase of the sampling clock generator 400 corresponding to the mode signal.
in a specific implementation, the phase controller 500 includes a digital signal edge number statistic module and a better phase obtaining module, wherein,
The edge number counting module is used for counting the edge numbers of different-phase digital signals respectively, wherein the edge numbers of the different-phase digital signals are the sum of the edge numbers of all the detected rows of the different-phase digital signals.
the better phase acquisition module is used for acquiring a better phase of the mode signal according to the sharpness of each row of the detected digital signals with different phases when the edge number of any phase digital signal is greater than a preset edge number threshold. In a specific implementation process, the better phase acquisition module includes an edge number judgment unit, and the edge number judgment unit is configured to judge whether the edge number of any phase digital signal at the current time is greater than a preset edge number threshold.
in one possible embodiment, the better phase acquisition module comprises: the device comprises an optimal sharpness obtaining unit, a statistical unit and a comparison unit.
The optimal sharpness obtaining unit is used for respectively comparing the sharpness of the digital signals of different phases in each row to obtain the optimal sharpness of each row, wherein the optimal sharpness of each row is the maximum value of the sharpness of the same row of the digital signals of different phases;
The statistical unit is used for respectively carrying out statistics on the optimal sharpness line number of the digital signals with different phases;
the comparison unit is configured to compare the optimal sharpness line number of the digital signals with different phases, where a phase corresponding to the digital signal with the largest optimal sharpness line number is a better phase of the mode signal.
in the embodiment of the present invention, the types of the mode signal include an R signal, a G signal, and a B signal, or a Y signal, a Pb signal, a Pr signal, and a cvbs signal.
other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (6)

1. A method for automatic phase detection of video and graphics signals, comprising:
Acquiring a mode signal of the same type from multiple paths of the same analog video and graphic signals, wherein one analog video and graphic signal corresponds to one picture, and the type of the mode signal comprises an R signal, a G signal and a B signal, or a brightness Y signal, a blue color difference Pb signal, a red color difference Pr signal, or a composite video broadcast cvbs signal;
generating sampling clocks with different phases according to the current phase control signal;
Converting the mode signal into digital signals with different phases by using the sampling clocks with different phases;
respectively detecting the edge quantity and the sharpness of each line of the digital signals with different phases line by line;
Respectively counting the edge number of digital signals with different phases, wherein the edge number of the digital signals with different phases is the sum of the edge numbers of all the detected rows of the digital signals with different phases;
When the edge number of any phase digital signal is larger than a preset edge number threshold, acquiring a better phase of the mode signal according to the sharpness of each row of the detected digital signals with different phases, wherein the better phase refers to the best phase obtained according to the sharpness of each row of the digital signals in the detected different phases;
Updating the phase control signals except the better phase in the different phases to obtain sampling clocks of the phase control signals except the better phase, obtaining digital signals under the updated sampling clocks, comparing the digital signals with the digital signals corresponding to the better phase, and obtaining the optimal phase of the mode signal;
and acquiring other types of mode signals from multiple paths of the same analog video and graphic signals, and acquiring the optimal phases of the other types of mode signals until the optimal phases of all types of mode signals are acquired.
2. the method of claim 1, wherein the detecting the edge number and sharpness of each line of the digital signals with different phases line by line comprises:
Presetting a window size as three pixel points, and sequentially calculating pixel difference values of all windows in each row of the digital signals with different phases, wherein the pixel difference value i of the window is |2b-a-c |, i is the pixel difference value of the window, b is the pixel value of a middle pixel point of the window, and a and c are the pixel values of two pixel points except the middle pixel point of the window respectively;
judging whether the pixel difference value of the window is larger than a preset difference value threshold value or not;
if the pixel difference value of the window is larger than a preset difference value threshold value, the window has an edge;
And counting the edge number of each line of the different-phase digital signals, superposing the pixel difference values of all windows with edges in each line of the different-phase digital signals, and calculating to obtain the sharpness of each line of the different-phase digital signals.
3. The method of claim 1, wherein said obtaining the better phase of the mode signal according to the sharpness of each row of the digital signal with different phase detected comprises:
Respectively comparing the sharpness of the digital signals of different phases in each row to obtain the optimal sharpness of each row, wherein the optimal sharpness of each row is the maximum value of the sharpness of the same row of the digital signals of different phases;
respectively counting the optimal sharpness line number of the digital signals with different phases;
And comparing the optimal sharpness line number of the digital signals with different phases, wherein the phase corresponding to the digital signal with the maximum optimal sharpness line number is the better phase of the mode signal.
4. An apparatus for automatic phase detection of video and graphics signals, comprising: a plurality of multiplexers, a plurality of analog-to-digital converters, a plurality of edge detection modules, a sampling clock generator, and a phase controller,
The multiple multiplexers are used for receiving the same input analog video and graphic signal and selecting the same type of mode signal, wherein one digital video and graphic signal corresponds to one picture;
the sampling clock generator is coupled with the phase controller and used for generating a plurality of sampling clocks with different phases according to a plurality of current phase control signals and respectively sending the sampling clocks to the analog-digital converter;
The analog-digital converters are coupled with the multiplexers one by one correspondingly, and are used for receiving the mode signals sent by the multiplexers, converting the mode signals into digital signals according to the sampling clocks sent by the sampling clock generators, and sending the digital signals to the corresponding edge detection modules;
The edge detection module is coupled with the analog-digital converters one by one correspondingly, the number of the edge detection module and the number of the multiplexers are matched with the number of the analog-digital converters, and the edge detection module is used for detecting the edge number and the sharpness of each line of the received digital signals line by line and sending the detection result to the phase controller;
The phase controllers are respectively coupled with the edge detection modules and are used for generating a plurality of phase control signals, sending the phase control signals to the sampling clock generator, receiving detection results sent by the edge detection modules and comparing the detection results to obtain the optimal phase corresponding to the mode signals;
the phase controller comprises a digital signal edge number statistic module and a better phase acquisition module, wherein,
The edge number counting module is used for respectively counting the edge numbers of different-phase digital signals, wherein the edge numbers of the different-phase digital signals are the sum of the edge numbers of all the detected rows of the different-phase digital signals;
The better phase acquisition module is used for acquiring a better phase of the mode signal according to the sharpness of each row of the detected digital signals with different phases when the edge number of any phase digital signal is greater than a preset edge number threshold, wherein the better phase refers to the best phase obtained according to the sharpness of each row of the digital signals in the detected different phases;
The types of the mode signals include an R signal, a G signal, and a B signal, or a luminance Y signal, a blue color difference Pb signal, a red color difference Pr signal, or a composite video broadcasting cvbs signal.
5. The apparatus of claim 4, wherein the edge detection module comprises:
The pixel difference value calculating unit is used for presetting the size of a window as three pixel points and calculating the pixel difference values of all the windows in each row of the digital signals with different phases in sequence, wherein the pixel difference value i of the window is |2b-a-c |, i is the pixel difference value of the window, b is the pixel value of a middle pixel point of the window, and a and c are the pixel values of two pixel points except the middle pixel point of the window respectively;
the difference value judging unit is used for judging whether the pixel difference value of the window is larger than a preset difference value threshold value or not;
An edge determining unit, configured to determine that the window has an edge if the pixel difference value of the window is greater than a preset difference threshold value;
And the edge number and sharpness acquisition unit is used for counting the edge number of each line of the different-phase digital signals, superposing the pixel difference values of all windows with edges in each line of the different-phase digital signals, and calculating to obtain the sharpness of each line of the different-phase digital signals.
6. The apparatus of claim 4, wherein the preferred phase acquisition module comprises:
the optimal sharpness obtaining unit is used for respectively comparing the sharpness of the digital signals of different phases in each row to obtain the optimal sharpness of each row, wherein the optimal sharpness of each row is the maximum value of the sharpness of the same row of the digital signals of different phases;
The statistical unit is used for respectively carrying out statistics on the optimal sharpness line number of the digital signals with different phases;
and the comparison unit is used for comparing the optimal sharpness line number of the digital signals with different phases, and the phase corresponding to the digital signal with the maximum optimal sharpness line number is the better phase of the mode signal.
CN201611185043.7A 2016-12-20 2016-12-20 automatic phase detection method and device for video and graphic signals Active CN106791276B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611185043.7A CN106791276B (en) 2016-12-20 2016-12-20 automatic phase detection method and device for video and graphic signals

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611185043.7A CN106791276B (en) 2016-12-20 2016-12-20 automatic phase detection method and device for video and graphic signals

Publications (2)

Publication Number Publication Date
CN106791276A CN106791276A (en) 2017-05-31
CN106791276B true CN106791276B (en) 2019-12-10

Family

ID=58894075

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611185043.7A Active CN106791276B (en) 2016-12-20 2016-12-20 automatic phase detection method and device for video and graphic signals

Country Status (1)

Country Link
CN (1) CN106791276B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114500767A (en) * 2020-11-12 2022-05-13 西安诺瓦星云科技股份有限公司 Input video source adjusting method and device, video input card and video processing equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1148697A (en) * 1995-07-27 1997-04-30 株式会社日立制作所 Vision signal treatment device for automatic regulating phase position of sample clock
CN1281154A (en) * 1999-07-20 2001-01-24 三星电子株式会社 Device and method for automatic control of liquid crystal display equipment screen state
CN101977284A (en) * 2010-11-29 2011-02-16 杭州海康威视软件有限公司 Image pickup system and image pickup method
CN102006447A (en) * 2009-08-26 2011-04-06 晨星软件研发(深圳)有限公司 Apparatus for auto phase detection for video signal and method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105122305B (en) * 2013-01-22 2018-10-30 美国莱迪思半导体公司 Mechanism for benefiting the dynamic phasing detection to the high-jitter-tolerance of the image of Media Stream

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1148697A (en) * 1995-07-27 1997-04-30 株式会社日立制作所 Vision signal treatment device for automatic regulating phase position of sample clock
CN1281154A (en) * 1999-07-20 2001-01-24 三星电子株式会社 Device and method for automatic control of liquid crystal display equipment screen state
CN102006447A (en) * 2009-08-26 2011-04-06 晨星软件研发(深圳)有限公司 Apparatus for auto phase detection for video signal and method thereof
CN101977284A (en) * 2010-11-29 2011-02-16 杭州海康威视软件有限公司 Image pickup system and image pickup method

Also Published As

Publication number Publication date
CN106791276A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
US6285344B1 (en) Automatic adjustment of color balance and other display parameters in digital displays
CA1150825A (en) Total raster error correction apparatus and method for the automatic set up of television cameras and the like
CN201011732Y (en) Video signal confirming device and video display device
US20030025813A1 (en) Method of detecting defective pixels of a solid-state image-pickup device and image-pickup apparatus using the same
CN106791276B (en) automatic phase detection method and device for video and graphic signals
CN107071396A (en) For the method for test video system, device and computer program product
US8164689B2 (en) Synchronizing signal control circuit and synchronizing signal control method
KR20010076040A (en) Appratus and method for inspecting screen quality
JPH10200911A (en) System and method for automatically correcting registration error in color television camera
KR101809644B1 (en) 4K based master switcher apparatus possible SDR and HDR processing
CN101006719A (en) Video format detector and integrated circuit comprising such video format detector as well as method for distinguishing different standards and/or types of video formats
US4500916A (en) Automatic on-air registration system and method for color TV camera
CN100570679C (en) The digital phase correcting method and system
JP3510640B2 (en) Television camera equipment
US7925106B2 (en) Apparatus and method for detecting motion in continuous images
US8896756B2 (en) Display apparatus
JPS58221578A (en) Display controller of picture information
US20050122431A1 (en) Digital signal processing system and method applied for chroma transition
CN110381324A (en) A kind of frame interpolated value interlace-removing method based on edge detection
JPS598990B2 (en) Scanning position deviation correction device for color television camera
US5455620A (en) Automatic generation of vector reference graticules
JP2004242130A (en) Signal generating device and method for measuring video/audio transmission time difference, and signal analysis device and method therefor
KR20010076835A (en) Auto white balancing device and method of digital camera
JP2536675B2 (en) Luminance signal Color signal separation filter
JPH0368293A (en) Automatic phase adjustment system for high definition television signal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20170531

Assignee: Shandong industry research information and Artificial Intelligence Integration Research Institute Co.,Ltd.

Assignor: HUNAN GOKE MICROELECTRONICS Co.,Ltd.

Contract record no.: X2021430000001

Denomination of invention: A method and device for automatic phase detection of video and graphic signals

Granted publication date: 20191210

License type: Common License

Record date: 20210115

EE01 Entry into force of recordation of patent licensing contract