Imaging exposure processing method and electronic equipment
By using an analog-to-digital converter independent of the audio codec in electronic devices to digitize light source information, the problem of bar flicker caused by hardware resource limitations is solved, and more accurate light source frequency detection and imaging exposure control are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-10-15
- Publication Date
- 2026-04-24
AI Technical Summary
In existing technologies, due to limitations in chip platform hardware resources, the analog-to-digital conversion capability of audio codecs is limited, which makes it easy for electronic devices to exhibit a flickering phenomenon in shooting previews or video recordings, making it impossible to perform accurate light source frequency detection.
An analog-to-digital converter (ADC) independent of the audio codec is used to convert ambient light information into digital light information. The target exposure time is determined by an on-chip processor and a digital signal processor. The ADC function, independent of the audio codec, enables more accurate light source frequency detection.
It reduces the occurrence of flickering in preview or recorded footage taken by electronic devices, improves the accuracy of light source frequency detection, and avoids hardware resource limitations.
Smart Images

Figure CN121924375A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to an imaging exposure processing method and electronic device. Background Technology
[0002] When an electronic device captures an image of an object and displays it on a screen or prints it on a medium, it does so line by line. The display or printing time for each line is the exposure time. In scenarios where an electronic device is used to capture luminous or reflective objects, if the exposure time is not an integer multiple of the flicker period of the light source, scrolling bright and dark stripes will appear in the preview or video recording of the electronic device, resulting in banding.
[0003] To avoid flickering in preview or recorded footage from electronic devices, related technologies first obtain digitized light source information through analog-to-digital conversion in an audio codec. Then, a flicker device encapsulated within the audio codec measures the light source frequency based on this information. The flicker period is then determined based on the measured frequency, and the exposure time of the image sensor (Complementary Metal-Oxide-Semiconductor Sensor, CMOS Sensor) in the electronic device is controlled to ensure it is an integer multiple of the flicker period. However, due to hardware resource limitations of the chip platform, the audio codec's capabilities are limited, preventing more precise light source frequency detection. Therefore, flickering may still occur in preview or recorded footage from electronic devices. Summary of the Invention
[0004] To address the aforementioned issues, embodiments of this application provide an imaging exposure processing method and electronic device that are not limited by the hardware resources of the chip platform, thereby enabling more accurate light source frequency detection and reducing flicker problems.
[0005] In a first aspect, embodiments of this application provide an imaging exposure processing method applied to an electronic device. The electronic device includes an on-chip processor, a digital signal processor, an analog-to-digital converter (ADC), and a photodiode. The on-chip processor is connected to the ADC and the ADC, and the ADC is connected to the ADC and the photodiode. The method includes: responding to a user operation by opening a camera application; running the camera application and using the photodiode to detect ambient light source information; the ADC converting the ambient light source information into digital light source information; the ADC determining a light source frequency based on the digital light source information; and the on-chip processor determining a target exposure time based on the light source frequency and performing imaging based on the target exposure time.
[0006] In this embodiment, the electronic device responds to user input by opening and running a camera application. It then uses a photodiode to detect ambient light information. At this point, an analog-to-digital converter (ADC) independent of the audio codec converts the ambient light information into digital light information. A digital signal processor (DSP) determines the light source frequency based on this digital information, and an on-chip processor determines the target exposure time based on the light source frequency and performs imaging based on that exposure time. Because this embodiment uses an ADC independent of the audio codec to convert ambient light information into digital light information, replacing the analog-to-digital conversion function in the audio codec, it eliminates the need for an audio codec to perform analog-to-digital conversion. Therefore, when detecting light source frequency, it is not limited by the hardware resources of the chip platform, enabling more accurate light source frequency detection. This helps reduce the problem of flickering in the preview or recording screen of the electronic device.
[0007] In one possible design of the first aspect, the on-chip processor includes an analog-to-digital converter driver, the digital signal processor includes a light source frequency resolution unit, and before using the photodiode to detect ambient light source information, the method further includes: the analog-to-digital converter driver registering device information for the analog-to-digital converter; and the analog-to-digital converter driver establishing a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter based on the registered device information, for receiving the digitized light source information generated by the analog-to-digital converter.
[0008] In this design approach, the analog-to-digital converter (ADC) device information is registered through an analog-to-digital converter (ADC) driver. This allows electronic devices to identify the ADC connected to the driver, ensuring proper communication and control between the driver and the ADC. Furthermore, after registering the ADC, the driver establishes a light source data path between the light source frequency resolution unit and the ADC based on its device information. This allows the ADC to be seamlessly integrated into the system and work collaboratively with other components, achieving accurate data acquisition and conversion.
[0009] In one possible design of the first aspect, the analog-to-digital converter (ADC) driver registers device information for the ADC, including: the ADC driver supplying power to a first device coupled to a drive port of the ADC driver; the ADC driver sending a first device identifier to the first device through the drive port; when the ADC driver receives an identifier confirmation message sent by the first device based on the first device identifier, the ADC driver determines that the first device is an allowed ADC; the ADC driver acquires the device information of the first device and registers the device information.
[0010] In this design, the analog-to-digital converter (ADC) driver only supplies power to the first device coupled to its drive port when device registration is required, thereby saving energy. Furthermore, by interacting with the first device using its identifier, the ADC driver can determine that the first device is an allowed ADC after receiving an identification confirmation message returned by the first device based on its identifier, and can then register the device information of the first device.
[0011] In one possible design of the first aspect, after the analog-to-digital converter driver acquires the device information of the first device and registers the device information, the method further includes: the analog-to-digital converter driver initializing the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information.
[0012] In this design, the analog-to-digital converter driver first initializes the light source data path between the light source frequency resolution unit and the analog-to-digital converter, which sets the light source data path to a ready state so that it can quickly respond to data transmission when needed, thereby improving the efficiency of data processing.
[0013] In one possible design of the first aspect, the on-chip processor further includes an overall control module; the analog-to-digital converter driver establishes a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter based on the registered device information, including: the overall control module activating the analog-to-digital converter driver to supply power to the analog-to-digital converter indicated by the registered device information; the analog-to-digital converter driver configuring path parameters for the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information, and configuring device parameters for the analog-to-digital converter; the analog-to-digital converter activating the configured light source data path.
[0014] In this design approach, the analog-to-digital converter (ADC) driver is activated through an overall control module. This allows the ADC driver to configure the path parameters of the light source data path and the device parameters of the ADC. It enables overall management of the path parameter configuration of the light source data path and the device parameter configuration of the ADC, reducing design complexity and error rate, thereby improving the system's flexibility, efficiency, and reliability.
[0015] In one possible design of the first aspect, the light source data path configuration instruction includes a target resolution and environmental attributes; the analog-to-digital converter driver configures the path parameters of the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information, and configures the device parameters of the analog-to-digital converter, including: the analog-to-digital converter driver configures the path parameters of the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information based on the target resolution and the environmental attributes, and configures the device parameters of the analog-to-digital converter.
[0016] In this design approach, the analog-to-digital converter driver configures the path parameters of the light source data path and the device parameters of the analog-to-digital converter based on the target resolution and environmental properties. This allows the configured light source data path and analog-to-digital converter to adapt to the target resolution and environmental properties, thereby meeting the imaging exposure requirements of the current shooting environment.
[0017] In one possible design of the first aspect, the electronic device further includes a registration control, in which the device information is stored; the analog-to-digital converter driver configures the path parameters of the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information, and configures the device parameters of the analog-to-digital converter, including: the analog-to-digital converter driver obtains the registered device information from the registration control, and based on the registered device information, configures the path parameters of the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information, and configures the device parameters of the analog-to-digital converter.
[0018] In this design approach, a registration control is used to store the registered device information. When path configuration and device configuration are required, the analog-to-digital converter driver can directly obtain the corresponding device information from the registration control, and then perform accurate path configuration and device configuration based on the device information to meet the imaging exposure requirements of the current shooting environment.
[0019] In one possible design of the first aspect, the analog-to-digital converter (ADC) activates the configured light source data path, comprising: the overall control module sending a light source data path activation command to the registration control; the registration control forwarding the light source data path activation command to the ADC driver; the ADC driver forwarding the light source data path activation command to the ADC; and the ADC activating the configured light source data path according to the light source data path activation command.
[0020] In this design approach, the registration control forwards the light source data path activation command sent by the overall control module, which can accurately activate the corresponding light source data path, thereby enabling accurate and effective data transmission.
[0021] In one possible design of the first aspect, the path parameter configuration and the device parameter configuration are executed by the analog-to-digital converter driver based on the triggering of the overall control module after receiving a light source data path configuration instruction. The light source data path configuration instruction is sent by the digital signal processor to the overall control module and is generated by the following method: the digital signal processor creates an exposure time adjustment trigger detection thread; in response to the exposure time adjustment trigger detection thread detecting that the exposure time adjustment function is triggered, the digital signal processor generates the light source data path configuration instruction.
[0022] In this design approach, by creating an exposure time adjustment trigger detection thread, it is possible to respond promptly to events that trigger the exposure time adjustment function, thereby enabling the timely generation of light source data path configuration instructions for configuring the path parameters of the light source data path.
[0023] In one possible design of the first aspect, the on-chip processor further includes an overall control module; after the on-chip processor determines the target exposure time based on the light source frequency and performs imaging based on the target exposure time, the method further includes: the overall control module sending a light source data path shutdown command to the analog-to-digital converter driver; the analog-to-digital converter driver shuts down the light source data path and powers off the analog-to-digital converter.
[0024] In this design, when imaging exposure processing is not required, the overall control module shuts down the light source data path and cuts off the power to the analog-to-digital converter by using the analog-to-digital converter driver, which can effectively save energy.
[0025] In one possible design of the first aspect, the electronic device further includes a registration control; the overall control module sends a light source data path shutdown command to the analog-to-digital converter driver, including: the overall control module sends the light source data path shutdown command to the registration control; the registration control forwards the light source data path shutdown command to the analog-to-digital converter driver; the analog-to-digital converter driver shuts down the light source data path and de-energizes the analog-to-digital converter, including: the analog-to-digital converter driver shuts down the light source data path; in response to the power-off command of the registration control, the analog-to-digital converter driver de-energizes the analog-to-digital converter.
[0026] In this design, the registration control forwards the light source data path shutdown command sent by the overall control module to shut down the light source data path, and the power-off command of the registration control is used to power off the analog-to-digital converter. This not only accurately shuts down the corresponding light source data path and analog-to-digital converter, but also effectively saves energy.
[0027] In one possible design of the first aspect, the device information includes a device identifier; the analog-to-digital converter driver establishes a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter based on the registered device information, including: the analog-to-digital converter driver establishing the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device identifier.
[0028] In this design approach, a light source data path is established between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device identifier, based on the registered device identifier, which can improve the accuracy of establishing the light source data path.
[0029] In one possible design of the first aspect, the device information includes device attributes, and the light source data path configuration instruction includes a target resolution and environmental attributes; the analog-to-digital converter driver establishes a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter based on the registered device information, including: the analog-to-digital converter driver determines a target device attribute that matches the target resolution and the environmental attributes, and establishes the light source data path between the light source frequency resolution unit and the registered analog-to-digital converter whose device attribute is the target device attribute.
[0030] In this design approach, the analog-to-digital converter driver first determines the target device attributes that match the target resolution and environmental attributes. Then, a light source data path is established between the light source frequency resolution unit and the registered analog-to-digital converter with the target device attributes. This allows the established light source data path to match the target resolution and environmental attributes, thereby meeting the imaging exposure requirements of the current shooting environment.
[0031] In one possible design of the first aspect, the device information includes a device identifier; the analog-to-digital converter driver establishes a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter based on the registered device information, including: the analog-to-digital converter driver acquiring a historical path establishment record, the historical path establishment record indicating the device identifier of the analog-to-digital converter in the historically established light source data path, and the correspondence between the path establishment geographical location and the path establishment time; the analog-to-digital converter driver searching the historical path establishment record, acquiring a second device identifier corresponding to the current geographical location and the current time, and establishing the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the second device identifier.
[0032] In this design, the analog-to-digital converter driver first searches for a second device identifier corresponding to the current geographical location and current time in the historical path establishment record. Then, based on the found second device identifier, a light source data path is established between the light source frequency resolution unit and the analog-to-digital converter indicated by the second device identifier. This approach can make full use of the information in the historical path establishment record to establish the required light source data path, thereby improving the efficiency of establishing the light source data path.
[0033] In one possible design of the first aspect, the digital signal processor includes a light source frequency resolution unit; the digital signal processor determines the light source frequency based on the digitized light source information, including: the light source frequency resolution unit parses the digitized light source information to obtain light source frequency information, the light source frequency information indicating the light source frequency; the light source frequency resolution unit converts the light source frequency information into target light source frequency information in a format suitable for exposure time calculation.
[0034] In this design approach, the light source frequency resolution capability of the light source frequency resolution unit in the digital signal processor is utilized to resolve the digital light source information to obtain the light source frequency information. Then, the light source frequency information is converted into target light source frequency information in a format suitable for exposure time calculation. This allows for the accurate determination of the ambient light source frequency, which is beneficial for adjusting the exposure time of the image sensor in the electronic device to an integer multiple of the flicker period of the ambient light source. Consequently, it can effectively reduce the problem of flickering in the preview or recording screen of the electronic device.
[0035] In one possible design of the first aspect, the on-chip processor includes an exposure imaging module; the on-chip processor determines a target exposure time based on the light source frequency and performs imaging based on the target exposure time, including: the exposure imaging module determines the target exposure time based on the target light source frequency information and performs imaging based on the target exposure time.
[0036] In this design, the exposure imaging module determines the target exposure time for imaging based on the target light source frequency information. This not only facilitates the overall control of the imaging exposure processing by the exposure imaging module, but also improves the accuracy of the target exposure time determination and the reliability of imaging. In turn, it helps to reduce the problem of flashing in the preview or recording screen of electronic devices.
[0037] In one possible design of the first aspect, the use of the photodiode to detect ambient light information includes: detecting the maximum value of the brightness difference between adjacent pixel rows of the displayed image; and if the maximum value of the brightness difference is greater than a first threshold, using the photodiode to detect ambient light information.
[0038] In this design, when the maximum brightness difference between adjacent pixel rows of a displayed image is greater than a first threshold, it can be considered that there is obvious stripe flicker in the displayed image. At this time, a photodiode can be used to detect ambient light information, and then the exposure time of the electronic device during imaging can be adjusted based on the detected ambient light information, which helps to reduce the stripe flicker problem.
[0039] In one possible design of the first aspect, the photodiode detects the ambient light information periodically; the analog-to-digital converter converts the ambient light information into digital light information, including: if the difference between the ambient light information detected in the current period and the ambient light information detected in the previous period is greater than a second threshold, the analog-to-digital converter converts the ambient light information into digital light information.
[0040] In this design, if the difference between the ambient light information detected in the current cycle and the ambient light information detected in the previous cycle is greater than a second threshold, it can be considered that the flicker period of the current ambient light is no longer an integer multiple of the exposure time of the image sensor in the electronic device. At this time, an analog-to-digital converter can be used to convert the ambient light information into digital light information, so that the exposure time currently used can be adjusted to an integer multiple of the flicker period of the current ambient light based on the digital light information, thereby helping to reduce the flicker problem.
[0041] In one possible design of the first aspect, the on-chip processor determines a target exposure time based on the light source frequency and performs imaging based on the target exposure time, including: if the number of determined light source frequencies is multiple, the on-chip processor acquires the light intensity corresponding to each light source frequency; the on-chip processor determines a main light source frequency among the multiple light source frequencies based on the light intensity; the on-chip processor determines the target exposure time based on the main light source frequency and performs imaging based on the target exposure time.
[0042] In this design approach, even if the current ambient light source is a mixture of multiple ambient light sources, the frequency of the main light source can be determined among these ambient light sources, and the exposure time can be adjusted based on the frequency of the main light source, thereby effectively reducing the problem of bar flicker.
[0043] In one possible design of the first aspect, after the on-chip processor determines the main light source frequency among a plurality of light source frequencies based on the light intensity, the method further includes: the on-chip processor filtering other light source frequencies among the plurality of light source frequencies besides the main light source frequency.
[0044] In this design approach, the on-chip processor filters out the frequencies of other light sources besides the main light source frequency, thus avoiding the influence of other light source frequencies on the imaging exposure process and improving the accuracy and reliability of imaging.
[0045] In one possible design of the first aspect, the on-chip processor determines a target exposure time based on the light source frequency and performs imaging based on the target exposure time, including: the on-chip processor acquiring a currently set exposure time; if the ratio of the set exposure time to the flicker period corresponding to the light source frequency is not an integer, the on-chip processor adjusts the set exposure time by a first step length and adjusts the light source frequency by a second step length until the ratio of the adjusted set exposure time to the flicker period corresponding to the adjusted light source frequency is an integer, wherein the first step length and the second step length are different; the on-chip processor uses the adjusted set exposure time as the target exposure time and performs imaging based on the target exposure time.
[0046] In this design approach, in scenarios where ambient light sources can be controlled using electronic devices, if the currently set exposure time is not an integer multiple of the flicker period corresponding to the ambient light source frequency, adjusting the set exposure time with a first step length and adjusting the light source frequency with a second step length different from the first step length can make the adjusted set exposure time an integer multiple of the flicker period corresponding to the adjusted light source frequency, thereby effectively reducing the flicker problem.
[0047] Secondly, embodiments of this application also provide an electronic device, including: a camera, a display screen, an on-chip processor, a digital signal processor, an analog-to-digital converter, and a photodiode; the on-chip processor is connected to the camera, the display screen, the digital signal processor, and the analog-to-digital converter; the analog-to-digital converter is connected to the digital signal processor and the photodiode; the camera is used to take pictures when running a camera application; the photodiode is used to detect ambient light source information; the analog-to-digital converter is used to convert the ambient light source information into digital light source information; the digital signal processor is used to determine the light source frequency based on the digital light source information; the on-chip processor is used to determine the target exposure time based on the light source frequency and to perform imaging based on the target exposure time; the display screen is used to display the image after imaging.
[0048] It is understood that the beneficial effects that the electronic device described in the second aspect above can achieve can be referred to the beneficial effects of the first aspect and any of its possible design embodiments, which will not be repeated here. Attached Figure Description
[0049] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0050] Figure 1This is a schematic diagram illustrating an application scenario of an electronic device provided in one embodiment of this application;
[0051] Figure 2 This is a schematic diagram illustrating the cause of the flashing phenomenon provided in one embodiment of this application;
[0052] Figure 3 This is a schematic diagram of the system hardware architecture provided in one embodiment of this application;
[0053] Figure 4 This is a schematic diagram of the system software architecture provided in one embodiment of this application;
[0054] Figure 5 This is a schematic diagram illustrating the process of implementing imaging exposure processing according to an embodiment of this application;
[0055] Figure 6 This is an interactive schematic diagram of an imaging exposure processing method provided in one embodiment of this application;
[0056] Figure 7 This is a schematic diagram illustrating the operation of a camera application according to one embodiment of this application;
[0057] Figure 8 This is an interactive schematic diagram of an imaging exposure processing method provided in another embodiment of this application;
[0058] Figure 9 This is an interactive schematic diagram of an imaging exposure processing method provided in another embodiment of this application;
[0059] Figure 10 This is a schematic diagram of the structure of an electronic device shown in one embodiment of this application. Detailed Implementation
[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0061] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0062] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first target object" and "second target object," etc., are used to distinguish different target objects, not to describe a specific order of target objects.
[0063] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0064] In the description of the embodiments in this application, unless otherwise stated, "multiple" means two or more. For example, multiple processing units means two or more processing units; multiple systems means two or more systems.
[0065] Before describing the technical solutions of the embodiments of this application, firstly, in conjunction with Figures 1 to 2 The application scenarios of the technical solution in this application are described.
[0066] In scenarios where electronic devices such as mobile phones and tablets are used for taking photos or videos, if an ambient light source is present, and the exposure time of the CMOS module in the electronic device is not an integer multiple of the flicker period of the ambient light source, then issues such as… Figure 1 The phenomenon shown is the alternating rolling of light and dark stripes, also known as bar flash.
[0067] For example, when an ambient light source is connected to a 50Hz AC power source, after signal conversion of the ambient light source, the following can be obtained: Figure 2 The optical signal waveform envelope shown is periodically changing at a frequency of 100Hz. If the flicker period of the ambient light source is denoted as T, then T = 1 / 100s. Furthermore, the exposure time of the CMOS module in the electronic device can be denoted as t, where the exposure time of the CMOS module refers to the time required for the CMOS module to expose each row of pixels in a frame of image. When the exposure time t of the CMOS module is not an integer multiple of the flicker period of the ambient light source, for example, t = T + t1 = t2 + t3 + t4, where t1 = t3 = t4, then when the CMOS module exposes the i-th row of pixels in that frame of image, the light energy received by the i-th row of pixels is S + S1, where S represents the light energy received by the i-th row of pixels within time T (corresponding to...). Figure 2 S1 represents the area of the optical signal waveform envelope where the i-th row pixel is located, and S1 represents the light energy received by the i-th row pixel within time t1 (corresponding to...). Figure 2 the area of the optical signal waveform envelope where S1 is located in the figure); when the CMOS module exposes the pixels of the (i + 1)-th row of this frame of image, the optical energy received by the pixels of the (i + 1)-th row is S2 + S3 + S4, where S2 represents the optical energy received by the pixels of the (i + 1)-th row within the time t2 (corresponding to Figure 2 the area of the optical signal waveform envelope where S2 is located in the figure), S3 represents the optical energy received by the pixels of the (i + 1)-th row within the time t3 (corresponding to Figure 2 the area of the optical signal waveform envelope where S3 is located in the figure), S4 represents the optical energy received by the pixels of the (i + 1)-th row within the time t4 (corresponding to Figure 2 the area of the optical signal waveform envelope where S4 is located in the figure). Referring to Figure 2 it can be seen that since t1 = t3 = t4, so S1 = S3 < S4, S + S1 < S2 + S3 + S4, that is to say, the optical energy received by the pixels of the i-th row is less than the optical energy received by the pixels of the (i + 1)-th row. Therefore, when the shooting preview screen or video recording screen of the electronic device displays this frame of image, the brightness of the pixels of the i-th row and the pixels of the (i + 1)-th row is different (the pixels of the i-th row are darker than the pixels of the (i + 1)-th row), so the shooting preview screen or video recording screen of the electronic device will have a bar flashing phenomenon.
[0068] In order to reduce the problem of bar flashing in the shooting preview screen or video recording screen of the electronic device, in the related art, an audio codec and a Flicker device encapsulated in the audio codec are used to detect the light source frequency of the ambient light source, and then control the exposure time of the CMOS module in the electronic device to meet an integer multiple of the flashing period of the ambient light source. However, limited by the hardware resources of the chip platform, the capabilities of commonly used audio codecs are limited and cannot perform more accurate light source frequency detection. Therefore, the shooting preview screen or recording screen of the electronic device may still have a bar flashing phenomenon.
[0069] To solve the above problems, the embodiment of the present application provides an imaging exposure processing method. This method uses an analog-to-digital converter (ADC) independent of the audio codec to convert the ambient light source information into digital light source information, thereby replacing the analog-to-digital conversion function in the audio codec. Therefore, there is no need to use the audio codec in the related art to implement analog-to-digital conversion. When performing light source frequency detection, it is not restricted by the hardware resources of the chip platform, so that more accurate light source frequency detection can be performed, which is conducive to reducing the problem of bar flashing in the shooting preview screen or recording screen of the electronic device.
[0070] The following Figure 3 introduces the imaging exposure processing method provided by the embodiment of the present application. Referring to Figure 3 As shown, Figure 3 This is a schematic diagram of a system hardware architecture provided in an embodiment of this application. Figure 3 In the electronic device 300, there are an on-chip processor 310, a digital signal processor 320, an analog-to-digital converter 330, and a photodiode 340. The on-chip processor 310 and the digital signal processor 320 are connected through a multiprocessor inter-process communication interface (QMI interface), and the on-chip processor 310 and the analog-to-digital converter 330 are connected through an I2C (Inter-Integrated Circuit) bus. The digital signal processor 320 includes a sensor digital signal processing module 321 and an audio digital signal processing module 322. The sensor digital signal processing module 321 and the audio digital signal processing module 322 are connected through an inter-thread communication interface (Qsocket interface). The analog-to-digital converter 330 is connected to the audio digital signal processing module 322 through a data transmission bus, and the analog-to-digital converter 330 is electrically connected to the photodiode 340.
[0071] The data transmission bus can be an I2S (Inter-IC Sound) bus or a TDM (Time Division Multiplex) bus, without specific limitations. A TDM bus is a time-division multiplexed data bus that allows multiple data streams to be transmitted in a specific time sequence on the same physical channel by dividing and allocating the time axis. An I2S bus is an audio bus used for serial data transmission between a digital audio processor and audio devices. In this embodiment, an I2S bus is used as an example. Using the I2S bus to transmit light source information between the audio digital signal processing module 322 and the analog-to-digital converter 330 can achieve the effect of multiplexing the audio data path, thereby effectively saving data path resources. Furthermore, an I2C bus is a bidirectional two-wire synchronous serial bus that can realize data transmission between devices through two lines (SDA and SCL).
[0072] It should be noted that the electronic device 300 may also include an audio codec (not shown in the figure), and an analog-to-digital converter 330 independent of the audio codec, used to replace the analog-to-digital conversion function of the audio codec, converting the ambient light information detected by the photodiode 340 into digital light information, so that the on-chip processor 310 and the digital signal processor 320 can cooperate with each other based on the digital light information to realize imaging exposure processing.
[0073] In one embodiment, the electronic device 300 can be a smart device such as a mobile phone or tablet capable of taking photos or videos. The photodiode 340 has a spectral range of 400nm to 700nm, a peak wavelength of 650nm, and a field of view (FOV) of 130 degrees. The FOV refers to the angular range of a plane or space that light can cover from a given observation point. This FOV characterizes the maximum angular range of light that the photodiode 340 can detect. It is understood that since the analog-to-digital converter 330 in this embodiment is independent of the audio codec in the electronic device 300, the FOV can be flexibly selected to better adapt to the data processing requirements of the system. For example, the FOV can support a sampling rate of 8kHz and a sampling bit depth of 32 bits.
[0074] exist Figure 3In this process, when a user takes a photo or video using electronic device 300, the on-chip processor 310 detects the user's opening of the camera application and, in response, activates analog-to-digital converter 330 via the I2C bus, which in turn activates photodiode 340. At this time, photodiode 340 detects ambient light information in the current shooting scene and sends this information to the analog-to-digital converter 330 via the wire between the photodiode 340 and the converter. This allows the converter to convert the ambient light information into digital light information, replacing the analog-to-digital conversion function of the audio codec. Next, the audio digital signal processing module 322 in digital signal processor 320 receives the digital light information from the converter 330 via the I2S bus, performs light frequency detection on the digital light information to obtain the ambient light frequency, and then sends this frequency to sensor digital signal processing module 321 via the Qsocket interface. After the sensor digital signal processing module 321 receives the light source frequency, it sends the frequency to the on-chip processor 310 via the QMI interface. The on-chip processor 310 then determines the flicker period of the ambient light source based on this frequency. It then adjusts the exposure time of the CMOS module (not shown) in the electronic device 300 to an integer multiple of the flicker period of the ambient light source, and finally performs imaging based on the adjusted exposure time. Because an analog-to-digital converter 330 independent of the audio codec is used to replace the audio codec's analog-to-digital conversion function, converting ambient light information into digital light information, and eliminating the need for an audio codec for analog-to-digital conversion, the entire imaging exposure process is not limited by the hardware resources of the chip platform. This allows for more accurate light source frequency detection, which helps reduce the problem of flickering in preview images when users take photos or videos using the electronic device 300.
[0075] Reference Figure 4 As shown, Figure 4 Is with Figure 3 A schematic diagram of the system software architecture corresponding to the system hardware architecture. Figure 4In this context, the electronic device 300 may include an application layer 410, an application framework layer 420, a system layer 430, a hardware abstraction layer 440, a kernel layer 450, and a hardware layer 460. The application layer 410, application framework layer 420, system layer 430, hardware abstraction layer 440, and kernel layer 450 are all deployed on an on-chip processor (such as...). Figure 3 The on-chip processor 310 in the chip; the hardware layer 460 includes, for example, Figure 3 The digital signal processor 320, analog-to-digital converter 330, and photodiode 340 are shown.
[0076] The application layer 410 may include camera applications such as self-developed camera 411 and third-party camera 412, and may also include audio applications such as system sound 414, music 415, and third-party application 416. Among them, self-developed camera 411 and third-party camera 412 may include camera modes such as preview, photo taking, video recording, portrait, HDR (High Dynamic Range) and large aperture.
[0077] The application framework layer 420 may include a camera manager (Camera-Service) 421 and an audio manager (Audio-Service) 422. The application framework layer 420 provides an application programming interface (API) and programming framework for the application layer 410. Specifically, the camera manager 421 manages the camera application and can determine the camera mode currently used by the camera application. The audio manager 422 manages audio playback functions, such as volume control (including increasing and decreasing volume).
[0078] System layer 430 may include multiple services, such as camera service (Camera-Server) 431 and audio service (Audio-Server) 432. Camera service 431 can be used to implement image preview, video preview, etc. Audio service 432 can be used to implement audio processing, etc.
[0079] The hardware abstraction layer 440 may include a camera hardware abstraction module (Camera-HAL) 441 and an audio hardware abstraction module (Audio-HAL) 442. The camera hardware abstraction module 441 can adjust the exposure time of the CMOS module, for example, by adjusting the exposure time of the CMOS module to an integer multiple of the flicker period of the ambient light source. The audio hardware abstraction module 442 can establish a light source data path, for example, by... Figure 3 A light source data path is established between the digital signal processor 320 and the analog-to-digital converter 330. In one embodiment, the hardware abstraction layer 440 may also be referred to as the overall control module; that is, the overall control module includes a camera hardware abstraction module 441 and an audio hardware abstraction module 442. Additionally, the camera hardware abstraction module 441 may also be referred to as the exposure imaging module, capable of determining the target exposure time for imaging based on the detected light source frequency, and capable of imaging based on the target exposure time.
[0080] Kernel layer 450 may include sensor driver (Sensor-Kernel) 451 and audio driver (Audio-Kernel) 452. Kernel layer 450 is a layer between hardware and software.
[0081] Hardware layer 460 may include a digital signal processor 320, an analog-to-digital converter 330, and a photodiode 340. The digital signal processor 320 may run a sensor process (Sensor-PD) 461 and an audio process (Audio-PD) 462. The sensor process 461 runs within the sensor digital signal processing module (e.g., sensor digital signal processing module) of the digital signal processor 320. Figure 3 The sensor digital signal processing module 321 in the digital signal processor 320, and the audio process 462 runs in the audio digital signal processing module (such as the sensor digital signal processing module 321 in the digital signal processor 320) Figure 3 The audio digital signal processing module 322 in the middle. The photodiode 340 can send the ambient light information of the detected ambient light source to the analog-to-digital converter 330, and the analog-to-digital converter 330 can convert the ambient light information output by the photodiode 340 into corresponding digital light information.
[0082] exist Figure 4In the system software architecture shown, when the user opens the camera application, the photodiode 340 detects ambient light information and sends it to the analog-to-digital converter 330. The converter then converts this information into digital light information, replacing the analog-to-digital conversion function of the audio codec. The converter 330 then sends this digital light information to the audio process 462 in the digital signal processor 320 for light source frequency analysis to obtain the light source frequency information. Next, the audio process 462, through the sensor process 461 and the sensor driver 451 in the kernel layer 450, sends this frequency information to the camera hardware abstraction module 441 in the hardware abstraction layer 440. Based on this frequency information, the camera hardware abstraction module 441 can determine the target exposure time for CMOS module imaging, for example, adjusting the CMOS module's exposure time to an integer multiple of the ambient light's flicker period, and performing imaging based on the determined target exposure time. This effectively reduces the problem of flickering in the preview or recording screen of electronic devices because the CMOS module's exposure time is adjusted to an integer multiple of the ambient light's flicker period.
[0083] The process of digital signal processors and camera hardware abstraction modules working together to achieve image exposure processing can be referred to as follows: Figure 5 As shown.
[0084] exist Figure 5 In the Android application framework layer 420, the camera manager 421 can communicate with the camera hardware abstraction module 441 in the hardware abstraction layer via a communication interface (HIDL interface or AIDL interface) to send user operation information related to the camera application to the camera hardware abstraction module 441. The HIDL (HAL Interface Definition Language) interface is used to define the interface between the Android framework and the hardware abstraction layer implementation, making communication between the Android framework and the hardware abstraction layer more standardized and modular. The HIDL interface allows developers to specify type and method calls and collect them into interfaces and packages. The AIDL (Android Interface Definition Language) interface is used on the Android platform to define and implement inter-process communication, enabling cross-process communication. The AIDL interface allows different parts of an Android application (which may be different processes or different applications) to communicate to transfer data.
[0085] The camera hardware abstraction module 441, located in the hardware abstraction layer, includes an After Effects (AE) graphics processing unit 4411 and a sensor subscription registration unit (NCSIntfQsee) 4412. The AE graphics processing unit 4411 and the sensor subscription registration unit 4412 are communicatively connected. The sensor subscription registration unit 4412 registers various functional services, including a gyroscope service 44121, an acceleration sensing service 44122, a gravity sensing service 44123, and a light source frequency adjustment service 44124. The light source frequency adjustment service 44124 can be used to adjust the exposure time of the CMOS module to an integer multiple of the flicker period of the ambient light source.
[0086] The sensor digital signal processing module 321 within the digital signal processor includes a light source frequency resolution driving unit 3211. This unit receives control commands sent by the light source frequency adjustment service 44124 via the control command transmission interface (SSCConnection) 4413 in the camera hardware abstraction module 441, thereby driving the audio digital signal processing module 322 of the digital signal processor to perform light source frequency resolution processing for the ambient light source. Furthermore, after receiving light source frequency information from the audio digital signal processing module 322, the unit can send this information to the light source frequency adjustment service 44124 via the QMI interface, enabling the service to adjust the exposure time of the CMOS module to an integer multiple of the flicker period of the ambient light source.
[0087] The audio digital signal processing module 322 within the digital signal processor includes a light source frequency resolution proxy service unit 3221, a light source frequency resolution unit (DevicePPTx) 3222, and a light source information receiving unit (DeviceTx) 3223, which are sequentially connected. The light source frequency resolution proxy service unit 3221 is connected to the light source frequency resolution driver unit 3211 via a Qsocket interface. The light source information receiving unit 3223 includes a hardware connection interface connected to an analog-to-digital converter 330 via an I2S bus. The analog-to-digital converter 330 is connected to a photodiode 340 via a wire. The light source frequency resolution unit 3222 includes a light source frequency resolution service 32221, which can call a light source frequency resolution algorithm (e.g., an anti-banding algorithm) to perform light source frequency resolution on the ambient light source information, thereby obtaining the light source frequency of the ambient light source.
[0088] The audio hardware abstraction module 442, located in the hardware abstraction layer, includes a Platform Adaptation Layer (PAL) 4421. This PAL 4421 includes an audio environment manager 44211, a data flow controller 44212, and a device controller 44213. The audio environment manager 44211 can send instructions to the light source frequency resolution proxy service unit 3221 in the audio digital signal processing module 322 to control the light source frequency resolution proxy service unit 3221 to start or stop the light source frequency resolution of ambient light sources. Both the data flow controller 44212 and the device controller 44213 can configure the light source frequency resolution unit 3222 and the light source information receiving unit 3223 in the audio digital signal processing module 322, thereby configuring the light source frequency resolution algorithm.
[0089] The audio driver at the kernel layer includes an analog-to-digital converter driver 4511. This driver 4511 is connected to the device controller 44213 in the platform adaptation layer 4421 and to the analog-to-digital converter 330 via the I2C bus for parameter configuration and control of the analog-to-digital converter 330.
[0090] The following is based on Figure 5 The process of imaging exposure processing is described in detail.
[0091] When a user opens the camera application on their electronic device and launches any of the camera modes in the application layer, such as preview, photo capture, video recording, portrait, HDR, and large aperture, the camera manager 421 in the application framework layer 420 receives the camera launch control signal and sends it to the camera hardware abstraction module 441 in the hardware abstraction layer via the HIDL interface. The camera hardware abstraction module 441 will start the light source frequency adjustment service 44124 in the sensor subscription registration unit 4412 according to the control signal. At this time, the light source frequency adjustment service 44124 will send the control signal to the light source frequency analysis driver unit 3211 in the sensor digital signal processing module 321 through the SSCConnection interface 4413. The light source frequency analysis driver unit 3211 will then transmit the control signal sequentially through the Qsocket interface and the light source frequency analysis proxy service unit 3221 in the audio digital signal processing module 322 to the platform adaptation layer 4421 in the audio hardware abstraction module 442. At this time, the platform adaptation layer 4421 will start the analog-to-digital converter driver 4511 in the kernel layer through the device controller 44213, so that the analog-to-digital converter driver 4511 starts the analog-to-digital converter 330 through the I2C bus. In addition, the platform adaptation layer 4421 will also configure the light source frequency analysis algorithm in the light source frequency analysis unit 3222 in the audio digital signal processing module 322. For example, it will configure the anti-banding algorithm in the light source frequency analysis unit 3222 so that the light source frequency analysis unit 3222 has the ability to analyze the light source frequency of the ambient light source.
[0092] After the analog-to-digital converter 330 is started, it continuously receives ambient light information detected by the photodiode 340, performs analog-to-digital conversion on the ambient light information to obtain digital light information, and then sends the digital light information to the light source information receiving unit 3223 in the audio digital signal processing module 322 via the I2S bus, so that the light source information receiving unit 3223 sends the digital light information to the light source frequency analysis unit 3222 in the audio digital signal processing module 322. At this time, the light source frequency analysis unit 3222 calls the configured light source frequency analysis algorithm (such as the anti-banding algorithm) to analyze the light source frequency of the digital light source information and obtain the light source frequency of the ambient light. Then, the light source frequency analysis unit 3222 transmits the analyzed light source frequency sequentially through the light source frequency analysis driving unit 3211 in the sensor digital signal processing module 321 and the QMI interface to the light source frequency adjustment service 44124 in the camera hardware abstraction module 441. At this time, the light source frequency adjustment service 44124 can adjust the exposure time of the CMOS module to an integer multiple of the flicker period of the ambient light according to the light source frequency, so that the electronic device can perform imaging according to the adjusted exposure time, thereby reducing the problem of strip flickering in the shooting preview screen or recording screen of the electronic device.
[0093] The imaging exposure processing method provided in this application embodiment will be described in detail below with a specific example. (Refer to...) Figure 6 , Figure 6 An interactive schematic diagram of an imaging exposure processing method is shown, which is applied to electronic devices such as mobile phones and tablets, wherein the electronic devices include analog-to-digital converters independent of audio codecs. Figure 6 In this process, the imaging exposure processing method may include:
[0094] Step 601: The user turns on the electronic device.
[0095] In some embodiments, the electronic device is equipped with a power button, which may be located on the side edge or top edge of the electronic device. The user can power on the electronic device by pressing and holding the power button for a certain period of time (e.g., 10 seconds). After the electronic device is powered on, it can display a home screen, which shows the application icons of the applications that the user has installed, such as the camera icon for the camera application.
[0096] Step 602: The analog-to-digital converter driver in the electronic device supplies power to the first device, wherein the first device is coupled to the drive port of the analog-to-digital converter driver.
[0097] In some embodiments, powering the first device can mean supplying power to the first device, which is currently not powered, to enable the first device to start. In other embodiments, powering the first device can also mean converting the lower voltage currently supplied to the first device to a higher voltage. Here, lower voltage and higher voltage are relative concepts. Lower voltage is a power supply with a relatively lower voltage value compared to a higher voltage; higher voltage is a power supply with a relatively higher voltage value compared to a lower voltage. For example, assuming the lower voltage is 0.7V, then 3.3V is a higher voltage relative to 0.7V; similarly, assuming the lower voltage is 1.5V, then 5V is a higher voltage relative to 1.5V. For example, assuming the current power supply to the first device is 0.7V (lower voltage), then powering the first device by the analog-to-digital converter driver can mean that the analog-to-digital converter driver provides the first device with a 3.3V power supply (higher voltage).
[0098] In some embodiments, the drive port of the analog-to-digital converter (ADC) driver may be coupled to a first device, which may be an ADC independent of the audio codec. When the electronic device is powered on, it may not know the specific device of the first device coupled to the ADC driver. Therefore, after the electronic device is powered on, the ADC driver in the electronic device may first supply power to the first device coupled to its drive port to facilitate subsequent device identification and registration operations for the first device. In other embodiments, power is supplied to the first device coupled to the ADC driver only when device registration is required, thereby saving energy.
[0099] In some embodiments, the analog-to-digital converter driver can directly power the first device. When the electronic device is powered on, the analog-to-digital converter driver can directly power the first device to start it up.
[0100] In some embodiments, the analog-to-digital converter driver can also supply power to the first device via an external power supply module. When the electronic device is powered on, the analog-to-digital converter driver can first send a power-on signal to the external power supply module connected to it, so that the external power supply module supplies power to the first device after receiving the power-on signal.
[0101] Step 603: The analog-to-digital converter driver sends the first device identifier to the first device through the drive port.
[0102] In some embodiments, the analog-to-digital converter driver may send a first device identifier to the first device to identify the first device and confirm whether the first device is an allowed analog-to-digital converter.
[0103] In some embodiments, the first device identifier may be an identification code set by the manufacturer at the time of device shipment (e.g., 12345), which can be obtained from the device's product documentation (such as the device's datasheet). It is understood that the identification code set for each device is unique.
[0104] In other embodiments, the first device identifier can also be a pre-agreed identifier code (e.g., 1357) between the analog-to-digital converter driver and the first device. For example, an identifier code can be predetermined, which can be appropriately selected according to the actual use case, and then the identifier code is saved in both the analog-to-digital converter driver and the first device. In this way, when the terminal executes step 603, the analog-to-digital converter driver can send its saved identifier code (i.e., the first device identifier) to the first device, so that the first device can establish a communication connection with the analog-to-digital converter driver based on the identifier code.
[0105] Step 604: The analog-to-digital converter driver determines whether it has received an identification confirmation message sent by the first device based on the first device identifier. If yes, the analog-to-digital converter driver determines that the first device is an allowed analog-to-digital converter. If no, the analog-to-digital converter driver repeats step 604.
[0106] In some embodiments, if the first device identifier matches the first device's identification code, the first device will return an identification confirmation message to the analog-to-digital converter driver to indicate that the first device identifier matches the first device's identification code. At this time, the analog-to-digital converter driver will determine that the first device is an allowed analog-to-digital converter, and can then perform subsequent registration processing for the analog-to-digital converter. If the first device identifier does not match the first device's identification code, the first device may not return any information to the analog-to-digital converter driver. In this case, the analog-to-digital converter driver will continuously check whether it has received the identification confirmation message sent by the first device based on the first device identifier until the timeout period expires.
[0107] In some embodiments, the identification confirmation information may include a start address field, a destination address field, and a confirmation information field. The start address field is used to fill in the address of the device sending the identification confirmation information, for example, the device address of the first device. The destination address field is used to fill in the address of the device receiving the identification confirmation information, for example, the device address of the analog-to-digital converter driver. The confirmation information field is used to fill in the specific information content of the identification confirmation information. For example, if the content of the confirmation information field is 1, it can be considered that the first device confirms that the first device identifier matches the first device's identification code. For example, if the content of the confirmation information field is 0, it can be considered that the first device confirms that the first device identifier does not match the first device's identification code. For example, in a specific example, assuming the device address of the first device is XX.XX.A and the device address of the analog-to-digital converter driver is XX.XX.B, then when the specific content of the identification confirmation information is XX.XX.A|XX.XX.B|1, it indicates that the identification confirmation information was sent by the first device to the analog-to-digital converter driver, and the first device confirmed in the identification confirmation information that the first device identifier matches the first device's identification code.
[0108] In some other embodiments, step 603 can be replaced by: the analog-to-digital converter driver obtaining the reporting device identifier of the first device through the driver port. In this case, step 604 can be replaced by: the analog-to-digital converter driver determining whether the reporting device identifier matches the pre-stored device identifier stored in the analog-to-digital converter driver; if yes, the analog-to-digital converter driver determines that the first device is an allowed analog-to-digital converter; if no, the analog-to-digital converter driver repeats step 603. In this embodiment, by having the first device actively send the reporting device identifier to the analog-to-digital converter driver, the timeliness of the analog-to-digital converter driver's matching determination of the reporting device identifier and the pre-stored device identifier can be improved. It should be noted that the reporting device identifier and the pre-stored device identifier are equivalent to the first device identifier and the first device identification code described above. For the relevant explanation of the first device identification code, please refer to the relevant explanation of the first device identifier and the first device identification code above, which will not be repeated here.
[0109] Step 605: The analog-to-digital converter driver obtains the device identifier of the analog-to-digital converter and registers the device identifier of the analog-to-digital converter into the registration control, thus completing the registration of the analog-to-digital converter.
[0110] In some embodiments, the analog-to-digital converter (ADC) driver can store the ADC's device identifier in a registration control to complete the ADC registration. Registering the ADC's device identifier through the ADC driver enables electronic devices to recognize the ADC connected to the ADC driver, thereby ensuring that the ADC driver can correctly communicate and control the ADC.
[0111] In some embodiments, the registration control can be a sound card control. Registering the analog-to-digital converter through the sound card control can achieve resource reuse, thereby saving system resources of electronic devices.
[0112] Step 606: The analog-to-digital converter driver initializes the light source data path between the light source frequency resolution unit and the registered analog-to-digital converter.
[0113] In some embodiments, the initialization of the light source data path between the light source frequency resolution unit and the analog-to-digital converter (ADC) may include selecting and confirming the light source data path between the two units, configuring the hardware interface between them, and configuring the registers of the light source frequency resolution unit. Specifically, selecting and confirming the light source data path means determining the currently selected transmission channel to establish the light source data path when the ADC supports multiple transmission channels. Configuring the hardware interface between the light source frequency resolution unit and the ADC involves configuring the hardware interface, such as an I2S bus interface or a TDM bus interface, to ensure smooth communication between them. Configuring the control registers of the light source frequency resolution unit involves configuring its control register parameters to set its operating mode, clock frequency, and other information.
[0114] In some embodiments, by first initializing the light source data path between the light source frequency resolution unit and the analog-to-digital converter, the light source data path can be set to a ready state so that it can quickly respond to data transmission when needed, thereby improving the efficiency of data processing.
[0115] Step 607: The analog-to-digital converter driver powers off the analog-to-digital converter.
[0116] In some embodiments, powering off the analog-to-digital converter (ADC) can mean stopping the supply of power to the ADC. In other embodiments, powering off the ADC can also mean switching the currently supplied higher voltage to the ADC to a lower voltage. The concepts of lower voltage and higher voltage are explained in the preceding descriptions and will not be repeated here.
[0117] In some embodiments, powering off the analog-to-digital converter (ADC) after completing the registration of the ADC and the initialization of the light source data path can save the ADC's energy consumption.
[0118] Step 608: The audio hardware abstraction module initializes the platform adaptation layer.
[0119] In some embodiments, the audio hardware abstraction module can initialize its internal platform adaptation layer so that the platform adaptation layer can control the execution of light source frequency resolution.
[0120] In some embodiments, the initialization of the platform adaptation layer may include configuring the control registers and control response of the platform adaptation layer. Configuring the control registers refers to configuring the control register parameters of the platform adaptation layer to set information such as the operating mode and clock frequency. Configuring the control response refers to configuring the control response capability of the platform adaptation layer to ensure that it can respond to control signals from the light source frequency resolution driving unit in the sensor digital signal processing module, and to initiate the light source frequency resolution unit to call its light source frequency resolution algorithm.
[0121] Step 609: The platform adaptation layer sends a detection thread creation instruction to the message listening process, so that the message listening process creates an exposure time adjustment trigger detection thread according to the detection thread creation instruction.
[0122] In some embodiments, the message monitoring process can run within the sensor's digital signal processing module. The exposure time adjustment trigger detection thread created by the message monitoring process is a looping detection thread that continuously checks whether the exposure time adjustment function has been triggered. By creating the exposure time adjustment trigger detection thread, the system can respond promptly to events that trigger the exposure time adjustment function, thereby enabling the timely generation of light source data path configuration instructions for configuring the path parameters of the light source data path.
[0123] In some embodiments, events that trigger the exposure time adjustment function may include events such as a user opening the camera, a user activating the exposure time adjustment function in the camera application, an electronic device (e.g., a mobile phone) detecting a flicker bar, and an electronic device detecting an ambient light source frequency change exceeding a preset threshold. Specifically, for the user opening the camera, the exposure time adjustment function is triggered when the user opens the camera application. For the user activating the exposure time adjustment function in the camera application, an exposure time adjustment button may be displayed on the camera application interface after the user opens the application; clicking the button triggers the exposure time adjustment function. For the electronic device detecting a flicker bar, the electronic device can continuously monitor for flicker during imaging; if flicker is detected, the electronic device will trigger the exposure time adjustment function. For the electronic device detecting an ambient light source frequency change exceeding a preset threshold, when the electronic device images with an exposure time that is an integer multiple of the flicker period of the ambient light source, if the frequency of the ambient light source changes and the change exceeds the preset threshold, the electronic device can assume that the current ambient light source (i.e., the ambient light source after the frequency change) will cause a flicker bar, and in this case, the electronic device will trigger the exposure time adjustment function. It should be noted that the change in the ambient light source frequency refers to the ratio of the difference between the changed and original light source frequencies to the original light source frequency. When this change exceeds a preset threshold, the frequency change of the ambient light source can be considered to cause flickering. The preset threshold can be appropriately selected based on the actual application, and no specific limitation is made here. For example, the preset threshold can be 0.3 or 0.5, etc.
[0124] Step 610: The message listening process runs the exposure time adjustment trigger detection thread to detect whether the exposure time adjustment function has been triggered.
[0125] In some embodiments, the main code for triggering the detection thread by exposure time adjustment may be as follows:
[0126] while(1){
[0127] mixer_wait_event
[0128] }mixer_read_event
[0129] Here, `mixer_wait_event` represents a function that waits for the exposure time adjustment trigger event to occur, `mixer_read_event` represents a function that outputs the corresponding event information after the exposure time adjustment trigger event occurs, and `while(1){mixer_wait_event}` represents a loop that checks whether `mixer_wait_event` has occurred. During the operation of the exposure time adjustment trigger detection thread, `mixer_wait_event` is continuously monitored. When `mixer_wait_event` is detected, it indicates that the exposure time adjustment function has been triggered. At this time, the exposure time adjustment trigger detection thread will output the corresponding event information through `mixer_read_event` to indicate the generation of a light source data path configuration instruction for configuring the path parameters of the light source data path.
[0130] In some embodiments, the exposure time adjustment function can be triggered when the user taps the camera application. For example, when the user taps the camera application on the electronic device, causing the electronic device to enter the camera application's shooting preview screen, the exposure time adjustment function will be triggered. Alternatively, the exposure time adjustment function can also be triggered when the user confirms the selection of a camera mode. For example, the camera application's camera modes may include an exposure time adjustment mode. After the user taps the camera application on the electronic device, causing the electronic device to enter the camera application's shooting preview screen, the shooting preview screen may display a mode icon corresponding to the exposure time adjustment mode. When the user taps the mode icon corresponding to the exposure time adjustment mode, the exposure time adjustment function is triggered.
[0131] Step 611: The user clicks the camera application on the electronic device.
[0132] In some embodiments, the electronic device may provide camera applications such as self-developed cameras and third-party cameras. Users can open the camera application by touching the area corresponding to the camera application on the electronic device. For example... Figure 7 As shown in the left image, the user can open the camera application by clicking the icon 711 corresponding to the camera application on the main screen 710 of the electronic device. At this time, the main screen 710 of the electronic device will redirect to display the following... Figure 7 The image on the right shows a 720p shooting preview. It's understandable that both self-developed and third-party cameras can include camera modes such as preview, photo, video, portrait, HDR, and large aperture.
[0133] Step 612: The exposure time adjustment trigger detection thread detects the user's click on the camera application and determines that the exposure time adjustment function has been triggered.
[0134] In some embodiments, the exposure time adjustment function can be triggered when the user taps the camera application. Therefore, when the exposure time adjustment trigger detection thread detects the user's tapping of the camera application, it can be determined that the exposure time adjustment function has been triggered.
[0135] Step 613: The sensor digital signal processing module generates a light source data path configuration instruction and sends the light source data path configuration instruction to the audio environment manager.
[0136] In some embodiments, when the exposure time adjustment function is triggered, the sensor digital signal processing module can generate a light source data path configuration instruction to configure the light source data path between the light source frequency resolution unit and the analog-to-digital converter, providing a data transmission basis for the light source information of the ambient light source.
[0137] Step 614: The audio environment manager sends the first configuration instruction to the platform adaptation layer based on the light source data path configuration instruction.
[0138] In some embodiments, the first configuration instruction (pal_stream_open) is an instruction used to instruct the platform adaptation layer to configure the light source data path. Based on the first configuration instruction, the platform adaptation layer can control the registered control to perform configuration processing of the light source data path.
[0139] In some embodiments, the first configuration instruction may include a start address field, a destination address field, and a configuration information field. The start address field is used to fill in the source address from which the first configuration instruction is sent, such as the address of the audio environment manager. The destination address field is used to fill in the destination address from which the first configuration instruction is received, such as the address of the platform adaptation layer. The configuration information field is used to fill in the specific configuration content of the first configuration instruction, such as path configuration information, interface configuration information, device register configuration information, etc. For example, in a specific example, assuming the address of the audio environment manager is XX.XX.1 and the address of the platform adaptation layer is XX.XX.2, then when the specific content of the first configuration instruction is XX.XX.1|XX.XX.2|XXXX, it indicates that the first configuration instruction is sent by the audio environment manager to the platform adaptation layer, and the audio environment manager carries the specific configuration content "XXXX" in the first configuration instruction.
[0140] Step 615: The platform adaptation layer sends a second configuration instruction to the registered control based on the first configuration instruction.
[0141] In some embodiments, the second configuration instruction (Apply_path) is an instruction used to instruct the registration control to configure the light source data path. Based on the second configuration instruction, the registration control can control the analog-to-digital converter driver to perform configuration processing of the light source data path.
[0142] In some embodiments, the second configuration instruction may include a start address field, a destination address field, and a configuration information field. The start address field is used to fill in the source address from which the second configuration instruction is sent, such as the address of the platform adaptation layer. The destination address field is used to fill in the destination address from which the second configuration instruction is received, such as the address of the registered control. The configuration information field is used to fill in the specific configuration content of the second configuration instruction, such as path configuration information, interface configuration information, device register configuration information, etc. For example, in a specific example, assuming the address of the platform adaptation layer is XX.XX.2 and the address of the registered control is XX.XX.3, then when the specific content of the second configuration instruction is XX.XX.2|XX.XX.3|XXXX, it indicates that the second configuration instruction is sent by the platform adaptation layer to the registered control, and the platform adaptation layer carries the specific configuration content of "XXXX" in the second configuration instruction.
[0143] Step 616: The registration control sends a drive control command to the analog-to-digital converter driver based on the second configuration command.
[0144] In some embodiments, the registration control can respond to the second configuration instruction by sending a driver control instruction (Apply_mixer_ctrl) to the analog-to-digital converter driver to trigger the analog-to-digital converter driver to perform configuration processing of the light source data path.
[0145] In some embodiments, the drive control instruction may include a start address field, a destination address field, and a control information field. The start address field is used to fill in the source address from which the drive control instruction is sent, such as the address of a registered control. The destination address field is used to fill in the destination address from which the drive control instruction is received, such as the address of an analog-to-digital converter driver. The control information field is used to fill in the specific control content of the drive control instruction, such as path selection control information, interface control information, device register control information, etc. For example, in a specific example, assuming the address of the registered control is XX.XX.3 and the address of the analog-to-digital converter driver is XX.XX.4, then when the specific content of the drive control instruction is XX.XX.3|XX.XX.4|XXXX, it indicates that the drive control instruction is sent by the registered control to the analog-to-digital converter driver, and the registered control carries the specific control content "XXXX" in the drive control instruction.
[0146] Step 617: The analog-to-digital converter driver supplies power to the analog-to-digital converter based on the drive control instructions and receives the path configuration execution instructions from the registered control.
[0147] In some embodiments, power is supplied to the analog-to-digital converter only when it is determined that configuration of the light source data path between the light source frequency resolution unit and the analog-to-digital converter is required, thus saving unnecessary energy consumption. In other embodiments, the registration control sends the path configuration execution instruction (pcm_open) to the analog-to-digital converter driver only when the analog-to-digital converter is already powered on, which improves the accuracy of the registration control's control over the analog-to-digital converter driver.
[0148] In some embodiments, powering an analog-to-digital converter (ADC) can mean supplying power to an ADC that is currently not powered, thereby enabling the ADC to start. In other embodiments, powering an ADC can also mean converting a lower voltage currently supplied to the ADC to a higher voltage. The concepts of lower and higher voltages are explained in the preceding descriptions and will not be repeated here.
[0149] In some embodiments, the path configuration execution instructions may be instructions generated based on Pulse Code Modulation (PCM), without specific limitations here.
[0150] Step 618: The analog-to-digital converter driver executes instructions based on the path configuration to obtain the registered device identifier from the registration control.
[0151] In some embodiments, the registration control may store registered device identifiers. When the analog-to-digital converter (ADC) driver receives a path configuration execution instruction from the registration control, it can request the registered device identifiers from the registration control. Specifically, the ADC driver can send a device identifier retrieval request to the registration control. This request may include the index of the device identifier to be retrieved. After receiving the request, the registration control can find the corresponding device identifier based on the index in the request and then send the retrieved device identifier to the ADC driver. For example, suppose the registration control stores three device identifiers, A1, A2, and A3, where the index of A1 is B1, the index of A2 is B2, and the index of A3 is B3. If the ADC driver's device identifier retrieval request includes index B2, then after receiving the request, the registration control will send device identifier A2 to the ADC driver.
[0152] Step 619: Based on the registered device identifier, the analog-to-digital converter driver establishes a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter, and configures the path parameters of the light source data path.
[0153] In some embodiments, by using a registration control to store the registered device identifier, the corresponding device identifier can be directly obtained from the registration control when path configuration is required. This allows for accurate path configuration based on the device identifier, ensuring it meets the imaging exposure requirements of the current shooting environment. For example, in a specific example, assuming the device identifier obtained by the analog-to-digital converter driver from the registration control is A2, the driver can establish a light source data path between the light source frequency resolution unit and the analog-to-digital converter with device identifier A2, and configure the corresponding path parameters of this light source data path to ensure it meets the imaging exposure requirements of the current shooting environment.
[0154] In some embodiments, the configuration of path parameters for the light source data path may include data transmission path configuration, light source frequency analysis algorithm configuration, light source data processing accuracy configuration, etc., which are not specifically limited here.
[0155] In some embodiments, the analog-to-digital converter (ADC) driver establishes a light source data path between the light source frequency resolution unit and the registered ADC based on the registered device identifier, and configures the path parameters of the light source data path. Specifically, this process may include: the ADC driver determining the corresponding ADC based on the registered device identifier, then establishing a light source data path between the ADC and the light source frequency resolution unit, and then configuring the path parameters of the light source data path. For example, suppose there are three ADCs, and the device identifiers of these three ADCs registered in the registration control are A1, A2, and A3, respectively; that is, the device identifier of the first ADC is A1, the device identifier of the second ADC is A2, and the device identifier of the third ADC is A3. Assuming the device identifier obtained by the analog-to-digital converter driver from the registration control is A2, the analog-to-digital converter driver can determine that the second analog-to-digital converter is the required analog-to-digital converter. At this time, the analog-to-digital converter driver can establish a light source data path between the light source frequency resolution unit and the second analog-to-digital converter, and then configure the corresponding path parameters of the light source data path so that the light source data path can meet the imaging exposure requirements of the current shooting environment.
[0156] In some embodiments, the light source data path between the light source frequency resolution unit and the analog-to-digital converter can be a multiplexing of the audio data path, thereby improving the efficiency of system resource utilization.
[0157] Step 620: The analog-to-digital converter driver configures the device parameters of the analog-to-digital converter based on the path configuration execution instruction and the registered device identifier obtained from the registration control.
[0158] In some embodiments, by using a registration control to store the registered device identifier, the corresponding device identifier can be directly obtained from the registration control when device configuration is required, and then the device can be accurately configured based on the device identifier to meet the imaging exposure requirements of the current shooting environment.
[0159] In some embodiments, the device parameter configuration for the analog-to-digital converter may include sampling rate configuration, sampling bit depth configuration, etc., which are not specifically limited here. For example, the sampling rate of the analog-to-digital converter can be configured to 16kHz, and the sampling bit depth of the analog-to-digital converter can be configured to 8bit.
[0160] Step 621: The audio environment manager sends a light source data path enabling command to the registered control through the platform adaptation layer.
[0161] In some embodiments, after configuring the path parameters of the light source data path and the device parameters of the analog-to-digital converter, the audio environment manager can send a light source data path start command (pal_stream_start) to the registered control through the platform adaptation layer, so that the registered control can perform the start operation of the light source data path according to the light source data path start command.
[0162] In some embodiments, a light source data path enabling instruction may include a start address field, a destination address field, and an instruction information field. The start address field is used to fill in the source address from which the light source data path enabling instruction is sent, such as the address of an audio environment manager. The destination address field is used to fill in the destination address from which the light source data path enabling instruction is received, such as the address of a registered control. The instruction information field is used to fill in the specific instruction content of the light source data path enabling instruction. For example, if the content of the instruction information field is 1, it indicates that the light source data path enabling instruction instructs the opening of the configured light source data path. For instance, in a specific example, assuming the address of the audio environment manager is XX.XX.1 and the address of the registered control is XX.XX.3, then when the specific content of the light source data path enabling instruction is XX.XX.1|XX.XX.3|1, it means that the light source data path enabling instruction is sent by the audio environment manager to the registered control, and the audio environment manager carries information in the light source data path enabling instruction instructing the opening of the configured light source data path.
[0163] Step 622: The registration control forwards the light source data path opening instruction to the analog-to-digital converter driver.
[0164] In some embodiments, the registration control can forward a light source data path enabling instruction from the audio environment manager to the analog-to-digital converter driver, so that the analog-to-digital converter driver can open the light source data path between the light source frequency resolution unit and the analog-to-digital converter.
[0165] In some embodiments, when the registration control forwards the light source data path start instruction to the analog-to-digital converter driver, it can first convert the light source data path start instruction to obtain a converted light source data path start instruction (pcm_start) that can be recognized by the analog-to-digital converter driver, and then send the converted light source data path start instruction to the analog-to-digital converter driver.
[0166] In some embodiments, the converted light source data path opening instruction can be an instruction generated based on Pulse Code Modulation (PCM), which is not specifically limited here.
[0167] Step 623: The analog-to-digital converter driver forwards the light source data path enable command to the analog-to-digital converter to enable the configured light source data path.
[0168] In some embodiments, the analog-to-digital converter (ADC) driver can send a light source data path activation command to the ADC to start the ADC, thereby opening the light source data path between the configured light source frequency resolution unit and the ADC. Specifically, after the ADC receives the light source data path activation command, since the command carries information indicating the opening of the configured light source data path, the ADC will switch from a sleep state or a low-power state to a normal operating state based on the command. Furthermore, the ADC will set its internally configured transmission channel to a ready state. At this time, the ADC can perform analog-to-digital conversion on the input data and output it, that is, the activation of the light source data path is completed.
[0169] Step 624: The photodiode detects the ambient light source information.
[0170] In some embodiments, the electronic device may include a photodiode. The electronic device can detect ambient light information during imaging using the photodiode. Ambient light information refers to the light source information (e.g., light signal) of the ambient light source. The ambient light source refers to the light source captured by the electronic device when taking a photo or video. Examples of ambient light sources include light emitted by fluorescent lamps, desk lamps, flashlights, and the flashlight function of a mobile phone; no specific limitation is made here.
[0171] In some embodiments, the photodiode is externally connected to the analog-to-digital converter. By using an external photodiode, it is not limited by the hardware resources of the chip platform, and a photodiode with higher light source frequency detection capability can be used, such as a photodiode that can detect light source frequencies in the range of 10Hz to 10GHz. This enables the detection of higher light source frequencies and reduces the problem of flickering in the preview or recording screen of electronic devices.
[0172] In other embodiments, the electronic device may also include an optical frequency sensor or a photomultiplier tube. The optical frequency sensor utilizes the photoelectric effect to convert the frequency of an optical signal into a measurable electrical signal. The photomultiplier tube utilizes the photoelectric effect and secondary electron emission effect to amplify a weak optical signal into a measurable electrical signal. Then, by measuring the amplification factor and response time of the optical signal, the frequency of the light source can be indirectly detected. When the electronic device includes an optical frequency sensor, step 624 can be replaced with: the optical frequency sensor detects ambient light source information. When the electronic device includes a photomultiplier tube, step 624 can be replaced with: the photomultiplier tube detects ambient light source information. It should be noted that both the optical frequency sensor and the photomultiplier tube are externally connected to an analog-to-digital converter.
[0173] In other embodiments, in addition to detecting ambient light information of the ambient light source through a photodiode after the user triggers the exposure time adjustment function, the electronic device can also automatically detect ambient light information of the ambient light source through a photodiode when a large difference in brightness is detected between adjacent pixel rows of the displayed image. Furthermore, the electronic device can also automatically detect ambient light information of the ambient light source through a photodiode when a large change in the light source frequency of the ambient light source is detected.
[0174] When an electronic device can automatically detect ambient light information through a photodiode when it detects a significant difference in brightness between adjacent pixel rows of a displayed image, it can detect the maximum brightness difference between adjacent pixel rows during the imaging process. This maximum brightness difference is then compared to a preset first threshold. If the maximum brightness difference is greater than the first threshold, it indicates a significant flicker problem in the image. In this case, the electronic device can detect the ambient light information through the photodiode and then perform the imaging exposure processing method of this embodiment based on the detected ambient light information to reduce the flicker problem. It should be noted that the specific value of the first threshold can be appropriately selected according to the actual application situation and is not specifically limited here. For example, the specific value of the first threshold can be 20 nits or 10 nits, etc. For example, in a specific instance, suppose the brightness of the first pixel row of the displayed image is detected to be 100 nits, the brightness of the second pixel row is 150 nits, and the brightness of the third pixel row is 140 nits. Then the brightness difference between the first and second pixel rows is 50 nits, and the brightness difference between the second and third pixel rows is 10 nits. Therefore, the maximum brightness difference is 50 nits. Assuming a first threshold of 20 nits, since the maximum brightness difference is greater than the first threshold, it can be considered that the image has a relatively obvious stripe flicker problem (i.e., there is a relatively obvious stripe flicker between the first and second pixel rows). At this time, the electronic device can detect the ambient light information of the current ambient light source, and then perform the imaging exposure processing method of this embodiment based on the ambient light information to reduce the stripe flicker problem.
[0175] When an electronic device can automatically detect ambient light information via a photodiode when it detects a significant change in the frequency of an ambient light source, it can periodically detect this information. If the difference between the ambient light information detected in the current cycle and the ambient light information detected in the previous cycle exceeds a second threshold, it indicates a noticeable flicker problem when taking photos or videos in the current scene. In this case, the electronic device can input the detected ambient light information into an analog-to-digital converter for the imaging exposure processing method of this embodiment, thereby reducing the flicker problem when taking photos or videos in the current scene. It should be noted that the specific value of the second threshold can be appropriately selected based on the actual application situation and is not specifically limited here. For example, the specific value of the second threshold can be 20Hz or 10Hz. For example, in a specific example, assuming the ambient light source in the current shooting scene is a variable-frequency light source (e.g., a frequency-adjustable light source), and the frequency of this ambient light source changes periodically, the frequency of the ambient light source detected by the electronic device in the previous cycle was 50Hz, while the frequency detected by the electronic device in the current cycle is 35Hz. Then the difference between these two ambient light source frequencies is 15Hz. Assuming the second threshold is 10Hz, since the difference between the frequencies of the two ambient light sources is greater than the second threshold, it can be assumed that a stripe flicker problem will occur when taking photos or videos in the current scene. At this time, the electronic device can perform the imaging exposure processing method of this application embodiment based on the ambient light source information detected in the current cycle, thereby reducing the stripe flicker problem.
[0176] Step 625: The photodiode inputs the ambient light information to the analog-to-digital converter, so that the analog-to-digital converter converts the ambient light information into digital light information.
[0177] In some embodiments, by employing an analog-to-digital converter (ADC) independent of the audio codec to replace the ADC function of the audio codec, ambient light information is converted into digital light information suitable for processing within the electronic device. This eliminates the need for an audio codec to perform the ADC, thereby enabling the electronic device to perform light source frequency detection without being limited by the hardware resources of the chip platform. This not only allows for more accurate light source frequency detection but also helps reduce the problem of flickering in the preview or recording screen of the electronic device.
[0178] In some embodiments, the photodiode can be electrically connected to the analog-to-digital converter via wires, such as via microstrip lines or striplines on a printed circuit board (PCB), without being specifically limited here.
[0179] In other embodiments, when the electronic device is equipped with a light frequency sensor or a photomultiplier tube, the content of step 625 will also be replaced accordingly if the content of step 624 is replaced. Specifically: when the electronic device is equipped with a light frequency sensor, the content of step 625 can be replaced by: the light frequency sensor inputs ambient light source information to the analog-to-digital converter, so that the analog-to-digital converter converts the ambient light source information into digital light source information. When the electronic device is equipped with a photomultiplier tube, the content of step 625 can be replaced by: the photomultiplier tube inputs ambient light source information to the analog-to-digital converter, so that the analog-to-digital converter converts the ambient light source information into digital light source information.
[0180] Step 626: The light source frequency analysis unit in the audio digital signal processing module receives the digitized light source information from the analog-to-digital converter and analyzes the digitized light source information to obtain the light source frequency information.
[0181] Step 627: The light source frequency resolution unit converts the light source frequency information into target light source frequency information in a format suitable for exposure time calculation, and sends the target light source frequency information to the camera hardware abstraction module.
[0182] In some embodiments, by utilizing the light source frequency resolution capability of the light source frequency resolution unit in the audio digital signal processing module, the digital light source information is resolved to obtain the light source frequency information. Then, the light source frequency information is converted into target light source frequency information in a format suitable for exposure time calculation. This allows the light source frequency of the ambient light source to be accurately obtained. This is beneficial for the camera hardware abstraction module to adjust the exposure time of the CMOS module in the electronic device to an integer multiple of the flicker period of the ambient light source, thereby effectively reducing the problem of strip flickering in the shooting preview or recording screen of the electronic device.
[0183] Step 628: The camera hardware abstraction module determines the target exposure time for imaging based on the target light source frequency information, and controls the CMOS module to perform imaging based on the target exposure time.
[0184] In some embodiments, the camera hardware abstraction module adjusts the exposure time of the CMOS module to an integer multiple of the flicker period of the ambient light source based on the target light source frequency information to obtain the target exposure time for imaging. Then, the CMOS module is controlled to perform imaging based on the obtained target exposure time, which can effectively reduce the problem of flashing in the preview or recording screen of the electronic device.
[0185] In some embodiments, when the camera hardware abstraction module determines the target exposure time for imaging according to the target light source frequency information, it may first determine the flicker period of the ambient light source according to the target light source frequency information, and then adjust the exposure time currently used by the CMOS module to an integer multiple of this flicker period to obtain the target exposure time for imaging. For example, assume that the target light source frequency information is f1 and the exposure time currently used by the CMOS module is T1. Then, the flicker period of the ambient light source can be determined as 1 / f1, and then the currently used exposure time T1 is adjusted to T2 = n * 1 / f1, where n is a positive integer, so that the target exposure time for imaging (i.e., T2) can be obtained.
[0186] In other embodiments, if the number of detected light source frequencies is multiple (i.e., the current ambient light source is a mixed light source of multiple ambient light sources), the electronic device may first obtain the light intensity corresponding to each light source frequency, then determine the one with the maximum light intensity among these light intensities, and then determine the light source frequency corresponding to the maximum light intensity as the main light source frequency. At this time, the camera hardware abstraction module determines the target exposure time for imaging based on this main light source frequency and controls the CMOS module to perform imaging based on the target exposure time. For example, in a specific example, assume that the number of detected light source frequencies is 3 (i.e., the current ambient light source is a mixed light source of 3 ambient light sources), where the light intensity corresponding to the first light source frequency is C1, the light intensity corresponding to the second light source frequency is C2, and the light intensity corresponding to the third light source frequency is C3, and C1 < C2 < C3. Then, it can be determined that the third light source frequency is the main light source frequency. At this time, the camera hardware abstraction module can determine the target exposure time for imaging based on the third light source frequency and control the CMOS module to perform imaging based on the target exposure time. In addition, in some embodiments, in order to further improve the accuracy and reliability of imaging, it is also possible to filter other light source frequencies except the main light source frequency among these light source frequencies. By filtering out other light source frequencies except the main light source frequency, the influence of other light source frequencies on the imaging exposure process can be avoided, thereby improving the accuracy and reliability of imaging.
[0187] In other embodiments, in scenarios where ambient light sources can be controlled by electronic devices, such as when using a smartphone-controlled smart light for special effects scene shooting (e.g., film shooting), if the electronic device detects that the ratio of the currently set exposure time to the flicker period corresponding to the ambient light source's frequency is not an integer, the electronic device can adjust the set exposure time using a first step length and adjust the light source frequency using a second step length different from the first step length, until the ratio of the adjusted set exposure time to the flicker period corresponding to the adjusted light source frequency is an integer. In this way, the electronic device can use the adjusted set exposure time as the target exposure time and perform imaging based on this target exposure time through the camera hardware abstraction module, thereby reducing the flicker problem. It should be noted that the specific values of the first and second step lengths can be appropriately selected according to the actual application situation, and are not specifically limited here. For example, the specific value of the first step length can be 0.01 seconds or 0.1 seconds, and the specific value of the second step length can be 5Hz or 10Hz, etc. For example, in a specific case, assuming the current set exposure time is 0.08 seconds and the current ambient light source frequency is 40Hz, then the flicker period corresponding to this light source frequency is 1 / 40 = 0.025 seconds. Since 0.08 / 0.025 = 3.2, the ratio of the set exposure time to the flicker period corresponding to the light source frequency is not an integer, which will cause the flickering problem. In this scenario, the user can adjust the set exposure time using an electronic device (such as a mobile phone) in increments of 0.01 seconds, and then adjust the ambient light source frequency in increments of 5 Hz. When the set exposure time is adjusted to 0.1 seconds and the ambient light source frequency is adjusted to 50 Hz, the flicker period corresponding to that frequency becomes 1 / 50 = 0.02 seconds. Since 0.1 / 0.02 = 5, meaning the ratio of the adjusted set exposure time to the flicker period corresponding to the adjusted light source frequency is an integer, the electronic device can use the adjusted set exposure time (i.e., 0.1 seconds) as the target exposure time and perform imaging based on that target exposure time, thereby reducing the flicker problem.
[0188] Step 629: The camera hardware abstraction module sends the image of the stripeless flash phenomenon to the camera application so that the camera application can display a preview of the stripeless flash phenomenon to the user.
[0189] In some embodiments, after the camera hardware abstraction module controls the CMOS module to generate an image without flash based on the target exposure time, the camera hardware abstraction module sends the image to the camera application. At this time, the camera application displays a preview of the image without flash to the user through the screen of the electronic device.
[0190] Step 630: The user exits the camera application.
[0191] In some embodiments, after a user finishes taking a picture or recording a video, the user can exit the camera application by clicking the back button or exit button on the interface displayed by the camera application, or by making a back gesture on the interface displayed by the camera application.
[0192] Step 631: The sensor digital signal processing module generates a light source data path shutdown command and sends the light source data path shutdown command to the audio environment manager.
[0193] In some embodiments, when the sensor digital signal processing module detects that the user has exited the camera application, it can generate a light source data path shutdown command to shut down the light source data path between the light source frequency resolution unit and the analog-to-digital converter, thereby saving system energy consumption and avoiding subsequent impact on the audio data path.
[0194] In some embodiments, a light source data path shutdown instruction may include a start address field, a destination address field, and an instruction information field. The start address field is used to fill in the source address from which the light source data path shutdown instruction is sent, such as the address of the sensor digital signal processing module. The destination address field is used to fill in the destination address from which the light source data path shutdown instruction is received, such as the address of the audio environment manager. The instruction information field is used to fill in the specific instruction content of the light source data path shutdown instruction. For example, if the instruction information field is filled with 1, it indicates that the light source data path shutdown instruction instructs the shutdown of the currently used light source data path. For instance, in a specific example, assuming the address of the sensor digital signal processing module is XX.XX.5 and the address of the audio environment manager is XX.XX.1, then when the specific content of the light source data path shutdown instruction is XX.XX.5|XX.XX.1|1, it means that the light source data path shutdown instruction was sent by the sensor digital signal processing module to the audio environment manager, and the sensor digital signal processing module carries information in the light source data path shutdown instruction instructing the shutdown of the currently used light source data path.
[0195] Step 632: The audio environment manager forwards a command to close the light source data path to the registered control.
[0196] In some embodiments, after the audio environment manager receives a light source data path shutdown instruction from the sensor digital signal processing module, the audio environment manager forwards the light source data path shutdown instruction to the registered control, so that the registered control can perform a shutdown operation on the light source data path according to the light source data path shutdown instruction.
[0197] In some embodiments, when the audio environment manager forwards the light source data path shutdown command to the registration control, it may first convert the light source data path shutdown command to obtain a converted light source data path shutdown command (pal_stream_stop) that the registration control can recognize, and then send the converted light source data path shutdown command (pal_stream_stop) to the registration control.
[0198] Step 633: The registered control forwards the light source data path shutdown command to the analog-to-digital converter driver.
[0199] In some embodiments, the registration control can forward a light source data path shutdown instruction from the audio environment manager to the analog-to-digital converter driver, so that the analog-to-digital converter driver can shut down the light source data path between the light source frequency resolution unit and the analog-to-digital converter.
[0200] In some embodiments, when the registration control forwards the light source data path shutdown command to the analog-to-digital converter driver, it can first convert the light source data path shutdown command to obtain a converted light source data path shutdown command (pcm_stop) that can be recognized by the analog-to-digital converter driver, and then send the converted light source data path shutdown command (pcm_stop) to the analog-to-digital converter driver.
[0201] In some embodiments, the converted light source data path shutdown instruction (pcm_stop) can be an instruction generated based on Pulse Code Modulation (PCM), which is not specifically limited here.
[0202] Step 634: The analog-to-digital converter driver shuts down the light source data path based on the light source data path shutdown command.
[0203] In some embodiments, the analog-to-digital converter (ADC) driver can send a light source data path shutdown command to the ADC, shutting down the ADC and thus closing the light source data path between the light source frequency resolution unit and the ADC. Specifically, after receiving the light source data path shutdown command, the ADC, carrying information indicating the shutdown of the currently used light source data path, will shut down its internal transmission channel based on the command. Furthermore, the ADC will switch from normal operation to sleep or low-power mode, at which point it will stop performing analog-to-digital conversion on the input data, thus completing the shutdown of the light source data path.
[0204] Step 635: The registration control sends a power-off command to the analog-to-digital converter driver.
[0205] In some embodiments, after the analog-to-digital converter (ADC) driver shuts down the light source data path, the registration control can send a power-off command (restore_mixer_ctrl) to the ADC driver to trigger the ADC driver to perform a power-off operation on the ADC.
[0206] In other embodiments, the registration control may also send a power reduction instruction to the analog-to-digital converter driver, which causes the driver to reduce the power supplied to the analog-to-digital converter (e.g., switch from a higher voltage currently supplied to the converter to a lower voltage). In this case, step 635 can be replaced by the registration control sending a power reduction instruction to the analog-to-digital converter driver.
[0207] Step 636: The analog-to-digital converter driver shuts down the analog-to-digital converter based on a power-down command.
[0208] In some embodiments, when the analog-to-digital converter driver receives a power-off command from the registration control, the analog-to-digital converter driver can control the cessation of power supply to the analog-to-digital converter, thereby achieving the purpose of powering off the analog-to-digital converter.
[0209] In other embodiments, when the registration control sends a power reduction command to the analog-to-digital converter driver, step 636 can be replaced by the analog-to-digital converter driver reducing the power supplied to the analog-to-digital converter based on the power reduction command. In this case, the analog-to-digital converter will enter a sleep mode or a low-power mode, thereby saving energy.
[0210] In this embodiment, when ambient light information is detected during imaging using an electronic device, the ambient light information is first input to an analog-to-digital converter (ADC) independent of the audio codec to convert the ambient light information into digital light information. Then, the light source frequency is determined based on the digital light information, and the target exposure time for imaging using the electronic device is determined based on the light source frequency. Imaging is then performed based on the target exposure time. Since this embodiment uses an ADC independent of the audio codec to replace the analog-to-digital conversion function of the audio codec, converting the ambient light information into digital light information suitable for internal processing of the electronic device, it does not require the use of the audio codec in related technologies to achieve analog-to-digital conversion. Therefore, when performing light source frequency detection, it is not limited by the hardware resources of the chip platform, enabling more accurate light source frequency detection and reducing the problem of flickering in the preview or recording screen of the electronic device.
[0211] The imaging exposure processing method provided in this application embodiment will be described in detail below with another specific example. (Refer to...) Figure 8 , Figure 8An interactive schematic diagram of another imaging exposure processing method is shown, which is applied to electronic devices such as mobile phones and tablets, wherein the electronic devices include analog-to-digital converters independent of audio codecs. Figure 8 In this process, the imaging exposure processing method may include:
[0212] Step 801: The user turns on the electronic device.
[0213] Step 802: The analog-to-digital converter driver in the electronic device supplies power to the first device coupled to the drive port of the analog-to-digital converter driver.
[0214] Step 803: The analog-to-digital converter driver sends the first device identifier to the first device through the drive port.
[0215] Step 804: The analog-to-digital converter driver determines whether it has received an identification confirmation message sent by the first device based on the first device identifier. If yes, the analog-to-digital converter driver determines that the first device is an allowed analog-to-digital converter. If no, the analog-to-digital converter driver repeats step 804.
[0216] Step 805: The analog-to-digital converter driver obtains the device identifier of the analog-to-digital converter and registers the device identifier of the analog-to-digital converter into the registration control, thus completing the registration of the analog-to-digital converter.
[0217] Step 806: The analog-to-digital converter driver initializes the light source data path between the light source frequency resolution unit and the registered analog-to-digital converter.
[0218] Step 807: The analog-to-digital converter driver powers off the analog-to-digital converter.
[0219] Step 808: The audio hardware abstraction module initializes the platform adaptation layer.
[0220] Step 809: The platform adaptation layer sends a detection thread creation instruction to the message listening process, so that the message listening process creates an exposure time adjustment trigger detection thread according to the detection thread creation instruction.
[0221] Step 810: The message listening process runs the exposure time adjustment trigger detection thread to detect whether the exposure time adjustment function has been triggered.
[0222] Step 811: The user clicks the camera application on the electronic device.
[0223] Step 812: The exposure time adjustment trigger detection thread detects the user's click on the camera application and determines that the exposure time adjustment function has been triggered.
[0224] Step 813: The sensor digital signal processing module generates a light source data path configuration instruction and sends the light source data path configuration instruction to the audio environment manager.
[0225] In some embodiments, the light source data path configuration instruction may include a target resolution and environmental attributes. The target resolution refers to the resolution that the digital light source information output by the analog-to-digital converter is expected to support. Environmental attributes refer to the attribute information of the current shooting environment, such as the current shooting location, current shooting time, and current shooting weather, etc., which are not specifically limited here. The target resolution can be selected by the user, determined based on historically commonly used resolutions, or determined based on current environmental attributes, which are not specifically limited here. For example, when the target resolution is selected by the user, the user can make the selection in the interface displayed by the camera application. When the target resolution is determined based on historically commonly used resolutions, the user's previously used resolution can be set as the target resolution. When the target resolution is determined based on current environmental attributes, the current shooting location, shooting time, shooting weather, etc., can be determined based on the current environmental attributes, and then the target resolution can be determined based on the current shooting location, shooting time, shooting weather, etc.
[0226] Step 814: The audio environment manager sends the first configuration instruction to the platform adaptation layer based on the light source data path configuration instruction.
[0227] Step 815: The platform adaptation layer sends a second configuration instruction to the registered control based on the first configuration instruction.
[0228] Step 816: The registration control sends drive control instructions to the analog-to-digital converter driver based on the second configuration instructions.
[0229] Step 817: The analog-to-digital converter driver supplies power to the analog-to-digital converter based on the drive control instructions and receives the path configuration execution instructions from the registered control.
[0230] In some embodiments, since the light source data path configuration instruction may include target resolution and environmental attributes, the path configuration execution instruction obtained based on the light source data path configuration instruction may also include target resolution and environmental attributes. It should be noted that the relevant descriptions regarding target resolution and environmental attributes have already been provided above, and will not be repeated here to avoid repetition.
[0231] Step 818: The analog-to-digital converter driver establishes a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter based on the target resolution and environmental attributes in the path configuration execution instruction, and configures the path parameters of the light source data path.
[0232] In some embodiments, the process of establishing a light source data path between a light source frequency resolution unit and a registered analog-to-digital converter based on the target resolution and environmental attributes, and configuring the path parameters of the light source data path, may specifically include: the analog-to-digital converter first determines the target device attributes that match the target resolution and environmental attributes, then determines the registered analog-to-digital converter with the target device attributes, establishes a light source data path between the analog-to-digital converter and the light source frequency resolution unit, and then configures the path parameters of the light source data path based on the target resolution and environmental attributes.
[0233] Step 819: The analog-to-digital converter driver configures the device parameters of the analog-to-digital converter based on the target resolution and environmental properties.
[0234] In some embodiments, configuring the device parameters of the analog-to-digital converter based on the target resolution and environmental attributes can enable the configured analog-to-digital converter to adapt to the target resolution and the environmental attributes of the current shooting environment, thereby meeting the imaging exposure requirements of the current shooting environment.
[0235] Step 820: The audio environment manager sends a light source data path enabling command to the registered control through the platform adaptation layer.
[0236] Step 821: The registration control forwards the light source data path opening instruction to the analog-to-digital converter driver.
[0237] Step 822: The analog-to-digital converter driver forwards the light source data path enable command to the analog-to-digital converter to enable the configured light source data path.
[0238] Step 823: The photodiode detects the ambient light source information.
[0239] Step 824: The photodiode inputs the ambient light information to the analog-to-digital converter, so that the analog-to-digital converter converts the ambient light information into digital light information.
[0240] Step 825: The light source frequency analysis unit in the audio digital signal processing module receives the digitized light source information from the analog-to-digital converter and analyzes the digitized light source information to obtain the light source frequency information.
[0241] Step 826: The light source frequency resolution unit converts the light source frequency information into target light source frequency information in a format suitable for exposure time calculation, and sends the target light source frequency information to the camera hardware abstraction module.
[0242] Step 827: The camera hardware abstraction module determines the target exposure time for imaging based on the target light source frequency information, and controls the CMOS module to perform imaging based on the target exposure time.
[0243] Step 828: The camera hardware abstraction module sends the image of the stripeless flash phenomenon to the camera application so that the camera application can display a preview of the stripeless flash phenomenon to the user.
[0244] Step 829: The user exits the camera application.
[0245] Step 830: The sensor digital signal processing module generates a light source data path shutdown command and sends the light source data path shutdown command to the audio environment manager.
[0246] Step 831: The audio environment manager forwards a command to close the light source data path to the registered control.
[0247] Step 832: The registration control forwards the light source data path shutdown command to the analog-to-digital converter driver.
[0248] Step 833: The analog-to-digital converter driver shuts down the light source data path based on the light source data path shutdown command.
[0249] Step 834: The registration control sends a power-off command to the analog-to-digital converter driver.
[0250] Step 835: The analog-to-digital converter driver shuts down the analog-to-digital converter based on a power-down command.
[0251] It should be noted that the explanations and descriptions of the parts in steps 801 to 835 that are the same as or similar to those in steps 601 to 636 can be found in the relevant content descriptions in steps 601 to 636, and will not be repeated here.
[0252] In this embodiment, when ambient light information is detected during imaging using an electronic device, the ambient light information is first input to an analog-to-digital converter (ADC) independent of the audio codec to convert the ambient light information into digital light information. Then, the light source frequency is determined based on the digital light information, and the target exposure time for imaging using the electronic device is determined based on the light source frequency. Imaging is then performed based on the target exposure time. Since this embodiment uses an ADC independent of the audio codec to replace the analog-to-digital conversion function of the audio codec, converting the ambient light information into digital light information suitable for internal processing of the electronic device, it does not require the use of the audio codec in related technologies to achieve analog-to-digital conversion. Therefore, when performing light source frequency detection, it is not limited by the hardware resources of the chip platform, enabling more accurate light source frequency detection and reducing the problem of flickering in the preview or recording screen of the electronic device.
[0253] The following is a detailed description of the imaging exposure processing method provided in the embodiments of this application, using yet another specific example. (Refer to...) Figure 9, Figure 9 An interactive schematic diagram of yet another imaging exposure processing method is shown, which is applied to electronic devices such as mobile phones and tablets, wherein the electronic devices include analog-to-digital converters independent of audio codecs. Figure 9 In this process, the imaging exposure processing method may include:
[0254] Step 901: The user turns on the electronic device.
[0255] Step 902, the analog-to-digital converter driver in the electronic device supplies power to the first device coupled to the drive port of the analog-to-digital converter driver.
[0256] Step 903: The analog-to-digital converter driver sends the first device identifier to the first device through the drive port.
[0257] Step 904: The analog-to-digital converter driver determines whether it has received an identification confirmation message sent by the first device based on the first device identifier. If yes, the analog-to-digital converter driver determines that the first device is an allowed analog-to-digital converter. If no, the analog-to-digital converter driver repeats step 904.
[0258] Step 905: The analog-to-digital converter driver obtains the device identifier of the analog-to-digital converter and registers the device identifier of the analog-to-digital converter into the registration control, thus completing the registration of the analog-to-digital converter.
[0259] Step 906: The analog-to-digital converter driver initializes the light source data path between the light source frequency resolution unit and the registered analog-to-digital converter.
[0260] Step 907: The analog-to-digital converter driver powers off the analog-to-digital converter.
[0261] Step 908: The audio hardware abstraction module initializes the platform adaptation layer.
[0262] Step 909: The platform adaptation layer sends a detection thread creation instruction to the message listening process, so that the message listening process creates an exposure time adjustment trigger detection thread according to the detection thread creation instruction.
[0263] Step 910: The message listening process runs the exposure time adjustment trigger detection thread to detect whether the exposure time adjustment function has been triggered.
[0264] Step 911: The user clicks the camera app on the electronic device.
[0265] Step 912: The exposure time adjustment trigger detection thread detects the user's click on the camera application and determines that the exposure time adjustment function has been triggered.
[0266] Step 913: The sensor digital signal processing module generates a light source data path configuration instruction and sends the light source data path configuration instruction to the audio environment manager.
[0267] Step 914: The audio environment manager sends the first configuration instruction to the platform adaptation layer based on the light source data path configuration instruction.
[0268] Step 915: The platform adaptation layer sends a second configuration instruction to the registered control based on the first configuration instruction.
[0269] Step 916: The registration control sends drive control instructions to the analog-to-digital converter driver based on the second configuration instructions.
[0270] In step 917, the analog-to-digital converter driver supplies power to the analog-to-digital converter based on the drive control instructions and receives the path configuration execution instructions from the registered control.
[0271] Step 918: The analog-to-digital converter driver executes instructions based on the path configuration to obtain historical path establishment records.
[0272] Step 919: The analog-to-digital converter driver establishes a light source data path based on the historical path record and configures the path parameters of the light source data path.
[0273] In some embodiments, a historical path establishment record is used to indicate the correspondence between the device identifier of the analog-to-digital converter (ADC) in a historically established light source data path, the geographical location of the path establishment, and the path establishment time. For example, suppose a user took a photo at location A and time B, and the electronic device adjusted the exposure time during the photo taking process. That is, the electronic device established a light source data path between the light source frequency resolution unit and the ADC at location A and time B. After establishing this light source data path, the electronic device can save a historical path establishment record. This historical path establishment record includes the device identifier of the ADC used to establish the light source data path (e.g., device identifier C), location A (i.e., the geographical location of the path establishment), and time B (i.e., the path establishment time). In other words, a correspondence is formed between device identifier C, location A, and time B in this historical path establishment record (i.e., a correspondence is formed between the ADC device identifier, the geographical location of the path establishment, and the path establishment time), and this correspondence corresponds to the historical path establishment record. Therefore, through this historical path establishment record, it can be known that a data transmission path was established at location A and time B using an ADC with device identifier C.
[0274] In some embodiments, the process of an analog-to-digital converter (ADC) driver establishing a light source data path based on a historical path establishment record may include: the ADC driver searching the historical path establishment record to obtain a second device identifier corresponding to the current geographical location and current time, and establishing a light source data path between the light source frequency resolution unit and the ADC indicated by the second device identifier. By first searching the historical path establishment record for the second device identifier corresponding to the current geographical location and current time, and then establishing a light source data path between the light source frequency resolution unit and the ADC indicated by the second device identifier based on the found second device identifier, the information in the historical path establishment record can be fully utilized to establish the required light source data path, thereby improving the efficiency of establishing the light source data path.
[0275] Step 920: The analog-to-digital converter driver configures the device parameters of the analog-to-digital converter indicated by the second device identifier based on the second device identifier found through the historical path establishment record.
[0276] In some embodiments, the analog-to-digital converter (ADC) is determined based on the second device identifier found through the historical path establishment record, and the device parameters of the determined ADC are configured. This can make full use of the information in the historical path establishment record to complete the device parameter configuration of the ADC, thereby improving the parameter configuration efficiency of the ADC.
[0277] In some embodiments, the device parameter configuration for the analog-to-digital converter (ADC) may include sampling rate configuration, sampling bit depth configuration, etc., which are not specifically limited here. For example, the sampling rate of the ADC can be configured to 16kHz, and the sampling bit depth can be configured to 8 bits. Since the device parameters of the corresponding ADC can be configured based on the second device identifier found through the historical path establishment record, the historical configuration parameters in the historical path establishment record can be used to configure the device parameters of the ADC, thereby improving the efficiency of ADC parameter configuration.
[0278] Step 921: The audio environment manager sends a light source data path enabling command to the registered control through the platform adaptation layer.
[0279] Step 922: The registration control forwards the light source data path opening instruction to the analog-to-digital converter driver.
[0280] Step 923: The analog-to-digital converter driver forwards the light source data path enable command to the analog-to-digital converter to enable the configured light source data path.
[0281] Step 924: The photodiode detects the ambient light source information.
[0282] Step 925: The photodiode inputs the ambient light information to the analog-to-digital converter, so that the analog-to-digital converter converts the ambient light information into digital light information.
[0283] Step 926: The light source frequency analysis unit in the audio digital signal processing module receives the digitized light source information from the analog-to-digital converter and analyzes the digitized light source information to obtain the light source frequency information.
[0284] Step 927: The light source frequency resolution unit converts the light source frequency information into target light source frequency information in a format suitable for exposure time calculation, and sends the target light source frequency information to the camera hardware abstraction module.
[0285] Step 928: The camera hardware abstraction module determines the target exposure time for imaging based on the target light source frequency information, and controls the CMOS module to perform imaging based on the target exposure time.
[0286] Step 929: The camera hardware abstraction module sends the image of the stripeless flash phenomenon to the camera application so that the camera application can display a preview of the stripeless flash phenomenon to the user.
[0287] Step 930: The user exits the camera application.
[0288] Step 931: The sensor digital signal processing module generates a light source data path shutdown command and sends the light source data path shutdown command to the audio environment manager.
[0289] Step 932: The audio environment manager forwards a command to close the light source data path to the registered control.
[0290] Step 933: The registered control forwards the light source data path shutdown command to the analog-to-digital converter driver.
[0291] Step 934: The analog-to-digital converter driver shuts down the light source data path based on the light source data path shutdown command.
[0292] Step 935: The registration control sends a power-off command to the analog-to-digital converter driver.
[0293] Step 936: The analog-to-digital converter driver shuts down the analog-to-digital converter based on a power-down command.
[0294] It should be noted that for the explanations and descriptions of the parts in steps 901 to 936 that are the same as or similar to those in steps 601 to 636, please refer to the relevant content descriptions in steps 601 to 636, which will not be repeated here.
[0295] In this embodiment, when ambient light information is detected during imaging using an electronic device, the ambient light information is first input to an analog-to-digital converter (ADC) independent of the audio codec to convert the ambient light information into digital light information. Then, the light source frequency is determined based on the digital light information, and the target exposure time for imaging using the electronic device is determined based on the light source frequency. Imaging is then performed based on the target exposure time. Since this embodiment uses an ADC independent of the audio codec to replace the analog-to-digital conversion function of the audio codec, converting the ambient light information into digital light information suitable for internal processing of the electronic device, it does not require the use of the audio codec in related technologies to achieve analog-to-digital conversion. Therefore, when performing light source frequency detection, it is not limited by the hardware resources of the chip platform, enabling more accurate light source frequency detection and reducing the problem of flickering in the preview or recording screen of the electronic device.
[0296] Reference Figure 10 As shown, Figure 10 This is a schematic diagram illustrating the structure of an electronic device according to an embodiment of this application. The electronic device can be a smart device such as a mobile phone or tablet, and is not specifically limited thereto. Figure 10 As shown, the electronic device 300 may include a processor 1010, an external memory interface 1020, an internal memory 1021, a USB interface 1030, a charging management module 1040, a power management module 1041, a battery 1042, an antenna 1, an antenna 2, a mobile communication module 1050, a wireless communication module 1060, an audio module 1070, a speaker 1070A, a receiver 1070B, a microphone 1070C, a headphone jack 1070D, a sensor module 1080, buttons 1090, a motor 1091, an indicator 1092, a camera 1093, a display screen 1094, and a Subscriber Identification Module (SIM) card interface 1095, etc. The sensor module 1080 may include a pressure sensor 1080A, a gyroscope sensor 1080B, a barometric pressure sensor 1080C, a magnetic sensor 1080D, an accelerometer sensor 1080E, a distance sensor 1080F, a proximity sensor 1080G, a fingerprint sensor 1080H, a temperature sensor 1080J, a touch sensor 1080K, an ambient light sensor 1080L, and a bone conduction sensor 1080M, etc.
[0297] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 300. In other embodiments of this application, the electronic device 300 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0298] The processor 1010 may include one or more processing units. For example, the processor 1010 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0299] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0300] The processor 1010 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 1010 is a cache memory. This memory can store instructions or data that the processor 1010 has just used or that are used repeatedly. If the processor 1010 needs to use the instruction or data again, it can directly retrieve it from this memory, thus avoiding repeated accesses, thereby reducing the waiting time of the processor 1010 and improving system efficiency.
[0301] USB interface 1030 is an interface compliant with USB standards, specifically a Mini USB interface, Micro USB interface, USB Type-C interface, etc., supporting various USB specifications including USB 1.0, USB 2.0, USB 3.0, and USB 4.0 or higher. For example, USB interface 1030 may include one or more USB interfaces.
[0302] Furthermore, the processor 1010 is also configured to retrieve instructions from memory to implement the imaging exposure processing method provided in the embodiments of this application, and according to the retrieved instructions, input ambient light source information to an analog-to-digital converter to convert the ambient light source information into digital light source information, then determine the light source frequency based on the digital light source information, then determine the target exposure time for imaging based on the light source frequency, and perform imaging based on the target exposure time. In addition, it is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 300. In other embodiments of this application, the electronic device 300 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0303] The charging management module 1040 receives charging input from the charger, and the power management module 1041 connects the battery 1042, the charging management module 1040, and the processor 1010. The wireless communication function of the electronic device 300 can be implemented through antenna 1, antenna 2, mobile communication module 1050, wireless communication module 1060, modem processor, and baseband processor.
[0304] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 300 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization; for example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0305] The mobile communication module 1050 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 300. The mobile communication module 1050 may include at least one filter, switch, power amplifier, and low-noise amplifier (LNA). The mobile communication module 1050 can receive electromagnetic waves through the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to the modem processor for demodulation. The mobile communication module 1050 can also amplify the signal modulated by the modem processor and then convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 1050 may be housed in the processor 1010. In some embodiments, at least some functional modules of the mobile communication module 1050 and at least some modules of the processor 1010 may be housed in the same device.
[0306] The wireless communication module 1060 can provide solutions for wireless communication applications on the electronic device 300, including Wireless Local Area Networks (WLANs) (such as Wireless Fidelity (Wi-Fi) networks), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR) technologies. The wireless communication module 1060 can be one or more devices integrating at least one communication processing module. The wireless communication module 1060 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering on the electromagnetic waves, and then sends the processed signal to processor 1010. The wireless communication module 1060 can also receive signals to be transmitted from processor 1010, perform frequency modulation and amplification, and then convert them into electromagnetic waves for radiation via antenna 2.
[0307] In some embodiments, antenna 1 of electronic device 300 is coupled to mobile communication module 1050, and antenna 2 is coupled to wireless communication module 1060, enabling electronic device 300 to communicate with networks and other devices via wireless communication technology. This wireless communication technology may include Global System for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).
[0308] Electronic device 300 can perform shooting functions through ISP, camera 1093, video codec, GPU, display screen 1094 and application processor.
[0309] The external storage interface 1020 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the electronic device 300. The external storage card communicates with the processor 1010 through the external storage interface 1020 to perform data storage functions, such as saving music, video, and other files on the external storage card. The electronic device 300 can implement audio functions, such as music playback and audio recording, through the audio module 1070, speaker 1070A, receiver 1070B, microphone 1070C, headphone jack 1070D, and application processor.
[0310] This application also provides an electronic device, which includes a camera, a display screen, an on-chip processor, a digital signal processor, an analog-to-digital converter, and a photodiode, wherein:
[0311] The on-chip processor is connected to the camera, display screen, digital signal processor, and analog-to-digital converter; the analog-to-digital converter is connected to the digital signal processor and photodiode.
[0312] The camera is used to take pictures when running camera applications;
[0313] Photodiodes are used to detect ambient light information;
[0314] Analog-to-digital converters are used to convert ambient light source information into digital light source information;
[0315] Digital signal processors are used to determine the frequency of a light source based on digitized light source information;
[0316] The on-chip processor is used to determine the target exposure time based on the light source frequency and to perform imaging based on the target exposure time;
[0317] The display screen is used to show the image after it has been formed.
[0318] The electronic device provided in this embodiment is used to execute the corresponding imaging exposure processing method provided above. Therefore, the beneficial effects it can achieve can be referred to the beneficial effects in the corresponding imaging exposure processing method provided above, and will not be repeated here.
[0319] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0320] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0321] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0322] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0323] Any content in the various embodiments of this application, as well as any content in the same embodiment, can be freely combined. Any combination of the above content is within the scope of this application.
[0324] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0325] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An imaging exposure processing method, characterized in that, Applied to an electronic device, the electronic device includes an on-chip processor, a digital signal processor, an analog-to-digital converter, and a photodiode, wherein the on-chip processor is connected to the digital signal processor and the analog-to-digital converter, and the analog-to-digital converter is connected to the digital signal processor and the photodiode, the method comprising: In response to user interaction, open the camera app; Run the camera application and use the photodiode to detect ambient light information; The analog-to-digital converter converts the ambient light source information into digital light source information. The digital signal processor determines the light source frequency based on the digitized light source information; The on-chip processor determines the target exposure time based on the light source frequency and performs imaging based on the target exposure time.
2. The method according to claim 1, characterized in that, The on-chip processor includes an analog-to-digital converter driver, the digital signal processor includes a light source frequency resolution unit, and the method further includes, before using the photodiode to detect ambient light information: The analog-to-digital converter driver registers the device information of the analog-to-digital converter; Based on the registered device information, the analog-to-digital converter driver establishes a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter to receive the digitized light source information generated by the analog-to-digital converter.
3. The method according to claim 2, characterized in that, The analog-to-digital converter driver registers device information for the analog-to-digital converter, including: The analog-to-digital converter driver supplies power to a first device coupled to the drive port of the analog-to-digital converter driver; The analog-to-digital converter driver sends a first device identifier to the first device through the drive port; When the analog-to-digital converter driver receives the identification confirmation information sent by the first device based on the first device identifier, the analog-to-digital converter driver determines that the first device is the analog-to-digital converter that is allowed to access; The analog-to-digital converter driver acquires the device information of the first device and registers the device information.
4. The method according to claim 3, characterized in that, After the analog-to-digital converter driver acquires the device information of the first device and registers the device information, the method further includes: The analog-to-digital converter driver initializes the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information.
5. The method according to claim 2, characterized in that, The on-chip processor also includes an overall control module; The analog-to-digital converter driver establishes a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter based on the registered device information, including: The overall control module activates the analog-to-digital converter driver to supply power to the analog-to-digital converter indicated by the registered device information; The analog-to-digital converter driver configures the path parameters of the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information, and configures the device parameters of the analog-to-digital converter. The analog-to-digital converter activates the configured light source data path.
6. The method according to claim 5, characterized in that, The light source data path configuration instructions include target resolution and environmental attributes; The analog-to-digital converter driver configures the path parameters of the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information, and configures the device parameters of the analog-to-digital converter, including: The analog-to-digital converter driver configures the path parameters of the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information, based on the target resolution and the environmental attributes, and configures the device parameters of the analog-to-digital converter.
7. The method according to claim 5, characterized in that, The electronic device also includes a registration control, and the device information is stored in the registration control; The analog-to-digital converter driver configures the path parameters of the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information, and configures the device parameters of the analog-to-digital converter, including: The analog-to-digital converter driver obtains the registered device information from the registration control, and based on the registered device information, configures the path parameters of the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device information, and configures the device parameters of the analog-to-digital converter.
8. The method according to claim 7, characterized in that, The analog-to-digital converter activates the configured light source data path, including: The overall control module sends a light source data path activation command to the registration control; The registration control forwards the light source data path activation command to the analog-to-digital converter driver; The analog-to-digital converter driver forwards the light source data path activation command to the analog-to-digital converter; The analog-to-digital converter activates the configured light source data path according to the light source data path activation command.
9. The method according to claim 5, characterized in that, The path parameter configuration and the device parameter configuration are executed by the analog-to-digital converter driver based on the triggering of the overall control module after receiving the light source data path configuration instruction. The light source data path configuration instruction is sent to the overall control module by the digital signal processor, and the light source data path configuration instruction is generated in the following manner: The digital signal processor creates an exposure time adjustment trigger detection thread; In response to the exposure time adjustment trigger detection thread detecting that the exposure time adjustment function has been triggered, the digital signal processor generates the light source data path configuration instruction.
10. The method according to claim 2, characterized in that, The on-chip processor also includes an overall control module; After the on-chip processor determines the target exposure time based on the light source frequency and performs imaging based on the target exposure time, the method further includes: The overall control module sends a light source data path shutdown command to the analog-to-digital converter driver; The analog-to-digital converter driver shuts down the light source data path and disconnects the power to the analog-to-digital converter.
11. The method according to claim 10, characterized in that, The electronic device also includes a registration control; The overall control module sends a light source data path shutdown command to the analog-to-digital converter driver, including: the overall control module sending the light source data path shutdown command to the registration control; and the registration control forwarding the light source data path shutdown command to the analog-to-digital converter driver. The analog-to-digital converter driver shuts down the light source data path and de-energizes the analog-to-digital converter, including: the analog-to-digital converter driver shuts down the light source data path; in response to the power-off command of the registration control, the analog-to-digital converter driver de-energizes the analog-to-digital converter.
12. The method according to claim 2, characterized in that, The device information includes the device identifier; The analog-to-digital converter driver establishes a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter based on the registered device information, including: The analog-to-digital converter driver establishes the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the registered device identifier.
13. The method according to claim 2, characterized in that, The device information includes device attributes, and the light source data path configuration instructions include target resolution and environmental attributes; The analog-to-digital converter driver establishes a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter based on the registered device information, including: The analog-to-digital converter driver determines the target device attributes that match the target resolution and the environmental attributes, and establishes the light source data path between the light source frequency resolution unit and the registered analog-to-digital converter whose device attributes are the target device attributes.
14. The method according to claim 2, characterized in that, The device information includes the device identifier; The analog-to-digital converter driver establishes a light source data path between the light source frequency resolution unit and the registered analog-to-digital converter based on the registered device information, including: The analog-to-digital converter driver acquires historical path establishment records, which indicate the device identifier of the analog-to-digital converter in the historically established light source data path, and the correspondence between the path establishment geographical location and the path establishment time. The analog-to-digital converter driver searches for the historical path to establish a record, obtains the second device identifier corresponding to the current geographical location and current time, and establishes the light source data path between the light source frequency resolution unit and the analog-to-digital converter indicated by the second device identifier.
15. The method according to claim 1, characterized in that, The digital signal processor includes a light source frequency resolution unit; The digital signal processor determines the light source frequency based on the digitized light source information, including: The light source frequency analysis unit analyzes the digital light source information to obtain light source frequency information, which indicates the light source frequency. The light source frequency resolution unit converts the light source frequency information into target light source frequency information in a format suitable for exposure time calculation.
16. The method according to claim 15, characterized in that, The on-chip processor includes an exposure imaging module; The on-chip processor determines the target exposure time based on the light source frequency and performs imaging based on the target exposure time, including: The exposure imaging module determines the target exposure time based on the target light source frequency information and performs imaging based on the target exposure time.
17. The method according to claim 1, characterized in that, The method of using the photodiode to detect ambient light information includes: Detect the maximum brightness difference between adjacent rows of pixels in the displayed image; If the maximum value of the brightness difference is greater than the first threshold, the photodiode is used to detect ambient light information.
18. The method according to claim 1, characterized in that, The photodiode detects the ambient light information periodically. The analog-to-digital converter converts the ambient light source information into digital light source information, including: If the difference between the ambient light source information detected in the current cycle and the ambient light source information detected in the previous cycle is greater than a second threshold, the analog-to-digital converter converts the ambient light source information into digital light source information.
19. The method according to claim 1, characterized in that, The on-chip processor determines the target exposure time based on the light source frequency and performs imaging based on the target exposure time, including: If the number of determined light source frequencies is multiple, the on-chip processor obtains the light intensity corresponding to each light source frequency; The on-chip processor determines the main light source frequency from among the multiple light source frequencies based on the light intensity; The on-chip processor determines the target exposure time based on the main light source frequency and performs imaging based on the target exposure time.
20. The method according to claim 19, characterized in that, After the on-chip processor determines the main light source frequency from among the multiple light source frequencies based on the light intensity, the method further includes: The on-chip processor filters the light from the multiple light source frequencies other than the main light source frequency.
21. The method according to claim 1, characterized in that, The on-chip processor determines the target exposure time based on the light source frequency and performs imaging based on the target exposure time, including: The on-chip processor obtains the current set exposure time; If the ratio of the set exposure time to the flicker period corresponding to the light source frequency is not an integer, the on-chip processor adjusts the set exposure time with a first step length and adjusts the light source frequency with a second step length until the ratio of the adjusted set exposure time to the flicker period corresponding to the adjusted light source frequency is an integer, wherein the first step length and the second step length are different. The on-chip processor uses the adjusted set exposure time as the target exposure time and performs imaging based on the target exposure time.
22. An electronic device, characterized in that, include: Cameras, displays, on-chip processors, digital signal processors, analog-to-digital converters, and photodiodes; The on-chip processor is connected to the camera, the display screen, the digital signal processor, and the analog-to-digital converter; the analog-to-digital converter is connected to the digital signal processor and the photodiode. The camera is used to take pictures when running a camera application; The photodiode is used to detect ambient light source information; The analog-to-digital converter is used to convert the ambient light source information into digital light source information; The digital signal processor is used to determine the light source frequency based on the digitized light source information; The on-chip processor is used to determine the target exposure time based on the light source frequency, and to perform imaging based on the target exposure time; The display screen is used to display the image after imaging.