Media data processing method, device, electronic device and readable storage medium
By adding the stream description information and verification code of the gain data stream in the JPEG file, the problem of inconvenience in finding Gainmap is solved, and the storage of multiple Gainmap is quickly achieved, simplifying the search process, and improving the search speed and efficiency.
Patent Information
- Application Number
- CN202310667267.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-06
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2043-06-06
AI Technical Summary
In the prior art, after adding Gainmap to the picture with high dynamic range (HDR), all Gainmaps need to be decoded and identified when searching for specified Gainmaps, resulting in inconvenience in searching and lack of unified size standards, and it is impossible to store multiple Gainmaps in the same JPEG file.
By adding stream description information of the gain data stream and its associated verification codes to the media data, the first verification code is used to identify the gain data stream and the second verification code is used to identify the stream description information, so as to quickly locate and find the target gain data stream, avoiding decoding and identification operations of all data.
It realizes the rapid search and reading of target gain data streams in JPEG files, simplifies the search process, supports the storage and management of multiple Gainmap, and improves the search speed and efficiency.
Smart Images

Figure CN116647761B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and specifically relates to a media data processing method, device, electronic device and readable storage medium. Background Art
[0002] In related technologies, for the extended display function of High Dynamic Range (HDR), a storage gain map (Gainmap) is added to an image such as JPEG.
[0003] However, since the sizes of gainmaps of different images are different, after storing the gainmaps, if you want to find a specific gainmap, you need to decode and identify all gainmaps. Therefore, the gainmap storage method in the related art has the problem of being inconvenient to find a specific gainmap. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a media data processing method, device, electronic device and readable storage medium, which can quickly locate the position of the gain data stream and stream description information in the media data, thereby facilitating the search of the media data.
[0005] In a first aspect, an embodiment of the present application provides a method for processing media data, the method comprising:
[0006] Acquire first media data and gain data stream;
[0007] determining stream description information of the gain data stream according to the gain data stream;
[0008] generating a first file according to the first media data, the gain data stream, and the stream description information, and storing the first file, wherein the first file includes: the first media data, the gain data stream, the stream description information, a first check code associated with the gain data stream, and a second check code associated with the stream description information;
[0009] The first check code is used to identify the associated gain data stream in the first file; and the second check code is used to identify the associated stream description information in the first file.
[0010] In a second aspect, an embodiment of the present application provides a media data processing device, the device comprising:
[0011] An acquisition module, configured to acquire first media data and a gain data stream;
[0012] A first determining module, configured to determine stream description information of the gain data stream according to the gain data stream;
[0013] a data processing module, configured to generate a first file based on the first media data, the gain data stream, and the stream description information, and store the first file, wherein the first file includes: the first media data, the gain data stream, the stream description information, a first check code associated with the gain data stream, and a second check code associated with the stream description information;
[0014] The first check code is used to identify the associated gain data stream in the first file; and the second check code is used to identify the associated stream description information in the first file.
[0015] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method described in the first aspect.
[0018] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method described in the first aspect.
[0019] In an embodiment of the present application, by adding a first check code associated with the gain data stream and a second check code associated with the stream description information to the first file, when it is necessary to use the gain data stream to gain adjust the first media data in the first file, the stream description information of each gain data stream can be found from the first file based on the second check code, and the required target gain data stream can be selected according to the stream description information. Then, based on the first check code associated with the target gain data stream, the target gain data stream can be found in the first file. Without decoding, identifying, or other operations on all the gain data streams in the first file, the target gain data stream can be found and read from the first file. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a flow chart of a media data processing method provided by an embodiment of the present application;
[0021] Figure 2 This is a schematic diagram of the JPEG file architecture;
[0022] Figure 3 This is one of the schematic diagrams of the architecture of the first file in the embodiment of the present application;
[0023] Figure 4 This is the second schematic diagram of the structure of the first file in the embodiment of the present application;
[0024] Figure 5 This is the third schematic diagram of the structure of the first file in the embodiment of the present application;
[0025] Figure 6 This is a schematic diagram of the architecture of the extended information in the embodiment of the present application;
[0026] Figure 7 This is a schematic structural diagram of a media data processing device provided in an embodiment of the present application;
[0027] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0028] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0030] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0031] The High Dynamic Range (HDR) display function can be understood as an extended display function for HDR. In the Android system, a unified standard for storing gainmaps in JPEG-R has been established. Specifically, a gainmap is stored after the JPEG data. When reading the gainmap, the data content in the JPEG file is decoded and identified to obtain the data content of the gainmap. Furthermore, the ISO standardization organization is also developing standards related to gainmaps.
[0032] However, the storage of Gainmap in the above related technologies has at least the following problems:
[0033] 1) When adding and storing gainmaps in images such as JPEG files, since gainmaps vary in size, there are many inconveniences in finding and expanding the gainmap after storing it in the JPEG file.
[0034] 2) There is no unified standard for the size of gainmaps, so it is not possible to have multiple gainmaps in the same JPEG file. For example, if there are multiple gainmaps in the same JPEG file, it is impossible to separate the different gainmaps in the file.
[0035] In an embodiment of the present application, a new storage standard is proposed to use a check code to identify a gain data stream, including a data stream of a Gainmap or other type of gain data, and the stream description information of the gain data stream. In this way, based on the check code associated with the stream description information, the respectively associated stream description information can be accurately located from the stored media file (i.e., the first file). Then, based on the stream description information, the required target gain data stream can be searched, and then based on the check code associated with the target gain data stream, the target gain data stream can be accurately located from the stored media file (i.e., the first file).
[0036] The media data processing method, device, electronic device, and readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0037] See also Figure 1 , a media data processing method provided in an embodiment of the present application may include the following steps:
[0038] Step 101: Acquire first media data and gain data stream.
[0039] In some embodiments, the first media data may be media data such as pictures, audio, and video. For ease of explanation, in the embodiments of the present application, the first media data is generally taken as a picture, such as a JPEG picture, and this does not constitute a specific limitation.
[0040] For example, the first media data is a picture generated when a shooting operation is completed. Assuming that the picture is in JPEG format, the schematic diagram of the architecture of the JPEG file corresponding to the picture can be as follows: Figure 2 shown.
[0041] Among them, the gain data stream can be used to adjust the gain of the first media data. For example, when the first media data is a JPEG picture, the gain data stream can be a Gainmap stream. In this way, the brightness gain in the JPEG picture can be adjusted based on the Gainmap stream to achieve a high dynamic range picture display function.
[0042] It should be noted that the type of gain data stream is related to the type of the first media data. For example, for pictures, gain data streams related to pictures such as Gainmap stream and watermark stream can be used; for audio, gain data streams related to audio can be used; for video, gain data streams related to video can be used.
[0043] For example, when taking a photo, a picture is generated and a Gainmap stream in RGBA format is generated when the photo is taken.
[0044] The gain data stream in the first file may be a Gainmap stream in RGBA format, a Gainmap stream in YUV format, or data obtained by encoding a Gainmap stream in YUV format.
[0045] Specifically, the media data processing method provided in the embodiment of the present application can convert the Gainmap stream from RGBA format to YUV format, and then encode the Gainmap stream in YUV format into formats such as JPEG and PNG, and add it to the image data content in the JPEG file, that is, after JPEG DATA; alternatively, the Gainmap stream in YUV format may not be encoded, but the Gainmap stream in YUV format may be added after JPEG DATA in the JPEG file; alternatively, the Gainmap stream in RGBA format may be directly added after JPEG DATA in the JPEG file.
[0046] The format of the Gainmap stream in a JPEG file can be shown in Table 1 below:
[0047] Table 1
[0048]
[0049]
[0050] For the sake of convenience, in the embodiments of the present application, an example is given of adding a Gainmap stream in JPEG format after JPEG DATA in a JPEG file, which is not a specific limitation.
[0051] It should be noted that, for the sake of convenience, the embodiments of the present application are usually illustrated by taking the first media data as a picture, and the gain data stream as a gainmap stream, watermark stream, or other gain data stream related to the picture as an example. The type of the gain data stream and the type of the first media data are not limited here.
[0052] In one implementation, the number of gain data streams may be one or at least two.
[0053] For example, the gain data stream includes a Gainmap stream and other gain streams, wherein the other gain stream may be a watermark stream or other stream different from the Gainmap stream.
[0054] For another example, the gain data stream includes at least two gainmap streams of different sizes, such as a full-size gainmap stream, a 1 / 2-size gainmap stream, a 1 / 4-size gainmap stream, and the like.
[0055] Step 102: Determine stream description information of the gain data stream according to the gain data stream.
[0056] The stream description information can be used to describe the features of the gain data stream, for example, the purpose, encoding format, number of channels of the gain data stream, etc. In this way, a gain data stream that meets the requirements can be found based on the stream description information.
[0057] Optionally, the flow description information includes at least one of the following:
[0058] a target identifier of the gain data stream;
[0059] The type of the gain data stream;
[0060] The service corresponding to the gain data stream;
[0061] the size of the gain data stream;
[0062] A module using the first file;
[0063] a declaration body of the gain data stream;
[0064] Attribute information of the gain data stream.
[0065] The target identifier is used to uniquely identify each gain data stream in the first file. For example, assuming that the gain data stream is a Gainmap stream, the target identifier is the key of the Gainmap stream.
[0066] Optionally, the key can be pre-associated with the Gainmap steam type, data format, etc. For example, the stream description information is shown in Table 2 below:
[0067] Table 2
[0068]
[0069] As shown in Table 2 above, the first four bytes (0x0003) of the Key: 0x00030001 indicate that the gain data stream is a gainmap stream. The last four bytes (0x0001) indicate the service type of the gainmap stream, such as its specific purpose. In other words, the Key can be divided into two parts: one indicating the general stream type, and the other indicating the specific stream type within that general category.
[0070] The size of the gainmap stream data in Table 2 above may be the number of bits of the gainmap stream data.
[0071] The module using the first file may indicate a module that needs to use the first file, such as an album application (Application, App) or a camera App.
[0072] The above-mentioned declaration entity may be the manufacturer of the electronic device that executes the media data processing method provided in the embodiment of the present application.
[0073] As shown in the remarks item in Table 2 above, attribute information of the gain data stream may be recorded, for example, the XDR2.0 parameter may indicate that the gain data stream is a Gainmap stream defined according to the rule XDR2.0, wherein XDR2.0 may be a definition rule for parameters in the Gainmapstream, i.e., Extreme Dynamic Range (XDR) version 2.0.
[0074] Step 103: Generate a first file based on the first media data, the gain data stream, and the stream description information, and store the first file, wherein the first file includes: the first media data, the gain data stream, the stream description information, a first check code associated with the gain data stream, and a second check code associated with the stream description information; wherein the first check code is used to identify the associated gain data stream in the first file; and the second check code is used to identify the associated stream description information in the first file.
[0075] In one embodiment, the gain data stream, the stream description information, the first check code associated with the gain data stream, and the second check code associated with the stream description information can be added after the first media data to form a first file. In this way, because the gainmap encoding stream is saved at the end of the original image Jpeg, this will not affect the normal display of the original image.
[0076] In one implementation, the first check code is associated with the gain data stream, which can be achieved by adding a fixed first check code before each gain data stream.
[0077] Similarly, the second check code is associated with the stream description information, which can be achieved by adding a fixed second check code before the stream description information of each gain data stream.
[0078] For example: Figure 3 As shown, assuming that the first media data is image data, the first check code is the string "Gainmapdata", and the second check code is the string "Gainmapinfo", then "Gainmapdata + data content of the gain data stream" can be added after the image data content: JPG data, and then "Gainmapinfo + stream description information" can be added after "Gainmapdata + data content of the gain data stream". In this way, by identifying Gainmapinfo, the stream description information of the gain data stream in the first file can be accurately located, and by identifying Gainmapdata, the data content of the gain data stream in the first file can be accurately located.
[0079] As an optional implementation manner, the number of the gain data streams may be one or at least two.
[0080] Optionally, the first file further includes: N and a third check code associated with N, where N is a positive integer;
[0081] The value of N is the number of gain data streams in the first file, and the third check code is used to identify the associated N in the first file.
[0082] In this embodiment, multiple gainmap streams or other streams can be written into one image file (taking Jpeg as an example) and combined into a method that does not affect the original file but can quickly obtain any required stream.
[0083] For example, you open the camera preview interface and enter a mode that requires generating multiple gainmap streams, or generating a gainmap stream and other streams, such as a watermark stream. Then, you click the photo button to take the photo. This generates at least one gainmap, which can be generated at different sizes, such as full-size, 1 / 4-size, or 1 / 16-size gainmap streams. A watermark stream may also be generated. At this point, you need to package the captured photo, the gainmap streams of different sizes, and the watermark stream into a first file.
[0084] Optionally, the initial value of N can be equal to 0, and each time a stream is generated, the value of N increases by 1. In this way, the value of N can change with the number of streams.
[0085] Through this embodiment, the number of gain data streams in the first file can be indicated by N, and the third check code can be used to accurately locate the N in the first file.
[0086] Optionally, after storing the first file, the method further includes:
[0087] Reading the first file;
[0088] Determining target gain stream data according to the third check code, the value of N, N second check codes and their corresponding stream description information, and N first check codes and their corresponding gain data streams;
[0089] adjusting the gain of the first media data based on the target gain data stream to obtain second media data;
[0090] The second media data is output.
[0091] In one embodiment, the reading order of the above-mentioned first file can be from back to front, that is, the reading order is: the third check code, the value of N, N second check codes and their corresponding stream description information, N first check codes and their corresponding gain data streams, and the first media data.
[0092] In another embodiment, the first media data can be read first, and then the third check code, the value of N, N second check codes and their corresponding stream description information, N first check codes and their corresponding gain data streams are read in sequence to find and read the required target gain data stream based on the third check code, the second check code and the stream description information, and the first check code.
[0093] For example, you can first identify the third check code from the first file, such as Figure 5 , and then read N based on the identified third check code. Then, based on the value of N, it is determined that the number of gain data streams included in the first file is equal to N. Then, the N second check codes can be searched for respectively, and the stream description information associated with each of the N check codes can be read from the first file. Thus, the required target gain data stream can be found based on the N stream description information. Finally, the target gain data stream can be found from the first file based on the first check code associated with the target gain data stream.
[0094] In one embodiment, the same gain data stream and its stream description information can be stored in adjacent positions in the first file. In this way, when it is determined that the gain data stream described by the target stream description information is the required gain data stream, it can be determined that the gain data stream adjacent to the target stream description information is the target gain data stream.
[0095] For example: Figure 4 As shown, assuming that N is 3, the data content of the three gain data streams and their first check codes and the corresponding stream description information and their second check codes are located in adjacent storage areas in the first file. At this time, for a specific gain data stream, the storage order of the first check code, the data content of the gain data stream, the second check code, and the stream description information is: first check code + data content of the gain data stream -> second check code + stream description information.
[0096] In another embodiment, when N is an integer greater than 1, the first file includes the following information arranged in sequence:
[0097] The first media data, N first check codes and their corresponding gain data streams, N second check codes and their corresponding stream description information, the third check code and the associated N.
[0098] In one embodiment, the method of outputting the second media data can be determined based on the data type of the second media data. For example, if the second media data is a picture, the picture can be displayed on a display screen; if the second media data is audio data, the audio can be played through a speaker.
[0099] In another implementation manner, outputting the second media data may be transmitting the processed second media data to another device via wired transmission or air interface transmission, which will not be elaborated herein.
[0100] In this embodiment, N gain data streams can be stored in sequence in a certain order, and then N stream description information can be stored after the N gain data streams in the same order. In this way, when it is determined that the gain data stream described by the i-th stream description information is the required gain data stream, it can be determined that the i-th gain data stream is the target gain data stream.
[0101] For example: Figure 5 As shown, assuming that N is equal to 3, first insert 3 first check codes + data content of the gain data stream after the JPG data, and then insert 3 second check codes + stream description information after the 3 first check codes + data content of the gain data stream.
[0102] It should be noted that the target gain stream data is determined in the above-mentioned order based on the third check code, the value of N, N second check codes and their corresponding stream description information, N first check codes and their corresponding gain data streams. The target gain stream data can be determined based on the third check code, the second check code, part or all of the stream description information, the first check code and the gain data stream.
[0103] For example: If you follow Figure 4 There is a problem in saving multiple streams in a JPEG file. When there are multiple streams, if we want to find one of the streams we need, we have to search for each stream separately. This causes the read pointer in the buffer to move constantly and requires the complete parsing of the entire stream description information, including the length information. Figure 5 In the storage architecture shown, it is only necessary to read the keys in all stream description information in sequence, and then find the stream that meets the needs based on the key. Figure 5 The storage architecture shown is similar to Figure 4The storage architecture shown can reduce the complexity of searching the gain data stream.
[0104] In some embodiments, determining the target gain stream data in sequence according to the third check code, the value of N, N second check codes and their corresponding stream description information, and N first check codes and their corresponding gain data streams includes:
[0105] Reading N from the first file according to the third verification code;
[0106] Read N second verification codes from the first file;
[0107] Reading target identifiers in the stream description information associated with each of the N second verification codes from the first file;
[0108] selecting a target gain data stream from the N gain data streams according to target identifiers of the N gain data streams;
[0109] The target gain data stream is read from the first file according to the first check code associated with the target gain data stream.
[0110] In one embodiment, the target identifier is a key, and the specific content of the key is shown in Table 2. It can be seen that the target gain data stream can be selected based on the key corresponding to the gain data stream and the gain data stream type, service type and other information described by the key.
[0111] Among them, the association relationship between the key and information such as the gain data stream type and business type can be pre-stored in the device that executes the media data processing method provided by the embodiment of the present application. In this way, when the key is identified, the information such as the gain data stream type and business type reflected by the key can be obtained. For example: when it is necessary to find a stream from multiple streams, since each stream has its own key, the encoding format of each stream can also be determined based on the correspondence between the 4-byte value in the key and the tag as shown in Table 1. In this way, it is only necessary to search for each key in the stream description information to achieve the search of the gain data stream.
[0112] For example, the stream description information of multiple streams shown in Table 3 below includes their respective keys. The key of each stream can be divided into two parts. One part (the first 4 bytes) is used to indicate the general type of the stream, such as GainmapStream, or initialized JPEG (initJpeg)Stream, or depth map (DepthMap)Stream, or each watermark frame on the JPEG image (perWatermarkBokehJpeg)Stream, or logo watermark (LogoWaterMark), or time watermark (TimeWaterMark), or horizontal time frame watermark (horizontalTimeFrameWaterMark)Stream, or flare portrait postdata (postdata)Stream, or document parameters (DocParams)Stream; the other part (the last 4 bytes) is used to indicate the specific classification of the stream, such as full size gain map data, or 1 / 4 size gain map, or a watermark background cutout for a regular image, a dual-camera image without a watermark or blur, or a dual-camera blur depth map, or a dual-camera blur image with a cutout background image at the watermark after blurring, or a logo watermark, a time and location watermark, a border watermark with a time and location watermark, a horizontal bitmap, or a flare portrait postdata, or the original image of an ultra-clear document before correction, or the parameters of an ultra-clear document:
[0113] Table 3
[0114]
[0115]
[0116]
[0117] For example, assuming the first media data is a JPEG image, if you need to remove a logo watermark from the JPEG image, you can find the Stream used to implement the logo watermark as the watermark data stream based on the key, and adjust the pixel gain in the JPEG image based on the Stream of the logo watermark to obtain the JPEG image after removing the logo watermark.
[0118] In this embodiment, it is only necessary to identify the target identifier in the stream description information to realize the gain data stream type corresponding to the target identifier information, thereby realizing the selection of the target gain data stream that meets the needs, which can improve the speed of finding the target gain data stream that meets the needs.
[0119] As an optional implementation manner, the first file further includes extended information, wherein the extended information includes at least one of the following:
[0120] Compatibility information with historical versions;
[0121] Extended information;
[0122] The length of the extended information;
[0123] a fourth check code associated with the extended information, wherein the fourth check code is used to identify the associated extended information in the first file;
[0124] A fifth verification code, wherein the fifth verification information is used to verify the validity of the first file.
[0125] In one embodiment, the extended information (MediaExtendInfo) can be used as information for retaining extensions or setting information for storing metadata. For example, the extended information can specifically include at least one of the following metadata: average gain, maximum gain, minimum gain, etc. of the gain data stream.
[0126] Optionally, the extended information may be in a form similar to the key:value format described above, that is, the correspondence between each extended information content and its respective first identifier is pre-stored, and the first identifier is inserted into the extended information. In this way, the specific extended information content may be obtained based on the first identifier and the pre-stored correspondence between the first identifier and the extended information content.
[0127] In one embodiment, by adding compatibility information with historical versions in the extended information, compatibility with historical versions of media data files can be achieved, wherein the historical versions of media data files may be other frame structure media data files other than the frame structure of the first file stored in the media data processing method provided in the embodiment of the present application, such as a media data file that does not include at least one of the first check code, the second check code, and the third check code.
[0128] For example: Figure 6 As shown, the extended information includes, from back to front: fixed old version compatibility information, then a fixed fourth check code "cameralbum`", then the 4-byte length of the extended information, then the content of the extended information, and then a fixed fifth check code "XXXX".
[0129] Among them, the fifth check code can be used to implement security verification of the first file. For example: when the fourth check code "cameralbum`" is identified, the content of the extended information can be read according to the length of the extended information. Then, when the fifth check code "XXXX" is identified, it is determined that the first file is a file provided by a trusted object, thereby executing the reading of other contents located after the extended information in the first file, such as: the third check code, the second check code, the stream description information, the first check code, the gain data stream, etc.; if the fifth check code "XXXX" is not identified, the reading of other contents located after the extended information in the first file can be terminated.
[0130] The media data processing method provided in the embodiment of the present application can, on the one hand, identify the stream data and its stream description information in the first file based on the first check code and the second check code, thereby simplifying the difficulty of finding the stream; on the other hand, when there are at least two streams in a media data, the at least two streams can be orderly managed, checked, and located, and the storage and transmission of Meta or Settings can be realized, which facilitates the expansion, transmission, and management of images.
[0131] The media data processing method provided in the embodiment of the present application can be executed by a media data processing device. In the embodiment of the present application, the media data processing device provided in the embodiment of the present application is described by taking the media data processing device executing the media data processing method as an example.
[0132] like Figure 7 As shown, a media data processing device 700 provided in an embodiment of the present application may include the following modules:
[0133] An acquisition module 701 is configured to acquire first media data and a gain data stream;
[0134] A first determining module 702, configured to determine stream description information of the gain data stream according to the gain data stream;
[0135] a data processing module 703, configured to generate a first file based on the first media data, the gain data stream, and the stream description information, and store the first file, wherein the first file includes: the first media data, the gain data stream, the stream description information, a first check code associated with the gain data stream, and a second check code associated with the stream description information;
[0136] The first check code is used to identify the associated gain data stream in the first file; and the second check code is used to identify the associated stream description information in the first file.
[0137] Optionally, the flow description information includes at least one of the following:
[0138] a target identifier of the gain data stream;
[0139] The type of the gain data stream;
[0140] The service corresponding to the gain data stream;
[0141] the size of the gain data stream;
[0142] A module using the first file;
[0143] a declaration body of the gain data stream;
[0144] Attribute information of the gain data stream.
[0145] Optionally, the first file further includes: N and a third check code associated with N, where N is a positive integer;
[0146] The value of N is the number of gain data streams in the first file, and the third check code is used to identify the associated N in the first file.
[0147] Optionally, when N is an integer greater than 1, the first file includes the following information arranged in sequence:
[0148] The first media data, N first check codes and their corresponding gain data streams, N second check codes and their corresponding stream description information, the third check code and the associated N.
[0149] Optionally, the media data processing apparatus 700 further includes:
[0150] A reading module, configured to read the first file;
[0151] A second determining module is configured to determine target gain stream data according to the third check code, the value of N, N second check codes and their corresponding stream description information, and N first check codes and their corresponding gain data streams;
[0152] a gain adjustment module, configured to adjust the gain of the first media data based on the target gain data stream to obtain second media data;
[0153] An output module, configured to output the second media data.
[0154] Optionally, the second determining module includes:
[0155] A first reading unit, configured to read the N from the first file according to the third check code;
[0156] A second reading unit, configured to read N second verification codes from the first file;
[0157] a third reading unit, configured to read, from the first file, target identifiers in the stream description information respectively associated with the N second verification codes;
[0158] a selection unit, configured to select a target gain data stream from the N gain data streams according to target identifiers of the N gain data streams;
[0159] A fourth reading unit is configured to read the target gain data stream from the first file according to the first check code associated with the target gain data stream.
[0160] Optionally, the first file further includes extended information, wherein the extended information includes at least one of the following:
[0161] Compatibility information with historical versions;
[0162] Extended information;
[0163] The length of the extended information;
[0164] a fourth check code associated with the extended information, wherein the fourth check code is used to identify the associated extended information in the first file;
[0165] A fifth verification code, wherein the fifth verification information is used to verify the validity of the first file.
[0166] The media data processing device 700 provided in the embodiment of the present application can achieve the following Figure 1 The various steps in the method embodiment shown can be obtained as shown in FIG. Figure 1 The same or similar beneficial effects as those in the illustrated method embodiments are not described again here to avoid repetition.
[0167] The media data processing device in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other device other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.
[0168] The media data processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0169] The media data processing device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented in the illustrated method embodiment will not be described again here.
[0170] Alternatively, as Figure 8 As shown, an embodiment of the present application further provides an electronic device 800, including a processor 801 and a memory 802, wherein the memory 802 stores a program or instruction that can be run on the processor 801. When the program or instruction is executed by the processor 801, the various steps of the above-mentioned media data processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0171] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0172] Figure 9 A schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
[0173] The electronic device 900 includes but is not limited to components such as a radio frequency unit 901 , a network module 902 , an audio output unit 903 , an input unit 904 , a sensor 905 , a display unit 906 , a user input unit 907 , an interface unit 908 , a memory 909 , and a processor 910 .
[0174] Those skilled in the art will understand that the electronic device 900 may also include a power source (such as a battery) to power each component, and the power source may be logically connected to the processor 910 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system. Figure 9 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be repeated here.
[0175] The input unit 904 is configured to obtain the first media data and the gain data stream;
[0176] The processor 910 is configured to determine stream description information of the gain data stream according to the gain data stream;
[0177] The processor 910 is configured to generate a first file based on the first media data, the gain data stream, and the stream description information, and control the memory 909 to store the first file, wherein the first file includes: the first media data, the gain data stream, the stream description information, a first check code associated with the gain data stream, and a second check code associated with the stream description information;
[0178] The first check code is used to identify the associated gain data stream in the first file; and the second check code is used to identify the associated stream description information in the first file.
[0179] Optionally, the flow description information includes at least one of the following:
[0180] a target identifier of the gain data stream;
[0181] The type of the gain data stream;
[0182] The service corresponding to the gain data stream;
[0183] the size of the gain data stream;
[0184] A module using the first file;
[0185] a declaration body of the gain data stream;
[0186] Attribute information of the gain data stream.
[0187] Optionally, the first file further includes: N and a third check code associated with N, where N is a positive integer;
[0188] The value of N is the number of gain data streams in the first file, and the third check code is used to identify the associated N in the first file.
[0189] Optionally, when N is an integer greater than 1, the first file includes the following information arranged in sequence:
[0190] The first media data, N first check codes and their corresponding gain data streams, N second check codes and their corresponding stream description information, the third check code and the associated N.
[0191] Optionally, after the processor 910 controls the memory 909 to store the first file, the processor 910 is further configured to:
[0192] Reading the first file;
[0193] Determining target gain stream data according to the third check code, the value of N, N second check codes and their corresponding stream description information, and N first check codes and their corresponding gain data streams;
[0194] adjusting the gain of the first media data based on the target gain data stream to obtain second media data;
[0195] The audio output unit 903 or the display unit 906 and the interface unit 908 are controlled to output the second media data.
[0196] Optionally, the determining of target gain stream data based on the third check code, the value of N, N second check codes and their corresponding stream description information, and N first check codes and their corresponding gain data streams, performed by the processor 910, includes:
[0197] Reading N from the first file according to the third verification code;
[0198] Read N second verification codes from the first file;
[0199] Reading target identifiers in the stream description information associated with each of the N second verification codes from the first file;
[0200] selecting a target gain data stream from the N gain data streams according to target identifiers of the N gain data streams;
[0201] The target gain data stream is read from the first file according to the first check code associated with the target gain data stream.
[0202] Optionally, the first file further includes extended information, wherein the extended information includes at least one of the following:
[0203] Compatibility information with historical versions;
[0204] Extended information;
[0205] The length of the extended information;
[0206] a fourth check code associated with the extended information, wherein the fourth check code is used to identify the associated extended information in the first file;
[0207] A fifth verification code, wherein the fifth verification information is used to verify the validity of the first file.
[0208] It should be understood that in an embodiment of the present application, the input unit 904 may include a graphics processing unit (GPU) 9041 and a microphone 9042, and the graphics processor 9041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 907 includes a touch panel 9071 and at least one of other input devices 9072. The touch panel 9071 is also called a touch screen. The touch panel 9071 may include two parts: a touch detection device and a touch controller. Other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and an operating stick, which will not be repeated here.
[0209] The memory 909 can be used to store software programs and various data. The memory 909 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 909 may include a volatile memory or a non-volatile memory, or the memory 909 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 909 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0210] Processor 910 may include one or more processing units. Optionally, processor 910 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 910.
[0211] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned media data processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0212] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0213] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned media data processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0214] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0215] An embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the various processes of the above-mentioned media data processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0216] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0217] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0218] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. A media data processing method, characterized in that: include: Acquire first media data and gain data stream; determining stream description information of the gain data stream according to the gain data stream; generating a first file according to the first media data, the gain data stream, and the stream description information, and storing the first file, wherein the first file includes: the first media data, the gain data stream, the stream description information, a first check code associated with the gain data stream, and a second check code associated with the stream description information; The first check code is used to identify the associated gain data stream in the first file; and the second check code is used to identify the associated stream description information in the first file.
2. The method according to claim 1, characterized in that The flow description information includes at least one of the following: a target identifier of the gain data stream; The type of the gain data stream; The service corresponding to the gain data stream; the size of the gain data stream; A module using the first file; a declaration body of the gain data stream; Attribute information of the gain data stream.
3. The method according to claim 1, characterized in that The first file further includes: N and a third check code associated with N, where N is a positive integer; The value of N is the number of gain data streams in the first file, and the third check code is used to identify the associated N in the first file.
4. The method according to claim 3, characterized in that When N is an integer greater than 1, the first file includes the following information arranged in sequence: The first media data, N first check codes and their corresponding gain data streams, N second check codes and their corresponding stream description information, the third check code and the associated N.
5. The method according to claim 4, characterized in that After storing the first file, the method further includes: Reading the first file; Determine a target gain data stream according to the third check code, the value of N, N second check codes and their corresponding stream description information, and N first check codes and their corresponding gain data streams; adjusting the gain of the first media data based on the target gain data stream to obtain second media data; The second media data is output.
6. The method according to claim 5, characterized in that The determining a target gain data stream according to the third check code, the value of N, N second check codes and their corresponding stream description information, and N first check codes and their corresponding gain data streams includes: Reading N from the first file according to the third verification code; Read N second verification codes from the first file; Reading target identifiers in the stream description information associated with each of the N second verification codes from the first file; selecting a target gain data stream from the N gain data streams according to target identifiers of the N gain data streams; The target gain data stream is read from the first file according to the first check code associated with the target gain data stream.
7. The method according to any one of claims 1 to 6, characterized in that The first file further includes extended information, wherein the extended information includes at least one of the following: Compatibility information with historical versions; Extended information; The length of the extended information; a fourth check code associated with the extended information, wherein the fourth check code is used to identify the associated extended information in the first file; A fifth check code is used to check the validity of the first file.
8. A media data processing device, characterized in that: include: An acquisition module, configured to acquire first media data and a gain data stream; A first determining module, configured to determine stream description information of the gain data stream according to the gain data stream; a data processing module, configured to generate a first file based on the first media data, the gain data stream, and the stream description information, and store the first file, wherein the first file includes: the first media data, the gain data stream, the stream description information, a first check code associated with the gain data stream, and a second check code associated with the stream description information; The first check code is used to identify the associated gain data stream in the first file; and the second check code is used to identify the associated stream description information in the first file.
9. The device according to claim 8, characterized in that The first file further includes: N and a third check code associated with N, where N is a positive integer; The value of N is the number of gain data streams in the first file, and the third check code is used to identify the associated N in the first file.
10. The device according to claim 9, characterized in that When N is an integer greater than 1, the first file includes the following information arranged in sequence: The first media data, N first check codes and their associated gain data streams, N second check codes and their associated stream description information, the third check code and the associated N.
11. The device according to claim 10, characterized in that Also includes: A reading module, configured to read the first file; A second determining module, configured to determine a target gain data stream according to the third check code, the value of N, N second check codes and their corresponding stream description information, and N first check codes and their corresponding gain data streams; a gain adjustment module, configured to adjust the gain of the first media data based on the target gain data stream to obtain second media data; An output module, configured to output the second media data.
12. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the media data processing method according to any one of claims 1 to 7 are implemented.
13. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the media data processing method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Backward compatible high dynamic range (HDR) images
CN114257750A
Video processing device and method, and computer storage medium
CN114554212A