Field sequence detection method, device, storage medium and chip for odd and even field data
By collecting and analyzing the parity field data in video frames and determining its parity field properties, the problem of difficulty in real-time, fast and accurate detection of field sequence errors in the prior art is solved, and fast and accurate field sequence detection and correction are achieved, improving Video quality.
Patent Information
- Application Number
- CN202411573122.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-11-06
AI Technical Summary
The prior art is difficult to detect whether the field sequence of parity field data is incorrect in real time, quickly and accurately, resulting in motion artifacts or jagging that may occur during video playback, seriously affecting image quality.
By collecting the field data of the nth field from the video frame, the field data of the insertion field is calculated, and the parity field properties of the nth field are determined based on the alignment relationship between the insertion field and the field data of the previous field, and then the field is detected. Is the order correct?
It realizes rapid detection of whether field order reversal occurs. By analyzing the differences between continuous field data, the continuity and consistency between fields are evaluated. The calculation amount is small, and the field order errors can be corrected in real time and accurately.
Smart Images

Figure CN119071475B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip technology, and in particular to a field sequence detection method, device, storage medium and chip for odd and even field data. Background Art
[0002] Interlaced scanning of video frames in a video can obtain field data of odd fields and field data of even fields. Taking the first line numbered 1 as an example, the odd horizontal scan lines (1, 3, 5...) in each video frame are first collected and displayed, and then the even horizontal scan lines (2, 4, 6...) in each video frame are collected and displayed. In this way, each video frame is actually composed of odd and even fields, and they are displayed alternately. One of the main purposes of interlaced scanning is to reduce bandwidth requirements while maintaining a higher frame rate.
[0003] During interlaced video capture, the correct field order of odd and even fields is critical to maintaining video quality. If a field is lost during the acquisition or transmission of odd and even fields, the field order of odd and even fields may be reversed, causing a series of problems during video playback. This situation is usually called field order error or field order inversion, and motion artifacts or aliasing may occur, seriously affecting image quality. Figure 1 A diagram showing an odd and even field sequence error, Figure 2 The diagram shows that the field order of odd and even fields is correct.
[0004] Although existing technologies attempt to detect and correct these errors through various mechanisms, there is still a lack of an efficient solution that can perform such operations in real time, quickly, and accurately. Summary of the invention
[0005] The present application provides a method, device, storage medium and chip for detecting the field sequence of odd and even field data, which are used to solve the problem that it is impossible to detect whether the field sequence of odd and even field data is wrong in real time, quickly and accurately. The technical solution is as follows:
[0006] According to a first aspect of the present application, a field sequence detection method for odd and even field data is provided, the method comprising:
[0007] Collect the field data of the nth field from the video frame according to the scanning rule of odd and even fields, where n≥2;
[0008] Calculate the field data of the inserted field according to the inter-line average value of the field data of the nth field;
[0009] Obtain the field data and odd and even field attributes of the collected n-1th field;
[0010] Determining an even-odd field attribute of the nth field according to an alignment relationship between the inserted field and the field data of the n-1th field;
[0011] Whether the field sequence is correct is detected according to the odd and even field attributes of the n-1th field and the nth field.
[0012] In a possible implementation manner, determining the odd-even field attribute of the nth field according to the alignment relationship between the inserted field and the field data of the n-1th field includes:
[0013] Extracting first field data and second field data from the field data of the n-1th field, wherein the first field data is field data from the first row to the second to last row, and the second field data is field data from the second row to the last row;
[0014] selecting field data aligned with the field data of the insertion field from the first field data and the second field data;
[0015] If the field data aligned with the inserted field is the first field data, determining the parity field attribute of the nth field to be an even field;
[0016] If the field data aligned with the inserted field is the second field data, the parity field attribute of the nth field is determined to be an odd field.
[0017] In a possible implementation, the selecting, from the first field data and the second field data, field data aligned with the field data of the inserted field includes:
[0018] Calculating a first difference cumulative value between the first field data and the field data of the inserted field;
[0019] calculating a second difference cumulative value between the second field data and the field data of the inserted field;
[0020] If the first difference cumulative value is greater than the second difference cumulative value, determining that the field data aligned with the inserted field is the second field data;
[0021] If the first difference cumulative value is smaller than the second difference cumulative value, it is determined that the first field data is aligned with the field data of the inserted field.
[0022] In a possible implementation manner, the calculating a first difference cumulative value between the first field data and the field data of the inserted field includes:
[0023] sorting the number of rows of the first field data and the field data of the inserted field respectively;
[0024] Calculating a difference value for data in the same row of the first field data and the field data of the inserted field;
[0025] All difference values are added together to obtain the first difference cumulative value.
[0026] In a possible implementation manner, the calculating a second difference cumulative value between the second field data and the field data of the inserted field includes:
[0027] sorting the number of rows of the second field data and the field data of the inserted field respectively;
[0028] Calculating a difference value for data in the same row of the second field data and the field data of the inserted field;
[0029] The second difference cumulative value is obtained by adding up all the difference values.
[0030] In a possible implementation manner, detecting whether the field sequence is correct according to the odd and even field attributes of the n-1th field and the nth field includes:
[0031] Detecting whether the odd and even field attributes of the n-1th field and the nth field are the same;
[0032] If the odd and even field attributes of the n-1th field and the nth field are different, it is determined that the field sequence is correct;
[0033] If the odd and even field attributes of the n-1th field and the nth field are the same, it is determined that the field sequence is wrong.
[0034] In a possible implementation, the method further includes:
[0035] Collecting field data of the first field from the video frame according to the scanning rule of odd and even fields;
[0036] The parity field attribute of the first field is determined to be an odd field.
[0037] According to a second aspect of the present application, a field sequence detection device for odd and even field data is provided, the device comprising:
[0038] The acquisition module is used to acquire field data of the nth field from the video frame according to the scanning rule of the odd and even fields, where n≥2;
[0039] A calculation module, used for calculating the field data of the inserted field according to the inter-line mean value of the field data of the nth field;
[0040] An acquisition module, used for acquiring field data and odd and even field attributes of the collected n-1th field;
[0041] A determination module, configured to determine an even-odd field attribute of the nth field according to an alignment relationship between the inserted field and the field data of the n-1th field;
[0042] The detection module is used to detect whether the field sequence is correct according to the odd and even field attributes of the n-1th field and the nth field.
[0043] According to a third aspect of the present application, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the field sequence detection method for odd and even field data as described above.
[0044] According to a fourth aspect of the present application, a chip is provided, the chip comprising the above-mentioned field sequence detection device for odd and even field data.
[0045] The beneficial effects of the technical solution provided by this application include at least:
[0046] When the nth field is an even field, the field data of the inserted field of the even field should be aligned with the field data from the second line to the last line of the n-1th field; when the nth field is an odd field, the field data of the inserted field of the odd field should be aligned with the field data from the first line to the second to last line of the n-1th field. According to this characteristic, the odd and even field properties of the nth field can be determined according to the alignment relationship between the inserted field and the field data of the n-1th field, and then the correctness of the field sequence can be detected according to the odd and even field properties of the n-1th field and the nth field. In this way, the continuity and consistency between the fields can be evaluated by analyzing the differences (in space) between consecutive field data, and the amount of calculation is small, so that it is possible to quickly detect whether the field sequence reversal occurs. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 It is a schematic diagram of an odd-even field sequence error;
[0049] Figure 2 It is a schematic diagram of the correct order of odd and even fields;
[0050] Figure 3 It is a schematic diagram of the alignment relationship between the inserted field and the previous field;
[0051] Figure 4 is a flow chart of a method for detecting the field sequence of odd and even field data provided by an embodiment of the present application;
[0052] Figure 5 is a flow chart of a method for detecting the field sequence of odd and even field data provided by an embodiment of the present application;
[0053] Figure 6is a flow chart of collecting odd and even field data provided by an embodiment of the present application;
[0054] Figure 7 is a flow chart of alignment detection of odd and even field data provided by an embodiment of the present application;
[0055] Figure 8 It is a structural block diagram of a field sequence detection device for odd and even field data provided by an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0057] When collecting field data of odd fields and even fields in a video frame, the field data of the previous field and the current field are separated by one line in the vertical direction. Then, the field data of the current field is averaged between lines and a line is inserted. The field data of the inserted field is theoretically aligned with the field data of the previous field in the vertical direction.
[0058] like Figure 3 As shown, the serial number of the first row is 1. If the current field (Current Field, CF) is an even field (that is, CF even), the field data of the inserted field of the even field should be aligned with the field data of the second row to the last row of the previous field (Prev Field, PF) (that is, the second row, third row, fourth row, ..., height / 2 of PF odd, height represents the height of the video frame); if the current field is an odd field (that is, CF odd), the field data of the inserted field of the odd field should be aligned with the field data of the first row to the second to last row of the previous field (that is, PF even) (that is, the first row, second row, third row, ..., h / 2-1 of PF even).
[0059] like Figure 4 As shown, it shows a method flow chart of a method for detecting the field sequence of odd and even field data provided by an embodiment of the present application, and the method for detecting the field sequence of odd and even field data can be applied to a chip. The method for detecting the field sequence of odd and even field data may include:
[0060] Step 401, collecting field data of the nth field from a video frame according to a scanning rule of odd and even fields, where n≥2.
[0061] The scanning rule of the odd-even field is to collect and display the odd-numbered horizontal scan lines (1, 3, 5...) in each video frame, and to collect and display the even-numbered horizontal scan lines (2, 4, 6...) in each video frame.
[0062] In this embodiment, the entire video frame can be scanned according to the scanning rule to obtain the nth field data. Optionally, when the resolution of the video frame is high, a window can be selected at the center of the video frame, and the data in the window can be scanned according to the scanning rule to obtain the nth field data, so as to reduce the amount of field data, thereby reducing the amount of calculation and speeding up the detection speed. Among them, the collected nth field may be an even field or an odd field.
[0063] Step 402: Calculate the field data of the inserted field according to the inter-line average of the field data of the nth field.
[0064] For the field data of the nth field, take every two rows of field data to perform average calculation to obtain an inserted row of data; all inserted rows of data are referred to as field data of the inserted field.
[0065] Step 403, obtaining the field data and odd and even field attributes of the collected (n-1)th field.
[0066] The odd-even field attribute includes odd fields and even fields.
[0067] The parity field attribute of the n-1th field may be an odd field or an even field.
[0068] Step 404: determine the odd-even field attribute of the nth field according to the alignment relationship between the inserted field and the field data of the n-1th field.
[0069] When the nth field is an even field, the field data of the inserted field of the even field should be aligned with the field data from the second row to the last row of the n-1th field; when the nth field is an odd field, the field data of the inserted field of the odd field should be aligned with the field data from the first row to the second to last row of the n-1th field. Based on this feature, we can determine the odd and even field attributes of the nth field according to the alignment relationship.
[0070] Step 405: Check whether the field sequence is correct based on the odd and even field attributes of the n-1th field and the nth field.
[0071] If the odd and even field attributes of the n-1th field are the same as the odd and even field attributes of the nth field, it is determined that the field sequence is incorrect; if the odd and even field attributes of the n-1th field are different from the odd and even field attributes of the nth field, it is determined that the field sequence is correct.
[0072] Assuming that the n-1th field is an even field and the nth field is an odd field, the field order is correct; assuming that the n-1th field is an even field and the nth field is an even field, the field order is incorrect; assuming that the n-1th field is an odd field and the nth field is an even field, the field order is correct; assuming that the n-1th field is an odd field and the nth field is an odd field, the field order is incorrect.
[0073] In summary, the field sequence detection method for odd and even field data provided in the embodiment of the present application is that when the nth field is an even field, the field data of the inserted field of the even field should be aligned with the field data from the second row to the last row of the n-1th field; when the nth field is an odd field, the field data of the inserted field of the odd field should be aligned with the field data from the first row to the second to last row of the n-1th field. According to this characteristic, the odd and even field properties of the nth field can be determined according to the alignment relationship between the inserted field and the field data of the n-1th field, and then whether the field sequence is correct can be detected according to the odd and even field properties of the n-1th field and the nth field. In this way, the continuity and consistency between the fields can be evaluated by analyzing the differences (in space) between consecutive field data, and the amount of calculation is small, so that it is possible to quickly detect whether the field sequence reversal occurs.
[0074] like Figure 5 As shown, it shows a flow chart of a method for detecting the field sequence of odd and even field data provided by an embodiment of the present application, and the method for detecting the field sequence of odd and even field data can be applied to a chip. The method for detecting the field sequence of odd and even field data can include:
[0075] Step 501, collecting field data of the nth field from a video frame according to a scanning rule of odd and even fields, where n≥2.
[0076] In this embodiment, the entire video frame can be scanned according to the scanning rule to obtain the nth field data. Optionally, when the resolution of the video frame is high, a window can be selected at the center of the video frame, and the data in the window can be scanned according to the scanning rule to obtain the nth field data, so as to reduce the amount of field data, thereby reducing the amount of calculation and speeding up the detection speed.
[0077] The following takes scanning the entire video frame to collect field data as an example to illustrate the process of collecting field data.
[0078] For each video, video frames are extracted from the video at a predetermined sampling frequency; for the first extracted video frame, if the sequence number of the first row in the video frame is 1, the field data of the first field is collected from the video frame according to the scanning rule of the odd and even fields, and the odd and even field attribute of the first field is determined to be an odd field. Figure 6 The acquisition process for each field is shown:
[0079] (1) Get the field data of the first field, store the field data of the first field into CF, and set the odd-even field attribute OddEvenTag_CF = 1, indicating that the first field is an odd field.
[0080] (2) Store the field data of the first field into PF and set the parity field attribute OddEvenTag_PF = 1; obtain the field data of the second field, store the field data of the second field into CF, and set the parity field attribute OddEvenTag_CF = 0, indicating that the second field is an even field.
[0081] (3) Store the field data of the second field into PF, set the odd-even field attribute OddEvenTag_PF = 0; obtain the field data of the third field, store the field data of the third field into CF, set the odd-even field attribute OddEvenTag_CF = 1, indicating that the third field is an odd field. And so on.
[0082] The nth field collected in this step may be an even field or an odd field.
[0083] Step 502: Calculate the field data of the inserted field according to the inter-line average value of the field data of the nth field.
[0084] For the field data of the nth field, take every two rows of field data to perform average calculation to obtain an inserted row of data; all inserted rows of data are referred to as field data of the inserted field.
[0085] Step 503: Acquire the field data and odd and even field attributes of the collected (n-1)th field.
[0086] The odd-even field attribute includes odd fields and even fields.
[0087] The parity field attribute of the n-1th field may be an odd field or an even field.
[0088] Step 504, extracting first field data and second field data from the field data of the n-1th field, the first field data is the field data from the first line to the second to last line, and the second field data is the field data from the second line to the last line.
[0089] like Figure 7 As shown, the size of the video frame is width×height, and the size of the field data is width×(height / 2). The field data of the n-1th field is denoted as PF, the first field data is from the 1st line to the height / 2-1th line, denoted as PF_1, and the second field data is denoted as PF_2.
[0090] Step 505: Select field data aligned with the field data of the inserted field from the first field data and the second field data.
[0091] In this embodiment, the difference accumulation value SAD (Sum of absolute differences) can be used to determine which line of the inserted field and the (n-1)th field are aligned.
[0092] Selecting the field data aligned with the field data of the inserted field from the first field data and the second field data may include the following steps:
[0093] (1) Calculate a first difference cumulative value between the first field data and the field data of the inserted field.
[0094] Specifically, calculating the first difference cumulative value between the first field data and the field data of the inserted field may include: sorting the number of rows of the first field data and the field data of the inserted field respectively; calculating the difference value of the data in the same row of the first field data and the field data of the inserted field; and adding all the difference values to obtain the first difference cumulative value SAD_1.
[0095] (2) Calculate a second difference cumulative value between the second field data and the field data of the inserted field.
[0096] Specifically, calculating the second difference cumulative value between the second field data and the field data of the inserted field may include: sorting the number of rows of the second field data and the field data of the inserted field respectively; calculating the difference value of the data in the same row of the second field data and the field data of the inserted field; and adding all the difference values to obtain the second difference cumulative value SAD_2.
[0097] (3) If the first difference cumulative value is greater than the second difference cumulative value, it is determined that the field data aligned with the inserted field is the second field data.
[0098] (4) If the first difference cumulative value is smaller than the second difference cumulative value, it is determined that the first field data is aligned with the field data of the inserted field.
[0099] Step 506: If the field data aligned with the inserted field is the first field data, determine the parity field attribute of the nth field as an even field.
[0100] If the data to be aligned is the first field, set OddEvenTag_CF=0.
[0101] Step 507: If the field data aligned with the inserted field is the second field data, determine that the parity field attribute of the nth field is an odd field.
[0102] If the data to be aligned is the second field, set OddEvenTag_CF=1.
[0103] Step 508: Check whether the field sequence is correct based on the odd and even field attributes of the n-1th field and the nth field.
[0104] Specifically, detecting whether the field sequence is correct according to the parity field attributes of the n-1th field and the nth field may include: detecting whether the parity field attributes of the n-1th field and the nth field are the same; if the parity field attributes of the n-1th field and the nth field are different, determining that the field sequence is correct; if the parity field attributes of the n-1th field and the nth field are the same, determining that the field sequence is incorrect.
[0105] Assuming that the n-1th field is an even field and the nth field is an odd field, the field order is correct; assuming that the n-1th field is an even field and the nth field is an even field, the field order is incorrect; assuming that the n-1th field is an odd field and the nth field is an even field, the field order is correct; assuming that the n-1th field is an odd field and the nth field is an odd field, the field order is incorrect.
[0106] In summary, the field sequence detection method for odd and even field data provided in the embodiment of the present application is that when the nth field is an even field, the field data of the inserted field of the even field should be aligned with the field data from the second row to the last row of the n-1th field; when the nth field is an odd field, the field data of the inserted field of the odd field should be aligned with the field data from the first row to the second to last row of the n-1th field. According to this characteristic, the odd and even field properties of the nth field can be determined according to the alignment relationship between the inserted field and the field data of the n-1th field, and then whether the field sequence is correct can be detected according to the odd and even field properties of the n-1th field and the nth field. In this way, the continuity and consistency between the fields can be evaluated by analyzing the differences (in space) between consecutive field data, and the amount of calculation is small, so that it is possible to quickly detect whether the field sequence reversal occurs.
[0107] like Figure 8 As shown, it shows a structural block diagram of a field sequence detection device for odd and even field data provided by an embodiment of the present application. The field sequence detection device for odd and even field data can be applied to a chip. The field sequence detection device for odd and even field data includes:
[0108] The acquisition module 810 is used to acquire field data of the nth field from the video frame according to the scanning rule of odd and even fields, where n≥2;
[0109] A calculation module 820, configured to calculate the field data of the inserted field according to the inter-line mean value of the field data of the nth field;
[0110] An acquisition module 830 is used to acquire field data and odd and even field attributes of the collected n-1th field;
[0111] A determination module 840, configured to determine an even-odd field attribute of the nth field according to an alignment relationship between the inserted field and the field data of the n-1th field;
[0112] The detection module 850 is used to detect whether the field sequence is correct according to the odd and even field attributes of the n-1th field and the nth field.
[0113] In an optional embodiment, the determination module 840 is further configured to:
[0114] Extracting first field data and second field data from the field data of the n-1th field, wherein the first field data is field data from the first row to the second to last row, and the second field data is field data from the second row to the last row;
[0115] selecting field data aligned with the field data of the insertion field from the first field data and the second field data;
[0116] If the field data aligned with the inserted field is the first field data, determining the parity field attribute of the nth field to be an even field;
[0117] If the field data aligned with the inserted field is the second field data, the parity field attribute of the nth field is determined to be an odd field.
[0118] In an optional embodiment, the determination module 840 is further configured to:
[0119] Calculating a first difference cumulative value between the first field data and the field data of the inserted field;
[0120] calculating a second difference cumulative value between the second field data and the field data of the inserted field;
[0121] If the first difference cumulative value is greater than the second difference cumulative value, determining that the field data aligned with the inserted field is the second field data;
[0122] If the first difference cumulative value is smaller than the second difference cumulative value, it is determined that the first field data is aligned with the field data of the inserted field.
[0123] In an optional embodiment, the determination module 840 is further configured to:
[0124] sorting the number of rows of the first field data and the field data of the inserted field respectively;
[0125] Calculating a difference value for data in the same row of the first field data and the field data of the inserted field;
[0126] All difference values are added together to obtain the first difference cumulative value.
[0127] In an optional embodiment, the determination module 840 is further configured to:
[0128] sorting the number of rows of the second field data and the field data of the inserted field respectively;
[0129] Calculating a difference value for data in the same row of the second field data and the field data of the inserted field;
[0130] The second difference cumulative value is obtained by adding up all the difference values.
[0131] In an optional embodiment, the detection module 850 is further configured to:
[0132] Detecting whether the odd and even field attributes of the n-1th field and the nth field are the same;
[0133] If the odd and even field attributes of the n-1th field and the nth field are different, it is determined that the field sequence is correct;
[0134] If the odd and even field attributes of the n-1th field and the nth field are the same, it is determined that the field sequence is wrong.
[0135] In an optional embodiment, the acquisition module 810 is further used to acquire field data of the first field from the video frame according to the scanning rule of odd and even fields;
[0136] The determination module 840 is configured to determine the odd-even field attribute of the first field as an odd field.
[0137] In summary, the field sequence detection device for odd and even field data provided by the embodiment of the present application is that when the nth field is an even field, the field data of the inserted field of the even field should be aligned with the field data from the second row to the last row of the n-1th field; when the nth field is an odd field, the field data of the inserted field of the odd field should be aligned with the field data from the first row to the second to last row of the n-1th field. According to this characteristic, the odd and even field attributes of the nth field can be determined according to the alignment relationship between the inserted field and the field data of the n-1th field, and then whether the field sequence is correct can be detected according to the odd and even field attributes of the n-1th field and the nth field. In this way, the continuity and consistency between the fields can be evaluated by analyzing the differences (in space) between consecutive field data, and the amount of calculation is small, so that it is possible to quickly detect whether the field sequence reversal occurs.
[0138] An embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the field sequence detection method for odd and even field data as described above.
[0139] An embodiment of the present application provides a chip, wherein the chip includes the field sequence detection device for any odd and even field data.
[0140] It should be noted that: the field sequence detection device for odd and even field data provided in the above embodiment only uses the division of the above functional modules as an example when performing field sequence detection of odd and even field data. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the field sequence detection device for odd and even field data is divided into different functional modules to complete all or part of the functions described above. In addition, the field sequence detection device for odd and even field data provided in the above embodiment and the field sequence detection method embodiment for odd and even field data belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0141] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0142] The above description is not intended to limit the embodiments of the present application. Any adjustments, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims
1. A field sequence detection method for odd and even field data, characterized in that: The method comprises: Collecting field data of the nth field from the video frame according to the scanning rule of odd and even fields, wherein the field data of the nth field is data of all odd-numbered lines in a video frame, or the field data of the nth field is data of all even-numbered lines in a video frame, where n≥2; Calculating the field data of the inserted field according to the inter-line mean value of the field data of the nth field, wherein the inter-line mean value is obtained by calculating the mean value of every two lines of field data in the field data of the nth field; Obtain the field data and odd and even field attributes of the collected n-1th field; Determining an even-odd field attribute of the nth field according to an alignment relationship between the inserted field and the field data of the n-1th field; Whether the field sequence is correct is detected according to the odd and even field attributes of the n-1th field and the nth field.
2. The field sequence detection method of odd and even field data according to claim 1, characterized in that: The determining the odd and even field attributes of the nth field according to the alignment relationship between the inserted field and the field data of the n-1th field comprises: Extracting first field data and second field data from the field data of the n-1th field, wherein the first field data is field data from the first row to the second to last row, and the second field data is field data from the second row to the last row; selecting field data aligned with the field data of the insertion field from the first field data and the second field data; If the field data aligned with the inserted field is the first field data, determining the parity field attribute of the nth field to be an even field; If the field data aligned with the inserted field is the second field data, the parity field attribute of the nth field is determined to be an odd field.
3. The field sequence detection method of odd and even field data according to claim 2, characterized in that: The selecting the field data aligned with the field data of the inserted field from the first field data and the second field data comprises: Calculating a first difference cumulative value between the first field data and the field data of the inserted field; calculating a second difference cumulative value between the second field data and the field data of the inserted field; If the first difference cumulative value is greater than the second difference cumulative value, determining that the field data aligned with the inserted field is the second field data; If the first difference cumulative value is smaller than the second difference cumulative value, it is determined that the first field data is aligned with the field data of the inserted field.
4. The field sequence detection method of odd and even field data according to claim 3, characterized in that: The calculating a first difference cumulative value between the first field data and the field data of the inserted field comprises: sorting the number of rows of the first field data and the field data of the inserted field respectively; Calculating a difference value for data in the same row of the first field data and the field data of the inserted field; All difference values are added together to obtain the first difference cumulative value.
5. The field sequence detection method of odd and even field data according to claim 3, characterized in that: The calculating a second difference cumulative value between the second field data and the field data of the inserted field comprises: sorting the number of rows of the second field data and the field data of the inserted field respectively; Calculating a difference value for data in the same row of the second field data and the field data of the inserted field; The second difference cumulative value is obtained by adding up all the difference values.
6. The field sequence detection method of odd and even field data according to claim 1, characterized in that: The detecting whether the field sequence is correct according to the odd and even field attributes of the n-1th field and the nth field comprises: Detecting whether the odd and even field attributes of the n-1th field and the nth field are the same; If the odd and even field attributes of the n-1th field and the nth field are different, it is determined that the field sequence is correct; If the odd and even field attributes of the n-1th field and the nth field are the same, it is determined that the field sequence is wrong.
7. The field sequence detection method of odd and even field data according to any one of claims 1 to 6, characterized in that: The method further comprises: Collecting field data of the first field from the video frame according to the scanning rule of odd and even fields; The parity field attribute of the first field is determined to be an odd field.
8. A field sequence detection device for odd and even field data, characterized in that: The device comprises: An acquisition module, used for acquiring field data of an nth field from a video frame according to a scanning rule of odd and even fields, wherein the field data of the nth field is data of all odd-numbered lines in a video frame, or the field data of the nth field is data of all even-numbered lines in a video frame, where n≥2; a calculation module, configured to calculate the field data of the inserted field according to the inter-line mean value of the field data of the nth field, wherein the inter-line mean value is obtained by calculating the mean value of every two lines of field data in the field data of the nth field; An acquisition module, used for acquiring field data and odd and even field attributes of the collected n-1th field; A determination module, configured to determine an even-odd field attribute of the nth field according to an alignment relationship between the inserted field and the field data of the n-1th field; The detection module is used to detect whether the field sequence is correct according to the odd and even field attributes of the n-1th field and the nth field.
9. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the field sequence detection method for odd and even field data according to any one of claims 1 to 7.
10. A chip, characterized in that: The chip comprises: the field sequence detection device for odd and even field data as claimed in claim 8.
Citation Information
Patent Citations
Digital video signal parity field inditification and correction method
CN101090471A
Odd-even field image data interlaced acquisition method, device, system and chip
CN118381990A