35. A method of encoding of syntactic elements of a data stream, wherein: before beginning of encoding of the data stream, cells of all context models are initialized with predefined values, so that each context model contains in each cell thereof data on a probability and a counter of a context occurrence number, a number of the cells stored in each context model is selected to be not less than a number of all possible states of context elements associated with a respective context model, and in the process of encoding of at least a portion of bits of the data stream: a group of context models is selected that comprises at least two context models of different size; values of at least two context elements associated the selected group of context models are calculated; selection of the cells in context models is carried out using values of the context elements associated with the respective context model; one context model is selected from the group of context models using values of individual counters of a context occurrence number stored in the selected cells; the data on the probability is extracted from the selected cell of the selected context model, which data is used for entropy encoding of a current bit of the data stream, and/or for selecting a mode of writing encoded bits into the data stream directly; data in the selected cell of the selected context model as well as in all the context models of the group of context models, which have a size greater than that of the selected context model, is updated; and a procedure of probability inheritance from the selected context model is carried out in respect of the selected cells of those context models of the group of context models for which predefined inheritance criteria are met.
48. The method of encoding according to claim 35 , wherein in the process of encoding at least one encoded syntactic element is binarized, and at least one context element is calculated using values of the syntactic elements encoded so far and/or values of the already encoded bits of a current syntactic element.