WO2021068758A1 - Shuffle method, apparatus, computer device, and readable storage medium - Google Patents

Shuffle method, apparatus, computer device, and readable storage medium Download PDF

Info

Publication number
WO2021068758A1
WO2021068758A1 PCT/CN2020/117564 CN2020117564W WO2021068758A1 WO 2021068758 A1 WO2021068758 A1 WO 2021068758A1 CN 2020117564 W CN2020117564 W CN 2020117564W WO 2021068758 A1 WO2021068758 A1 WO 2021068758A1
Authority
WO
WIPO (PCT)
Prior art keywords
shuffling
unit
shuffle
stream
block
Prior art date
Application number
PCT/CN2020/117564
Other languages
French (fr)
Chinese (zh)
Inventor
张尧
王秉睿
何皓源
Original Assignee
安徽寒武纪信息科技有限公司
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 安徽寒武纪信息科技有限公司 filed Critical 安徽寒武纪信息科技有限公司
Publication of WO2021068758A1 publication Critical patent/WO2021068758A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Definitions

  • This application relates to the field of computer technology, in particular to a shuffling method, device, computer equipment and readable storage medium.
  • a shuffling method includes:
  • the first shuffling level at least one first shuffle group corresponding to the data block to be encoded is determined, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one coded stream ;
  • the shuffling unit encodes the first stream block to be encoded according to a preset encoding algorithm.
  • a shuffling method in a second aspect, includes:
  • the first shuffle level determine at least one first shuffle group corresponding to the data block to be decoded, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one decoded stream ;
  • the shuffling unit decodes the first stream block to be decoded according to a preset decoding algorithm.
  • a shuffling device comprising:
  • the first determination module is configured to determine at least one first shuffle group corresponding to the data block to be encoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit
  • the washing unit contains at least one coded stream;
  • the second determining module is used to determine the code length of each first shuffling unit
  • a third determining module configured to determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
  • a sending module configured to send a first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be coded in the input shuffle unit,
  • the first stream block to be encoded is encoded by the input shuffling unit according to a preset encoding algorithm.
  • a shuffling device comprising:
  • the first determining module is configured to determine at least one first shuffle group corresponding to the data block to be decoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit
  • the washing unit contains at least one decoding stream;
  • the second determining module is used to determine the code length of each first shuffling unit
  • a third determining module configured to determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
  • a sending module configured to send a first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit,
  • the first stream block to be decoded is decoded by the input shuffling unit according to a preset decoding algorithm.
  • a computer device including a memory and a processor, the memory stores a computer program that can run on the processor, and when the processor executes the computer program, any one of the first aspect is implemented. The steps of the method described in item.
  • a computer-readable storage medium on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method described in any one of the first aspects.
  • a chip system including a processor, the processor is coupled to a memory, the memory stores program instructions, and the first aspect is implemented when the program instructions stored in the memory are executed by the processor Any of the methods.
  • a computer device including a memory and a processor, the memory stores a computer program that can run on the processor, and when the processor executes the computer program, any one of the second aspects is implemented. The steps of the method described in item.
  • a computer-readable storage medium on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the methods in the second aspect.
  • a chip system including a processor, the processor is coupled to a memory, the memory stores program instructions, and the second aspect is implemented when the program instructions stored in the memory are executed by the processor Any of the methods.
  • FIG. 1 is a schematic structural diagram of a codec provided by an embodiment of the application
  • FIG. 2 is a schematic flowchart of a method for generating an encoded stream provided by an embodiment of the application
  • FIG. 3 is a schematic diagram of a source data provided by an embodiment of this application.
  • FIG. 4A is a schematic diagram of stream block division according to an embodiment of this application.
  • FIG. 4B is a schematic diagram of a stream block division provided by an embodiment of this application.
  • FIG. 5 is a schematic flow chart of a shuffling method provided by an embodiment of the application.
  • FIG. 6 is a schematic flow chart of determining an output/input shuffling unit according to an embodiment of the application.
  • FIG. 7A is a schematic diagram of a coded stream before shuffling according to an embodiment of the application.
  • FIG. 7B is a schematic diagram of another coded stream before shuffling according to an embodiment of the application.
  • FIG. 8A is a schematic diagram of a shuffling process of an encoded stream provided by an embodiment of the application.
  • FIG. 8B is a schematic diagram of another shuffling process of an encoded stream provided by an embodiment of the application.
  • FIG. 9A is a schematic diagram of completion of shuffling of a coded stream provided by an embodiment of the application.
  • FIG. 9B is a schematic diagram of completion of shuffling of another coded stream provided by an embodiment of the application.
  • FIG. 10 is a schematic diagram of coded data provided by an embodiment of this application.
  • FIG. 11 is a schematic diagram of a source data sub-block splicing provided by an embodiment of this application.
  • FIG. 12A is a schematic diagram of splicing coded data sub-blocks according to an embodiment of the application.
  • FIG. 12B is a schematic diagram of splicing coded data sub-blocks according to an embodiment of this application.
  • FIG. 12C is a schematic diagram of splicing coded data sub-blocks according to an embodiment of the application.
  • FIG. 12D is a schematic diagram of sub-block splicing of encoded data provided by an embodiment of the application.
  • FIG. 13 is a schematic flow chart of a shuffling method provided by an embodiment of the application.
  • FIG. 14 is a schematic flowchart of determining an output/input shuffling unit according to an embodiment of the application.
  • 15 is a schematic diagram of a decoded stream before shuffling according to an embodiment of the application.
  • FIG. 16 is a schematic diagram of a decoding stream shuffling process provided by an embodiment of this application.
  • FIG. 17 is a schematic diagram of completion of shuffling of decoded streams provided by an embodiment of the application.
  • FIG. 18 is a schematic diagram of encoding header data provided by an embodiment of this application.
  • FIG. 19 is a schematic diagram of data division when decoding is provided according to an embodiment of this application.
  • FIG. 20 is a schematic diagram of data division when decoding is provided according to an embodiment of this application.
  • FIG. 21 is a schematic structural diagram of a shuffling device provided by an embodiment of the application.
  • Figure 22 is a schematic structural diagram of a shuffling device provided by an embodiment of the application.
  • FIG. 23 is a schematic structural diagram of a computer device provided by an embodiment of this application.
  • the term “if” can be interpreted as “when” or “once” or “in response to determination” or “in response to detection” depending on the context.
  • the phrase “if determined” or “if detected [described condition or event]” can be interpreted as meaning “once determined” or “in response to determination” or “once detected [described condition or event]” depending on the context ]” or “in response to detection of [condition or event described]”.
  • FIG. 1 is a system architecture diagram of a codec provided by an embodiment of the application.
  • the codec includes at least one memory and at least one processor.
  • the at least one memory is used to store computer programs.
  • the at least one processor is used to execute the shuffling method according to the computer program stored in the memory to ensure that the encoding lengths of the encoded streams are similar, so as to avoid excessive complements due to alignment requirements between the encoded streams, thereby reducing the encoding rate .
  • the at least one processor may include one or more of IPU (Intelligent Processing Unit), CPU (Central Processing Unit, central processing unit), and GPU (Graphics Processing Unit, graphics processing unit); At least one processor can be a master-slave processor in the CT/LT architecture.
  • IPU Intelligent Processing Unit
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit, graphics processing unit
  • At least one processor can be a master-slave processor in the CT/LT architecture.
  • Step 201 Obtain source data to be encoded.
  • the codec when the codec needs to encode source data, the codec can obtain pre-stored source data to be encoded.
  • the format of the source data is a two-dimensional format
  • the low-dimensional is X
  • the high-dimensional is Y
  • the starting address is the data address
  • the size of the source data is the low-dimensional data size (data size X) *High-dimensional data size (data size Y)
  • the stride of the source data in the low dimensionality (stride) is the low-dimensional data stride (data X).
  • the source data can be further divided into multiple source data blocks evenly in two dimensions. As shown in Figure 3, each block represents a source data block, and the size of the source data block is the size of the low-dimensional source data block.
  • the low-dimensional interval between two adjacent source data blocks is the low-dimensional source data block stride (block stride X)
  • the high-dimensional interval is the high-dimensional source data block stride (block stride Y).
  • Step 202 According to the received encoding instruction, determine the encoding area corresponding to the encoding instruction in the source data, the encoding area contains at least one to-be-encoded data block, and the to-be-encoded data block is the source data block or the source data sub-block.
  • the codec can determine the encoding region corresponding to the encoding instruction in the source data according to the received encoding instruction.
  • the coding area contains at least one data block to be coded, and the data block to be coded is a source data block or a source data sub-block. As shown in Figure 3, the dashed frame is the coding area.
  • the coding area can be specified by specifying the low-dimensional offset (offset X) in the low-dimensional direction and the high-dimensional offset (offset X) in the high-dimensional direction in the source data. Y) Obtained.
  • the coding region includes the number of low-dimensional source data blocks (block num X) source data blocks in the low-dimensional direction, and the high-dimensional source data block number (block num Y) source data blocks in the high-dimensional direction.
  • the start address of the coding area is the address of the start source data block.
  • the codec After the codec obtains the coding region corresponding to the coding instruction, for the central source data block (ie, the source data block represented by the vertical square in FIG. 3), the codec can directly encode the source data block. For the source data block at the edge (ie the source data block represented by the diagonal square in Figure 3), the codec can specify the top, bottom, left and right four The parameter determines the source data sub-block in the source data block, and encodes the determined source data sub-block.
  • the codec supports arbitrarily dividing the source data into blocks, and arbitrarily extracting the coding region from the obtained source data block for coding.
  • Step 203 For each to-be-coded data block in at least one to-be-coded data block, divide the to-be-coded data block into multiple stream blocks, and send the multiple stream blocks to multiple codes corresponding to the to-be-coded data block Stream, as a stream block to be shuffled in multiple encoded streams.
  • the codec can encode the same data block to be encoded in parallel through multiple encoding streams.
  • the codec can divide the data block to be encoded into multiple stream blocks, and send the multiple stream blocks to the data block to be encoded
  • Corresponding multiple coded streams are used as stream blocks to be shuffled in the multiple coded streams.
  • the codec may divide the data block to be encoded into multiple row sequences, and each row sequence contains at least one data sub-block to be encoded. Then, for each sub-block of data to be encoded in each row sequence, the codec may divide the sub-block of data to be encoded into multiple stream blocks.
  • the codec divides the data block to be encoded into 4 line sequences.
  • the first row sequence includes the data sub-block 1, the data sub-block 2, the data sub-block 3 to be encoded, and the data sub-block 4 to be encoded;
  • the second row sequence contains the data sub-block 5 to be encoded and the data to be encoded.
  • the fourth row sequence contains the data sub-block 13 to be encoded, the data sub-block 14 to be encoded, the data sub-block 15 to be encoded and the data sub-block 16 to be encoded.
  • the diagonal squares in each row sequence indicate the non-encoded data in the data block to be encoded . Then, as shown in FIG.
  • the codec may divide the sub-block of data to be coded into 4 stream blocks and send them to the coded stream (steam) 1 respectively.
  • coded stream 4 as the stream block to be shuffled in each coded stream.
  • coded stream 1 and coded stream 2 include 16 stream blocks to be shuffled
  • coded stream 3 and coded stream 4 include 12 stream blocks to be shuffled.
  • Step 501 Determine at least one first shuffling group corresponding to the data block to be encoded according to the first shuffling level.
  • the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one coded stream.
  • the codec may select a corresponding shuffling level from the preset shuffling levels according to the difference in the number of stream blocks contained in each coded stream. For example, three shuffle levels can be preset in the codec, shuffle level 1, shuffle level 2, and shuffle level 3.
  • the codec selects a certain shuffling level (ie, the first shuffling level)
  • it may further determine at least one first shuffling group corresponding to the data block to be encoded according to the first shuffling level.
  • the first shuffle group includes a plurality of first shuffle units
  • the first shuffle unit includes at least one coded stream.
  • the codec determines the processing process of at least one first shuffling group corresponding to the data block to be encoded is acquiring multiple encoded streams corresponding to the data block to be encoded.
  • the multiple encoded streams are divided into multiple first shuffling units, and the multiple first shuffling units are divided into at least one first shuffling group.
  • the first shuffle unit includes at least one coded stream, and the first shuffle group includes a plurality of first shuffle units.
  • the codec may obtain multiple encoded streams corresponding to the data block to be encoded. Then, the codec may divide the multiple coded streams into multiple first shuffling units according to the first shuffling level, and divide the multiple first shuffling units into at least one first shuffling group.
  • the first shuffle unit includes at least one coded stream
  • the first shuffle group includes a plurality of first shuffle units.
  • the data block to be coded corresponds to 32 coded streams.
  • the codec can divide the 32 coded streams into 32 first shuffle units, and combine the 32 first shuffle units.
  • the shuffling unit is divided into 8 first shuffling groups, that is, every 4 adjacent coded streams are shuffled; when the first shuffling level is shuffle level 2, the codec can divide 32 coded streams Divide into 8 first shuffling units, and divide the 8 first shuffling units into 2 first shuffling groups, that is, 4 coded streams are shuffled in every adjacent 16 coded streams
  • the unit is shuffled; when the first shuffle level is shuffle level 3, the codec can divide 32 encoded streams into 2 first shuffle units, and divide the 2 first shuffle units into 1
  • the first shuffling group that is, 16 coded streams among the 32 coded streams are shuffled as a shuffling unit.
  • Step 502 Determine the code length of each first shuffling unit.
  • the codec can further determine each first shuffle unit in the first shuffle group The length of the encoding.
  • the codec may determine the total coding length of the stream block to be coded in the coded stream contained in the first shuffling unit as The code length of the first shuffling unit.
  • the codec may also determine the total code length of the stream block to be coded and the coded stream block in the coded stream contained in the first shuffling unit as the first shuffling The encoding length of the unit.
  • Step 503 Determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit.
  • the codec determines the code length of each first shuffle unit, it can determine the output shuffle unit and the input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit. unit. Among them, as shown in Figure 6, the codec determines the output shuffle unit and the input shuffle unit in each first shuffle unit according to the coding length of each first shuffle unit as follows:
  • Step 601 Determine the shuffling type of each first shuffling unit according to the code length of each first shuffling unit.
  • the codec may determine the shuffling type of each first shuffling unit according to the coding length of each first shuffling unit.
  • the codec can determine the shuffling type of each first shuffling unit in various ways according to the encoding length of each first shuffling unit.
  • the embodiment of the present application provides two feasible ways, which are specifically as follows :
  • the codec can determine the first shuffling unit's encoding length according to the first difference between the encoding length of the first shuffling unit and the encoding lengths of other first shuffling units.
  • Shuffle type The specific process is as follows:
  • Step 1 For each first shuffle unit in each first shuffle unit, determine a first difference between the code length of the first shuffle unit and the code lengths of other first shuffle units.
  • the codec can further determine the code length of the first shuffle unit and other first shuffle units.
  • the first difference in the coding length of the unit Example 1, as shown in Fig.
  • each shuffling unit contains an encoded stream as an example, the encoding length of encoded stream 1 is N+5, and the encoded stream 2
  • the code length of coded stream 3 is N+9
  • the coded length of coded stream 3 is N
  • the coded length of coded stream 4 is N+3
  • N is a positive integer
  • the first difference corresponding to coded stream 1 is ⁇ -4,5, 2 ⁇
  • the first difference corresponding to code stream 2 is ⁇ 4, 9, 6 ⁇
  • the first difference corresponding to code stream 3 is ⁇ -5, -9, -3 ⁇
  • the first difference corresponding to code stream 4 The value is ⁇ -2, -6, 3 ⁇ .
  • Example two as shown in Figure 7B, four shuffle units are used as a shuffle group for shuffling, and each shuffle unit contains one coded stream as an example.
  • the code length of coded stream 1 is N+15, and the coded stream 2
  • the code length of code stream 3 is N+10, the code length of code stream 3 is N+8, the code length of code stream 4 is N, and N is a positive integer, then the first difference corresponding to code stream 1 is ⁇ 5,7,15 ⁇ , the first difference corresponding to encoded stream 2 is ⁇ -5, 2, 10 ⁇ , the first difference corresponding to encoded stream 3 is ⁇ -7, -2, 8 ⁇ , and the first difference corresponding to encoded stream 4 Is ⁇ -15, -10, -8 ⁇ .
  • Step 2 Determine the shuffling type of the first shuffling unit according to the first difference corresponding to the first shuffling unit.
  • the first preset difference threshold may be pre-stored in the codec.
  • the first preset difference threshold can be set by a technician based on experience.
  • the codec After the codec obtains the first difference value corresponding to the first shuffle unit, it can determine whether there is a target difference whose absolute value is greater than or equal to the first preset difference threshold in the first difference value corresponding to the first shuffle unit. Value, and whether the target difference is positive. If there is a target difference value in the first difference value corresponding to the first shuffling unit whose absolute value is greater than or equal to the first preset difference value threshold, and the target difference values are all positive numbers, the codec executes step 3.
  • the codec executes the step four. If there is no target difference value whose absolute value is greater than or equal to the first preset difference value threshold in the first difference value corresponding to the first shuffling unit. Then the codec executes step 5.
  • Step 3 Determine that the shuffling type of the first shuffling unit is a high coding type.
  • the codec may It is determined that the shuffling type of the first shuffling unit is a high coding type (indicated by H below). For example, in the foregoing example 1, as shown in FIG. 7A, the first preset difference threshold is 7, and the shuffling type of the encoded stream 2 is H. In the foregoing example 2, as shown in FIG. 7B, the first preset If the difference threshold is set to 7, then the shuffling type of coded stream 1 and coded stream 2 is H.
  • Step 4 Determine that the shuffling type of the first shuffling unit is a low coding type.
  • the decoder may determine that the shuffling type of the first shuffling unit is a low coding type (hereinafter denoted by L). For example, in the foregoing example 1, as shown in FIG. 7A, the first preset difference threshold is 7, and the shuffling type of the encoded stream 3 is L. In the foregoing example 2, as shown in FIG. 7B, the first preset If the difference threshold is set to 7, then the shuffling type of coded stream 3 and coded stream 4 is L.
  • L low coding type
  • Step 5 Determine that the shuffling type of the first shuffling unit is a medium coding type.
  • the codec can determine the first difference of the first shuffling unit
  • the shuffling type is the medium encoding type (denoted by M below).
  • M the medium encoding type
  • the codec may determine the shuffling type of the first shuffling unit according to the second difference between the code length of the first shuffling unit and the average code length. The specific process is as follows:
  • Step 1 Determine the average code length according to the code length of each first shuffling unit.
  • each shuffling unit contains a coded stream as an example, the code length of coded stream 1 is N+5, and the coded length of coded stream 2 is N+ 9.
  • the coding length of coded stream 3 is N
  • the coding length of coded stream 4 is N+3
  • N is a positive integer
  • each shuffle unit contains a code stream as an example, the code length of code stream 1 is N+15, and the code length of code stream 2 is N+ 10.
  • the code length of code stream 3 is N+8, and the code length of code stream 4 is N.
  • N is a positive integer, and the average code length is N+8.25.
  • Step 2 For each first shuffle unit in each first shuffle unit, determine a second difference between the code length of the first shuffle unit and the average code length.
  • the codec may further determine the second difference between the code length of the first shuffle unit and the average code length. For example, in the above example three, the second difference corresponding to code stream 1 is 0.75, the second difference value corresponding to code stream 2 is 4.75, the second difference value corresponding to code stream 3 is -4.25, and the second difference value corresponding to code stream 4 is -4.25.
  • the second difference is -1.25; in the above example four, the second difference corresponding to coded stream 1 is 6.75, the second difference corresponding to coded stream 2 is 1.75, and the second difference corresponding to coded stream 3 is -0.25 , The second difference corresponding to code stream 4 is -8.25.
  • Step 3 Determine the shuffling type of the first shuffling unit according to the second difference value corresponding to the first shuffling unit.
  • the second preset difference threshold may be pre-stored in the codec.
  • the second preset difference threshold can be set by a technician based on experience. After the codec obtains the second difference value corresponding to the first shuffle unit, it can determine whether the absolute value of the second difference value corresponding to the first shuffle unit is greater than or equal to the second preset difference value threshold, and the second difference value Whether the difference is positive. If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, the codec executes step 4.
  • the codec executes step 5. If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, the codec executes step 5. If the absolute value of the second difference corresponding to the first shuffling unit is less than the second preset difference threshold, the codec executes step 6.
  • Step 4 Determine that the shuffling type of the first shuffling unit is a high coding type.
  • the codec can determine the first shuffle unit
  • the shuffling type of the washing unit is a high coding type (namely H).
  • H high coding type
  • the second preset difference threshold is 4, and the shuffling type of coded stream 2 is H; in the foregoing example four, the second preset difference threshold is 6, then the shuffle type of coded stream 1
  • the shuffling type is H.
  • Step 5 Determine that the shuffling type of the first shuffling unit is a low coding type.
  • the codec can determine the first shuffle
  • the shuffling type of the unit is the low coding type (ie L).
  • the second preset difference threshold is 4, and the shuffling type of the encoded stream 3 is L; in the foregoing example four, the second preset difference threshold is 6, then the encoding stream 4 The shuffling type is L.
  • Step 6 determining that the shuffling type of the first shuffling unit is a medium coding type.
  • the codec can determine that the shuffling type of the first shuffling unit is the medium encoding type (That is M).
  • the second preset difference threshold is 4, and the shuffling type of coded stream 1 and coded stream 4 is M; in the above example four, the second preset difference threshold is 6, then The shuffling type of coded stream 2 and coded stream 3 is M.
  • Step 602 Determine an output shuffle unit and an input shuffle unit corresponding to each output shuffle unit in each first shuffle unit according to the shuffle type of each first shuffle unit and a preset shuffle rule.
  • the codec may be pre-stored with shuffling rules.
  • the shuffling rules can be set by technicians based on experience.
  • the codec After the codec obtains the shuffling type of each first shuffling unit, it can further determine the output shuffle in each first shuffling unit according to the shuffling type of each first shuffling unit and preset shuffling rules.
  • Unit and the input shuffle unit corresponding to each output shuffle unit the codec determines the output shuffle unit and the input shuffle corresponding to each output shuffle unit in each first shuffle unit according to the shuffle type of each first shuffle unit and preset shuffle rules.
  • the processing of the unit is as follows:
  • Step 1 If the first number of the first target shuffling units of the high coding type is less than or equal to the second number of the second target shuffling units of the low coding type, the first target shuffling unit is determined as the output shuffling unit , And for each output shuffle unit, in the second target shuffle unit, at least one second target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
  • the codec may determine the first target shuffling unit It is the output shuffle unit. Then, for each output shuffle unit, the codec may determine at least one second target shuffle unit in the second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit.
  • one second target shuffling unit may only be used as an input shuffling unit corresponding to one output shuffling unit, or may be used as an input shuffling unit corresponding to multiple output shuffling units, which is not limited in the embodiment of the present application.
  • each shuffling unit contains a coded stream as an example
  • the codec can change Coded stream 1 is determined as the output shuffle unit, and coded stream 4 is determined as the input shuffle unit of coded stream 1.
  • the codec can change coded stream 1 Determine as the output shuffling unit, and determine the coded stream 3 and coded stream 4 as the input shuffle unit of the coded stream 1.
  • the codec can change the coded stream 1 is determined as the output shuffle unit, and coded stream 2, coded stream 3, and coded stream 4 are determined as the input shuffle unit of coded stream 1.
  • the codec The device can determine the coded stream 1 and coded stream 2 as the output shuffle unit, and the coded stream 3 as the input shuffle unit of the coded stream 1, and the coded stream 4 as the input shuffle unit of the coded stream 2.
  • the encoder can also determine coded stream 3 and coded stream 4 as the input shuffle unit of coded stream 1, and the coded stream 3 and coded stream 4 can be determined as the input shuffle unit of coded stream 2.
  • the codec can also determine the coded stream 3 is determined as the input shuffle unit of coded stream 1, and the sum coded stream 3 and coded stream 4 are determined as the input shuffle unit of coded stream 2.
  • Step 2 If the first number of the first target shuffling units of the high coding type is greater than the second number of the second target shuffling units of the low coding type, the second number of the first target shuffling units are determined as the output shuffle units. For each output shuffle unit, in the second target shuffle unit, at least one second target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
  • the codec may combine in each first target shuffling unit The second number of first target shuffle units are determined as output shuffle units. Then, for each output shuffle unit, the codec may determine at least one second target shuffle unit in the second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit.
  • one second target shuffling unit may only be used as an input shuffling unit corresponding to one output shuffling unit, or may be used as an input shuffling unit corresponding to multiple output shuffling units, which is not limited in the embodiment of the present application.
  • each shuffling unit contains a coded stream as an example
  • the codec can change Coded stream 2 is determined as the output shuffling unit, and coded stream 4 is determined as the input shuffling unit of coded stream 2.
  • the codec can change coded stream 3 It is determined as the output shuffling unit, and the coded stream 4 is determined as the input shuffling unit of the coded stream 1.
  • the codec may further determine a number of first target shuffle units other than the output shuffle unit corresponding to the second target shuffle unit (hereinafter referred to as the first output shuffle unit)
  • a first target shuffle unit is used as an output shuffle unit (hereinafter referred to as a second output shuffle unit), and for each second output shuffle unit, the codec can determine at least in the third target shuffle unit
  • a third target shuffle unit is used as the input shuffle unit corresponding to the second output shuffle unit.
  • each shuffling unit contains a coded stream as an example, when the shuffle type of coded stream 1 to coded stream 4 is HHML, the codec can change Coded stream 2 is determined as the first output shuffle unit, and coded stream 4 is determined as the input shuffle unit of coded stream 2. At the same time, the codec can also determine coded stream 1 as the second output shuffle unit, and The coded stream 3 is determined as the input shuffling unit of the coded stream 1.
  • the codec may determine the third target shuffle unit as the output shuffle unit, and determine itself as the first shuffle unit.
  • the input shuffle unit corresponding to the three-target shuffle unit. For example, taking 4 shuffling units as a shuffling group for shuffling, each shuffling unit contains a coded stream as an example, when the shuffle type of coded stream 1 to coded stream 4 is MMMM, the codec can change The coded stream 1 is determined as the output shuffling unit, and the coded stream 1 is determined as the input shuffling unit of the coded stream 1.
  • the coded stream 2 to the coded stream 4 are similar to them, and will not be repeated here.
  • Step 504 Send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be coded in the input shuffle unit, so as to pass the input shuffle unit according to the pre-shuffled stream blocks.
  • the assumed encoding algorithm encodes the first stream block to be encoded.
  • the first preset number may be pre-stored in the codec.
  • the first preset number can be set by a technician based on experience.
  • the codec can send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the input shuffle unit.
  • the first to-be-coded stream block in the input shuffling unit is used to encode the first to-be-coded stream block according to a preset coding algorithm.
  • the first preset number may be greater than or equal to the number of input shuffle units; the stream blocks to be shuffled received by each input shuffle unit may be the same or different; for each input shuffle unit, the codec
  • the third preset number of units to be shuffled in the input shuffle unit may also be input to the queue to be coded of the input shuffle unit as the first stream block to be coded of the input shuffle unit.
  • the second preset number of stream blocks to be shuffled in the output shuffle unit are sent to the input shuffle unit corresponding to the output shuffle unit as the input shuffle unit
  • the first stream block to be encoded in the unit is sent to the input shuffle unit corresponding to the output shuffle unit.
  • the second preset number may be pre-stored in the codec.
  • the second preset number can be set by a technician based on experience.
  • the codec may send the second preset number of stream blocks to be shuffled in the output shuffle unit to the output shuffle unit.
  • the input shuffling unit corresponding to the shuffling unit is used as the first stream block to be encoded in the input shuffling unit.
  • the second preset number may be greater than or equal to the number of input shuffle units corresponding to the output shuffle unit, and the number of stream blocks to be shuffled received by each input shuffle unit may be the same or different.
  • each shuffling unit contains one coded stream as an example.
  • the shuffle type of coded stream 1 to coded stream 4 is MHLM, then Coded stream 2 is the output shuffling unit, and coded stream 3 is the input shuffling unit of coded stream 2, then coded stream 1 can output 1 block to be shuffled to coded stream 1, and coded stream 2 can output 1 to coded stream 3.
  • a stream block to be shuffled, and the encoded stream 4 can output one stream block to be shuffled to the encoded stream 4.
  • the encoding length of encoded stream 1 is N+8, the encoding length of encoded stream 2 is N+9, the encoding length of encoded stream 3 is N+3, and the encoding of encoded stream 4 is The length is N+6, and the shuffling type of code stream 1 to code stream 4 is MMMM.
  • the shuffling type of code stream 1 to code stream 4 is MMMM.
  • four shuffle units are used as a shuffle group for shuffling, and each shuffle unit contains an encoded stream as an example.
  • the shuffle type of encoded stream 1 to encoded stream 4 is HHLL, Then coded stream 1 and coded stream 2 are output shuffle units, coded stream 3 and coded stream 4 are the input shuffle units of coded stream 1, and coded stream 4 is the input shuffle unit of coded stream 2, then coded stream 1 can be separately One stream block to be shuffled is output to the coded stream 3 and the coded stream 4, and the coded stream 2 can output two stream blocks to be shuffled to the coded stream 4.
  • the encoding length of encoded stream 1 is N+15
  • the encoding length of encoded stream 2 is N+10
  • the encoding length of encoded stream 3 is N+11
  • the encoding of encoded stream 4 is The length is N+9
  • the shuffling type of coded stream 1 to coded stream 4 is MMMM.
  • the codec may determine at least one second shuffling group corresponding to the data block to be encoded according to the second shuffling level.
  • the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one coded stream. Then, the codec may re-shuffle the stream blocks to be coded in each second shuffling unit as the stream blocks to be shuffled, until the coding length of each second shuffling unit meets the preset proximity condition.
  • the codec may further determine at least one second corresponding to the data block to be encoded according to the second shuffling level.
  • Shuffle group wherein, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one coded stream. According to the second shuffling level, the codec determines at least one second shuffling group corresponding to the data block to be encoded.
  • the processing procedure is similar to step 501, and will not be repeated here. Then, the codec may re-shuffle the stream blocks to be coded in each second shuffling unit as the stream blocks to be shuffled, until the coding length of each second shuffling unit meets the preset proximity condition.
  • the codec may further shuffle the coded stream corresponding to the data block to be coded according to the third shuffling level.
  • the codec can shuffle the encoded stream corresponding to the data block to be coded according to shuffle level 1-shuffle level 2-shuffle level 3, or according to shuffle level 1-shuffle level 3-shuffle level 2
  • the coded stream corresponding to the data block to be coded is shuffled, and the coded stream corresponding to the data block to be coded can also be shuffled according to shuffle level 2-shuffle level 3-shuffle level 1.
  • the codec detects that the encoding of the first encoded stream in the multiple encoded streams is completed, the third preset number of the unencoded second encoded streams in the multiple encoded streams
  • the stream block to be coded is sent to the first coded stream as the stream block to be coded in the first coded stream.
  • a third preset number may be pre-stored in the codec.
  • the third preset number can be set by a technician based on experience.
  • the codec detects that the encoding of the first encoded stream of the multiple encoded streams is completed (that is, the first encoded stream outputs the end of the encoded stream (StreamFinish) mark), it can encode the uncompleted second encoding of the multiple encoded streams
  • the third preset number of stream blocks to be coded in the stream are sent to the first coded stream as the stream blocks to be coded in the first coded stream.
  • the second coded stream may be all uncoded coded streams among the multiple coded streams, or may be part of the uncoded coded streams of the multiple coded streams.
  • the process of encoding the first stream block to be encoded by the codec through the input shuffling unit according to a preset encoding algorithm is as follows:
  • Step 1 According to the first encoding rule corresponding to the preset characters, the preset characters included in the first stream block to be encoded are encoded to obtain the first encoded data.
  • the first encoding rule corresponding to the preset character may be pre-stored in the codec.
  • the first encoding rule corresponding to the preset character can be set by a technician based on experience.
  • the codec may encode the preset characters contained in the first stream block to be encoded according to the first encoding rule corresponding to the preset characters to obtain the first encoded data.
  • technicians can set several consecutive all-zero characters as preset characters. Table 1 shows the preset characters, as shown in Table 1:
  • Step 2 Encode the first encoded data according to a preset second encoding rule.
  • the second encoding rule may be pre-stored in the codec.
  • the second encoding rule may be a prefix code encoding algorithm or other encoding algorithms, which is not limited in the embodiment of the present application.
  • the codec encodes the data block to be encoded, and after obtaining the encoded data block, it may generate an encoding header block of the encoded data block corresponding to each data block to be encoded.
  • the encoding header block contains the storage address of the encoded data block corresponding to the encoding header block. Then, the codec can store each coded header block, and store each coded data block after each coded header block.
  • the codec uses a header-data block mapping form for storage.
  • the mapping form is divided into two parts, namely a header part and a data block part.
  • the start address of the encoding header is the head address;
  • the space occupied by the encoding header is the total number of encoding headers (head total number) the size of encoding header blocks, and the total number of encoding headers can be greater than or equal to the effective encoding The number of header blocks.
  • each encoding header block is 16 bytes
  • each encoding header block stores information such as the starting address and actual size of the encoded data block corresponding to the encoding header block
  • each encoding header block is stored in the storage device.
  • the coded data block is stored next to the end address of the coded header.
  • Each coded data block part contains several coded data blocks, and each coded data block has a one-to-one correspondence with the h coding header block.
  • the storage format of the coded data block is divided into two types: a packing format and an unpacking format.
  • the encoded data block is composed of encoded data, and the size of the encoded data is equal to the encoded size of the data to be encoded in the data block to be encoded.
  • the coded data blocks are tightly stored, and each coded data block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the data block to be coded. That is, the space occupied by the encoded data block is the actual size of the data block to be encoded after encoding.
  • the coded data block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be coded.
  • each coded data block in the unpacked format, is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be coded. That is, each coded data block occupies the same space and is equal to the size of a complete data block to be coded before coding.
  • the former part is encoded data
  • the latter part is reserved padding data.
  • the coded data block is composed of coded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block.
  • the coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block.
  • the coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.
  • the codec when it determines multiple coding regions in the source data according to different coding instructions, it may divide a complete source data block into multiple source data sub-blocks. Among them, the encoding area corresponding to each encoding instruction is on the adjacent side, and either all encode complete source data blocks, and the source data blocks do not overlap each other; or each encode a part of the same source data block (that is, the source data Sub-block), and the boundary of each source data sub-block within the source data block exactly overlaps.
  • the four coding regions determined by the four coding instructions in the source data divide a part of the source data block (represented by gray diagonal squares) into multiple source data sub-blocks, each of the same source data block The boundaries of the source data sub-blocks exactly overlap.
  • the codec encodes each source data sub-block in the same source data block according to different coding instructions to obtain the coded data sub-block.
  • the codec stores the coded data sub-blocks corresponding to multiple source data sub-blocks in the same source data block, the coded data sub-blocks may be stored in the same coded data block. In this way, multiple coding instructions can be realized to complete the splicing of specific coding regions.
  • the effect is exactly the same as that of coding through one coding command, and the execution order of these coding commands can be executed arbitrarily or even concurrently, so that in the multi-core source data division and single When the core is divided into blocks for pipeline execution, the coding task can be divided.
  • a source data block is divided into two parts in both low and high dimensions, so that the source data block is divided into 4 source data sub-blocks, namely TL (top-left), TR (top-right), BL (bottom-left) and BR (bottom-right).
  • the size of each source data sub-block is shown in Figure 12A.
  • the codec can be specified by the four parameters of block left, block right, block top, and block bottom in the source data block.
  • Each source data sub-block can be encoded data or non-encoded data.
  • the 4 source data sub-blocks corresponding to the 4 coded data sub-blocks can be stored in a fixed order of TL-TR-BL-BR, and each coded data sub-block is filled with coded data and Data composition, the sum of the size of the encoded data and the size of the padding data is equal to the size of the source data sub-block. That is, the space occupied by each coded data sub-block is the size of the source data sub-block corresponding to the coded data sub-block before coding.
  • the space of the coded data block is the same as the size of the source data block, thus ensuring that if each source data sub-block of the source data block is coded by a different coding instruction, each coding instruction can be divided according to the information (can be Calculate the address of the sub-block of encoded data in charge by calculating the instruction domain, so as to realize the splicing of the results of multiple encoding instructions.
  • the codec can convert the coded data block in the non-packed format into the coded data block in the packed format by means such as a code move (Move).
  • each coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block.
  • the coded data sub-blocks are tightly stored, and the starting address of each coded data sub-block needs to be accumulated according to the actual size of the previous coded data sub-blocks.
  • the space occupied by the entire coded data block is all the coded data sub-blocks. The sum of the sizes.
  • a source data block is divided into two parts in a high dimension, so that the source data block is divided into two source data sub-blocks, namely TL and BL, or BL and BR.
  • a source data block is divided into two parts in a low dimension, so that the source data block is divided into two source data sub-blocks, namely TL and TR, or TR and BR.
  • a source data block is not divided into low-dimensional and high-dimensional. There is only one source data sub-block, and the source data sub-block can be TL, TR, BL, or BR. As shown in Figure 12D, one source data block has only one source data sub-block TL.
  • the codec performs shuffling processing on the data block to be encoded, if it detects that the total encoding length of the stream block to be encoded in each first shuffling group is greater than the original length of the data block to be encoded, the encoding process of the data block to be encoded is terminated. Then the codec can resend the request to read the data block to be encoded, and the read data block to be encoded does not need to be encoded and stored directly.
  • the codec may also terminate the encoding process of the data block to be encoded if it detects that the encoding length output by the encoding process is greater than the size of the data block to be encoded when encoding the data block to be encoded.
  • the embodiment of the present application provides a shuffling method.
  • the codec determines at least one first shuffling group corresponding to the data block to be encoded according to the first shuffling level.
  • the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one coded stream. Then, the codec determines the encoding length of each first shuffling unit, and according to the encoding length of each first shuffling unit, in each first shuffling unit, determines the output shuffling unit and the input shuffling unit.
  • the codec sends the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream block to be coded in the input shuffle unit to pass the input shuffle unit
  • the first stream block to be encoded is encoded according to a preset encoding algorithm. In this way, by shuffling each coded stream of the data block to be coded, it is possible to ensure that the coded lengths of the coded streams are similar, thereby avoiding excessive complements due to alignment requirements between the coded streams, thereby reducing the coding rate. At the same time, it can also avoid the deadlock situation between each coded stream.
  • the embodiment of the present application also provides a shuffling method, which is applied to the decoding process. As shown in Figure 13, the specific steps are as follows:
  • Step 1301 Determine at least one first shuffling group corresponding to the data block to be decoded according to the first shuffling level.
  • the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one decoded stream.
  • the codec determines at least one first shuffling group corresponding to the data block to be decoded as follows: the codec obtains multiple decoding streams corresponding to the data block to be decoded, and according to the first shuffling level, the codec obtains multiple decoding streams corresponding to the data block to be decoded.
  • a shuffling level dividing the multiple decoded streams into multiple first shuffling units, and dividing the multiple first shuffling units into at least one first shuffling group.
  • the first shuffle unit includes at least one decoded stream
  • the first shuffle group includes a plurality of first shuffle units.
  • step 1301 The processing procedure of step 1301 is similar to the processing procedure of step 501, and will not be repeated here.
  • Step 1302 Determine the code length of each first shuffling unit.
  • the codec determines the total code length of the stream block to be decoded in the decoded stream contained in the first shuffle unit as the The code length of the first shuffling unit.
  • the codec may also determine the total code length of the stream block to be decoded and the decoded stream block in the decoded stream contained in the first shuffling unit as the first shuffling The encoding length of the unit.
  • step 1302 is similar to the processing procedure of step 502, and will not be repeated here.
  • Step 1303 Determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit.
  • step 1303 is similar to the processing procedure of step 503, and will not be repeated here.
  • the codec determines the output shuffling unit and the input shuffling unit in each first shuffling unit according to the coding length of each first shuffling unit as follows:
  • Step 1401 Determine the shuffling type of each first shuffling unit according to the code length of each first shuffling unit.
  • the codec can determine the shuffling type of each first shuffling unit in various ways according to the encoding length of each first shuffling unit.
  • the embodiment of the present application provides two feasible ways, which are specifically as follows :
  • the codec can determine the first shuffling unit's encoding length according to the first difference between the encoding length of the first shuffling unit and the encoding lengths of other first shuffling units.
  • Shuffle type The specific process is as follows:
  • Step 1 For each first shuffle unit in each first shuffle unit, determine a first difference between the code length of the first shuffle unit and the code lengths of other first shuffle units.
  • each shuffle unit contains a decoded stream as an example, the code length of decoded stream 1 is N+5, and decoded stream 2
  • the encoding length of decoded stream 3 is N+9
  • the encoding length of decoded stream 3 is N
  • the encoding length of decoded stream 4 is N+3, and N is a positive integer
  • the first difference corresponding to decoded stream 1 is ⁇ -4, 5, 2 ⁇
  • the first difference corresponding to decoded stream 2 is ⁇ 4, 9, 6 ⁇
  • the first difference corresponding to decoded stream 3 is ⁇ -5, -9, -3 ⁇
  • the first difference corresponding to decoded stream 4 The value is ⁇ -2, -6, 3 ⁇ .
  • Step 2 Determine the shuffling type of the first shuffling unit according to the first difference corresponding to the first shuffling unit.
  • Step 3 If there is a target difference value in the first difference value corresponding to the first shuffle unit whose absolute value is greater than or equal to the first preset difference value threshold, and the target difference values are all positive numbers, then the first difference value is determined
  • the shuffling type of the washing unit is a high coding type.
  • the first preset difference threshold is 7, and the shuffling type of the decoded stream 2 is H.
  • Step 4 If there is a target difference in the first difference corresponding to the first shuffle unit whose absolute value is greater than or equal to the first preset difference threshold, and there is a negative target difference in the target difference, then determine the The shuffling type of the first shuffling unit is a low coding type.
  • the first preset difference threshold is 7, and the shuffling type of the decoded stream 3 is L.
  • Step 5 If there is no target difference with an absolute value greater than or equal to the first preset difference threshold in the first difference corresponding to the first shuffle unit, determine that the shuffle type of the first shuffle unit is medium Encoding type.
  • the first preset difference threshold is 7
  • the shuffling type of the decoded stream 1 and the decoded stream 4 is M.
  • the codec may determine the shuffling type of the first shuffling unit according to the second difference between the code length of the first shuffling unit and the average code length. The specific process is as follows:
  • Step 1 Determine the average code length according to the code length of each first shuffling unit.
  • Step 2 For each first shuffle unit in each first shuffle unit, determine a second difference between the code length of the first shuffle unit and the average code length.
  • Step 3 Determine the shuffling type of the first shuffling unit according to the second difference value corresponding to the first shuffling unit.
  • Step 4 If the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, then determine the shuffle of the first shuffle unit
  • the type is a high encoding type.
  • Step 5 If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, determine the shuffling type of the first shuffling unit It is a low encoding type.
  • Step 6 If the absolute value of the second difference value corresponding to the first shuffling unit is smaller than the second preset difference value threshold, it is determined that the shuffling type of the first shuffling unit is a medium coding type.
  • step 1401 is similar to the processing procedure of step 601, and will not be repeated here.
  • Step 1402 Determine an output shuffle unit and an input shuffle unit corresponding to each output shuffle unit in each first shuffle unit according to the shuffle type of each first shuffle unit and preset shuffle rules.
  • the codec determines the output shuffle unit and the input corresponding to each output shuffle unit in each first shuffle unit according to the shuffle type of each first shuffle unit and preset shuffle rules.
  • the processing process of the shuffling unit is as follows:
  • Step 1 If the first number of the first target shuffling units of the high decoding type is greater than the second number of the second target shuffling units of the low decoding type, the second target shuffling unit is determined as the output shuffling unit, and For each output shuffle unit, in the first target shuffle unit, at least one first target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
  • Step 2 If the first number of the first target shuffling units of the high decoding type is less than or equal to the second number of the second target shuffling units of the low decoding type, the first number of second target shuffling units are determined as Output shuffle units, and for each output shuffle unit, in the first target shuffle unit, at least one first target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
  • step 1402 is similar to the processing procedure of step 602, and will not be repeated here.
  • Step 1304 Send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit, so as to pass the input shuffle unit according to the pre-shuffled stream blocks.
  • the decoding algorithm decodes the first stream block to be decoded.
  • the second preset number of stream blocks to be shuffled in the output shuffle unit are sent to the input shuffle unit corresponding to the output shuffle unit as the input shuffle unit
  • the first stream block to be decoded in the unit is sent to the input shuffle unit corresponding to the output shuffle unit.
  • each shuffle unit contains a decoded stream as an example.
  • the shuffle type of decoded stream 1 to decoded stream 4 is MHLM
  • Decoding stream 3 is the output shuffling unit
  • decoding stream 2 is the input shuffling unit of decoded stream 3.
  • decoded stream 1 can output 1 block to be shuffled to decoded stream 1
  • decoded stream 3 can output 1 to decoded stream 2.
  • the decoding stream 4 can output one stream block to be shuffled to the decoding stream 4.
  • the encoding length of decoded stream 1 is N+8, the encoding length of decoded stream 2 is N+9, the encoding length of decoded stream 3 is N+3, and the encoding of decoded stream 4 is N+3.
  • the length is N+6, and the shuffling type from decoded stream 1 to decoded stream 4 is MMMM.
  • step 1304 is similar to the processing procedure of step 504, and will not be repeated here.
  • the codec determines at least one second shuffling group corresponding to the data block to be decoded according to the second shuffling level.
  • the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one decoded stream. Then, the codec re-shuffles the stream blocks to be decoded in each second shuffle unit as the stream blocks to be shuffled, until the code length of each second shuffle unit meets the preset proximity condition.
  • the codec may further determine at least one second corresponding to the data block to be decoded according to the second shuffling level.
  • Shuffle group wherein, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one decoded stream.
  • the process of the codec determining at least one second shuffling group corresponding to the data block to be decoded according to the second shuffling level is similar to step 1301, and will not be repeated here.
  • the codec may re-shuffle the stream blocks to be decoded in each second shuffle unit as the stream blocks to be shuffled, until the code length of each second shuffle unit meets the preset proximity condition.
  • the codec may further shuffle the decoded stream corresponding to the data block to be decoded according to the third shuffling level.
  • the codec can shuffle the decoded stream corresponding to the data block to be decoded according to shuffle level 1-shuffle level 2-shuffle level 3, or according to shuffle level 1-shuffle level 3-shuffle level 2
  • the decoded stream corresponding to the data block to be decoded is shuffled, and the decoded stream corresponding to the data block to be decoded can also be shuffled according to the shuffling level 2-shuffling level 3-shuffling level 1.
  • the codec detects that the decoding of the first decoded stream among the multiple decoded streams is completed, the second preset number of undecoded second decoded streams among the multiple decoded streams
  • the stream block to be decoded is sent to the first decoded stream as the stream block to be decoded in the first decoded stream.
  • the third preset number may be pre-stored in the codec.
  • the third preset number can be set by a technician based on experience.
  • the codec detects that the decoding of the first decoded stream in the multiple decoded streams is completed (that is, the first decoded stream outputs the decoded stream end (StreamFinish) mark), it can decode the uncompleted second decoded in the multiple decoded streams
  • the third preset number of stream blocks to be decoded in the stream are sent to the first decoded stream as the stream blocks to be decoded in the first decoded stream.
  • the second decoded stream may be all undecoded decoded streams of the multiple decoded streams, or may be part of the undecoded decoded streams of the multiple decoded streams.
  • processing procedure for the codec to obtain the decoded stream is as follows:
  • Step 1 Obtain the encoding header data corresponding to the data to be decoded.
  • the codec uses a header-data block mapping form for storage.
  • the codec needs to first obtain the encoding header data corresponding to the data to be decoded.
  • the encoding header data format is a two-dimensional format, the low dimension is X, the high dimension Y, and the size of the encoding header data is the low dimension encoding header size (head size X) * high dimension encoding header size (head size Y) ).
  • the encoding header data can be further divided into a plurality of encoding header blocks evenly in two dimensions.
  • Step 2 According to the received decoding instruction, in the encoding header data, a decoding area containing at least one encoding header block corresponding to the decoding instruction is determined, and at least one to-be-decoded data block corresponding to the at least one encoding header block is obtained.
  • the encoding header block contains the storage address of the encoded data block corresponding to the encoding header block.
  • the codec can determine the decoding area containing at least one coded header block corresponding to the decoded instruction in the coded header data according to the received decoding instruction.
  • the start address of the decoding area is the head start position of the encoding head, which can be obtained by the low-dimensional encoding head offset (head offset X) and the high-dimensional encoding head offset (head offset Y).
  • the decoding area includes the number of low-dimensional encoding headers (head number X) encoding header blocks in the low-dimensional direction, and the number of high-dimensional encoding headers (head number Y) encoding header blocks in the high-dimensional direction.
  • the encoding header block contains the storage address of the encoded data block corresponding to the encoding header block.
  • Step 3 For each data block to be decoded in at least one data block to be decoded, the data block to be decoded is divided into multiple stream blocks, and the multiple stream blocks are sent to multiple decodes corresponding to the data block to be decoded Stream, as a stream block to be shuffled in multiple decoded streams.
  • the codec can decode the same data block to be decoded in parallel through multiple decoding streams.
  • the codec can divide the data block to be decoded into multiple stream blocks, and send the multiple stream blocks to the data block to be decoded
  • the corresponding multiple decoded streams are used as stream blocks to be shuffled in the multiple decoded streams.
  • the codec may divide the data block to be decoded into multiple row sequences, and each row sequence contains at least one data sub-block to be decoded.
  • the codec may divide the sub-block of data to be decoded into multiple stream blocks. In this way, it can be ensured that the number of stream blocks in each decoded stream is close.
  • the data block to be decoded is composed of encoded data, and the size of the encoded data is equal to the encoded size of the data to be encoded in the data block to be encoded.
  • the decoded data blocks are tightly stored, and each decoded data block is composed of encoded data, and the size of the encoded data is equal to the encoded size of the data to be encoded in the data block to be encoded. That is, the space occupied by the decoded data block is the actual size of the data block to be encoded after encoding.
  • the data block to be decoded is composed of encoded data and padding data, and the sum of the size of the encoded data and the size of the padding data is equal to the size of the data block to be encoded.
  • each decoded data block is composed of encoded data and padding data, and the sum of the size of the encoded data and the size of the padding data is equal to the size of the data block to be encoded. That is, each decoded data block occupies the same space and is equal to the size of a complete data block to be encoded before encoding. Among them, the former part is encoded data, and the latter part is reserved padding data.
  • the data block to be decoded is composed of encoded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block.
  • the coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block.
  • the coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.
  • the codec when it determines multiple coding regions in the source data according to different coding instructions, it may divide a complete source data block into multiple source data sub-blocks. Among them, the encoding area corresponding to each encoding instruction is on the adjacent side, and either all encode complete source data blocks, and the source data blocks do not overlap each other; or each encode a part of the same source data block (that is, the source data Sub-block), and the boundary of each source data sub-block within the source data block exactly overlaps.
  • the four coding regions determined by the four coding instructions in the source data divide a part of the source data block (represented by gray diagonal squares) into multiple source data sub-blocks, each of the same source data block The boundaries of the source data sub-blocks exactly overlap.
  • the codec encodes each source data sub-block in the same source data block according to different coding instructions to obtain the coded data sub-block.
  • the codec stores the coded data sub-blocks corresponding to multiple source data sub-blocks in the same source data block, the coded data sub-blocks may be stored in the same coded data block. In this way, multiple coding instructions can be realized to complete the splicing of specific coding regions.
  • the effect is exactly the same as that of coding through one coding command, and the execution order of these coding commands can be executed arbitrarily or even concurrently, so that in the multi-core source data division and single When the core is divided into blocks for pipeline execution, the coding task can be divided.
  • a source data block is divided into two parts in both low and high dimensions, so that the source data block is divided into 4 source data sub-blocks, namely TL (top-left), TR (top-right), BL (bottom-left) and BR (bottom-right).
  • the size of each source data sub-block is shown in Figure 12A.
  • the codec can be specified by the four parameters of block left, block right, block top, and block bottom in the source data block.
  • Each source data sub-block can be encoded data or non-encoded data.
  • the 4 source data sub-blocks corresponding to the 4 coded data sub-blocks can be stored in a fixed order of TL-TR-BL-BR, and each coded data sub-block is filled with coded data and Data composition, the sum of the size of the encoded data and the size of the padding data is equal to the size of the source data sub-block. That is, the space occupied by each coded data sub-block is the size of the source data sub-block corresponding to the coded data sub-block before coding.
  • the space of the coded data block is the same as the size of the source data block, thus ensuring that if each source data sub-block of the source data block is coded by a different coding instruction, each coding instruction can be divided according to the information (can be Calculate the address of the sub-block of encoded data in charge by calculating the instruction domain, so as to realize the splicing of the results of multiple encoding instructions.
  • the codec can convert the coded data block in the non-packed format into the coded data block in the packed format by means such as a code move (Move).
  • each coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block.
  • the coded data sub-blocks are tightly stored, and the starting address of each coded data sub-block needs to be accumulated according to the actual size of the previous coded data sub-blocks.
  • the space occupied by the entire coded data block is all the coded data sub-blocks. The sum of the sizes.
  • a source data block is divided into two parts in a high dimension, so that the source data block is divided into two source data sub-blocks, namely TL and BL, or BL and BR.
  • a source data block is divided into two parts in a low dimension, so that the source data block is divided into two source data sub-blocks, namely TL and TR, or TR and BR.
  • a source data block is not divided into low-dimensional and high-dimensional. There is only one source data sub-block, and the source data sub-block can be TL, TR, BL, or BR. As shown in Figure 12D, one source data block has only one source data sub-block TL.
  • the data partition during decoding may be different from that during encoding.
  • the data partition of the decoding instruction is not aligned with the partition of the encoded data block, there will be a boundary data block during encoding.
  • the boundary data block if it has only TL Part, then if this part is the unencoded source data form, then you can read only the required part, if it is the encoded encoded data form, then you need to decompress the entire encoded data block, and only write the required part to Destination address.
  • the boundary data block itself contains four parts and is different from the division during encoding, then there will be another division of the 4 encoded data sub-blocks.
  • the solid-line frame represents the data division during encoding
  • the dashed frame represents the data division during decoding.
  • Their division points are different, so that the data block to be decoded during decoding may be an encoded data block.
  • a part, such as the TL block represented by the left-slashed square, may also be formed by concatenating parts of up to 4 sub-data blocks, such as the BR block represented by the vertical square.
  • the embodiment of the present application provides a shuffling method.
  • the codec determines at least one first shuffling group corresponding to the data block to be decoded according to the first shuffling level.
  • the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one decoded stream.
  • the codec determines the encoding length of each first shuffling unit, and according to the encoding length of each first shuffling unit, in each first shuffling unit, determines the output shuffling unit and the input shuffling unit.
  • the codec sends the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream block to be decoded in the input shuffle unit to pass the input shuffle unit
  • the first stream block to be decoded is decoded according to a preset decoding algorithm. In this way, by shuffling the decoded streams of the data block to be decoded, it is possible to ensure that the encoding lengths of the decoded streams are similar, so as to avoid excessive complements due to alignment requirements between the decoded streams, thereby reducing the decoded stream. At the same time, it can also avoid deadlocks between each decoded stream.
  • the embodiment of the present application also provides a shuffling device. As shown in FIG. 21, the device includes:
  • the first determining module 2110 is configured to determine at least one first shuffle group corresponding to the data block to be encoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes At least one coded stream;
  • the second determining module 2120 is configured to determine the code length of each first shuffling unit
  • the third determining module 2130 is configured to determine the output shuffle unit and the input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
  • the sending module 2140 is used to send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream block to be coded in the input shuffle unit to pass the input shuffle
  • the unit encodes the first stream block to be encoded according to a preset encoding algorithm.
  • the embodiment of the present application also provides a shuffling device. As shown in FIG. 22, the device includes:
  • the first determining module 2210 is configured to determine at least one first shuffle group corresponding to the data block to be decoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes At least one decoded stream;
  • the second determining module 2220 is configured to determine the code length of each first shuffling unit
  • the third determining module 2230 is configured to determine the output shuffle unit and the input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
  • the sending module 2240 is used to send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream block to be decoded in the input shuffle unit to pass the input shuffle
  • the unit decodes the first stream block to be decoded according to a preset decoding algorithm.
  • a computer device including a memory and a processor, the memory stores a computer program that can run on the processor, and the processor executes the computer program When realizing the above-mentioned shuffling method steps.
  • a computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned shuffling method are realized.
  • a chip system includes a processor, the processor is coupled to a memory, the memory stores program instructions, and the above shuffling is implemented when the program instructions stored in the memory are executed by the processor method.
  • steps in the flowcharts of FIGS. 2-4 are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order for the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in Figures 2-4 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. These sub-steps or stages The execution order of is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
  • the above device embodiments are only illustrative, and the device of the present disclosure may also be implemented in other ways.
  • the division of units/modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation.
  • multiple units, modules or components may be combined or integrated into another system, or some features may be omitted or not implemented.
  • the functional units/modules in the various embodiments of the present disclosure may be integrated into one unit/module, or each unit/module may exist alone physically, or two or more units/modules may exist.
  • the modules are integrated together.
  • the above-mentioned integrated unit/module can be implemented in the form of hardware or software program module.
  • the hardware may be a digital circuit, an analog circuit, and so on.
  • the physical realization of the hardware structure includes but is not limited to transistors, memristors and so on.
  • the artificial intelligence processor may be any appropriate hardware processor, such as CPU, GPU, FPGA, DSP, ASIC, and so on.
  • the storage unit may be any suitable magnetic storage medium or magneto-optical storage medium, such as RRAM (Resistive Random Access Memory), DRAM (Dynamic Random Access Memory), Static random access memory SRAM (Static Random-Access Memory), enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), high-bandwidth memory HBM (High-Bandwidth Memory), hybrid storage cube HMC (Hybrid Memory Cube), etc. Wait.
  • RRAM Resistive Random Access Memory
  • DRAM Dynamic Random Access Memory
  • Static random access memory SRAM Static Random-Access Memory
  • enhanced dynamic random access memory EDRAM Enhanced Dynamic Random Access Memory
  • high-bandwidth memory HBM High-Bandwidth Memory
  • hybrid storage cube HMC Hybrid Memory Cube
  • the integrated unit/module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer readable memory.
  • the technical solution of the present disclosure essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory. It contains a number of instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present disclosure.
  • the aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
  • Clause A1 corresponding right 1; clause A2, corresponding right 2; clause A3, corresponding right 3; clause A4, corresponding right 4; clause A5, corresponding right 5; clause A6, corresponding right 6; clause A7, corresponding right 7; clause A8, corresponding right 8; clause A9, corresponding right 9; clause A10, corresponding right 10; clause A11, corresponding right 11; clause A12, corresponding right 12; clause A13, corresponding right 13; clause A14, corresponding right 14; clause A15 , Correspondence Rights 15; Clause A16, Correspondence Rights 16; Clause A17, Correspondence Rights 17; Clauses A18, Correspondence Rights 18; Clauses A19, Correspondence Rights 19; Clauses A20, Correspondence Rights 20; Correspondence Rights 22; Clause A23, Correspondence Rights 23; Clauses A24, Correspondence Rights 24; Clauses A25, Correspondence Rights 25; Clauses A26, Correspondence Rights 26; Clauses A27, Correspondence Rights 27;
  • clause A1 a shuffling method, the method includes:
  • the first shuffling level at least one first shuffle group corresponding to the data block to be encoded is determined, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one coded stream ;
  • the shuffling unit encodes the first stream block to be encoded according to a preset encoding algorithm.
  • the method according to clause A1 includes:
  • the multiple encoded streams are divided into multiple first shuffling units, and the multiple first shuffling units are divided into at least one first shuffling group.
  • the shuffling unit includes at least one coded stream, and the first shuffling group includes a plurality of first shuffling units.
  • the determining the coding length of each first shuffling unit includes:
  • each first shuffle unit in each first shuffle group determines the total code length of the stream block to be coded in the coded stream contained in the first shuffle unit as the code of the first shuffle unit length.
  • each of the first shuffling units an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit are determined ;
  • the sending the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be coded in the input shuffle unit includes:
  • the second preset number of stream blocks to be shuffled in the output shuffle unit are sent to the input shuffle unit corresponding to the output shuffle unit as the first in the input shuffle unit.
  • a stream block to be encoded is sent to the input shuffle unit corresponding to the output shuffle unit as the first in the input shuffle unit.
  • each first shuffling unit in each of the first shuffling units determine a first difference between the code length of the first shuffling unit and the code lengths of other first shuffling units;
  • the shuffling type of the first shuffling unit is determined according to the first difference corresponding to the first shuffling unit.
  • the shuffling type of the unit is a high coding type
  • the shuffling type of a shuffling unit is a low coding type.
  • the shuffling type of the first shuffling unit is a medium coding type.
  • the shuffling type of the first shuffling unit is determined according to the second difference value corresponding to the first shuffling unit.
  • the shuffling type of the first shuffling unit is determined High coding type
  • the shuffling type of the first shuffling unit is Low encoding type.
  • the shuffling type of the first shuffling unit is a medium coding type.
  • the first target shuffle unit is determined as the output shuffle unit, and the For each output shuffle unit, in the second target shuffle unit, determine at least one second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit;
  • first number of first target shuffle units of the high coding type is greater than the second number of second target shuffle units of the low coding type, then the second number of first target shuffle units are determined as output shuffle units, And for each output shuffle unit, in the second target shuffle unit, at least one second target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
  • the encoding area corresponding to the encoding instruction is determined, the encoding area includes at least one data block to be encoded, and the data block to be encoded is a source data block or a source data sub Piece;
  • each to-be-coded data block in the at least one to-be-coded data block divides the to-be-coded data block into multiple stream blocks, and send the multiple stream blocks to a plurality of corresponding to the to-be-coded data block
  • the coded stream is used as a stream block to be shuffled in the multiple coded streams.
  • the fourth preset number of to-be-encoded stream blocks in the second encoded streams that have not been encoded in the plurality of encoded streams are sent to the first
  • the coded stream is used as the stream block to be coded in the first coded stream.
  • the coding process of the to-be-coded data block is terminated.
  • Clause A15 The method according to clause A1, the method comprising:
  • the second shuffle level determine at least one second shuffle group corresponding to the data block to be encoded, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one coded stream ;
  • the stream block to be coded in each second shuffling unit is used as the stream block to be shuffled to perform shuffling again until the code length of each second shuffling unit meets the preset proximity condition.
  • the first encoded data is encoded according to a preset second encoding rule.
  • Clause A18 The method according to clause A17, wherein the coded data block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the data block to be coded; or,
  • the coded data block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be coded.
  • Clause A19 The method according to clause A17, wherein the coded data block is composed of coded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block;
  • the coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block; or,
  • the coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.
  • a shuffling method comprising:
  • the first shuffle level determine at least one first shuffle group corresponding to the data block to be decoded, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one decoded stream ;
  • the shuffling unit decodes the first stream block to be decoded according to a preset decoding algorithm.
  • the multiple decoded streams are divided into multiple first shuffling units, and the multiple first shuffling units are divided into at least one first shuffling group.
  • the shuffle unit includes at least one decoded stream, and the first shuffle group includes a plurality of first shuffle units.
  • the determining the coding length of each first shuffling unit includes:
  • each first shuffle unit in each first shuffle group determines the total code length of the stream block to be decoded in the decoded stream contained in the first shuffle unit as the code of the first shuffle unit length.
  • each of the first shuffling units an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit are determined ;
  • the sending the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit includes:
  • the second preset number of stream blocks to be shuffled in the output shuffle unit are sent to the input shuffle unit corresponding to the output shuffle unit as the first in the input shuffle unit.
  • a stream block to be decoded is sent to the input shuffle unit corresponding to the output shuffle unit as the first in the input shuffle unit.
  • each first shuffling unit in each of the first shuffling units determine a first difference between the code length of the first shuffling unit and the code lengths of other first shuffling units;
  • the shuffling type of the first shuffling unit is determined according to the first difference corresponding to the first shuffling unit.
  • the shuffling type of the unit is a high coding type
  • the shuffling type of a shuffling unit is a low coding type.
  • the shuffling type of the first shuffling unit is a medium coding type.
  • each first shuffling unit in each of the first shuffling units determine a second difference between the coding length of the first shuffling unit and the average coding length
  • the shuffling type of the first shuffling unit is determined according to the second difference value corresponding to the first shuffling unit.
  • the shuffling type of the first shuffling unit is determined High coding type
  • the shuffling type of the first shuffling unit is Low encoding type.
  • the shuffling type of the first shuffling unit is a medium coding type.
  • the second target shuffling unit is determined to be the output shuffling unit, and for each An output shuffle unit, in the first target shuffle unit, determining at least one first target shuffle unit as the input shuffle unit corresponding to the output shuffle unit;
  • the first number of the first target shuffling units of the high decoding type is less than or equal to the second number of the second target shuffling units of the low decoding type
  • the first number of second target shuffling units are determined as output shuffling Unit, and for each output shuffle unit, in the first target shuffle unit, at least one first target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
  • the encoding header data determines a decoding area containing at least one encoding header block corresponding to the decoding instruction, and obtaining at least one to-be-decoded data block corresponding to the at least one encoding header block,
  • the encoding header block contains the storage address of the encoded data block corresponding to the encoding header block;
  • each to-be-decoded data block in the at least one to-be-decoded data block divides the to-be-decoded data block into multiple stream blocks, and send the multiple stream blocks to multiple corresponding to the to-be-decoded data block
  • the decoded stream is used as the stream block to be shuffled in the multiple decoded streams.
  • Clause A32 The method according to clause A31, wherein the data block to be decoded is composed of encoded data, and the size of the encoded data is equal to the encoded size of the data to be encoded in the data block to be encoded; or,
  • the data block to be decoded is composed of encoded data and padding data, and the sum of the size of the encoded data and the size of the padding data is equal to the size of the data block to be encoded.
  • Clause A33 The method according to clause A31, wherein the data block to be decoded is composed of encoded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block;
  • the coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block; or,
  • the coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.
  • the second preset number of to-be-decoded stream blocks in the second decoded streams that have not been decoded in the plurality of decoded streams are sent to the first decoded stream.
  • the decoded stream is used as the stream block to be decoded in the first decoded stream.
  • the second shuffle level determine at least one second shuffle group corresponding to the data block to be decoded, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one decoded stream ;
  • the stream block to be decoded in each second shuffling unit is used as the stream block to be shuffled to perform shuffling again until the code length of each second shuffling unit meets the preset proximity condition.
  • a shuffling device comprising:
  • the first determination module is configured to determine at least one first shuffle group corresponding to the data block to be encoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit
  • the washing unit contains at least one coded stream;
  • the second determining module is used to determine the code length of each first shuffling unit
  • a third determining module configured to determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
  • a sending module configured to send a first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be coded in the input shuffle unit,
  • the first stream block to be encoded is encoded by the input shuffling unit according to a preset encoding algorithm.
  • a shuffling device comprising:
  • the first determining module is configured to determine at least one first shuffle group corresponding to the data block to be decoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit
  • the washing unit contains at least one decoding stream;
  • the second determining module is used to determine the code length of each first shuffling unit
  • a third determining module configured to determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
  • a sending module configured to send a first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit,
  • the first stream block to be decoded is decoded by the input shuffling unit according to a preset decoding algorithm.
  • a computer device including a memory and a processor, the memory stores a computer program that can run on the processor, and the processor implements any one of clauses A1 to A19 when the computer program is executed The steps of the method.
  • Clause A39 A computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in any one of clauses A1 to A19.
  • a chip system including a processor, the processor is coupled to a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the claim clauses A1 to are implemented The method described in any one of A19.
  • a computer device comprising a memory and a processor, the memory stores a computer program that can run on the processor, and the processor implements any of claims A20 to A35 when the computer program is executed.
  • a chip system including a processor, the processor is coupled to a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, it implements claim clauses A20 to The method described in any one of A35.

Abstract

Provided are a shuffle method, apparatus, computer device, and readable storage medium. The method comprises: according to a first shuffle level, determining at least one first shuffle group corresponding to a data block to be encoded (S501), the first shuffle group containing a plurality of first shuffle units, the first shuffling units containing at least one encoded stream; determining the encoding length of each first shuffle unit (S502); according to the encoding length of each first shuffle unit, determining, in each of the first shuffling units, an output shuffle unit and an input shuffle unit (S503); sending a first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit, and taking same as a first stream block to be encoded in the input shuffle unit, so that the first stream block to be encoded is encoded by means of the input shuffle unit according to a preset encoding algorithm (S504).

Description

混洗方法、装置、计算机设备及可读存储介质Shuffle method, device, computer equipment and readable storage medium
本申请要求于2019年10月9日提交中国专利局的申请号为201910954846.1、名称为“混洗方法、装置、计算机设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on October 9, 2019 with the application number 201910954846. 1, titled "Shuffle method, device, computer equipment and readable storage medium", the entire content of which is incorporated by reference Incorporated in this application.
技术领域Technical field
本申请涉及计算机技术领域,特别是涉及一种混洗方法、装置、计算机设备及可读存储介质。This application relates to the field of computer technology, in particular to a shuffling method, device, computer equipment and readable storage medium.
背景技术Background technique
目前,SOC(System on a Chip,片上系统)中数据的编解码过程中,需要进行数据补齐,从而导致编解码率较高。因此,亟需一种可以降低编解码率的方案。At present, in the process of encoding and decoding data in a SOC (System on a Chip), data needs to be complemented, resulting in a high encoding and decoding rate. Therefore, there is an urgent need for a solution that can reduce the codec rate.
发明内容Summary of the invention
基于此,有必要针对上述技术问题,提供一种混洗方法、装置、计算机设备及可读存储介质。Based on this, it is necessary to provide a shuffling method, device, computer equipment, and readable storage medium in response to the above technical problems.
第一方面,提供了一种混洗方法,所述方法包括:In the first aspect, a shuffling method is provided, and the method includes:
根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个编码流;According to the first shuffling level, at least one first shuffle group corresponding to the data block to be encoded is determined, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one coded stream ;
确定各第一混洗单元的编码长度;Determine the code length of each first shuffling unit;
根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;Determine an output shuffle unit and an input shuffle unit in each of the first shuffle units according to the code length of each of the first shuffle units;
将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待编码流块,以通过所述输入混洗单元根据预设的编码算法对所述第一待编码流块进行编码。Send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be encoded in the input shuffle unit to pass the input The shuffling unit encodes the first stream block to be encoded according to a preset encoding algorithm.
第二方面,提供了一种混洗方法,所述方法包括:In a second aspect, a shuffling method is provided, and the method includes:
根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个解码流;According to the first shuffle level, determine at least one first shuffle group corresponding to the data block to be decoded, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one decoded stream ;
确定各第一混洗单元的编码长度;Determine the code length of each first shuffling unit;
根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;Determine an output shuffle unit and an input shuffle unit in each of the first shuffle units according to the code length of each of the first shuffle units;
将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待解码流块,以通过所述输入混洗单元根据预设的解码算法对所述第一待解码流块进行解码。Send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit to pass the input The shuffling unit decodes the first stream block to be decoded according to a preset decoding algorithm.
第三方面,提供了一种混洗装置,所述装置包括:In a third aspect, a shuffling device is provided, the device comprising:
第一确定模块,用于根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个编码流;The first determination module is configured to determine at least one first shuffle group corresponding to the data block to be encoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit The washing unit contains at least one coded stream;
第二确定模块,用于确定各第一混洗单元的编码长度;The second determining module is used to determine the code length of each first shuffling unit;
第三确定模块,用于根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;A third determining module, configured to determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
发送模块,用于将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待编码流块,以通过所述输入混洗单元根据预设的编码算法对所述第一待编码流块进行编码。A sending module, configured to send a first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be coded in the input shuffle unit, The first stream block to be encoded is encoded by the input shuffling unit according to a preset encoding algorithm.
第四方面,提供了一种混洗装置,所述装置包括:In a fourth aspect, a shuffling device is provided, the device comprising:
第一确定模块,用于根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个解码流;The first determining module is configured to determine at least one first shuffle group corresponding to the data block to be decoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit The washing unit contains at least one decoding stream;
第二确定模块,用于确定各第一混洗单元的编码长度;The second determining module is used to determine the code length of each first shuffling unit;
第三确定模块,用于根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;A third determining module, configured to determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
发送模块,用于将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待解码流块,以通过所述输入混洗单元根据预设的解码算法对所述第一待解码流块进行解码。A sending module, configured to send a first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit, The first stream block to be decoded is decoded by the input shuffling unit according to a preset decoding algorithm.
第五方面,提供了一种计算机设备,包含存储器及处理器,所述存储器上存储有可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现第一方面中任一项所述方法的步骤。In a fifth aspect, a computer device is provided, including a memory and a processor, the memory stores a computer program that can run on the processor, and when the processor executes the computer program, any one of the first aspect is implemented. The steps of the method described in item.
第六方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现第一方面中任一项所述的方法的步骤。In a sixth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method described in any one of the first aspects.
第七方面,提供了一种芯片系统,包含处理器,所述处理器和存储器耦合,所述存储器存储有程序指令,当所述存储器存储的程序指令被所述处理器执行时实现第一方面任一项所述的方法。In a seventh aspect, a chip system is provided, including a processor, the processor is coupled to a memory, the memory stores program instructions, and the first aspect is implemented when the program instructions stored in the memory are executed by the processor Any of the methods.
第八方面,提供了一种计算机设备,包含存储器及处理器,所述存储器上存储有可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现第二方面中任一项所述方法的步骤。In an eighth aspect, a computer device is provided, including a memory and a processor, the memory stores a computer program that can run on the processor, and when the processor executes the computer program, any one of the second aspects is implemented. The steps of the method described in item.
第九方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现第二方面中任一项所述的方法的步骤。In a ninth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the methods in the second aspect.
第十方面,提供了一种芯片系统,包含处理器,所述处理器和存储器耦合,所述存储器存储有程序指令,当所述存储器存储的程序指令被所述处理器执行时实现第二方面任一项所述的方法。In a tenth aspect, a chip system is provided, including a processor, the processor is coupled to a memory, the memory stores program instructions, and the second aspect is implemented when the program instructions stored in the memory are executed by the processor Any of the methods.
附图说明Description of the drawings
为了更好地描述和说明这里公开的实施例和/或示例,可以参考一幅或多幅附图。用于描述附图的附加细节或示例不应当被认为是对所公开的发明、目前描述的实施例和/或示例以及目前理解的这些发明的最佳模式中的任何一者的范围的限制。In order to better describe and explain the embodiments and/or examples disclosed herein, one or more drawings may be referred to. The additional details or examples used to describe the drawings should not be considered as limiting the scope of any of the disclosed inventions, the currently described embodiments and/or examples, and the best mode of these inventions currently understood.
图1为本申请实施例提供的一种编解码器的结构示意图;FIG. 1 is a schematic structural diagram of a codec provided by an embodiment of the application;
图2为本申请实施例提供的一种编码流的生成方法的流程示意图;2 is a schematic flowchart of a method for generating an encoded stream provided by an embodiment of the application;
图3为本申请实施例提供的一种源数据的示意图;FIG. 3 is a schematic diagram of a source data provided by an embodiment of this application;
图4A为本申请实施例提供的一种流块划分的示意图;FIG. 4A is a schematic diagram of stream block division according to an embodiment of this application;
图4B为本申请实施例提供的一种流块划分的示意图;FIG. 4B is a schematic diagram of a stream block division provided by an embodiment of this application;
图5为本申请实施例提供的一种混洗方法的流程示意图;FIG. 5 is a schematic flow chart of a shuffling method provided by an embodiment of the application;
图6为本申请实施例提供的一种确定输出/输入混洗单元的流程示意图;FIG. 6 is a schematic flow chart of determining an output/input shuffling unit according to an embodiment of the application;
图7A为本申请实施例提供的一种编码流的混洗前的示意图;FIG. 7A is a schematic diagram of a coded stream before shuffling according to an embodiment of the application;
图7B为本申请实施例提供的另一种编码流的混洗前的示意图;FIG. 7B is a schematic diagram of another coded stream before shuffling according to an embodiment of the application;
图8A为本申请实施例提供的一种编码流的混洗过程的示意图;FIG. 8A is a schematic diagram of a shuffling process of an encoded stream provided by an embodiment of the application; FIG.
图8B为本申请实施例提供的另一种编码流的混洗过程的示意图;FIG. 8B is a schematic diagram of another shuffling process of an encoded stream provided by an embodiment of the application;
图9A为本申请实施例提供的一种编码流的混洗完成的示意图;FIG. 9A is a schematic diagram of completion of shuffling of a coded stream provided by an embodiment of the application; FIG.
图9B为本申请实施例提供的另一种编码流的混洗完成的示意图;FIG. 9B is a schematic diagram of completion of shuffling of another coded stream provided by an embodiment of the application; FIG.
图10为本申请实施例提供的一种编码数据的示意图;FIG. 10 is a schematic diagram of coded data provided by an embodiment of this application;
图11为本申请实施例提供的一种源数据子块拼接的示意图;FIG. 11 is a schematic diagram of a source data sub-block splicing provided by an embodiment of this application;
图12A为本申请实施例提供的一种编码数据子块拼接的示意图;FIG. 12A is a schematic diagram of splicing coded data sub-blocks according to an embodiment of the application; FIG.
图12B为本申请实施例提供的一种编码数据子块拼接的示意图;FIG. 12B is a schematic diagram of splicing coded data sub-blocks according to an embodiment of this application;
图12C为本申请实施例提供的一种编码数据子块拼接的示意图;FIG. 12C is a schematic diagram of splicing coded data sub-blocks according to an embodiment of the application; FIG.
图12D为本申请实施例提供的一种编码数据子块拼接的示意图;FIG. 12D is a schematic diagram of sub-block splicing of encoded data provided by an embodiment of the application; FIG.
图13为本申请实施例提供的一种混洗方法的流程示意图;FIG. 13 is a schematic flow chart of a shuffling method provided by an embodiment of the application;
图14为本申请实施例提供的一种确定输出/输入混洗单元的流程示意图;FIG. 14 is a schematic flowchart of determining an output/input shuffling unit according to an embodiment of the application;
图15为本申请实施例提供的一种解码流混洗前的示意图;15 is a schematic diagram of a decoded stream before shuffling according to an embodiment of the application;
图16为本申请实施例提供的一种解码流混洗过程的示意图;FIG. 16 is a schematic diagram of a decoding stream shuffling process provided by an embodiment of this application;
图17为本申请实施例提供的一种解码流混洗完成的示意图;FIG. 17 is a schematic diagram of completion of shuffling of decoded streams provided by an embodiment of the application; FIG.
图18为本申请实施例提供的一种编码头数据的示意图;FIG. 18 is a schematic diagram of encoding header data provided by an embodiment of this application;
图19为本申请实施例提供的一种待解码时数据划分的示意图;FIG. 19 is a schematic diagram of data division when decoding is provided according to an embodiment of this application;
图20为本申请实施例提供的一种待解码时数据划分的示意图;FIG. 20 is a schematic diagram of data division when decoding is provided according to an embodiment of this application;
图21为本申请实施例提供的一种混洗装置的结构示意图;FIG. 21 is a schematic structural diagram of a shuffling device provided by an embodiment of the application;
图22为本申请实施例提供的一种混洗装置的结构示意图;Figure 22 is a schematic structural diagram of a shuffling device provided by an embodiment of the application;
图23为本申请实施例提供的一种计算机设备的结构示意图。FIG. 23 is a schematic structural diagram of a computer device provided by an embodiment of this application.
具体实施方式Detailed ways
下面将结合本披露实施例中的附图,对本披露实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本披露一部分实施例,而不是全部的实施例。基于本披露中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本披露保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present disclosure in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, but not all of the embodiments. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of this disclosure.
应当理解,本披露的权利要求、说明书及附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。本披露的说明书和权利要求书中使用的术语“包含”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that the terms "first", "second", "third" and "fourth" in the claims, specification and drawings of this disclosure are used to distinguish different objects, rather than to describe a specific order . The terms "comprising" and "comprising" used in the specification and claims of this disclosure indicate the existence of the described features, wholes, steps, operations, elements and/or components, but do not exclude one or more other features, wholes The existence or addition of, steps, operations, elements, components, and/or their collections.
还应当理解,在此本披露说明书中所使用的术语仅仅是出于描述特定实施例的目的,而并不意在限定本披露。如在本披露说明书和权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包含复数形式。还应当进一步理解,在本披露说明书和权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包含这些组合。It should also be understood that the terms used in this disclosure specification are only for the purpose of describing specific embodiments, and are not intended to limit the disclosure. As used in this disclosure and claims, unless the context clearly indicates other circumstances, the singular forms "a", "an" and "the" are intended to include plural forms. It should be further understood that the term "and/or" used in this disclosure specification and claims refers to any combination of one or more of the items listed in association and all possible combinations, and includes these combinations.
如在本说明书和权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in this specification and claims, the term "if" can be interpreted as "when" or "once" or "in response to determination" or "in response to detection" depending on the context. Similarly, the phrase "if determined" or "if detected [described condition or event]" can be interpreted as meaning "once determined" or "in response to determination" or "once detected [described condition or event]" depending on the context ]" or "in response to detection of [condition or event described]".
本申请实施例提供了一种混洗方法,该方法可以应用于编解码器(codec)。图1为本申请实施例提供的一种编解码器的系统架构图。如图1所示,该编解码器包含至少一个存储器和至少一个处理器。该至少一个存储器用于存储计算机程序。该至少一个处理器用于根据存储器中存储的计算机程序执行混洗方法,以保证各编码流的编码长度相近,从而避免由于各个编码流之间的对齐要求造成的补数过多,进而降低编码率。其中,该至少一个处理器可以包含IPU(Intelligent Processing Unit,智能处理器)、CPU(Central Processing Unit,中央处理器)和GPU(Graphics Processing Unit,图形处理器)中的一种或多种;该至少一个处理器可以为主从CT/LT架构中的处理器。The embodiment of the present application provides a shuffling method, which can be applied to a codec. FIG. 1 is a system architecture diagram of a codec provided by an embodiment of the application. As shown in Figure 1, the codec includes at least one memory and at least one processor. The at least one memory is used to store computer programs. The at least one processor is used to execute the shuffling method according to the computer program stored in the memory to ensure that the encoding lengths of the encoded streams are similar, so as to avoid excessive complements due to alignment requirements between the encoded streams, thereby reducing the encoding rate . Wherein, the at least one processor may include one or more of IPU (Intelligent Processing Unit), CPU (Central Processing Unit, central processing unit), and GPU (Graphics Processing Unit, graphics processing unit); At least one processor can be a master-slave processor in the CT/LT architecture.
为了便于理解,本申请实施例优先对本申请实施例提供的一种编码流的生成方法进行详细的说明。如图2所示,具体步骤如下:For ease of understanding, the embodiments of the present application give priority to a detailed description of a method for generating a coded stream provided by the embodiments of the present application. As shown in Figure 2, the specific steps are as follows:
步骤201,获取待编码的源数据。Step 201: Obtain source data to be encoded.
在实施中,当编译码器需要对源数据进行编码时,编译码器可以获取预先存储的待编码的源数据。如图3所示,源数据的格式为二维格式,低维为X,高维为Y,起始地址为数据地址(data address),源数据的大小为低维数据大小(data size X)*高维数据大小(data size Y),源数据的在低维上的步幅(stride)为低维数据步幅(data stride X)。源数据可以进一步在二维上均匀的划分为多个源数据块(block),如图3所示,每个方块表示一个源数据块,源数据块的大小为低维源数据块大小(block size X)*高维源数据块大小(block size Y),相邻两个源数据块之间的低维间隔为低维源数据块步幅(block stride X),高维间隔为高维源数据块步幅(block stride Y)。In implementation, when the codec needs to encode source data, the codec can obtain pre-stored source data to be encoded. As shown in Figure 3, the format of the source data is a two-dimensional format, the low-dimensional is X, the high-dimensional is Y, the starting address is the data address, and the size of the source data is the low-dimensional data size (data size X) *High-dimensional data size (data size Y), the stride of the source data in the low dimensionality (stride) is the low-dimensional data stride (data X). The source data can be further divided into multiple source data blocks evenly in two dimensions. As shown in Figure 3, each block represents a source data block, and the size of the source data block is the size of the low-dimensional source data block. size X)*High-dimensional source data block size (block size Y), the low-dimensional interval between two adjacent source data blocks is the low-dimensional source data block stride (block stride X), and the high-dimensional interval is the high-dimensional source data block stride (block stride Y).
步骤202,根据接收到的编码指令,在源数据中,确定编码指令对应的编码区域,编码区域包含至少一个待编码数据块,待编码数据块为源数据块或源数据子块。Step 202: According to the received encoding instruction, determine the encoding area corresponding to the encoding instruction in the source data, the encoding area contains at least one to-be-encoded data block, and the to-be-encoded data block is the source data block or the source data sub-block.
在实施中,编译码器获取到待编码的源数据后,可以根据接收到的编码指令,在源数据中,确定该编码指令对应的编码区域。其中,编码区域包含至少一个待编码数据块,待编码数据块为源数据块或源数据子块。如图3所示,虚线框为编码区域,该编码区域可以通过在源数据中指定低维方向上的低维偏移量(offset X)和指定高维方向上的高维偏移量(offset Y)得到。其中,该编码区域在低维方向上包含低维源数据块数目(block num X)个源数据块,在高维方向上包含高维源数据块数目(block num Y)个源数据块。该编码区域的起始地址(start address)为起始源数据块的地址。In implementation, after obtaining the source data to be encoded, the codec can determine the encoding region corresponding to the encoding instruction in the source data according to the received encoding instruction. The coding area contains at least one data block to be coded, and the data block to be coded is a source data block or a source data sub-block. As shown in Figure 3, the dashed frame is the coding area. The coding area can be specified by specifying the low-dimensional offset (offset X) in the low-dimensional direction and the high-dimensional offset (offset X) in the high-dimensional direction in the source data. Y) Obtained. Wherein, the coding region includes the number of low-dimensional source data blocks (block num X) source data blocks in the low-dimensional direction, and the high-dimensional source data block number (block num Y) source data blocks in the high-dimensional direction. The start address of the coding area is the address of the start source data block.
编解码器得到该编码指令对应的编码区域后,针对中央的源数据块(即图3中使用竖线方块表示的源数据块),编解码器可以直接对该源数据块进行编码。而对于边缘的源数据块(即图3中使用斜线方块表 示的源数据块),编解码器可以通过指定上(top)、下(bottom)、左(left)和右(right)四个参数在源数据块中确定源数据子块,并对确定出的源数据子块进行编码。After the codec obtains the coding region corresponding to the coding instruction, for the central source data block (ie, the source data block represented by the vertical square in FIG. 3), the codec can directly encode the source data block. For the source data block at the edge (ie the source data block represented by the diagonal square in Figure 3), the codec can specify the top, bottom, left and right four The parameter determines the source data sub-block in the source data block, and encodes the determined source data sub-block.
需要说明的是,除编码区域外,该源数据中的其他区域中的数据无需进行分块,其他区域中的数据的大小也无需对齐到源数据块的大小,低维偏移量、高维偏移量、低维源数据块步幅、高维源数据块步幅、低维源数据大小、高维源数据大小和低维源数据步幅也无需与低维源数据块大小或高维源数据块大小对齐。也即编解码器支持在源数据中任意地分块,并在得到的源数据块中任意取出编码区域进行编码。It should be noted that, except for the encoding area, the data in other areas of the source data does not need to be partitioned, and the size of the data in other areas does not need to be aligned to the size of the source data block, low-dimensional offset, high-dimensional The offset, low-dimensional source data block step size, high-dimensional source data block step size, low-dimensional source data size, high-dimensional source data size, and low-dimensional source data step size do not need to be aligned with the low-dimensional source data block size or the high-dimensional source data block size. That is to say, the codec supports arbitrarily dividing the source data into blocks, and arbitrarily extracting the coding region from the obtained source data block for coding.
步骤203,针对至少一个待编码数据块中的每个待编码数据块,将该待编码数据块划分为多个流块,并将多个流块发送至该待编码数据块对应的多个编码流,作为多个编码流中的待混洗流块。Step 203: For each to-be-coded data block in at least one to-be-coded data block, divide the to-be-coded data block into multiple stream blocks, and send the multiple stream blocks to multiple codes corresponding to the to-be-coded data block Stream, as a stream block to be shuffled in multiple encoded streams.
在实施中,为了提高编码的吞吐量,编解码器可以通过多个编码流并行对同一待编码数据块进行编码。同理,编解码器在进行混洗时,针对每个待编码数据块,编解码器可以将该待编码数据块划分为多个流块,并将多个流块发送至该待编码数据块对应的多个编码流,作为多个编码流中的待混洗流块。可选的,编解码器可以将待编码数据块划分成多个行序列,每个行序列中包含至少一个待编码数据子块。然后,针对每个行序列中的每个待编码数据子块,编解码器可以将该待编码数据子块划分为多个流块。这样,可以保证每个编码流中的流块的数目相近。例如,如图4A所示,编解码器将待编码数据块划分为4个行序列。其中,第一行序列包含待编码数据子块1、待编码数据子块2、待编码数据子块3和待编码数据子块4;第二行序列包含待编码数据子块5、待编码数据子块6、待编码数据子块7和待编码数据子块8;第三行序列包含待编码数据子块9、待编码数据子块10、待编码数据子块11和待编码数据子块12;第四行序列包含待编码数据子块13、待编码数据子块14、待编码数据子块15和待编码数据子块16,各行序列中斜线方块表示该待编码数据块中非编码数据。然后,如图4B所示,针对每个行序列中的每个待编码数据子块,编解码器可以将该待编码数据子块划分为4个流块,分别发送至编码流(steam)1至编码流4中,作为各编码流中的待混洗流块。其中,编码流1和编码流2包含16个待混洗流块,编码流3和编码流4包含12个待混洗流块。In implementation, in order to improve encoding throughput, the codec can encode the same data block to be encoded in parallel through multiple encoding streams. Similarly, when the codec shuffles, for each data block to be encoded, the codec can divide the data block to be encoded into multiple stream blocks, and send the multiple stream blocks to the data block to be encoded Corresponding multiple coded streams are used as stream blocks to be shuffled in the multiple coded streams. Optionally, the codec may divide the data block to be encoded into multiple row sequences, and each row sequence contains at least one data sub-block to be encoded. Then, for each sub-block of data to be encoded in each row sequence, the codec may divide the sub-block of data to be encoded into multiple stream blocks. In this way, it can be ensured that the number of stream blocks in each coded stream is close. For example, as shown in FIG. 4A, the codec divides the data block to be encoded into 4 line sequences. Among them, the first row sequence includes the data sub-block 1, the data sub-block 2, the data sub-block 3 to be encoded, and the data sub-block 4 to be encoded; the second row sequence contains the data sub-block 5 to be encoded and the data to be encoded. Sub-block 6, to-be-coded data sub-block 7 and to-be-coded data sub-block 8; the third row sequence contains to-be-coded data sub-block 9, to-be-coded data sub-block 10, to-be-coded data sub-block 11 and to-be-coded data sub-block 12 ; The fourth row sequence contains the data sub-block 13 to be encoded, the data sub-block 14 to be encoded, the data sub-block 15 to be encoded and the data sub-block 16 to be encoded. The diagonal squares in each row sequence indicate the non-encoded data in the data block to be encoded . Then, as shown in FIG. 4B, for each sub-block of data to be coded in each row sequence, the codec may divide the sub-block of data to be coded into 4 stream blocks and send them to the coded stream (steam) 1 respectively. To coded stream 4, as the stream block to be shuffled in each coded stream. Among them, coded stream 1 and coded stream 2 include 16 stream blocks to be shuffled, and coded stream 3 and coded stream 4 include 12 stream blocks to be shuffled.
下面将结合具体的实施例,对本申请实施例提供的一种混洗方法进行详细的说明,该混洗方法应用于编码过程。如图5所示,具体步骤如下:In the following, a shuffling method provided in an embodiment of the present application will be described in detail with reference to specific embodiments, and the shuffling method is applied to the encoding process. As shown in Figure 5, the specific steps are as follows:
步骤501,根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组。其中,第一混洗组包含多个第一混洗单元,第一混洗单元包含至少一个编码流。Step 501: Determine at least one first shuffling group corresponding to the data block to be encoded according to the first shuffling level. Wherein, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one coded stream.
在实施中,编解码器可以根据各编码流包含的流块数目的差异,在预设的各混洗等级中选取对应的混洗等级。例如,编解码器中可以预设三个混洗等级,混洗等级1、混洗等级2和混洗等级3。编解码器选定某一混洗等级(即第一混洗等级)后,可以进一步根据该第一混洗等级,确定待编码数据块对应的至少一个第一混洗组。其中,第一混洗组包含多个第一混洗单元,第一混洗单元包含至少一个编码流。In an implementation, the codec may select a corresponding shuffling level from the preset shuffling levels according to the difference in the number of stream blocks contained in each coded stream. For example, three shuffle levels can be preset in the codec, shuffle level 1, shuffle level 2, and shuffle level 3. After the codec selects a certain shuffling level (ie, the first shuffling level), it may further determine at least one first shuffling group corresponding to the data block to be encoded according to the first shuffling level. Wherein, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one coded stream.
可选的,编解码器根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组的处理过程为获取待编码数据块对应的多个编码流。根据第一混洗等级,将多个编码流划分为多个第一混洗单元,并将多个第一混洗单元划分为至少一个第一混洗组。其中,第一混洗单元包含至少一个编码流,第一混洗组包含多个第一混洗单元。Optionally, according to the first shuffling level, the codec determines the processing process of at least one first shuffling group corresponding to the data block to be encoded is acquiring multiple encoded streams corresponding to the data block to be encoded. According to the first shuffling level, the multiple encoded streams are divided into multiple first shuffling units, and the multiple first shuffling units are divided into at least one first shuffling group. Wherein, the first shuffle unit includes at least one coded stream, and the first shuffle group includes a plurality of first shuffle units.
在实施中,当编解码器需要根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组时,编解码器可以获取待编码数据块对应的多个编码流。然后,编解码器可以根据第一混洗等级,将多个编码流划分为多个第一混洗单元,并将多个第一混洗单元划分为至少一个第一混洗组。其中,第一混洗单元包含至少一个编码流,第一混洗组包含多个第一混洗单元。例如,待编码数据块对应32个编码流,当第一混洗等级为混洗等级1时,编解码器可以将32个编码流划分为32个第一混洗单元,并将32个第一混洗单元划分为8个第一混洗组,也即,每相邻的4个编码流进行混洗;当第一混洗等级为混洗等级2时,编解码器可以将32个编码流划分为8个第一混洗单元,并将8个第一混洗单元划分为2个第一混洗组,也即,每相邻的16个编码流中以4个编码流为一个混洗单元进行混洗;当第一混洗等级为混洗等级3时,编解码器可以将32个编码流划分为2个第一混洗单元,并将2个第一混洗单元划分为1个第一混洗组,也即,32个编码流中以16个编码流为一个混洗单元进行混洗。In implementation, when the codec needs to determine at least one first shuffling group corresponding to the data block to be encoded according to the first shuffling level, the codec may obtain multiple encoded streams corresponding to the data block to be encoded. Then, the codec may divide the multiple coded streams into multiple first shuffling units according to the first shuffling level, and divide the multiple first shuffling units into at least one first shuffling group. Wherein, the first shuffle unit includes at least one coded stream, and the first shuffle group includes a plurality of first shuffle units. For example, the data block to be coded corresponds to 32 coded streams. When the first shuffle level is shuffle level 1, the codec can divide the 32 coded streams into 32 first shuffle units, and combine the 32 first shuffle units. The shuffling unit is divided into 8 first shuffling groups, that is, every 4 adjacent coded streams are shuffled; when the first shuffling level is shuffle level 2, the codec can divide 32 coded streams Divide into 8 first shuffling units, and divide the 8 first shuffling units into 2 first shuffling groups, that is, 4 coded streams are shuffled in every adjacent 16 coded streams The unit is shuffled; when the first shuffle level is shuffle level 3, the codec can divide 32 encoded streams into 2 first shuffle units, and divide the 2 first shuffle units into 1 The first shuffling group, that is, 16 coded streams among the 32 coded streams are shuffled as a shuffling unit.
步骤502,确定各第一混洗单元的编码长度。Step 502: Determine the code length of each first shuffling unit.
在实施中,编解码器确定出待编码数据块对应的第一混洗组后,针对每个第一混洗组,编解码器可以 进一步确定该第一混洗组中各第一混洗单元的编码长度。可选的,针对每个第一混洗组中的每个第一混洗单元,编解码器可以将该第一混洗单元包含的编码流中的待编码流块的总编码长度,确定为该第一混洗单元的编码长度。针对混洗处理和编码处理同步进行的情况,编解码器还可以将第一混洗单元包含的编码流中的待编码流块和已编码流块的总编码长度,确定为该第一混洗单元的编码长度。In implementation, after the codec determines the first shuffle group corresponding to the data block to be encoded, for each first shuffle group, the codec can further determine each first shuffle unit in the first shuffle group The length of the encoding. Optionally, for each first shuffling unit in each first shuffling group, the codec may determine the total coding length of the stream block to be coded in the coded stream contained in the first shuffling unit as The code length of the first shuffling unit. For the case that the shuffling process and the encoding process are performed simultaneously, the codec may also determine the total code length of the stream block to be coded and the coded stream block in the coded stream contained in the first shuffling unit as the first shuffling The encoding length of the unit.
步骤503,根据各第一混洗单元的编码长度,在各第一混洗单元中,确定输出混洗单元和输入混洗单元。Step 503: Determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit.
在实施中,编解码器确定出各第一混洗单元的编码长度后,可以根据各第一混洗单元的编码长度,在各第一混洗单元中,确定输出混洗单元和输入混洗单元。其中,如图6所示,编解码器根据各第一混洗单元的编码长度,在各第一混洗单元中,确定输出混洗单元和输入混洗单元的处理过程如下:In implementation, after the codec determines the code length of each first shuffle unit, it can determine the output shuffle unit and the input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit. unit. Among them, as shown in Figure 6, the codec determines the output shuffle unit and the input shuffle unit in each first shuffle unit according to the coding length of each first shuffle unit as follows:
步骤601,根据各第一混洗单元的编码长度,确定各第一混洗单元的混洗类型。Step 601: Determine the shuffling type of each first shuffling unit according to the code length of each first shuffling unit.
在实施中,编解码器确定出各第一混洗单元的编码长度后,编解码器可以根据各第一混洗单元的编码长度,确定各第一混洗单元的混洗类型。其中,编解码器根据各第一混洗单元的编码长度,确定各第一混洗单元的混洗类型的方式可以是多种多样的,本申请实施例提供了两种可行的方式,具体如下:In implementation, after the codec determines the coding length of each first shuffling unit, the codec may determine the shuffling type of each first shuffling unit according to the coding length of each first shuffling unit. Among them, the codec can determine the shuffling type of each first shuffling unit in various ways according to the encoding length of each first shuffling unit. The embodiment of the present application provides two feasible ways, which are specifically as follows :
方式一,针对每个第一混洗单元,编解码器可以根据该第一混洗单元的编码长度与其他第一混洗单元的编码长度的第一差值,确定该第一混洗单元的混洗类型。具体处理过程如下:Manner 1: For each first shuffling unit, the codec can determine the first shuffling unit's encoding length according to the first difference between the encoding length of the first shuffling unit and the encoding lengths of other first shuffling units. Shuffle type. The specific process is as follows:
步骤一,针对各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与其他第一混洗单元的编码长度的第一差值。Step 1: For each first shuffle unit in each first shuffle unit, determine a first difference between the code length of the first shuffle unit and the code lengths of other first shuffle units.
在实施中,编解码器确定出各第一混洗单元的编码长度后,针对每个第一混洗单元,编解码器可以进一步确定该第一混洗单元的编码长度与其他第一混洗单元的编码长度的第一差值。示例一,如图7A所示,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个编码流为例,编码流1的编码长度为N+5,编码流2的编码长度为N+9,编码流3的编码长度为N,编码流4的编码长度为N+3,N为正整数,则编码流1对应的第一差值为{-4,5,2},编码流2对应的第一差值为{4,9,6},编码流3对应的第一差值为{-5,-9,-3},编码流4对应的第一差值为{-2,-6,3}。In implementation, after the codec determines the code length of each first shuffle unit, for each first shuffle unit, the codec can further determine the code length of the first shuffle unit and other first shuffle units. The first difference in the coding length of the unit. Example 1, as shown in Fig. 7A, four shuffling units are used as a shuffling group for shuffling, each shuffling unit contains an encoded stream as an example, the encoding length of encoded stream 1 is N+5, and the encoded stream 2 The code length of coded stream 3 is N+9, the coded length of coded stream 3 is N, the coded length of coded stream 4 is N+3, and N is a positive integer, then the first difference corresponding to coded stream 1 is {-4,5, 2}, the first difference corresponding to code stream 2 is {4, 9, 6}, the first difference corresponding to code stream 3 is {-5, -9, -3}, and the first difference corresponding to code stream 4 The value is {-2, -6, 3}.
示例二,如图7B所示,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个编码流为例,编码流1的编码长度为N+15,编码流2的编码长度为N+10,编码流3的编码长度为N+8,编码流4的编码长度为N,N为正整数,则编码流1对应的第一差值为{5,7,15},编码流2对应的第一差值为{-5,2,10},编码流3对应的第一差值为{-7,-2,8},编码流4对应的第一差值为{-15,-10,-8}。Example two, as shown in Figure 7B, four shuffle units are used as a shuffle group for shuffling, and each shuffle unit contains one coded stream as an example. The code length of coded stream 1 is N+15, and the coded stream 2 The code length of code stream 3 is N+10, the code length of code stream 3 is N+8, the code length of code stream 4 is N, and N is a positive integer, then the first difference corresponding to code stream 1 is {5,7,15 }, the first difference corresponding to encoded stream 2 is {-5, 2, 10}, the first difference corresponding to encoded stream 3 is {-7, -2, 8}, and the first difference corresponding to encoded stream 4 Is {-15, -10, -8}.
步骤二,根据该第一混洗单元对应的第一差值,确定该第一混洗单元的混洗类型。Step 2: Determine the shuffling type of the first shuffling unit according to the first difference corresponding to the first shuffling unit.
在实施中,编解码器中可以预先存储有第一预设差值阈值。该第一预设差值阈值可以由技术人员根据经验进行设置。编解码器得到该第一混洗单元对应的第一差值后,可以判断该第一混洗单元对应的第一差值中是否存在绝对值大于或等于第一预设差值阈值的目标差值,且目标差值是否均为正数。如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且目标差值均为正数,则编解码器执行步骤三。如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且目标差值中存在负数的目标差值,则编解码器执行步骤四。如果该第一混洗单元对应的第一差值中不存在绝对值大于或等于第一预设差值阈值的目标差值。则编解码器执行步骤五。In implementation, the first preset difference threshold may be pre-stored in the codec. The first preset difference threshold can be set by a technician based on experience. After the codec obtains the first difference value corresponding to the first shuffle unit, it can determine whether there is a target difference whose absolute value is greater than or equal to the first preset difference threshold in the first difference value corresponding to the first shuffle unit. Value, and whether the target difference is positive. If there is a target difference value in the first difference value corresponding to the first shuffling unit whose absolute value is greater than or equal to the first preset difference value threshold, and the target difference values are all positive numbers, the codec executes step 3. If there is a target difference in the first difference corresponding to the first shuffling unit whose absolute value is greater than or equal to the first preset difference threshold, and there is a negative target difference in the target difference, the codec executes the step four. If there is no target difference value whose absolute value is greater than or equal to the first preset difference value threshold in the first difference value corresponding to the first shuffling unit. Then the codec executes step 5.
步骤三,确定该第一混洗单元的混洗类型为高编码类型。Step 3: Determine that the shuffling type of the first shuffling unit is a high coding type.
在实施中,如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且目标差值均为正数,则编解码器可以确定该第一混洗单元的混洗类型为高编码类型(以下用H表示)。例如,在上述示例一中,如图7A所示,第一预设差值阈值为7,则编码流2的混洗类型为H,在上述示例二中,如图7B所示,第一预设差值阈值为7,则编码流1和编码流2的混洗类型为H。In implementation, if the first difference corresponding to the first shuffling unit has a target difference whose absolute value is greater than or equal to the first preset difference threshold, and the target difference is all positive, the codec may It is determined that the shuffling type of the first shuffling unit is a high coding type (indicated by H below). For example, in the foregoing example 1, as shown in FIG. 7A, the first preset difference threshold is 7, and the shuffling type of the encoded stream 2 is H. In the foregoing example 2, as shown in FIG. 7B, the first preset If the difference threshold is set to 7, then the shuffling type of coded stream 1 and coded stream 2 is H.
步骤四,确定该第一混洗单元的混洗类型为低编码类型。Step 4: Determine that the shuffling type of the first shuffling unit is a low coding type.
在实施中,如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且目标差值中存在负数的目标差值,则编解码器可以确定该第一混洗单元的混洗类型为低编码类型(以下用L表示)。例如,在上述示例一中,如图7A所示,第一预设差值阈值为7,则编码流3的混洗类型为L,在上述示例二中,如图7B所示,第一预设差值阈值为7,则编码流3和编码流4的混洗类型为L。In implementation, if the first difference corresponding to the first shuffling unit has a target difference whose absolute value is greater than or equal to the first preset difference threshold, and there is a negative target difference in the target difference, then edit The decoder may determine that the shuffling type of the first shuffling unit is a low coding type (hereinafter denoted by L). For example, in the foregoing example 1, as shown in FIG. 7A, the first preset difference threshold is 7, and the shuffling type of the encoded stream 3 is L. In the foregoing example 2, as shown in FIG. 7B, the first preset If the difference threshold is set to 7, then the shuffling type of coded stream 3 and coded stream 4 is L.
步骤五,确定该第一混洗单元的混洗类型为中编码类型。Step 5: Determine that the shuffling type of the first shuffling unit is a medium coding type.
在实施中,如果该第一混洗单元对应的第一差值中不存在绝对值大于或等于第一预设差值阈值的目标差值,则编解码器可以确定该第一混洗单元的混洗类型为中编码类型(以下用M表示)。例如,在上述示例一中,如图7A所示,第一预设差值阈值为7,则编码流1和编码流4的混洗类型为M。In implementation, if the first difference corresponding to the first shuffling unit does not have a target difference whose absolute value is greater than or equal to the first preset difference threshold, the codec can determine the first difference of the first shuffling unit The shuffling type is the medium encoding type (denoted by M below). For example, in the foregoing example 1, as shown in FIG. 7A, the first preset difference threshold is 7, and the shuffling type of the encoded stream 1 and the encoded stream 4 is M.
方式二,针对每个第一混洗单元,编解码器可以根据该第一混洗单元的编码长度与平均编码长度的第二差值,确定该第一混洗单元的混洗类型。具体处理过程如下:Manner 2: For each first shuffling unit, the codec may determine the shuffling type of the first shuffling unit according to the second difference between the code length of the first shuffling unit and the average code length. The specific process is as follows:
步骤一,根据各第一混洗单元的编码长度,确定平均编码长度。Step 1: Determine the average code length according to the code length of each first shuffling unit.
在实施中,编解码器确定出各第一混洗单元的编码长度后,可以根据各第一混洗单元的编码长度,确定平均编码长度。示例三,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个编码流为例,编码流1的编码长度为N+5,编码流2的编码长度为N+9,编码流3的编码长度为N,编码流4的编码长度为N+3,N为正整数,则平均编码长度为N+4.25。In implementation, after the codec determines the coding length of each first shuffling unit, it can determine the average coding length according to the coding length of each first shuffling unit. Example 3: Taking 4 shuffling units as a shuffling group for shuffling, each shuffling unit contains a coded stream as an example, the code length of coded stream 1 is N+5, and the coded length of coded stream 2 is N+ 9. The coding length of coded stream 3 is N, the coding length of coded stream 4 is N+3, and N is a positive integer, so the average code length is N+4.25.
示例四,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个编码流为例,编码流1的编码长度为N+15,编码流2的编码长度为N+10,编码流3的编码长度为N+8,编码流4的编码长度为N,N为正整数,则平均编码长度为N+8.25。Example 4, shuffle with 4 shuffle units as a shuffle group, each shuffle unit contains a code stream as an example, the code length of code stream 1 is N+15, and the code length of code stream 2 is N+ 10. The code length of code stream 3 is N+8, and the code length of code stream 4 is N. N is a positive integer, and the average code length is N+8.25.
步骤二,针对各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与平均编码长度的第二差值。Step 2: For each first shuffle unit in each first shuffle unit, determine a second difference between the code length of the first shuffle unit and the average code length.
在实施中,编解码器确定出平均编码长度后,针对每个第一混洗单元,编解码器可以进一步确定该第一混洗单元的编码长度与平均编码长度的第二差值。例如,在上述示例三中,编码流1对应的第二差值为0.75,编码流2对应的第二差值为4.75,编码流3对应的第二差值为-4.25,编码流4对应的第二差值为-1.25;在上述示例四中,编码流1对应的第二差值为6.75,编码流2对应的第二差值为1.75,编码流3对应的第二差值为-0.25,编码流4对应的第二差值为-8.25。In implementation, after the codec determines the average code length, for each first shuffle unit, the codec may further determine the second difference between the code length of the first shuffle unit and the average code length. For example, in the above example three, the second difference corresponding to code stream 1 is 0.75, the second difference value corresponding to code stream 2 is 4.75, the second difference value corresponding to code stream 3 is -4.25, and the second difference value corresponding to code stream 4 is -4.25. The second difference is -1.25; in the above example four, the second difference corresponding to coded stream 1 is 6.75, the second difference corresponding to coded stream 2 is 1.75, and the second difference corresponding to coded stream 3 is -0.25 , The second difference corresponding to code stream 4 is -8.25.
步骤三,根据该第一混洗单元对应的第二差值,确定该第一混洗单元的混洗类型。Step 3: Determine the shuffling type of the first shuffling unit according to the second difference value corresponding to the first shuffling unit.
在实施中,编解码器中可以预先存储有第二预设差值阈值。该第二预设差值阈值可以由技术人员根据经验进行设置。编解码器得到该第一混洗单元对应的第二差值后,可以判断该第一混洗单元对应的第二差值的绝对值是否大于或等于第二预设差值阈值,且第二差值是否为正数。如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且第二差值为正数,则编解码器执行步骤四。如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且第二差值为负数,则编解码器执行步骤五。如果该第一混洗单元对应的第二差值的绝对值小于第二预设差值阈值,则编解码器执行步骤六。In implementation, the second preset difference threshold may be pre-stored in the codec. The second preset difference threshold can be set by a technician based on experience. After the codec obtains the second difference value corresponding to the first shuffle unit, it can determine whether the absolute value of the second difference value corresponding to the first shuffle unit is greater than or equal to the second preset difference value threshold, and the second difference value Whether the difference is positive. If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, the codec executes step 4. If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, the codec executes step 5. If the absolute value of the second difference corresponding to the first shuffling unit is less than the second preset difference threshold, the codec executes step 6.
步骤四,确定该第一混洗单元的混洗类型为高编码类型。Step 4: Determine that the shuffling type of the first shuffling unit is a high coding type.
在实施中,如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且第二差值为正数,则编解码器可以确定该第一混洗单元的混洗类型为高编码类型(即H)。例如,在上述示例三中,第二预设差值阈值为4,则编码流2的混洗类型为H;在上述示例四中,第二预设差值阈值为6,则编码流1的混洗类型为H。In implementation, if the absolute value of the second difference value corresponding to the first shuffle unit is greater than or equal to the second preset difference value threshold, and the second difference value is positive, the codec can determine the first shuffle unit The shuffling type of the washing unit is a high coding type (namely H). For example, in the foregoing example three, the second preset difference threshold is 4, and the shuffling type of coded stream 2 is H; in the foregoing example four, the second preset difference threshold is 6, then the shuffle type of coded stream 1 The shuffling type is H.
步骤五,确定该第一混洗单元的混洗类型为低编码类型。Step 5: Determine that the shuffling type of the first shuffling unit is a low coding type.
在实施中,如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且第二差值为负数,则编解码器可以确定该第一混洗单元的混洗类型为低编码类型(即L)。例如,在上述示例三中,第二预设差值阈值为4,则编码流3的混洗类型为L;在上述示例四中,第二预设差值阈值为6,则编码流4的混洗类型为L。In implementation, if the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, the codec can determine the first shuffle The shuffling type of the unit is the low coding type (ie L). For example, in the foregoing example three, the second preset difference threshold is 4, and the shuffling type of the encoded stream 3 is L; in the foregoing example four, the second preset difference threshold is 6, then the encoding stream 4 The shuffling type is L.
步骤六,确定该第一混洗单元的混洗类型为中编码类型。 Step 6, determining that the shuffling type of the first shuffling unit is a medium coding type.
在实施中,如果该第一混洗单元对应的第二差值的绝对值小于第二预设差值阈值,则编解码器可以确定该第一混洗单元的混洗类型为中编码类型(即M)。例如,在上述示例三中,第二预设差值阈值为4,则编码流1和编码流4的混洗类型为M;在上述示例四中,第二预设差值阈值为6,则编码流2和编码流3的混洗类型为M。In implementation, if the absolute value of the second difference value corresponding to the first shuffling unit is less than the second preset difference value threshold, the codec can determine that the shuffling type of the first shuffling unit is the medium encoding type ( That is M). For example, in the above example three, the second preset difference threshold is 4, and the shuffling type of coded stream 1 and coded stream 4 is M; in the above example four, the second preset difference threshold is 6, then The shuffling type of coded stream 2 and coded stream 3 is M.
步骤602,根据各第一混洗单元的混洗类型和预设的混洗规则,在各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元。Step 602: Determine an output shuffle unit and an input shuffle unit corresponding to each output shuffle unit in each first shuffle unit according to the shuffle type of each first shuffle unit and a preset shuffle rule.
在实施中,编解码器中可以预先存储有混洗规则。该混洗规则可以由技术人员根据经验进行设置。编解码器得到各第一混洗单元的混洗类型后,可以进一步根据各第一混洗单元的混洗类型和预设的混洗规 则,在各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元。其中,编解码器根据各第一混洗单元的混洗类型和预设的混洗规则,在各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元的处理过程如下:In implementation, the codec may be pre-stored with shuffling rules. The shuffling rules can be set by technicians based on experience. After the codec obtains the shuffling type of each first shuffling unit, it can further determine the output shuffle in each first shuffling unit according to the shuffling type of each first shuffling unit and preset shuffling rules. Unit and the input shuffle unit corresponding to each output shuffle unit. Among them, the codec determines the output shuffle unit and the input shuffle corresponding to each output shuffle unit in each first shuffle unit according to the shuffle type of each first shuffle unit and preset shuffle rules. The processing of the unit is as follows:
步骤一,如果高编码类型的第一目标混洗单元的第一数目小于或等于低编码类型的第二目标混洗单元的第二数目,则将第一目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第二目标混洗单元中,确定至少一个第二目标混洗单元作为该输出混洗单元对应的输入混洗单元。Step 1: If the first number of the first target shuffling units of the high coding type is less than or equal to the second number of the second target shuffling units of the low coding type, the first target shuffling unit is determined as the output shuffling unit , And for each output shuffle unit, in the second target shuffle unit, at least one second target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
在实施中,如果高编码类型的第一目标混洗单元的第一数目小于或等于低编码类型的第二目标混洗单元的第二数目,则编解码器可以将第一目标混洗单元确定为输出混洗单元。然后,针对每个输出混洗单元,编解码器可以在第二目标混洗单元中,确定至少一个第二目标混洗单元作为该输出混洗单元对应的输入混洗单元。其中,一个第二目标混洗单元可以仅作为一个输出混洗单元对应的输入混洗单元,也可以作为多个输出混洗单元对应的输入混洗单元,本申请实施例不作限定。例如,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个编码流为例,当编码流1至编码流4的混洗类型为HMML时,编解码器可以将编码流1确定为输出混洗单元,并将编码流4确定为编码流1的输入混洗单元;当编码流1至编码流4的混洗类型为HMLL时,编解码器可以将编码流1确定为输出混洗单元,并将编码流3和编码流4确定为编码流1的输入混洗单元;当编码流1至编码流4的混洗类型为HLLL时,编解码器可以将编码流1确定为输出混洗单元,并将编码流2、编码流3和编码流4确定为编码流1的输入混洗单元;当编码流1至编码流4的混洗类型为HHLL时,编解码器可以将编码流1和编码流2确定为输出混洗单元,并将编码流3确定为编码流1的输入混洗单元,将编码流4确定为编码流2的输入混洗单元,编解码器也可以将编码流3和编码流4确定为编码流1的输入混洗单元,将和编码流3和编码流4确定为编码流2的输入混洗单元,编解码器也可以将编码流3确定为编码流1的输入混洗单元,将和编码流3和编码流4确定为编码流2的输入混洗单元。In an implementation, if the first number of the first target shuffling units of the high encoding type is less than or equal to the second number of the second target shuffling units of the low encoding type, the codec may determine the first target shuffling unit It is the output shuffle unit. Then, for each output shuffle unit, the codec may determine at least one second target shuffle unit in the second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit. Wherein, one second target shuffling unit may only be used as an input shuffling unit corresponding to one output shuffling unit, or may be used as an input shuffling unit corresponding to multiple output shuffling units, which is not limited in the embodiment of the present application. For example, taking 4 shuffling units as a shuffling group for shuffling, each shuffling unit contains a coded stream as an example, when the shuffle type of coded stream 1 to coded stream 4 is HMML, the codec can change Coded stream 1 is determined as the output shuffle unit, and coded stream 4 is determined as the input shuffle unit of coded stream 1. When the shuffle type of coded stream 1 to coded stream 4 is HMLL, the codec can change coded stream 1 Determine as the output shuffling unit, and determine the coded stream 3 and coded stream 4 as the input shuffle unit of the coded stream 1. When the shuffle type of the coded stream 1 to the coded stream 4 is HLLL, the codec can change the coded stream 1 is determined as the output shuffle unit, and coded stream 2, coded stream 3, and coded stream 4 are determined as the input shuffle unit of coded stream 1. When the shuffle type of coded stream 1 to coded stream 4 is HHLL, the codec The device can determine the coded stream 1 and coded stream 2 as the output shuffle unit, and the coded stream 3 as the input shuffle unit of the coded stream 1, and the coded stream 4 as the input shuffle unit of the coded stream 2. The encoder can also determine coded stream 3 and coded stream 4 as the input shuffle unit of coded stream 1, and the coded stream 3 and coded stream 4 can be determined as the input shuffle unit of coded stream 2. The codec can also determine the coded stream 3 is determined as the input shuffle unit of coded stream 1, and the sum coded stream 3 and coded stream 4 are determined as the input shuffle unit of coded stream 2.
步骤二,如果高编码类型的第一目标混洗单元的第一数目大于低编码类型的第二目标混洗单元的第二数目,则将第二数目个第一目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第二目标混洗单元中,确定至少一个第二目标混洗单元作为该输出混洗单元对应的输入混洗单元。Step 2: If the first number of the first target shuffling units of the high coding type is greater than the second number of the second target shuffling units of the low coding type, the second number of the first target shuffling units are determined as the output shuffle units. For each output shuffle unit, in the second target shuffle unit, at least one second target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
在实施中,如果高编码类型的第一目标混洗单元的第一数目大于低编码类型的第二目标混洗单元的第二数目,则编解码器可以在各第一目标混洗单元中将第二数目个第一目标混洗单元确定为输出混洗单元。然后,针对每个输出混洗单元,编解码器可以在第二目标混洗单元中,确定至少一个第二目标混洗单元作为该输出混洗单元对应的输入混洗单元。其中,一个第二目标混洗单元可以仅作为一个输出混洗单元对应的输入混洗单元,也可以作为多个输出混洗单元对应的输入混洗单元,本申请实施例不作限定。例如,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个编码流为例,当编码流1至编码流4的混洗类型为HHML时,编解码器可以将编码流2确定为输出混洗单元,并将编码流4确定为编码流2的输入混洗单元;当编码流1至编码流4的混洗类型为HHHL时,编解码器可以将编码流3确定为输出混洗单元,并将编码流4确定为编码流1的输入混洗单元。In implementation, if the first number of the first target shuffling units of the high encoding type is greater than the second number of the second target shuffling units of the low encoding type, the codec may combine in each first target shuffling unit The second number of first target shuffle units are determined as output shuffle units. Then, for each output shuffle unit, the codec may determine at least one second target shuffle unit in the second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit. Wherein, one second target shuffling unit may only be used as an input shuffling unit corresponding to one output shuffling unit, or may be used as an input shuffling unit corresponding to multiple output shuffling units, which is not limited in the embodiment of the present application. For example, taking 4 shuffling units as a shuffling group for shuffling, each shuffling unit contains a coded stream as an example, when the shuffle type of coded stream 1 to coded stream 4 is HHML, the codec can change Coded stream 2 is determined as the output shuffling unit, and coded stream 4 is determined as the input shuffling unit of coded stream 2. When the shuffle type of coded stream 1 to coded stream 4 is HHHL, the codec can change coded stream 3 It is determined as the output shuffling unit, and the coded stream 4 is determined as the input shuffling unit of the coded stream 1.
需要说明的是,如果高编码类型的第一目标混洗单元的第一数目大于低编码类型的第二目标混洗单元的第二数目,且各混洗单元中存在中编码类型的第三目标混洗单元,则编解码器还可以进一步在除确定为第二目标混洗单元对应的输出混洗单元(以下称为第一输出混洗单元)以外的第一目标混洗单元中,确定若干个第一目标混洗单元作为输出混洗单元(以下称为第二输出混洗单元),并针对每个第二输出混洗单元,编解码器可以在第三目标混洗单元中,确定至少一个第三目标混洗单元作为该第二输出混洗单元对应的输入混洗单元。例如,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个编码流为例,当编码流1至编码流4的混洗类型为HHML时,编解码器可以将编码流2确定为第一输出混洗单元,并将编码流4确定为编码流2的输入混洗单元;同时,编解码器还可以将编码流1确定为第二输出混洗单元,并将编码流3确定为编码流1的输入混洗单元。It should be noted that if the first number of first target shuffling units of high coding type is greater than the second number of second target shuffling units of low coding type, and each shuffling unit has a third target of medium coding type Shuffle unit, the codec may further determine a number of first target shuffle units other than the output shuffle unit corresponding to the second target shuffle unit (hereinafter referred to as the first output shuffle unit) A first target shuffle unit is used as an output shuffle unit (hereinafter referred to as a second output shuffle unit), and for each second output shuffle unit, the codec can determine at least in the third target shuffle unit A third target shuffle unit is used as the input shuffle unit corresponding to the second output shuffle unit. For example, taking 4 shuffling units as a shuffling group for shuffling, each shuffling unit contains a coded stream as an example, when the shuffle type of coded stream 1 to coded stream 4 is HHML, the codec can change Coded stream 2 is determined as the first output shuffle unit, and coded stream 4 is determined as the input shuffle unit of coded stream 2. At the same time, the codec can also determine coded stream 1 as the second output shuffle unit, and The coded stream 3 is determined as the input shuffling unit of the coded stream 1.
另外,对于中编码类型的第三目标混洗单元,针对每个第三目标混洗单元,编解码器可以将该第三目标混洗单元确定为输出混洗单元,并将自身确定为该第三目标混洗单元对应的输入混洗单元。例如,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个编码流为例,当编码流1至编码流4的混洗类型为MMMM时,编解码器可以将编码流1确定为输出混洗单元,并将编码流1确定为编码流1的输入混 洗单元,编码流2至编码流4与之类似,此处不再赘述。In addition, for the third target shuffle unit of the medium encoding type, for each third target shuffle unit, the codec may determine the third target shuffle unit as the output shuffle unit, and determine itself as the first shuffle unit. The input shuffle unit corresponding to the three-target shuffle unit. For example, taking 4 shuffling units as a shuffling group for shuffling, each shuffling unit contains a coded stream as an example, when the shuffle type of coded stream 1 to coded stream 4 is MMMM, the codec can change The coded stream 1 is determined as the output shuffling unit, and the coded stream 1 is determined as the input shuffling unit of the coded stream 1. The coded stream 2 to the coded stream 4 are similar to them, and will not be repeated here.
步骤504,将输出混洗单元中第一预设数目个待混洗流块,发送至输入混洗单元,作为输入混洗单元中的第一待编码流块,以通过输入混洗单元根据预设的编码算法对第一待编码流块进行编码。Step 504: Send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be coded in the input shuffle unit, so as to pass the input shuffle unit according to the pre-shuffled stream blocks. The assumed encoding algorithm encodes the first stream block to be encoded.
在实施中,编解码器中可以预先存储有第一预设数目。该第一预设数目可以由技术人员根据经验进行设置。编解码器确定出输出混洗单元和输入混洗单元后,编解码器可以将输出混洗单元中第一预设数目个待混洗流块,发送至输入混洗单元,作为输入混洗单元中的第一待编码流块,以通过输入混洗单元根据预设的编码算法对第一待编码流块进行编码。其中,第一预设数目可以大于或等于输入混洗单元的数目;每个输入混洗单元接收到的待混洗流块可以相同,也可以不同;针对每个输入混洗单元,编解码器还可以将该输入混洗单元中第三预设数目个待混洗单元输入至该输入混洗单元的待编码队列,作为该输入混洗单元的第一待编码流块。In implementation, the first preset number may be pre-stored in the codec. The first preset number can be set by a technician based on experience. After the codec determines the output shuffle unit and the input shuffle unit, the codec can send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the input shuffle unit The first to-be-coded stream block in the input shuffling unit is used to encode the first to-be-coded stream block according to a preset coding algorithm. Among them, the first preset number may be greater than or equal to the number of input shuffle units; the stream blocks to be shuffled received by each input shuffle unit may be the same or different; for each input shuffle unit, the codec The third preset number of units to be shuffled in the input shuffle unit may also be input to the queue to be coded of the input shuffle unit as the first stream block to be coded of the input shuffle unit.
可选的,针对每个输出混洗单元,将该输出混洗单元中第二预设数目个待混洗流块,发送至该输出混洗单元对应的输入混洗单元,作为该输入混洗单元中的第一待编码流块。Optionally, for each output shuffle unit, the second preset number of stream blocks to be shuffled in the output shuffle unit are sent to the input shuffle unit corresponding to the output shuffle unit as the input shuffle unit The first stream block to be encoded in the unit.
在实施中,编解码器中可以预先存储有第二预设数目。该第二预设数目可以由技术人员根据经验进行设置。对于输出混洗单元与输入混洗单元对应的情况,针对每个输出混洗单元,编解码器可以将该输出混洗单元中第二预设数目个待混洗流块,发送至该输出混洗单元对应的输入混洗单元,作为该输入混洗单元中的第一待编码流块。其中,第二预设数目可以大于或等于该输出混洗单元对应的输入混洗单元的数目,且每个输入混洗单元接收到的待混洗流块的数目可以相同,也可以不同。这样,可以保证各个混洗单元的编码长度相近。例如,如图8A所示,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个编码流为例,编码流1至编码流4的混洗类型为MHLM,则编码流2为输出混洗单元,编码流3为编码流2的输入混洗单元,则编码流1可以向编码流1输出1个待混洗流块,编码流2可以向编码流3输出1个待混洗流块,编码流4可以向编码流4输出1个待混洗流块。这样,如图9A所示,混洗完成后编码流1的编码长度为N+8,编码流2的编码长度为N+9,编码流3的编码长度为N+3,编码流4的编码长度为N+6,编码流1至编码流4的混洗类型为MMMM。又如,如图8B所示,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个编码流为例,编码流1至编码流4的混洗类型为HHLL,则编码流1和编码流2为输出混洗单元,编码流3和编码流4为编码流1的输入混洗单元,编码流4为编码流2的输入混洗单元,则编码流1可以分别向编码流3和编码流4输出1个待混洗流块,编码流2可以向编码流4输出2个待混洗流块。这样,如图9B所示,混洗完成后编码流1的编码长度为N+15,编码流2的编码长度为N+10,编码流3的编码长度为N+11,编码流4的编码长度为N+9,编码流1至编码流4的混洗类型为MMMM。In implementation, the second preset number may be pre-stored in the codec. The second preset number can be set by a technician based on experience. For the case where the output shuffle unit corresponds to the input shuffle unit, for each output shuffle unit, the codec may send the second preset number of stream blocks to be shuffled in the output shuffle unit to the output shuffle unit. The input shuffling unit corresponding to the shuffling unit is used as the first stream block to be encoded in the input shuffling unit. The second preset number may be greater than or equal to the number of input shuffle units corresponding to the output shuffle unit, and the number of stream blocks to be shuffled received by each input shuffle unit may be the same or different. In this way, it can be ensured that the code lengths of each shuffling unit are similar. For example, as shown in Figure 8A, four shuffling units are used as a shuffling group for shuffling, and each shuffling unit contains one coded stream as an example. The shuffle type of coded stream 1 to coded stream 4 is MHLM, then Coded stream 2 is the output shuffling unit, and coded stream 3 is the input shuffling unit of coded stream 2, then coded stream 1 can output 1 block to be shuffled to coded stream 1, and coded stream 2 can output 1 to coded stream 3. A stream block to be shuffled, and the encoded stream 4 can output one stream block to be shuffled to the encoded stream 4. Thus, as shown in Figure 9A, after the shuffling is completed, the encoding length of encoded stream 1 is N+8, the encoding length of encoded stream 2 is N+9, the encoding length of encoded stream 3 is N+3, and the encoding of encoded stream 4 is The length is N+6, and the shuffling type of code stream 1 to code stream 4 is MMMM. As another example, as shown in Fig. 8B, four shuffle units are used as a shuffle group for shuffling, and each shuffle unit contains an encoded stream as an example. The shuffle type of encoded stream 1 to encoded stream 4 is HHLL, Then coded stream 1 and coded stream 2 are output shuffle units, coded stream 3 and coded stream 4 are the input shuffle units of coded stream 1, and coded stream 4 is the input shuffle unit of coded stream 2, then coded stream 1 can be separately One stream block to be shuffled is output to the coded stream 3 and the coded stream 4, and the coded stream 2 can output two stream blocks to be shuffled to the coded stream 4. Thus, as shown in Figure 9B, after the shuffling is completed, the encoding length of encoded stream 1 is N+15, the encoding length of encoded stream 2 is N+10, the encoding length of encoded stream 3 is N+11, and the encoding of encoded stream 4 is The length is N+9, and the shuffling type of coded stream 1 to coded stream 4 is MMMM.
作为一种可选地实施方式,编解码器可以根据第二混洗等级,确定待编码数据块对应的至少一个第二混洗组。其中,第二混洗组包含多个第二混洗单元,第二混洗单元包含至少一个编码流。然后,编解码器可以将各第二混洗单元中的待编码流块作为待混洗流块重新进行混洗处理,直到各第二混洗单元的编码长度满足预设接近度条件。As an optional implementation manner, the codec may determine at least one second shuffling group corresponding to the data block to be encoded according to the second shuffling level. Wherein, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one coded stream. Then, the codec may re-shuffle the stream blocks to be coded in each second shuffling unit as the stream blocks to be shuffled, until the coding length of each second shuffling unit meets the preset proximity condition.
在实施中,编解码器根据第一混洗等级对待编码数据块对应的编码流进行混洗后,编解码器还可以进一步根据第二混洗等级,确定待编码数据块对应的至少一个第二混洗组。其中,第二混洗组包含多个第二混洗单元,第二混洗单元包含至少一个编码流。编解码器根据第二混洗等级,确定待编码数据块对应的至少一个第二混洗组的处理过程如步骤501类似,此处不再赘述。然后,编解码器可以将各第二混洗单元中的待编码流块作为待混洗流块重新进行混洗处理,直到各第二混洗单元的编码长度满足预设接近度条件。In implementation, after the codec shuffles the encoded stream corresponding to the data block to be encoded according to the first shuffling level, the codec may further determine at least one second corresponding to the data block to be encoded according to the second shuffling level. Shuffle group. Wherein, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one coded stream. According to the second shuffling level, the codec determines at least one second shuffling group corresponding to the data block to be encoded. The processing procedure is similar to step 501, and will not be repeated here. Then, the codec may re-shuffle the stream blocks to be coded in each second shuffling unit as the stream blocks to be shuffled, until the coding length of each second shuffling unit meets the preset proximity condition.
需要说明的是,编解码器根据第二混洗等级对待编码数据块对应的编码流进行混洗后,还可以进一步根据第三混洗等级对待编码数据块对应的编码流进行混洗。例如,编解码器可以按照混洗等级1-混洗等级2—混洗等级3对待编码数据块对应的编码流进行混洗,也可以按照混洗等级1-混洗等级3—混洗等级2对待编码数据块对应的编码流进行混洗,还可以按照混洗等级2-混洗等级3—混洗等级1对待编码数据块对应的编码流进行混洗。It should be noted that after the codec shuffles the coded stream corresponding to the data block to be coded according to the second shuffling level, it may further shuffle the coded stream corresponding to the data block to be coded according to the third shuffling level. For example, the codec can shuffle the encoded stream corresponding to the data block to be coded according to shuffle level 1-shuffle level 2-shuffle level 3, or according to shuffle level 1-shuffle level 3-shuffle level 2 The coded stream corresponding to the data block to be coded is shuffled, and the coded stream corresponding to the data block to be coded can also be shuffled according to shuffle level 2-shuffle level 3-shuffle level 1.
作为一种可选地实施方式,当编解码器检测到多个编码流中的第一编码流编码完成时,将多个编码流中未编码完成的第二编码流中第三预设数目个待编码流块发送至第一编码流,作为第一编码流中的待编码流块。As an optional implementation manner, when the codec detects that the encoding of the first encoded stream in the multiple encoded streams is completed, the third preset number of the unencoded second encoded streams in the multiple encoded streams The stream block to be coded is sent to the first coded stream as the stream block to be coded in the first coded stream.
在实施中,为了进一步平衡各个编码流的编码长度,提高小数据块编码时的编码率。编解码器中可以 预先存储有第三预设数目。该第三预设数目可以由技术人员根据经验进行设置。当编解码器检测到多个编码流中的第一编码流编码完成(也即第一编码流输出编码流结束(StreamFinish)标记)时,可以将多个编码流中未编码完成的第二编码流中第三预设数目个待编码流块发送至第一编码流,作为第一编码流中的待编码流块。其中,第二编码流可以为多个编码流中全部的未编码完成的编码流,也可以为多个编码流中部分的未编码完成的编码流。In the implementation, in order to further balance the encoding length of each encoded stream, the encoding rate when encoding small data blocks is increased. A third preset number may be pre-stored in the codec. The third preset number can be set by a technician based on experience. When the codec detects that the encoding of the first encoded stream of the multiple encoded streams is completed (that is, the first encoded stream outputs the end of the encoded stream (StreamFinish) mark), it can encode the uncompleted second encoding of the multiple encoded streams The third preset number of stream blocks to be coded in the stream are sent to the first coded stream as the stream blocks to be coded in the first coded stream. Wherein, the second coded stream may be all uncoded coded streams among the multiple coded streams, or may be part of the uncoded coded streams of the multiple coded streams.
作为一种可选地实施方式,编解码器通过输入混洗单元根据预设的编码算法对第一待编码流块进行编码的处理过程如下:As an optional implementation manner, the process of encoding the first stream block to be encoded by the codec through the input shuffling unit according to a preset encoding algorithm is as follows:
步骤一,根据预设字符对应的第一编码规则,对第一待编码流块中包含的预设字符进行编码,得到第一编码数据。Step 1: According to the first encoding rule corresponding to the preset characters, the preset characters included in the first stream block to be encoded are encoded to obtain the first encoded data.
在实施中,编解码器中可以预先存储有预设字符对应的第一编码规则。该预设字符对应的第一编码规则可以由技术人员根据经验进行设置。编解码器可以根据预设字符对应的第一编码规则,对第一待编码流块中包含的预设字符进行编码,得到第一编码数据。其中,由于神经网络数据具有稀疏特性,因此,技术人员可以将连续若干个全零字符设置为预设字符。表一为各预设字符,如表一所示:In implementation, the first encoding rule corresponding to the preset character may be pre-stored in the codec. The first encoding rule corresponding to the preset character can be set by a technician based on experience. The codec may encode the preset characters contained in the first stream block to be encoded according to the first encoding rule corresponding to the preset characters to obtain the first encoded data. Among them, due to the sparse nature of neural network data, technicians can set several consecutive all-zero characters as preset characters. Table 1 shows the preset characters, as shown in Table 1:
表一Table I
名称name 描述description
StreamFinishStreamFinish 编码流结束的标志Mark the end of the encoded stream
SingleZeroSingleZero 单个全0数据Single all 0 data
DoubleZeroDoubleZero 连续两个全0数据Two consecutive all 0 data
TripleZeroTripleZero 连续三个全0数据Three consecutive all 0 data
QuadZeroQuadZero 连续四个全0数据Four consecutive all 0 data
LiteralsLiterals 其它8bit字符的编码Encoding of other 8bit characters
步骤二,根据预设的第二编码规则对第一编码数据进行编码。Step 2: Encode the first encoded data according to a preset second encoding rule.
在实施中,编解码器中可以预先存储有第二编码规则。该第二编码规则可以为前缀码编码算法,也可以为其他编码算法,本申请实施例不作限定。编解码器得到第一编码数据后,可以进行一步根据预设的第二编码规则对第一编码数据进行编码。In implementation, the second encoding rule may be pre-stored in the codec. The second encoding rule may be a prefix code encoding algorithm or other encoding algorithms, which is not limited in the embodiment of the present application. After the codec obtains the first encoded data, it can perform a step to encode the first encoded data according to the preset second encoding rule.
作为一种可选地实施方式,编解码器对待编码数据块进行编码,得到编码数据块后,可以生成各待编码数据块对应的编码数据块的编码头块。其中,编码头块中包含编码头块对应的编码数据块的存储地址。然后,编解码器可以将各编码头块进行存储,并在各编码头块之后存储各编码数据块。As an optional implementation manner, the codec encodes the data block to be encoded, and after obtaining the encoded data block, it may generate an encoding header block of the encoded data block corresponding to each data block to be encoded. Wherein, the encoding header block contains the storage address of the encoded data block corresponding to the encoding header block. Then, the codec can store each coded header block, and store each coded data block after each coded header block.
在实施中,对于待编码数据块对应的编码数据块,如图10所示,编解码器采用头-数据块(header-data block)映射的形式进行存储。该映射形式分为两大部分,分别为编码头(header)部分和编码数据块(data block)部分。编码头部分的起始地址为编码头地址(head address);编码头部分占据的空间为编码头总数目(head total number)个编码头块的大小,编码头总数目可以大于或等于有效的编码头块的数目。其中,每个编码头块的大小为16比特(byte),每个编码头块中存储有该编码头块对应的编码数据块的起始地址和实际大小等信息,各个编码头块在存储设备中连续存放。编码数据块部分紧挨着编码头部分的结束地址存放。每个编码数据块部分包含了若干个编码数据块,每个编码数据块与h编码头块一一对应。其中,编码数据块的存储格式分为打包(packing)格式和非打包(unpacking)格式两种。In implementation, for the encoded data block corresponding to the data block to be encoded, as shown in FIG. 10, the codec uses a header-data block mapping form for storage. The mapping form is divided into two parts, namely a header part and a data block part. The start address of the encoding header is the head address; the space occupied by the encoding header is the total number of encoding headers (head total number) the size of encoding header blocks, and the total number of encoding headers can be greater than or equal to the effective encoding The number of header blocks. Among them, the size of each encoding header block is 16 bytes, and each encoding header block stores information such as the starting address and actual size of the encoded data block corresponding to the encoding header block, and each encoding header block is stored in the storage device. In continuous storage. The coded data block is stored next to the end address of the coded header. Each coded data block part contains several coded data blocks, and each coded data block has a one-to-one correspondence with the h coding header block. Among them, the storage format of the coded data block is divided into two types: a packing format and an unpacking format.
可选的,对于打包格式,编码数据块由编码数据组成,编码数据的大小等于待编码数据块中待编码数据编码后的大小。Optionally, for the packing format, the encoded data block is composed of encoded data, and the size of the encoded data is equal to the encoded size of the data to be encoded in the data block to be encoded.
在实施中,如图10所示,打包格式下,编码数据块紧密存放,每个编码数据块由编码数据组成,编码数据的大小等于待编码数据块中待编码数据编码后的大小。也即,编码数据块占据的空间为待编码数据块编码后的实际大小。In the implementation, as shown in FIG. 10, in the packed format, the coded data blocks are tightly stored, and each coded data block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the data block to be coded. That is, the space occupied by the encoded data block is the actual size of the data block to be encoded after encoding.
可选的,对于非打包格式,编码数据块由编码数据和填充数据组成,编码数据的大小和填充数据的大小之和等于待编码数据块的大小。Optionally, for the non-packed format, the coded data block consists of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be coded.
在实施中,如图10所示,非打包格式下,每个编码数据块由编码数据和填充数据组成,编码数据的大小和填充数据的大小之和等于待编码数据块的大小。也即,每个编码数据块都占用相同的空间,且等于编码前一个完整的待编码数据块的大小。其中,前一部分为编码数据,后一部分为保留的填充数据。In the implementation, as shown in FIG. 10, in the unpacked format, each coded data block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be coded. That is, each coded data block occupies the same space and is equal to the size of a complete data block to be coded before coding. Among them, the former part is encoded data, and the latter part is reserved padding data.
作为一种可选地实施方式,编码数据块由属于同一源数据块中的多个源数据子块对应的编码数据子块组成。在打包格式下,编码数据子块由编码数据组成,编码数据的大小等于源数据子块中待编码数据编码后的大小。在非打包格式下,编码数据子块由编码数据和填充数据组成,编码数据的大小和填充数据的大小之和等于源数据子块的大小。As an optional implementation manner, the coded data block is composed of coded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block. In the packed format, the coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block. In the unpacked format, the coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.
在实施中,编解码器根据不同的编码指令,在源数据中确定多个编码区域时,可能会将一个完整的源数据块切分成多个源数据子块。其中,各编码指令对应的编码区域在相邻的那一侧,要么都编码完整的源数据块,而且源数据块之间互不重叠;要么各自编码同一源数据块的一部分(也即源数据子块),且各源数据子块在源数据块内部的边界正好重叠。如图11所示,四个编码指令在源数据中确定出的四个编码区域将部分源数据块(以灰色斜线方块表示)切分成多个源数据子块,同一源数据块中的各源数据子块的边界正好重叠。编解码器根据不同编码指令对同一源数据块中的各源数据子块进行编码,得到编码数据子块。编解码器在对同一源数据块中的多个源数据子块对应的编码数据子块进行存储时,可以将该编码数据子块存储至同一编码数据块中。这样,可以实现多条编码指令协同完成特定编码区域的拼接,其效果与通过一条编码指令进行编码完全相同,并且这些编码指令的执行顺序可以任意甚至并发执行,从而在多核的源数据划分和单核内部为了流水执行而分块的情况下,能够将编码任务进行划分。In implementation, when the codec determines multiple coding regions in the source data according to different coding instructions, it may divide a complete source data block into multiple source data sub-blocks. Among them, the encoding area corresponding to each encoding instruction is on the adjacent side, and either all encode complete source data blocks, and the source data blocks do not overlap each other; or each encode a part of the same source data block (that is, the source data Sub-block), and the boundary of each source data sub-block within the source data block exactly overlaps. As shown in Figure 11, the four coding regions determined by the four coding instructions in the source data divide a part of the source data block (represented by gray diagonal squares) into multiple source data sub-blocks, each of the same source data block The boundaries of the source data sub-blocks exactly overlap. The codec encodes each source data sub-block in the same source data block according to different coding instructions to obtain the coded data sub-block. When the codec stores the coded data sub-blocks corresponding to multiple source data sub-blocks in the same source data block, the coded data sub-blocks may be stored in the same coded data block. In this way, multiple coding instructions can be realized to complete the splicing of specific coding regions. The effect is exactly the same as that of coding through one coding command, and the execution order of these coding commands can be executed arbitrarily or even concurrently, so that in the multi-core source data division and single When the core is divided into blocks for pipeline execution, the coding task can be divided.
如图12A所示,一个源数据块在低维和高维均被划分为两部分,使得该源数据块划分为4个源数据子块,分别为TL(top-left),TR(top-right),BL(bottom-left)和BR(bottom-right)。其中,每个源数据子块的大小如图12A所示,编解码器可以通过源数据块内部的block left,block right,block top,block bottom四个参数指定。每个源数据子块可以是编码数据,也可以是非编码数据。在非打包格式下的编码数据块中,上述4个源数据子块对应4个编码数据子块可以按照TL-TR-BL-BR的固定顺序存储,每个编码数据子块由编码数据和填充数据组成,编码数据的大小和填充数据的大小之和等于源数据子块的大小。也即,每个编码数据子块所占据的空间为该编码数据子块对应的源数据子块编码前的大小。这样,编码数据块的空间与源数据块的大小相同,从而保证了如果源数据块的每个源数据子块都是由不同的编码指令进行编码,每条编码指令都可以根据划分信息(可以通过指令域计算得到)计算出所负责的编码数据子块的地址,从而实现多条编码指令结果的拼接。As shown in Figure 12A, a source data block is divided into two parts in both low and high dimensions, so that the source data block is divided into 4 source data sub-blocks, namely TL (top-left), TR (top-right), BL (bottom-left) and BR (bottom-right). Among them, the size of each source data sub-block is shown in Figure 12A. The codec can be specified by the four parameters of block left, block right, block top, and block bottom in the source data block. Each source data sub-block can be encoded data or non-encoded data. In the coded data block in the unpacked format, the 4 source data sub-blocks corresponding to the 4 coded data sub-blocks can be stored in a fixed order of TL-TR-BL-BR, and each coded data sub-block is filled with coded data and Data composition, the sum of the size of the encoded data and the size of the padding data is equal to the size of the source data sub-block. That is, the space occupied by each coded data sub-block is the size of the source data sub-block corresponding to the coded data sub-block before coding. In this way, the space of the coded data block is the same as the size of the source data block, thus ensuring that if each source data sub-block of the source data block is coded by a different coding instruction, each coding instruction can be divided according to the information (can be Calculate the address of the sub-block of encoded data in charge by calculating the instruction domain, so as to realize the splicing of the results of multiple encoding instructions.
如图12A所示,编解码器可以通过编码移动(Move)等方式将非打包格式下的编码数据块转化为打包格式下的编码数据块。在打包格式下的编码数据块中,每个编码数据子块由编码数据组成,编码数据的大小等于源数据子块中待编码数据编码后的大小。其中,各编码数据子块之间紧密存放,每个编码数据子块的起始地址需要根据前面的编码数据子块的实际大小累加获得,整个编码数据块所占据的空间就是所有编码数据子块的大小之和。As shown in FIG. 12A, the codec can convert the coded data block in the non-packed format into the coded data block in the packed format by means such as a code move (Move). In the coded data block in the packed format, each coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block. Among them, the coded data sub-blocks are tightly stored, and the starting address of each coded data sub-block needs to be accumulated according to the actual size of the previous coded data sub-blocks. The space occupied by the entire coded data block is all the coded data sub-blocks. The sum of the sizes.
如图12B所示,一个源数据块在高维被划分为两部分,使得该源数据块划分为2个源数据子块,分别为TL和BL,或者BL和BR。如图12C所示,一个源数据块在低维被划分为两部分,使得该源数据块划分为2个源数据子块,分别为TL和TR,或者TR和BR。As shown in FIG. 12B, a source data block is divided into two parts in a high dimension, so that the source data block is divided into two source data sub-blocks, namely TL and BL, or BL and BR. As shown in FIG. 12C, a source data block is divided into two parts in a low dimension, so that the source data block is divided into two source data sub-blocks, namely TL and TR, or TR and BR.
一个源数据块在低维和高维均不进行划分,仅有一个源数据子块,该源数据子块可以为TL、TR、BL或BR。如图12D所示,一个源数据块仅有TL一个源数据子块。A source data block is not divided into low-dimensional and high-dimensional. There is only one source data sub-block, and the source data sub-block can be TL, TR, BL, or BR. As shown in Figure 12D, one source data block has only one source data sub-block TL.
为了支持不同编码区域的拼接,包含多个编码数据子块的编码数据块对应的编码头的格式如表二所示。In order to support the splicing of different coded regions, the format of the code header corresponding to the coded data block containing multiple coded data sub-blocks is shown in Table 2.
表二Table II
Figure PCTCN2020117564-appb-000001
Figure PCTCN2020117564-appb-000001
作为一种可选地实施方式,如果各第一混洗组中待编码流块总编码长度大于待编码数据块的原长度,则终止对待编码数据块的编码处理。As an optional implementation manner, if the total coding length of the stream blocks to be coded in each first shuffling group is greater than the original length of the data blocks to be coded, then the coding process of the data blocks to be coded is terminated.
在实施中,为了保证编码数据块可以按照非打包格式进行存储,需要保证编码数据块的大小不能超过待编码数据块的大小。编解码器在对待编码数据块进行混洗处理时,如果检测到各第一混洗组中待编码流块总编码长度大于待编码数据块的原长度,则终止对待编码数据块的编码处理。然后编解码器可以重新发送请求读取待编码数据块,读取的待编码数据块无需进行编码处理,直接进行存储。可选的,编解码器还可以在对待编码数据块进行编码时,如果检测到编码处理输出的编码长度大于待编码数据块的大小,则终止对待编码数据块的编码处理。In implementation, in order to ensure that the encoded data block can be stored in a non-packed format, it is necessary to ensure that the size of the encoded data block cannot exceed the size of the data block to be encoded. When the codec performs shuffling processing on the data block to be encoded, if it detects that the total encoding length of the stream block to be encoded in each first shuffling group is greater than the original length of the data block to be encoded, the encoding process of the data block to be encoded is terminated. Then the codec can resend the request to read the data block to be encoded, and the read data block to be encoded does not need to be encoded and stored directly. Optionally, the codec may also terminate the encoding process of the data block to be encoded if it detects that the encoding length output by the encoding process is greater than the size of the data block to be encoded when encoding the data block to be encoded.
本申请实施例提供了一种混洗方法。编解码器根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组。其中,第一混洗组包含多个第一混洗单元,第一混洗单元包含至少一个编码流。然后,编解码器确定各第一混洗单元的编码长度,根据各第一混洗单元的编码长度,在各第一混洗单元中,确定输出混洗单元和输入混洗单元。之后,编解码器将输出混洗单元中第一预设数目个待混洗流块,发送至输入混洗单元,作为输入混洗单元中的第一待编码流块,以通过输入混洗单元根据预设的编码算法对第一待编码流块进行编码。这样,通过对待编码数据块的各编码流进行混洗,可以保证各编码流的编码长度相近,从而避免由于各个编码流之间的对齐要求造成的补数过多,进而降低编码率。同时,还可以避免各编码流之间产生死锁情况。The embodiment of the present application provides a shuffling method. The codec determines at least one first shuffling group corresponding to the data block to be encoded according to the first shuffling level. Wherein, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one coded stream. Then, the codec determines the encoding length of each first shuffling unit, and according to the encoding length of each first shuffling unit, in each first shuffling unit, determines the output shuffling unit and the input shuffling unit. After that, the codec sends the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream block to be coded in the input shuffle unit to pass the input shuffle unit The first stream block to be encoded is encoded according to a preset encoding algorithm. In this way, by shuffling each coded stream of the data block to be coded, it is possible to ensure that the coded lengths of the coded streams are similar, thereby avoiding excessive complements due to alignment requirements between the coded streams, thereby reducing the coding rate. At the same time, it can also avoid the deadlock situation between each coded stream.
本申请实施例还提供了一种混洗方法,该混洗方法应用于解码过程。如图13所示,具体步骤如下:The embodiment of the present application also provides a shuffling method, which is applied to the decoding process. As shown in Figure 13, the specific steps are as follows:
步骤1301,根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组。其中,第一混洗组包含多个第一混洗单元,第一混洗单元包含至少一个解码流。Step 1301: Determine at least one first shuffling group corresponding to the data block to be decoded according to the first shuffling level. Wherein, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one decoded stream.
可选的,编解码器根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组的处理过程为:编解码器获取待解码数据块对应的多个解码流,根据第一混洗等级,将多个解码流划分为多个第一混洗单元,并将多个第一混洗单元划分为至少一个第一混洗组。其中,第一混洗单元包含至少一个解码流,第一混洗组包含多个第一混洗单元。Optionally, according to the first shuffling level, the codec determines at least one first shuffling group corresponding to the data block to be decoded as follows: the codec obtains multiple decoding streams corresponding to the data block to be decoded, and according to the first shuffling level, the codec obtains multiple decoding streams corresponding to the data block to be decoded. A shuffling level, dividing the multiple decoded streams into multiple first shuffling units, and dividing the multiple first shuffling units into at least one first shuffling group. Wherein, the first shuffle unit includes at least one decoded stream, and the first shuffle group includes a plurality of first shuffle units.
步骤1301的处理过程与步骤501的处理过程类似,此处不再赘述。The processing procedure of step 1301 is similar to the processing procedure of step 501, and will not be repeated here.
步骤1302,确定各第一混洗单元的编码长度。Step 1302: Determine the code length of each first shuffling unit.
可选的,针对每个第一混洗组中的每个第一混洗单元,编解码器将该第一混洗单元包含的解码流中的待解码流块的总编码长度,确定为该第一混洗单元的编码长度。针对混洗处理和解码处理同步进行的情况,编解码器还可以将第一混洗单元包含的解码流中的待解码流块和已解码流块的总编码长度,确定为该 第一混洗单元的编码长度。Optionally, for each first shuffle unit in each first shuffle group, the codec determines the total code length of the stream block to be decoded in the decoded stream contained in the first shuffle unit as the The code length of the first shuffling unit. For the case that the shuffling process and the decoding process are performed simultaneously, the codec may also determine the total code length of the stream block to be decoded and the decoded stream block in the decoded stream contained in the first shuffling unit as the first shuffling The encoding length of the unit.
步骤1302的处理过程与步骤502的处理过程类似,此处不再赘述。The processing procedure of step 1302 is similar to the processing procedure of step 502, and will not be repeated here.
步骤1303,根据各第一混洗单元的编码长度,在各第一混洗单元中,确定输出混洗单元和输入混洗单元。Step 1303: Determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit.
步骤1303的处理过程与步骤503的处理过程类似,此处不再赘述。The processing procedure of step 1303 is similar to the processing procedure of step 503, and will not be repeated here.
可选的,如图14所示,编解码器根据各第一混洗单元的编码长度,在各第一混洗单元中,确定输出混洗单元和输入混洗单元的处理过程如下:Optionally, as shown in Figure 14, the codec determines the output shuffling unit and the input shuffling unit in each first shuffling unit according to the coding length of each first shuffling unit as follows:
步骤1401,根据各第一混洗单元的编码长度,确定各第一混洗单元的混洗类型。其中,编解码器根据各第一混洗单元的编码长度,确定各第一混洗单元的混洗类型的方式可以是多种多样的,本申请实施例提供了两种可行的方式,具体如下:Step 1401: Determine the shuffling type of each first shuffling unit according to the code length of each first shuffling unit. Among them, the codec can determine the shuffling type of each first shuffling unit in various ways according to the encoding length of each first shuffling unit. The embodiment of the present application provides two feasible ways, which are specifically as follows :
方式一,针对每个第一混洗单元,编解码器可以根据该第一混洗单元的编码长度与其他第一混洗单元的编码长度的第一差值,确定该第一混洗单元的混洗类型。具体处理过程如下:Manner 1: For each first shuffling unit, the codec can determine the first shuffling unit's encoding length according to the first difference between the encoding length of the first shuffling unit and the encoding lengths of other first shuffling units. Shuffle type. The specific process is as follows:
步骤一,针对各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与其他第一混洗单元的编码长度的第一差值。Step 1: For each first shuffle unit in each first shuffle unit, determine a first difference between the code length of the first shuffle unit and the code lengths of other first shuffle units.
示例五,如图15所示,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个解码流为例,解码流1的编码长度为N+5,解码流2的编码长度为N+9,解码流3的编码长度为N,解码流4的编码长度为N+3,N为正整数,则解码流1对应的第一差值为{-4,5,2},解码流2对应的第一差值为{4,9,6},解码流3对应的第一差值为{-5,-9,-3},解码流4对应的第一差值为{-2,-6,3}。Example 5, as shown in Figure 15, shuffle with 4 shuffle units as a shuffle group, each shuffle unit contains a decoded stream as an example, the code length of decoded stream 1 is N+5, and decoded stream 2 The encoding length of decoded stream 3 is N+9, the encoding length of decoded stream 3 is N, the encoding length of decoded stream 4 is N+3, and N is a positive integer, then the first difference corresponding to decoded stream 1 is {-4, 5, 2}, the first difference corresponding to decoded stream 2 is {4, 9, 6}, the first difference corresponding to decoded stream 3 is {-5, -9, -3}, the first difference corresponding to decoded stream 4 The value is {-2, -6, 3}.
步骤二,根据该第一混洗单元对应的第一差值,确定该第一混洗单元的混洗类型。Step 2: Determine the shuffling type of the first shuffling unit according to the first difference corresponding to the first shuffling unit.
步骤三,如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且目标差值均为正数,则确定该第一混洗单元的混洗类型为高编码类型。Step 3: If there is a target difference value in the first difference value corresponding to the first shuffle unit whose absolute value is greater than or equal to the first preset difference value threshold, and the target difference values are all positive numbers, then the first difference value is determined The shuffling type of the washing unit is a high coding type.
例如,在上述示例五中,如图15所示,第一预设差值阈值为7,则解码流2的混洗类型为H。For example, in the fifth example above, as shown in FIG. 15, the first preset difference threshold is 7, and the shuffling type of the decoded stream 2 is H.
步骤四,如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且目标差值中存在负数的目标差值,则确定该第一混洗单元的混洗类型为低编码类型。Step 4: If there is a target difference in the first difference corresponding to the first shuffle unit whose absolute value is greater than or equal to the first preset difference threshold, and there is a negative target difference in the target difference, then determine the The shuffling type of the first shuffling unit is a low coding type.
例如,在上述示例五中,如图15所示,第一预设差值阈值为7,则解码流3的混洗类型为L。For example, in the fifth example above, as shown in FIG. 15, the first preset difference threshold is 7, and the shuffling type of the decoded stream 3 is L.
步骤五,如果该第一混洗单元对应的第一差值中不存在绝对值大于或等于第一预设差值阈值的目标差值,则确定该第一混洗单元的混洗类型为中编码类型。 Step 5. If there is no target difference with an absolute value greater than or equal to the first preset difference threshold in the first difference corresponding to the first shuffle unit, determine that the shuffle type of the first shuffle unit is medium Encoding type.
例如,在上述示例五中,如图15所示,第一预设差值阈值为7,则解码流1和解码流4的混洗类型为M。For example, in the fifth example above, as shown in FIG. 15, the first preset difference threshold is 7, and the shuffling type of the decoded stream 1 and the decoded stream 4 is M.
方式二,针对每个第一混洗单元,编解码器可以根据该第一混洗单元的编码长度与平均编码长度的第二差值,确定该第一混洗单元的混洗类型。具体处理过程如下:Manner 2: For each first shuffling unit, the codec may determine the shuffling type of the first shuffling unit according to the second difference between the code length of the first shuffling unit and the average code length. The specific process is as follows:
步骤一,根据各第一混洗单元的编码长度,确定平均编码长度。Step 1: Determine the average code length according to the code length of each first shuffling unit.
步骤二,针对各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与平均编码长度的第二差值。Step 2: For each first shuffle unit in each first shuffle unit, determine a second difference between the code length of the first shuffle unit and the average code length.
步骤三,根据该第一混洗单元对应的第二差值,确定该第一混洗单元的混洗类型。Step 3: Determine the shuffling type of the first shuffling unit according to the second difference value corresponding to the first shuffling unit.
步骤四,如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且第二差值为正数,则确定该第一混洗单元的混洗类型为高编码类型。Step 4: If the absolute value of the second difference corresponding to the first shuffle unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, then determine the shuffle of the first shuffle unit The type is a high encoding type.
步骤五,如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且第二差值为负数,则确定该第一混洗单元的混洗类型为低编码类型。 Step 5. If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, determine the shuffling type of the first shuffling unit It is a low encoding type.
步骤六,如果该第一混洗单元对应的第二差值的绝对值小于第二预设差值阈值,则确定该第一混洗单元的混洗类型为中编码类型。 Step 6. If the absolute value of the second difference value corresponding to the first shuffling unit is smaller than the second preset difference value threshold, it is determined that the shuffling type of the first shuffling unit is a medium coding type.
步骤1401的处理过程与步骤601的处理过程类似,此处不再赘述。The processing procedure of step 1401 is similar to the processing procedure of step 601, and will not be repeated here.
步骤1402,根据各第一混洗单元的混洗类型和预设的混洗规则,在各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元。Step 1402: Determine an output shuffle unit and an input shuffle unit corresponding to each output shuffle unit in each first shuffle unit according to the shuffle type of each first shuffle unit and preset shuffle rules.
可选的,编解码器根据各第一混洗单元的混洗类型和预设的混洗规则,在各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元的处理过程如下:Optionally, the codec determines the output shuffle unit and the input corresponding to each output shuffle unit in each first shuffle unit according to the shuffle type of each first shuffle unit and preset shuffle rules. The processing process of the shuffling unit is as follows:
步骤一,如果高解码类型的第一目标混洗单元的第一数目大于低解码类型的第二目标混洗单元的第二数目,则将第二目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第一目标混洗单元中,确定至少一个第一目标混洗单元作为该输出混洗单元对应的输入混洗单元。Step 1: If the first number of the first target shuffling units of the high decoding type is greater than the second number of the second target shuffling units of the low decoding type, the second target shuffling unit is determined as the output shuffling unit, and For each output shuffle unit, in the first target shuffle unit, at least one first target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
步骤二,如果高解码类型的第一目标混洗单元的第一数目小于或等于低解码类型的第二目标混洗单元的第二数目,则将第一数目个第二目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第一目标混洗单元中,确定至少一个第一目标混洗单元作为该输出混洗单元对应的输入混洗单元。Step 2: If the first number of the first target shuffling units of the high decoding type is less than or equal to the second number of the second target shuffling units of the low decoding type, the first number of second target shuffling units are determined as Output shuffle units, and for each output shuffle unit, in the first target shuffle unit, at least one first target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
步骤1402的处理过程与步骤602的处理过程类似,此处不再赘述。The processing procedure of step 1402 is similar to the processing procedure of step 602, and will not be repeated here.
步骤1304,将输出混洗单元中第一预设数目个待混洗流块,发送至输入混洗单元,作为输入混洗单元中的第一待解码流块,以通过输入混洗单元根据预设的解码算法对第一待解码流块进行解码。Step 1304: Send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit, so as to pass the input shuffle unit according to the pre-shuffled stream blocks. Suppose the decoding algorithm decodes the first stream block to be decoded.
可选的,针对每个输出混洗单元,将该输出混洗单元中第二预设数目个待混洗流块,发送至该输出混洗单元对应的输入混洗单元,作为该输入混洗单元中的第一待解码流块。Optionally, for each output shuffle unit, the second preset number of stream blocks to be shuffled in the output shuffle unit are sent to the input shuffle unit corresponding to the output shuffle unit as the input shuffle unit The first stream block to be decoded in the unit.
例如,如图16所示,以4个混洗单元为一个混洗组进行混洗,每个混洗单元包含一个解码流为例,解码流1至解码流4的混洗类型为MHLM,则解码流3为输出混洗单元,解码流2为解码流3的输入混洗单元,则解码流1可以向解码流1输出1个待混洗流块,解码流3可以向解码流2输出1个待混洗流块,解码流4可以向解码流4输出1个待混洗流块。这样,如图17所示,混洗完成后解码流1的编码长度为N+8,解码流2的编码长度为N+9,解码流3的编码长度为N+3,解码流4的编码长度为N+6,解码流1至解码流4的混洗类型为MMMM。For example, as shown in Figure 16, four shuffle units are used as a shuffle group for shuffling, and each shuffle unit contains a decoded stream as an example. The shuffle type of decoded stream 1 to decoded stream 4 is MHLM, then Decoding stream 3 is the output shuffling unit, and decoding stream 2 is the input shuffling unit of decoded stream 3. Then decoded stream 1 can output 1 block to be shuffled to decoded stream 1, and decoded stream 3 can output 1 to decoded stream 2. The decoding stream 4 can output one stream block to be shuffled to the decoding stream 4. Thus, as shown in Figure 17, after the shuffling is completed, the encoding length of decoded stream 1 is N+8, the encoding length of decoded stream 2 is N+9, the encoding length of decoded stream 3 is N+3, and the encoding of decoded stream 4 is N+3. The length is N+6, and the shuffling type from decoded stream 1 to decoded stream 4 is MMMM.
步骤1304的处理过程与步骤504的处理过程类似,此处不再赘述。The processing procedure of step 1304 is similar to the processing procedure of step 504, and will not be repeated here.
作为一种可选地实施方式,编解码器根据第二混洗等级,确定待解码数据块对应的至少一个第二混洗组。其中,第二混洗组包含多个第二混洗单元,第二混洗单元包含至少一个解码流。然后,编解码器将各第二混洗单元中的待解码流块作为待混洗流块重新进行混洗处理,直到各第二混洗单元的编码长度满足预设接近度条件。As an optional implementation manner, the codec determines at least one second shuffling group corresponding to the data block to be decoded according to the second shuffling level. Wherein, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one decoded stream. Then, the codec re-shuffles the stream blocks to be decoded in each second shuffle unit as the stream blocks to be shuffled, until the code length of each second shuffle unit meets the preset proximity condition.
在实施中,编解码器根据第一混洗等级对待解码数据块对应的解码流进行混洗后,编解码器还可以进一步根据第二混洗等级,确定待解码数据块对应的至少一个第二混洗组。其中,第二混洗组包含多个第二混洗单元,第二混洗单元包含至少一个解码流。编解码器根据第二混洗等级,确定待解码数据块对应的至少一个第二混洗组的处理过程如步骤1301类似,此处不再赘述。然后,编解码器可以将各第二混洗单元中的待解码流块作为待混洗流块重新进行混洗处理,直到各第二混洗单元的编码长度满足预设接近度条件。In implementation, after the codec shuffles the decoded stream corresponding to the data block to be decoded according to the first shuffling level, the codec may further determine at least one second corresponding to the data block to be decoded according to the second shuffling level. Shuffle group. Wherein, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one decoded stream. The process of the codec determining at least one second shuffling group corresponding to the data block to be decoded according to the second shuffling level is similar to step 1301, and will not be repeated here. Then, the codec may re-shuffle the stream blocks to be decoded in each second shuffle unit as the stream blocks to be shuffled, until the code length of each second shuffle unit meets the preset proximity condition.
需要说明的是,编解码器根据第二混洗等级对待解码数据块对应的解码流进行混洗后,还可以进一步根据第三混洗等级对待解码数据块对应的解码流进行混洗。例如,编解码器可以按照混洗等级1-混洗等级2—混洗等级3对待解码数据块对应的解码流进行混洗,也可以按照混洗等级1-混洗等级3—混洗等级2对待解码数据块对应的解码流进行混洗,还可以按照混洗等级2-混洗等级3—混洗等级1对待解码数据块对应的解码流进行混洗。It should be noted that after the codec shuffles the decoded stream corresponding to the data block to be decoded according to the second shuffling level, it may further shuffle the decoded stream corresponding to the data block to be decoded according to the third shuffling level. For example, the codec can shuffle the decoded stream corresponding to the data block to be decoded according to shuffle level 1-shuffle level 2-shuffle level 3, or according to shuffle level 1-shuffle level 3-shuffle level 2 The decoded stream corresponding to the data block to be decoded is shuffled, and the decoded stream corresponding to the data block to be decoded can also be shuffled according to the shuffling level 2-shuffling level 3-shuffling level 1.
作为一种可选地实施方式,当编解码器检测到多个解码流中的第一解码流解码完成时,将多个解码流中未解码完成的第二解码流中第二预设数目个待解码流块发送至第一解码流,作为第一解码流中的待解码流块。As an optional implementation manner, when the codec detects that the decoding of the first decoded stream among the multiple decoded streams is completed, the second preset number of undecoded second decoded streams among the multiple decoded streams The stream block to be decoded is sent to the first decoded stream as the stream block to be decoded in the first decoded stream.
在实施中,为了进一步平衡各个解码流的编码长度,提高小数据块解码时的解码率。编解码器中可以预先存储有第三预设数目。该第三预设数目可以由技术人员根据经验进行设置。当编解码器检测到多个解码流中的第一解码流解码完成(也即第一解码流输出解码流结束(StreamFinish)标记)时,可以将多个解码流中未解码完成的第二解码流中第三预设数目个待解码流块发送至第一解码流,作为第一解码流中的待解码流块。其中,第二解码流可以为多个解码流中全部的未解码完成的解码流,也可以为多个解码流中部分的未解码完成的解码流。In implementation, in order to further balance the encoding length of each decoded stream, the decoding rate when decoding small data blocks is improved. The third preset number may be pre-stored in the codec. The third preset number can be set by a technician based on experience. When the codec detects that the decoding of the first decoded stream in the multiple decoded streams is completed (that is, the first decoded stream outputs the decoded stream end (StreamFinish) mark), it can decode the uncompleted second decoded in the multiple decoded streams The third preset number of stream blocks to be decoded in the stream are sent to the first decoded stream as the stream blocks to be decoded in the first decoded stream. Wherein, the second decoded stream may be all undecoded decoded streams of the multiple decoded streams, or may be part of the undecoded decoded streams of the multiple decoded streams.
作为一种可选地实施方式,编解码器获取解码流的处理过程如下:As an optional implementation manner, the processing procedure for the codec to obtain the decoded stream is as follows:
步骤一,获取待解码数据对应的编码头数据。Step 1: Obtain the encoding header data corresponding to the data to be decoded.
在实施中,对于编码数据块,如图10所示,编解码器采用头-数据块(header-data block)映射的形式进行存储。当编解码器需要获取待解码数据时,编解码器需要先获取待解码数据对应的编码头数据。如图 18所示,编码头数据的格式为二维格式,低维为X,高维维Y,编码头数据的大小为低维编码头大小(head size X)*高维编码头大小(head size Y)。编码头数据可以进一步在二维上均匀的划分为多个编码头块(block)。In the implementation, for the coded data block, as shown in FIG. 10, the codec uses a header-data block mapping form for storage. When the codec needs to obtain the data to be decoded, the codec needs to first obtain the encoding header data corresponding to the data to be decoded. As shown in Figure 18, the encoding header data format is a two-dimensional format, the low dimension is X, the high dimension Y, and the size of the encoding header data is the low dimension encoding header size (head size X) * high dimension encoding header size (head size Y) ). The encoding header data can be further divided into a plurality of encoding header blocks evenly in two dimensions.
步骤二,根据接收到的解码指令,在编码头数据中,确定解码指令对应的包含至少一个编码头块的解码区域,并获取至少一个编码头块对应的至少一个待解码数据块。其中,编码头块中包含编码头块对应的编码数据块的存储地址。Step 2: According to the received decoding instruction, in the encoding header data, a decoding area containing at least one encoding header block corresponding to the decoding instruction is determined, and at least one to-be-decoded data block corresponding to the at least one encoding header block is obtained. Wherein, the encoding header block contains the storage address of the encoded data block corresponding to the encoding header block.
在实施中,编解码器获取到编码头数据后,可以根据接收到的解码指令,在编码头数据中,确定解码指令对应的包含至少一个编码头块的解码区域。如图18所示,解码区域的起始地址为编码头起始(head start)位置,可以通过低维编码头偏移(head offset X)和高维编码头偏移(head offset Y)得到。该解码区域在低维方向上包含低维编码头数目(head number X)个编码头块,在高维上包含高维编码头数目(head number Y)个编码头块。其中,编码头块中包含编码头块对应的编码数据块的存储地址。编解码器得到解码区域后,针对解码区域中的每个编码头块,编解码器可以根据该编码头块中存储的编码数据块的存储地址,获取待解码数据块。In implementation, after the codec obtains the coded header data, it can determine the decoding area containing at least one coded header block corresponding to the decoded instruction in the coded header data according to the received decoding instruction. As shown in FIG. 18, the start address of the decoding area is the head start position of the encoding head, which can be obtained by the low-dimensional encoding head offset (head offset X) and the high-dimensional encoding head offset (head offset Y). The decoding area includes the number of low-dimensional encoding headers (head number X) encoding header blocks in the low-dimensional direction, and the number of high-dimensional encoding headers (head number Y) encoding header blocks in the high-dimensional direction. Wherein, the encoding header block contains the storage address of the encoded data block corresponding to the encoding header block. After the codec obtains the decoding area, for each code header block in the decoding area, the codec can obtain the data block to be decoded according to the storage address of the coded data block stored in the code header block.
步骤三,针对至少一个待解码数据块中的每个待解码数据块,将该待解码数据块划分为多个流块,并将多个流块发送至该待解码数据块对应的多个解码流,作为多个解码流中的待混洗流块。Step 3: For each data block to be decoded in at least one data block to be decoded, the data block to be decoded is divided into multiple stream blocks, and the multiple stream blocks are sent to multiple decodes corresponding to the data block to be decoded Stream, as a stream block to be shuffled in multiple decoded streams.
在实施中,为了提高解码的吞吐量,编解码器可以通过多个解码流并行对同一待解码数据块进行解码。同理,编解码器在进行混洗时,针对每个待解码数据块,编解码器可以将该待解码数据块划分为多个流块,并将多个流块发送至该待解码数据块对应的多个解码流,作为多个解码流中的待混洗流块。可选的,编解码器可以将待解码数据块划分成多个行序列,每个行序列中包含至少一个待解码数据子块。然后,针对每个行序列中的每个待解码数据子块,编解码器可以将该待解码数据子块划分为多个流块。这样,可以保证每个解码流中的流块的数目相近。In implementation, in order to improve the decoding throughput, the codec can decode the same data block to be decoded in parallel through multiple decoding streams. Similarly, when the codec shuffles, for each data block to be decoded, the codec can divide the data block to be decoded into multiple stream blocks, and send the multiple stream blocks to the data block to be decoded The corresponding multiple decoded streams are used as stream blocks to be shuffled in the multiple decoded streams. Optionally, the codec may divide the data block to be decoded into multiple row sequences, and each row sequence contains at least one data sub-block to be decoded. Then, for each sub-block of data to be decoded in each row sequence, the codec may divide the sub-block of data to be decoded into multiple stream blocks. In this way, it can be ensured that the number of stream blocks in each decoded stream is close.
可选的,打包格式下,待解码数据块由编码数据组成,编码数据的大小等于待编码数据块中待编码数据编码后的大小。Optionally, in the packed format, the data block to be decoded is composed of encoded data, and the size of the encoded data is equal to the encoded size of the data to be encoded in the data block to be encoded.
在实施中,如图10所示,打包格式下,解码数据块紧密存放,每个解码数据块由编码数据组成,编码数据的大小等于待编码数据块中待编码数据编码后的大小。也即,解码数据块占据的空间为待编码数据块编码后的实际大小。In the implementation, as shown in FIG. 10, in the packed format, the decoded data blocks are tightly stored, and each decoded data block is composed of encoded data, and the size of the encoded data is equal to the encoded size of the data to be encoded in the data block to be encoded. That is, the space occupied by the decoded data block is the actual size of the data block to be encoded after encoding.
可选的,非打包格式下,待解码数据块由编码数据和填充数据组成,编码数据的大小和填充数据的大小之和等于待编码数据块的大小。Optionally, in the non-packed format, the data block to be decoded is composed of encoded data and padding data, and the sum of the size of the encoded data and the size of the padding data is equal to the size of the data block to be encoded.
在实施中,如图10所示,非打包格式下,每个解码数据块由编码数据和填充数据组成,编码数据的大小和填充数据的大小之和等于待编码数据块的大小。也即,每个解码数据块都占用相同的空间,且等于编码前一个完整的待编码数据块的大小。其中,前一部分为编码数据,后一部分为保留的填充数据。In the implementation, as shown in FIG. 10, in the non-packed format, each decoded data block is composed of encoded data and padding data, and the sum of the size of the encoded data and the size of the padding data is equal to the size of the data block to be encoded. That is, each decoded data block occupies the same space and is equal to the size of a complete data block to be encoded before encoding. Among them, the former part is encoded data, and the latter part is reserved padding data.
可选的,待解码数据块由属于同一源数据块中的多个源数据子块对应的编码数据子块组成。在打包格式下,编码数据子块由编码数据组成,编码数据的大小等于源数据子块中待编码数据编码后的大小。在非打包格式下,编码数据子块由编码数据和填充数据组成,编码数据的大小和填充数据的大小之和等于源数据子块的大小。Optionally, the data block to be decoded is composed of encoded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block. In the packed format, the coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block. In the unpacked format, the coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.
在实施中,编解码器根据不同的编码指令,在源数据中确定多个编码区域时,可能会将一个完整的源数据块切分成多个源数据子块。其中,各编码指令对应的编码区域在相邻的那一侧,要么都编码完整的源数据块,而且源数据块之间互不重叠;要么各自编码同一源数据块的一部分(也即源数据子块),且各源数据子块在源数据块内部的边界正好重叠。如图11所示,四个编码指令在源数据中确定出的四个编码区域将部分源数据块(以灰色斜线方块表示)切分成多个源数据子块,同一源数据块中的各源数据子块的边界正好重叠。编解码器根据不同编码指令对同一源数据块中的各源数据子块进行编码,得到编码数据子块。编解码器在对同一源数据块中的多个源数据子块对应的编码数据子块进行存储时,可以将该编码数据子块存储至同一编码数据块中。这样,可以实现多条编码指令协同完成特定编码区域的拼接,其效果与通过一条编码指令进行编码完全相同,并且这些编码指令的执行顺序可以任意甚至并发执行,从而在多核的源数据划分和单核内部为了流水执行而分块的情况下,能够将编码任务进行划分。In implementation, when the codec determines multiple coding regions in the source data according to different coding instructions, it may divide a complete source data block into multiple source data sub-blocks. Among them, the encoding area corresponding to each encoding instruction is on the adjacent side, and either all encode complete source data blocks, and the source data blocks do not overlap each other; or each encode a part of the same source data block (that is, the source data Sub-block), and the boundary of each source data sub-block within the source data block exactly overlaps. As shown in Figure 11, the four coding regions determined by the four coding instructions in the source data divide a part of the source data block (represented by gray diagonal squares) into multiple source data sub-blocks, each of the same source data block The boundaries of the source data sub-blocks exactly overlap. The codec encodes each source data sub-block in the same source data block according to different coding instructions to obtain the coded data sub-block. When the codec stores the coded data sub-blocks corresponding to multiple source data sub-blocks in the same source data block, the coded data sub-blocks may be stored in the same coded data block. In this way, multiple coding instructions can be realized to complete the splicing of specific coding regions. The effect is exactly the same as that of coding through one coding command, and the execution order of these coding commands can be executed arbitrarily or even concurrently, so that in the multi-core source data division and single When the core is divided into blocks for pipeline execution, the coding task can be divided.
如图12A所示,一个源数据块在低维和高维均被划分为两部分,使得该源数据块划分为4个源数据子 块,分别为TL(top-left),TR(top-right),BL(bottom-left)和BR(bottom-right)。其中,每个源数据子块的大小如图12A所示,编解码器可以通过源数据块内部的block left,block right,block top,block bottom四个参数指定。每个源数据子块可以是编码数据,也可以是非编码数据。在非打包格式下的编码数据块中,上述4个源数据子块对应4个编码数据子块可以按照TL-TR-BL-BR的固定顺序存储,每个编码数据子块由编码数据和填充数据组成,编码数据的大小和填充数据的大小之和等于源数据子块的大小。也即,每个编码数据子块所占据的空间为该编码数据子块对应的源数据子块编码前的大小。这样,编码数据块的空间与源数据块的大小相同,从而保证了如果源数据块的每个源数据子块都是由不同的编码指令进行编码,每条编码指令都可以根据划分信息(可以通过指令域计算得到)计算出所负责的编码数据子块的地址,从而实现多条编码指令结果的拼接。As shown in Figure 12A, a source data block is divided into two parts in both low and high dimensions, so that the source data block is divided into 4 source data sub-blocks, namely TL (top-left), TR (top-right), BL (bottom-left) and BR (bottom-right). Among them, the size of each source data sub-block is shown in Figure 12A. The codec can be specified by the four parameters of block left, block right, block top, and block bottom in the source data block. Each source data sub-block can be encoded data or non-encoded data. In the coded data block in the unpacked format, the 4 source data sub-blocks corresponding to the 4 coded data sub-blocks can be stored in a fixed order of TL-TR-BL-BR, and each coded data sub-block is filled with coded data and Data composition, the sum of the size of the encoded data and the size of the padding data is equal to the size of the source data sub-block. That is, the space occupied by each coded data sub-block is the size of the source data sub-block corresponding to the coded data sub-block before coding. In this way, the space of the coded data block is the same as the size of the source data block, thus ensuring that if each source data sub-block of the source data block is coded by a different coding instruction, each coding instruction can be divided according to the information (can be Calculate the address of the sub-block of encoded data in charge by calculating the instruction domain, so as to realize the splicing of the results of multiple encoding instructions.
如图12A所示,编解码器可以通过编码移动(Move)等方式将非打包格式下的编码数据块转化为打包格式下的编码数据块。在打包格式下的编码数据块中,每个编码数据子块由编码数据组成,编码数据的大小等于源数据子块中待编码数据编码后的大小。其中,各编码数据子块之间紧密存放,每个编码数据子块的起始地址需要根据前面的编码数据子块的实际大小累加获得,整个编码数据块所占据的空间就是所有编码数据子块的大小之和。As shown in FIG. 12A, the codec can convert the coded data block in the non-packed format into the coded data block in the packed format by means such as a code move (Move). In the coded data block in the packed format, each coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block. Among them, the coded data sub-blocks are tightly stored, and the starting address of each coded data sub-block needs to be accumulated according to the actual size of the previous coded data sub-blocks. The space occupied by the entire coded data block is all the coded data sub-blocks. The sum of the sizes.
如图12B所示,一个源数据块在高维被划分为两部分,使得该源数据块划分为2个源数据子块,分别为TL和BL,或者BL和BR。如图12C所示,一个源数据块在低维被划分为两部分,使得该源数据块划分为2个源数据子块,分别为TL和TR,或者TR和BR。As shown in FIG. 12B, a source data block is divided into two parts in a high dimension, so that the source data block is divided into two source data sub-blocks, namely TL and BL, or BL and BR. As shown in FIG. 12C, a source data block is divided into two parts in a low dimension, so that the source data block is divided into two source data sub-blocks, namely TL and TR, or TR and BR.
一个源数据块在低维和高维均不进行划分,仅有一个源数据子块,该源数据子块可以为TL、TR、BL或BR。如图12D所示,一个源数据块仅有TL一个源数据子块。A source data block is not divided into low-dimensional and high-dimensional. There is only one source data sub-block, and the source data sub-block can be TL, TR, BL, or BR. As shown in Figure 12D, one source data block has only one source data sub-block TL.
可选的,解码时的数据划分与编码时可能不同,当解码指令的数据划分与编码数据块的划分不对齐时,就会有编码时的边界数据块,对于边界数据块,如果它只有TL部分,那么如果这部分是未编码的源数据形式,那么可以只读出所需要的部分,如果是已编码的编码数据形式,那么需要对整个编码数据块解压后,只将需要的部分写到目的地址。如果边界数据块本身包含四个部分,并且与编码时的划分不同,那么会出现对于4个编码数据子块的再次划分。如图19所示,实线框表示编码(encode)时的数据划分,虚线框表示了解码时的数据划分,它们的划分点不同,使得解码时的待解码数据块可能是一个编码数据块的一部分,如左斜线方块表示的TL块,也可能是最多4个子数据块的部分拼接而成,如竖线方块表示的BR块。Optionally, the data partition during decoding may be different from that during encoding. When the data partition of the decoding instruction is not aligned with the partition of the encoded data block, there will be a boundary data block during encoding. For the boundary data block, if it has only TL Part, then if this part is the unencoded source data form, then you can read only the required part, if it is the encoded encoded data form, then you need to decompress the entire encoded data block, and only write the required part to Destination address. If the boundary data block itself contains four parts and is different from the division during encoding, then there will be another division of the 4 encoded data sub-blocks. As shown in Figure 19, the solid-line frame represents the data division during encoding, and the dashed frame represents the data division during decoding. Their division points are different, so that the data block to be decoded during decoding may be an encoded data block. A part, such as the TL block represented by the left-slashed square, may also be formed by concatenating parts of up to 4 sub-data blocks, such as the BR block represented by the vertical square.
这种划分共有如图20所示的四种情况,分别对应解码划分的交叉点和编码划分的交叉点不同的位置关系,考虑到每种情况下解码时都需要取4种不同的数据块(TL,TR,BL,BR),解码时共有16种不同的数据块。此处只考虑了最一般的情形,其它的划分不足4块或者编码和解码时的划分对齐的情况可以看做这4类情况的特例。There are four cases of this division as shown in Figure 20, which correspond to the different positional relationship between the intersection of the decoding division and the intersection of the encoding division. Considering that in each case, 4 different data blocks need to be taken when decoding ( TL, TR, BL, BR), there are a total of 16 different data blocks when decoding. Only the most general case is considered here, and the case where other divisions are less than 4 blocks or the divisions during encoding and decoding are aligned can be regarded as special cases of these 4 types of cases.
本申请实施例提供了一种混洗方法。编解码器根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组。其中,第一混洗组包含多个第一混洗单元,第一混洗单元包含至少一个解码流。然后,编解码器确定各第一混洗单元的编码长度,根据各第一混洗单元的编码长度,在各第一混洗单元中,确定输出混洗单元和输入混洗单元。之后,编解码器将输出混洗单元中第一预设数目个待混洗流块,发送至输入混洗单元,作为输入混洗单元中的第一待解码流块,以通过输入混洗单元根据预设的解码算法对第一待解码流块进行解码。这样,通过对待解码数据块的各解码流进行混洗,可以保证各解码流的编码长度相近,从而避免由于各个解码流之间的对齐要求造成的补数过多,进而降低解码流。同时,还可以避免各解码流之间产生死锁情况。The embodiment of the present application provides a shuffling method. The codec determines at least one first shuffling group corresponding to the data block to be decoded according to the first shuffling level. Wherein, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one decoded stream. Then, the codec determines the encoding length of each first shuffling unit, and according to the encoding length of each first shuffling unit, in each first shuffling unit, determines the output shuffling unit and the input shuffling unit. After that, the codec sends the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream block to be decoded in the input shuffle unit to pass the input shuffle unit The first stream block to be decoded is decoded according to a preset decoding algorithm. In this way, by shuffling the decoded streams of the data block to be decoded, it is possible to ensure that the encoding lengths of the decoded streams are similar, so as to avoid excessive complements due to alignment requirements between the decoded streams, thereby reducing the decoded stream. At the same time, it can also avoid deadlocks between each decoded stream.
本申请实施例还提供了一种混洗装置,如图21所示,该装置包括:The embodiment of the present application also provides a shuffling device. As shown in FIG. 21, the device includes:
第一确定模块2110,用于根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组,第一混洗组包含多个第一混洗单元,第一混洗单元包含至少一个编码流;The first determining module 2110 is configured to determine at least one first shuffle group corresponding to the data block to be encoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes At least one coded stream;
第二确定模块2120,用于确定各第一混洗单元的编码长度;The second determining module 2120 is configured to determine the code length of each first shuffling unit;
第三确定模块2130,用于根据各第一混洗单元的编码长度,在各第一混洗单元中,确定输出混洗单元和输入混洗单元;The third determining module 2130 is configured to determine the output shuffle unit and the input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
发送模块2140,用于将输出混洗单元中第一预设数目个待混洗流块,发送至输入混洗单元,作为输入混洗单元中的第一待编码流块,以通过输入混洗单元根据预设的编码算法对第一待编码流块进行编码。The sending module 2140 is used to send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream block to be coded in the input shuffle unit to pass the input shuffle The unit encodes the first stream block to be encoded according to a preset encoding algorithm.
本申请实施例还提供了一种混洗装置,如图22所示,该装置包括:The embodiment of the present application also provides a shuffling device. As shown in FIG. 22, the device includes:
第一确定模块2210,用于根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组,第一混洗组包含多个第一混洗单元,第一混洗单元包含至少一个解码流;The first determining module 2210 is configured to determine at least one first shuffle group corresponding to the data block to be decoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes At least one decoded stream;
第二确定模块2220,用于确定各第一混洗单元的编码长度;The second determining module 2220 is configured to determine the code length of each first shuffling unit;
第三确定模块2230,用于根据各第一混洗单元的编码长度,在各第一混洗单元中,确定输出混洗单元和输入混洗单元;The third determining module 2230 is configured to determine the output shuffle unit and the input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
发送模块2240,用于将输出混洗单元中第一预设数目个待混洗流块,发送至输入混洗单元,作为输入混洗单元中的第一待解码流块,以通过输入混洗单元根据预设的解码算法对第一待解码流块进行解码。The sending module 2240 is used to send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream block to be decoded in the input shuffle unit to pass the input shuffle The unit decodes the first stream block to be decoded according to a preset decoding algorithm.
在一个实施例中,提供了一种计算机设备,如图23所示,包含存储器及处理器,所述存储器上存储有可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述混洗方法步骤。In one embodiment, a computer device is provided, as shown in FIG. 23, including a memory and a processor, the memory stores a computer program that can run on the processor, and the processor executes the computer program When realizing the above-mentioned shuffling method steps.
在一个实施例中,一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述混洗方法的步骤。In one embodiment, a computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned shuffling method are realized.
在一个实施例中,一种芯片系统,包含处理器,所述处理器和存储器耦合,所述存储器存储有程序指令,当所述存储器存储的程序指令被所述处理器执行时实现上述混洗方法。In one embodiment, a chip system includes a processor, the processor is coupled to a memory, the memory stores program instructions, and the above shuffling is implemented when the program instructions stored in the memory are executed by the processor method.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本披露并不受所描述的动作顺序的限制,因为依据本披露,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作和模块并不一定是本披露所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited by the described sequence of actions. Because according to this disclosure, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the involved actions and modules are not necessarily required by the disclosure.
进一步需要说明的是,虽然图2-4的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-4中的至少一部分步骤可以包含多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be further noted that although the steps in the flowcharts of FIGS. 2-4 are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order for the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in Figures 2-4 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. These sub-steps or stages The execution order of is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
应该理解,上述的装置实施例仅是示意性的,本披露的装置还可通过其它的方式实现。例如,上述实施例中所述单元/模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如,多个单元、模块或组件可以结合,或者可以集成到另一个系统,或一些特征可以忽略或不执行。It should be understood that the above device embodiments are only illustrative, and the device of the present disclosure may also be implemented in other ways. For example, the division of units/modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components may be combined or integrated into another system, or some features may be omitted or not implemented.
另外,若无特别说明,在本披露各个实施例中的各功能单元/模块可以集成在一个单元/模块中,也可以是各个单元/模块单独物理存在,也可以两个或两个以上单元/模块集成在一起。上述集成的单元/模块既可以采用硬件的形式实现,也可以采用软件程序模块的形式实现。In addition, unless otherwise specified, the functional units/modules in the various embodiments of the present disclosure may be integrated into one unit/module, or each unit/module may exist alone physically, or two or more units/modules may exist. The modules are integrated together. The above-mentioned integrated unit/module can be implemented in the form of hardware or software program module.
所述集成的单元/模块如果以硬件的形式实现时,该硬件可以是数字电路,模拟电路等等。硬件结构的物理实现包含但不局限于晶体管,忆阻器等等。若无特别说明,所述人工智能处理器可以是任何适当的硬件处理器,比如CPU、GPU、FPGA、DSP和ASIC等等。若无特别说明,所述存储单元可以是任何适当的磁存储介质或者磁光存储介质,比如,阻变式存储器RRAM(Resistive Random Access Memory)、动态随机存取存储器DRAM(Dynamic Random Access Memory)、静态随机存取存储器SRAM(Static Random-Access Memory)、增强动态随机存取存储器EDRAM(Enhanced Dynamic Random Access Memory)、高带宽内存HBM(High-Bandwidth Memory)、混合存储立方HMC(Hybrid Memory Cube)等等。If the integrated unit/module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, and so on. The physical realization of the hardware structure includes but is not limited to transistors, memristors and so on. Unless otherwise specified, the artificial intelligence processor may be any appropriate hardware processor, such as CPU, GPU, FPGA, DSP, ASIC, and so on. Unless otherwise specified, the storage unit may be any suitable magnetic storage medium or magneto-optical storage medium, such as RRAM (Resistive Random Access Memory), DRAM (Dynamic Random Access Memory), Static random access memory SRAM (Static Random-Access Memory), enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), high-bandwidth memory HBM (High-Bandwidth Memory), hybrid storage cube HMC (Hybrid Memory Cube), etc. Wait.
所述集成的单元/模块如果以软件程序模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本披露的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包含若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本披露各个实施例所述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit/module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer readable memory. Based on this understanding, the technical solution of the present disclosure essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory. It contains a number of instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present disclosure. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。上述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各 个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。In the above-mentioned embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in an embodiment, reference may be made to related descriptions of other embodiments. The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the various technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should all be combined. It is considered as the range described in this specification.
依据以下条款可更好地理解前述内容:The foregoing can be better understood according to the following clauses:
条款A1,对应权1;条款A2,对应权2;条款A3,对应权3;条款A4,对应权4;条款A5,对应权5;条款A6,对应权6;条款A7,对应权7;条款A8,对应权8;条款A9,对应权9;条款A10,对应权10;条款A11,对应权11;条款A12,对应权12;条款A13,对应权13;条款A14,对应权14;条款A15,对应权15;条款A16,对应权16;条款A17,对应权17;条款A18,对应权18;条款A19,对应权19;条款A20,对应权20;条款A21,对应权21;条款A22,对应权22;条款A23,对应权23;条款A24,对应权24;条款A25,对应权25;条款A26,对应权26;条款A27,对应权27;条款A28,对应权28;条款A29,对应权29;条款A30,对应权30;条款A31,对应权31;条款A32,对应权32;条款A33,对应权33;条款A34,对应权34;条款A35,对应权35;条款A36,对应权36;条款A37,对应权37;条款A38,对应权38;条款A39,对应权39;条款A40,对应权40;条款A41,对应权41;条款A42,对应权42;条款A43,对应权43。Clause A1, corresponding right 1; clause A2, corresponding right 2; clause A3, corresponding right 3; clause A4, corresponding right 4; clause A5, corresponding right 5; clause A6, corresponding right 6; clause A7, corresponding right 7; clause A8, corresponding right 8; clause A9, corresponding right 9; clause A10, corresponding right 10; clause A11, corresponding right 11; clause A12, corresponding right 12; clause A13, corresponding right 13; clause A14, corresponding right 14; clause A15 , Correspondence Rights 15; Clause A16, Correspondence Rights 16; Clause A17, Correspondence Rights 17; Clauses A18, Correspondence Rights 18; Clauses A19, Correspondence Rights 19; Clauses A20, Correspondence Rights 20; Correspondence Rights 22; Clause A23, Correspondence Rights 23; Clauses A24, Correspondence Rights 24; Clauses A25, Correspondence Rights 25; Clauses A26, Correspondence Rights 26; Clauses A27, Correspondence Rights 27; Clauses A28, Correspondence Rights 28; Right 29; Article A30, Corresponding Right 30; Article A31, Corresponding Right 31; Article A32, Corresponding Right 32; Article A33, Corresponding Right 33; Article A34, Corresponding Right 34; Article A35, Corresponding Right 35; Article A36, Corresponding Right 36; Article A37, corresponding right 37; Article A38, corresponding right 38; Article A39, corresponding right 39; Article A40, corresponding right 40; Article A41, corresponding right 41; Article A42, corresponding right 42; Article A43, corresponding right 43 .
例如,条款A1、一种混洗方法,所述方法包括:For example, clause A1, a shuffling method, the method includes:
根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个编码流;According to the first shuffling level, at least one first shuffle group corresponding to the data block to be encoded is determined, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one coded stream ;
确定各第一混洗单元的编码长度;Determine the code length of each first shuffling unit;
根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;Determine an output shuffle unit and an input shuffle unit in each of the first shuffle units according to the code length of each of the first shuffle units;
将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待编码流块,以通过所述输入混洗单元根据预设的编码算法对所述第一待编码流块进行编码。Send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be encoded in the input shuffle unit to pass the input The shuffling unit encodes the first stream block to be encoded according to a preset encoding algorithm.
条款A2、根据条款A1所述的方法,所述根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组,包括:Clause A2, the method according to clause A1, the determining at least one first shuffling group corresponding to the data block to be encoded according to the first shuffling level includes:
获取待编码数据块对应的多个编码流;Acquiring multiple coded streams corresponding to the data block to be coded;
根据第一混洗等级,将所述多个编码流划分为多个第一混洗单元,并将所述多个第一混洗单元划分为至少一个第一混洗组,所述第一混洗单元包含至少一个编码流,所述第一混洗组包含多个第一混洗单元。According to the first shuffling level, the multiple encoded streams are divided into multiple first shuffling units, and the multiple first shuffling units are divided into at least one first shuffling group. The shuffling unit includes at least one coded stream, and the first shuffling group includes a plurality of first shuffling units.
条款A3、根据条款A1所述的方法,所述确定各第一混洗单元的编码长度,包括:Clause A3. According to the method of clause A1, the determining the coding length of each first shuffling unit includes:
针对每个第一混洗组中的每个第一混洗单元,将该第一混洗单元包含的编码流中的待编码流块的总编码长度,确定为该第一混洗单元的编码长度。For each first shuffle unit in each first shuffle group, determine the total code length of the stream block to be coded in the coded stream contained in the first shuffle unit as the code of the first shuffle unit length.
条款A4、根据条款A1所述的方法,所述根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元,包括:Clause A4. The method according to clause A1, wherein determining an output shuffling unit and an input shuffling unit in each of the first shuffling units according to the coding length of each of the first shuffling units includes:
根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型;Determine the shuffling type of each first shuffling unit according to the code length of each first shuffling unit;
根据所述各第一混洗单元的混洗类型和预设的混洗规则,在所述各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元;According to the shuffling type of each first shuffling unit and preset shuffling rules, in each of the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit are determined ;
所述将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待编码流块,包括:The sending the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be coded in the input shuffle unit includes:
针对每个输出混洗单元,将该输出混洗单元中第二预设数目个待混洗流块,发送至该输出混洗单元对应的输入混洗单元,作为该输入混洗单元中的第一待编码流块。For each output shuffle unit, the second preset number of stream blocks to be shuffled in the output shuffle unit are sent to the input shuffle unit corresponding to the output shuffle unit as the first in the input shuffle unit. A stream block to be encoded.
条款A5、根据条款A4所述的方法,所述根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型,包括:Clause A5. The method according to clause A4, wherein the determining the shuffling type of each first shuffling unit according to the coding length of each first shuffling unit includes:
针对所述各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与其他第一混洗单元的编码长度的第一差值;For each first shuffling unit in each of the first shuffling units, determine a first difference between the code length of the first shuffling unit and the code lengths of other first shuffling units;
根据该第一混洗单元对应的第一差值,确定该第一混洗单元的混洗类型。The shuffling type of the first shuffling unit is determined according to the first difference corresponding to the first shuffling unit.
条款A6、根据条款A5所述的方法,所述根据该第一混洗单元对应的第一差值,确定该第一混洗单元的混洗类型,包括:Clause A6. The method according to clause A5, wherein the determining the shuffling type of the first shuffling unit according to the first difference corresponding to the first shuffling unit includes:
如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且所述目标差值均为正数,则确定该第一混洗单元的混洗类型为高编码类型;If there is a target difference in the first difference corresponding to the first shuffling unit whose absolute value is greater than or equal to the first preset difference threshold, and the target difference is all positive, then the first shuffle is determined The shuffling type of the unit is a high coding type;
如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且所述目标差值中存在负数的目标差值,则确定该第一混洗单元的混洗类型为低编码类型。If there is a target difference in the first difference corresponding to the first shuffle unit whose absolute value is greater than or equal to the first preset difference threshold, and there is a negative target difference in the target difference, then the first difference is determined The shuffling type of a shuffling unit is a low coding type.
条款A7、根据条款A6所述的方法,所述方法还包括:Clause A7. The method according to clause A6, the method further comprising:
如果该第一混洗单元对应的第一差值中不存在绝对值大于或等于第一预设差值阈值的目标差值,则确定该第一混洗单元的混洗类型为中编码类型。If the first difference corresponding to the first shuffling unit does not have a target difference with an absolute value greater than or equal to the first preset difference threshold, it is determined that the shuffling type of the first shuffling unit is a medium coding type.
条款A8、根据条款A4所述的方法,所述根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型,包括:Clause A8. The method according to clause A4, wherein the determining the shuffling type of each first shuffling unit according to the coding length of each first shuffling unit includes:
根据所述各第一混洗单元的编码长度,确定平均编码长度;Determine an average code length according to the code length of each first shuffling unit;
针对所述各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与所述平均编码长度的第二差值;For each first shuffling unit in each of the first shuffling units, determine a second difference between the code length of the first shuffling unit and the average code length;
根据该第一混洗单元对应的第二差值,确定该第一混洗单元的混洗类型。The shuffling type of the first shuffling unit is determined according to the second difference value corresponding to the first shuffling unit.
条款A9、根据条款A8所述的方法,所述根据该第一混洗单元对应的第二差值,确定该第一混洗单元的混洗类型,包括:Clause A9. The method according to clause A8, wherein the determining the shuffling type of the first shuffling unit according to the second difference value corresponding to the first shuffling unit includes:
如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且所述第二差值为正数,则确定该第一混洗单元的混洗类型为高编码类型;If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, then the shuffling type of the first shuffling unit is determined High coding type;
如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且所述第二差值为负数,则确定该第一混洗单元的混洗类型为低编码类型。If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, it is determined that the shuffling type of the first shuffling unit is Low encoding type.
条款A10、根据条款A9所述的方法,所述方法还包括:Clause A10. The method according to clause A9, the method further comprising:
如果该第一混洗单元对应的第二差值的绝对值小于第二预设差值阈值,则确定该第一混洗单元的混洗类型为中编码类型。If the absolute value of the second difference value corresponding to the first shuffling unit is smaller than the second preset difference value threshold, it is determined that the shuffling type of the first shuffling unit is a medium coding type.
条款A11、根据条款A4所述的方法,所述根据所述各第一混洗单元的混洗类型和预设的混洗规则,在所述各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元,包括:Clause A11. The method according to clause A4, wherein according to the shuffling type of each first shuffling unit and a preset shuffling rule, in each first shuffling unit, an output shuffling unit is determined And the input shuffle unit corresponding to each output shuffle unit, including:
如果高编码类型的第一目标混洗单元的第一数目小于或等于低编码类型的第二目标混洗单元的第二数目,则将第一目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第二目标混洗单元中,确定至少一个第二目标混洗单元作为该输出混洗单元对应的输入混洗单元;If the first number of the first target shuffle unit of the high coding type is less than or equal to the second number of the second target shuffle unit of the low coding type, the first target shuffle unit is determined as the output shuffle unit, and the For each output shuffle unit, in the second target shuffle unit, determine at least one second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit;
如果高编码类型的第一目标混洗单元的第一数目大于低编码类型的第二目标混洗单元的第二数目,则将第二数目个第一目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第二目标混洗单元中,确定至少一个第二目标混洗单元作为该输出混洗单元对应的输入混洗单元。If the first number of first target shuffle units of the high coding type is greater than the second number of second target shuffle units of the low coding type, then the second number of first target shuffle units are determined as output shuffle units, And for each output shuffle unit, in the second target shuffle unit, at least one second target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
条款A12、根据条款A1所述的方法,所述方法还包括:Clause A12. The method according to clause A1, the method further comprising:
获取待编码的源数据;Obtain the source data to be encoded;
根据接收到的编码指令,在所述源数据中,确定所述编码指令对应的编码区域,所述编码区域包含至少一个待编码数据块,所述待编码数据块为源数据块或源数据子块;According to the received encoding instruction, in the source data, the encoding area corresponding to the encoding instruction is determined, the encoding area includes at least one data block to be encoded, and the data block to be encoded is a source data block or a source data sub Piece;
针对所述至少一个待编码数据块中的每个待编码数据块,将该待编码数据块划分为多个流块,并将所述多个流块发送至该待编码数据块对应的多个编码流,作为所述多个编码流中的待混洗流块。For each to-be-coded data block in the at least one to-be-coded data block, divide the to-be-coded data block into multiple stream blocks, and send the multiple stream blocks to a plurality of corresponding to the to-be-coded data block The coded stream is used as a stream block to be shuffled in the multiple coded streams.
条款A13、根据条款A1所述的方法,所述方法还包括:Clause A13. The method according to clause A1, the method further comprising:
当检测到多个编码流中的第一编码流编码完成时,将所述多个编码流中未编码完成的第二编码流中第四预设数目个待编码流块发送至所述第一编码流,作为所述第一编码流中的待编码流块。When it is detected that the encoding of the first encoded stream among the plurality of encoded streams is completed, the fourth preset number of to-be-encoded stream blocks in the second encoded streams that have not been encoded in the plurality of encoded streams are sent to the first The coded stream is used as the stream block to be coded in the first coded stream.
条款A14、根据条款A1所述的方法,所述方法还包括:Clause A14. The method according to clause A1, the method further comprising:
如果各第一混洗组中待编码流块总编码长度大于所述待编码数据块的原长度,则终止对所述待编码数据块的编码处理。If the total coding length of the to-be-coded stream blocks in each first shuffle group is greater than the original length of the to-be-coded data block, the coding process of the to-be-coded data block is terminated.
条款A15、根据条款A1所述的方法,所述方法包括:Clause A15. The method according to clause A1, the method comprising:
根据第二混洗等级,确定待编码数据块对应的至少一个第二混洗组,所述第二混洗组包含多个第二混洗单元,所述第二混洗单元包含至少一个编码流;According to the second shuffle level, determine at least one second shuffle group corresponding to the data block to be encoded, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one coded stream ;
将各第二混洗单元中的待编码流块作为待混洗流块重新进行混洗处理,直到各第二混洗单元的编码长度满足预设接近度条件。The stream block to be coded in each second shuffling unit is used as the stream block to be shuffled to perform shuffling again until the code length of each second shuffling unit meets the preset proximity condition.
条款A16、根据条款A1所述的方法,所述通过所述输入混洗单元根据预设的编码算法对所述第一待 编码流块进行编码,包括:Clause A16. The method according to clause A1, wherein the encoding of the first stream block to be encoded by the input shuffling unit according to a preset encoding algorithm includes:
根据预设字符对应的第一编码规则,对所述第一待编码流块中包含的预设字符进行编码,得到第一编码数据;Encoding the preset characters included in the first stream block to be encoded according to the first encoding rule corresponding to the preset characters to obtain first encoded data;
根据预设的第二编码规则对所述第一编码数据进行编码。The first encoded data is encoded according to a preset second encoding rule.
条款A17、根据条款A12所述的方法,所述方法还包括:Clause A17. The method according to clause A12, the method further comprising:
生成各待编码数据块对应的编码数据块的编码头块,所述编码头块中包含所述编码头块对应的编码数据块的存储地址;Generating an encoding header block of an encoded data block corresponding to each data block to be encoded, where the encoding header block contains the storage address of the encoded data block corresponding to the encoding header block;
将各编码头块进行存储,并在所述各编码头块之后存储各编码数据块。Store each encoding header block, and store each encoded data block after each encoding header block.
条款A18、根据条款A17所述的方法,所述编码数据块由编码数据组成,所述编码数据的大小等于待编码数据块中待编码数据编码后的大小;或者,Clause A18. The method according to clause A17, wherein the coded data block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the data block to be coded; or,
所述编码数据块由编码数据和填充数据组成,所述编码数据的大小和所述填充数据的大小之和等于待编码数据块的大小。The coded data block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be coded.
条款A19、根据条款A17所述的方法,所述编码数据块由属于同一源数据块中的多个源数据子块对应的编码数据子块组成;Clause A19. The method according to clause A17, wherein the coded data block is composed of coded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block;
所述编码数据子块由编码数据组成,所述编码数据的大小等于源数据子块中待编码数据编码后的大小;或者,The coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block; or,
所述编码数据子块由编码数据和填充数据组成,所述编码数据的大小和所述填充数据的大小之和等于所述源数据子块的大小。The coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.
条款A20、一种混洗方法,所述方法包括:Clause A20. A shuffling method, the method comprising:
根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个解码流;According to the first shuffle level, determine at least one first shuffle group corresponding to the data block to be decoded, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one decoded stream ;
确定各第一混洗单元的编码长度;Determine the code length of each first shuffling unit;
根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;Determine an output shuffle unit and an input shuffle unit in each of the first shuffle units according to the code length of each of the first shuffle units;
将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待解码流块,以通过所述输入混洗单元根据预设的解码算法对所述第一待解码流块进行解码。Send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit to pass the input The shuffling unit decodes the first stream block to be decoded according to a preset decoding algorithm.
条款A21、根据条款A20所述的方法,所述根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组,包括:Clause A21. The method according to clause A20, wherein the determining at least one first shuffling group corresponding to the data block to be decoded according to the first shuffling level includes:
获取待解码数据块对应的多个解码流;Acquiring multiple decoded streams corresponding to the data block to be decoded;
根据第一混洗等级,将所述多个解码流划分为多个第一混洗单元,并将所述多个第一混洗单元划分为至少一个第一混洗组,所述第一混洗单元包含至少一个解码流,所述第一混洗组包含多个第一混洗单元。According to the first shuffling level, the multiple decoded streams are divided into multiple first shuffling units, and the multiple first shuffling units are divided into at least one first shuffling group. The shuffle unit includes at least one decoded stream, and the first shuffle group includes a plurality of first shuffle units.
条款A22、根据条款A20所述的方法,所述确定各第一混洗单元的编码长度,包括:Clause A22. According to the method of clause A20, the determining the coding length of each first shuffling unit includes:
针对每个第一混洗组中的每个第一混洗单元,将该第一混洗单元包含的解码流中的待解码流块的总编码长度,确定为该第一混洗单元的编码长度。For each first shuffle unit in each first shuffle group, determine the total code length of the stream block to be decoded in the decoded stream contained in the first shuffle unit as the code of the first shuffle unit length.
条款A23、根据条款A20所述的方法,所述根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元,包括:Clause A23. The method according to clause A20, wherein determining an output shuffling unit and an input shuffling unit in each of the first shuffling units according to the coding length of each of the first shuffling units includes:
根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型;Determine the shuffling type of each first shuffling unit according to the code length of each first shuffling unit;
根据所述各第一混洗单元的混洗类型和预设的混洗规则,在所述各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元;According to the shuffling type of each first shuffling unit and preset shuffling rules, in each of the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit are determined ;
所述将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待解码流块,包括:The sending the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit includes:
针对每个输出混洗单元,将该输出混洗单元中第二预设数目个待混洗流块,发送至该输出混洗单元对应的输入混洗单元,作为该输入混洗单元中的第一待解码流块。For each output shuffle unit, the second preset number of stream blocks to be shuffled in the output shuffle unit are sent to the input shuffle unit corresponding to the output shuffle unit as the first in the input shuffle unit. A stream block to be decoded.
条款A24、根据条款A23所述的方法,所述根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型,包括:Clause A24. The method according to clause A23, wherein the determining the shuffling type of each first shuffling unit according to the coding length of each first shuffling unit includes:
针对所述各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与其他第一混洗单元的编码长度的第一差值;For each first shuffling unit in each of the first shuffling units, determine a first difference between the code length of the first shuffling unit and the code lengths of other first shuffling units;
根据该第一混洗单元对应的第一差值,确定该第一混洗单元的混洗类型。The shuffling type of the first shuffling unit is determined according to the first difference corresponding to the first shuffling unit.
条款A25、根据条款A24所述的方法,所述根据该第一混洗单元对应的第一差值,确定该第一混洗单元的混洗类型,包括:Clause A25. The method according to clause A24, wherein the determining the shuffling type of the first shuffling unit according to the first difference corresponding to the first shuffling unit includes:
如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且所述目标差值均为正数,则确定该第一混洗单元的混洗类型为高编码类型;If there is a target difference in the first difference corresponding to the first shuffling unit whose absolute value is greater than or equal to the first preset difference threshold, and the target difference is all positive, then the first shuffle is determined The shuffling type of the unit is a high coding type;
如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且所述目标差值中存在负数的目标差值,则确定该第一混洗单元的混洗类型为低编码类型。If there is a target difference in the first difference corresponding to the first shuffle unit whose absolute value is greater than or equal to the first preset difference threshold, and there is a negative target difference in the target difference, then the first difference is determined The shuffling type of a shuffling unit is a low coding type.
条款A26、根据条款A25所述的方法,所述方法还包括:Clause A26. The method according to clause A25, the method further comprising:
如果该第一混洗单元对应的第一差值中不存在绝对值大于或等于第一预设差值阈值的目标差值,则确定该第一混洗单元的混洗类型为中编码类型。If the first difference corresponding to the first shuffling unit does not have a target difference with an absolute value greater than or equal to the first preset difference threshold, it is determined that the shuffling type of the first shuffling unit is a medium coding type.
条款A27、根据条款A23所述的方法,所述根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型,包括:Clause A27. The method according to clause A23, wherein the determining the shuffling type of each first shuffling unit according to the coding length of each first shuffling unit includes:
根据所述各第一混洗单元的编码长度,确定平均编码长度;Determine an average code length according to the code length of each first shuffling unit;
针对所述各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与所述平均编码长度的第二差值;For each first shuffling unit in each of the first shuffling units, determine a second difference between the coding length of the first shuffling unit and the average coding length;
根据该第一混洗单元对应的第二差值,确定该第一混洗单元的混洗类型。The shuffling type of the first shuffling unit is determined according to the second difference value corresponding to the first shuffling unit.
条款A28、根据条款A27所述的方法,所述根据该第一混洗单元对应的第二差值,确定该第一混洗单元的混洗类型,包括:Clause A28. The method according to clause A27, wherein the determining the shuffling type of the first shuffling unit according to the second difference value corresponding to the first shuffling unit includes:
如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且所述第二差值为正数,则确定该第一混洗单元的混洗类型为高编码类型;If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, then the shuffling type of the first shuffling unit is determined High coding type;
如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且所述第二差值为负数,则确定该第一混洗单元的混洗类型为低编码类型。If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, it is determined that the shuffling type of the first shuffling unit is Low encoding type.
条款A29、根据条款A28所述的方法,所述方法还包括:Clause A29. The method according to clause A28, the method further comprising:
如果该第一混洗单元对应的第二差值的绝对值小于第二预设差值阈值,则确定该第一混洗单元的混洗类型为中编码类型。If the absolute value of the second difference value corresponding to the first shuffling unit is smaller than the second preset difference value threshold, it is determined that the shuffling type of the first shuffling unit is a medium coding type.
条款A30、根据条款A23所述的方法,所述根据所述各第一混洗单元的混洗类型和预设的混洗规则,在所述各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元,包括:Clause A30. The method according to clause A23, wherein according to the shuffling type of each first shuffling unit and a preset shuffling rule, in each first shuffling unit, determining an output shuffling unit And the input shuffle unit corresponding to each output shuffle unit, including:
如果高解码类型的第一目标混洗单元的第一数目大于低解码类型的第二目标混洗单元的第二数目,则将第二目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第一目标混洗单元中,确定至少一个第一目标混洗单元作为该输出混洗单元对应的输入混洗单元;If the first number of the first target shuffling units of the high decoding type is greater than the second number of the second target shuffling units of the low decoding type, the second target shuffling unit is determined to be the output shuffling unit, and for each An output shuffle unit, in the first target shuffle unit, determining at least one first target shuffle unit as the input shuffle unit corresponding to the output shuffle unit;
如果高解码类型的第一目标混洗单元的第一数目小于或等于低解码类型的第二目标混洗单元的第二数目,则将第一数目个第二目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第一目标混洗单元中,确定至少一个第一目标混洗单元作为该输出混洗单元对应的输入混洗单元。If the first number of the first target shuffling units of the high decoding type is less than or equal to the second number of the second target shuffling units of the low decoding type, the first number of second target shuffling units are determined as output shuffling Unit, and for each output shuffle unit, in the first target shuffle unit, at least one first target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
条款A31、根据条款A20所述的方法,所述方法还包括:Clause A31. The method according to clause A20, the method further comprising:
获取待解码数据对应的编码头数据;Acquiring encoding header data corresponding to the data to be decoded;
根据接收到的解码指令,在所述编码头数据中,确定所述解码指令对应的包含至少一个编码头块的解码区域,并获取所述至少一个编码头块对应的至少一个待解码数据块,所述编码头块中包含所述编码头块对应的编码数据块的存储地址;According to the received decoding instruction, in the encoding header data, determining a decoding area containing at least one encoding header block corresponding to the decoding instruction, and obtaining at least one to-be-decoded data block corresponding to the at least one encoding header block, The encoding header block contains the storage address of the encoded data block corresponding to the encoding header block;
针对所述至少一个待解码数据块中的每个待解码数据块,将该待解码数据块划分为多个流块,并将所述多个流块发送至该待解码数据块对应的多个解码流,作为所述多个解码流中的待混洗流块。For each to-be-decoded data block in the at least one to-be-decoded data block, divide the to-be-decoded data block into multiple stream blocks, and send the multiple stream blocks to multiple corresponding to the to-be-decoded data block The decoded stream is used as the stream block to be shuffled in the multiple decoded streams.
条款A32、根据条款A31所述的方法,所述待解码数据块由编码数据组成,所述编码数据的大小等于待编码数据块中待编码数据编码后的大小;或者,Clause A32. The method according to clause A31, wherein the data block to be decoded is composed of encoded data, and the size of the encoded data is equal to the encoded size of the data to be encoded in the data block to be encoded; or,
所述待解码数据块由编码数据和填充数据组成,所述编码数据的大小和所述填充数据的大小之和等于待编码数据块的大小。The data block to be decoded is composed of encoded data and padding data, and the sum of the size of the encoded data and the size of the padding data is equal to the size of the data block to be encoded.
条款A33、根据条款A31所述的方法,所述待解码数据块由属于同一源数据块中的多个源数据子块对应的编码数据子块组成;Clause A33. The method according to clause A31, wherein the data block to be decoded is composed of encoded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block;
所述编码数据子块由编码数据组成,所述编码数据的大小等于源数据子块中待编码数据编码后的大小;或者,The coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block; or,
所述编码数据子块由编码数据和填充数据组成,所述编码数据的大小和所述填充数据的大小之和等于所述源数据子块的大小。The coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.
条款A34、根据条款A20所述的方法,所述方法还包括:Clause A34. The method according to clause A20, the method further comprising:
当检测到多个解码流中的第一解码流解码完成时,将所述多个解码流中未解码完成的第二解码流中第二预设数目个待解码流块发送至所述第一解码流,作为所述第一解码流中的待解码流块。When it is detected that the decoding of the first decoded stream among the plurality of decoded streams is completed, the second preset number of to-be-decoded stream blocks in the second decoded streams that have not been decoded in the plurality of decoded streams are sent to the first decoded stream. The decoded stream is used as the stream block to be decoded in the first decoded stream.
条款A35、根据条款A20所述的方法,所述方法还包括:Clause A35. The method according to clause A20, the method further comprising:
根据第二混洗等级,确定待解码数据块对应的至少一个第二混洗组,所述第二混洗组包含多个第二混洗单元,所述第二混洗单元包含至少一个解码流;According to the second shuffle level, determine at least one second shuffle group corresponding to the data block to be decoded, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one decoded stream ;
将各第二混洗单元中的待解码流块作为待混洗流块重新进行混洗处理,直到各第二混洗单元的编码长度满足预设接近度条件。The stream block to be decoded in each second shuffling unit is used as the stream block to be shuffled to perform shuffling again until the code length of each second shuffling unit meets the preset proximity condition.
条款A36、一种混洗装置,所述装置包括:Clause A36. A shuffling device, said device comprising:
第一确定模块,用于根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个编码流;The first determination module is configured to determine at least one first shuffle group corresponding to the data block to be encoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit The washing unit contains at least one coded stream;
第二确定模块,用于确定各第一混洗单元的编码长度;The second determining module is used to determine the code length of each first shuffling unit;
第三确定模块,用于根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;A third determining module, configured to determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
发送模块,用于将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待编码流块,以通过所述输入混洗单元根据预设的编码算法对所述第一待编码流块进行编码。A sending module, configured to send a first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be coded in the input shuffle unit, The first stream block to be encoded is encoded by the input shuffling unit according to a preset encoding algorithm.
条款A37、一种混洗装置,所述装置包括:Clause A37. A shuffling device, said device comprising:
第一确定模块,用于根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个解码流;The first determining module is configured to determine at least one first shuffle group corresponding to the data block to be decoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit The washing unit contains at least one decoding stream;
第二确定模块,用于确定各第一混洗单元的编码长度;The second determining module is used to determine the code length of each first shuffling unit;
第三确定模块,用于根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;A third determining module, configured to determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
发送模块,用于将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待解码流块,以通过所述输入混洗单元根据预设的解码算法对所述第一待解码流块进行解码。A sending module, configured to send a first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit, The first stream block to be decoded is decoded by the input shuffling unit according to a preset decoding algorithm.
条款A38、一种计算机设备,包含存储器及处理器,所述存储器上存储有可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现条款A1至条款A19中任一项所述方法的步骤。Clause A38. A computer device including a memory and a processor, the memory stores a computer program that can run on the processor, and the processor implements any one of clauses A1 to A19 when the computer program is executed The steps of the method.
条款A39、一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现条款A1至条款A19中任一项所述的方法的步骤。Clause A39. A computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in any one of clauses A1 to A19.
条款A40、一种芯片系统,包含处理器,所述处理器和存储器耦合,所述存储器存储有程序指令,当所述存储器存储的程序指令被所述处理器执行时实现权利要求条款A1至条款A19任一项所述的方法。Clause A40. A chip system, including a processor, the processor is coupled to a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the claim clauses A1 to are implemented The method described in any one of A19.
条款A41、一种计算机设备,包含存储器及处理器,所述存储器上存储有可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现权利要求条款A20至条款A35中任一项所述方法的步骤。Clause A41. A computer device comprising a memory and a processor, the memory stores a computer program that can run on the processor, and the processor implements any of claims A20 to A35 when the computer program is executed. One of the steps of the described method.
条款A42、一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求条款A20至条款A35中任一项所述的方法的步骤。Clause A42. A computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in any one of claims A20 to A35.
条款A43、一种芯片系统,包含处理器,所述处理器和存储器耦合,所述存储器存储有程序指令,当所述存储器存储的程序指令被所述处理器执行时实现权利要求条款A20至条款A35任一项所述的方法。Clause A43. A chip system, including a processor, the processor is coupled to a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, it implements claim clauses A20 to The method described in any one of A35.
以上对本披露实施例进行了详细介绍,本文中应用了具体个例对本披露的原理及实施方式进行了阐述,以上实施例的说明仅用于帮助理解本披露的方法及其核心思想。同时,本领域技术人员依据本披露的思想,基于本披露的具体实施方式及应用范围上做出的改变或变形之处,都属于本披露保护的范围。综上所述,本说明书内容不应理解为对本披露的限制。The embodiments of the present disclosure are described in detail above, and specific examples are used in this article to illustrate the principles and implementation manners of the present disclosure. The descriptions of the above embodiments are only used to help understand the methods and core ideas of the present disclosure. At the same time, changes or modifications made by those skilled in the art based on the ideas of this disclosure, the specific implementation and application scope of this disclosure, are all within the protection scope of this disclosure. In summary, the content of this specification should not be construed as a limitation of this disclosure.

