CN109544664B - Animation data processing method and device, electronic equipment and readable storage medium - Google Patents

Animation data processing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN109544664B
CN109544664B CN201811392654.8A CN201811392654A CN109544664B CN 109544664 B CN109544664 B CN 109544664B CN 201811392654 A CN201811392654 A CN 201811392654A CN 109544664 B CN109544664 B CN 109544664B
Authority
CN
China
Prior art keywords
sub
parameter information
key frame
information
key
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
CN201811392654.8A
Other languages
Chinese (zh)
Other versions
CN109544664A (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.)
Beijing Pixel Software Technology Co Ltd
Original Assignee
Beijing Pixel Software 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 Beijing Pixel Software Technology Co Ltd filed Critical Beijing Pixel Software Technology Co Ltd
Priority to CN201811392654.8A priority Critical patent/CN109544664B/en
Publication of CN109544664A publication Critical patent/CN109544664A/en
Application granted granted Critical
Publication of CN109544664B publication Critical patent/CN109544664B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application provides an animation data processing method and device, electronic equipment and a readable storage medium. The electronic equipment stores original animation data, wherein the original animation data comprise bones, and the bones comprise key frames arranged according to a time information sequence, and the method comprises the following steps: setting the sub-parameter information with the difference value smaller than the preset precision with the corresponding default information to be consistent with the corresponding default information; deleting the sub-parameter information of the key frame positioned in the middle of three continuous key frames corresponding to the same sub-parameter information; discarding sub-parameter information of the key frame consistent with the corresponding default information, and marking a multi-bit identification code which is prestored and corresponds to the key frame as a first state; marking the corresponding multi-digit identification code with the sub-parameter information inconsistent with the corresponding default information as a second state; and storing the sub-parameter information of the processed key frame and the corresponding marked multi-bit identification code. Therefore, the size of the animation data is reduced, and the consumption of resources and cost is reduced.

Description

Animation data processing method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an animation data processing method and apparatus, an electronic device, and a readable storage medium.
Background
With the rapid development of the computer field, animation data is widely used in various fields, for example, three-dimensional animation games and animation movies. However, the current animation data has a general problem that a large amount of animation data occupies too large a storage space, and in an actual service application scenario with a large data volume, resources and costs are consumed very much.
Disclosure of Invention
In view of this, embodiments of the present application provide an animation data processing method, an apparatus, an electronic device, and a readable storage medium.
In a first aspect, an embodiment of the present application provides an animation data processing method, which is applied to an electronic device. The electronic device stores original animation data, wherein the original animation data comprise bones, the bones comprise key frames arranged according to a time information sequence, and the method comprises the following steps:
and acquiring parameter information of the key frame, wherein the parameter information comprises a plurality of sub-parameter information.
And judging whether the difference value between each piece of sub-parameter information and the corresponding pre-stored default information is smaller than the preset precision, and if the difference value between the piece of sub-parameter information and the corresponding preset default information is smaller than the preset precision, setting the piece of sub-parameter information to be consistent with the corresponding default information.
And judging whether three continuous key frames corresponding to the sub-parameter information exist or not, and if the three continuous key frames corresponding to the sub-parameter information exist, deleting the sub-parameter information in the key frames arranged in the middle according to the time information sequence from the three continuous key frames.
And if the sub-parameter information of the key frame is consistent with the corresponding default information, discarding the sub-parameter information, and marking a multi-bit identification code which is prestored and corresponds to the key frame into a first state.
And if the sub-parameter information of the key frame is inconsistent with the corresponding default information, marking the pre-stored multi-bit identification code corresponding to the key frame as a second state.
And storing the processed sub-parameter information of the key frame and the corresponding marked multi-bit identification code.
The first state indicates that the sub-parameter information corresponding to the multi-bit identification code in the key frame is discarded, and the first state indicates that the sub-parameter information corresponding to the multi-bit identification code is stored in the key frame.
Optionally, the sub-parameter information includes first sub-parameter information, second sub-parameter information, and third sub-parameter information, and the step of determining whether there are three consecutive key frames corresponding to the same sub-parameter information, and if there are three consecutive key frames corresponding to the same sub-parameter information, deleting the sub-parameter information, which is arranged in a middle key frame according to the time information sequence, from among the three consecutive key frames includes:
and judging whether three continuous key frames corresponding to the same first sub-parameter information, second sub-parameter information and third sub-parameter information exist.
And if the first sub-parameter information, the second sub-parameter information and the third sub-parameter information correspond to three identical continuous key frames, deleting the sub-parameter information in the key frame arranged in the middle of the three continuous key frames according to the time information sequence.
Optionally, if the sub-parameter information of the key frame is consistent with the corresponding default information, discarding the sub-parameter information, and marking a pre-stored multi-bit identification code corresponding to the key frame as a first state, including:
if the first sub-parameter information of the key frame is consistent with the corresponding default information, discarding the first sub-parameter information, and marking the first bit of the prestored multi-bit identification code corresponding to the key frame as a first state; and
if the second sub-parameter information of the key frame is consistent with the corresponding default information, discarding the second sub-parameter information, and marking the second bit of the prestored multi-bit identification code corresponding to the key frame as a first state; and
and if the third sub-parameter information of the key frame is consistent with the corresponding default information, discarding the third sub-parameter information, and marking a third bit of a multi-bit identification code which is prestored and corresponds to the key frame as a first state.
Optionally, if the sub-parameter information of the key frame is inconsistent with the corresponding default information, the step of marking a multi-bit identifier code corresponding to the key frame in a second state includes:
if the first sub-parameter information of the key frame is inconsistent with the corresponding default information, storing the first sub-parameter information, and marking the first bit of the multi-bit identification code corresponding to the key frame in a second state; and
if the second sub-parameter information of the key frame is inconsistent with the corresponding default information, storing the second sub-parameter information, and marking a second bit of a multi-bit identification code which is prestored and corresponds to the key frame as a second state; and
and if the third sub-parameter information of the key frame is inconsistent with the corresponding default information, storing the third sub-parameter information, and marking a third bit of a multi-bit identification code which is prestored and corresponds to the key frame as a second state.
Optionally, before storing the processed sub-parameter information of the key frame and the corresponding marked multi-digit identification code, the method further includes:
time information of three consecutive key frames is obtained, the three consecutive key frames including a middle key frame, a first neighboring key frame and a second neighboring key frame.
And calculating according to the time information of the three continuous key frames, the sub-parameter information of the first adjacent key frame and the sub-parameter information of the second adjacent key frame corresponding to the sub-parameter information to obtain the sub-reference information corresponding to the sub-parameter information.
Judging whether each piece of sub-parameter information of the intermediate key frame is consistent with the corresponding sub-reference information, if so, deleting the sub-parameter information of the intermediate key frame, and if not, not deleting the sub-parameter information of the intermediate key frame.
Optionally, the step of calculating according to the time information of the three consecutive key frames, the sub-parameter information of the first adjacent key frame, and the sub-parameter information of the second adjacent key frame corresponding to each sub-parameter information, and acquiring the sub-reference information corresponding to each sub-parameter information includes:
calculating according to the time information of the three continuous key frames, the first sub-parameter information of the first adjacent key frame and the first sub-parameter information of the second adjacent key frame to obtain first sub-reference information; and
calculating according to the time information of the three continuous key frames, the second sub-parameter information of the first adjacent key frame and the second sub-parameter information of the second adjacent key frame to obtain second sub-reference information; and
and calculating according to the time information of the three continuous key frames, the third sub-parameter information of the first adjacent key frame and the third sub-parameter information of the second adjacent key frame to obtain third sub-reference information.
Optionally, the step of determining whether each piece of sub-parameter information of the intermediate key frame is consistent with the corresponding piece of sub-reference information, if so, deleting the piece of sub-parameter information of the intermediate key frame, and if not, not deleting the piece of sub-parameter information of the intermediate key frame, including:
judging whether the first sub-parameter information of the intermediate key frame is consistent with the first sub-reference information or not, if so, deleting the first sub-parameter information of the intermediate key frame, and if not, not deleting the first sub-parameter information of the intermediate key frame; and
judging whether second sub-parameter information of the intermediate key frame is consistent with the second sub-reference information or not, if so, deleting the second sub-parameter information of the intermediate key frame, and if not, deleting the second sub-parameter information of the intermediate key frame; and
judging whether the third sub-parameter information of the intermediate key frame is consistent with the third sub-reference information, if so, deleting the third sub-parameter information of the intermediate key frame, and if not, deleting the third sub-parameter information of the intermediate key frame.
In a second aspect, an embodiment of the present application provides an animation data processing apparatus, which is applied to an electronic device, where the electronic device stores original animation data, the original animation data includes a skeleton, and the skeleton includes keyframes arranged according to a chronological information sequence, and the apparatus includes:
an obtaining module, configured to obtain parameter information of the key frame, where the parameter information includes multiple pieces of sub-parameter information.
The first processing module is used for judging whether the difference value between each piece of sub-parameter information and the corresponding pre-stored default information is smaller than the preset precision, and when the difference value between the piece of sub-parameter information and the corresponding preset default information is smaller than the preset precision, the first processing module sets the piece of sub-parameter information to be consistent with the corresponding default information.
And the second processing module is configured to determine whether three consecutive key frames corresponding to the same sub-parameter information exist, and when three consecutive key frames corresponding to the same sub-parameter information exist, delete the sub-parameter information in the key frame among the three consecutive key frames, which is arranged in the middle of the key frames according to the time information sequence.
And the third processing module is used for discarding the sub-parameter information when the sub-parameter information of the key frame is consistent with the corresponding default information, and marking a multi-bit identification code which is prestored and corresponds to the key frame into a first state.
And the fourth processing module is used for marking the prestored multi-bit identification code corresponding to the key frame as a second state when the sub-parameter information of the key frame is inconsistent with the corresponding default information.
And the storage module is used for storing the processed sub-parameter information of the key frame and the corresponding marked multi-digit identification code.
In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device stores original animation data, the original animation data includes a skeleton, and the skeleton includes key frames arranged in a time information order, and the electronic device includes:
a memory;
a processor; and
an animation data processing apparatus stored in the memory and including software functional modules executed by the processor, the apparatus comprising:
an obtaining module, configured to obtain parameter information of the key frame, where the parameter information includes multiple pieces of sub-parameter information.
The first processing module is used for judging whether the difference value between each piece of sub-parameter information and the corresponding pre-stored default information is smaller than the preset precision, and when the difference value between the piece of sub-parameter information and the corresponding preset default information is smaller than the preset precision, the first processing module sets the piece of sub-parameter information to be consistent with the corresponding default information.
And the second processing module is configured to determine whether three consecutive key frames corresponding to the same sub-parameter information exist, and when three consecutive key frames corresponding to the same sub-parameter information exist, delete the sub-parameter information in the key frame among the three consecutive key frames, which is arranged in the middle of the key frames according to the time information sequence.
And the third processing module is used for discarding the sub-parameter information when the sub-parameter information of the key frame is consistent with the corresponding default information, marking a multi-bit identification code which is pre-stored and corresponds to the key frame as a first state, and storing the sub-parameter information of the processed key frame and the marked multi-bit identification code.
And the fourth processing module is used for marking the prestored multi-bit identification code corresponding to the key frame as a second state when the sub-parameter information of the key frame is inconsistent with the corresponding default information, and storing the sub-parameter information of the key frame and the marked multi-bit identification code.
And the storage module is used for storing the processed sub-parameter information of the key frame and the corresponding marked multi-bit identification code.
In a fourth aspect, an embodiment of the present application provides a readable storage medium, where a computer program is stored, and when the computer program is executed, the method for processing animation data is implemented.
According to the animation data processing method, the animation data processing device, the electronic equipment and the readable storage medium, each piece of sub-parameter information, the difference value of which is smaller than the preset precision, of the corresponding default information is set to be consistent with the corresponding default information; deleting the sub-parameter information of the key frame positioned in the middle of three continuous key frames corresponding to the same sub-parameter information; discarding sub-parameter information of the key frame consistent with the corresponding default information, and marking a multi-bit identification code which is prestored and corresponds to the key frame as a first state; marking the corresponding multi-digit identification code with the sub-parameter information inconsistent with the corresponding default information as a second state; and storing the sub-parameter information of the processed key frame and the corresponding marked multi-bit identification code. Therefore, the parameter information of partial key frames is deleted, the animation data occupying smaller storage space is obtained, the resource and cost consumption is reduced, and the method can be suitable for wide video scenes.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and it will be apparent to those skilled in the art that other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a schematic flow chart of a method for processing animation data according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart of an animation data processing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart of an animation data processing method according to an embodiment of the present application;
fig. 4 is a schematic block diagram of an electronic device according to an embodiment of the present application.
Icon: 100-animation data processing means; 110-an obtaining module; 120-a first processing module; 130-a second processing module; 140-a third processing module; 150-a fourth processing module; 160-a storage module; 200-an electronic device; 210-a memory; 220-processor.
Detailed Description
The inventor finds that the storage space occupied by the current animation data is too large, and resources and cost are consumed very much in the actual service application scene with huge data volume. For the above problems, although the existing animation data processing method can improve the above problems to a certain extent, it has a poor effect of reducing the storage space occupied by the animation data, and has a great limitation.
The above prior art solutions have drawbacks that are the results of practical and careful study of the inventor, and therefore, the discovery process of the above problems and the solutions proposed by the following embodiments of the present application for the above problems should be the contributions of the inventor to the present application in the process of the present application.
In view of the above problems, the inventor of the present application proposes the following technical solutions, which can effectively reduce the size of animation data, have small distortion of animation data, and even can reduce the size of animation data without loss, while ensuring the quality of animation data, effectively reduce the size of animation data, and reduce the occupied amount of storage space.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Please refer to fig. 1, which is a schematic flow chart of an animation data processing method according to an embodiment of the present application, and the animation data processing method is applied to an electronic device. The electronic device stores original animation data, wherein the original animation data comprise bones, and the bones comprise key frames arranged according to a time information sequence. The skeleton is multiple, each skeleton has a unique skeleton ID, each skeleton comprises a plurality of key frames, the key frames correspond to the skeleton IDs, and when the parameter information and the time information of the key frames are processed, the parameter information and the time information under the same skeleton ID are aimed at. It should be noted that the animation data processing method provided in the embodiment of the present application is not limited to the specific sequence shown in fig. 1 and described below. The method can be realized by the following steps:
step S10, acquiring parameter information of the key frame, wherein the parameter information comprises a plurality of sub-parameter information.
Step S20, determining whether a difference between each piece of sub-parameter information and the corresponding pre-stored default information is smaller than a preset precision, if the difference between the piece of sub-parameter information and the corresponding pre-stored default information is smaller than the preset precision, executing step S201, and if the difference between the piece of sub-parameter information and the corresponding pre-stored default information is not smaller than the preset precision, executing step S30.
Step S201, the sub-parameter information is set to be consistent with the corresponding default information.
Step S30, determining whether there are three consecutive key frames corresponding to the sub-parameter information, if there are three consecutive key frames corresponding to the sub-parameter information, performing step S301, and if there are no three consecutive key frames corresponding to the sub-parameter information, performing step S40.
In detail, the sub-parameter information includes first sub-parameter information, second sub-parameter information, and third sub-parameter information, and as an implementable embodiment, the step of determining whether there are three consecutive key frames corresponding to the same sub-parameter information, and if there are three consecutive key frames corresponding to the same sub-parameter information, deleting the sub-parameter information in a key frame arranged in the middle of the three consecutive key frames in the order of the time information may be implemented by:
judging whether three continuous key frames corresponding to the first sub-parameter information, the second sub-parameter information and the third sub-parameter information are the same or not;
and if the first sub-parameter information, the second sub-parameter information and the third sub-parameter information correspond to three same continuous key frames, deleting the sub-parameter information in the key frame arranged in the middle of the three continuous key frames according to the time information sequence.
Step S301, deleting the sub-parameter information in the key frame among the three consecutive key frames, which is arranged in the middle according to the time information sequence.
Step S40, determining whether each piece of sub-parameter information of the key frame is consistent with the corresponding default information, if so, performing step S401, and if not, performing step S402.
Step S401, discarding the sub-parameter information, and marking the pre-stored multi-bit identification code corresponding to the key frame as a first state.
Further, if the sub-parameter information of the key frame is consistent with the corresponding default information, discarding the sub-parameter information, and marking the pre-stored multi-bit identification code corresponding to the key frame as the first state, which can be implemented by the following steps:
if the first sub-parameter information of the key frame is consistent with the corresponding default information, discarding the first sub-parameter information, and marking the first bit of the multi-bit identification code corresponding to the key frame in a first state; and
if the second sub-parameter information of the key frame is consistent with the corresponding default information, discarding the second sub-parameter information, and marking the second bit of the prestored multi-bit identification code corresponding to the key frame as a first state; and
and if the third sub-parameter information of the key frame is consistent with the corresponding default information, discarding the third sub-parameter information, and marking a third bit of a multi-bit identification code which is prestored and corresponds to the key frame as a first state.
Step S402, marking the prestored multi-bit identification code corresponding to the key frame as a second state.
Further, as an implementation manner, if the sub-parameter information of the key frame is inconsistent with the corresponding default information, the step of marking the pre-stored multi-bit identification code corresponding to the key frame as the second state may be implemented by:
if the first sub-parameter information of the key frame is inconsistent with the corresponding default information, storing the first sub-parameter information, and marking the first bit of the multi-bit identification code corresponding to the key frame in a second state; and
if the second sub-parameter information of the key frame is inconsistent with the corresponding default information, storing the second sub-parameter information, and marking a second bit of a multi-bit identification code which is prestored and corresponds to the key frame as a second state; and
and if the third sub-parameter information of the key frame is inconsistent with the corresponding default information, storing the third sub-parameter information, and marking a third bit of a multi-bit identification code which is prestored and corresponds to the key frame as a second state.
And S50, storing the processed sub-parameter information of the key frame and the corresponding marked multi-digit identification code.
Wherein the first state indicates that sub-parameter information corresponding to the multi-bit identification code in the key frame is discarded, and the second state indicates that sub-parameter information corresponding to the multi-bit identification code is stored in the key frame.
Therefore, the electronic equipment deletes the sub-parameter information consistent with the corresponding default information, reduces the data size of the corresponding key frame, increases the multi-bit identification code, enables the key frame with the deleted sub-parameter information to have the corresponding mark, and can ensure the completeness of the key frame parameter information by identifying the state of the corresponding bit of the multi-bit identification code when reading the sub-parameter information of the key frame, thereby ensuring that the animation data cannot be incomplete when the occupied space of the animation data is reduced.
Referring to fig. 2 and fig. 3 in combination, in an embodiment, before storing the processed sub-parameter information of the key frame and the corresponding marked multi-bit identification code, the method further includes:
step S60, acquiring time information of three consecutive key frames, where the three consecutive key frames include a middle key frame, a first adjacent key frame, and a second adjacent key frame.
Step S70, calculating according to the time information of the three consecutive key frames, the sub-parameter information of the first adjacent key frame, and the sub-parameter information of the second adjacent key frame corresponding to the sub-parameter information, and acquiring the sub-reference information corresponding to the sub-parameter information.
In detail, in an embodiment, the step of obtaining sub-reference information corresponding to each piece of sub-parameter information by performing calculation according to the time information of the three consecutive key frames, each piece of sub-parameter information of the first neighboring key frame, and the sub-parameter information of the second neighboring key frame corresponding to each piece of sub-parameter information may be performed by:
step S701, calculating according to the time information of the three consecutive key frames, the first sub-parameter information of the first adjacent key frame, and the first sub-parameter information of the second adjacent key frame, and obtaining first sub-reference information.
Step S702, calculating according to the time information of the three consecutive key frames, the second sub-parameter information of the first adjacent key frame, and the second sub-parameter information of the second adjacent key frame, to obtain second sub-reference information.
Step S703, calculating according to the time information of the three consecutive key frames, the third sub-parameter information of the first adjacent key frame, and the third sub-parameter information of the second adjacent key frame, to obtain third sub-reference information.
In detail, as an implementation manner, the sub-reference information is obtained through calculation, and the following manner is adopted:
y 21 ′=(x 2 -x 1 )×y 11 +(x 3 -x 2 )×y 31
y 22 ′=(x 2 -x 1 )×y 12 +(x 3 -x 2 )×y 32
y 23 ′=(x 2 -x 1 )×y 13 +(x 3 -x 2 )×y 33
wherein x is 1 、x 2 And x 3 Time information of the first adjacent key frame, time information of the second adjacent key frame and time information of the middle key frame, y 11 、y 12 And y 13 First sub-parameter information, second sub-parameter information and third self-parameter information, y, of the first adjacent key frame, respectively 31 、y 32 And y 33 First sub-parameter information, second sub-parameter information and third self-parameter information, y, of a second adjacent key frame 21 ’、y 22 ' and y 23 ' are first sub-reference information, second sub-reference information, and third sub-reference information, respectively.
Step S80, determining whether each sub-parameter information of the middle key frame is consistent with the corresponding sub-reference information, if so, executing step S801, and if not, executing step S802.
As an implementation manner, the determining whether each piece of sub-parameter information of the intermediate key frame is consistent with the corresponding sub-reference information includes the following steps:
judging whether the first sub-parameter information of the intermediate key frame is consistent with the first sub-reference information or not, if so, deleting the first sub-parameter information of the intermediate key frame, and if not, not deleting the first sub-parameter information of the intermediate key frame; and
judging whether second sub-parameter information of the intermediate key frame is consistent with the second sub-reference information or not, if so, deleting the second sub-parameter information of the intermediate key frame, and if not, deleting the second sub-parameter information of the intermediate key frame; and
judging whether the third sub-parameter information of the intermediate key frame is consistent with the third sub-reference information, if so, deleting the third sub-parameter information of the intermediate key frame, and if not, deleting the third sub-parameter information of the intermediate key frame.
Step S801, deleting the sub-parameter information of the intermediate key frame.
Step S802, the sub-parameter information of the intermediate key frame is not deleted.
Therefore, the sub-parameter information of the corresponding key frame consistent with the calculated sub-reference time information in the animation data is deleted, so that the size of the animation data is reduced, the storage space is saved, and the resource and cost consumption is reduced. And when the animation data is read, the integrity of the animation data is ensured by recalculating the corresponding sub-parameter information.
Please refer to fig. 4, which is a block diagram of an electronic device 200 according to an embodiment of the present disclosure. The animation data processing apparatus 100 is applied to an electronic device 200, the electronic device 200 stores original animation data, the original animation data includes bones, the bones include key frames arranged according to a time information sequence, and the apparatus includes:
an obtaining module 110, configured to obtain parameter information of the key frame, where the parameter information includes multiple pieces of sub-parameter information.
The first processing module 120 is configured to determine whether a difference between each piece of sub-parameter information and corresponding pre-stored default information is smaller than a preset precision, and when the difference between the piece of sub-parameter information and the corresponding preset default information is smaller than the preset precision, the first processing module 120 sets the piece of sub-parameter information to be consistent with the corresponding default information.
The second processing module 130 is configured to determine whether there are three consecutive key frames corresponding to the same sub-parameter information, and when there are three consecutive key frames corresponding to the same sub-parameter information, the second processing module 130 deletes the sub-parameter information in the key frame among the three consecutive key frames that is arranged in the middle according to the time information sequence.
The third processing module 140 is configured to discard the sub-parameter information of the key frame when the sub-parameter information of the key frame is consistent with the corresponding default information, and mark a multi-bit identifier code, which is pre-stored and corresponds to the key frame, as a first state.
The fourth processing module 150 is configured to mark the pre-stored multi-bit identification code corresponding to the key frame as the second state when the sub-parameter information of the key frame is inconsistent with the corresponding default information.
The storage module 160 is configured to store the processed sub-parameter information of the key frame and the corresponding marked multi-digit identification code.
The first state indicates that the sub-parameter information corresponding to the multi-bit identification code in the key frame is discarded, and the first state indicates that the sub-parameter information corresponding to the multi-bit identification code is stored in the key frame. So that parameter information of the animation data can be read according to the identification states of the multi-bit identification codes when the animation data is read.
Further, an electronic device 200 is provided in an embodiment of the present application, where the electronic device 200 stores original animation data, the original animation data includes bones, and the bones include keyframes arranged in a time information order. In this embodiment, the electronic device 200 includes: a memory 210, a processor 220, and an animation data processing apparatus 100. The device is stored in the memory 210 and includes software functional modules that are executed by the processor 220.
In this embodiment, the electronic device 200 may be any device having a data storage requirement. Such as a mobile phone (mobile phone), a tablet computer (Pad), a Virtual Reality (VR) terminal device, an Augmented Reality (AR) terminal device, and the like. The embodiments of the present application do not limit the application scenarios.
The memory 210, the processor 220, and the animation data processing apparatus 100 are electrically connected to each other directly or indirectly to enable data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The memory 210 stores the animation data processing device 100, the animation data processing device 100 includes at least one software functional module which can be stored in the memory 210 in the form of software or firmware (firmware), and the processor 220 executes various functional applications and data processing by running software programs and modules stored in the memory 210, such as the animation data processing device 100 in the present disclosure, so as to implement the animation data processing method executed by the electronic device 200 in the present application.
The Memory 210 may be, but is not limited to, a Random Access Memory (RAM) 210, a Read Only Memory (ROM) 210, a Programmable Read Only Memory (PROM) 210, an Erasable Read Only Memory (EPROM) 210, an electrically Erasable Read Only Memory (EEPROM) 210, and the like. The memory 210 is used for storing a program, and the processor 220 executes the program after receiving an execution instruction.
The processor 220 may be an integrated circuit chip having data processing capabilities. The Processor 220 may be a general-purpose Processor 220, and includes a Central Processing Unit (CPU) 220, a Network Processor 220 (NP), and the like. The various methods, steps and logic blocks disclosed in this disclosure may be implemented or performed. The general purpose processor 220 may be a microprocessor 220 or the processor 220 may be any conventional processor 220 or the like.
It will be appreciated that the configuration shown in FIG. 4 is merely illustrative and that electronic device 200 may include more or fewer components than shown in FIG. 4 or may have a different configuration than shown in FIG. 4. The components shown in fig. 4 may be implemented in hardware, software, or a combination thereof.
Further, an embodiment of the present application also provides a readable storage medium, in which a computer program is stored, and when the computer program is executed, the animation data processing method is implemented.
According to the animation data processing method and device, the electronic device 200 and the readable storage medium, each piece of sub-parameter information with the difference value smaller than the preset precision with the corresponding default information is set to be consistent with the corresponding default information; deleting the sub-parameter information of the key frame positioned in the middle of three continuous key frames corresponding to the same sub-parameter information; discarding sub-parameter information of the key frame consistent with the corresponding default information, and marking a multi-bit identification code which is prestored and corresponds to the key frame as a first state; marking the corresponding multi-digit identification code with the sub-parameter information inconsistent with the corresponding default information as a second state; and storing the sub-parameter information of the processed key frame and the corresponding marked multi-bit identification code. Therefore, part of parameter information of part of key frames is deleted, and corresponding parameter information can be obtained again when animation data is read through the identification state of the added multi-bit identification code. The method ensures the integrity of the animation data and reduces the resource and cost consumption while reducing the animation data, and can be suitable for wide video scenes.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus and method embodiments described above are illustrative only, as the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
It will be evident to those skilled in the art that the application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.

Claims (8)

1. An animation data processing method applied to an electronic device, wherein the electronic device stores original animation data, the original animation data comprises bones, and the bones comprise key frames arranged according to a time information sequence, and the method comprises the following steps:
acquiring parameter information of the key frame, wherein the parameter information comprises a plurality of sub-parameter information;
judging whether the difference value between each piece of sub-parameter information and corresponding pre-stored default information is smaller than preset precision, and if the difference value between each piece of sub-parameter information and the corresponding preset default information is smaller than the preset precision, setting the sub-parameter information to be consistent with the corresponding default information;
judging whether three continuous key frames corresponding to the sub-parameter information exist or not, and if the three continuous key frames corresponding to the sub-parameter information exist, deleting the sub-parameter information in the key frames arranged in the middle of the three continuous key frames according to the time information sequence;
if the sub-parameter information of the key frame is consistent with the corresponding default information, discarding the sub-parameter information, and marking a multi-bit identification code which is prestored and corresponds to the key frame as a first state;
if the sub-parameter information of the key frame is inconsistent with the corresponding default information, marking a multi-bit identification code which is prestored and corresponds to the key frame as a second state;
storing the processed sub-parameter information of the key frame and the corresponding marked multi-digit identification code;
wherein the first state indicates that sub-parameter information corresponding to the multi-bit identification code in the key frame is discarded, and the second state indicates that sub-parameter information corresponding to the multi-bit identification code is stored in the key frame;
the sub-parameter information includes first sub-parameter information, second sub-parameter information, and third sub-parameter information, and the step of determining whether there are three consecutive key frames corresponding to the same sub-parameter information, and if there are three consecutive key frames corresponding to the same sub-parameter information, deleting the sub-parameter information in the key frame among the three consecutive key frames, which is arranged in the middle of the key frames according to the time information sequence, includes:
judging whether three continuous key frames corresponding to the first sub-parameter information, the second sub-parameter information and the third sub-parameter information are the same or not;
if the first sub-parameter information, the second sub-parameter information and the third sub-parameter information correspond to three identical continuous key frames, deleting the sub-parameter information in the key frames arranged in the middle of the three continuous key frames according to the time information sequence;
before storing the processed sub-parameter information of the key frame and the corresponding marked multi-digit identification code, the method further includes:
acquiring time information of three continuous key frames, wherein the three continuous key frames comprise a middle key frame, a first adjacent key frame and a second adjacent key frame;
calculating according to the time information of the three continuous key frames, the sub-parameter information of the first adjacent key frame and the sub-parameter information of the second adjacent key frame corresponding to the sub-parameter information to obtain sub-reference information corresponding to the sub-parameter information;
judging whether each piece of sub-parameter information of the intermediate key frame is consistent with the corresponding sub-reference information, if so, deleting the sub-parameter information of the intermediate key frame, and if not, not deleting the sub-parameter information of the intermediate key frame.
2. The method according to claim 1, wherein if the sub-parameter information of the key frame is consistent with the corresponding default information, discarding the sub-parameter information, and marking a multi-bit identification code pre-stored corresponding to the key frame as a first state, the method comprises:
if the first sub-parameter information of the key frame is consistent with the corresponding default information, discarding the first sub-parameter information, and marking the first bit of the multi-bit identification code corresponding to the key frame in a first state; and
if the second sub-parameter information of the key frame is consistent with the corresponding default information, discarding the second sub-parameter information, and marking the second bit of the prestored multi-bit identification code corresponding to the key frame as a first state; and
and if the third sub-parameter information of the key frame is consistent with the corresponding default information, discarding the third sub-parameter information, and marking a third bit of a multi-bit identification code which is prestored and corresponds to the key frame as a first state.
3. The method for processing animation data according to claim 2, wherein if the sub-parameter information of the key frame is inconsistent with the corresponding default information, the step of marking the pre-stored multi-bit id code corresponding to the key frame as the second state comprises:
if the first sub-parameter information of the key frame is inconsistent with the corresponding default information, storing the first sub-parameter information, and marking the first bit of the multi-bit identification code corresponding to the key frame in a second state; and
if the second sub-parameter information of the key frame is inconsistent with the corresponding default information, storing the second sub-parameter information, and marking a second bit of a multi-bit identification code which is prestored and corresponds to the key frame as a second state; and
and if the third sub-parameter information of the key frame is inconsistent with the corresponding default information, storing the third sub-parameter information, and marking a third bit of a multi-bit identification code corresponding to the key frame in a second state.
4. The animation data processing method according to claim 1, wherein the step of obtaining sub-reference information corresponding to each piece of sub-parameter information by performing calculation based on the time information of the three consecutive key frames, each piece of sub-parameter information of the first neighboring key frame, and sub-parameter information of the second neighboring key frame corresponding to each piece of sub-parameter information comprises:
calculating according to the time information of the three continuous key frames, the first sub-parameter information of the first adjacent key frame and the first sub-parameter information of the second adjacent key frame to obtain first sub-reference information; and
calculating according to the time information of the three continuous key frames, the second sub-parameter information of the first adjacent key frame and the second sub-parameter information of the second adjacent key frame to obtain second sub-reference information; and
and calculating according to the time information of the three continuous key frames, the third sub-parameter information of the first adjacent key frame and the third sub-parameter information of the second adjacent key frame to obtain third sub-reference information.
5. The animation data processing method according to claim 4, wherein the step of determining whether or not each piece of sub-parameter information of the intermediate key frame coincides with the corresponding piece of sub-reference information, and if each piece of sub-parameter information of the intermediate key frame coincides with the corresponding piece of sub-reference information, deleting the piece of sub-parameter information of the intermediate key frame, and if each piece of sub-parameter information of the intermediate key frame does not coincide with the corresponding piece of sub-reference information, not deleting the piece of sub-parameter information of the intermediate key frame comprises:
judging whether the first sub-parameter information of the intermediate key frame is consistent with the first sub-reference information or not, if so, deleting the first sub-parameter information of the intermediate key frame, and if not, not deleting the first sub-parameter information of the intermediate key frame; and
judging whether second sub-parameter information of the intermediate key frame is consistent with the second sub-reference information or not, if so, deleting the second sub-parameter information of the intermediate key frame, and if not, deleting the second sub-parameter information of the intermediate key frame; and
judging whether the third sub-parameter information of the intermediate key frame is consistent with the third sub-reference information, if so, deleting the third sub-parameter information of the intermediate key frame, and if not, deleting the third sub-parameter information of the intermediate key frame.
6. An animation data processing apparatus applied to an electronic device storing original animation data including a skeleton including key frames arranged in time information order, the apparatus comprising:
an obtaining module, configured to obtain parameter information of the key frame, where the parameter information includes multiple pieces of sub-parameter information;
the first processing module is used for judging whether the difference value between each piece of sub-parameter information and the corresponding pre-stored default information is smaller than the preset precision, and when the difference value between the piece of sub-parameter information and the corresponding preset default information is smaller than the preset precision, the first processing module sets the piece of sub-parameter information to be consistent with the corresponding default information;
a second processing module, configured to determine whether there are three consecutive key frames corresponding to the same sub-parameter information, and when there are three consecutive key frames corresponding to the same sub-parameter information, delete the sub-parameter information in the key frames arranged in the middle of the three consecutive key frames according to the time information sequence;
a third processing module, configured to discard the sub-parameter information of the key frame when the sub-parameter information is consistent with the corresponding default information, and mark a multi-bit identifier code, which is pre-stored and corresponds to the key frame, as a first state;
the fourth processing module is used for marking the prestored multi-bit identification code corresponding to the key frame as a second state when the sub-parameter information of the key frame is inconsistent with the corresponding default information;
the storage module is used for storing the processed sub-parameter information of the key frame and the corresponding marked multi-digit identification code;
the sub-parameter information includes first sub-parameter information, second sub-parameter information, and third sub-parameter information, and the second processing module is further configured to:
judging whether three continuous key frames corresponding to the first sub-parameter information, the second sub-parameter information and the third sub-parameter information are the same or not;
if the first sub-parameter information, the second sub-parameter information and the third sub-parameter information correspond to three same continuous key frames, deleting the sub-parameter information in the key frames arranged in the middle of the three continuous key frames according to the time information sequence;
before storing the processed sub-parameter information of the key frame and the corresponding marked multi-bit identification code, the second processing module is further configured to:
acquiring time information of three continuous key frames, wherein the three continuous key frames comprise a middle key frame, a first adjacent key frame and a second adjacent key frame;
calculating according to the time information of the three continuous key frames, the sub-parameter information of the first adjacent key frame and the sub-parameter information of the second adjacent key frame corresponding to the sub-parameter information to obtain sub-reference information corresponding to the sub-parameter information;
judging whether each piece of sub-parameter information of the intermediate key frame is consistent with the corresponding sub-reference information, if so, deleting the sub-parameter information of the intermediate key frame, and if not, not deleting the sub-parameter information of the intermediate key frame.
7. An electronic device, wherein the electronic device stores original animation data, wherein the original animation data includes a skeleton including key frames arranged in a time information order, the electronic device comprising:
a memory;
a processor; and
an animation data processing apparatus stored in the memory and including software functional modules executed by the processor, the apparatus comprising:
an obtaining module, configured to obtain parameter information of the key frame, where the parameter information includes multiple pieces of sub-parameter information;
the first processing module is used for judging whether the difference value between each piece of sub-parameter information and the corresponding pre-stored default information is smaller than the preset precision, and when the difference value between the piece of sub-parameter information and the corresponding preset default information is smaller than the preset precision, the first processing module sets the piece of sub-parameter information to be consistent with the corresponding default information;
the second processing module is configured to determine whether three consecutive key frames corresponding to the same sub-parameter information exist, and when three consecutive key frames corresponding to the same sub-parameter information exist, the second processing module deletes the sub-parameter information, which is arranged in the middle key frame according to the time information sequence, from the three consecutive key frames;
a third processing module, configured to discard the sub-parameter information of the key frame when the sub-parameter information is consistent with the corresponding default information, mark a multi-bit identifier code pre-stored and corresponding to the key frame as a first state, and store the sub-parameter information of the processed key frame and the marked multi-bit identifier code;
the fourth processing module is used for marking a multi-bit identification code which is prestored and corresponds to the key frame into a second state when the sub-parameter information of the key frame is inconsistent with the corresponding default information, and storing the sub-parameter information of the key frame and the multi-bit identification code which is marked correspondingly;
the storage module is used for storing the processed sub-parameter information of the key frame and the corresponding marked multi-bit identification codes;
the sub-parameter information includes first sub-parameter information, second sub-parameter information, and third sub-parameter information, and the second processing module is further configured to:
judging whether three continuous key frames corresponding to the first sub-parameter information, the second sub-parameter information and the third sub-parameter information are the same or not;
if the first sub-parameter information, the second sub-parameter information and the third sub-parameter information correspond to three identical continuous key frames, deleting the sub-parameter information in the key frames arranged in the middle of the three continuous key frames according to the time information sequence;
before storing the processed sub-parameter information of the key frame and the corresponding marked multi-bit identification code, the second processing module is further configured to:
acquiring time information of three continuous key frames, wherein the three continuous key frames comprise a middle key frame, a first adjacent key frame and a second adjacent key frame;
calculating according to the time information of the three continuous key frames, the sub-parameter information of the first adjacent key frame and the sub-parameter information of the second adjacent key frame corresponding to the sub-parameter information to obtain sub-reference information corresponding to the sub-parameter information;
judging whether each piece of sub-parameter information of the intermediate key frame is consistent with the corresponding sub-reference information, if so, deleting the sub-parameter information of the intermediate key frame, and if not, not deleting the sub-parameter information of the intermediate key frame.
8. A readable storage medium, characterized in that a computer program is stored therein, which when executed, implements the animation data processing method of any one of claims 1 to 5.
CN201811392654.8A 2018-11-21 2018-11-21 Animation data processing method and device, electronic equipment and readable storage medium Active CN109544664B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811392654.8A CN109544664B (en) 2018-11-21 2018-11-21 Animation data processing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811392654.8A CN109544664B (en) 2018-11-21 2018-11-21 Animation data processing method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN109544664A CN109544664A (en) 2019-03-29
CN109544664B true CN109544664B (en) 2023-03-28

Family

ID=65848746

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811392654.8A Active CN109544664B (en) 2018-11-21 2018-11-21 Animation data processing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN109544664B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110992448B (en) * 2019-11-28 2023-06-30 网易(杭州)网络有限公司 Animation processing method, device, electronic equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AUPQ535200A0 (en) * 2000-01-31 2000-02-17 Canon Kabushiki Kaisha Extracting key frames from a video sequence
CN101655859B (en) * 2009-07-10 2012-06-13 北京大学 Method for fast removing redundancy key frames and device thereof
JP2012105205A (en) * 2010-11-12 2012-05-31 Nikon Corp Key frame extractor, key frame extraction program, key frame extraction method, imaging apparatus, and server device
CN106327538B (en) * 2016-08-25 2019-09-20 深圳市创梦天地科技有限公司 A kind of two dimension skeleton cartoon compression method and device
CN108492338B (en) * 2018-02-09 2021-12-24 腾讯科技(深圳)有限公司 Compression method and device for animation file, storage medium and electronic device
CN108320322B (en) * 2018-02-11 2021-06-08 腾讯科技(成都)有限公司 Animation data processing method, animation data processing device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109544664A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
CN107832062B (en) Program updating method and terminal equipment
CN109783757B (en) Method, device and system for rendering webpage, storage medium and electronic device
CN108228293B (en) Interface skin switching method and device
CN106227483B (en) Display control method and mobile terminal
CN109544664B (en) Animation data processing method and device, electronic equipment and readable storage medium
CN113407254B (en) Form generation method and device, electronic equipment and storage medium
CN112052157B (en) Method, device and system for constructing test message
CN111049735B (en) Group head portrait display method, device, equipment and storage medium
CN111767492A (en) Picture loading method and device, computer equipment and storage medium
CN111813485A (en) Page layout processing method, device and equipment and computer readable storage medium
CN108776665B (en) Data processing method and device
CN106156169B (en) Discrete data processing method and device
CN111754518B (en) Image set expansion method and device and electronic equipment
CN114925127A (en) Two-dimensional graph generation method and device for cascade structure data and storage medium
CN108769732B (en) Image transmission method and system and electronic terminal
CN112507235A (en) Mixed-rank material recommendation method and system, electronic equipment and storage medium
CN110782389B (en) Image data byte alignment method and terminal
CN114117063A (en) Entity alignment method, device, electronic equipment and computer readable storage medium
CN112650763A (en) Configuration method of product quota, related equipment and storage medium
CN112035656A (en) Method, device, computer equipment and medium for quickly previewing document
CN112055058A (en) Data storage method and device and computer readable storage medium
CN116263792B (en) Method and system for crawling complex internet data
CN111881356A (en) Content recommendation method and device, electronic equipment and storage medium
CN107659830B (en) Interactive activity access method, system and terminal equipment
CN115994203B (en) AI-based data annotation processing method, system and AI center

Legal Events

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