Skip to content

Instantly share code, notes, and snippets.

@azyobuzin
Created August 8, 2020 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azyobuzin/abda48895149bbd180b138ae6bf62671 to your computer and use it in GitHub Desktop.
Save azyobuzin/abda48895149bbd180b138ae6bf62671 to your computer and use it in GitHub Desktop.
@startuml
package rac {
class RacInput24 {
+ bool read_12bit_chance(uint16_t)
+ bool read_bit()
}
}
package symbol {
class UniformSymbolCoder {
- RacInput24 rac
+ read_int(int, int)
+ read_int(int)
}
UniformSymbolCoder "1" o-- "1" RacInput24
interface SymbolCoder {
+ bool read(SymbolChanceBitType, int)
}
class SimpleBitChance {
# uint16_t chance
+ uint16_t get_12bit()
+ void set_12bit(uint16_t)
+ void put(bool, SimpleBitChanceTable)
}
class SimpleBitChanceTable {
+ uint16_t[][] next
+ uint32_t alpha
}
class SymbolChance {
- SimpleBitChance bit_zero
- SimpleBitChance bit_sign
- SimpleBitChance[] bit_exp
- SimpleBitChance[] bit_mant
+ SimpleBitChance bitZero()
+ SimpleBitChance bitSign()
+ SimpleBitChance bitExp(int)
+ SimpleBitChance bitMant(int)
+ SimpleBitChance bit(SymbolChanceBitType, int)
}
SymbolChance *-- SimpleBitChance
class SimpleSymbolBitCoder {
- SimpleBitChanceTable table
- SymbolChance ctx
- RacInput24 rac
+ bool read(SymbolChanceBitType, int)
}
SymbolCoder <|.. SimpleSymbolBitCoder
SimpleSymbolBitCoder "1" o-- "1" SimpleBitChanceTable
SimpleSymbolBitCoder "1" o-- "1" SymbolChance
SimpleSymbolBitCoder "1" o-- "1" RacInput24
class SimpleSymbolCoder {
- SymbolChance ctx
- SimpleBitChanceTable table
- RacInput24 rac
+ int read_int(int, int)
+ int read_int2(int, int)
+ int read_int(int)
}
SimpleSymbolCoder "1" *-- "1" SymbolChance
SimpleSymbolCoder "1" *-- "1" SimpleBitChanceTable
SimpleSymbolCoder "1" o-- "1" RacInput24
SimpleSymbolBitCoder <. SimpleSymbolCoder : use
}
package compound {
class PropertyDecisionNode {
+ int8_t property
+ int16_t count
+ PropertyVal splitval
+ uint32_t childID
+ uint32_t leafID
}
class Tree
Tree "1" *-- "1..*" PropertyDecisionNode
class FinalCompoundSymbolChances {
+ SymbolChance realChances
}
FinalCompoundSymbolChances "1" *-- "1" SymbolChance
class FinalCompoundSymbolBitCoder {
- SimpleBitChanceTable table
- RacInput24 rac
- FinalCompoundSymbolChances chances
+ bool read(SymbolChanceBitType, int)
}
SymbolCoder <|.. FinalCompoundSymbolBitCoder
FinalCompoundSymbolBitCoder "1" o-- "1" SimpleBitChanceTable
FinalCompoundSymbolBitCoder "1" o-- "1" RacInput24
FinalCompoundSymbolBitCoder "1" o-- "1" FinalCompoundSymbolChances
class FinalCompoundSymbolCoder {
- RacInput24 rac
- SimpleBitChanceTable table
+ read_int(FinalCompoundSymbolChances, int, int)
+ read_int(FinalCompoundSymbolChances, int)
}
FinalCompoundSymbolCoder "1" o-- "1" RacInput24
FinalCompoundSymbolCoder "1" *-- "1" SimpleBitChanceTable
FinalCompoundSymbolBitCoder <. FinalCompoundSymbolCoder : use
class FinalPropertySymbolCoder {
- FinalCompoundSymbolCoder coder
- uint nb_properties
- vector<FinalCompoundSymbolChances> leaf_node
- Tree inner_node
- FinalCompoundSymbolChances find_leaf(Properties)
+ int read_int(Properties, int, int)
+ int read_int(Properties, int, int)
}
FinalPropertySymbolCoder "1" *-- "1" FinalCompoundSymbolCoder
FinalPropertySymbolCoder "1" *-- "1..*" FinalCompoundSymbolChances
FinalPropertySymbolCoder "1" o-- "1" Tree
}
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment