CN104916298B - Decoding method, coding and decoding device, electronic equipment and talking picture generation method - Google Patents

Decoding method, coding and decoding device, electronic equipment and talking picture generation method Download PDF

Info

Publication number
CN104916298B
CN104916298B CN201510283432.2A CN201510283432A CN104916298B CN 104916298 B CN104916298 B CN 104916298B CN 201510283432 A CN201510283432 A CN 201510283432A CN 104916298 B CN104916298 B CN 104916298B
Authority
CN
China
Prior art keywords
voice data
file
audio
coding
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510283432.2A
Other languages
Chinese (zh)
Other versions
CN104916298A (en
Inventor
张圣杰
申世安
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201510283432.2A priority Critical patent/CN104916298B/en
Publication of CN104916298A publication Critical patent/CN104916298A/en
Application granted granted Critical
Publication of CN104916298B publication Critical patent/CN104916298B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention discloses a kind of coding method, the described method includes:Obtain the first view data and the first voice data;First voice data is inserted into the file header of picture file according to preset strategy, and described first image data are synthesized into a file with first voice data.The present invention further simultaneously discloses a kind of coding/decoding method, code device, decoding apparatus, electronic equipment and sound photograph generation method.Technical solution using the present invention, it can realize that the coding of picture, audio in same file preserves, and decoding can be synchronized to sound photo and is played, also solve the problems, such as that sound photo is be easy to causeing voice data loss after the preservation of graph and image processing software editing in the prior art, improves user experience at the same time.

Description

Decoding method, coding and decoding device, electronic equipment and talking picture generation method
Technical field
The present invention relates to image processing techniques, more particularly to a kind of decoding method, coding and decoding device, electronic equipment and have Sound Picture Generation Method.
Background technology
In general, people record slice of life with the mode of photo or video.Since sound photo can be shooting people Reappear real scene during shooting at that time with other audiences of photo, therefore, sound photo is increasingly liked be subject to people Love.
At present, sound photo technology is broadly divided into two kinds, and one kind is that photo, audio are separated into two files to store, But this method inconvenience is propagated and browsed at the same time;Another kind is that have photo, audio storage in one file, in picture The end-of-file of form, is inserted directly into the data of audio format, and still, this method is protected by graph and image processing software editing After depositing, voice data loss is be easy to cause.
The content of the invention
In view of this, it is a primary object of the present invention to provide a kind of decoding method, coding and decoding device, electronic equipment and Talking picture generation method, can realize that the coding of picture, audio in same file preserves and synchronous decoding plays, and solve Certainly sound photo is be easy to causeing asking for voice data loss after the preservation of graph and image processing software editing in the prior art Topic.
To reach above-mentioned purpose, the technical proposal of the invention is realized in this way:
The present invention provides a kind of coding method, the described method includes:
Obtain the first view data and the first voice data;
First voice data is inserted into the file header of picture file according to preset strategy, and by first figure As data synthesize a file with first voice data.
Preferably, the preset strategy includes:
Whether the coding of graphics form for judging to use in advance has audio identifiers in image file format standard;
When there is audio identifiers,
Inserted in the file header of picture file with the corresponding audio identifiers of coding of graphics form, in the sound The first voice data is inserted into after frequency identifier;After the completion for the treatment of the first voice data insertion, the first view data is inserted;
When there is no audio identifiers,
Beginning identifier is inserted in the reserved field of the file header of picture file, and is inserted into after the beginning identifier First voice data, after the completion for the treatment of the first voice data insertion, inserts end identifier;
Insert the first view data.
Preferably, it is described acquisition the first view data and the first voice data before, further include:
Obtain the coding of graphics form and audio coding formats of user's selection.
Preferably, the first view data of the acquisition and the first voice data, including:
Acquired image data is encoded according to the selected coding of graphics form of user, generates the first picture number According to;
Acquired voice data is encoded according to the selected audio coding formats of user, generates the first audio number According to.
Present invention also offers a kind of coding/decoding method, the described method includes:
Detect the Format Type of file to be opened;
Search whether that there are first flag symbol in the file header of the file to be opened according to the Format Type;
When there are during first flag symbol, being accorded with based on the first flag and obtain the first voice data;
Decoding is synchronized to first voice data and the first acquired view data.
Preferably, it is described that first voice data is obtained based on first flag symbol, including:
When first flag symbol is audio identifiers, obtained in the file header of the file to be opened positioned at described The first voice data after audio identifiers;
When first flag symbol is starts identifier, end identifier is searched, and obtain and start identifier with terminating The first voice data between identifier.
Preferably, it is described that decoding is synchronized to first voice data and the first acquired view data, bag Include:
Control that the first sub-line journey decodes the first voice data, the second sub-line journey is to first using synchronous control technique View data is decoded;Wherein, first sub-line journey and the second sub-line journey are independent sub-line journey;
The decoded result of the decoded result of first voice data and the first view data is back to main thread, with by institute State the broadcasting of the decoded voice data of main line process control and view data.
Preferably, the broadcasting by the decoded voice data of the main line process control and view data, including:
Pass through the voice data and view data after user interface broadcast decoder.
Present invention also offers a kind of code device, the code device includes first acquisition unit and synthesis unit;Its In,
The first acquisition unit, for obtaining the coding of graphics form and audio coding formats of user's selection;
The synthesis unit, for first voice data to be inserted into the file header of picture file according to preset strategy In, and described first image data are synthesized into a file with first voice data.
Preferably, the preset strategy includes:
Whether the coding of graphics form for judging to use in advance has audio identifiers in image file format standard;
When there is audio identifiers,
Inserted in the file header of picture file with the corresponding audio identifiers of coding of graphics form, in the sound The first voice data is inserted into after frequency identifier;After the completion for the treatment of the first voice data insertion, the first view data is inserted;
When there is no audio identifiers,
Beginning identifier is inserted in the reserved field of the file header of picture file, and is inserted into after the beginning identifier First voice data, after the completion for the treatment of the first voice data insertion, inserts end identifier;
Insert the first view data.
Preferably, it is described acquisition the first view data and the first voice data before, further include:
Obtain the coding of graphics form and audio coding formats of user's selection.
Preferably, the code device, further includes:
Second acquisition unit, for obtaining the coding of graphics form and audio coding formats of user's selection.
Preferably, the first acquisition unit, is additionally operable to:
Acquired image data is encoded according to the selected coding of graphics form of user, generates the first picture number According to;
Acquired voice data is encoded according to the selected audio coding formats of user, generates the first audio number According to.
Present invention also offers a kind of decoding apparatus, the decoding apparatus includes detection unit, searching unit, the 3rd acquisition Unit and decoding unit;Wherein,
The detection unit, for detecting the Format Type of file to be opened;
The searching unit, for searching whether to deposit in the file header of the file to be opened according to the Format Type Accorded with first flag;
3rd acquiring unit, for when there are during first flag symbol, being accorded with based on the first flag and obtain the first sound Frequency evidence;
The decoding unit, for synchronizing solution to first voice data and the first acquired view data Code.
Preferably, the 3rd acquiring unit, is additionally operable to:
When first flag symbol is audio identifiers, obtained in the file header of the file to be opened positioned at described The first voice data after audio identifiers;
When first flag symbol is starts identifier, end identifier is searched, and obtain and start identifier with terminating The first voice data between identifier.
Preferably, the decoding unit, is additionally operable to:
Control that the first sub-line journey decodes the first voice data, the second sub-line journey is to first using synchronous control technique View data is decoded;Wherein, first sub-line journey and the second sub-line journey are independent sub-line journey;
The decoded result of the decoded result of first voice data and the first view data is back to main thread, with by institute State the broadcasting of the decoded voice data of main line process control and view data.
Preferably, the decoding unit, is additionally operable to:
Pass through the voice data and view data after user interface broadcast decoder.
Present invention also offers a kind of electronic equipment, the electronic equipment include at least weigh decoding apparatus described above, And/or decoding apparatus described above.
Present invention also offers a kind of talking picture generation method, the described method includes:
Obtain an at least picture file and an audio file;
The voice data of the audio file is inserted into the file header of the picture file, and by the picture file View data a file is synthesized with the voice data of the audio file.
Decoding method, coding and decoding device, electronic equipment and sound photograph generation method provided by the present invention, obtain the One view data and the first voice data;First voice data is inserted into the file of picture file according to preset strategy In head, and described first image data are synthesized into a file by voice data with first voice data.In this way, it can realize The coding of picture, audio in same file preserves, and decoding can be synchronized to sound photo and is played, while also solves Sound photo is be easy to causeing the problem of voice data is lost after the preservation of graph and image processing software editing in the prior art, Improve user experience.Specifically, using technical solution of the present invention, the propagation for sound photo of being more convenient for share;Even if Also it can be preserved and will not be lost into edlin, audio-frequency information using graph and image processing software, more reliably;Since energy is same Shi Chengxian pictures and sound, user experience is more preferably.
Brief description of the drawings
Fig. 1 realizes flow diagram one for coding method provided in an embodiment of the present invention;
Fig. 2 realizes flow diagram two for coding method provided in an embodiment of the present invention;
Fig. 3 is the flow diagram of the coded treatment of sound photo provided in an embodiment of the present invention;
Fig. 4 realizes flow diagram for talking picture generation method provided in an embodiment of the present invention;
Fig. 5 realizes flow diagram for coding/decoding method provided in an embodiment of the present invention;
Fig. 6 is the process flow schematic diagram of the decoding process of sound photo provided in an embodiment of the present invention;
Fig. 7 is the composition structure diagram of code device provided in an embodiment of the present invention;
Fig. 8 is the composition structure diagram of decoding apparatus provided in an embodiment of the present invention.
Embodiment
In order to more fully hereinafter understand the features of the present invention and technology contents, below in conjunction with the accompanying drawings to the reality of the present invention Now it is described in detail, appended attached drawing purposes of discussion only for reference, is not used for limiting the present invention.
Fig. 1 is that flow diagram one is realized in coding method provided in an embodiment of the present invention, coding staff in the present embodiment Method can be applied in electronic equipment, as shown in Figure 1, the coding method mainly includes the following steps that:
Step 101:Obtain the first view data and the first voice data.
Here, described first image data can refer to the view data after coding;First voice data can be Refer to the voice data after coding.
Which kind of in the present embodiment, specifically acquired image data are encoded using coding of graphics form, Ke Yigen Determined according to default setting of the electronic equipment when dispatching from the factory;Similarly, specifically using which kind of audio coding formats to the sound that is gathered Frequency can be determined according to being encoded according to default setting of the electronic equipment when dispatching from the factory.
It is of course also possible to selection interface is provided to the user, in order to which user selects coding of graphics according to the hobby of oneself Form and audio coding formats.
Preferably, the first view data of the acquisition and the first voice data, can include:
Coding of graphics form encodes acquired image data according to determined by electronic equipment, generates the first figure As data;
Audio coding formats encode acquired voice data according to determined by electronic equipment, generate the first sound Frequency evidence.
Here, when not receiving setting operation of the user to coding of graphics form and audio coding formats, electronics is set Standby identified coding of graphics form and audio coding formats are the forms of system default;
When receiving setting operation of the user to coding of graphics form and audio coding formats, electronic equipment determines Coding of graphics form and audio coding formats be the selected coding format of user and audio coding formats.
In the present embodiment, the electronic equipment is at least configured with:
For obtaining the image collecting device of image, such as camera;
And for obtaining the voice collection device of audio, such as microphone.
In the present embodiment, view data can be obtained by the camera of electronic equipment;Voice data can be set by electronics Standby microphone obtains.
Preferably, voice data can be obtained again after view data is obtained, can also be while view data be obtained Obtain voice data.
That is, user, which can first pass through image preview interface, determines its photo for wanting to clap, then click on shooting and press Start to record again after button;Or record while shooting push button is clicked on.
Step 102:First voice data is inserted into the file header of picture file according to preset strategy, and by institute State the first view data and synthesize a file with first voice data.
Preferably, the preset strategy can include:
Whether the coding of graphics form for judging to use in advance has audio identifiers in image file format standard;
When there is audio identifiers,
Inserted in the file header of picture file with the corresponding audio identifiers of coding of graphics form, in the sound The first voice data is inserted into after frequency identifier;After the completion for the treatment of the first voice data insertion, the first view data is inserted;
When there is no audio identifiers,
Beginning identifier is inserted in the reserved field of the file header of picture file, and is inserted into after the beginning identifier First voice data, after the completion for the treatment of the first voice data insertion, inserts end identifier;
Insert the first view data.
That is, even if not having audio identifiers in image file format standard, voice data can also be inserted into.
In such scheme, alternatively, before the first view data of the acquisition and the first voice data, it can also wrap Include:
Obtain the coding of graphics form and audio coding formats of user's selection.
Specifically, the user interface (abbreviation UI interfaces) of electronic equipment can be provided with coding of graphics form selection dialog box And audio coding formats dialog box, the picture that the electronic equipment is supported is presented in coding of graphics form selects dialog box and compiles Code form, is presented the audio coding formats that the electronic equipment is supported, with by user in audio coding formats select dialog box Coding of graphics form and audio coding formats are made choice according to the hobby of oneself or custom.
Specifically, when electronic equipment has touch-screen (supporting touch input), user can be by using finger or tactile The touch such as pen form is touched to select coding of graphics form and audio coding formats., can when electronic equipment does not support touch input To select coding of graphics form and audio coding formats by relevant button.
Specifically, can also after user's coding of graphics form and audio coding formats of selection for the first time is recorded The coding of graphics form and audio coding formats that user is set for the first time are arranged to the coding of graphics form and sound of acquiescence Frequency coded format, until user actively changes coding of graphics form and audio coding formats again.
In such scheme, alternatively, the first view data of the acquisition and the first voice data, can include:
Acquired image data is encoded according to the selected coding of graphics form of user, generates the first picture number According to;
Acquired voice data is encoded according to the selected audio coding formats of user, generates the first audio number According to.
In embodiments of the present invention, the first view data and the first voice data are obtained;According to preset strategy by described in First voice data is inserted into the file header of picture file, and described first image data and first voice data are closed Into a file;In this way, no matter whether there are audio identifiers corresponding with coding of graphics form in image file format standard, all Voice data can be inserted into;Voice data is placed on the file header of picture file, in any case editing picture, will not influence to read Voice data, realizes the coding of picture, audio in same file and preserves, solve sound photo in the prior art and passing through Cross after graph and image processing software editing preserves and be easy to cause the problem of voice data is lost.
Fig. 2 is that flow diagram two is realized in coding method provided in an embodiment of the present invention, coding staff in the present embodiment Method can be applied in electronic equipment, as shown in Fig. 2, the coding method mainly includes the following steps that:
Step 201:Obtain the coding of graphics form and audio coding formats of user's selection.
Here, the coding of graphics form for user's selection can have a variety of, such as:BMP、JPG、TIFF、GIF、PCX、 TGA, EXIF, FPX, SVG, PSD, CDR, PCD, DXF, UFO, EPS, AI, RAW etc..
Here, the audio coding formats for user's selection can have a variety of, such as:CD、WAVE、AIFF、AU、MPEG、 MP3, MIDI, WMA, VQF, AMR etc..
Specifically, the UI interfaces of electronic equipment can be provided with coding of graphics form selection dialog box and audio coding lattice Formula dialog box, is presented the coding of graphics form that the electronic equipment is supported, in audio in coding of graphics form selects dialog box Coded format selection dialog box in the audio coding formats that the electronic equipment is supported are presented, with by user according to the hobby of oneself Or it is accustomed to be made choice to coding of graphics form and audio coding formats.
Specifically, when electronic equipment has touch-screen (supporting touch input), user can be by using finger or tactile The touch such as pen form is touched to select coding of graphics form and audio coding formats., can when electronic equipment does not support touch input To select coding of graphics form and audio coding formats by relevant button.
Specifically, can also after user's coding of graphics form and audio coding formats of selection for the first time is recorded The coding of graphics form and audio coding formats that user is set for the first time are arranged to the coding of graphics form and sound of acquiescence Frequency coded format, until user actively changes coding of graphics form and audio coding formats again.
Step 202:Obtain the first view data and the first voice data.
Specifically, described first image data can be the view data after coding, and first voice data can be Voice data after coding.
Preferably, the first view data of the acquisition and the first voice data, can include:
Acquired view data is encoded according to the selected coding of graphics form of user, generates the first picture number According to;
Acquired voice data is encoded according to the selected audio coding formats of user, generates the first audio number According to.
In the present embodiment, the electronic equipment is at least configured with:
For obtaining the image collecting device of image, such as camera;
And for obtaining the voice collection device of audio, such as microphone.
In the present embodiment, view data can be obtained by the camera of electronic equipment;Voice data can be set by electronics Standby microphone obtains.
Preferably, voice data can be obtained again after view data is obtained, can also be while view data be obtained Obtain voice data.
That is, user, which can first pass through image preview interface, determines its photo for wanting to clap, then click on shooting and press Start to record again after button;Or record while shooting push button is clicked on.
Step 203:Judge whether the coding of graphics form there are audio identifiers in image file format standard, and it is raw Into judging result.
Here, described image file format standard is image file format standard of the prior art.
For example, described image file format standard can be " digital camera images file format standard (Digital Still Camera Image File Format Standard)”。
It should be noted that the order of step 202 and step 203 can exchange.
Step 204:First voice data is inserted into the file header of picture file based on the judging result, and Described first image data are synthesized into a file with first voice data.
Preferably, the file header that first voice data is inserted into picture file based on the judging result In, and described first image data are synthesized into a file with first voice data, it can include:
When the judging result is there are audio identifiers, inserted in the file header of picture file and the coding of graphics The corresponding audio identifiers of form, are inserted into the first voice data after the audio identifiers;
After the completion for the treatment of the first voice data insertion, the first view data is inserted.
Here, the audio identifiers be existing image file format standard in defined and the coding of graphics The corresponding audio identifiers of form.
Preferably, the file header that first voice data is inserted into picture file based on the judging result In, and described first image data are synthesized into a file with first voice data, it can also include:
When the judging result is not have audio identifiers, inserted out in the reserved field of the file header of picture file Beginning identifier, and the first voice data is inserted into after the beginning identifier, after the completion for the treatment of the first voice data insertion, put Enter end identifier;
Then the first view data is inserted.
Here, the identifier that starts is to be initially inserted into the symbol of the first voice data for characterizing, the end of identification Symbol is the symbol terminated for characterizing the first voice data of insertion.
Need, the identifier and the end identifier of starting can be known by the decoding apparatus of the present invention Not.
For example, start identifier and a knot when the judging result when there is no audio identifiers, to predefine one Beam identification accords with, and pre-defined beginning identifier and end identifier are notified decoding apparatus, in order to decoding apparatus Synthesized file can be decoded.
Specifically, the Format Type of the file after the synthesis is the selected coding of graphics form of user in step 201 Type.
Here, the file after the synthesis can be stored into the memory of electronic equipment, or will by electronic equipment File after the synthesis is sent to server, to preserve the file after the synthesis by server.
In the present embodiment, the electronic equipment can be that mobile phone, tablet computer etc. have camera and microphone and have There is the equipment of encoding function.
For example, the plug-in unit selection coded format during user is applied by camera, by taking JPEG still images as an example, The identifier of file header part definable 0x9286, supports the data of arbitrary format random length, and recording is ejected after shooting photo Prompting, after user is recorded, is encoded automatically according to the coded format of user's selection, talking picture is synthesized, then by institute Sound photo is stated to be saved in memory.
It should be noted that the 0x9286 is " tradable image file format digital camera:Exif” (Exchangeable image file format for Digital Still Cameras:Exif) in 2.1 version of standard Defined identifier, the 0x9286 support the data of arbitrary format random length.
Certainly, definition starts to be not restricted to this form listed above during identifier, does not enumerate herein.
In embodiments of the present invention, the coding of graphics form and audio coding formats of user's selection are obtained;Obtain first View data and the first voice data;Judge whether the coding of graphics form has audio mark in image file format standard Know symbol, and generate judging result;First voice data is inserted into the file header of picture file based on the judging result In, and described first image data are synthesized into a file with first voice data;In this way, voice data is placed on picture The file header of file, editing picture, will not influence to read voice data, realize picture, audio same in any case Coding in file preserves, and it is easy after being preserved by graph and image processing software editing to solve sound photo in the prior art The problem of causing voice data to lose.
Fig. 3 is the flow diagram of the coded treatment of sound photo provided in an embodiment of the present invention, as shown in figure 3, the stream Journey mainly includes the following steps that:
Step 301 receives the coding of graphics form and audio coding formats that user specifies;
Here it is possible to specifying for user is received by UI interfaces.
Step 302:Acquired voice data is encoded according to audio coding formats, generates the first voice data;
Step 303:Judge whether specified coding of graphics form there are audio identifiers in image file format standard, If so, perform step 304;If not provided, perform step 306;
Step 304:The audio identifiers in standard are inserted in File header information, then perform step 305;
Here, the standard refers to the image file format standard described in step 303.
Step 305:The first voice data is inserted after audio identifiers, then performs step 309;
Step 306:Beginning identifier is inserted in the reserved field of file header, then performs step 307;
Wherein, the decoding apparatus identification that starts identifier and can be described by the present invention.
Step 307:The first voice data is inserted into after identifier is started, then performs step 308;
Step 308:Wait to insert after the completion of the first voice data, insert end identifier, then perform step 309;
Wherein, the decoding apparatus identification that the end identifier can be described by the present invention.
Step 309:The first view data is inserted, then performs step 308;
Here, the coding of graphics form that described first image data refer to be specified according to user is to acquired view data The data obtained after being encoded.
The first view data when is specifically generated, can be completed during step 302 to step 308.
Step 310:First voice data is synthesized into a file with the first view data.
Specifically, the file storage after synthesis can be had to the equipment of store function to memory or Cloud Server etc. In.
The executive agent of 301~step 310 of above-mentioned steps may each be code device or have code device Electronic equipment.
Fig. 4 realizes flow diagram for talking picture generation method provided in an embodiment of the present invention;In the present embodiment Talking picture generation can be applied in electronic equipment, as shown in figure 4, talking picture generation mainly includes the following steps that:
Step 401:Obtain an at least picture file and an audio file.
Here, the picture file may come from the first equipment, and the audio file may come from the second equipment;
Wherein, first equipment can be identical equipment or different equipment from second equipment;Institute It can be the third party device different from electronic equipment to state the first equipment and second equipment.
Step 402:The voice data of the audio file is inserted into the file header of the picture file, and by described in The view data of picture file synthesizes a file with the voice data of the audio file.
Alternatively, specifically how the voice data of the audio file to be inserted into the file header of the picture file, The coding method shown in Fig. 1~Fig. 3 is referred to, details are not described herein.
Fig. 5 is that coding/decoding method provided in an embodiment of the present invention realizes flow diagram, coding/decoding method in the present embodiment It can be applied in electronic equipment, as shown in figure 5, the coding/decoding method mainly includes the following steps that:
Step 501:Detect the Format Type of file to be opened.
Here, the file to be opened refers to that record has the picture file of image information and audio-frequency information, such as sound photograph Piece.
Here, the Format Type refers to synthesize coding of graphics form used during the file to be opened, namely step Coding of graphics form described in 501.
Step 502:Search whether that there are the first mark in the file header of the file to be opened according to the Format Type Know symbol.
Here, the first flag symbol can be audio identifiers or start identifier.
Step 503:When there are during first flag symbol, being accorded with based on the first flag and obtain the first voice data.
It should be noted that when first flag symbol is not present in file header, illustrate that the file to be opened does not include sound Frequency information, so, the file to be opened can be opened in the way of existing opening normal picture formatted file, herein no longer Repeat.
Preferably, it is described that first voice data is obtained based on first flag symbol, it can include:
When first flag symbol is audio identifiers, obtained in the file header of the file to be opened positioned at described The first voice data after audio identifiers;
When first flag symbol is starts identifier, end identifier is searched, and obtain and start identifier with terminating The first voice data between identifier.
Certainly, the end identifier can also search in step 502 starts to search in the lump during identifier.
Preferably, during the first voice data of the acquisition, can also include:
Audio coding formats are determined according to the first voice data, to treat to play the decoding according to the audio coding formats Voice data afterwards.
Step 504:Decoding is synchronized to first voice data and the first acquired view data.
Here it is possible to when detecting the Format Type of file to be opened, the first view data is obtained;Can also based on institute After stating first flag symbol the first voice data of acquisition, the first view data is obtained.Certainly, the first view data when is obtained to also have Other modes, no longer enumerated here.
Preferably, it is described that decoding is synchronized to first voice data and the first acquired view data, can With including:
Control that the first sub-line journey decodes the first voice data, the second sub-line journey is to first using synchronous control technique View data is decoded;Wherein, first sub-line journey and the second sub-line journey are independent sub-line journey;
The decoded result of the decoded result of first voice data and the first view data is back to main thread, with by institute State the broadcasting of the decoded voice data of main line process control and view data.
Here, the synchronous control technique can be thread lock technology, atomic operation technology etc..
Preferably, the broadcasting by the decoded voice data of the main line process control and view data, can wrap Include:
Pass through the voice data and view data after user interface broadcast decoder.
In the present embodiment, the electronic equipment can be the equipment that mobile phone, computer etc. have decoding and playing function.
Still illustrated so that user selects coded format as JPEG still images as an example.User clicks in picture library application During the JPEG picture file of pre-review, electronic equipment (or decoding apparatus) retrieves the audio identification defined before this hereof first Symbol 0x9286 whether there is, and such as exist, and obtains relevant first voice data, is put into independent sub-line journey kind and is decoded;It is another Sub-line journey decodes the first acquired view data by simultaneous techniques, and the decoded result of two sub-line journeys returns to master Thread, with by the presentation synchronous on UI of main thread control picture, audio.
In embodiments of the present invention, the Format Type of file to be opened is detected;Wait to beat described according to the Format Type Search whether that there are first flag symbol in the file header of open file;When there are during first flag symbol, being accorded with based on the first flag Obtain the first voice data;Decoding is synchronized to first voice data and the first acquired view data;In this way, Since first flag symbol is present in file header, reading voice data is not interfered with, photo and audio can be carried out at the same time and broadcast Put, make user's experience effect more preferably.
Fig. 6 is the process flow schematic diagram of the decoding process of sound photo provided in an embodiment of the present invention, as shown in fig. 6, The flow comprises the following steps:
Step 601:The Format Type of picture file is detected, then performs step 602;
Specifically, with decoding apparatus electronic equipment (or decoding apparatus) detection picture file Format Type it Before, user can send the instruction of the pre-review picture file by the picture file in clicking on the picture library application of electronic equipment.
Step 602:Retrieval file head, lookup are to be accorded with file header with the presence or absence of first flag;
Here, the first flag symbol can be audio identifiers or start identifier.
Specifically, the file header of the picture file is retrieved.
Step 603:The first voice data is obtained, the first sub-line journey is opened and the first voice data is decoded, and will solution Code result is sent to main thread;
Step 604:The second sub-line journey is controlled to decode the first view data using synchronous control technique, and will decoding As a result send to main thread;
Step 605:The broadcasting of the decoded voice data of the main line process control and view data.
Specifically, the voice data and view data after the broadcast decoder of UI interfaces can be passed through.
The executive agent of 601~step 605 of above-mentioned steps may each be decoding apparatus or have decoding apparatus Electronic equipment.
Fig. 7 is the composition structure diagram of code device provided in an embodiment of the present invention, as shown in fig. 7, the coding dress Put including first acquisition unit 71 and synthesis unit 72;Wherein,
The first acquisition unit 71, for obtaining the coding of graphics form and audio coding formats of user's selection;
The synthesis unit 72, for first voice data to be inserted into the file of picture file according to preset strategy In head, and described first image data are synthesized into a file with first voice data.
Preferably, the preset strategy can include:
Whether the coding of graphics form for judging to use in advance has audio identifiers in image file format standard;
When there is audio identifiers,
Inserted in the file header of picture file with the corresponding audio identifiers of coding of graphics form, in the sound The first voice data is inserted into after frequency identifier;After the completion for the treatment of the first voice data insertion, the first view data is inserted;
When there is no audio identifiers,
Beginning identifier is inserted in the reserved field of the file header of picture file, and is inserted into after the beginning identifier First voice data, after the completion for the treatment of the first voice data insertion, inserts end identifier;
Insert the first view data.
Preferably, the synthesis unit 72, is specifically used for:
When judging there are audio identifiers, inserted in the file header of picture file corresponding with the coding of graphics form Audio identifiers, the first voice data is inserted into after the audio identifiers;
After the completion for the treatment of the first voice data insertion, the first view data is inserted.
Preferably, the synthesis unit 72, also particularly useful for:
When judging not having audio identifiers, beginning identifier is inserted in the reserved field of the file header of picture file, And the first voice data is inserted into after the beginning identifier, after the completion for the treatment of the first voice data insertion, insert end mark Know symbol;
Insert the first view data.
In such scheme, alternatively, the code device, further includes:
Second acquisition unit 73, for obtaining the coding of graphics form and audio coding formats of user's selection.
In such scheme, alternatively, the first acquisition unit 71, also particularly useful for:
Acquired image data is encoded according to the selected coding of graphics form of user, generates the first picture number According to;
Acquired voice data is encoded according to the selected audio coding formats of user, generates the first audio number According to.
It will be appreciated by those skilled in the art that each processing unit in code device shown in Fig. 7 realizes function, can Understand with reference to the associated description of aforementioned encoding methods.It is it will be appreciated by those skilled in the art that each in code device shown in Fig. 7 Processing unit, can be realized by running on the program on processor, can also be realized by specifically logic circuit.
First acquisition unit 71, synthesis unit 72 in code device described in various embodiments above, second acquisition unit 73, in practical applications can by the code device or the code device central processing unit in the electronic device (CPU, Central Processing Unit), digital signal processor (DSP, Digital Signal Processor) or Programmable gate array (FPGA, Field-Programmable Gate Array) is realized.
Fig. 8 is the composition structure diagram of decoding apparatus provided in an embodiment of the present invention, as shown in figure 8, the decoding dress Put including detection unit 81, searching unit 82, the 3rd acquiring unit 83 and decoding unit 84;Wherein,
The detection unit 81, for detecting the Format Type of file to be opened;
The searching unit 82, for being searched whether according to the Format Type in the file header of the file to be opened There are first flag symbol;
3rd acquiring unit 83, for when there are during first flag symbol, first is obtained based on first flag symbol Voice data;
The decoding unit 84, for being synchronized to first voice data and the first acquired view data Decoding.
Preferably, the 3rd acquiring unit 83, is specifically used for:
When first flag symbol is audio identifiers, obtained in the file header of the file to be opened positioned at described The first voice data after audio identifiers;
When first flag symbol is starts identifier, end identifier is searched, and obtain and start identifier with terminating The first voice data between identifier.
Preferably, the decoding unit 84, is specifically used for:
Control that the first sub-line journey decodes the first voice data, the second sub-line journey is to first using synchronous control technique View data is decoded;Wherein, first sub-line journey and the second sub-line journey are independent sub-line journey;
The decoded result of the decoded result of first voice data and the first view data is back to main thread, with by institute State the broadcasting of the decoded voice data of main line process control and view data.
Preferably, the decoding unit, also particularly useful for:
Pass through the voice data and view data after user interface broadcast decoder.
It will be appreciated by those skilled in the art that each processing unit in decoding apparatus shown in Fig. 8 realizes function, can Understand with reference to the associated description of foregoing coding/decoding method.It is it will be appreciated by those skilled in the art that each in decoding apparatus shown in Fig. 8 Processing unit, can be realized by running on the program on processor, can also be realized by specifically logic circuit.
Detection unit 81, searching unit 82 in decoding apparatus described in various embodiments above, 83 and of the 3rd acquiring unit Decoding unit 84, in practical applications can by the decoding apparatus or the decoding apparatus CPU in the electronic device, DSP or FPGA is realized.
The present invention also describes a kind of electronic equipment, and the electronic equipment includes code device described above, and/or, Decoding apparatus described above.
Specifically, the composition structure diagram of the code device can be with as shown in fig. 7, the decoding apparatus forms knot Structure schematic diagram can be with as shown in figure 8, details are not described herein.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row His property includes, so that process, method, article or device including a series of elements not only include those key elements, and And other elements that are not explicitly listed are further included, or further include as this process, method, article or device institute inherently Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this Also there are other identical element in the process of key element, method, article or device.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on such understanding, technical scheme substantially in other words does the prior art Going out the part of contribution can be embodied in the form of software product, which is stored in a storage medium In (such as ROM/RAM, magnetic disc, CD), including some instructions are used so that a station terminal equipment (can be mobile phone, computer, takes Be engaged in device, air conditioner, or network equipment etc.) perform method described in each embodiment of the present invention.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair The equivalent structure or equivalent flow shift that bright specification and accompanying drawing content are made, is directly or indirectly used in other relevant skills Art field, is included within the scope of the present invention.

Claims (14)

  1. A kind of 1. coding method, it is characterised in that the described method includes:
    Obtain the first view data and the first voice data;
    First voice data is inserted into the file header of picture file according to preset strategy, and by described first image number A file is synthesized according to first voice data,
    Wherein, the preset strategy includes:
    Whether the coding of graphics form for judging to use in advance has audio identifiers in image file format standard;
    When there is audio identifiers,
    Inserted in the file header of picture file with the corresponding audio identifiers of coding of graphics form, in the audio mark The first voice data is inserted into after knowing symbol;After the completion for the treatment of the first voice data insertion, the first view data is inserted;
    When there is no audio identifiers,
    Beginning identifier is inserted in the reserved field of the file header of picture file, and first is inserted into after the beginning identifier Voice data, after the completion for the treatment of the first voice data insertion, inserts end identifier;
    Insert the first view data.
  2. 2. coding method according to claim 1, it is characterised in that the first view data of the acquisition and the first audio Before data, further include:
    Obtain the coding of graphics form and audio coding formats of user's selection.
  3. 3. coding method according to claim 2, it is characterised in that the first view data of the acquisition and the first audio Data, including:
    Acquired image data is encoded according to the selected coding of graphics form of user, generates the first view data;
    Acquired voice data is encoded according to the selected audio coding formats of user, generates the first voice data.
  4. A kind of 4. coding/decoding method, it is characterised in that the described method includes:
    Detect the Format Type of file to be opened;
    Search whether that there are first flag symbol in the file header of the file to be opened according to the Format Type;
    When there are during first flag symbol, being accorded with based on the first flag and obtain the first voice data;
    Decoding is synchronized to first voice data and the first acquired view data;
    Wherein, it is described that first voice data is obtained based on first flag symbol, including:
    When first flag symbol is audio identifiers, is obtained in the file header of the file to be opened and be located at the audio The first voice data after identifier;
    When first flag symbol is starts identifier, end identifier is searched, and obtain and start identifier and end of identification The first voice data between symbol.
  5. 5. coding/decoding method according to claim 4, it is characterised in that described to first voice data and acquired The first view data synchronize decoding, including:
    Control that the first sub-line journey decodes the first voice data, the second sub-line journey is to the first image using synchronous control technique Data are decoded;Wherein, first sub-line journey and the second sub-line journey are independent sub-line journey;
    The decoded result of the decoded result of first voice data and the first view data is back to main thread, with by the master Thread controls the broadcasting of decoded voice data and view data.
  6. 6. coding/decoding method according to claim 5, it is characterised in that described by the decoded audio of main line process control The broadcasting of data and view data, including:
    Pass through the voice data and view data after user interface broadcast decoder.
  7. 7. a kind of code device, it is characterised in that the code device includes first acquisition unit and synthesis unit;Wherein,
    The first acquisition unit, for obtaining the first view data and the first voice data;
    The synthesis unit, for first voice data to be inserted into the file header of picture file according to preset strategy, And described first image data are synthesized into a file with first voice data;
    Wherein, the preset strategy includes:
    Whether the coding of graphics form for judging to use in advance has audio identifiers in image file format standard;
    When there is audio identifiers,
    Inserted in the file header of picture file with the corresponding audio identifiers of coding of graphics form, in the audio mark The first voice data is inserted into after knowing symbol;After the completion for the treatment of the first voice data insertion, the first view data is inserted;
    When there is no audio identifiers,
    Beginning identifier is inserted in the reserved field of the file header of picture file, and first is inserted into after the beginning identifier Voice data, after the completion for the treatment of the first voice data insertion, inserts end identifier;
    Insert the first view data.
  8. 8. code device according to claim 7, the code device further includes:
    Second acquisition unit, for obtaining the coding of graphics form and audio coding formats of user's selection.
  9. 9. code device according to claim 8, the first acquisition unit, are additionally operable to:
    Acquired image data is encoded according to the selected coding of graphics form of user, generates the first view data;
    Acquired voice data is encoded according to the selected audio coding formats of user, generates the first voice data.
  10. 10. a kind of decoding apparatus, it is characterised in that the decoding apparatus includes detection unit, searching unit, the 3rd acquiring unit And decoding unit;Wherein,
    The detection unit, for detecting the Format Type of file to be opened;
    The searching unit, for searching whether that there are in the file header of the file to be opened according to the Format Type One identifier;
    3rd acquiring unit, for when there are during first flag symbol, being accorded with based on the first flag and obtain the first audio number According to;
    The decoding unit, for synchronizing decoding to first voice data and the first acquired view data;
    Wherein, the 3rd acquiring unit, is additionally operable to:
    When first flag symbol is audio identifiers, is obtained in the file header of the file to be opened and be located at the audio The first voice data after identifier;
    When first flag symbol is starts identifier, end identifier is searched, and obtain and start identifier and end of identification The first voice data between symbol.
  11. 11. decoding apparatus according to claim 10, it is characterised in that the decoding unit, is additionally operable to:
    Control that the first sub-line journey decodes the first voice data, the second sub-line journey is to the first image using synchronous control technique Data are decoded;Wherein, first sub-line journey and the second sub-line journey are independent sub-line journey;
    The decoded result of the decoded result of first voice data and the first view data is back to main thread, with by the master Thread controls the broadcasting of decoded voice data and view data.
  12. 12. decoding apparatus according to claim 10, it is characterised in that the decoding unit, is additionally operable to:
    Pass through the voice data and view data after user interface broadcast decoder.
  13. 13. a kind of electronic equipment, it is characterised in that the electronic equipment includes at least claim 7 to any one of claim 9 The code device, and/or claim 10 are to claim 12 any one of them decoding apparatus.
  14. A kind of 14. talking picture generation method, it is characterised in that the described method includes:
    Obtain an at least picture file and an audio file;
    The voice data of the audio file is inserted into the file header of the picture file, and by the figure of the picture file As data synthesize a file with the voice data of the audio file;
    Wherein, the voice data of the audio file is inserted into the file header of the picture file and is specially:Judgement is adopted in advance Whether coding of graphics form has audio identifiers in image file format standard;
    When there is audio identifiers,
    Inserted in the file header of picture file with the corresponding audio identifiers of coding of graphics form, in the audio mark The first voice data is inserted into after knowing symbol;After the completion for the treatment of the first voice data insertion, the first view data is inserted;
    When there is no audio identifiers,
    Beginning identifier is inserted in the reserved field of the file header of picture file, and first is inserted into after the beginning identifier Voice data, after the completion for the treatment of the first voice data insertion, inserts end identifier;
    Insert the first view data.
CN201510283432.2A 2015-05-28 2015-05-28 Decoding method, coding and decoding device, electronic equipment and talking picture generation method Active CN104916298B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510283432.2A CN104916298B (en) 2015-05-28 2015-05-28 Decoding method, coding and decoding device, electronic equipment and talking picture generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510283432.2A CN104916298B (en) 2015-05-28 2015-05-28 Decoding method, coding and decoding device, electronic equipment and talking picture generation method

Publications (2)

Publication Number Publication Date
CN104916298A CN104916298A (en) 2015-09-16
CN104916298B true CN104916298B (en) 2018-05-11

Family

ID=54085322

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510283432.2A Active CN104916298B (en) 2015-05-28 2015-05-28 Decoding method, coding and decoding device, electronic equipment and talking picture generation method

Country Status (1)

Country Link
CN (1) CN104916298B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105472289B (en) * 2015-11-11 2019-02-22 努比亚技术有限公司 Edit the device and method of sound photo
CN105407282A (en) * 2015-11-16 2016-03-16 中科创达软件股份有限公司 Photographing method and replay method
CN105677717B (en) * 2015-12-29 2019-04-19 努比亚技术有限公司 A kind of display methods and terminal
CN106777204B (en) * 2016-12-23 2020-08-07 北京安云世纪科技有限公司 Picture data processing method and device and mobile terminal
CN106791442B (en) * 2017-01-20 2019-11-15 维沃移动通信有限公司 A kind of image pickup method and mobile terminal
CN112151048B (en) * 2019-06-11 2024-04-02 李庆成 Method for generating and processing audio-visual data
CN111354384A (en) * 2020-02-27 2020-06-30 北京奇艺世纪科技有限公司 GIF picture generation method, playing method and device and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1199892A4 (en) * 2000-03-14 2006-08-09 Matsushita Electric Ind Co Ltd Device and method for reproducing image and voice
CN101986302B (en) * 2010-10-28 2012-10-17 华为终端有限公司 Media file association method and device
CN102609968B (en) * 2012-03-05 2015-06-24 深圳市优利麦克科技开发有限公司 Method and system for realizing audio picture
CN104580888B (en) * 2014-12-17 2018-09-04 广东欧珀移动通信有限公司 A kind of image processing method and terminal

Also Published As

Publication number Publication date
CN104916298A (en) 2015-09-16

Similar Documents

Publication Publication Date Title
CN104916298B (en) Decoding method, coding and decoding device, electronic equipment and talking picture generation method
KR101733793B1 (en) Method and apparatus for managing of data
WO2018149175A1 (en) Video-recording method and apparatus, and electronic device
CN104869467B (en) Information output method, device and system in media play
JP6065019B2 (en) REPRODUCTION CONTROL DEVICE, REPRODUCTION CONTROL METHOD, AND PROGRAM
CN108600773A (en) Caption data method for pushing, subtitle methods of exhibiting, device, equipment and medium
JP6367334B2 (en) Video processing method, apparatus, and playback apparatus
WO2017148442A1 (en) Audio and video processing method and apparatus, and computer storage medium
JP2004537190A5 (en)
CN106572395A (en) Video processing method and device
KR100963005B1 (en) Method for file formation according to freeview av service
JP2010113593A (en) Information processor, information processing method and information processing program
WO2016202176A1 (en) Method, device and apparatus for synthesizing media file
CN109618229A (en) Association playback method, device, server and the storage medium of audio-video
CN104038774B (en) Generate the method and device of ring signal file
US8988457B2 (en) Multi image-output display mode apparatus and method
CN107785037A (en) Use the method, system and medium of audio time code synchronized multimedia content
TW200422922A (en) Apparatus for reproducing an audio stream
JP2010268195A (en) Video content editing program, server, apparatus and method
KR101432994B1 (en) Method for creating and reproducing media metadata based on media object and apparatus thereof
CN104038772B (en) Generate the method and device of ring signal file
JP5043711B2 (en) Video evaluation apparatus and method
US20130151972A1 (en) Media processing comparison system and techniques
JP2008523759A (en) Method and system for synthesizing video messages
KR101295377B1 (en) Method for constructing of file format and apparatus and method for processing broadcast signal with file which has file format

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant