CN104916298A - Coding and decoding methods, coding and decoding devices, electronic equipment and audio picture generating method - Google Patents

Coding and decoding methods, coding and decoding devices, electronic equipment and audio picture generating method Download PDF

Info

Publication number
CN104916298A
CN104916298A CN201510283432.2A CN201510283432A CN104916298A CN 104916298 A CN104916298 A CN 104916298A CN 201510283432 A CN201510283432 A CN 201510283432A CN 104916298 A CN104916298 A CN 104916298A
Authority
CN
China
Prior art keywords
voice data
file
coding
identifier
audio
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.)
Granted
Application number
CN201510283432.2A
Other languages
Chinese (zh)
Other versions
CN104916298B (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 coding method. The method comprises that first image data and first audio data are obtained; and the first audio data is inserted into the header of a picture file according to a preset strategy, and the first image data and the first audio data are combined into one file. The invention also discloses a decoding method, coding and decoding devices, electronic equipment and an audio picture generating method. According to technical scheme of the invention, pictures and audio can be encoded and stored in the same file, an audio picture can be decoded and played at the same time, the problem that in the prior art audio data of the audio picture tends lose after the picture is edited and stored by image and picture processing software is solved, and user experience is improved.

Description

Decoding method, coding and decoding device, electronic equipment and talking picture generation method
Technical field
The present invention relates to image processing techniques, particularly relate to a kind of decoding method, coding and decoding device, electronic equipment and talking picture generation method.
Background technology
Usually, the mode of people's photo or video records slice of life.Because sound photo can reappear for other audiences taking people and photo real scene when taking at that time, therefore, sound photo is more and more subject to liking of people.
At present, sound photo technology is mainly divided into two kinds, and one is that photo, audio frequency are separated in two files and are deposited, but this method inconvenience is propagated and browses simultaneously; Another kind is handlebar photo, audio frequency is deposited in one file, at the end-of-file of picture format, directly inserts the data of audio format, but this method, after preserving through graph and image processing software editing, easily causes voice data to lose.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of decoding method, coding and decoding device, electronic equipment and talking picture generation method, picture, the audio frequency coding in same file can be realized preserve and synchronous decoding broadcasting, and solve the problem that in prior art, sound photo easily causes voice data to lose after preserving through graph and image processing software editing.
For achieving the above object, technical scheme of the present invention is achieved in that
The invention provides a kind of coding method, described method comprises:
Obtain the first view data and the first voice data;
According to preset strategy, described first voice data is inserted in the file header of picture file, and described first view data and described first voice data are synthesized a file.
Preferably, described preset strategy comprises:
Judge whether the pre-coding of graphics form adopted has audio identifiers in image file format standard;
When there being audio identifiers,
In the file header of picture file, insert the audio identifiers corresponding with described coding of graphics form, after described audio identifiers, insert the first voice data; After described first voice data has inserted, insert the first view data;
When there is no audio identifiers,
In the reserved field of the file header of picture file, insert beginning identifier, and insert the first voice data after described beginning identifier, after described first voice data has inserted, insert end identifier;
Insert the first view data.
Preferably, before described acquisition first view data and the first voice data, also comprise:
Obtain coding of graphics form and the audio coding formats of user's selection.
Preferably, described acquisition first view data and the first voice data, comprising:
According to user-selected coding of graphics form, obtained image data is encoded, generate the first view data;
According to user-selected audio coding formats, obtained voice data is encoded, generate the first voice data.
Present invention also offers a kind of coding/decoding method, described method comprises:
Detect the Format Type of file to be opened;
In the file header of described file to be opened, search whether there is the first identifier according to described Format Type;
When existence the first identifier, obtain the first voice data based on described first identifier;
Synchronous decoding is carried out to described first voice data and the first view data of obtaining.
Preferably, describedly obtain the first voice data based on described first identifier, comprising:
When described first identifier is audio identifiers, in the file header of described file to be opened, obtain the first voice data after being positioned at described audio identifiers;
When described first identifier is for starting identifier, search end identifier, and obtain the first voice data started between identifier and end identifier.
Preferably, described synchronous decoding is carried out to described first voice data and the first view data of obtaining, comprising:
The first sub-thread is decoded to the first voice data, the second sub-thread is decoded to the first view data to adopt synchronous control technique to control; Wherein, described first sub-thread and the second sub-thread are independently sub-thread;
The decoded result of the decoded result of the first voice data and the first view data is back to main thread, to be controlled the broadcasting of decoded voice data and view data by described main thread.
Preferably, the described broadcasting being controlled decoded voice data and view data by described main thread, comprising:
By the voice data after user interface broadcast decoder and view data.
Present invention also offers a kind of code device, described code device comprises the first acquiring unit and synthesis unit; Wherein,
Described first acquiring unit, for obtaining coding of graphics form and the audio coding formats of user's selection;
Described synthesis unit, for being inserted in the file header of picture file by described first voice data according to preset strategy, and synthesizes a file by described first view data and described first voice data.
Preferably, described preset strategy comprises:
Judge whether the pre-coding of graphics form adopted has audio identifiers in image file format standard;
When there being audio identifiers,
In the file header of picture file, insert the audio identifiers corresponding with described coding of graphics form, after described audio identifiers, insert the first voice data; After described first voice data has inserted, insert the first view data;
When there is no audio identifiers,
In the reserved field of the file header of picture file, insert beginning identifier, and insert the first voice data after described beginning identifier, after described first voice data has inserted, insert end identifier;
Insert the first view data.
Preferably, before described acquisition first view data and the first voice data, also comprise:
Obtain coding of graphics form and the audio coding formats of user's selection.
Preferably, described code device, also comprises:
Second acquisition unit, for obtaining coding of graphics form and the audio coding formats of user's selection.
Preferably, described first acquiring unit, also for:
According to user-selected coding of graphics form, obtained image data is encoded, generate the first view data;
According to user-selected audio coding formats, obtained voice data is encoded, generate the first voice data.
Present invention also offers a kind of decoding device, described decoding device comprise detecting unit, search unit, the 3rd acquiring unit and decoding unit; Wherein,
Described detecting unit, for detecting the Format Type of file to be opened;
Describedly search unit, for searching whether there is the first identifier according to described Format Type in the file header of described file to be opened;
Described 3rd acquiring unit, for when existence the first identifier, obtains the first voice data based on described first identifier;
Described decoding unit, for carrying out synchronous decoding to described first voice data and the first view data of obtaining.
Preferably, described 3rd acquiring unit, also for:
When described first identifier is audio identifiers, in the file header of described file to be opened, obtain the first voice data after being positioned at described audio identifiers;
When described first identifier is for starting identifier, search end identifier, and obtain the first voice data started between identifier and end identifier.
Preferably, described decoding unit, also for:
The first sub-thread is decoded to the first voice data, the second sub-thread is decoded to the first view data to adopt synchronous control technique to control; Wherein, described first sub-thread and the second sub-thread are independently sub-thread;
The decoded result of the decoded result of the first voice data and the first view data is back to main thread, to be controlled the broadcasting of decoded voice data and view data by described main thread.
Preferably, described decoding unit, also for:
By the voice data after user interface broadcast decoder and view data.
Present invention also offers a kind of electronic equipment, described electronic equipment at least comprise power decoding device mentioned above and/or, decoding device mentioned above.
Present invention also offers a kind of talking picture generation method, described method comprises:
Obtain at least one picture file and an audio file;
The voice data of described audio file is inserted in the file header of described picture file, and the voice data of the view data of described picture file and described audio file is synthesized a file.
Decoding method provided by the present invention, coding and decoding device, electronic equipment and sound photograph generation method, obtain the first view data and the first voice data; According to preset strategy, described first voice data is inserted in the file header of picture file, and described first view data and described first voice data are synthesized a file by voice data.So, picture, the audio frequency coding in same file can be realized preserve, and synchronous decoding broadcasting can be carried out to sound photo, also solve the problem that in prior art, sound photo easily causes voice data to lose after preserving through graph and image processing software editing simultaneously, improve Consumer's Experience.Concrete, adopt technical scheme of the present invention, the propagation of sound photo of being more convenient for share; Even if adopt graph and image processing software to edit, audio-frequency information also can be preserved and can not be lost, more reliably; Owing to can present picture and sound simultaneously, Consumer's Experience is better.
Accompanying drawing explanation
The realization flow schematic diagram one of the coding method that Fig. 1 provides for the embodiment of the present invention;
The realization flow schematic diagram two of the coding method that Fig. 2 provides for the embodiment of the present invention;
The schematic flow sheet of the coded treatment of the sound photo that Fig. 3 provides for the embodiment of the present invention;
The realization flow schematic diagram of the talking picture generation method that Fig. 4 provides for the embodiment of the present invention;
The realization flow schematic diagram of the coding/decoding method that Fig. 5 provides for the embodiment of the present invention;
The treatment scheme schematic diagram of the decoding process of the sound photo that Fig. 6 provides for the embodiment of the present invention;
The composition structural representation of the code device that Fig. 7 provides for the embodiment of the present invention;
The composition structural representation of the decoding device that Fig. 8 provides for the embodiment of the present invention.
Embodiment
In order to more at large understand feature of the present invention and technology contents, below in conjunction with accompanying drawing, realization of the present invention is described in detail, the use of appended accompanying drawing explanation only for reference, is not used for limiting the present invention.
The realization flow schematic diagram one of the coding method that Fig. 1 provides for the embodiment of the present invention, the coding method in the present embodiment can be applicable in electronic equipment, and as shown in Figure 1, this coding method mainly comprises the following steps:
Step 101: obtain the first view data and the first voice data.
Here, described first view data can refer to the view data after coding; Described first voice data can refer to the voice data after coding.
In the present embodiment, concrete which kind of coding of graphics form that adopts is encoded to gathered view data, can determine according to the default setting of electronic equipment when dispatching from the factory; In like manner, concrete which kind of audio coding formats that adopts is encoded to gathered voice data, can determine according to the default setting of electronic equipment when dispatching from the factory.
Certainly, also interface can be selected, so that user selects coding of graphics form and audio coding formats according to the hobby of oneself for user provides.
Preferably, described acquisition first view data and the first voice data, can comprise:
According to electronic equipment determined coding of graphics form, obtained image data is encoded, generate the first view data;
According to the determined audio coding formats of electronic equipment, obtained voice data is encoded, generate the first voice data.
Here, when not receiving the setting operation of user to coding of graphics form and audio coding formats, the determined coding of graphics form of electronic equipment and audio coding formats are all forms of system default;
When receiving the setting operation of user to coding of graphics form and audio coding formats, electronic equipment determined coding of graphics form and audio coding formats are all user-selected coding format and audio coding formats.
In the present embodiment, described electronic equipment is at least configured with:
For obtaining the image collecting device of image, as camera;
And, for obtaining the voice collection device of audio frequency, as microphone.
In the present embodiment, view data can be obtained by the camera of electronic equipment; Voice data can be obtained by the microphone of electronic equipment.
Preferably, after acquisition view data, voice data can be obtained again, also can obtain voice data while acquisition view data.
That is, by image preview interface, user first can determine that it wants the photo clapped, start recording again after then clicking shooting push button; Or record while click shooting push button.
Step 102: described first voice data is inserted in the file header of picture file according to preset strategy, and described first view data and described first voice data are synthesized a file.
Preferably, described preset strategy can comprise:
Judge whether the pre-coding of graphics form adopted has audio identifiers in image file format standard;
When there being audio identifiers,
In the file header of picture file, insert the audio identifiers corresponding with described coding of graphics form, after described audio identifiers, insert the first voice data; After described first voice data has inserted, insert the first view data;
When there is no audio identifiers,
In the reserved field of the file header of picture file, insert beginning identifier, and insert the first voice data after described beginning identifier, after described first voice data has inserted, insert end identifier;
Insert the first view data.
That is, even if there is no audio identifiers in image file format standard, also voice data can be inserted.
In such scheme, alternatively, before described acquisition first view data and the first voice data, can also comprise:
Obtain coding of graphics form and the audio coding formats of user's selection.
Particularly, the user interface (being called for short UI interface) of electronic equipment can be provided with coding of graphics form and select dialog box and audio coding formats dialog box, the coding of graphics form that this electronic equipment is supported is presented in coding of graphics form selection dialog box, the audio coding formats that this electronic equipment is supported is presented, to be selected coding of graphics form and audio coding formats according to the hobby of oneself or custom by user in audio coding formats selection dialog box.
Particularly, when electronic equipment has touch-screen (namely supporting to touch input), user can by selecting coding of graphics form and audio coding formats by touch forms such as finger or felt pens.When electronic equipment is not supported to touch input, coding of graphics form and audio coding formats can be selected by relevant button.
Particularly, after the coding of graphics form and audio coding formats of recording user first time selection, the coding of graphics form that also user can be arranged first time and audio coding formats are set to coding of graphics form and the audio coding formats of acquiescence, until user initiatively revises coding of graphics form and audio coding formats again.
In such scheme, alternatively, described acquisition first view data and the first voice data, can comprise:
According to user-selected coding of graphics form, obtained image data is encoded, generate the first view data;
According to user-selected audio coding formats, obtained voice data is encoded, generate the first voice data.
In embodiments of the present invention, the first view data and the first voice data is obtained; According to preset strategy, described first voice data is inserted in the file header of picture file, and described first view data and described first voice data are synthesized a file; So, no matter whether there is the audio identifiers corresponding with coding of graphics form in image file format standard, can voice data be inserted; Voice data is placed on the file header of picture file, editing picture in any case, also reading voice data can not be affected, achieve picture, the audio frequency coding in same file to preserve, solve the problem that in prior art, sound photo easily causes voice data to lose after preserving through graph and image processing software editing.
The realization flow schematic diagram two of the coding method that Fig. 2 provides for the embodiment of the present invention, the coding method in the present embodiment can be applicable in electronic equipment, and as shown in Figure 2, this coding method mainly comprises the following steps:
Step 201: the coding of graphics form and the audio coding formats that obtain user's selection.
Here, the coding of graphics form can selected for user can have multiple, as: BMP, JPG, TIFF, GIF, PCX, TGA, EXIF, FPX, SVG, PSD, CDR, PCD, DXF, UFO, EPS, AI, RAW etc.
Here, the audio coding formats can selected for user can have multiple, as: CD, WAVE, AIFF, AU, MPEG, MP3, MIDI, WMA, VQF, AMR etc.
Particularly, the UI interface of electronic equipment can be provided with coding of graphics form and select dialog box and audio coding formats dialog box, the coding of graphics form that this electronic equipment is supported is presented in coding of graphics form selection dialog box, the audio coding formats that this electronic equipment is supported is presented, to be selected coding of graphics form and audio coding formats according to the hobby of oneself or custom by user in audio coding formats selection dialog box.
Particularly, when electronic equipment has touch-screen (namely supporting to touch input), user can by selecting coding of graphics form and audio coding formats by touch forms such as finger or felt pens.When electronic equipment is not supported to touch input, coding of graphics form and audio coding formats can be selected by relevant button.
Particularly, after the coding of graphics form and audio coding formats of recording user first time selection, the coding of graphics form that also user can be arranged first time and audio coding formats are set to coding of graphics form and the audio coding formats of acquiescence, until user initiatively revises coding of graphics form and audio coding formats again.
Step 202: obtain the first view data and the first voice data.
Particularly, described first view data can be the view data after coding, and described first voice data can be the voice data after coding.
Preferably, described acquisition first view data and the first voice data, can comprise:
According to user-selected coding of graphics form, obtained view data is encoded, generate the first view data;
According to user-selected audio coding formats, obtained voice data is encoded, generate the first voice data.
In the present embodiment, described electronic equipment is at least configured with:
For obtaining the image collecting device of image, as camera;
And, for obtaining the voice collection device of audio frequency, as microphone.
In the present embodiment, view data can be obtained by the camera of electronic equipment; Voice data can be obtained by the microphone of electronic equipment.
Preferably, after acquisition view data, voice data can be obtained again, also can obtain voice data while acquisition view data.
That is, by image preview interface, user first can determine that it wants the photo clapped, start recording again after then clicking shooting push button; Or record while click shooting push button.
Step 203: judge whether described coding of graphics form has audio identifiers in image file format standard, and generate judged result.
Here, described image file format standard is image file format standard of the prior art.
Such as, described image file format standard can be " digital camera images file format standard (DigitalStill Camera Image File Format Standard) ".
It should be noted that, step 202 can be exchanged with the order of step 203.
Step 204: described first voice data is inserted in the file header of picture file based on described judged result, and described first view data and described first voice data are synthesized a file.
Preferably, describedly based on described judged result, described first voice data to be inserted in the file header of picture file, and described first view data and described first voice data is synthesized a file, can comprise:
When described judged result is for there being an audio identifiers, in the file header of picture file, inserts the audio identifiers corresponding with described coding of graphics form, after described audio identifiers, insert the first voice data;
After described first voice data has inserted, insert the first view data.
Here, described audio identifiers is the audio identifiers corresponding with this coding of graphics form defined in existing image file format standard.
Preferably, describedly based on described judged result, described first voice data to be inserted in the file header of picture file, and described first view data and described first voice data is synthesized a file, can also comprise:
When described judged result is not for having an audio identifiers, beginning identifier is inserted in the reserved field of the file header of picture file, and the first voice data is inserted after described beginning identifier, after described first voice data has inserted, insert end identifier;
Then the first view data is inserted.
Here, described beginning identifier is for characterizing the symbol starting to insert the first voice data, and described end identifier is the symbol terminated for characterizing insertion first voice data.
Need to say, described beginning identifier and described end identifier can by decoding device identifications of the present invention.
Such as, when described judged result is not for having an audio identifiers, predefine one starts identifier and an end identifier, and by predefined for institute beginning identifier and end identifier notice decoding device, so that decoding device can be decoded to synthesized file.
Particularly, the Format Type of the file after described synthesis is coding of graphics Format Type user-selected in step 201.
Here, the file after described synthesis can be stored in the storer of electronic equipment, or by electronic equipment, the file after described synthesis is sent to server, to be preserved the file after this synthesis by server.
In the present embodiment, described electronic equipment can be that mobile phone, panel computer etc. have camera and microphone and have the equipment of encoding function.
For example, coded format selected by plug-in unit during user is applied by camera, for JPEG still image, at the identifier of file header part definable 0x9286, support the data of arbitrary format random length, after taking pictures, eject recording prompt, after user records, automatically the coded format selected according to user is encoded, and synthesis talking picture, is then saved in described sound photo in storer.
It should be noted that, described 0x9286 is the identifier specified in " tradable image file format digital camera: Exif " (Exchangeable image file format for Digital Still Cameras:Exif) standard 2.1 version, and described 0x9286 supports the data of arbitrary format random length.
Certainly, be not restricted to the above this form enumerated when definition starts identifier, do not enumerate at this.
In embodiments of the present invention, coding of graphics form and the audio coding formats of user's selection is obtained; Obtain the first view data and the first voice data; Judge whether described coding of graphics form has audio identifiers in image file format standard, and generate judged result; Based on described judged result, described first voice data is inserted in the file header of picture file, and described first view data and described first voice data are synthesized a file; So, voice data is placed on the file header of picture file, editing picture in any case, also reading voice data can not be affected, achieve picture, the audio frequency coding in same file to preserve, solve the problem that in prior art, sound photo easily causes voice data to lose after preserving through graph and image processing software editing.
The schematic flow sheet of the coded treatment of the sound photo that Fig. 3 provides for the embodiment of the present invention, as shown in Figure 3, this flow process mainly comprises the following steps:
Step 301 receives the coding of graphics form and audio coding formats that user specifies;
Here, the appointment of user can be received by UI interface.
Step 302: encode to obtained voice data according to audio coding formats, generates the first voice data;
Step 303: whether the coding of graphics form specified by judgement has audio identifiers in image file format standard, if had, performs step 304; If no, perform step 306;
Step 304: insert the audio identifiers in standard in File header information, then performs step 305;
Here, described standard refers to the image file format standard described in step 303.
Step 305: insert the first voice data after audio identifiers, then performs step 309;
Step 306: insert beginning identifier in the reserved field of file header, then performs step 307;
Wherein, the decoding device identification that described beginning identifier can be described by the present invention.
Step 307: insert the first voice data after beginning identifier, then perform step 308;
Step 308: after inserting the first voice data and completing, insert end identifier, then performs step 309;
Wherein, the decoding device identification that described end identifier can be described by the present invention.
Step 309: insert the first view data, then performs step 308;
Here, described first view data refers to the data obtained after the coding of graphics form of specifying according to user is encoded to obtained view data.
Specifically when generate the first view data, can complete during step 302 to step 308.
Step 310: the first voice data and the first view data are synthesized a file.
Particularly, the file after synthesis can be stored into storer or Cloud Server etc. to have in the equipment of memory function.
The executive agent of above-mentioned steps 301 ~ step 310 can be all code device, also can be the electronic equipment with code device.
The realization flow schematic diagram of the talking picture generation method that Fig. 4 provides for the embodiment of the present invention; Talking picture in the present embodiment generates and can be applicable in electronic equipment, and as shown in Figure 4, this talking picture generates and mainly comprises the following steps:
Step 401: obtain at least one picture file and an audio file.
Here, described picture file can come from the first equipment, and described audio file can come from the second equipment;
Wherein, described first equipment can be identical equipment with described second equipment, also can be different equipment; Described first equipment and described second equipment can be the third party devices being different from electronic equipment.
Step 402: the voice data of described audio file is inserted in the file header of described picture file, and the voice data of the view data of described picture file and described audio file is synthesized a file.
Alternatively, specifically how the voice data of described audio file is inserted in the file header of described picture file, with reference to the coding method shown in Fig. 1 ~ Fig. 3, can repeat them here.
The realization flow schematic diagram of the coding/decoding method that Fig. 5 provides for the embodiment of the present invention, the coding/decoding method in the present embodiment can be applicable in electronic equipment, and as shown in Figure 5, this coding/decoding method mainly comprises the following steps:
Step 501: the Format Type detecting file to be opened.
Here, described file to be opened refers to the picture file recording image information and audio-frequency information, as sound photo.
Here, coding of graphics form used when described Format Type refers to and synthesizes described file to be opened is also the coding of graphics form described in step 501.
Step 502: search whether there is the first identifier according to described Format Type in the file header of described file to be opened.
Here, described first identifier can be audio identifiers or start identifier.
Step 503: when existence the first identifier, obtains the first voice data based on described first identifier.
It should be noted that, when there is not the first identifier in file header, illustrating that described file to be opened does not comprise audio-frequency information, so, described file to be opened can be opened according to the existing mode opening normal picture formatted file, not repeat them here.
Preferably, describedly obtain the first voice data based on described first identifier, can comprise:
When described first identifier is audio identifiers, in the file header of described file to be opened, obtain the first voice data after being positioned at described audio identifiers;
When described first identifier is for starting identifier, search end identifier, and obtain the first voice data started between identifier and end identifier.
Certainly, described end identifier also can be searched in step 502 when starting identifier and be searched in the lump.
Preferably, during described acquisition the first voice data, can also comprise:
According to the first voice data determination audio coding formats, to treat to play described decoded voice data according to described audio coding formats.
Step 504: synchronous decoding is carried out to described first voice data and the first view data of obtaining.
Here, when detecting the Format Type of file to be opened, the first view data can be obtained; Also after obtaining the first voice data based on described first identifier, the first view data can be obtained.Certainly, when obtain the first view data and also have other modes, no longer enumerate at this.
Preferably, described synchronous decoding is carried out to described first voice data and the first view data of obtaining, can comprise:
The first sub-thread is decoded to the first voice data, the second sub-thread is decoded to the first view data to adopt synchronous control technique to control; Wherein, described first sub-thread and the second sub-thread are independently sub-thread;
The decoded result of the decoded result of the first voice data and the first view data is back to main thread, to be controlled the broadcasting of decoded voice data and view data by described main thread.
Here, described synchronous control technique can be thread lock technology, atomic operation technology etc.
Preferably, the described broadcasting being controlled decoded voice data and view data by described main thread, can comprise:
By the voice data after user interface broadcast decoder and view data.
In the present embodiment, described electronic equipment can be the equipment that mobile phone, computer etc. have decoding and playing function.
Still coded format is selected to be described for JPEG still image for user.User is when the JPEG picture file of pre-review is clicked in picture library application, whether electronic equipment (or decoding device) is retrieved the audio identifiers 0x9286 defined before this first hereof and is existed, as existed, obtaining the first relevant voice data, putting into independent sub-thread kind and decoding; Another sub-thread is decoded to the first obtained view data by simultaneous techniques, and the decoded result of two sub-threads returns to main thread, to be controlled synchronous the presenting on UI of picture, audio frequency by main thread.
In embodiments of the present invention, the Format Type of file to be opened is detected; In the file header of described file to be opened, search whether there is the first identifier according to described Format Type; When existence the first identifier, obtain the first voice data based on described first identifier; Synchronous decoding is carried out to described first voice data and the first view data of obtaining; So, because the first identifier is present in file header, reading voice data can not be affected, comparison film and audio frequency can play simultaneously, make user's experience effect better.
The treatment scheme schematic diagram of the decoding process of the sound photo that Fig. 6 provides for the embodiment of the present invention, as shown in Figure 6, this flow process comprises the following steps:
Step 601: the Format Type detecting picture file, then performs step 602;
Particularly, before the electronic equipment (or decoding device) with decoding device detects the Format Type of picture file, user sends the instruction of this picture file of pre-review by the picture file clicked in the picture library application of electronic equipment.
Step 602: retrieving files head, searching is whether there is the first identifier in file header;
Here, described first identifier can be audio identifiers, also can be to start identifier.
Particularly, the file header of described picture file is retrieved.
Step 603: obtain the first voice data, opens the first sub-thread and decodes to the first voice data, and decoded result is sent to main thread;
Step 604: adopt synchronous control technique to control the second sub-thread and the first view data is decoded, and decoded result is sent to main thread;
Step 605: described main thread controls the broadcasting of decoded voice data and view data.
Particularly, by the voice data after the broadcast decoder of UI interface and view data.
The executive agent of above-mentioned steps 601 ~ step 605 can be all decoding device, also can be the electronic equipment with decoding device.
The composition structural representation of the code device that Fig. 7 provides for the embodiment of the present invention, as shown in Figure 7, described code device comprises the first acquiring unit 71 and synthesis unit 72; Wherein,
Described first acquiring unit 71, for obtaining coding of graphics form and the audio coding formats of user's selection;
Described synthesis unit 72, for being inserted in the file header of picture file by described first voice data according to preset strategy, and synthesizes a file by described first view data and described first voice data.
Preferably, described preset strategy can comprise:
Judge whether the pre-coding of graphics form adopted has audio identifiers in image file format standard;
When there being audio identifiers,
In the file header of picture file, insert the audio identifiers corresponding with described coding of graphics form, after described audio identifiers, insert the first voice data; After described first voice data has inserted, insert the first view data;
When there is no audio identifiers,
In the reserved field of the file header of picture file, insert beginning identifier, and insert the first voice data after described beginning identifier, after described first voice data has inserted, insert end identifier;
Insert the first view data.
Preferably, described synthesis unit 72, specifically for:
When judging there is audio identifiers, in the file header of picture file, inserting the audio identifiers corresponding with described coding of graphics form, after described audio identifiers, insert the first voice data;
After described first voice data has inserted, insert the first view data.
Preferably, described synthesis unit 72, also specifically for:
When judging there is no audio identifiers, in the reserved field of the file header of picture file, inserting beginning identifier, and insert the first voice data after described beginning identifier, after described first voice data has inserted, inserting end identifier;
Insert the first view data.
In such scheme, alternatively, described code device, also comprises:
Second acquisition unit 73, for obtaining coding of graphics form and the audio coding formats of user's selection.
In such scheme, alternatively, described first acquiring unit 71, also specifically for:
According to user-selected coding of graphics form, obtained image data is encoded, generate the first view data;
According to user-selected audio coding formats, obtained voice data is encoded, generate the first voice data.
It will be appreciated by those skilled in the art that the practical function of each processing unit in the code device shown in Fig. 7, can refer to the associated description of aforementioned encoding methods and understand.It will be appreciated by those skilled in the art that each processing unit in the code device shown in Fig. 7, realize by the program run on processor, also realize by logical circuit particularly.
The first acquiring unit 71 in code device above described in each embodiment, synthesis unit 72, second acquisition unit 73, in actual applications all can by described code device or described code device central processing unit (CPU in the electronic device, Central Processing Unit), digital signal processor (DSP, DigitalSignal Processor) or programmable gate array (FPGA, Field-Programmable Gate Array) realization.
The composition structural representation of the decoding device that Fig. 8 provides for the embodiment of the present invention, as shown in Figure 8, described decoding device comprises detecting unit 81, searches unit 82, the 3rd acquiring unit 83 and decoding unit 84; Wherein,
Described detecting unit 81, for detecting the Format Type of file to be opened;
Describedly search unit 82, for searching whether there is the first identifier according to described Format Type in the file header of described file to be opened;
Described 3rd acquiring unit 83, for when existence the first identifier, obtains the first voice data based on described first identifier;
Described decoding unit 84, for carrying out synchronous decoding to described first voice data and the first view data of obtaining.
Preferably, described 3rd acquiring unit 83, specifically for:
When described first identifier is audio identifiers, in the file header of described file to be opened, obtain the first voice data after being positioned at described audio identifiers;
When described first identifier is for starting identifier, search end identifier, and obtain the first voice data started between identifier and end identifier.
Preferably, described decoding unit 84, specifically for:
The first sub-thread is decoded to the first voice data, the second sub-thread is decoded to the first view data to adopt synchronous control technique to control; Wherein, described first sub-thread and the second sub-thread are independently sub-thread;
The decoded result of the decoded result of the first voice data and the first view data is back to main thread, to be controlled the broadcasting of decoded voice data and view data by described main thread.
Preferably, described decoding unit, also specifically for:
By the voice data after user interface broadcast decoder and view data.
It will be appreciated by those skilled in the art that the practical function of each processing unit in the decoding device shown in Fig. 8, can refer to the associated description of aforementioned decode method and understand.It will be appreciated by those skilled in the art that each processing unit in the decoding device shown in Fig. 8, realize by the program run on processor, also realize by logical circuit particularly.
Detecting unit 81 in decoding device above described in each embodiment, search unit 82, the 3rd acquiring unit 83 and decoding unit 84, in actual applications all can by described decoding device or described decoding device CPU, DSP or FPGA in the electronic device realize.
The present invention also describes a kind of electronic equipment, and described electronic equipment comprises code device mentioned above, and/or, decoding device mentioned above.
Concrete, the composition structural representation of described code device can as shown in Figure 7, and the composition structural representation of described decoding device can as shown in Figure 8, not repeat them here.
It should be noted that, in this article, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or device and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or device.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the device comprising this key element and also there is other identical element.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that above-described embodiment method can add required general hardware platform by software and realize, hardware can certainly be passed through, but in a lot of situation, the former is better embodiment.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in a storage medium (as ROM/RAM, magnetic disc, CD), comprising some instructions in order to make a station terminal equipment (can be mobile phone, computing machine, server, air conditioner, or the network equipment etc.) perform method described in each embodiment of the present invention.
These are only the preferred embodiments of the present invention; not thereby the scope of the claims of the present invention is limited; every utilize instructions of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.

Claims (18)

1. a coding method, is characterized in that, described method comprises:
Obtain the first view data and the first voice data;
According to preset strategy, described first voice data is inserted in the file header of picture file, and described first view data and described first voice data are synthesized a file.
2. coding method according to claim 1, is characterized in that, described preset strategy comprises:
Judge whether the pre-coding of graphics form adopted has audio identifiers in image file format standard;
When there being audio identifiers,
In the file header of picture file, insert the audio identifiers corresponding with described coding of graphics form, after described audio identifiers, insert the first voice data; After described first voice data has inserted, insert the first view data;
When there is no audio identifiers,
In the reserved field of the file header of picture file, insert beginning identifier, and insert the first voice data after described beginning identifier, after described first voice data has inserted, insert end identifier;
Insert the first view data.
3. coding method according to claim 1, is characterized in that, before described acquisition first view data and the first voice data, also comprises:
Obtain coding of graphics form and the audio coding formats of user's selection.
4. coding method according to claim 3, is characterized in that, described acquisition first view data and the first voice data, comprising:
According to user-selected coding of graphics form, obtained image data is encoded, generate the first view data;
According to user-selected audio coding formats, obtained voice data is encoded, generate the first voice data.
5. a coding/decoding method, is characterized in that, described method comprises:
Detect the Format Type of file to be opened;
In the file header of described file to be opened, search whether there is the first identifier according to described Format Type;
When existence the first identifier, obtain the first voice data based on described first identifier;
Synchronous decoding is carried out to described first voice data and the first view data of obtaining.
6. coding/decoding method according to claim 5, is characterized in that, describedly obtains the first voice data based on described first identifier, comprising:
When described first identifier is audio identifiers, in the file header of described file to be opened, obtain the first voice data after being positioned at described audio identifiers;
When described first identifier is for starting identifier, search end identifier, and obtain the first voice data started between identifier and end identifier.
7. coding/decoding method according to claim 5, is characterized in that, describedly carries out synchronous decoding to described first voice data and the first view data of obtaining, comprising:
The first sub-thread is decoded to the first voice data, the second sub-thread is decoded to the first view data to adopt synchronous control technique to control; Wherein, described first sub-thread and the second sub-thread are independently sub-thread;
The decoded result of the decoded result of the first voice data and the first view data is back to main thread, to be controlled the broadcasting of decoded voice data and view data by described main thread.
8. coding/decoding method according to claim 5, is characterized in that, the described broadcasting being controlled decoded voice data and view data by described main thread, comprising:
By the voice data after user interface broadcast decoder and view data.
9. a code device, is characterized in that, described code device comprises the first acquiring unit and synthesis unit; Wherein,
Described first acquiring unit, for obtaining coding of graphics form and the audio coding formats of user's selection;
Described synthesis unit, for being inserted in the file header of picture file by described first voice data according to preset strategy, and synthesizes a file by described first view data and described first voice data.
10. code device according to claim 9, is characterized in that, described preset strategy comprises:
Judge whether the pre-coding of graphics form adopted has audio identifiers in image file format standard;
When there being audio identifiers,
In the file header of picture file, insert the audio identifiers corresponding with described coding of graphics form, after described audio identifiers, insert the first voice data; After described first voice data has inserted, insert the first view data;
When there is no audio identifiers,
In the reserved field of the file header of picture file, insert beginning identifier, and insert the first voice data after described beginning identifier, after described first voice data has inserted, insert end identifier;
Insert the first view data.
11. code devices according to claim 9, described code device also comprises:
Second acquisition unit, for obtaining coding of graphics form and the audio coding formats of user's selection.
12. code devices according to claim 11, described first acquiring unit, also for:
According to user-selected coding of graphics form, obtained image data is encoded, generate the first view data;
According to user-selected audio coding formats, obtained voice data is encoded, generate the first voice data.
13. 1 kinds of decoding devices, is characterized in that, described decoding device comprises detecting unit, searches unit, the 3rd acquiring unit and decoding unit; Wherein,
Described detecting unit, for detecting the Format Type of file to be opened;
Describedly search unit, for searching whether there is the first identifier according to described Format Type in the file header of described file to be opened;
Described 3rd acquiring unit, for when existence the first identifier, obtains the first voice data based on described first identifier;
Described decoding unit, for carrying out synchronous decoding to described first voice data and the first view data of obtaining.
14. decoding devices according to claim 13, is characterized in that, described 3rd acquiring unit, also for:
When described first identifier is audio identifiers, in the file header of described file to be opened, obtain the first voice data after being positioned at described audio identifiers;
When described first identifier is for starting identifier, search end identifier, and obtain the first voice data started between identifier and end identifier.
15. decoding devices according to claim 13, is characterized in that, described decoding unit, also for:
The first sub-thread is decoded to the first voice data, the second sub-thread is decoded to the first view data to adopt synchronous control technique to control; Wherein, described first sub-thread and the second sub-thread are independently sub-thread;
The decoded result of the decoded result of the first voice data and the first view data is back to main thread, to be controlled the broadcasting of decoded voice data and view data by described main thread.
16. decoding devices according to claim 13, is characterized in that, described decoding unit, also for:
By the voice data after user interface broadcast decoder and view data.
17. 1 kinds of electronic equipments, is characterized in that, described electronic equipment at least comprises the decoding device described in any one of power 9 to power 12 and/or the decoding device described in any one of power 13 to power 16.
18. 1 kinds of talking picture generation methods, is characterized in that, described method comprises:
Obtain at least one picture file and an audio file;
The voice data of described audio file is inserted in the file header of described picture file, and the voice data of the view data of described picture file and described audio file is synthesized a file.
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 true CN104916298A (en) 2015-09-16
CN104916298B 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)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105407282A (en) * 2015-11-16 2016-03-16 中科创达软件股份有限公司 Photographing method and replay method
CN105472289A (en) * 2015-11-11 2016-04-06 努比亚技术有限公司 Device and method for editing audio photo
CN105677717A (en) * 2015-12-29 2016-06-15 努比亚技术有限公司 Display method and terminal
CN106791442A (en) * 2017-01-20 2017-05-31 维沃移动通信有限公司 A kind of image pickup method and mobile terminal
CN106777204A (en) * 2016-12-23 2017-05-31 北京奇虎科技有限公司 The processing method of image data, device and mobile terminal
CN111354384A (en) * 2020-02-27 2020-06-30 北京奇艺世纪科技有限公司 GIF picture generation method, playing method and device and electronic equipment
CN112151048A (en) * 2019-06-11 2020-12-29 李庆成 Method for generating and processing audio-visual image data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070041714A1 (en) * 2000-03-14 2007-02-22 Matsushita Electric Industrial Co., Ltd. Image and audio reproducing apparatus and method
CN101986302A (en) * 2010-10-28 2011-03-16 华为终端有限公司 Media file association method and device
CN102609968A (en) * 2012-03-05 2012-07-25 信源通科技(深圳)有限公司 Method and system for realizing audio picture
CN104580888A (en) * 2014-12-17 2015-04-29 广东欧珀移动通信有限公司 Picture processing method and terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070041714A1 (en) * 2000-03-14 2007-02-22 Matsushita Electric Industrial Co., Ltd. Image and audio reproducing apparatus and method
CN101986302A (en) * 2010-10-28 2011-03-16 华为终端有限公司 Media file association method and device
CN102609968A (en) * 2012-03-05 2012-07-25 信源通科技(深圳)有限公司 Method and system for realizing audio picture
CN104580888A (en) * 2014-12-17 2015-04-29 广东欧珀移动通信有限公司 Picture processing method and terminal

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105472289A (en) * 2015-11-11 2016-04-06 努比亚技术有限公司 Device and method for editing audio photo
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
CN105677717A (en) * 2015-12-29 2016-06-15 努比亚技术有限公司 Display method and terminal
CN105677717B (en) * 2015-12-29 2019-04-19 努比亚技术有限公司 A kind of display methods and terminal
CN106777204A (en) * 2016-12-23 2017-05-31 北京奇虎科技有限公司 The processing method of image data, device and mobile terminal
CN106777204B (en) * 2016-12-23 2020-08-07 北京安云世纪科技有限公司 Picture data processing method and device and mobile terminal
CN106791442A (en) * 2017-01-20 2017-05-31 维沃移动通信有限公司 A kind of image pickup method and mobile terminal
CN112151048A (en) * 2019-06-11 2020-12-29 李庆成 Method for generating and processing audio-visual image data
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

Also Published As

Publication number Publication date
CN104916298B (en) 2018-05-11

Similar Documents

Publication Publication Date Title
CN104916298A (en) Coding and decoding methods, coding and decoding devices, electronic equipment and audio picture generating method
US11301113B2 (en) Information processing apparatus display control method and program
JP6367334B2 (en) Video processing method, apparatus, and playback apparatus
WO2017148442A1 (en) Audio and video processing method and apparatus, and computer storage medium
CN104869467A (en) Information output method and system for media playing, and apparatuses
US20070245376A1 (en) Portable media player enabled to obtain previews of media content
CN106155470B (en) A kind of audio file generation method and device
CN101662595B (en) Electronic apparatus, method of changing a moving image data section
US20070265720A1 (en) Content marking method, content playback apparatus, content playback method, and storage medium
TW200404218A (en) Data processing device, data processing method, contents distribution device, contents distribution method and computer program
CN112383790B (en) Live broadcast screen recording method and device, electronic equipment and storage medium
CN110162652A (en) A kind of picture display method and device, terminal device
CN102348086A (en) Method and mobile terminal for loading background sounds in video recording process
CN102737690B (en) Method and terminal that music application starts
JP2004234157A (en) Information processor and method, and computer program
CN107276985A (en) One kind is based on e-commerce platform Online Video management method
CN104038774B (en) Generate the method and device of ring signal file
CN111556329B (en) Method and device for inserting media content in live broadcast
CN109618229A (en) Association playback method, device, server and the storage medium of audio-video
CN105681683A (en) Video and picture mixed playing method and device
CN102819851A (en) Method for implementing sound pictures by using computer
JP2001282261A (en) Speech data setting device and method, speech data forming device and method, recording medium
CN104038772B (en) Generate the method and device of ring signal file
EP2179365A1 (en) Method and apparatus for generating and reproducing media object-based metadata
US8819551B2 (en) Display device and method, and program

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