Claims (43)

  1. 一种混洗方法,其特征在于,所述方法包括:A shuffling method, characterized in that the method comprises:
    根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个编码流;According to the first shuffling level, at least one first shuffle group corresponding to the data block to be encoded is determined, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one coded stream ;
    确定各第一混洗单元的编码长度;Determine the code length of each first shuffling unit;
    根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;Determine an output shuffle unit and an input shuffle unit in each of the first shuffle units according to the code length of each of the first shuffle units;
    将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待编码流块,以通过所述输入混洗单元根据预设的编码算法对所述第一待编码流块进行编码。Send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be encoded in the input shuffle unit to pass the input The shuffling unit encodes the first stream block to be encoded according to a preset encoding algorithm.
  2. 根据权利要求1所述的方法,其特征在于,所述根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组,包括:The method according to claim 1, wherein the determining at least one first shuffling group corresponding to the data block to be encoded according to the first shuffling level comprises:
    获取待编码数据块对应的多个编码流;Acquiring multiple coded streams corresponding to the data block to be coded;
    根据第一混洗等级,将所述多个编码流划分为多个第一混洗单元,并将所述多个第一混洗单元划分为至少一个第一混洗组,所述第一混洗单元包含至少一个编码流,所述第一混洗组包含多个第一混洗单元。According to the first shuffling level, the multiple encoded streams are divided into multiple first shuffling units, and the multiple first shuffling units are divided into at least one first shuffling group. The shuffling unit includes at least one coded stream, and the first shuffling group includes a plurality of first shuffling units.
  3. 根据权利要求1所述的方法,其特征在于,所述确定各第一混洗单元的编码长度,包括:The method according to claim 1, wherein said determining the coding length of each first shuffling unit comprises:
    针对每个第一混洗组中的每个第一混洗单元,将该第一混洗单元包含的编码流中的待编码流块的总编码长度,确定为该第一混洗单元的编码长度。For each first shuffle unit in each first shuffle group, determine the total code length of the stream block to be coded in the coded stream contained in the first shuffle unit as the code of the first shuffle unit length.
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元,包括:The method according to claim 1, wherein the first shuffling unit determines the output shuffle unit and the input shuffle unit according to the coding length of each first shuffle unit, include:
    根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型;Determine the shuffling type of each first shuffling unit according to the code length of each first shuffling unit;
    根据所述各第一混洗单元的混洗类型和预设的混洗规则,在所述各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元;According to the shuffling type of each first shuffling unit and preset shuffling rules, in each of the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit are determined ;
    所述将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待编码流块,包括:The sending the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be coded in the input shuffle unit includes:
    针对每个输出混洗单元,将该输出混洗单元中第二预设数目个待混洗流块,发送至该输出混洗单元对应的输入混洗单元,作为该输入混洗单元中的第一待编码流块。For each output shuffle unit, the second preset number of stream blocks to be shuffled in the output shuffle unit are sent to the input shuffle unit corresponding to the output shuffle unit as the first in the input shuffle unit. A stream block to be encoded.
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型,包括:The method according to claim 4, wherein the determining the shuffling type of each first shuffling unit according to the coding length of each first shuffling unit comprises:
    针对所述各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与其他第一混洗单元的编码长度的第一差值;For each first shuffling unit in each of the first shuffling units, determine a first difference between the code length of the first shuffling unit and the code lengths of other first shuffling units;
    根据该第一混洗单元对应的第一差值,确定该第一混洗单元的混洗类型。The shuffling type of the first shuffling unit is determined according to the first difference corresponding to the first shuffling unit.
  6. 根据权利要求5所述的方法,其特征在于,所述根据该第一混洗单元对应的第一差值,确定该第一混洗单元的混洗类型,包括:The method according to claim 5, wherein the determining the shuffling type of the first shuffling unit according to the first difference corresponding to the first shuffling unit comprises:
    如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且所述目标差值均为正数,则确定该第一混洗单元的混洗类型为高编码类型;If there is a target difference in the first difference corresponding to the first shuffling unit whose absolute value is greater than or equal to the first preset difference threshold, and the target difference is all positive, then the first shuffle is determined The shuffling type of the unit is a high coding type;
    如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且所述目标差值中存在负数的目标差值,则确定该第一混洗单元的混洗类型为低编码类型。If there is a target difference in the first difference corresponding to the first shuffle unit whose absolute value is greater than or equal to the first preset difference threshold, and there is a negative target difference in the target difference, then the first difference is determined The shuffling type of a shuffling unit is a low coding type.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method according to claim 6, wherein the method further comprises:
    如果该第一混洗单元对应的第一差值中不存在绝对值大于或等于第一预设差值阈值的目标差值,则确定该第一混洗单元的混洗类型为中编码类型。If the first difference corresponding to the first shuffling unit does not have a target difference with an absolute value greater than or equal to the first preset difference threshold, it is determined that the shuffling type of the first shuffling unit is a medium coding type.
  8. 根据权利要求4所述的方法,其特征在于,所述根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型,包括:The method according to claim 4, wherein the determining the shuffling type of each first shuffling unit according to the coding length of each first shuffling unit comprises:
    根据所述各第一混洗单元的编码长度,确定平均编码长度;Determine an average code length according to the code length of each first shuffling unit;
    针对所述各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与所述平均编码长度的第二差值;For each first shuffling unit in each of the first shuffling units, determine a second difference between the coding length of the first shuffling unit and the average coding length;
    根据该第一混洗单元对应的第二差值,确定该第一混洗单元的混洗类型。The shuffling type of the first shuffling unit is determined according to the second difference value corresponding to the first shuffling unit.
  9. 根据权利要求8所述的方法,其特征在于,所述根据该第一混洗单元对应的第二差值,确定该第一混洗单元的混洗类型,包括:8. The method according to claim 8, wherein the determining the shuffling type of the first shuffling unit according to the second difference value corresponding to the first shuffling unit comprises:
    如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且所述第二差值为正数,则确定该第一混洗单元的混洗类型为高编码类型;If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, then the shuffling type of the first shuffling unit is determined High coding type;
    如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且所述第二差值为负数,则确定该第一混洗单元的混洗类型为低编码类型。If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, it is determined that the shuffling type of the first shuffling unit is Low encoding type.
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method according to claim 9, wherein the method further comprises:
    如果该第一混洗单元对应的第二差值的绝对值小于第二预设差值阈值,则确定该第一混洗单元的混洗类型为中编码类型。If the absolute value of the second difference value corresponding to the first shuffling unit is smaller than the second preset difference value threshold, it is determined that the shuffling type of the first shuffling unit is a medium coding type.
  11. 根据权利要求4所述的方法,其特征在于,所述根据所述各第一混洗单元的混洗类型和预设的混洗规则,在所述各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元,包括:The method according to claim 4, wherein the first shuffling unit determines the output shuffling according to the shuffling type and the preset shuffling rule of each first shuffling unit. The washing unit and the input shuffle unit corresponding to each output shuffle unit include:
    如果高编码类型的第一目标混洗单元的第一数目小于或等于低编码类型的第二目标混洗单元的第二数目,则将第一目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第二目标混洗单元中,确定至少一个第二目标混洗单元作为该输出混洗单元对应的输入混洗单元;If the first number of the first target shuffle unit of the high coding type is less than or equal to the second number of the second target shuffle unit of the low coding type, the first target shuffle unit is determined as the output shuffle unit, and the For each output shuffle unit, in the second target shuffle unit, determine at least one second target shuffle unit as the input shuffle unit corresponding to the output shuffle unit;
    如果高编码类型的第一目标混洗单元的第一数目大于低编码类型的第二目标混洗单元的第二数目,则将第二数目个第一目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第二目标混洗单元中,确定至少一个第二目标混洗单元作为该输出混洗单元对应的输入混洗单元。If the first number of first target shuffle units of the high coding type is greater than the second number of second target shuffle units of the low coding type, then the second number of first target shuffle units are determined as output shuffle units, And for each output shuffle unit, in the second target shuffle unit, at least one second target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
  12. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    获取待编码的源数据;Obtain the source data to be encoded;
    根据接收到的编码指令,在所述源数据中,确定所述编码指令对应的编码区域,所述编码区域包含至少一个待编码数据块,所述待编码数据块为源数据块或源数据子块;According to the received encoding instruction, in the source data, the encoding area corresponding to the encoding instruction is determined, the encoding area includes at least one data block to be encoded, and the data block to be encoded is a source data block or a source data sub Piece;
    针对所述至少一个待编码数据块中的每个待编码数据块,将该待编码数据块划分为多个流块,并将所述多个流块发送至该待编码数据块对应的多个编码流,作为所述多个编码流中的待混洗流块。For each to-be-coded data block in the at least one to-be-coded data block, divide the to-be-coded data block into multiple stream blocks, and send the multiple stream blocks to a plurality of corresponding to the to-be-coded data block The coded stream is used as a stream block to be shuffled in the multiple coded streams.
  13. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    当检测到多个编码流中的第一编码流编码完成时,将所述多个编码流中未编码完成的第二编码流中第四预设数目个待编码流块发送至所述第一编码流,作为所述第一编码流中的待编码流块。When it is detected that the encoding of the first encoded stream among the plurality of encoded streams is completed, the fourth preset number of to-be-encoded stream blocks in the second encoded streams that have not been encoded in the plurality of encoded streams are sent to the first The coded stream is used as the stream block to be coded in the first coded stream.
  14. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    如果各第一混洗组中待编码流块总编码长度大于所述待编码数据块的原长度,则终止对所述待编码数据块的编码处理。If the total coding length of the to-be-coded stream blocks in each first shuffle group is greater than the original length of the to-be-coded data block, the coding process of the to-be-coded data block is terminated.
  15. 根据权利要求1所述的方法,其特征在于,所述方法包括:The method according to claim 1, wherein the method comprises:
    根据第二混洗等级,确定待编码数据块对应的至少一个第二混洗组,所述第二混洗组包含多个第二混洗单元,所述第二混洗单元包含至少一个编码流;According to the second shuffle level, determine at least one second shuffle group corresponding to the data block to be encoded, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one coded stream ;
    将各第二混洗单元中的待编码流块作为待混洗流块重新进行混洗处理,直到各第二混洗单元的编码长度满足预设接近度条件。The stream block to be coded in each second shuffling unit is used as the stream block to be shuffled to perform shuffling again until the code length of each second shuffling unit meets the preset proximity condition.
  16. 根据权利要求1所述的方法,其特征在于,所述通过所述输入混洗单元根据预设的编码算法对所述第一待编码流块进行编码,包括:The method according to claim 1, wherein the encoding the first stream block to be encoded by the input shuffling unit according to a preset encoding algorithm comprises:
    根据预设字符对应的第一编码规则,对所述第一待编码流块中包含的预设字符进行编码,得到第一编码数据;Encoding the preset characters included in the first stream block to be encoded according to the first encoding rule corresponding to the preset characters to obtain first encoded data;
    根据预设的第二编码规则对所述第一编码数据进行编码。The first encoded data is encoded according to a preset second encoding rule.
  17. 根据权利要求12所述的方法,其特征在于,所述方法还包括:The method according to claim 12, wherein the method further comprises:
    生成各待编码数据块对应的编码数据块的编码头块,所述编码头块中包含所述编码头块对应的编码数据块的存储地址;Generating an encoding header block of an encoded data block corresponding to each data block to be encoded, where the encoding header block contains the storage address of the encoded data block corresponding to the encoding header block;
    将各编码头块进行存储,并在所述各编码头块之后存储各编码数据块。Store each encoding header block, and store each encoded data block after each encoding header block.
  18. 根据权利要求17所述的方法,其特征在于,所述编码数据块由编码数据组成,所述编码数据的大小等于待编码数据块中待编码数据编码后的大小;或者,The method according to claim 17, wherein the coded data block is composed of coded data, and the size of the coded data is equal to the size of the coded data in the data block to be coded; or,
    所述编码数据块由编码数据和填充数据组成,所述编码数据的大小和所述填充数据的大小之和等于待 编码数据块的大小。The coded data block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the data block to be coded.
  19. 根据权利要求17所述的方法,其特征在于,所述编码数据块由属于同一源数据块中的多个源数据子块对应的编码数据子块组成;The method according to claim 17, wherein the coded data block is composed of coded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block;
    所述编码数据子块由编码数据组成,所述编码数据的大小等于源数据子块中待编码数据编码后的大小;或者,The coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block; or,
    所述编码数据子块由编码数据和填充数据组成,所述编码数据的大小和所述填充数据的大小之和等于所述源数据子块的大小。The coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.
  20. 一种混洗方法,其特征在于,所述方法包括:A shuffling method, characterized in that the method comprises:
    根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个解码流;According to the first shuffle level, determine at least one first shuffle group corresponding to the data block to be decoded, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit includes at least one decoded stream ;
    确定各第一混洗单元的编码长度;Determine the code length of each first shuffling unit;
    根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;Determine an output shuffle unit and an input shuffle unit in each of the first shuffle units according to the code length of each of the first shuffle units;
    将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待解码流块,以通过所述输入混洗单元根据预设的解码算法对所述第一待解码流块进行解码。Send the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit to pass the input The shuffling unit decodes the first stream block to be decoded according to a preset decoding algorithm.
  21. 根据权利要求20所述的方法,其特征在于,所述根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组,包括:The method according to claim 20, wherein the determining at least one first shuffling group corresponding to the data block to be decoded according to the first shuffling level comprises:
    获取待解码数据块对应的多个解码流;Acquiring multiple decoded streams corresponding to the data block to be decoded;
    根据第一混洗等级,将所述多个解码流划分为多个第一混洗单元,并将所述多个第一混洗单元划分为至少一个第一混洗组,所述第一混洗单元包含至少一个解码流,所述第一混洗组包含多个第一混洗单元。According to the first shuffling level, the multiple decoded streams are divided into multiple first shuffling units, and the multiple first shuffling units are divided into at least one first shuffling group. The shuffle unit includes at least one decoded stream, and the first shuffle group includes a plurality of first shuffle units.
  22. 根据权利要求20所述的方法,其特征在于,所述确定各第一混洗单元的编码长度,包括:The method according to claim 20, wherein said determining the coding length of each first shuffling unit comprises:
    针对每个第一混洗组中的每个第一混洗单元,将该第一混洗单元包含的解码流中的待解码流块的总编码长度,确定为该第一混洗单元的编码长度。For each first shuffle unit in each first shuffle group, determine the total code length of the stream block to be decoded in the decoded stream contained in the first shuffle unit as the code of the first shuffle unit length.
  23. 根据权利要求20所述的方法,其特征在于,所述根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元,包括:22. The method according to claim 20, wherein the first shuffle unit determines the output shuffle unit and the input shuffle unit according to the coding length of each first shuffle unit, include:
    根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型;Determine the shuffling type of each first shuffling unit according to the code length of each first shuffling unit;
    根据所述各第一混洗单元的混洗类型和预设的混洗规则,在所述各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元;According to the shuffling type of each first shuffling unit and preset shuffling rules, in each of the first shuffling units, an output shuffling unit and an input shuffling unit corresponding to each output shuffling unit are determined ;
    所述将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待解码流块,包括:The sending the first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit includes:
    针对每个输出混洗单元,将该输出混洗单元中第二预设数目个待混洗流块,发送至该输出混洗单元对应的输入混洗单元,作为该输入混洗单元中的第一待解码流块。For each output shuffle unit, the second preset number of stream blocks to be shuffled in the output shuffle unit are sent to the input shuffle unit corresponding to the output shuffle unit as the first in the input shuffle unit. A stream block to be decoded.
  24. 根据权利要求23所述的方法,其特征在于,所述根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型,包括:The method according to claim 23, wherein the determining the shuffling type of each first shuffling unit according to the coding length of each first shuffling unit comprises:
    针对所述各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与其他第一混洗单元的编码长度的第一差值;For each first shuffling unit in each of the first shuffling units, determine a first difference between the code length of the first shuffling unit and the code lengths of other first shuffling units;
    根据该第一混洗单元对应的第一差值,确定该第一混洗单元的混洗类型。The shuffling type of the first shuffling unit is determined according to the first difference corresponding to the first shuffling unit.
  25. 根据权利要求24所述的方法,其特征在于,所述根据该第一混洗单元对应的第一差值,确定该第一混洗单元的混洗类型,包括:The method of claim 24, wherein the determining the shuffling type of the first shuffling unit according to the first difference value corresponding to the first shuffling unit comprises:
    如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且所述目标差值均为正数,则确定该第一混洗单元的混洗类型为高编码类型;If there is a target difference in the first difference corresponding to the first shuffling unit whose absolute value is greater than or equal to the first preset difference threshold, and the target difference is all positive, then the first shuffle is determined The shuffling type of the unit is a high coding type;
    如果该第一混洗单元对应的第一差值中存在绝对值大于或等于第一预设差值阈值的目标差值,且所述目标差值中存在负数的目标差值,则确定该第一混洗单元的混洗类型为低编码类型。If there is a target difference in the first difference corresponding to the first shuffle unit whose absolute value is greater than or equal to the first preset difference threshold, and there is a negative target difference in the target difference, then the first difference is determined The shuffling type of a shuffling unit is a low coding type.
  26. 根据权利要求25所述的方法,其特征在于,所述方法还包括:The method according to claim 25, wherein the method further comprises:
    如果该第一混洗单元对应的第一差值中不存在绝对值大于或等于第一预设差值阈值的目标差值,则确定该第一混洗单元的混洗类型为中编码类型。If the first difference corresponding to the first shuffling unit does not have a target difference with an absolute value greater than or equal to the first preset difference threshold, it is determined that the shuffling type of the first shuffling unit is a medium coding type.
  27. 根据权利要求23所述的方法,其特征在于,所述根据所述各第一混洗单元的编码长度,确定所述各第一混洗单元的混洗类型,包括:The method according to claim 23, wherein the determining the shuffling type of each first shuffling unit according to the coding length of each first shuffling unit comprises:
    根据所述各第一混洗单元的编码长度,确定平均编码长度;Determine an average code length according to the code length of each first shuffling unit;
    针对所述各第一混洗单元中的每个第一混洗单元,确定该第一混洗单元的编码长度与所述平均编码长度的第二差值;For each first shuffling unit in each of the first shuffling units, determine a second difference between the coding length of the first shuffling unit and the average coding length;
    根据该第一混洗单元对应的第二差值,确定该第一混洗单元的混洗类型。The shuffling type of the first shuffling unit is determined according to the second difference value corresponding to the first shuffling unit.
  28. 根据权利要求27所述的方法,其特征在于,所述根据该第一混洗单元对应的第二差值,确定该第一混洗单元的混洗类型,包括:28. The method of claim 27, wherein the determining the shuffling type of the first shuffling unit according to the second difference value corresponding to the first shuffling unit comprises:
    如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且所述第二差值为正数,则确定该第一混洗单元的混洗类型为高编码类型;If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a positive number, then the shuffling type of the first shuffling unit is determined High coding type;
    如果该第一混洗单元对应的第二差值的绝对值大于或等于第二预设差值阈值,且所述第二差值为负数,则确定该第一混洗单元的混洗类型为低编码类型。If the absolute value of the second difference corresponding to the first shuffling unit is greater than or equal to the second preset difference threshold, and the second difference is a negative number, it is determined that the shuffling type of the first shuffling unit is Low encoding type.
  29. 根据权利要求28所述的方法,其特征在于,所述方法还包括:The method according to claim 28, wherein the method further comprises:
    如果该第一混洗单元对应的第二差值的绝对值小于第二预设差值阈值,则确定该第一混洗单元的混洗类型为中编码类型。If the absolute value of the second difference value corresponding to the first shuffling unit is smaller than the second preset difference value threshold, it is determined that the shuffling type of the first shuffling unit is a medium coding type.
  30. 根据权利要求23所述的方法,其特征在于,所述根据所述各第一混洗单元的混洗类型和预设的混洗规则,在所述各第一混洗单元中,确定输出混洗单元以及每个输出混洗单元对应的输入混洗单元,包括:23. The method according to claim 23, characterized in that, according to the shuffling type of each first shuffling unit and a preset shuffling rule, in each first shuffling unit, determining the output shuffling The washing unit and the input shuffle unit corresponding to each output shuffle unit include:
    如果高解码类型的第一目标混洗单元的第一数目大于低解码类型的第二目标混洗单元的第二数目,则将第二目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第一目标混洗单元中,确定至少一个第一目标混洗单元作为该输出混洗单元对应的输入混洗单元;If the first number of the first target shuffling units of the high decoding type is greater than the second number of the second target shuffling units of the low decoding type, the second target shuffling unit is determined to be the output shuffling unit, and for each An output shuffle unit, in the first target shuffle unit, determining at least one first target shuffle unit as the input shuffle unit corresponding to the output shuffle unit;
    如果高解码类型的第一目标混洗单元的第一数目小于或等于低解码类型的第二目标混洗单元的第二数目,则将第一数目个第二目标混洗单元确定为输出混洗单元,并针对每个输出混洗单元,在第一目标混洗单元中,确定至少一个第一目标混洗单元作为该输出混洗单元对应的输入混洗单元。If the first number of the first target shuffling units of the high decoding type is less than or equal to the second number of the second target shuffling units of the low decoding type, the first number of second target shuffling units are determined as output shuffling Unit, and for each output shuffle unit, in the first target shuffle unit, at least one first target shuffle unit is determined as the input shuffle unit corresponding to the output shuffle unit.
  31. 根据权利要求20所述的方法,其特征在于,所述方法还包括:The method according to claim 20, wherein the method further comprises:
    获取待解码数据对应的编码头数据;Acquiring encoding header data corresponding to the data to be decoded;
    根据接收到的解码指令,在所述编码头数据中,确定所述解码指令对应的包含至少一个编码头块的解码区域,并获取所述至少一个编码头块对应的至少一个待解码数据块,所述编码头块中包含所述编码头块对应的编码数据块的存储地址;According to the received decoding instruction, in the encoding header data, determining a decoding area containing at least one encoding header block corresponding to the decoding instruction, and obtaining at least one to-be-decoded data block corresponding to the at least one encoding header block, The encoding header block contains the storage address of the encoded data block corresponding to the encoding header block;
    针对所述至少一个待解码数据块中的每个待解码数据块,将该待解码数据块划分为多个流块,并将所述多个流块发送至该待解码数据块对应的多个解码流,作为所述多个解码流中的待混洗流块。For each to-be-decoded data block in the at least one to-be-decoded data block, divide the to-be-decoded data block into multiple stream blocks, and send the multiple stream blocks to multiple corresponding to the to-be-decoded data block The decoded stream is used as the stream block to be shuffled in the multiple decoded streams.
  32. 根据权利要求31所述的方法,其特征在于,所述待解码数据块由编码数据组成,所述编码数据的大小等于待编码数据块中待编码数据编码后的大小;或者,The method according to claim 31, wherein the data block to be decoded is composed of encoded data, and the size of the encoded data is equal to the encoded size of the data to be encoded in the data block to be encoded; or,
    所述待解码数据块由编码数据和填充数据组成,所述编码数据的大小和所述填充数据的大小之和等于待编码数据块的大小。The data block to be decoded is composed of encoded data and padding data, and the sum of the size of the encoded data and the size of the padding data is equal to the size of the data block to be encoded.
  33. 根据权利要求31所述的方法,其特征在于,所述待解码数据块由属于同一源数据块中的多个源数据子块对应的编码数据子块组成;The method according to claim 31, wherein the data block to be decoded is composed of encoded data sub-blocks corresponding to multiple source data sub-blocks belonging to the same source data block;
    所述编码数据子块由编码数据组成,所述编码数据的大小等于源数据子块中待编码数据编码后的大小;或者,The coded data sub-block is composed of coded data, and the size of the coded data is equal to the coded size of the data to be coded in the source data sub-block; or,
    所述编码数据子块由编码数据和填充数据组成,所述编码数据的大小和所述填充数据的大小之和等于所述源数据子块的大小。The coded data sub-block is composed of coded data and padding data, and the sum of the size of the coded data and the size of the padding data is equal to the size of the source data sub-block.
  34. 根据权利要求20所述的方法,其特征在于,所述方法还包括:The method according to claim 20, wherein the method further comprises:
    当检测到多个解码流中的第一解码流解码完成时,将所述多个解码流中未解码完成的第二解码流中第二预设数目个待解码流块发送至所述第一解码流,作为所述第一解码流中的待解码流块。When it is detected that the decoding of the first decoded stream among the plurality of decoded streams is completed, the second preset number of to-be-decoded stream blocks in the second decoded streams that have not been decoded in the plurality of decoded streams are sent to the first decoded stream. The decoded stream is used as the stream block to be decoded in the first decoded stream.
  35. 根据权利要求20所述的方法,其特征在于,所述方法还包括:The method according to claim 20, wherein the method further comprises:
    根据第二混洗等级,确定待解码数据块对应的至少一个第二混洗组,所述第二混洗组包含多个第二混 洗单元,所述第二混洗单元包含至少一个解码流;According to the second shuffle level, determine at least one second shuffle group corresponding to the data block to be decoded, the second shuffle group includes a plurality of second shuffle units, and the second shuffle unit includes at least one decoded stream ;
    将各第二混洗单元中的待解码流块作为待混洗流块重新进行混洗处理,直到各第二混洗单元的编码长度满足预设接近度条件。The stream block to be decoded in each second shuffling unit is used as the stream block to be shuffled to perform shuffling again until the code length of each second shuffling unit meets the preset proximity condition.
  36. 一种混洗装置,其特征在于,所述装置包括:A shuffling device, characterized in that the device comprises:
    第一确定模块,用于根据第一混洗等级,确定待编码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个编码流;The first determination module is configured to determine at least one first shuffle group corresponding to the data block to be encoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit The washing unit contains at least one coded stream;
    第二确定模块,用于确定各第一混洗单元的编码长度;The second determining module is used to determine the code length of each first shuffling unit;
    第三确定模块,用于根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;A third determining module, configured to determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
    发送模块,用于将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待编码流块,以通过所述输入混洗单元根据预设的编码算法对所述第一待编码流块进行编码。A sending module, configured to send a first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be coded in the input shuffle unit, The first stream block to be encoded is encoded by the input shuffling unit according to a preset encoding algorithm.
  37. 一种混洗装置,其特征在于,所述装置包括:A shuffling device, characterized in that the device comprises:
    第一确定模块,用于根据第一混洗等级,确定待解码数据块对应的至少一个第一混洗组,所述第一混洗组包含多个第一混洗单元,所述第一混洗单元包含至少一个解码流;The first determining module is configured to determine at least one first shuffle group corresponding to the data block to be decoded according to the first shuffle level, the first shuffle group includes a plurality of first shuffle units, and the first shuffle unit The washing unit contains at least one decoding stream;
    第二确定模块,用于确定各第一混洗单元的编码长度;The second determining module is used to determine the code length of each first shuffling unit;
    第三确定模块,用于根据所述各第一混洗单元的编码长度,在所述各第一混洗单元中,确定输出混洗单元和输入混洗单元;A third determining module, configured to determine an output shuffle unit and an input shuffle unit in each first shuffle unit according to the code length of each first shuffle unit;
    发送模块,用于将所述输出混洗单元中第一预设数目个待混洗流块,发送至所述输入混洗单元,作为所述输入混洗单元中的第一待解码流块,以通过所述输入混洗单元根据预设的解码算法对所述第一待解码流块进行解码。A sending module, configured to send a first preset number of stream blocks to be shuffled in the output shuffle unit to the input shuffle unit as the first stream blocks to be decoded in the input shuffle unit, The first stream block to be decoded is decoded by the input shuffling unit according to a preset decoding algorithm.
  38. 一种计算机设备,包含存储器及处理器,所述存储器上存储有可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至19中任一项所述方法的步骤。A computer device comprising a memory and a processor, and a computer program that can be run on the processor is stored on the memory, wherein the processor implements any one of claims 1 to 19 when the computer program is executed. The steps of the method described in item.
  39. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至19中任一项所述的方法的步骤。A computer-readable storage medium with a computer program stored thereon, wherein the computer program implements the steps of the method according to any one of claims 1 to 19 when the computer program is executed by a processor.
  40. 一种芯片系统,其特征在于,包含处理器,所述处理器和存储器耦合,所述存储器存储有程序指令,当所述存储器存储的程序指令被所述处理器执行时实现权利要求1至19任一项所述的方法。A chip system, characterized in that it comprises a processor, the processor is coupled with a memory, the memory stores program instructions, and claims 1 to 19 are implemented when the program instructions stored in the memory are executed by the processor. Any of the methods.
  41. 一种计算机设备,包含存储器及处理器,所述存储器上存储有可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求20至35中任一项所述方法的步骤。A computer device comprising a memory and a processor, and a computer program that can be run on the processor is stored on the memory, wherein the processor implements any one of claims 20 to 35 when the computer program is executed. The steps of the method described in item.
  42. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求20至35中任一项所述的方法的步骤。A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the method according to any one of claims 20 to 35 when the computer program is executed by a processor.
  43. 一种芯片系统,其特征在于,包含处理器,所述处理器和存储器耦合,所述存储器存储有程序指令,当所述存储器存储的程序指令被所述处理器执行时实现权利要求20至35任一项所述的方法。A chip system, comprising a processor, the processor is coupled with a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, claims 20 to 35 are implemented Any of the methods described.
PCT/CN2020/117564 2019-10-09 2020-09-25 Shuffle method, apparatus, computer device, and readable storage medium WO2021068758A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910954846.1 2019-10-09
CN201910954846.1A CN112631595B (en) 2019-10-09 2019-10-09 Shuffling method, shuffling device, computer equipment and readable storage medium

Publications (1)

Publication Number Publication Date
WO2021068758A1 true WO2021068758A1 (en) 2021-04-15

Family

ID=75283315

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/117564 WO2021068758A1 (en) 2019-10-09 2020-09-25 Shuffle method, apparatus, computer device, and readable storage medium

Country Status (2)

Country Link
CN (1) CN112631595B (en)
WO (1) WO2021068758A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6476737B1 (en) * 2001-11-16 2002-11-05 Lsi Logic Corporation Rate 64/65 (d=0, G=11/I=10) run length limited modulation code
CN1581725A (en) * 2003-08-07 2005-02-16 三星电子株式会社 Method and apparatus for determining a shuffling pattern in a double space-time transmit diversity system
CN102375805A (en) * 2011-10-31 2012-03-14 中国人民解放军国防科学技术大学 Vector processor-oriented FFT (Fast Fourier Transform) parallel computation method based on SIMD (Single Instruction Multiple Data)
CN103582883A (en) * 2011-02-24 2014-02-12 A9.Com公司 Improved encoding and decoding of variable-length data with group formats
CN108089882A (en) * 2016-11-23 2018-05-29 想象技术有限公司 Code and decode variable length instruction
WO2018169025A1 (en) * 2017-03-13 2018-09-20 Mitsubishi Electric Corporation Polar-code based encoder and method for configuring divide and conquer structure of polar-code based encoder

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2931609B1 (en) * 2008-05-23 2010-06-04 Canon Kk PSEUDO-HIERARCHIC ENCODING AND DECODING METHODS AND ASSOCIATED SYSTEMS
US8824569B2 (en) * 2011-12-07 2014-09-02 International Business Machines Corporation High bandwidth decompression of variable length encoded data streams
US9258112B2 (en) * 2013-03-15 2016-02-09 Accenture Global Services Limited Configurable key-based data shuffling and encryption

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6476737B1 (en) * 2001-11-16 2002-11-05 Lsi Logic Corporation Rate 64/65 (d=0, G=11/I=10) run length limited modulation code
CN1581725A (en) * 2003-08-07 2005-02-16 三星电子株式会社 Method and apparatus for determining a shuffling pattern in a double space-time transmit diversity system
CN103582883A (en) * 2011-02-24 2014-02-12 A9.Com公司 Improved encoding and decoding of variable-length data with group formats
CN102375805A (en) * 2011-10-31 2012-03-14 中国人民解放军国防科学技术大学 Vector processor-oriented FFT (Fast Fourier Transform) parallel computation method based on SIMD (Single Instruction Multiple Data)
CN108089882A (en) * 2016-11-23 2018-05-29 想象技术有限公司 Code and decode variable length instruction
WO2018169025A1 (en) * 2017-03-13 2018-09-20 Mitsubishi Electric Corporation Polar-code based encoder and method for configuring divide and conquer structure of polar-code based encoder

Also Published As

Publication number Publication date
CN112631595B (en) 2024-03-01
CN112631595A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
WO2022120912A1 (en) Coding method and device, decoding method and device, and computer-readable storage medium
JP5068849B2 (en) Ray tracing method, system, and program
CN103559020B (en) A kind of DNA reads ordinal number according to the compression of FASTQ file in parallel and decompression method
BR102018009143A2 (en) METHOD AND APPARATUS FOR ENCODING AND DECODING TWO-DIMENSION POINT CLOUDS
CN109479146B (en) Bit packing for incremental color compression
CN107886560B (en) Animation resource processing method and device
WO2014166434A1 (en) Method for coding/decoding depth image and coding/decoding device
JP2015523012A5 (en)
JP4808771B2 (en) Apparatus and method for encoding and decoding three-dimensional mesh information
BRPI1014218B1 (en) METHOD AND APPARATUS FOR PROCESSING AN IMAGE
BR112020020003A2 (en) method and device for encoding the geometry of a point cloud
US9918098B2 (en) Memory management of motion vectors in high efficiency video coding motion vector prediction
WO2021012278A1 (en) Data processing method, system, encoder, and decoder
KR102231975B1 (en) Techniques for performing a forward transformation by a video encoder using a forward transform matrix
WO2021068758A1 (en) Shuffle method, apparatus, computer device, and readable storage medium
US8942474B2 (en) Method and system for interpolating index values of associated tiles in an image
JP2019511865A5 (en)
CN104754343B (en) Image processing method and system, decoding method, encoder and decoder
WO2019199513A1 (en) A method and apparatus for encoding and decoding metadata associated with patched projection of point clouds
JP2022520922A (en) Chroma Intra prediction methods and devices, as well as computer storage media
CN103975593B (en) The method and apparatus for being compressed based on threedimensional model and generating the bit stream of repetitive structure discovery
WO2015196929A1 (en) Method and apparatus for encoding and decoding intra-frame depth image blocks
CN112650496B (en) Shuffling method and computing device
CN112631597A (en) Shuffling method and calculation device
CN112650496A (en) Shuffling method and calculation device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20874534

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20874534

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20874534

Country of ref document: EP

Kind code of ref document: A1